diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 58be0dfee0..b3afc985d6 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -20,6 +20,7 @@ (define-extern uint16 type) (define-extern uint32 type) (define-extern int8 type) +(define-extern int16 type) (define-extern int32 type) (define-extern int64 type) (define-extern uint8 type) @@ -2272,7 +2273,7 @@ (define-extern matrix-f-u-compose (function matrix vector vector matrix)) (define-extern matrix-f-r-compose (function matrix vector vector matrix)) (define-extern matrix-u-f-compose (function matrix vector vector matrix)) -(define-extern matrix-u-r-compose (function matrix vector vector vector matrix)) +(define-extern matrix-u-r-compose (function matrix vector vector matrix)) (define-extern matrix-r-f-compose (function matrix vector vector vector matrix)) (define-extern matrix-r-u-compose (function matrix vector vector vector matrix)) (define-extern matrix-f-compose (function matrix vector matrix)) @@ -11096,7 +11097,7 @@ (borrow-hold-count uint32 :offset-assert 696) (borrow-hold pair 3 :offset-assert 700) (cloth symbol :offset-assert 712) - (player-control-override symbol :offset-assert 716) + (player-control-override cpad-info :offset-assert 716) (player-control-mask uint32 :offset-assert 720) (gun-special-mode symbol :offset-assert 724) (airlock-command pair :offset-assert 728) @@ -13204,6 +13205,8 @@ (guard-transport 26) (kg-pickup 27) (bike-d 28) + (max 29) + (invalid0 -1) (invalid #xffffffff) ) ;; ---traffic-h:traffic-type @@ -13280,8 +13283,17 @@ ) ) +;; +++traffic-h:guard-type +(defenum guard-type + :type uint8 + (tazer 0) + (rifle 1) + (grenade 2) + ) +;; ---traffic-h:guard-type + (deftype traffic-object-spawn-params (structure) - ((object-type uint8 :offset-assert 0) ;; traffic-type + ((object-type traffic-type :offset-assert 0) ;; traffic-type (behavior uint64 :offset-assert 8) (id uint32 :offset-assert 16) (nav-mesh nav-mesh :offset-assert 20) ;; guessed by decompiler @@ -13290,10 +13302,10 @@ (rotation quaternion :inline :offset-assert 48) (velocity vector :inline :offset-assert 64) (handle handle :offset-assert 80) ;; handle - (handle-parent uint64 :offset-assert 88) + (handle-parent handle :offset-assert 88) (guard-type uint8 :offset-assert 96) (user-data uint32 :offset-assert 100) - (entity basic :offset-assert 104) + (entity entity :offset-assert 104) (flags traffic-spawn-flags :offset-assert 108) ;; guessed by decompiler (proc process :offset-assert 112) ;; guessed by decompiler ) @@ -21345,7 +21357,8 @@ ) (deftype part-tracker (process) - ((root trsqv :offset-assert 128) ;; guessed by decompiler + ((parent (pointer process) :override) + (root trsqv :offset-assert 128) ;; guessed by decompiler (mat matrix :inline :offset-assert 144) (offset vector :inline :offset-assert 208) (userdata uint64 :offset-assert 224) @@ -29125,7 +29138,7 @@ (update-from-spheres (_type_) none) ;; 28 (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none) ;; 29 (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol) ;; 30 - (add-sphere-with-mask-and-id (_type_ vector int int) symbol) ;; 31 + (add-sphere-with-mask-and-id (_type_ vector vector float int) symbol) ;; 31 (sphere-hash-method-32 (_type_ sphere int) symbol) ;; 32 ) ) @@ -29154,7 +29167,7 @@ (fill-actor-list-for-box (_type_ vector (pointer collide-shape) int) int) ;; 35 (fill-actor-list-for-sphere (_type_ vector vector float (pointer collide-shape) int int) int) ;; 36 (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int) ;; 37 - (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int) ;; 38 + (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape)) int) ;; 38 (spatial-hash-method-39 (_type_ object hash-object-info) int) ;; 39 ) ) @@ -29354,7 +29367,7 @@ (rigid-body-control-method-22 (_type_ vector vector) none) ;; 22 (rigid-body-control-method-23 (_type_ vector vector) none) ;; 23 (rigid-body-control-method-24 (_type_ vector vector) none) ;; 24 - (rigid-body-control-method-25 (_type_ vector) none) ;; 25 + (rigid-body-control-method-25 (_type_ vector) vector) ;; 25 (rigid-body-control-method-26 (_type_) none) ;; 26 (init! (_type_ rigid-body-info vector quaternion (function rigid-body-object float)) none) ;; 27 (rigid-body-control-method-28 (_type_ vector quaternion) none) ;; 28 @@ -29386,7 +29399,7 @@ active ;; 29 ) (:methods - (rigid-body-object-method-30 (_type_) none) ;; 30 + (rigid-body-object-method-30 (_type_) object) ;; 30 (apply-gravity! (_type_ float) none) ;; 31 (rigid-body-object-method-32 (_type_) none) ;; 32 (alloc-rbody-control! (_type_ rigid-body-object-constants) none) ;; 33 ;; (init-skel-and-rigid-body (_type_) none) @@ -30956,7 +30969,7 @@ (define-extern *darkjak-texture-anim-array* (texture-anim-array texture-anim)) (define-extern set-darkjak-texture-morph! (function float none)) (define-extern *darkjak-highres-texture-anim-array* (texture-anim-array texture-anim)) -;; (define-extern set-darkjak-highres-texture-morph! function) ;; (function float symbol) +(define-extern set-darkjak-highres-texture-morph! (function float symbol)) (define-extern *skull-gem-texture-anim-array* (texture-anim-array texture-anim)) (define-extern *default-water-texture-anim-array* (texture-anim-array texture-anim)) (define-extern *default-warp-texture-anim-array* (texture-anim-array texture-anim)) @@ -32249,18 +32262,18 @@ (define-extern init-mood-ctygenb (function mood-context object)) (define-extern update-mood-ctygenb (function mood-context float int none :behavior time-of-day-proc)) (define-extern *mhcity-mood-fog-table* mood-fog-table) -(define-extern overide-mhcity-fog function) +(define-extern overide-mhcity-fog (function mood-context float int none)) (define-extern init-mood-mhcitya (function mood-context object)) (define-extern update-mood-mhcitya (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-mhcityb (function mood-context object)) (define-extern update-mood-mhcityb (function mood-context float int none :behavior time-of-day-proc)) -(define-extern calc-lmhcity-palettes function) +(define-extern calc-lmhcity-palettes (function mood-context symbol)) (define-extern update-mood-lmhcitya (function mood-context float int none :behavior time-of-day-proc)) (define-extern update-mood-lmhcityb (function mood-context float int none :behavior time-of-day-proc)) -(define-extern *ctyport-level* level-group) +(define-extern *ctyport-level* level) (define-extern update-mood-ctyport (function mood-context float int none :behavior time-of-day-proc)) -(define-extern reset-marquee-color! function) -(define-extern add-marquee-color! function) +(define-extern reset-marquee-color! (function none)) +(define-extern add-marquee-color! (function float float float none)) (define-extern update-mood-ctymarka (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-mountain (function mood-context uint)) (define-extern update-mood-mountain (function mood-context float int none :behavior time-of-day-proc)) @@ -39993,13 +40006,13 @@ :size-assert #x4c :flag-assert #xb0000004c (:methods - (mysql-nav-node-method-9 () none) ;; 9 ;; (exec-sql! (_type_) symbol) - (mysql-nav-node-method-10 () none) ;; 10 ;; (temp-edge-size (_type_) int) + (exec-sql! (_type_) symbol) ;; 9 + (temp-edge-size (_type_) int) ;; 10 ) ) (deftype mysql-nav-node-array (inline-array-class) - ((data mysql-nav-node :dynamic :offset-assert 16) ;; guessed by decompiler + ((data mysql-nav-node :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 @@ -40145,22 +40158,22 @@ :size-assert #x428 :flag-assert #x1800000428 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type string) _type_) - (mysql-nav-graph-method-9 () none) ;; 9 ;; (init-from-sql! (_type_ string string) symbol) - (mysql-nav-graph-method-10 () none) ;; 10 ;; (exec-sql! (_type_) symbol) - (mysql-nav-graph-method-11 () none) ;; 11 ;; (indexof-nav-node (_type_ int) int) - (mysql-nav-graph-method-12 () none) ;; 12 ;; (indexof-nav-edge (_type_ int) int) - (mysql-nav-graph-method-13 () none) ;; 13 ;; (alloc-new-node! (_type_) int) - (mysql-nav-graph-method-14 () none) ;; 14 ;; (alloc-new-edge! (_type_) int) - (mysql-nav-graph-method-15 () none) ;; 15 ;; (indexof-visnode (_type_ int int) int) - (mysql-nav-graph-method-16 () none) ;; 16 ;; (alloc-new-visnode! (_type_ int int) int) - (mysql-nav-graph-method-17 () none) ;; 17 ;; (mysql-nav-graph-method-17 (_type_) none) - (mysql-nav-graph-method-18 () none) ;; 18 ;; (lookup-level-info2 (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info) - (mysql-nav-graph-method-19 () none) ;; 19 ;; (mysql-nav-graph-method-19 (_type_) none) - (mysql-nav-graph-method-20 () none) ;; 20 ;; (mysql-nav-graph-method-20 (_type_) none) - (mysql-nav-graph-method-21 () none) ;; 21 - (mysql-nav-graph-method-22 () none) ;; 22 - (mysql-nav-graph-method-23 () none) ;; 23 + (new (symbol type string) _type_) ;; 0 + (init-from-sql! (_type_ string string) symbol) ;; 9 + (exec-sql! (_type_) symbol) ;; 10 + (indexof-nav-node (_type_ int) int) ;; 11 + (indexof-nav-edge (_type_ int) int) ;; 12 + (mysql-nav-graph-method-13 (_type_) none) ;; 13 ;; (alloc-new-node! (_type_) int) + (mysql-nav-graph-method-14 (_type_) none) ;; 14 ;; (alloc-new-edge! (_type_) int) + (mysql-nav-graph-method-15 (_type_) none) ;; 15 ;; (indexof-visnode (_type_ int int) int) + (mysql-nav-graph-method-16 (_type_) none) ;; 16 ;; (alloc-new-visnode! (_type_ int int) int) + (mysql-nav-graph-method-17 (_type_) none) ;; 17 ;; (mysql-nav-graph-method-17 (_type_) none) + (lookup-level-info2 (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info) ;; 18 + (mysql-nav-graph-method-19 (_type_) none) ;; 19 ;; (mysql-nav-graph-method-19 (_type_) none) + (mysql-nav-graph-method-20 (_type_) none) ;; 20 ;; (mysql-nav-graph-method-20 (_type_) none) + (mysql-nav-graph-method-21 (_type_) none) ;; 21 + (mysql-nav-graph-method-22 (_type_) none) ;; 22 + (mysql-nav-graph-method-23 (_type_) none) ;; 23 ) ) @@ -40770,7 +40783,6 @@ ;; speech-manager ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype speech-instance (structure) ((speech uint16 :offset-assert 0) (num-play-times int8 :offset-assert 2) @@ -40780,24 +40792,37 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| +;; +++speech-manager:speech-info-flag +(defenum speech-info-flag + :type uint64 + :bitfield #t + (si0 0) + (si1 1) + (si2 2) + (si3 3) + (si4 4) + (si5 5) + (si6 6) + (si7 7) + (si8 8) + ) +;; ---speech-manager:speech-info-flag + (deftype speech-info (structure) - ((speeches basic :offset-assert 0) - (flags uint64 :offset-assert 8) - (play-time uint64 :offset-assert 16) + ((speeches (array speech-instance) :offset-assert 0) + (flags speech-info-flag :offset-assert 8) + (play-time time-frame :offset-assert 16) ) :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) -|# -;; (define-extern mark-speech-played function) -;; (define-extern speech-play function) -;; (define-extern speeches-reset function) -;; (define-extern speeches-debug-reset function) +(define-extern mark-speech-played (function speech-info int time-frame)) +(define-extern speech-play (function (array speech-info) int (inline-array talker-speech-class) vector int)) +(define-extern speeches-reset (function (array speech-info) symbol)) +(define-extern speeches-debug-reset (function (array speech-info) symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; texture-upload ;; @@ -41487,7 +41512,7 @@ (get-damage-from-attack (_type_ object event-message-block) float) ;; 62 (enemy-method-63 (_type_ float) float) ;; 63 (update-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware) ;; 64 - (penetrate->next-state (_type_) symbol) ;; 65 + (penetrate->next-state (_type_ process event-message-block float) symbol) ;; 65 (get-penetrated-by (_type_) penetrate) ;; 66 (coin-flip? (_type_) symbol) ;; 67 (get-enemy-aware (_type_ enemy-aware) enemy-aware) ;; 68 @@ -41648,6 +41673,8 @@ debug-control ;; 159 ) (:methods + (init-enemy-info! (_type_ nav-enemy-info) none :replace) ;; 118 + (init-enemy-defaults! (_type_ nav-enemy-info) object :replace) ;; 125 (normalize-heading! (_type_ nav-control) none) ;; 160 (nav-enemy-method-161 (_type_ nav-control) none) ;; 161 (nav-enemy-method-162 (_type_) none) ;; 162 @@ -41861,8 +41888,8 @@ smush ;; 22 ) (:methods - (bouncer-method-23 (_type_) none) ;; 23 ;; (init-skeleton! (_type_) none) - (bouncer-method-24 (_type_) none) ;; 24 ;; (bouncer-method-24 (_type_) none) + (init-skel! (_type_) none) ;; 23 + (init-collision! (_type_) none) ;; 24 (play-sound (_type_) none) ;; 25 (bouncer-method-26 (_type_) none) ;; 26 ) @@ -44700,18 +44727,18 @@ ;; ctysluma-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *range-color-rubble-flame* curve-color-fast) -;; (define-extern *range-alpha-rubble-flame* curve2d-fast) -;; (define-extern *range-scale-rubble-flame-x* curve2d-fast) -;; (define-extern *range-scale-rubble-flame-y* curve2d-fast) -;; (define-extern *r-curve-rubble-flame* curve2d-fast) -;; (define-extern *g-curve-rubble-flame* curve2d-fast) -;; (define-extern *b-curve-rubble-flame* curve2d-fast) -;; (define-extern *curve-alpha-rubble-flame* curve2d-fast) -;; (define-extern *curve-scale-rubble-flame-x* curve2d-fast) -;; (define-extern *curve-scale-rubble-flame-y* curve2d-fast) -;; (define-extern *part-ctyslum-rubble-fire-flame-curve-settings* object) -;; (define-extern check-drop-level-ctysluma-drop-userdata function) ;; (function sparticle-system sparticle-cpuinfo vector none) +(define-extern *range-color-rubble-flame* curve-color-fast) +(define-extern *range-alpha-rubble-flame* curve2d-fast) +(define-extern *range-scale-rubble-flame-x* curve2d-fast) +(define-extern *range-scale-rubble-flame-y* curve2d-fast) +(define-extern *r-curve-rubble-flame* curve2d-fast) +(define-extern *g-curve-rubble-flame* curve2d-fast) +(define-extern *b-curve-rubble-flame* curve2d-fast) +(define-extern *curve-alpha-rubble-flame* curve2d-fast) +(define-extern *curve-scale-rubble-flame-x* curve2d-fast) +(define-extern *curve-scale-rubble-flame-y* curve2d-fast) +(define-extern *part-ctyslum-rubble-fire-flame-curve-settings* particle-curve-settings) +(define-extern check-drop-level-ctysluma-drop-userdata (function sparticle-system sparticle-cpuinfo vector none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; neon-baron-part ;; @@ -46551,7 +46578,9 @@ ) (deftype bombbot-bomb (process-focusable) - ((explode-part sparticle-launch-control :offset-assert 208) + ((parent (pointer process-focusable) :override) + (root collide-shape-moving :override) + (explode-part sparticle-launch-control :offset-assert 208) (rot-axis vector :inline :offset-assert 224) (rot-angle float :offset-assert 240) (warning-glow-part sparticle-launch-control :offset-assert 244) @@ -46658,22 +46687,21 @@ drop-bombs ;; 193 ) (:methods - ; (bombbot-method-192 () none) ;; 192 (bombbot-method-194 (_type_) none) ;; 194 (bombbot-method-195 (_type_) none) ;; 195 - (bombbot-method-196 (_type_) none) ;; 196 + (bombbot-method-196 (_type_ vector) none) ;; 196 (bombbot-method-197 (_type_) none) ;; 197 (bombbot-method-198 (_type_) none) ;; 198 (bombbot-method-199 (_type_) none) ;; 199 - (bombbot-method-200 (_type_) none) ;; 200 - (bombbot-method-201 (_type_) none) ;; 201 + (toggle-cspec-deadly (_type_ symbol int) none) ;; 200 + (valid-target? (_type_ process-focusable) object) ;; 201 (bombbot-method-202 (_type_) none) ;; 202 (bombbot-method-203 (_type_) none) ;; 203 (bombbot-method-204 (_type_) none) ;; 204 (bombbot-method-205 (_type_) none) ;; 205 - (bombbot-method-206 (_type_) none) ;; 206 - (bombbot-method-207 (_type_) none) ;; 207 - (bombbot-method-208 (_type_) none) ;; 208 + (fire-shot (_type_ vector vector) (pointer projectile)) ;; 206 + (bombbot-method-207 (_type_) symbol) ;; 207 + (bombbot-method-208 (_type_ vector vector) vector) ;; 208 ) ) @@ -46729,7 +46757,6 @@ :size-assert #x600 :flag-assert #xd205800600 (:state-methods - hostile ;; 38 explode ;; 190 done ;; 209 ) @@ -46738,7 +46765,7 @@ (deftype task-manager-blow-barricade (task-manager) ((check-timer time-frame :offset-assert 240) (bombbot-h handle :offset-assert 248) - (actor-group uint32 :offset-assert 256) + (actor-group (pointer actor-group) :offset-assert 256) (actor-group-count int32 :offset-assert 260) (done? int32 :offset-assert 264) (minimap connection-minimap :offset-assert 268) @@ -46753,54 +46780,52 @@ ) ) -#| (deftype task-manager-port-fight (task-manager) - ((check-timer uint64 :offset-assert 236) - (bombbot-h UNKNOWN 4 :offset-assert 244) - (actor-group uint32 :offset-assert 276) - (actor-group-count int32 :offset-assert 280) - (done? int32 :offset-assert 284) - (minimap connection-minimap :offset-assert 288) - (min-time uint32 :offset-assert 292) - (hud-timer uint64 :offset-assert 196) - (intro-state int32 :offset-assert 308) - (intro-time uint64 :offset-assert 228) - (target-far-enough? basic :offset-assert 324) + ((check-timer time-frame :offset-assert 240) + (bombbot-h handle 4 :offset-assert 248) + (actor-group (pointer actor-group) :offset-assert 280) + (actor-group-count int32 :offset-assert 284) + (done? int32 :offset-assert 288) + (minimap connection-minimap :offset-assert 292) + (min-time uint32 :offset-assert 296) + ; (hud-timer handle :offset-assert 200) + (intro-state int32 :offset 312) + ; (intro-time time-frame :offset-assert 232) + (target-far-enough? symbol :offset 328) ) :method-count-assert 34 :size-assert #x14c :flag-assert #x2200d0014c - (:methods - (task-manager-port-fight-method-33 () none) ;; 33 - ) (:state-methods - wait ;; 14 fail-screen ;; 32 - active ;; 15 + ) + (:methods + (add-danger (_type_) none) ;; 33 ) ) -|# -;; (define-extern *bombbot-hint* object) -;; (define-extern *bombbot-hint-time* object) -;; (define-extern *bombbot-body-constants* object) ;; rigid-body-object-constants -;; (define-extern bombbot-bomb-handler function) -;; (define-extern *daxter-speech* object) -;; (define-extern bombbot-bomb-reaction function) -;; (define-extern bombbot-bomb-init-by-other function) -;; (define-extern *bombbot-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info -;; (define-extern *bombbot-ik-limb-setup* array) -;; (define-extern bombbot-do-spline function) ;; (function vector vector vector vector vector float vector) -;; (define-extern spawn-bombbot-projectile function) -;; (define-extern *bombbot-debris-params* debris-static-params) -;; (define-extern bombbot-callback function) ;; (function cspace transformq none) -;; (define-extern bombbot-head-callback function) ;; (function cspace transformq none) -;; (define-extern bombbot-gun-swivel-callback function) ;; (function cspace transformq none) -;; (define-extern bombbot-gun-callback function) ;; (function cspace transformq none) -;; (define-extern *bombbot-spring-setup* array) ;; (array spring-setup) -;; (define-extern bombbot-init-by-other function) ;; (function bombbot-spawn-params none :behavior bombbot) -;; (define-extern bombbot-player-init-by-other function) -;; (define-extern *blow-barricade-kg-squad-member-settings* object) +(declare-type kg-squad-member-settings structure) + +(define-extern *bombbot-hint* sound-id) +(define-extern *bombbot-hint-time* float) +(define-extern *bombbot-body-constants* rigid-body-object-constants) +(def-event-handler bombbot-bomb-handler bombbot-bomb) +(define-extern *daxter-speech* int) +(define-extern bombbot-bomb-reaction (function control-info collide-query vector vector collide-status)) +(define-extern bombbot-bomb-init-by-other (function vector vector object :behavior bombbot-bomb)) +(define-extern *bombbot-nav-enemy-info* nav-enemy-info) +(define-extern *bombbot-ik-limb-setup* (array ik-limb-setup)) +(define-extern bombbot-do-spline (function vector vector vector vector vector float vector)) +(define-extern spawn-bombbot-projectile (function bombbot vector vector float vector float (pointer bombbot-shot))) +(define-extern *bombbot-debris-params* debris-static-params) +(define-extern bombbot-callback (function cspace transformq none)) +(define-extern bombbot-head-callback (function cspace transformq none)) +(define-extern bombbot-gun-swivel-callback (function cspace transformq none)) +(define-extern bombbot-gun-callback (function cspace transformq none)) +(define-extern *bombbot-spring-setup* (array spring-setup)) +(define-extern bombbot-init-by-other (function bombbot-spawn-params none :behavior bombbot)) +(define-extern bombbot-player-init-by-other (function bombbot-spawn-params object :behavior bombbot-player)) +(define-extern *blow-barricade-kg-squad-member-settings* (inline-array kg-squad-member-settings)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wasdoors-init ;; @@ -46836,123 +46861,30 @@ (define-extern spt-birth-func-brightness-buggy-wasdoors-dirt (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) (define-extern spt-birth-func-part-wasdoors-buggy-skid-bits (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; h-torpedo ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -#| -(deftype htorpedo (h-bike-c) - ((speed float :offset-assert 1296) - (target-speed float :offset-assert 1300) - (pitch float :offset-assert 1304) - (target-pitch float :offset-assert 1308) - (max-pitch float :offset-assert 1312) - (roll float :offset-assert 1316) - (target-roll float :offset-assert 1320) - (turn-rate float :offset-assert 1324) - (target-turn-rate float :offset-assert 1328) - (ground-height float :offset-assert 1332) - (ground-offset float :offset-assert 1336) - (down-force float :offset-assert 1340) - (want-jump? basic :offset-assert 1344) - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (jump-state uint8 :offset-assert 1360) - (on-water? basic :offset-assert 1364) - (cam-pitch float :offset-assert 1368) - (cam-roll float :offset-assert 1372) - (target-cam-roll float :offset-assert 1376) - (based-cam-roll float :offset-assert 1380) - (last-quat quaternion :inline :offset-assert 1392) - (override-camera? basic :offset-assert 1408) - (under-water? basic :offset-assert 1412) - (next-bob-cam-time uint64 :offset-assert 1416) - (thrust-sound uint32 :offset-assert 1424) - (ground-sound uint32 :offset-assert 1428) - (reverb-dest float :offset-assert 1432) - (pitch-current float :offset-assert 1436) - (ground-vol-current float :offset-assert 1440) - (last-slice-val float :offset-assert 1444) - (evasive-sound uint32 :offset-assert 1448) - (evasive-volume float :offset-assert 1452) - (stopping-evasive? basic :offset-assert 1456) - (spawn-splash? basic :offset-assert 1460) - (wake-sound uint32 :offset-assert 1464) - (heat-haze basic :offset-assert 1468) - (last-land-speech-time uint64 :offset-assert 1472) - (last-jump-speech-time uint64 :offset-assert 1480) - ) - :method-count-assert 171 - :size-assert #x5d0 - :flag-assert #xab055005d0 - (:methods - (htorpedo-method-162 () none) ;; 162 - (htorpedo-method-164 () none) ;; 164 - (htorpedo-method-165 () none) ;; 165 - (htorpedo-method-166 () none) ;; 166 - (htorpedo-method-167 () none) ;; 167 - (htorpedo-method-168 () none) ;; 168 - (htorpedo-method-169 () none) ;; 169 - (htorpedo-method-170 () none) ;; 170 - ) - (:state-methods - explode ;; 60 - player-control ;; 58 - hide ;; 163 - waiting ;; 57 - ) - ) -|# - -#| -(deftype light-trail-tracker-torpedo (light-trail-tracker) - () - :method-count-assert 21 - :size-assert #xac - :flag-assert #x15003000ac - ) -|# - -;; (define-extern *growing-curve-torpedo* object) -;; (define-extern *water-simple-alpha-curve-fade-out-torpedo* object) -;; (define-extern *color-curve-tan-brown-torpedo* object) -;; (define-extern *water-simple-alpha-curve-in-torpedo* object) -;; (define-extern *torpedo-wake-trail* object) -;; (define-extern spt-func-nuke-water-splash function) -;; (define-extern *range-torp-explo-color* curve-color-fast) -;; (define-extern *range-torp-explo-alpha* curve2d-fast) -;; (define-extern *range-torp-explo-scale-x* curve2d-fast) -;; (define-extern *range-torp-explo-scale-y* curve2d-fast) -;; (define-extern *curve-torp-explo-alpha* curve2d-fast) -;; (define-extern *curve-torp-explo-scale-x* curve2d-fast) -;; (define-extern *curve-torp-explo-scale-y* curve2d-fast) -;; (define-extern *part-torpedo-explosion-texture-curve-settings* object) -;; (define-extern PHYSICS_SCALAR object) -;; (define-extern *torpedo-speech-list* object) -;; (define-extern *torpedo-jump-speech* array) -;; (define-extern *torpedo-land-speech* array) -;; (define-extern *h-torpedo-constants* object) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyport-attack ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype port-attack-speech-instance (speech-instance) () :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| +;; +++ctyport-attack:mine-type +(defenum mine-type + :type uint64 + ) +;; ---ctyport-attack:mine-type + (deftype ctyport-mine-layout (structure) - ((mine-type uint64 :offset-assert 0) + ((mine-type mine-type :offset-assert 0) (num-mines int8 :offset-assert 8) - (inout? basic :offset-assert 12) - (spin? basic :offset-assert 16) - (active? basic :offset-assert 20) - (checked-this-frame? basic :offset-assert 24) + (inout? symbol :offset-assert 12) + (spin? symbol :offset-assert 16) + (active? symbol :offset-assert 20) + (checked-this-frame? symbol :offset-assert 24) (origin vector :inline :offset-assert 32) (secondary-pos vector :inline :offset-assert 48) (initial-angle float :offset-assert 64) @@ -46960,120 +46892,110 @@ (spinrate float :offset-assert 72) (period float :offset-assert 76) (offset float :offset-assert 80) - (stored-handles uint32 :offset-assert 84) + (stored-handles (pointer handle) :offset-assert 84) ) :method-count-assert 9 :size-assert #x58 :flag-assert #x900000058 ) -|# -#| (deftype ctyport-attack-package-info (structure) ((pos vector :inline :offset-assert 0) - (locked? basic :offset-assert 16) - (on-water? basic :offset-assert 20) - (probe? basic :offset-assert 24) + (locked? symbol :offset-assert 16) + (on-water? symbol :offset-assert 20) + (probe? symbol :offset-assert 24) ) :method-count-assert 9 :size-assert #x1c :flag-assert #x90000001c ) -|# -#| (deftype ctyport-attack-hud (hud) ((pos-tt float :offset-assert 2756) (tt-current float :offset-assert 2760) (tt-prev float :offset-assert 2764) (tt-next float :offset-assert 2768) - (spike-time uint64 :offset-assert 2776) + (spike-time time-frame :offset-assert 2776) ) :method-count-assert 27 :size-assert #xae0 :flag-assert #x1b0a600ae0 ) -|# -#| +(declare-type handle-array inline-array-class-uint64) + (deftype ctyport-attack-manager (task-manager) - ((active-torpedo uint64 :offset-assert 240) - (inactive-mine-list basic :offset-assert 248) - (mine-clock uint64 :offset-assert 256) + ((active-torpedo handle :offset-assert 240) + (inactive-mine-list handle-array :offset-assert 248) + (mine-clock time-frame :offset-assert 256) (current-package-index int16 :offset-assert 264) - (rod-of-god uint64 :offset-assert 272) - (wall-h uint64 :offset-assert 280) - (passed-cutscene-trigger? basic :offset-assert 288) - (finish-type basic :offset-assert 292) - (mine-layout basic :offset-assert 296) - (package-positions basic :offset-assert 300) - (h-hud uint64 :offset-assert 304) + (rod-of-god handle :offset-assert 272) + (wall-h handle :offset-assert 280) + (passed-cutscene-trigger? symbol :offset-assert 288) + (finish-type (array type) :offset-assert 292) + (mine-layout (array ctyport-mine-layout) :offset-assert 296) + (package-positions (array ctyport-attack-package-info) :offset-assert 300) + (h-hud handle :offset-assert 304) ) :method-count-assert 52 :size-assert #x138 :flag-assert #x3400c00138 - (:methods - (ctyport-attack-manager-method-34 () none) ;; 34 - (ctyport-attack-manager-method-42 () none) ;; 42 - (ctyport-attack-manager-method-43 () none) ;; 43 - (ctyport-attack-manager-method-44 () none) ;; 44 - (ctyport-attack-manager-method-45 () none) ;; 45 - (ctyport-attack-manager-method-46 () none) ;; 46 - (ctyport-attack-manager-method-47 () none) ;; 47 - (ctyport-attack-manager-method-48 () none) ;; 48 - (ctyport-attack-manager-method-49 () none) ;; 49 - (ctyport-attack-manager-method-50 () none) ;; 50 - (ctyport-attack-manager-method-51 () none) ;; 51 - ) (:state-methods - play-get-on-movie ;; 41 - get-on-nuke ;; 39 - start-mission ;; 38 pickup-nukes ;; 32 head-to-wall ;; 33 + undefined0 ;; 34 watch-approach ;; 35 nuke-wall ;; 36 wait-for-cleanup ;; 37 + start-mission ;; 38 + get-on-nuke ;; 39 exit-naughty-ottsel ;; 40 - wait ;; 14 + play-get-on-movie ;; 41 + ) + (:methods + (ctyport-attack-manager-method-42 (_type_ ctyport-mine-layout) symbol) ;; 42 + (ctyport-attack-manager-method-43 (_type_ ctyport-mine-layout) symbol) ;; 43 + (ctyport-attack-manager-method-44 (_type_ ctyport-mine-layout) symbol) ;; 44 + (ctyport-attack-manager-method-45 (_type_) handle) ;; 45 + (ctyport-attack-manager-method-46 (_type_) float) ;; 46 + (hit-cutscene-trigger? (_type_) symbol) ;; 47 + (ctyport-attack-manager-method-48 (_type_ int) object) ;; 48 + (ctyport-attack-manager-method-49 (_type_) int) ;; 49 + (play-speech (_type_ int) int) ;; 50 + (ctyport-attack-manager-method-51 (_type_ traffic-object-spawn-params) object) ;; 51 ) ) -|# -#| (deftype ctyport-mine (process-drawable) - ((bob-scalar float :offset-assert 200) - (last-play-time uint64 :offset-assert 208) + ((root collide-shape :override) + (bob-scalar float :offset-assert 200) + (last-play-time time-frame :offset-assert 208) ) :method-count-assert 24 :size-assert #xd8 :flag-assert #x18006000d8 - (:methods - (ctyport-mine-method-23 () none) ;; 23 ;; (ctyport-mine-method-23 (_type_) none) - ) (:state-methods - menacing ;; 22, old: (fall () _type_ :state) - idle ;; 21, old: (die () _type_ :state) - hidden ;; 20, old: (idle () _type_ :state) + hidden ;; 20 + idle ;; 21 + menacing ;; 22 + ) + (:methods + (update (_type_ float) float) ;; 23 ) ) -|# -#| (deftype ctyport-attack-package (process-drawable) - ((hum-sound uint32 :offset-assert 200) + ((hum-sound sound-id :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc (:state-methods - die ;; 21 idle ;; 20 + die ;; 21 ) ) -|# -#| (deftype cty-dax-missile-launcher (process-drawable) () :method-count-assert 21 @@ -47083,64 +47005,59 @@ idle ;; 20 ) ) -|# -;; (define-extern *ctyport-attack-speech-list* object) -;; (define-extern *port-attack-speech* array) -;; (define-extern *port-attack-dead-pool* object) -;; (define-extern ctyport-attack-manager-event-handler function) -;; (define-extern classify-mine-layout function) -;; (define-extern *recorded-pos* object) -;; (define-extern *recorded-length* object) -;; (define-extern record-pos function) -;; (define-extern print-record-pos function) -;; (define-extern *ctyport-mine-positions* array) -;; (define-extern *ctyport-package-positions* array) -;; (define-extern *ctyport-barrier-pos* object) -;; (define-extern get-ctyport-attack-death-count function) -;; (define-extern ctyport-mine-init-by-other function) ;; (function city-port-run-mine-info none :behavior ctyport-mine) -;; (define-extern ctyport-attack-package-init-by-other function) -;; (define-extern ctyport-attack-setup function) -;; (define-extern *cutscene-trigger-plane-normal* object) -;; (define-extern *cutscene-trigger-plane-pt* object) -;; (define-extern *approach-camera-pt* object) -;; (define-extern *approach-camera-matrix* object) -;; (define-extern *port-attack-fail-sphere* object) -;; (define-extern *port-attack-fail-radius* object) -;; (define-extern copy-record-pos function) -;; (define-extern print-record-pos-2 function) -;; (define-extern lctypatk-login function) -;; (define-extern lctypatk-logout function) -;; (define-extern *hud-boost-curve* curve2d-fast) +(define-extern *ctyport-attack-speech-list* (inline-array talker-speech-class)) +(define-extern *port-attack-speech* (array speech-info)) +(define-extern *port-attack-dead-pool* dead-pool) +(def-event-handler ctyport-attack-manager-event-handler ctyport-attack-manager) +(define-extern classify-mine-layout (function int)) +(define-extern *recorded-pos* (inline-array vector)) +(define-extern *recorded-length* int) +(define-extern record-pos (function none)) +(define-extern print-record-pos (function none)) +(define-extern *ctyport-mine-positions* (array ctyport-mine-layout)) +(define-extern *ctyport-package-positions* (array ctyport-attack-package-info)) +(define-extern *ctyport-barrier-pos* vector) +(define-extern get-ctyport-attack-death-count (function int)) +(define-extern ctyport-mine-init-by-other (function object :behavior ctyport-mine)) +(define-extern ctyport-attack-package-init-by-other (function vector object :behavior ctyport-attack-package)) +(define-extern ctyport-attack-setup (function none :behavior ctyport-attack-manager)) +(define-extern *cutscene-trigger-plane-normal* vector) +(define-extern *cutscene-trigger-plane-pt* vector) +(define-extern *approach-camera-pt* vector) +(define-extern *approach-camera-matrix* matrix) +(define-extern *port-attack-fail-sphere* sphere) +(define-extern *port-attack-fail-radius* float) +(define-extern copy-record-pos (function symbol)) +(define-extern print-record-pos-2 (function symbol)) +(define-extern lctypatk-login (function level none)) +(define-extern lctypatk-logout (function level none)) +(define-extern *hud-boost-curve* curve2d-fast) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyport-attack-bbush ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ctyport-attack-manager-bbush (ctyport-attack-manager) - ((actor-group uint32 :offset-assert 308) - (actor-group-count int32 :offset-assert 312) - (clock-speed float :offset-assert 316) - (hud-timer uint64 :offset-assert 196) - (countdown-timer uint64 :offset-assert 332) + ((actor-group (pointer actor-group) :offset-assert 312) + (actor-group-count int32 :offset-assert 316) + (clock-speed float :offset-assert 320) + (countdown-timer handle :offset 336) ) :method-count-assert 53 :size-assert #x158 :flag-assert #x3500e00158 (:state-methods - wait-award ;; 52 - head-to-wall ;; 33 pickup-nukes ;; 32 - wait ;; 14 + head-to-wall ;; 33 + wait-award ;; 52 ) ) -|# -;; (define-extern *ctyport-attack-bbush-positions* object) -;; (define-extern *ctyport-bbush-mine-positions* array) -;; (define-extern *port-attack-bbush-fail-sphere* object) -;; (define-extern *port-attack-bbush-fail-radius* object) +(define-extern *ctyport-attack-bbush-positions* (array ctyport-attack-package-info)) +(define-extern *ctyport-bbush-mine-positions* (array ctyport-mine-layout)) +(define-extern *port-attack-bbush-fail-sphere* sphere) +(define-extern *port-attack-bbush-fail-radius* float) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-turret-shot ;; @@ -48060,24 +47977,24 @@ (max-user-count uint8 :offset-assert 12) (user-count uint8 :offset-assert 13) (width uint8 :offset-assert 14) - (flags uint8 :offset-assert 15) ;; nav-branch-flags + (flags nav-branch-flags :offset-assert 15) ;; nav-branch-flags ) :method-count-assert 21 :size-assert #x10 :flag-assert #x1500000010 (:methods - (nav-branch-method-9 () none) ;; 9 ;; (set-default-density-speed-and-width (_type_) none) - (nav-branch-method-10 () none) ;; 10 ;; (debug-print (_type_ object int) none) + (set-default-density-speed-and-width (_type_) none) ;; 9 + (debug-print (_type_ object int) none) ;; 10 (get-density (_type_) float) ;; 11 (get-speed-limit (_type_) float) ;; 12 (get-width (_type_) float) ;; 13 (user-limit-reached? (_type_) symbol) ;; 14 (dest-node-id-at-max? (_type_) symbol) ;; 15 - (nav-branch-method-16 () none) ;; 16 ;; (set-density (_type_ float) none) - (nav-branch-method-17 () none) ;; 17 ;; (set-speed-limit (_type_ float) none) - (nav-branch-method-18 () none) ;; 18 ;; (set-width (_type_ float) none) - (nav-branch-method-19 () none) ;; 19 ;; (set-src-node (_type_ nav-node) none) - (nav-branch-method-20 () none) ;; 20 ;; (set-dst-node (_type_ nav-node) none) + (set-density (_type_ float) none) ;; 16 + (set-speed-limit (_type_ float) none) ;; 17 + (set-width (_type_ float) none) ;; 18 + (set-src-node (_type_ nav-node) none) ;; 19 + (set-dst-node (_type_ nav-node) none) ;; 20 ) ) @@ -48115,15 +48032,15 @@ :flag-assert #x1600000020 ;; field nav-node-flag is likely a value type. (:methods - (nav-node-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) - (nav-node-method-10 () none) ;; 10 ;; (debug-print (_type_ symbol string) none) - (nav-node-method-11 () none) ;; 11 ;; (remove-branch-by-idx (_type_ int) none) - (nav-node-method-12 () none) ;; 12 ;; (init-from-pt-and-heading (_type_ vector vector) none) - (nav-node-method-13 () none) ;; 13 ;; (set-pos-xyz (_type_ vector) none) - (nav-node-method-14 () none) ;; 14 ;; (set-angle-from-heading (_type_ vector) none) - (nav-node-method-15 () none) ;; 15 ;; (set-id-and-link-branches-back (_type_ uint) none) - (nav-node-method-16 () none) ;; 16 ;; (set-radius (_type_ float) none) - (nav-node-method-17 () none) ;; 17 ;; (set-angle (_type_ float) none) + (debug-draw (_type_) none) ;; 9 + (debug-print (_type_ symbol string) none) ;; 10 + (remove-branch-by-idx (_type_ int) none) ;; 11 + (init-from-pt-and-heading (_type_ vector vector) none) ;; 12 + (set-pos-xyz (_type_ vector) none) ;; 13 + (set-angle-from-heading (_type_ vector) none) ;; 14 + (set-id-and-link-branches-back (_type_ uint) none) ;; 15 + (set-radius (_type_ float) none) ;; 16 + (set-angle (_type_ float) none) ;; 17 (get-position (_type_ vector) vector) ;; 18 (calc-sine-and-cosine! (_type_ vector) vector) ;; 19 (get-angle (_type_) float) ;; 20 @@ -48162,43 +48079,43 @@ :size-assert #x3c :flag-assert #x2d0000003c (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type int int int uint) _type_) - (nav-graph-method-9 () none) ;; 9 ;; (debug-draw-nodes (_type_) none) - (nav-graph-method-10 () none) ;; 10 ;; (nav-graph-method-10 (_type_ vector int) none) - (nav-graph-method-11 () none) ;; 11 - (nav-graph-method-12 () none) ;; 12 - (nav-graph-method-13 () none) ;; 13 - (nav-graph-method-14 () none) ;; 14 - (nav-graph-method-15 () none) ;; 15 ;; (debug-reset (_type_) none) - (nav-graph-method-16 () none) ;; 16 ;; (debug-add-node (_type_ int) nav-node) - (nav-graph-method-17 () none) ;; 17 ;; (debug-link-node-to-graph (_type_ nav-node) none) - (nav-graph-method-18 () none) ;; 18 ;; (debug-reset-branch-array (_type_ nav-node int) none) - (nav-graph-method-19 () none) ;; 19 ;; (nav-graph-method-19 (_type_ int int int int int int) none) - (nav-graph-method-20 () none) ;; 20 ;; (nav-graph-method-20 (_type_ int int) none) - (nav-graph-method-21 () none) ;; 21 ;; (move-selected-to-height-map-height (_type_) none) - (nav-graph-method-22 () none) ;; 22 ;; (select-nodes-in-range (_type_ int int) none) - (nav-graph-method-23 () none) ;; 23 ;; (deselect-nodes-in-range (_type_ int int) none) - (nav-graph-method-24 () none) ;; 24 ;; (toggle-select-nodes-in-range (_type_ int int) none) - (nav-graph-method-25 () none) ;; 25 ;; (select-nodes-in-level (_type_ symbol symbol) none) - (nav-graph-method-26 () none) ;; 26 ;; (select-nodes-by-nav-mesh-id (_type_ int symbol) none) - (nav-graph-method-27 () none) ;; 27 ;; (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none) - (nav-graph-method-28 () none) ;; 28 ;; (print-selected-nodes (_type_) none) - (nav-graph-method-29 () none) ;; 29 ;; (assign-selected-nodes-to-level (_type_ symbol) none) - (nav-graph-method-30 () none) ;; 30 ;; (assign-selected-nodes-to-nav-mesh (_type_ uint) none) - (nav-graph-method-31 () none) ;; 31 ;; (set-radius-of-selected-nodes (_type_ float) none) - (nav-graph-method-32 () none) ;; 32 ;; (set-speed-limit-of-selected (_type_ float) none) - (nav-graph-method-33 () none) ;; 33 ;; (set-density-of-selected (_type_ float) none) - (nav-graph-method-34 () none) ;; 34 ;; (set-width-of-selected (_type_ float) none) - (nav-graph-method-35 () none) ;; 35 ;; (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) - (nav-graph-method-36 () none) ;; 36 ;; (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) - (nav-graph-method-37 () none) ;; 37 ;; (offset-pos-of-selected (_type_ vector) none) - (nav-graph-method-38 () none) ;; 38 ;; (nav-graph-method-38 (_type_) none) - (nav-graph-method-39 () none) ;; 39 ;; (nav-graph-method-39 (_type_) none) - (nav-graph-method-40 () none) ;; 40 ;; (nav-graph-method-40 (_type_ int) int) + (new (symbol type int int int uint) _type_) ;; 0 + (debug-draw-nodes (_type_) none) ;; 9 + (find-nearest-nav-node (_type_ vector symbol) nav-node) ;; 10 + (print-nav-graph (_type_) none) ;; 11 + (set-first-node (_type_) none) ;; 12 + (nav-graph-method-13 (_type_ int int) none) ;; 13 + (nav-graph-method-14 (_type_ int int) none) ;; 14 + (reset! (_type_) none) ;; 15 + (add-node (_type_ int) nav-node) ;; 16 + (link-node-to-graph (_type_ nav-node) none) ;; 17 + (reset-branch-array (_type_ nav-node int) none) ;; 18 + (nav-graph-method-19 (_type_ int int int int int int) none) ;; 19 + (nav-graph-method-20 (_type_ int int) none) ;; 20 + (move-selected-to-height-map-height (_type_) none) ;; 21 + (select-nodes-in-range (_type_ int int) none) ;; 22 + (deselect-nodes-in-range (_type_ int int) none) ;; 23 + (toggle-select-nodes-in-range (_type_ int int) none) ;; 24 + (select-nodes-in-level (_type_ symbol symbol) none) ;; 25 + (select-nodes-by-nav-mesh-id (_type_ int symbol) none) ;; 26 + (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none) ;; 27 + (print-selected-nodes (_type_) none) ;; 28 + (assign-selected-nodes-to-level (_type_ symbol) none) ;; 29 + (assign-selected-nodes-to-nav-mesh (_type_ uint) none) ;; 30 + (set-radius-of-selected-nodes (_type_ float) none) ;; 31 + (set-speed-limit-of-selected (_type_ float) none) ;; 32 + (set-density-of-selected (_type_ float) none) ;; 33 + (set-width-of-selected (_type_ float) none) ;; 34 + (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) ;; 35 + (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) ;; 36 + (offset-pos-of-selected (_type_ vector) none) ;; 37 + (nav-graph-method-38 (_type_) none) ;; 38 + (nav-graph-method-39 (_type_) none) ;; 39 + (nav-graph-method-40 (_type_ int) int) ;; 40 (node-at-idx (_type_ int) nav-node) ;; 41 - (nav-graph-method-42 () none) ;; 42 ;; (patch-nodes (_type_) none) - (nav-graph-method-43 () none) ;; 43 ;; (copy-to-mysql-graph (_type_ mysql-nav-graph string) none) - (nav-graph-method-44 () none) ;; 44 ;; (from-editor (_type_ mysql-nav-graph symbol) none) + (patch-nodes (_type_) none) ;; 42 + (copy-to-mysql-graph (_type_ mysql-nav-graph string) none) ;; 43 + (from-editor (_type_ mysql-nav-graph symbol) none) ;; 44 ) ) @@ -48272,6 +48189,7 @@ (mh-guard int8 :offset 4) (mh-ped int8 :offset 5) ) + :allow-misaligned :method-count-assert 9 :size-assert #x6 :flag-assert #x900000006 @@ -48283,7 +48201,7 @@ (kg-strength int8 :offset 1) (mh-strength int8 :offset 2) ) - :pack-me + :allow-misaligned :method-count-assert 9 :size-assert #x3 :flag-assert #x900000003 @@ -48295,26 +48213,34 @@ (kg-mode uint8 :offset 1) (mh-mode uint8 :offset 2) ) + :allow-misaligned :method-count-assert 9 :size-assert #x3 :flag-assert #x900000003 ) (deftype territory-faction-flag (structure) - ((data int8 3 :offset-assert 0 :score -1) + ((data uint8 3 :offset-assert 0 :score -1) (ff-mode uint8 :offset 0) (kg-mode uint8 :offset 1) (mh-mode uint8 :offset 2) ) + :pack-me :method-count-assert 9 :size-assert #x3 :flag-assert #x900000003 ) +;; +++cty-faction-h:faction-spawn-flag (defenum faction-spawn-flag :type uint8 :bitfield #t + (fs0 0) + (fs1 1) + (fs2 2) + (fs3 3) ) +;; ---cty-faction-h:faction-spawn-flag (deftype faction-spawn-info (structure) ((faction-type uint8 :offset-assert 0) @@ -48322,61 +48248,111 @@ (requested-level uint8 :offset-assert 2) (flags faction-spawn-flag :offset-assert 3) ) - :pack-me + :allow-misaligned :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) +;; +++cty-faction-h:cty-faction-update-flag (defenum cty-faction-update-flag :type uint8 :bitfield #t + (cfu0 0) ) +;; ---cty-faction-h:cty-faction-update-flag + +;; +++cty-faction-h:cty-faction-level +(defenum cty-faction-level + (pesc 0) + (pesb 1) + (pesa 2) + (pepa 3) + (car 4) + (pepc 5) + (pepb 6) + ) +;; ---cty-faction-h:cty-faction-level + +;; +++cty-faction-h:nav-territory-type +(defenum nav-territory-type + :type uint8 + (port-ff-deep 0) + (port-ff-near-kg 1) + (port-ff-kg-border 2) + (inda-kg-ff-border 3) + (inda-kg 4) + (inda-kg-deep 5) + (indb-kg-deep 6) + (indb-kg 7) + (indb-kg-ff-border 8) + (sluma-ff-kg-border 9) + (sluma-ff 10) + (sluma-ff-deep 11) + (slumb-ff-deep 12) + (slumc-ff-deep 13) + (genc-border 14) + (genc 15) + (port-ff-near-mh 16) + (port-ff-mh-border 17) + (mhcity-mh-ff-border 18) + (mhcity-mh 19) + (mhcity-mh-deep 20) + (special0 21) + (special1 22) + (special2 23) + (special3 24) + (special4 25) + (special5 26) + (special6 27) + (special7 28) + (special8 29) + (invalid 128) + ) +;; ---cty-faction-h:nav-territory-type -#| (deftype cty-faction-manager (basic) - ((faction-array faction-spawn-info 30 :inline :offset-assert 4) + ((faction-array cty-faction-info 30 :offset-assert 4) (faction-mod-array cty-faction-info 30 :inline :offset-assert 124) (global-faction-strength-mod cty-faction-strength :inline :offset-assert 604) (territory-faction-strength-mod cty-faction-strength 4 :inline :offset-assert 607) - (permission-cache int8 30 :offset-assert 671) + (permission-cache uint8 30 :offset 671) (last-requested-level symbol :offset-assert 704) (territory-faction-modes territory-faction-mode 30 :inline :offset-assert 708) - (territory-flags territory-faction-flag 30 :inline :offset-assert 1188) + (territory-flags uint8 30 :offset-assert 1188) (last-active-territories uint32 :offset-assert 1220) (update-flags cty-faction-update-flag :offset-assert 1224) (target-exclusive-branch-index uint8 :offset-assert 1225) (territory-faction-flags territory-faction-flag :inline :offset-assert 1226) (faction-spawn faction-spawn-info 7 :inline :offset-assert 1229) - (last-change-music-time time-frame :offset-assert 1344) + (last-change-music-time time-frame :offset 1344) (start-fight-music-time time-frame :offset-assert 1352) ) :method-count-assert 26 :size-assert #x550 :flag-assert #x1a00000550 (:methods - (cty-faction-manager-method-9 () none) ;; 9 - (cty-faction-manager-method-10 () none) ;; 10 - (cty-faction-manager-method-11 () none) ;; 11 - (cty-faction-manager-method-12 () none) ;; 12 - (cty-faction-manager-method-13 () none) ;; 13 - (cty-faction-manager-method-14 () none) ;; 14 - (cty-faction-manager-method-15 () none) ;; 15 - (cty-faction-manager-method-16 () none) ;; 16 - (cty-faction-manager-method-17 () none) ;; 17 - (cty-faction-manager-method-18 () none) ;; 18 - (cty-faction-manager-method-19 () none) ;; 19 - (cty-faction-manager-method-20 () none) ;; 20 - (cty-faction-manager-method-21 () none) ;; 21 - (cty-faction-manager-method-22 () none) ;; 22 - (cty-faction-manager-method-23 () none) ;; 23 - (cty-faction-manager-method-24 () none) ;; 24 - (cty-faction-manager-method-25 () none) ;; 25 + (cty-faction-manager-method-9 (_type_ int symbol) int) ;; 9 + (cty-faction-manager-method-10 (_type_ int symbol) int) ;; 10 + (cty-faction-manager-method-11 (_type_ int) uint) ;; 11 + (cty-faction-manager-method-12 (_type_ int int) int) ;; 12 + (cty-faction-manager-method-13 (_type_) symbol) ;; 13 + (cty-faction-manager-method-14 (_type_ nav-territory-type int int) int) ;; 14 + (restore-defaults (_type_) cty-faction-update-flag) ;; 15 + (cty-faction-manager-method-16 (_type_ nav-territory-type) int) ;; 16 + (cty-faction-manager-method-17 (_type_ symbol) int) ;; 17 + (cty-faction-manager-method-18 (_type_ symbol) int) ;; 18 + (cty-faction-manager-method-19 (_type_) symbol) ;; 19 + (cty-faction-manager-method-20 (_type_ uint) int) ;; 20 + (cty-faction-manager-method-21 (_type_ int) symbol) ;; 21 + (cty-faction-manager-method-22 (_type_) cty-faction-update-flag) ;; 22 + (cty-faction-manager-method-23 (_type_ uint) symbol) ;; 23 + (cty-faction-manager-method-24 (_type_) symbol) ;; 24 + (faction-spawn (_type_ int int symbol symbol) faction-spawn-flag) ;; 25 ) ) -|# -(define-extern *cty-faction-manager* symbol) +(define-extern *cty-faction-manager* cty-faction-manager) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; traffic-engine-h ;; @@ -48426,8 +48402,8 @@ :flag-assert #xb00000020 ;; field vis-cell-flag is likely a value type. field vis-cell-flag is likely a value type. (:methods - (vis-cell-method-9 () none) ;; 9 ;; (reset-segment-counts (_type_) none) - (vis-cell-method-10 () none) ;; 10 ;; (debug-draw (_type_) none) + (reset-segment-counts (_type_) none) ;; 9 + (debug-draw (_type_) none) ;; 10 ) ) @@ -48477,9 +48453,9 @@ :size-assert #x40 :flag-assert #xe00000040 (:methods - (grid-info-method-9 () none) ;; 9 ;; (setup-grid-from-bounding-box (_type_ (pointer bounding-box) int int) none) - (grid-info-method-10 () none) ;; 10 ;; (lookup-cell-for-point (_type_ vis-grid-pos vector) none) - (grid-info-method-11 () none) ;; 11 ;; (lookup-box-for-sphere (_type_ vis-grid-box vector) none) + (setup-grid-from-bounding-box (_type_ (pointer bounding-box) int int) none) ;; 9 + (lookup-cell-for-point (_type_ vis-grid-pos vector) none) ;; 10 + (lookup-box-for-sphere (_type_ vis-grid-box vector) none) ;; 11 (debug-draw-grid (_type_ rgba) none) ;; 12 (debug-draw-cell (_type_ vis-grid-pos rgba) none) ;; 13 ) @@ -48501,16 +48477,16 @@ :size-assert #x8c :flag-assert #x130000008c (:methods - (city-level-info-method-9 () none) ;; 9 ;; (city-level-info-method-9 (_type_) symbol) - (city-level-info-method-10 () none) ;; 10 ;; (init-vis-ray (_type_ vis-ray vector vector) none) - (city-level-info-method-11 () none) ;; 11 ;; (city-level-info-method-11 (_type_ vis-ray) none) - (city-level-info-method-12 () none) ;; 12 ;; (city-level-info-method-12 (_type_ vector nav-branch vector) vector) - (city-level-info-method-13 () none) ;; 13 ;; (lookup-cell-by-position (_type_ vector) vis-cell) - (city-level-info-method-14 () none) ;; 14 ;; (get-first-cell-in-box (_type_ vis-grid-box) vis-cell) - (city-level-info-method-15 () none) ;; 15 ;; (sphere-in-grid? (_type_ vector int) symbol) - (city-level-info-method-16 () none) ;; 16 ;; (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) - (city-level-info-method-17 () none) ;; 17 ;; (update-suppressions-from-traffic-engine (_type_ traffic-engine) none) - (city-level-info-method-18 () none) ;; 18 ;; (city-level-info-method-18 (_type_) none) + (city-level-info-method-9 (_type_) object) ;; 9 + (init-vis-ray (_type_ vis-ray vector vector) none) ;; 10 + (city-level-info-method-11 (_type_ vis-ray) none) ;; 11 + (city-level-info-method-12 (_type_ vector nav-branch vector) vector) ;; 12 + (lookup-cell-by-position (_type_ vector) vis-cell) ;; 13 + (get-first-cell-in-box (_type_ vis-grid-box) vis-cell) ;; 14 + (sphere-in-grid? (_type_ vector int) symbol) ;; 15 + (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) ;; 16 + (update-suppressions-from-traffic-engine (_type_ traffic-engine) none) ;; 17 + (city-level-info-method-18 (_type_) none) ;; 18 ) ) @@ -48526,12 +48502,12 @@ :size-assert #x820 :flag-assert #xf00000820 (:methods - (traffic-level-data-method-9 () none) ;; 9 ;; (reset (_type_) none) - (traffic-level-data-method-10 () none) ;; 10 ;; (add-active-cell (_type_ vis-cell) none) - (traffic-level-data-method-11 () none) ;; 11 ;; (remove-active-cell (_type_ int) none) - (traffic-level-data-method-12 () none) ;; 12 ;; (add-newly-active-cell (_type_ vis-cell) none) - (traffic-level-data-method-13 () none) ;; 13 ;; (per-frame-cell-update (_type_) none) - (traffic-level-data-method-14 () none) ;; 14 ;; (debug-draw (_type_) none) + (reset! (_type_) none) ;; 9 + (add-active-cell (_type_ vis-cell) none) ;; 10 + (remove-active-cell (_type_ int) none) ;; 11 + (add-newly-active-cell (_type_ vis-cell) none) ;; 12 + (per-frame-cell-update (_type_) none) ;; 13 + (debug-draw (_type_) none) ;; 14 ) ) @@ -48562,8 +48538,23 @@ :flag-assert #x900000020 ) +;; +++traffic-engine-h:traffic-type-flag +(defenum traffic-type-flag + :bitfield #t + :type uint8 + (ttf0) + (ttf1) + (ttf2) + (ttf3) + (ttf4) + (ttf5) + (ttf6) + (ttf7) + ) +;; ---traffic-engine-h:traffic-type-flag + (deftype traffic-object-type-info (structure) - ((flags uint8 :offset-assert 0) ;; traffic-type-flags + ((flags traffic-type-flag :offset-assert 0) (active-count int8 :offset-assert 1) (inactive-count int8 :offset-assert 2) (reserve-count uint16 :offset-assert 4) @@ -48608,11 +48599,11 @@ :size-assert #x230 :flag-assert #xe00000230 (:methods - (traffic-suppressor-method-9 () none) ;; 9 ;; (reset-boxes (_type_) none) - (traffic-suppressor-method-10 () none) ;; 10 ;; (add-new-supression-box (_type_ traffic-suppression-params) none) - (traffic-suppressor-method-11 () none) ;; 11 ;; (remove-box-by-id (_type_ int) none) - (traffic-suppressor-method-12 () none) ;; 12 ;; (update-box-from-params (_type_ traffic-suppression-params) none) - (traffic-suppressor-method-13 () none) ;; 13 ;; (debug-draw (_type_) none) + (reset-boxes (_type_) none) ;; 9 + (add-new-supression-box (_type_ traffic-suppression-params) none) ;; 10 + (remove-box-by-id (_type_ int) none) ;; 11 + (update-box-from-params (_type_ traffic-suppression-params) none) ;; 12 + (debug-draw (_type_) none) ;; 13 ) ) @@ -48630,24 +48621,24 @@ :size-assert #x47e :flag-assert #x1b0000047e (:methods - (traffic-tracker-method-9 () none) ;; 9 ;; (traffic-tracker-method-9 (_type_) none) - (traffic-tracker-method-10 () none) ;; 10 ;; (traffic-tracker-method-10 (_type_) none) - (traffic-tracker-method-11 () none) ;; 11 ;; (traffic-tracker-method-11 (_type_) none) - (traffic-tracker-method-12 () none) ;; 12 ;; (add-active-process (_type_ traffic-type handle) none) - (traffic-tracker-method-13 () none) ;; 13 ;; (remove-active-process (_type_ int) handle) - (traffic-tracker-method-14 () none) ;; 14 ;; (add-reserved-process (_type_ traffic-type handle) none) + (traffic-tracker-method-9 (_type_) none) ;; 9 + (traffic-tracker-method-10 (_type_) none) ;; 10 + (traffic-tracker-method-11 (_type_) none) ;; 11 + (add-active-process (_type_ traffic-type handle) none) ;; 12 + (remove-active-process (_type_ int) handle) ;; 13 + (add-reserved-process (_type_ traffic-type handle) none) ;; 14 (get-from-inactive-by-type (_type_ traffic-type) handle) ;; 15 - (traffic-tracker-method-16 () none) ;; 16 ;; (get-from-inactive-by-handle (_type_ traffic-type handle) handle) - (traffic-tracker-method-17 () none) ;; 17 ;; (deactivate-object (_type_ int symbol) none) - (traffic-tracker-method-18 () none) ;; 18 ;; (set-process-to-killed (_type_ process) none) - (traffic-tracker-method-19 () none) ;; 19 ;; (deactivate-all (_type_ symbol) none) - (traffic-tracker-method-20 () none) ;; 20 ;; (deactivate-all-of-type (_type_ traffic-type symbol) none) - (traffic-tracker-method-21 () none) ;; 21 ;; (activate-from-params (_type_ traffic-object-spawn-params) none) - (traffic-tracker-method-22 () none) ;; 22 ;; (activate-by-type (_type_ traffic-type nav-segment float) none) - (traffic-tracker-method-23 () none) ;; 23 ;; (activate-by-handle (_type_ traffic-object-spawn-params) none) - (traffic-tracker-method-24 () none) ;; 24 ;; (reset (_type_ uint traffic-engine) none) - (traffic-tracker-method-25 () none) ;; 25 ;; (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) - (traffic-tracker-method-26 () none) ;; 26 ;; (for-all-active-processes-of-type (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none) + (get-from-inactive-by-handle (_type_ traffic-type handle) handle) ;; 16 + (deactivate-object (_type_ int symbol) none) ;; 17 + (set-process-to-killed (_type_ process) none) ;; 18 + (deactivate-all (_type_ symbol) none) ;; 19 + (deactivate-all-of-type (_type_ traffic-type symbol) none) ;; 20 + (activate-from-params (_type_ traffic-object-spawn-params) none) ;; 21 + (activate-by-type (_type_ traffic-type nav-segment float) none) ;; 22 + (activate-by-handle (_type_ traffic-object-spawn-params) none) ;; 23 + (reset (_type_ uint traffic-engine) none) ;; 24 + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) ;; 25 + (for-all-active-processes-of-type (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none) ;; 26 ) ) @@ -48666,6 +48657,8 @@ (level-data-array traffic-level-data 2 :inline :offset-assert 64) ;; guessed by decompiler (object-type-info-array traffic-object-type-info 29 :inline :offset-assert 4224) ;; guessed by decompiler (tracker-array traffic-tracker 2 :inline :offset-assert 5152) ;; guessed by decompiler + (tracker0 traffic-tracker :inline :offset 5152 :score 1) ;; added + (tracker1 traffic-tracker :inline :offset 6304 :score 1) ;; added (inactive-object-array handle 580 :offset 7456) ;; guessed by decompiler (suppressor traffic-suppressor :inline :offset-assert 12096) (danger-sphere-count int8 :offset 12656) @@ -48677,55 +48670,55 @@ :flag-assert #x3a00003284 (:methods (new (symbol type) _type_) ;; 0 - (traffic-engine-method-9 () none) ;; 9 ;; (update-traffic (_type_) none) + (update-traffic (_type_) none) ;; 9 (reset-and-init-from-manager (_type_ process) none) ;; 10 - (traffic-engine-method-11 () none) ;; 11 ;; (stop-alarm-sound (_type_) none) - (traffic-engine-method-12 () none) ;; 12 ;; (debug-unused (_type_) none) - (traffic-engine-method-13 () none) ;; 13 ;; (add-object (_type_ traffic-type process) none) - (traffic-engine-method-14 () none) ;; 14 ;; (sphere-in-loaded-city-infos? (_type_ vector int) symbol) - (traffic-engine-method-15 () none) ;; 15 ;; (activate-one-citizen (_type_ nav-segment float) none) - (traffic-engine-method-16 () none) ;; 16 ;; (activate-one-vehicle (_type_ nav-segment float) none) - (traffic-engine-method-17 () none) ;; 17 ;; (can-dest-be-used? (_type_ nav-branch) symbol) - (traffic-engine-method-18 () none) ;; 18 ;; (child-killed (_type_ process) none) - (traffic-engine-method-19 () none) ;; 19 ;; (deactivate-all-from-level (_type_ symbol) none) + (squad-stop-alarm-sound (_type_) none) ;; 11 + (stub (_type_) none) ;; 12 + (add-object (_type_ traffic-type process) none) ;; 13 + (sphere-in-loaded-city-infos? (_type_ vector int) symbol) ;; 14 + (activate-one-citizen (_type_ nav-segment float) none) ;; 15 + (activate-one-vehicle (_type_ nav-segment float) none) ;; 16 + (can-dest-be-used? (_type_ nav-branch) symbol) ;; 17 + (child-killed (_type_ process) none) ;; 18 + (deactivate-all-from-level (_type_ symbol) none) ;; 19 (find-best-segment (_type_ vector vector int) nav-segment) ;; 20 (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) ;; 21 (add-danger (_type_ traffic-danger-info) none) ;; 22 - (traffic-engine-method-23 () none) ;; 23 ;; (guard-count (_type_) int) - (traffic-engine-method-24 () none) ;; 24 ;; (set-target-level (_type_ float) none) - (traffic-engine-method-25 () none) ;; 25 ;; (set-guard-target-level (_type_ float) none) - (traffic-engine-method-26 () none) ;; 26 ;; (deactivate-all (_type_) none) - (traffic-engine-method-27 () none) ;; 27 ;; (deactivate-by-type (_type_ traffic-type) none) - (traffic-engine-method-28 () none) ;; 28 ;; (maybe-increase-guard-aim-count (_type_) symbol) - (traffic-engine-method-29 () none) ;; 29 ;; (restore-default-settings (_type_) none) - (traffic-engine-method-30 () none) ;; 30 ;; (increase-alert-level (_type_ int target) none) - (traffic-engine-method-31 () none) ;; 31 ;; (decrease-alert-level (_type_ int) none) - (traffic-engine-method-32 () none) ;; 32 ;; (set-alert-level (_type_ int) none) - (traffic-engine-method-33 () none) ;; 33 ;; (set-max-alert-level (_type_ int) none) - (traffic-engine-method-34 () none) ;; 34 ;; (set-alert-duration (_type_ time-frame) none) - (traffic-engine-method-35 () none) ;; 35 ;; (get-alert-level (_type_) int) - (traffic-engine-method-36 () none) ;; 36 ;; (get-target (_type_) target) - (traffic-engine-method-37 () none) ;; 37 ;; (set-object-target-level (_type_ int float) none) - (traffic-engine-method-38 () none) ;; 38 ;; (set-object-target-count (_type_ int int) none) - (traffic-engine-method-39 () none) ;; 39 ;; (set-object-reserve-count (_type_ int uint) none) - (traffic-engine-method-40 () none) ;; 40 ;; (get-object-reserve-count (_type_ int) int) - (traffic-engine-method-41 () none) ;; 41 ;; (get-object-remaining-count (_type_ int) int) - (traffic-engine-method-42 () none) ;; 42 ;; (activate-object (_type_ traffic-object-spawn-params) none) - (traffic-engine-method-43 () none) ;; 43 ;; (activate-by-handle (_type_ traffic-object-spawn-params) none) - (traffic-engine-method-44 () none) ;; 44 ;; (set-parking-spot-prob (_type_ int float) none) - (traffic-engine-method-45 () none) ;; 45 ;; (get-random-parking-spot-type (_type_) traffic-type) - (traffic-engine-method-46 () none) ;; 46 ;; (new-suppression-box (_type_ traffic-suppression-params) none) - (traffic-engine-method-47 () none) ;; 47 ;; (remove-suppression-box (_type_ traffic-suppression-params) none) - (traffic-engine-method-48 () none) ;; 48 ;; (update-suppression-box (_type_ traffic-suppression-params) none) - (traffic-engine-method-49 () none) ;; 49 ;; (traffic-engine-method-49 (_type_ vector int traffic-target-status) traffic-target-status) - (traffic-engine-method-50 () none) ;; 50 ;; (find-closest-to-with-collide-lists (_type_ process-drawable collide-spec) process-focusable) - (traffic-engine-method-51 () none) ;; 51 ;; (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) - (traffic-engine-method-52 () none) ;; 52 ;; (send-alert-events (_type_) none) - (traffic-engine-method-53 () none) ;; 53 ;; (end-pursuit-by-type (_type_ traffic-type) none) - (traffic-engine-method-54 () none) ;; 54 ;; (get-traffic-guard-type-settings (_type_ int) traffic-guard-type-settings) - (traffic-engine-method-55 () none) ;; 55 ;; (get-guard-type-for-traffic-obj (_type_ int) uint) - (traffic-engine-method-56 () none) ;; 56 ;; (get-traffic-guard-change-to-type (_type_ int) uint) - (traffic-engine-method-57 () none) ;; 57 ;; (set-guard-target-count-range (_type_ int int int) none) + (target-count (_type_ float) none) ;; 23 + (deactivate-all (_type_) none) ;; 24 + (deactivate-by-type (_type_ traffic-type) none) ;; 25 + (restore-default-settings (_type_) none) ;; 26 + (set-object-target-level (_type_ int float) none) ;; 27 + (set-object-target-count (_type_ int int) none) ;; 28 + (set-object-reserve-count (_type_ int uint) none) ;; 29 + (get-object-reserve-count (_type_ int) uint) ;; 30 ;; + (get-object-remaining-count (_type_ int) int) ;; 31 ;; + (activate-object (_type_ traffic-object-spawn-params) none) ;; 32 + (activate-by-handle (_type_ traffic-object-spawn-params) none) ;; 33 + (set-parking-spot-prob (_type_ int float) none) ;; 34 + (get-random-parking-spot-type (_type_) traffic-type) ;; 35 + (new-suppression-box (_type_ traffic-suppression-params) none) ;; 36 + (remove-suppression-box (_type_ traffic-suppression-params) none) ;; 37 + (update-suppression-box (_type_ traffic-suppression-params) none) ;; 38 + (stub1 (_type_) none) ;; 39 + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) ;; 40 + (set-object-auto-activate (_type_ int symbol) none) ;; 41 + (check-proc-in-tracker (_type_ process int) none) ;; 42 + (kill-traffic-sphere (_type_ vector) none) ;; 43 + (level-link (_type_ level) none) ;; 44 + (level-unlink (_type_ level) none) ;; 45 + (add-squad-ctrl (_type_ squad-control) none) ;; 46 + (stub2 (_type_) none) ;; 47 + (stub3 (_type_) none) ;; 48 + (handle-new-vis-cell (_type_ vis-cell) none) ;; 49 + (init-sync-masks (_type_) none) ;; 50 + (stub4 (_type_) none) ;; 51 + (update-traffic-amount (_type_) none) ;; 52 + (update-danger (_type_) none) ;; 53 + (update-danger-from-target (_type_) none) ;; 54 + (stub5 (_type_) none) ;; 55 + (update-suppressor (_type_) none) ;; 56 + (recompute-suppressions (_type_) none) ;; 57 ) ) @@ -48809,7 +48802,7 @@ :flag-assert #x1600000090 (:methods (vehicle-controller-method-9 (_type_) none) ;; 9 ;; (vehicle-controller-method-9 (_type_) none) - (vehicle-controller-method-10 (_type_ traffic-tracker) none) ;; 10 ;; (vehicle-controller-method-10 (_type_ traffic-tracker) none) + (vehicle-controller-method-10 (_type_ nav-branch) none) ;; 10 ;; (vehicle-controller-method-10 (_type_ traffic-tracker) none) (vehicle-controller-method-11 (_type_) none) ;; 11 ;; (vehicle-controller-method-11 (_type_) none) (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none) ;; 12 ;; (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none) (vehicle-controller-method-13 (_type_ nav-branch vector) none) ;; 13 ;; (vehicle-controller-method-13 (_type_ nav-branch vector) none) @@ -48830,7 +48823,166 @@ ;; nav-graph ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern make-nav-graph function) ;; (function mysql-nav-graph symbol none) +(define-extern make-nav-graph (function mysql-nav-graph symbol nav-graph)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; squad-control-h ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +(deftype squad-unit-settings (structure) + ((target-count int8 :offset-assert 0) + (shot-count int8 :offset-assert 1) + (rand-shot-count int8 :offset-assert 2) + (inaccuracy float :offset-assert 4) + (acquire-delay uint16 :offset-assert 8 :decomp-as time-frame) + (shot-delay uint16 :offset-assert 10 :decomp-as time-frame) + (burst-delay uint16 :offset-assert 12 :decomp-as time-frame) + (rand-burst-delay uint16 :offset-assert 14 :decomp-as time-frame) + (rand-shot-delay uint16 :offset-assert 16 :decomp-as time-frame) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x12 + :flag-assert #x900000012 + ) + +;; +++squad-control-h:squad-target-flag +(defenum squad-target-flag + :type uint8 + :bitfield #t + (visible-now) + (visible-recently) + (visible-ever) + (updated) + (force-visible) + ) +;; ---squad-control-h:squad-target-flag + +(deftype squad-target-status (structure) + ((flags squad-target-flag :offset-assert 0) + (handle handle :offset-assert 8) + (last-seen-time time-frame :offset-assert 16) + (position vector :inline :offset-assert 32) + (velocity vector :inline :offset-assert 48) + (threat-level float :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ;; field squad-target-flag is likely a value type. + ) + +;; +++squad-control-h:squad-alert-flag +(defenum squad-alert-flag + :type uint8 + :bitfield #t + (alert-ending) + (alarm-on) + (guard-multi-focus) + (sticky-guard-settings) + (disable-pursuit-control) + (update-target-search) + (war) + ) +;; ---squad-control-h:squad-alert-flag + +(deftype squad-alert-state (structure) + ((flags squad-alert-flag :offset-assert 0) + (level uint8 :offset-assert 1) + (max-level uint8 :offset-assert 2) + (guards-in-sight-of-target int8 :offset-assert 3) + (guard-aim-count int8 :offset-assert 4) + (guard-inaccuracy-factor float :offset-assert 8) + (guard-target-level float :offset-assert 12) + (duration uint32 :offset-assert 16 :decomp-as time-frame) + (start-time time-frame :offset-assert 24) + (notify-time time-frame :offset-assert 32) + (alarm-sound-id sound-id :offset-assert 40) + (target-status-array squad-target-status 3 :inline :offset-assert 48) + (target-status squad-target-status :inline :offset 48) + ) + :method-count-assert 10 + :size-assert #x120 + :flag-assert #xa00000120 + ;; field squad-alert-flag is likely a value type. + (:methods + (init! (_type_) none) ;; 9 + ) + ) + +(deftype primary-target-pos-vel (structure) + ((position vector :inline :offset-assert 0) + (velocity vector :inline :offset-assert 16) + (time uint32 :offset 28 :score 1) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype squad-control (basic) + ((sync-clock uint8 :offset-assert 4) + (sync-mask-8 uint8 :offset-assert 5) + (sync-mask-16 uint16 :offset-assert 6) + (sync-mask-32 uint32 :offset-assert 8) + (alert-state squad-alert-state :inline :offset-assert 16) + (primary-target-history primary-target-pos-vel 16 :inline :offset-assert 304) + ) + :method-count-assert 34 + :size-assert #x330 + :flag-assert #x2200000330 + (:methods + (initialize (_type_ process) none) ;; 9 + (squad-control-method-10 (_type_) none) ;; 10 + (stop-alarm-sound (_type_) none) ;; 11 + (init-alert (_type_) none) ;; 12 + (update (_type_) none) ;; 13 + (set-sync-mask (_type_) none) ;; 14 + (probe-backgnd-collision (_type_ vector vector) symbol) ;; 15 + (squad-control-method-16 (_type_ vector process-focusable squad-target-status) none) ;; 16 + (squad-control-method-17 (_type_ vector int squad-target-status) squad-target-status) ;; 17 + (squad-control-method-18 (_type_ int process) int) ;; 18 + (set-alert-level0 (_type_ int) int) ;; 19 + (start-alert (_type_ int) none) ;; 20 + (set-alert-level (_type_ int) none) ;; 21 + (get-alert-level (_type_) int) ;; 22 + (set-alert-duration (_type_ time-frame) none) ;; 23 + (squad-control-method-24 (_type_) int) ;; 24 + (squad-control-method-25 (_type_ primary-target-pos-vel time-frame) none) ;; 25 + (set-pos-vel (_type_ primary-target-pos-vel) primary-target-pos-vel) ;; 26 + (squad-control-method-27 (_type_ process float) none) ;; 27 + (get-idx-in-status-arr (_type_ handle) int) ;; 28 + (valid-target-handle? (_type_ handle) symbol) ;; 29 + (get-target-focus (_type_) process-focusable) ;; 30 + (squad-control-method-31 (_type_ vector process-focusable handle float float) none) ;; 31 + (get-handle-pos (_type_ handle vector) vector) ;; 32 + (get-focus-in-range (_type_ process-focusable) process-focusable) ;; 33 + ) + ) + +;; added +(deftype squad-control-stack-type0 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (float0 float :offset 32) + (byte0 int8 :offset 36) + (mesh nav-mesh :offset 40) + (cquery collide-query :inline :offset 64) + (vec2 vector :inline :offset 272) + (vec3 vector :inline :offset 288) + (float1 float :offset 604) + (float2 float :offset 608) + (float3 float :offset 612) + ) + ) + +(define-extern *waswide-squad-control* squad-control) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; squad-control ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mission-squad-control-h ;; @@ -48844,6 +48996,8 @@ (cai1 1) (cai2 2) (cai3 3) + (cai4 4) + (cai5 5) ) ;; ---mission-squad-control-h:city-attacker-info-flag @@ -48858,23 +49012,24 @@ (enemy-type int16 :offset-assert 30) (self-index int16 :offset-assert 32) (enemy-index int16 :offset-assert 34) - (callback function :offset-assert 36) - (hatred-map-callback function :offset-assert 40) + (callback (function process city-attacker-info int) :offset-assert 36) + (hatred-map-callback (function process city-attacker-info int) :offset-assert 40) ) :method-count-assert 11 :size-assert #x2c :flag-assert #xb0000002c (:methods - (city-attacker-info-method-9 () none) ;; 9 - (city-attacker-info-method-10 () none) ;; 10 + (init! (_type_ process int) none) ;; 9 + (reset! (_type_) none) ;; 10 ) ) (deftype city-attacker-cache (structure) ((pos vector :offset-assert 0) - (proc basic :offset-assert 4) + (proc process :offset-assert 4) (attackable? symbol :offset-assert 8) ) + :pack-me :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c @@ -48884,6 +49039,8 @@ (defenum city-hatred-info-flag :type uint16 :bitfield #t + (chi0 0) + (chi1 1) ) ;; ---mission-squad-control-h:city-hatred-info-flag @@ -48897,6 +49054,7 @@ (index uint8 :offset-assert 22) (pad uint8 :offset-assert 23) ) + :pack-me :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 @@ -48928,9 +49086,9 @@ (deftype mission-squad-control (basic) ((attackers city-attacker-array :offset-assert 4) - (unused-list basic :offset-assert 8) - (hatred-vals basic :offset-assert 12) - (hatred-indices basic :offset-assert 16) + (unused-list (array int16) :offset-assert 8) + (hatred-vals city-hatred-array :offset-assert 12) + (hatred-indices (array uint8) :offset-assert 16) (attacker-cache city-attacker-cache-array :offset-assert 20) (target-attacker city-attacker-info :offset-assert 24) (max-num-object-types int32 :offset-assert 28) @@ -48939,21 +49097,21 @@ :size-assert #x20 :flag-assert #x1800000020 (:methods - (mission-squad-control-method-9 () none) ;; 9 - (mission-squad-control-method-10 () none) ;; 10 - (mission-squad-control-method-11 () none) ;; 11 - (mission-squad-control-method-12 () none) ;; 12 - (mission-squad-control-method-13 () none) ;; 13 - (mission-squad-control-method-14 () none) ;; 14 - (mission-squad-control-method-15 () none) ;; 15 - (mission-squad-control-method-16 () none) ;; 16 - (mission-squad-control-method-17 () none) ;; 17 - (mission-squad-control-method-18 () none) ;; 18 - (mission-squad-control-method-19 () none) ;; 19 - (mission-squad-control-method-20 () none) ;; 20 - (mission-squad-control-method-21 () none) ;; 21 - (mission-squad-control-method-22 () none) ;; 22 - (mission-squad-control-method-23 () none) ;; 23 + (init! (_type_ int int int) none) ;; 9 + (allocate-attacker (_type_) city-attacker-info) ;; 10 + (remove-attacker (_type_ city-attacker-info) none) ;; 11 + (mission-squad-control-method-12 (_type_) symbol) ;; 12 + (mission-squad-control-method-13 (_type_ city-attacker-info) int) ;; 13 + (init-attackers (_type_) none) ;; 14 + (init-attack-controller (_type_) none) ;; 15 + (mission-squad-control-method-16 (_type_) none) ;; 16 + (set-hatred-indices-for-all (_type_ int city-hatred-info city-hatred-info int) symbol) ;; 17 + (get-attacker-at-idx (_type_ int) city-attacker-info) ;; 18 + (push-back-hatred (_type_) city-hatred-info) ;; 19 + (set-hatred-indices (_type_ city-hatred-info int int) uint) ;; 20 + (get-hatred-at-idx (_type_ int int) city-hatred-info) ;; 21 + (update-attack-target (_type_) none) ;; 22 + (reset-hatred (_type_) none) ;; 23 ) ) @@ -48961,119 +49119,143 @@ ;; citizen-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++citizen-h:citizen-flag +(defenum citizen-flag + :type uint16 + :bitfield #t + (persistent) + (run-mode) + (shuffle-mode) + (in-pursuit) + (hostile) + (target-in-sight) + (sticky-weapon) + (knocked-out-car) + (knocked-out-bike) + (dark-guard) + (female) + (in-formation) + (neck-no-auto-look-at) + (talking) + (in-mission) + ) +;; ---citizen-h:citizen-flag + (deftype citizen (nav-enemy) - ((flags citizen-flag :offset-assert 616) - (traffic-id int8 :offset-assert 618) - (hit-by-player-count int8 :offset-assert 619) - (gnd-height float :offset-assert 620) - (speed-scale float :offset-assert 624) - (controller vehicle-controller :inline :offset-assert 636) - (squad basic :offset-assert 780) - (danger-pos sphere :inline :offset-assert 796) - (dest-point vector :inline :offset-assert 700) - (vehicle uint64 :offset-assert 812) ;; handle - (formation uint64 :offset-assert 812) - (formation-index int8 :offset-assert 820) - (anim-shuffle int32 :offset-assert 824) - (dist-walk-anim float :offset-assert 828) - (speed-walk float :offset-assert 832) - (anim-walk int32 :offset-assert 836) - (dist-run-anim float :offset-assert 840) - (speed-run float :offset-assert 844) - (anim-run int32 :offset-assert 848) - (travel-anim-scale-speed float :offset-assert 852) - (water-anim int32 :offset-assert 856) - (interp float :offset-assert 860) - (last-danger-time uint64 :offset-assert 868) ;; time-frame - (next-time-look-at uint64 :offset-assert 876) ;; time-frame - (stop-time-look-at uint64 :offset-assert 884) ;; time-frame - (wait-return-state (state citizen) :offset-assert 892) ;; guessed by decompiler - (wait-time uint64 :offset-assert 900) ;; time-frame - (shield-handle uint64 :offset-assert 908) - (cp-valid? symbol :offset-assert 916) ;; guessed by decompiler - (cp-sphere sphere :inline :offset-assert 924) - (cp-vec vector :inline :offset-assert 940) - (cp-next-time uint64 :offset-assert 956) ;; time-frame - (cp-exit-time uint64 :offset-assert 964) ;; time-frame - (cp-force vector :inline :offset-assert 972) - (cp-plane plane :inline :offset-assert 988) - (cp-factor float :offset-assert 1004) - (faction-mode uint8 :offset-assert 1008) - (attacker-info city-attacker-info :offset-assert 1012) - (mission-squad basic :offset-assert 1016) - (probe-counter uint32 :offset-assert 1020) + ((self citizen :override) + (ppointer (pointer citizen) :override) + (flags citizen-flag :offset-assert 620) + (traffic-id int8 :offset-assert 622) + (hit-by-player-count int8 :offset-assert 623) + (gnd-height float :offset-assert 624) + (speed-scale float :offset-assert 628) + (controller vehicle-controller :inline :offset-assert 640) + (squad squad-control :offset-assert 784) + (danger-pos sphere :inline :offset-assert 800) + (dest-point vector :inline :offset 704 :score 1) + (vehicle handle :offset-assert 816) ;; handle + (formation handle :offset 816) + (formation-index int8 :offset-assert 824) + (anim-shuffle int32 :offset-assert 828) + (dist-walk-anim float :offset-assert 832) + (speed-walk float :offset-assert 836) + (anim-walk int32 :offset-assert 840) + (dist-run-anim float :offset-assert 844) + (speed-run float :offset-assert 848) + (anim-run int32 :offset-assert 852) + (travel-anim-scale-speed float :offset-assert 856) + (water-anim int32 :offset-assert 860) + (interp float :offset-assert 864) + (last-danger-time time-frame :offset-assert 872) ;; time-frame + (next-time-look-at time-frame :offset-assert 880) ;; time-frame + (stop-time-look-at time-frame :offset-assert 888) ;; time-frame + (wait-return-state (state citizen) :offset-assert 896) ;; guessed by decompiler + (wait-time time-frame :offset-assert 904) ;; time-frame + (shield-handle handle :offset-assert 912) + (cp-valid? symbol :offset-assert 920) ;; guessed by decompiler + (cp-sphere sphere :inline :offset-assert 928) + (cp-vec vector :inline :offset-assert 944) + (cp-next-time time-frame :offset-assert 960) ;; time-frame + (cp-exit-time time-frame :offset-assert 968) ;; time-frame + (cp-force vector :inline :offset-assert 976) + (cp-plane plane :inline :offset-assert 992) + (cp-factor float :offset-assert 1008) + (faction-mode uint8 :offset-assert 1012) + (attacker-info city-attacker-info :offset-assert 1016) + (mission-squad mission-squad-control :offset-assert 1020) + (probe-counter uint32 :offset-assert 1024) ) :method-count-assert 216 :size-assert #x404 :flag-assert #xd803900404 ;; field citizen-flag is likely a value type. + (:state-methods + wait ;; 190 + inactive ;; 191 + in-ditch ;; 192 + ) (:methods - (citizen-method-190 () none) ;; 190 ;; (citizen-method-190 (_type_ vector) none) - (citizen-method-191 () none) ;; 191 ;; (gen-clear-path (_type_) nav-segment) - (citizen-method-192 () none) ;; 192 ;; (citizen-method-192 (_type_) none) - (citizen-method-193 () none) ;; 193 ;; (throw-off-vehicle (_type_) none) - (citizen-method-194 () none) ;; 194 ;; (gen-new-dir (_type_ vector float) nav-segment) - (citizen-method-195 () none) ;; 195 ;; (citizen-method-195 (_type_ vector) symbol) - (citizen-method-196 () none) ;; 196 ;; (get-run-anim (_type_) int) - (citizen-method-197 () none) ;; 197 ;; (trigger-alert (_type_ int target) none) - (citizen-method-198 () none) ;; 198 ;; (decrease-alert (_type_ object) none) - (citizen-method-199 () none) ;; 199 ;; (set-behavior! (_type_ traffic-object-spawn-params) none) - (citizen-method-200 () none) ;; 200 ;; (citizen-method-200 (_type_) none) - (citizen-method-201 () none) ;; 201 - (citizen-method-202 () none) ;; 202 - (citizen-method-203 () none) ;; 203 - (citizen-method-204 () none) ;; 204 - (citizen-method-205 () none) ;; 205 - (citizen-method-206 () none) ;; 206 - (citizen-method-207 () none) ;; 207 - (citizen-method-208 () none) ;; 208 - (citizen-method-209 () none) ;; 209 - (citizen-method-210 () none) ;; 210 - (citizen-method-211 () none) ;; 211 - (citizen-method-212 () none) ;; 212 - (citizen-method-213 () none) ;; 213 - (citizen-method-214 () none) ;; 214 - (citizen-method-215 () none) ;; 215 + (init-enemy-defaults! (_type_ nav-enemy-info) none :replace) + (set-squad (_type_) none) ;; 193 + (citizen-method-194 (_type_) none) ;; 194 + (citizen-method-195 (_type_) none) ;; 195 + (go-inactive (_type_) none) ;; 196 + (find-segment (_type_ vector vector) nav-segment) ;; 197 + (nav-segment-callback (_type_ vector traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) ;; 198 + (citizen-method-199 (_type_ nav-segment) none) ;; 199 + (citizen-method-200 (_type_) symbol) ;; 200 ;; + (citizen-method-201 (_type_ vector) none) ;; 201 + (citizen-method-202 (_type_ vector vector) none) ;; 202 + (citizen-method-203 (_type_ vector) none) ;; 203 + (gen-clear-path (_type_) nav-segment) ;; 204 + (citizen-method-205 (_type_) none) ;; 205 + (citizen-method-206 (_type_) none) ;; 206 + (citizen-method-207 (_type_ vector float) nav-segment) ;; 207 + (citizen-method-208 (_type_ vector) none) ;; 208 + (get-run-anim (_type_) int) ;; 209 + (citizen-method-210 (_type_ int process) none) ;; 210 + (set-alert-level (_type_ int) none) ;; 211 + (go-from-behavior (_type_ traffic-object-spawn-params) none) ;; 212 + (citizen-method-213 (_type_) none) ;; 213 + (citizen-method-214 (_type_ nav-control vector) none) ;; 214 + (citizen-method-215 (_type_) none) ;; 215 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; squad-control-city-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++squad-control-city-h:squad-city-mode +(defenum squad-city-mode + :type uint32 + (zero) + (one) + (two) + ) +;; ---squad-control-city-h:squad-city-mode + (deftype squad-control-city (squad-control) - ((sync-clock uint8 :offset-assert 4) - (sync-mask-8 uint8 :offset-assert 5) - (sync-mask-16 uint16 :offset-assert 6) - (sync-mask-32 uint32 :offset-assert 8) - (alert-state squad-alert-state :inline :offset-assert 16) - (primary-target-history UNKNOWN 16 :offset-assert 304) - (traffic basic :offset-assert 816) - (city-mode uint32 :offset-assert 820) + ((traffic traffic-engine :offset-assert 816) + (city-mode squad-city-mode :offset-assert 820) ) :method-count-assert 45 :size-assert #x338 :flag-assert #x2d00000338 (:methods - (squad-control-city-method-34 () none) ;; 34 - (squad-control-city-method-35 () none) ;; 35 - (squad-control-city-method-36 () none) ;; 36 - (squad-control-city-method-37 () none) ;; 37 - (squad-control-city-method-38 () none) ;; 38 - (squad-control-city-method-39 () none) ;; 39 - (squad-control-city-method-40 () none) ;; 40 - (squad-control-city-method-41 () none) ;; 41 - (squad-control-city-method-42 () none) ;; 42 - (squad-control-city-method-43 () none) ;; 43 - (squad-control-city-method-44 () none) ;; 44 + (squad-control-city-method-34 (_type_) symbol) ;; 34 + (squad-control-city-method-35 (_type_ citizen handle) process-focusable) ;; 35 + (get-city-mode (_type_) squad-city-mode) ;; 36 + (squad-control-city-method-37 (_type_) none) ;; 37 + (squad-control-city-method-38 (_type_ process-focusable process-focusable) symbol) ;; 38 + (squad-control-city-method-39 (_type_ process-focusable process-focusable) float) ;; 39 + (squad-control-city-method-40 (_type_ process-focusable process-focusable) none) ;; 40 + (squad-control-city-method-41 (_type_ process-focusable process-focusable) symbol) ;; 41 + (squad-control-city-method-42 (_type_) float) ;; 42 + (squad-control-city-method-43 (_type_ process-focusable) symbol) ;; 43 + (add-squad-to-traffic-engine (_type_ traffic-engine) none) ;; 44 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; squad-control-city ;; @@ -49084,23 +49266,20 @@ ;; kg-squad-control-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype handle-array (inline-array-class-uint64) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data0 handle :dynamic :score 1) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype kg-squad-member-settings (structure) - ((object-type uint8 :offset-assert 0) + ((object-type traffic-type :offset-assert 0) (max-target-count int8 :offset-assert 1) (min-target-count int8 :offset-assert 2) (target-count int8 :offset-assert 3) - (enemy-type uint8 :offset-assert 4) + (enemy-type traffic-type :offset-assert 4) (toggle-shield-percentage float :offset-assert 8) (heat-shield-percentage float :offset-assert 12) ) @@ -49108,160 +49287,175 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype kg-squad-settings (structure) ((roboguard-settings kg-squad-member-settings :inline :offset-assert 0) (roboguard-giant-settings kg-squad-member-settings :inline :offset-assert 16) (flying-turret-settings kg-squad-member-settings :inline :offset-assert 32) (spydroid-settings kg-squad-member-settings :inline :offset-assert 48) - (kg-enemy-settings UNKNOWN 4 :offset-assert 0) + (kg-enemy-settings kg-squad-member-settings 4 :inline :offset 0 :score -1) ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) -|# -#| +;; +++kg-squad-control-h:kg-squad-used-guard-types +(defenum kg-squad-used-guard-types + :type uint32 + :bitfield #t + (kg0 0) + (kg1 1) + (kg2 2) + (kg3 3) + (kg4 4) + (kg5 5) + (kg6 6) + (kg7 7) + (kg8 8) + (kg9 9) + ) +;; ---kg-squad-control-h:kg-squad-used-guard-types + (deftype kg-squad-control (squad-control-city) - ((guard-to-traffic-mapping UNKNOWN 10 :offset-assert 824) - (guard-to-squad-setting-mapping UNKNOWN 10 :offset-assert 834) - (used-guard-types uint32 :offset-assert 844) - (active-squad-member-list basic :offset-assert 852) - (enemy-type-seek-to-list UNKNOWN 3 :offset-assert 856) - (enemy-type-seek-from-list UNKNOWN 3 :offset-assert 859) - (enemy-type-seek-to uint8 :offset-assert 856) - (enemy-type-seek-from uint8 :offset-assert 859) - (enemy-type-seek-to-war uint8 :offset-assert 857) - (enemy-type-seek-from-war uint8 :offset-assert 860) - (enemy-type-seek-to-mission uint8 :offset-assert 858) - (enemy-type-seek-from-mission uint8 :offset-assert 861) + ((guard-to-traffic-mapping traffic-type 10 :offset-assert 824) + (guard-to-squad-setting-mapping uint8 10 :offset-assert 834) + (used-guard-types kg-squad-used-guard-types :offset-assert 844) + (active-squad-member-list handle-array :offset 852) + (enemy-type-seek-to-list uint8 3 :offset-assert 856) + (enemy-type-seek-from-list uint8 3 :offset-assert 859) + (enemy-type-seek-to uint8 :offset 856) + (enemy-type-seek-from uint8 :offset 859) + (enemy-type-seek-to-war uint8 :offset 857) + (enemy-type-seek-from-war uint8 :offset 860) + (enemy-type-seek-to-mission uint8 :offset 858) + (enemy-type-seek-from-mission uint8 :offset 861) (alert-level int8 :offset-assert 862) - (squad-settings UNKNOWN 3 :offset-assert 864) - (squad-normal-settings kg-squad-settings :inline :offset-assert 864) - (squad-war-settings kg-squad-settings :inline :offset-assert 928) - (squad-mission-settings kg-squad-settings :inline :offset-assert 992) + (squad-settings kg-squad-settings 3 :inline :offset-assert 864) + (squad-normal-settings kg-squad-settings :inline :offset 864) + (squad-war-settings kg-squad-settings :inline :offset 928) + (squad-mission-settings kg-squad-settings :inline :offset 992) (current-target-attackers int8 :offset-assert 1056) ) :method-count-assert 55 :size-assert #x421 :flag-assert #x3700000421 (:methods - (kg-squad-control-method-45 () none) ;; 45 - (kg-squad-control-method-46 () none) ;; 46 - (kg-squad-control-method-47 () none) ;; 47 - (kg-squad-control-method-48 () none) ;; 48 - (kg-squad-control-method-49 () none) ;; 49 - (kg-squad-control-method-50 () none) ;; 50 - (kg-squad-control-method-51 () none) ;; 51 - (kg-squad-control-method-52 () none) ;; 52 - (kg-squad-control-method-53 () none) ;; 53 - (kg-squad-control-method-54 () none) ;; 54 + (increment-alert-level (_type_ int) int) ;; 45 + (set-alert-level1 (_type_ int) int) ;; 46 + (add-squad-member (_type_ process) int) ;; 47 + (pop-squad-member-from-list (_type_ process) int) ;; 48 + (get-alert-level1 (_type_) int) ;; 49 + (copy-squad-settings-to-idx (_type_ (inline-array kg-squad-member-settings) int) none) ;; 50 + (kg-squad-control-method-51 (_type_) symbol) ;; 51 + (kg-squad-control-method-52 (_type_ process process) int) ;; 52 + (kg-squad-control-method-53 (_type_) none) ;; 53 + (kg-squad-control-method-54 (_type_) float) ;; 54 ) ) -|# -;; (define-extern *kg-squad-control* object) +(define-extern *kg-squad-control* kg-squad-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ff-squad-control-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype traffic-guard-type-info (structure) - ((object-type uint8 :offset-assert 0) ;; traffic-type + ((object-type traffic-type :offset-assert 0) ;; traffic-type (max-target-count int8 :offset-assert 1) (min-target-count int8 :offset-assert 2) (target-count int8 :offset-assert 3) (count int8 :offset-assert 4) - (change-to-type uint8 :offset-assert 5) + (change-to-type traffic-type :offset-assert 5) ) + :allow-misaligned :method-count-assert 9 :size-assert #x6 :flag-assert #x900000006 ) -|# -#| (deftype traffic-guard-type-array (structure) - ((data UNKNOWN 3 :offset-assert 0) - (guard-info-normal traffic-guard-type-info :inline :offset-assert 0) - (guard-info-war traffic-guard-type-info :inline :offset-assert 16) - (guard-info-mission traffic-guard-type-info :inline :offset-assert 32) + ((data traffic-guard-type-info 3 :inline :offset-assert 0) + (guard-info-normal traffic-guard-type-info :inline :offset 0) + (guard-info-war traffic-guard-type-info :inline :offset 16) + (guard-info-mission traffic-guard-type-info :inline :offset 32) ) + :allow-misaligned :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype squad-alert-state-settings (structure) - ((guard-settings-array UNKNOWN 10 :offset-assert 0) - (ped-tazer squad-unit-settings :inline :offset-assert 0) - (ped-rifle squad-unit-settings :inline :offset-assert 32) - (ped-grenade squad-unit-settings :inline :offset-assert 64) - (ped-waster squad-unit-settings :inline :offset-assert 96) - (bike-turret squad-unit-settings :inline :offset-assert 128) - (hellcat-turret squad-unit-settings :inline :offset-assert 160) + ((guard-settings-array squad-unit-settings 10 :inline :offset-assert 0 :score -1) + (ped-tazer squad-unit-settings :inline :offset 0) + (ped-rifle squad-unit-settings :inline :offset 32) + (ped-grenade squad-unit-settings :inline :offset 64) + (ped-waster squad-unit-settings :inline :offset 96) + (bike-turret squad-unit-settings :inline :offset 128) + (hellcat-turret squad-unit-settings :inline :offset 160) ) + :pack-me :method-count-assert 9 :size-assert #x140 :flag-assert #x900000140 ) -|# -#| (deftype traffic-target-formation (structure) - ((circle-range UNKNOWN 16 :offset-assert 0) + ((circle-range float 16 :offset-assert 0) ) + :pack-me :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) -|# -#| +(deftype ff-squad-control-stack-var0 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (vec2 nav-find-poly-parms :inline :offset 32) + (cquery collide-query :inline :offset 80) + (vec5 vector :inline :offset 608) + (vec6 vector :inline :offset 624) + ) + ) + (deftype ff-squad-control (squad-control-city) - ((squad-settings UNKNOWN 3 :offset-assert 824) - (settings squad-alert-state-settings :inline :offset-assert 824) - (settings-war squad-alert-state-settings :inline :offset-assert 1144) - (settings-mission squad-alert-state-settings :inline :offset-assert 1464) - (guard-type-info-array UNKNOWN 10 :offset-assert 1784) - (guard-type-mask-from-object-type UNKNOWN 29 :offset-assert 2264) - (target-formation-array UNKNOWN 3 :offset-assert 2380) + ((squad-settings squad-alert-state-settings 3 :inline :offset 824 :score -1) + (settings squad-alert-state-settings :inline :offset 824) + (settings-war squad-alert-state-settings :inline :offset 1144) + (settings-mission squad-alert-state-settings :inline :offset 1464) + (guard-type-info-array traffic-guard-type-array 10 :inline :offset-assert 1784) + (guard-type-mask-from-object-type uint32 29 :offset-assert 2264) + (target-formation-array traffic-target-formation 3 :inline :offset-assert 2380) ) :method-count-assert 57 :size-assert #xa0c :flag-assert #x3900000a0c (:methods - (ff-squad-control-method-45 () none) ;; 45 - (ff-squad-control-method-46 () none) ;; 46 - (ff-squad-control-method-47 () none) ;; 47 - (ff-squad-control-method-48 () none) ;; 48 - (ff-squad-control-method-49 () none) ;; 49 - (ff-squad-control-method-50 () none) ;; 50 - (ff-squad-control-method-51 () none) ;; 51 - (ff-squad-control-method-52 () none) ;; 52 - (ff-squad-control-method-53 () none) ;; 53 - (ff-squad-control-method-54 () none) ;; 54 - (ff-squad-control-method-55 () none) ;; 55 - (ff-squad-control-method-56 () none) ;; 56 + (ff-squad-control-method-45 (_type_) none) ;; 45 + (ff-squad-control-method-46 (_type_) none) ;; 46 + (ff-squad-control-method-47 (_type_) none) ;; 47 + (ff-squad-control-method-48 (_type_) none) ;; 48 + (set-guard-target-level (_type_ float) none) ;; 49 + (get-focus (_type_) process-focusable) ;; 50 + (ff-squad-control-method-51 (_type_ process-focusable collide-spec) process-focusable) ;; 51 + (end-pursuit-for-all (_type_ int) none) ;; 52 + (get-unit-settings-by-idx (_type_ int) squad-unit-settings) ;; 53 + (ff-squad-control-method-54 (_type_ int) none) ;; 54 + (ff-squad-control-method-55 (_type_ int int) traffic-type) ;; 55 + (ff-squad-control-method-56 (_type_ int int int) none) ;; 56 ) ) -|# -(define-extern *ff-squad-control* squad-control) +(define-extern *ff-squad-control* ff-squad-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mh-squad-control-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype mh-squad-member-settings (structure) - ((object-type uint8 :offset-assert 0) + ((object-type traffic-type :offset-assert 0) (max-target-count int8 :offset-assert 1) (min-target-count int8 :offset-assert 2) (target-count int8 :offset-assert 3) @@ -49272,192 +49466,195 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype mh-squad-settings (structure) - ((mh-enemy-settings UNKNOWN 3 :offset-assert 0) - (grunt-settings mh-squad-member-settings :inline :offset-assert 0) - (flitter-settings mh-squad-member-settings :inline :offset-assert 16) - (predator-settings mh-squad-member-settings :inline :offset-assert 32) + ((mh-enemy-settings mh-squad-member-settings 3 :inline :offset-assert 0 :score -1) + (grunt-settings mh-squad-member-settings :inline :offset 0) + (flitter-settings mh-squad-member-settings :inline :offset 16) + (predator-settings mh-squad-member-settings :inline :offset 32) ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype mh-squad-control (squad-control-city) - ((active-squad-member-list basic :offset-assert 828) - (squad-settings UNKNOWN 3 :offset-assert 832) - (squad-normal-settings mh-squad-settings :inline :offset-assert 832) - (squad-war-settings mh-squad-settings :inline :offset-assert 880) - (squad-mission-settings mh-squad-settings :inline :offset-assert 928) + ((active-squad-member-list handle-array :offset 828) + (squad-settings mh-squad-settings 3 :inline :offset-assert 832) + (squad-normal-settings mh-squad-settings :inline :offset 832) + (squad-war-settings mh-squad-settings :inline :offset 880) + (squad-mission-settings mh-squad-settings :inline :offset 928) (alert-level int8 :offset-assert 976) - (map-traffic-object-type-to-squad UNKNOWN 29 :offset-assert 977) + (map-traffic-object-type-to-squad traffic-type 29 :offset-assert 977) (current-target-attackers int8 :offset-assert 1006) ) :method-count-assert 49 :size-assert #x3ef :flag-assert #x31000003ef (:methods - (mh-squad-control-method-45 () none) ;; 45 - (mh-squad-control-method-46 () none) ;; 46 - (mh-squad-control-method-47 () none) ;; 47 - (mh-squad-control-method-48 () none) ;; 48 + (add-squad-member (_type_ process) int) ;; 45 + (pop-squad-member-from-list (_type_ process) int) ;; 46 + (copy-squad-settings-to-idx (_type_ (inline-array mh-squad-member-settings) int) none) ;; 47 + (mh-squad-control-method-48 (_type_) symbol) ;; 48 ) ) -|# -;; (define-extern *mh-squad-control* object) +(define-extern *mh-squad-control* mh-squad-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cty-faction ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++cty-faction:exclusive-nav-info-mask +(defenum exclusive-nav-info-mask + :type uint8 + :bitfield #t + (eni0 0) + (eni1 1) + (eni2 2) + (eni3 3) + (eni4 4) + (eni5 5) + (eni6 6) + (eni7 7) + ) +;; ---cty-faction:exclusive-nav-info-mask + (deftype exclusive-nav-mesh-info (structure) - ((aid uint32 :offset-assert 0) - (exclusive-mask uint8 :offset-assert 4) + ((aid uint32 :offset-assert 0) + (exclusive-mask exclusive-nav-info-mask :offset-assert 4) ) :method-count-assert 9 :size-assert #x5 :flag-assert #x900000005 ) -|# -;; (define-extern *territory-list* array) -;; (define-extern *default-faction-info* array) -;; (define-extern *default-faction-mod* object) -;; (define-extern *default-faction-strength-mod* object) +(define-extern *territory-list* (array pair)) +(define-extern *default-faction-info* (array cty-faction-info)) +(define-extern *default-faction-mod* cty-faction-info) +(define-extern *default-faction-strength-mod* cty-faction-strength) (define-extern setup-city-task-faction (function object)) -;; (define-extern *exclusive-nav-mesh-list* array) -;; (define-extern map-symbol-to-nav-territory-type function) +(define-extern *exclusive-nav-mesh-list* (array exclusive-nav-mesh-info)) +(define-extern map-symbol-to-nav-territory-type (function symbol nav-territory-type)) (define-extern cty-faction-evaluate-commands (function pair object)) -;; (define-extern is-faction-level-loaded? function) +(define-extern is-faction-level-loaded? (function cty-faction-level symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; formations ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype formation-info (structure) - ((composition basic :offset-assert 0) - (layout basic :offset-assert 4) + ((composition (array uint8) :offset-assert 0) + (layout (array vector) :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype formation-layout (basic) - ((formation-points UNKNOWN 10 :offset-assert 16) + ((formation-points vector 10 :inline :offset-assert 16) (num-formation-points int8 :offset-assert 176) (leader-index int8 :offset-assert 177) (__pad int16 :offset-assert 178) (scale-factor float :offset-assert 180) (estimated-radius float :offset-assert 184) - (composition basic :offset-assert 188) + (composition (array uint8) :offset-assert 188) ) :method-count-assert 10 :size-assert #xc0 :flag-assert #xa000000c0 (:methods - (formation-layout-method-9 () none) ;; 9 + (init! (_type_ formation-info) none) ;; 9 ) ) -|# -;; (define-extern *formation-layout-cross* array) -;; (define-extern *formation-composition-cross* array) -;; (define-extern *formation-layout-wedge* array) -;; (define-extern *formation-composition-wedge* array) -;; (define-extern *formation-list* object) +(define-extern *formation-layout-cross* (array vector)) +(define-extern *formation-composition-cross* (array uint8)) +(define-extern *formation-layout-wedge* (array vector)) +(define-extern *formation-composition-wedge* (array uint8)) +(define-extern *formation-list* (inline-array formation-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; formation-object ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; handle-array is already defined! +;; +++formation-object:formation-object-flag +(defenum formation-object-flag + :type uint8 + :bitfield #t + (fo0) + ) +;; ---formation-object:formation-object-flag -#| (deftype formation-object (process-focusable) - ((object-list basic :offset-assert 208) + ((object-list handle-array :offset-assert 208) (num-objects int8 :offset-assert 212) - (formation basic :offset-assert 216) - (flags uint8 :offset-assert 220) + (formation formation-layout :offset-assert 216) + (flags formation-object-flag :offset-assert 220) (controller vehicle-controller :inline :offset-assert 224) - (alert-time-offset uint64 :offset-assert 368) + (alert-time-offset time-frame :offset-assert 368) (dest-position vector :inline :offset-assert 384) (formation-transform matrix :inline :offset-assert 400) ) :method-count-assert 48 :size-assert #x1d0 :flag-assert #x30015001d0 - (:methods - (formation-object-method-30 () none) ;; 30 - (formation-object-method-31 () none) ;; 31 - (formation-object-method-32 () none) ;; 32 - (formation-object-method-33 () none) ;; 33 - (formation-object-method-34 () none) ;; 34 - (formation-object-method-35 () none) ;; 35 - (formation-object-method-36 () none) ;; 36 - (formation-object-method-37 () none) ;; 37 - (formation-object-method-38 () none) ;; 38 - (formation-object-method-39 () none) ;; 39 - (formation-object-method-40 () none) ;; 40 - (formation-object-method-41 () none) ;; 41 - (formation-object-method-42 () none) ;; 42 - (formation-object-method-43 () none) ;; 43 - (formation-object-method-44 () none) ;; 44 - (formation-object-method-45 () none) ;; 45 - (formation-object-method-46 () none) ;; 46 - (formation-object-method-47 () none) ;; 47 - ) (:state-methods active ;; 28 inactive ;; 29 ) + (:methods + (formation-object-method-30 (_type_) symbol) ;; 30 + (formation-object-method-31 (_type_) float) ;; 31 + (formation-object-method-32 (_type_) float) ;; 32 + (formation-object-method-33 (_type_) float) ;; 33 + (formation-object-method-34 (_type_) float) ;; 34 + (formation-object-method-35 (_type_) symbol) ;; 35 + (get-leader-handle (_type_) handle) ;; 36 + (formation-object-method-37 (_type_) symbol) ;; 37 + (get-target-speed (_type_ process-focusable int) float) ;; 38 + (init-collision! (_type_) none) ;; 39 + (formation-object-method-40 (_type_ vector vector int) vector) ;; 40 + (formation-event-handler (_type_ process int symbol event-message-block) object) ;; 41 + (formation-object-method-42 (_type_ handle) symbol) ;; 42 + (formation-object-method-43 (_type_ int) none) ;; 43 + (formation-object-method-44 (_type_ int) object) ;; 44 + (formation-object-method-45 (_type_) symbol) ;; 45 + (clear-objects! (_type_) none) ;; 46 + (formation-object-method-47 (_type_ handle) object) ;; 47 + ) ) -|# -#| (deftype msg-get-num-inactive (structure) - ((obj-type uint8 :offset-assert 0) + ((obj-type traffic-type :offset-assert 0) (num-inactive-out int32 :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype msg-get-inactive-objects (structure) - ((object-type-info-array uint32 :offset-assert 0) + ((object-type-info-array (inline-array traffic-object-type-info) :offset-assert 0) ) :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -;; (define-extern formation-init-by-other function) -;; (define-extern foo-hack object) -;; (define-extern formation-object-event-handler function) -;; (define-extern random-var object) +(define-extern formation-init-by-other (function traffic-object-spawn-params object :behavior formation-object)) +(define-extern foo-hack symbol) +(def-event-handler formation-object-event-handler formation-object) +(define-extern random-var int) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-obs-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype city-race-ring-info (structure) ((pos vector :inline :offset-assert 0) - (angle float :offset-assert 12) + (angle float :offset 12) (boost float :offset-assert 16) (dist float :offset-assert 20) ) @@ -49465,23 +49662,19 @@ :size-assert #x18 :flag-assert #xa00000018 (:methods - (city-race-ring-info-method-9 () none) ;; 9 ;; (city-race-ring-info-method-9 (_type_ symbol) none) + (gen-static-macro (_type_ object) none) ;; 9 ) ) -|# -#| (deftype city-ambush-spot (structure) ((pos vector :inline :offset-assert 0) - (obj-type uint8 :offset-assert 16) + (obj-type traffic-type :offset-assert 16) ) :method-count-assert 9 :size-assert #x11 :flag-assert #x900000011 ) -|# -#| (deftype city-ambush-info (structure) ((count int16 :offset-assert 0) (array (inline-array city-ambush-spot) :offset-assert 4) ;; guessed by decompiler @@ -49490,11 +49683,9 @@ :size-assert #x8 :flag-assert #xa00000008 (:methods - (city-ambush-info-method-9 () none) ;; 9 ;; (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none) + (init (_type_ traffic-object-spawn-params) none) ;; 9 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mission-squad-control ;; @@ -49513,36 +49704,63 @@ :flag-assert #x1800000021 ) -;; (define-extern city-target-type->cty-faction function) -;; (define-extern city-target-type->traffic-object-type function) -;; (define-extern symbol->city-target-type function) +;; +++cty-attack-controller:city-target-type +(defenum city-target-type + (unk1 1) + (unk2 2) + (guard-tazer 3) + (guard-rifle 4) + (guard-grenade 5) + (grunt 6) + (flitter 7) + (unknown 8) + (roboguard 9) + (turret 10) + (spydroid 11) + (roboguard-giant 12) + ) +;; ---cty-attack-controller:city-target-type + +;; +++cty-attack-controller:cty-faction +(defenum cty-faction + :type uint8 + (ff 0) + (kg 1) + (mh 2) + (invalid 128) + ) +;; ---cty-attack-controller:cty-faction + +(define-extern city-target-type->cty-faction (function city-target-type cty-faction)) +(define-extern city-target-type->traffic-object-type (function city-target-type traffic-type)) +(define-extern symbol->city-target-type (function symbol city-target-type)) (define-extern *cty-attack-controller* cty-attack-controller) -;; (define-extern initialize-cty-attack-controller function) +(define-extern initialize-cty-attack-controller (function none)) (define-extern cty-attack-reset (function symbol symbol symbol none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; flee-info ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; (deftype flee-info (structure) -; () -; :method-count-assert 14 -; :flag-assert #xe00000000 -; (:methods -; (flee-info-method-9 (_type_) none) ;; 9 -; (flee-info-method-10 (_type_) none) ;; 10 -; (flee-info-method-11 (_type_) none) ;; 11 -; (flee-info-method-12 (_type_) none) ;; 12 -; (flee-info-method-13 (_type_) none) ;; 13 -; ) -; ) +(deftype flee-info (structure) + ((pad uint8 4)) ;; added + :pack-me + :method-count-assert 14 + :flag-assert #xe00000004 + (:methods + (flee-info-method-9 (_type_ citizen nav-branch int vector float) float) ;; 9 + (flee-info-method-10 (_type_ citizen vector) nav-segment) ;; 10 + (flee-info-method-11 (_type_ citizen) none) ;; 11 + (flee-info-method-12 (_type_ citizen) none) ;; 12 + (flee-info-method-13 (_type_ citizen) none) ;; 13 + ) + ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; citizen ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype iter-seg (structure) ((self citizen :offset-assert 0) ;; guessed by decompiler (score float :offset-assert 4) @@ -49554,42 +49772,39 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -;; (define-extern *citizen-debug* object) ;; symbol -;; (define-extern citizen-init-by-other function) ;; (function traffic-object-spawn-params none :behavior citizen) -;; (define-extern citizen-travel-anim function) ;; (function int int symbol :behavior citizen) -;; (define-extern iter-seg-clear-path function) ;; (function iter-seg nav-segment symbol) -;; (define-extern iter-seg-new-dir function) ;; (function iter-seg nav-segment none) +(define-extern *citizen-debug* symbol) +(define-extern citizen-init-by-other (function traffic-object-spawn-params object :behavior citizen)) +(define-extern citizen-travel-anim (function int int symbol :behavior citizen)) +(define-extern iter-seg-clear-path (function iter-seg nav-segment symbol)) +(define-extern iter-seg-new-dir (function iter-seg nav-segment nav-segment)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; civilian ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype civilian-anim-info (structure) ((anim-index int32 2 :offset-assert 0) ;; guessed by decompiler - (anim-index-front int32 :offset-assert 0) - (anim-index-back int32 :offset-assert 4) + (anim-index-front int32 :offset 0) + (anim-index-back int32 :offset 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype civilian-global-info (basic) ((prev-yellow-hit int8 :offset-assert 4) (prev-blue-hit int8 :offset-assert 5) (knocked int32 2 :offset-assert 8) ;; guessed by decompiler - (anim-knocked-front int32 :offset-assert 8) - (anim-knocked-back int32 :offset-assert 12) + (anim-knocked-front int32 :offset 8) + (anim-knocked-back int32 :offset 12) (knocked-land int32 2 :offset-assert 16) ;; guessed by decompiler - (anim-knocked-front-land int32 :offset-assert 16) - (anim-knocked-back-land int32 :offset-assert 20) - (yellow-hit-anim civilian-anim-info 1 :offset-assert 24) ;; guessed by decompiler - (blue-hit-anim civilian-anim-info 3 :offset-assert 32) ;; guessed by decompiler + (anim-knocked-front-land int32 :offset 16) + (anim-knocked-back-land int32 :offset 20) + (yellow-hit-anim civilian-anim-info 1 :inline :offset-assert 24) ;; guessed by decompiler + (blue-hit-anim civilian-anim-info 3 :inline :offset-assert 32) ;; guessed by decompiler (anim-cover-head-start int32 :offset-assert 56) (anim-cover-head-loop int32 :offset-assert 60) (anim-cover-head-end int32 :offset-assert 64) @@ -49611,9 +49826,7 @@ :size-assert #x5d :flag-assert #x90000005d ) -|# -#| (deftype civilian (citizen) ((info civilian-global-info :offset-assert 1028) ;; guessed by decompiler (anim-panic-run int32 :offset-assert 1032) @@ -49623,7 +49836,7 @@ (anim-get-up-back int32 :offset-assert 1048) (last-second-pos vector :inline :offset-assert 1056) (last-distance float :offset-assert 1072) - (next-time uint64 :offset-assert 1080) ;; time-frame + (next-time time-frame :offset-assert 1080) ;; time-frame (dive-target-point vector :inline :offset-assert 1088) (dive-reaction float :offset-assert 1104) (allow-dive symbol :offset-assert 1108) ;; guessed by decompiler @@ -49634,92 +49847,87 @@ :method-count-assert 234 :size-assert #x464 :flag-assert #xea03f00464 - (:methods - (civilian-method-229 () none) ;; 229 - (civilian-method-230 () none) ;; 230 - (civilian-method-231 () none) ;; 231 - (civilian-method-232 () none) ;; 232 - (civilian-method-233 () none) ;; 233 - ) (:state-methods - wait-at-dest ;; 228 - exit-vehicle ;; 227 - ride ;; 226 - board-vehicle ;; 225 - avoid-danger ;; 216, old: (go-dive (_type_) none) - flee ;; 36 - on-ground ;; 218 - clear-path ;; 217, old: (civilian-method-217 (_type_ vector) symbol) - wait ;; 190 - dive ;; 219 - cower-ground ;; 222 + knocked ;; 31 knocked-recover ;; 32 + flee ;; 36 + wait ;; 190 + avoid-danger ;; 216 + clear-path ;; 217 + on-ground ;; 218 + dive ;; 219 get-up-front ;; 220 get-up-back ;; 221 - knocked ;; 31 + cower-ground ;; 222 wait-for-ride ;; 223 move-to-vehicle ;; 224 + board-vehicle ;; 225 + ride ;; 226 + exit-vehicle ;; 227 + wait-at-dest ;; 228 + ) + (:methods + (civilian-method-229 (_type_ nav-branch int vector float) float) ;; 229 + (civilian-method-230 (_type_ vector) nav-segment) ;; 230 + (civilian-method-231 (_type_) none) ;; 231 + (civilian-method-232 (_type_ vector) symbol) ;; 232 + (start-ragdoll (_type_ art-joint-anim) none) ;; 233 ) ) -|# -;; (define-extern civilian-flee-post function) ;; (function none :behavior civilian) -;; (define-extern civilian-avoid-danger-post function) ;; (function none :behavior civilian) -;; (define-extern civilian-avoid-danger-post2 function) ;; (function none :behavior civilian) -;; (define-extern civilian-clear-path-post function) ;; (function none :behavior civilian) -;; (define-extern civilian-clear-path-post2 function) ;; (function none :behavior civilian) -;; (define-extern civilian-falling-post function) ;; (function none :behavior civilian) -;; (define-extern do-spline2 function) ;; (function vector vector vector vector vector float vector) +(define-extern civilian-flee-post (function none :behavior civilian)) +(define-extern civilian-avoid-danger-post (function none :behavior civilian)) +(define-extern civilian-avoid-danger-post2 (function none :behavior civilian)) +(define-extern civilian-clear-path-post (function none :behavior civilian)) +(define-extern civilian-clear-path-post2 (function none :behavior civilian)) +(define-extern civilian-falling-post (function none :behavior civilian)) +(define-extern do-spline2 (function vector vector vector vector vector float vector)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; guard-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype guard-anim-info (structure) ((anim-index int32 2 :offset-assert 0) ;; guessed by decompiler - (anim-index-front int32 :offset-assert 0) - (anim-index-back int32 :offset-assert 4) + (anim-index-front int32 :offset 0) + (anim-index-back int32 :offset 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype guard-global-info (basic) ((prev-yellow-hit int8 :offset-assert 4) (prev-blue-hit int8 :offset-assert 5) (knocked int32 2 :offset-assert 8) ;; guessed by decompiler (knocked-land int32 2 :offset-assert 16) ;; guessed by decompiler - (anim-knocked-front int32 :offset-assert 8) - (anim-knocked-back int32 :offset-assert 12) - (anim-knocked-front-land int32 :offset-assert 16) - (anim-knocked-back-land int32 :offset-assert 20) - (yellow-hit-anim guard-anim-info 2 :offset-assert 24) ;; guessed by decompiler - (yellow-land-anim guard-anim-info 2 :offset-assert 40) ;; guessed by decompiler + (anim-knocked-front int32 :offset 8) + (anim-knocked-back int32 :offset 12) + (anim-knocked-front-land int32 :offset 16) + (anim-knocked-back-land int32 :offset 20) + (yellow-hit-anim guard-anim-info 2 :inline :offset-assert 24) ;; guessed by decompiler + (yellow-land-anim guard-anim-info 2 :inline :offset-assert 40) ;; guessed by decompiler (blue-hit-anim int32 1 :offset-assert 56) ;; guessed by decompiler + (pad uint8 4) ;; added ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype guard-shoot-info (structure) ((anim-index int32 :offset-assert 0) (start float :offset-assert 4) (end float :offset-assert 8) ) + :pack-me :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype range (structure) ((start float :offset-assert 0) (end float :offset-assert 4) @@ -49728,9 +49936,7 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype crimson-guard-collide-shape (collide-shape-moving) () :method-count-assert 68 @@ -49738,28 +49944,28 @@ :flag-assert #x44000001dc ;; field penetrate is likely a value type. field penetrate is likely a value type. ) -|# -#| (deftype crimson-guard (citizen) - ((info guard-global-info :offset-assert 1028) ;; guessed by decompiler + ((squad ff-squad-control :override) + (root crimson-guard-collide-shape :override) + (info guard-global-info :offset-assert 1028) ;; guessed by decompiler (hit-face uint32 :offset-assert 1032) (anim-get-up-front int32 :offset-assert 1036) (anim-get-up-back int32 :offset-assert 1040) (small-hit int32 :offset-assert 1044) (yellow-anim uint32 :offset-assert 1048) - (guard-type uint8 :offset-assert 1052) + (guard-type guard-type :offset-assert 1052) (settings squad-unit-settings :offset-assert 1056) ;; traffic-guard-type-settings - (next-time uint64 :offset-assert 1064) ;; time-frame - (last-time-see-target uint64 :offset-assert 1072) ;; time-frame + (next-time time-frame :offset-assert 1064) ;; time-frame + (last-time-see-target time-frame :offset-assert 1072) ;; time-frame (joint joint-mod :offset-assert 1080) ;; guessed by decompiler (joint-enable symbol :offset-assert 1084) ;; guessed by decompiler (already-shot symbol :offset-assert 1088) ;; guessed by decompiler (miss-amount float :offset-assert 1092) (l-control lightning-control :offset-assert 1096) ;; guessed by decompiler - (next-shot uint64 :offset-assert 1104) ;; int64 - (anim-shoot guard-shoot-info 3 :offset-assert 1112) ;; guessed by decompiler - (transport uint64 :offset-assert 1152) ;; handle + (next-shot time-frame :offset-assert 1104) ;; int64 + (anim-shoot guard-shoot-info 3 :inline :offset-assert 1112) ;; guessed by decompiler + (transport handle :offset-assert 1152) ;; handle (transport-side uint32 :offset-assert 1160) (target-flags uint8 :offset-assert 1164) (target-pos vector :inline :offset-assert 1168) @@ -49774,123 +49980,123 @@ (target-self-xz-dist float :offset-assert 1300) (grenade-guard-min-player-dist float :offset-assert 1304) (flee-behavior flee-info :inline :offset-assert 1308) - (last-check-player-time uint64 :offset-assert 1312) + (last-check-player-time time-frame :offset-assert 1312) (num-times-reloading-interrupted int32 :offset-assert 1320) - (total-flee-time uint64 :offset-assert 1328) - (last-fire-time uint64 :offset-assert 1336) + (total-flee-time time-frame :offset-assert 1328) + (last-fire-time time-frame :offset-assert 1336) (ammo-count int8 :offset-assert 1344) - (urgent-fire basic :offset-assert 1348) - (last-onscreen-time uint64 :offset-assert 1352) + (urgent-fire symbol :offset-assert 1348) + (last-onscreen-time time-frame :offset-assert 1352) (target-y-angle float :offset-assert 1360) ;; degrees - (rand-state-time uint64 :offset-assert 1368) - (pursuit-start-time uint64 :offset-assert 1376) + (rand-state-time time-frame :offset-assert 1368) + (pursuit-start-time time-frame :offset-assert 1376) (last-visible-target-pos vector :inline :offset-assert 1392) (lazer-sound sound-id :offset-assert 1408) ;; guessed by decompiler (move-position vector :inline :offset-assert 1424) (move-index int32 :offset-assert 1440) - (reloading-ammo uint64 :offset-assert 1448) - (guard-riot-shield uint64 :offset-assert 1456) + (reloading-ammo handle :offset-assert 1448) + (guard-riot-shield handle :offset-assert 1456) (guard-shield-rotate-y-degrees float :offset-assert 1464) (attack-hit-shield-type uint64 :offset-assert 1472) (current-shield-logic uint64 :offset-assert 1480) (target-status squad-target-status :inline :offset-assert 1488) (minimap connection-minimap :offset-assert 1556) (other-side symbol :offset-assert 1560) ;; guessed by decompiler - (last-choose-new-enemy-time uint64 :offset-assert 1568) + (last-choose-new-enemy-time time-frame :offset-assert 1568) (last-quick-target-spot-angle float :offset-assert 1576) - (next-update-target-time uint64 :offset-assert 1584) - (last-player-attack-time uint64 :offset-assert 1592) + (next-update-target-time time-frame :offset-assert 1584) + (last-player-attack-time time-frame :offset-assert 1592) (player-attack-count int32 :offset-assert 1600) ) :method-count-assert 291 :size-assert #x644 :flag-assert #x12305d00644 + (:state-methods + get-up-front ;; 216 + get-up-back ;; 217 + search ;; 218 + attack ;; 219 + arrest ;; 220 + gun-shoot ;; 221 + grenade-throw ;; 222 + grenade-throw-post-reloading ;; 223 + grenade-throw-post-retreating ;; 224 + exit-transport ;; 225 + waiting-ambush ;; 226 + close-attack ;; 227 + attack-tazer ;; 228 + knocked-off-vehicle ;; 229 + roll-right ;; 230 + roll-left ;; 231 + close-attack-active ;; 232 + flee-danger ;; 233 + grenade-hostile ;; 234 + rifle-hostile ;; 235 + tazer-hostile ;; 236 + undefined0 ;; 237 + undefined1 ;; 238 + undefined2 ;; 239 + undefined3 ;; 240 + undefined4 ;; 241 + undefined5 ;; 242 + undefined6 ;; 243 + undefined7 ;; 244 + undefined8 ;; 245 + undefined9 ;; 246 + undefined10 ;; 247 + undefined11 ;; 248 + undefined12 ;; 249 + rifle-reload ;; 250 + ) (:methods - (crimson-guard-method-216 () none) ;; 216 ;; (crimson-guard-method-216 (_type_) symbol) - (crimson-guard-method-217 () none) ;; 217 ;; (crimson-guard-method-217 (_type_ vector vector vector) int) - (crimson-guard-method-218 () none) ;; 218 ;; (crimson-guard-method-218 (_type_ vector) none) - (crimson-guard-method-219 () none) ;; 219 ;; (crimson-guard-method-219 (_type_) none) - (crimson-guard-method-220 () none) ;; 220 ;; (crimson-guard-method-220 (_type_) none) - (crimson-guard-method-221 () none) ;; 221 ;; (crimson-guard-method-221 (_type_) none) - (crimson-guard-method-222 () none) ;; 222 ;; (crimson-guard-method-222 (_type_) none) - (crimson-guard-method-223 () none) ;; 223 ;; (crimson-guard-method-223 (_type_ float) none) - (crimson-guard-method-224 () none) ;; 224 ;; (crimson-guard-method-224 (_type_ vector) float) - (crimson-guard-method-225 () none) ;; 225 ;; (crimson-guard-method-225 (_type_ uint symbol) none) - (crimson-guard-method-226 () none) ;; 226 ;; (crimson-guard-method-226 (_type_) none) - (crimson-guard-method-227 () none) ;; 227 - (crimson-guard-method-228 () none) ;; 228 - (crimson-guard-method-229 () none) ;; 229 - (crimson-guard-method-230 () none) ;; 230 - (crimson-guard-method-231 () none) ;; 231 - (crimson-guard-method-232 () none) ;; 232 - (crimson-guard-method-233 () none) ;; 233 - (crimson-guard-method-234 () none) ;; 234 - (crimson-guard-method-235 () none) ;; 235 - (crimson-guard-method-236 () none) ;; 236 - (crimson-guard-method-237 () none) ;; 237 - (crimson-guard-method-238 () none) ;; 238 - (crimson-guard-method-239 () none) ;; 239 - (crimson-guard-method-240 () none) ;; 240 - (crimson-guard-method-241 () none) ;; 241 - (crimson-guard-method-242 () none) ;; 242 - (crimson-guard-method-243 () none) ;; 243 - (crimson-guard-method-244 () none) ;; 244 - (crimson-guard-method-245 () none) ;; 245 - (crimson-guard-method-246 () none) ;; 246 - (crimson-guard-method-247 () none) ;; 247 - (crimson-guard-method-248 () none) ;; 248 - (crimson-guard-method-249 () none) ;; 249 - (crimson-guard-method-250 () none) ;; 250 - (crimson-guard-method-251 () none) ;; 251 - (crimson-guard-method-252 () none) ;; 252 - (crimson-guard-method-253 () none) ;; 253 - (crimson-guard-method-254 () none) ;; 254 - (crimson-guard-method-255 () none) ;; 255 - (crimson-guard-method-256 () none) ;; 256 - (crimson-guard-method-257 () none) ;; 257 - (crimson-guard-method-258 () none) ;; 258 - (crimson-guard-method-259 () none) ;; 259 - (crimson-guard-method-260 () none) ;; 260 - (crimson-guard-method-261 () none) ;; 261 - (crimson-guard-method-262 () none) ;; 262 - (crimson-guard-method-263 () none) ;; 263 - (crimson-guard-method-264 () none) ;; 264 - (crimson-guard-method-265 () none) ;; 265 - (crimson-guard-method-266 () none) ;; 266 - (crimson-guard-method-267 () none) ;; 267 - (crimson-guard-method-268 () none) ;; 268 - (crimson-guard-method-269 () none) ;; 269 - (crimson-guard-method-270 () none) ;; 270 - (crimson-guard-method-271 () none) ;; 271 - (crimson-guard-method-272 () none) ;; 272 - (crimson-guard-method-273 () none) ;; 273 - (crimson-guard-method-274 () none) ;; 274 - (crimson-guard-method-275 () none) ;; 275 - (crimson-guard-method-276 () none) ;; 276 - (crimson-guard-method-277 () none) ;; 277 - (crimson-guard-method-278 () none) ;; 278 - (crimson-guard-method-279 () none) ;; 279 - (crimson-guard-method-280 () none) ;; 280 - (crimson-guard-method-281 () none) ;; 281 - (crimson-guard-method-282 () none) ;; 282 - (crimson-guard-method-283 () none) ;; 283 - (crimson-guard-method-284 () none) ;; 284 - (crimson-guard-method-285 () none) ;; 285 - (crimson-guard-method-286 () none) ;; 286 - (crimson-guard-method-287 () none) ;; 287 - (crimson-guard-method-288 () none) ;; 288 - (crimson-guard-method-289 () none) ;; 289 - (crimson-guard-method-290 () none) ;; 290 + (crimson-guard-method-251 (_type_) none) ;; 251 + (crimson-guard-method-252 (_type_) none) ;; 252 + (crimson-guard-method-253 (_type_) none) ;; 253 + (crimson-guard-method-254 (_type_) none) ;; 254 + (crimson-guard-method-255 (_type_) none) ;; 255 + (crimson-guard-method-256 (_type_) symbol) ;; 256 + (crimson-guard-method-257 (_type_) symbol) ;; 257 + (crimson-guard-method-258 (_type_ vector vector vector) int) ;; 258 + (crimson-guard-method-259 (_type_ vector) none) ;; 259 + (crimson-guard-method-260 (_type_) none) ;; 260 + (crimson-guard-method-261 (_type_) none) ;; 261 + (crimson-guard-method-262 (_type_) none) ;; 262 + (crimson-guard-method-263 (_type_) none) ;; 263 + (crimson-guard-method-264 (_type_) none) ;; 264 + (crimson-guard-method-265 (_type_ float) none) ;; 265 + (crimson-guard-method-266 (_type_ vector) float) ;; 266 + (crimson-guard-method-267 (_type_ guard-type symbol) none) ;; 267 + (crimson-guard-method-268 (_type_) object) ;; 268 + (crimson-guard-method-269 (_type_ process-focusable) object) ;; 269 + (crimson-guard-method-270 (_type_) symbol) ;; 270 + (crimson-guard-method-271 (_type_) symbol) ;; 271 + (crimson-guard-method-272 (_type_) symbol) ;; 272 + (crimson-guard-method-273 (_type_) none) ;; 273 + (crimson-guard-method-274 (_type_) none) ;; 274 + (crimson-guard-method-275 (_type_) none) ;; 275 + (crimson-guard-method-276 (_type_) none) ;; 276 + (crimson-guard-method-277 (_type_) none) ;; 277 + (crimson-guard-method-278 (_type_) none) ;; 278 + (crimson-guard-method-279 (_type_) none) ;; 279 + (crimson-guard-method-280 (_type_) symbol) ;; 280 + (crimson-guard-method-281 (_type_) none) ;; 281 + (crimson-guard-method-282 (_type_ vector traffic-target-formation (pointer float) int) symbol) ;; 282 + (crimson-guard-method-283 (_type_) float) ;; 283 + (crimson-guard-method-284 (_type_ vector) vector) ;; 284 + (crimson-guard-method-285 (_type_ int) int) ;; 285 + (crimson-guard-method-286 (_type_) int) ;; 286 + (crimson-guard-method-287 (_type_ process-focusable) float) ;; 287 + (crimson-guard-method-288 (_type_ process-focusable) float) ;; 288 + (crimson-guard-method-289 (_type_ float) none) ;; 289 + (crimson-guard-method-290 (_type_) process) ;; 290 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; traffic-util ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern add-debug-line-arrow function) ;; (function none) +(define-extern add-debug-line-arrow (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; traffic-engine ;; @@ -49906,8 +50112,17 @@ :flag-assert #x900000020 ) -;; (define-extern *traffic-suppress-activation* object) ;; symbol -;; (define-extern get-level-nav-graph-by-id function) ;; (function int nav-graph) +(deftype traffic-engine-stack-var0 (structure) + ((params traffic-object-spawn-params :inline :offset 0) + (vec0 vector :inline :offset 128) + (vec1 vector :inline :offset 144) + (vec2 vector :inline :offset 160) + (vec3 vector :inline :offset 176) + ) + ) + +(define-extern *traffic-suppress-activation* symbol) +(define-extern get-level-nav-graph-by-id (function int nav-graph)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; traffic-manager ;; @@ -49929,9 +50144,9 @@ ) (:methods (traffic-manager-method-16 (_type_) none) ;; 16 ;; (update (_type_) none) - (traffic-manager-method-17 (_type_) none) ;; 17 ;; (spawn-all (_type_) none) + (spawn-all (_type_) none) ;; 17 ;; (spawn-all (_type_) none) (traffic-manager-method-18 (_type_) none) ;; 18 ;; (kill-excess-once (_type_) none) - (traffic-manager-method-19 (_type_) none) ;; 19 ;; (kill-all-inactive (_type_) none) + (kill-all (_type_) none) ;; 19 ;; (kill-all-inactive (_type_) none) (traffic-manager-method-20 (_type_) none) ;; 20 ;; (reset-and-init (_type_) none) (traffic-manager-method-21 (_type_) none) ;; 21 ;; (init-params (_type_) none) (traffic-manager-method-22 (_type_) none) ;; 22 @@ -49964,12 +50179,37 @@ :flag-assert #x900000005 ) +(declare-type citizen-norm citizen) +(define-extern citizen-norm type) +(declare-type citizen-chick citizen) +(define-extern citizen-chick type) +(declare-type citizen-fat citizen) +(define-extern citizen-fat type) +(declare-type metalhead-predator citizen) +(define-extern metalhead-predator type) +(declare-type metalhead-grunt citizen) +(define-extern metalhead-grunt type) +(declare-type metalhead-flitter citizen) +(define-extern metalhead-flitter type) +(declare-type wlander-male citizen) +(define-extern wlander-male type) +(declare-type wlander-female citizen) +(define-extern wlander-female type) +(declare-type crimson-guard citizen) +(define-extern crimson-guard type) +(declare-type roboguard-city citizen) +(define-extern roboguard-city type) +(declare-type flying-turret citizen) +(define-extern flying-turret type) +(declare-type spydroid citizen) +(define-extern spydroid type) + (define-extern *traffic-engine* traffic-engine) (define-extern *traffic-fast-spawn* symbol) (define-extern draw-city-info (function city-level-info vis-grid-pos none)) -(define-extern formation-spawn function) -(define-extern type-from-traffic-object-type function) -(define-extern citizen-spawn (function process type traffic-object-spawn-params process-drawable)) +(define-extern formation-spawn (function process type formation-info formation-object)) +(define-extern type-from-traffic-object-type (function traffic-type type)) +(define-extern citizen-spawn (function process traffic-type traffic-object-spawn-params process-drawable)) (define-extern traffic-object-spawn (function process traffic-object-spawn-params process-drawable)) (define-extern *traffic-vehicle-level-borrow-list* object) (define-extern *traffic-vehicle-level-sound-list* object) @@ -49987,19 +50227,17 @@ ;; desresc-path ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype desert-transport-node (structure) ((pos vector :inline :offset-assert 0) - (is-stop? basic :offset-assert 16) + (is-stop? symbol :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -;; (define-extern *desresc-transport-path-0* array) -;; (define-extern *desresc-transport-path-1* array) +(define-extern *desresc-transport-path-0* (array desert-transport-node)) +(define-extern *desresc-transport-path-1* (array desert-transport-node)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; desresc-texture ;; @@ -50011,36 +50249,31 @@ ;; desert-rescue ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype rescue-speech-instance (speech-instance) () :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype desert-rescue-transport-init-params (structure) ((pos vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) - (path-pts uint32 :offset-assert 32) + (path-pts (inline-array vector) :offset-assert 32) (num-pts int32 :offset-assert 36) - (desresc-path basic :offset-assert 40) + (desresc-path (array desert-transport-node) :offset-assert 40) ) :method-count-assert 9 :size-assert #x2c :flag-assert #x90000002c ) -|# -#| (deftype desert-passenger-info (structure) ((passenger-pos vector :inline :offset-assert 0) (beacon-pos vector :inline :offset-assert 16) (transport-angle float :offset-assert 32) - (is-final? basic :offset-assert 36) - (total-time uint64 :offset-assert 40) + (is-final? symbol :offset-assert 36) + (total-time time-frame :offset-assert 40) (num-marauders int8 :offset-assert 48) (sandstorm-intensity float :offset-assert 52) ) @@ -50048,62 +50281,57 @@ :size-assert #x38 :flag-assert #x900000038 ) -|# -#| (deftype task-manager-desert-rescue (task-manager) ((current-passenger-index int8 :offset-assert 240) - (current-passenger uint64 :offset-assert 248) - (current-task-arrow uint64 :offset-assert 256) - (current-transport uint64 :offset-assert 264) - (taxi-timer uint64 :offset-assert 272) - (num-enemies-remaining int8 :offset-assert 288) - (current-enemy uint64 :offset-assert 296) - (jak-vehicle uint64 :offset-assert 304) - (dust-storm uint64 :offset-assert 312) - (passenger-pos basic :offset-assert 320) - (desresc-path basic :offset-assert 324) + (current-passenger handle :offset-assert 248) + (current-task-arrow handle :offset-assert 256) + (current-transport handle :offset-assert 264) + (taxi-timer time-frame :offset-assert 272) + (num-enemies-remaining int8 :offset 288) + (current-enemy handle :offset-assert 296) + (jak-vehicle handle :offset-assert 304) + (dust-storm handle :offset-assert 312) + (passenger-pos (array desert-passenger-info) :offset-assert 320) + (desresc-path (array desert-transport-node) :offset-assert 324) ) :method-count-assert 50 :size-assert #x148 :flag-assert #x3200d00148 - (:methods - (task-manager-desert-rescue-method-42 () none) ;; 42 - (task-manager-desert-rescue-method-43 () none) ;; 43 - (task-manager-desert-rescue-method-44 () none) ;; 44 - (task-manager-desert-rescue-method-45 () none) ;; 45 - (task-manager-desert-rescue-method-46 () none) ;; 46 - (task-manager-desert-rescue-method-47 () none) ;; 47 - (task-manager-desert-rescue-method-48 () none) ;; 48 - (task-manager-desert-rescue-method-49 () none) ;; 49 - ) (:state-methods - finish-task ;; 34 - drop-off-passenger ;; 33 pickup-passenger ;; 32 + drop-off-passenger ;; 33 + finish-task ;; 34 fight ;; 35 - wait-for-vehicle-return ;; 39 - play-dead-wlander-movie ;; 38 race-home ;; 36 rescue-start ;; 37 - fail-delay ;; 41 - active ;; 15 + play-dead-wlander-movie ;; 38 + wait-for-vehicle-return ;; 39 investigate-dead-wlander ;; 40 - wait ;; 14 + fail-delay ;; 41 + ) + (:methods + (task-manager-desert-rescue-method-42 (_type_) none) ;; 42 + (spawn-sat (_type_) none) ;; 43 + (task-manager-desert-rescue-method-44 (_type_) none) ;; 44 + (task-manager-desert-rescue-method-45 (_type_ int) none) ;; 45 + (init-transport-params! (_type_ desert-rescue-transport-init-params) none) ;; 46 + (task-manager-desert-rescue-method-47 (_type_) time-frame) ;; 47 + (task-manager-desert-rescue-method-48 (_type_) float) ;; 48 + (task-manager-desert-rescue-method-49 (_type_) none) ;; 49 ) ) -|# -#| (deftype transport-path-control (path-control) () :method-count-assert 32 :size-assert #x24 :flag-assert #x2000000024 + (:methods + (new (symbol type process-drawable (inline-array vector) int) _type_) ;; 0 + ) ) -|# -#| (deftype desert-rescue-transport (process-focusable) ((pitch float :offset-assert 208) (target-pitch float :offset-assert 212) @@ -50116,108 +50344,105 @@ (current-stop-node-index int16 :offset-assert 238) (move-speed float :offset-assert 240) (target-move-speed float :offset-assert 244) - (has-passenger? basic :offset-assert 248) + (has-passenger? symbol :offset-assert 248) (seek-speed float :offset-assert 252) - (is-braking? basic :offset-assert 256) - (teleport-when-ready? basic :offset-assert 260) - (die-when-ready? basic :offset-assert 264) - (is-last-passenger? basic :offset-assert 268) - (tread1 uint64 :offset-assert 272) - (tread2 uint64 :offset-assert 280) + (is-braking? symbol :offset-assert 256) + (teleport-when-ready? symbol :offset-assert 260) + (die-when-ready? symbol :offset-assert 264) + (is-last-passenger? symbol :offset-assert 268) + (tread1 handle :offset-assert 272) + (tread2 handle :offset-assert 280) (tread-frequency uint8 :offset-assert 288) (tread-last-spawn-index uint8 :offset-assert 289) - (desresc-path basic :offset-assert 292) - (can-board? basic :offset-assert 296) + (desresc-path (array desert-transport-node) :offset-assert 292) + (can-board? symbol :offset-assert 296) ) :method-count-assert 46 :size-assert #x12c :flag-assert #x2e00b0012c - (:methods - (desert-rescue-transport-method-28 () none) ;; 28 - (desert-rescue-transport-method-30 () none) ;; 30 - (desert-rescue-transport-method-34 () none) ;; 34 - (desert-rescue-transport-method-35 () none) ;; 35 - (desert-rescue-transport-method-36 () none) ;; 36 - (desert-rescue-transport-method-37 () none) ;; 37 - (desert-rescue-transport-method-38 () none) ;; 38 - (desert-rescue-transport-method-39 () none) ;; 39 - (desert-rescue-transport-method-40 () none) ;; 40 - (desert-rescue-transport-method-41 () none) ;; 41 - (desert-rescue-transport-method-42 () none) ;; 42 - (desert-rescue-transport-method-43 () none) ;; 43 - (desert-rescue-transport-method-44 () none) ;; 44 - (desert-rescue-transport-method-45 () none) ;; 45 - ) (:state-methods + undefined0 ;; 28, not defined + die ;; 29 + undefined1 ;; 30, not defined following-path ;; 31 waiting-for-passenger ;; 32 preparing-for-launch ;; 33 - die ;; 29 + ) + (:methods + (desert-rescue-transport-method-34 (_type_) float) ;; 34 + (probe-ground (_type_ vector) float) ;; 35 + (get-node-stop-idx (_type_) int) ;; 36 + (desert-rescue-transport-method-37 (_type_ int int) quaternion) ;; 37 + (desert-rescue-transport-method-38 (_type_) quaternion) ;; 38 + (desert-rescue-transport-method-39 (_type_) quaternion) ;; 39 + (desert-rescue-transport-method-40 (_type_) none) ;; 40 + (desert-rescue-transport-method-41 (_type_) none) ;; 41 + (probe-ground2 (_type_ vector vector) float) ;; 42 + (desert-rescue-transport-method-43 (_type_) none) ;; 43 + (desert-rescue-transport-method-44 (_type_) symbol) ;; 44 + (desert-rescue-transport-method-45 (_type_) symbol) ;; 45 + ) + (:states + idle-hidden + hidden-idle ) ) -|# -;; (define-extern *desert-rescue-speech-list* object) -;; (define-extern *rescue-speech* array) -;; (define-extern *rescue-speech-1* array) -;; (define-extern *rescue-speech-2* array) -;; (define-extern *rescue-speech-array* array) -;; (define-extern *duststorm-gate-pos* object) -;; (define-extern *duststorm-wind-angle* object) -;; (define-extern *home-pos* object) -;; (define-extern *snake-start-pos* object) -;; (define-extern *snake-start-angle* object) -;; (define-extern *passenger-pos* array) -;; (define-extern *__transport-path__* object) -;; (define-extern *transport-tread-settings* object) -;; (define-extern *replace-last* object) -;; (define-extern *frequency* object) -;; (define-extern desert-transport-event-handler function) -;; (define-extern desert-rescue-transport-init-by-other function) -;; (define-extern *transport-move-speed* object) -;; (define-extern idle-hidden state) -;; (define-extern hidden-idle state) -;; (define-extern *nav-mesh-aid* object) +(define-extern *desert-rescue-speech-list* (inline-array talker-speech-class)) +(define-extern *rescue-speech* (array speech-info)) +(define-extern *rescue-speech-1* (array speech-info)) +(define-extern *rescue-speech-2* (array speech-info)) +(define-extern *rescue-speech-array* (array (array speech-info))) +(define-extern *duststorm-gate-pos* vector) +(define-extern *duststorm-wind-angle* float) +(define-extern *home-pos* vector) +(define-extern *snake-start-pos* vector) +(define-extern *snake-start-angle* float) +(define-extern *passenger-pos* (array desert-passenger-info)) +(define-extern *__transport-path__* (inline-array vector)) +(define-extern *transport-tread-settings* light-trail-composition) +(define-extern *replace-last* object) +(define-extern *frequency* int) +(def-event-handler desert-transport-event-handler desert-rescue-transport) +(define-extern desert-rescue-transport-init-by-other (function desert-rescue-transport-init-params object :behavior desert-rescue-transport)) +(define-extern *transport-move-speed* float) +(define-extern *nav-mesh-aid* int) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; desert-rescue-bbush ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype task-manager-desert-rescue-bbush (task-manager-desert-rescue) - ((actor-group uint32 :offset-assert 324) - (actor-group-count int32 :offset-assert 328) - (final-timeout uint64 :offset-assert 332) + ((actor-group (pointer actor-group) :offset-assert 328) + (actor-group-count int32 :offset-assert 332) + (final-timeout time-frame :offset-assert 336) ) :method-count-assert 52 :size-assert #x158 :flag-assert #x3400e00158 (:state-methods - pickup-passenger ;; 32 - finish-bbush ;; 51 - show-finish ;; 50 drop-off-passenger ;; 33 - active ;; 15 + pickup-passenger ;; 32 + show-finish ;; 50 + finish-bbush ;; 51 ) ) -|# -;; (define-extern *bbush-passenger-pos* object) -;; (define-extern *__bbush-transport-path__* object) +(define-extern *bbush-passenger-pos* (array desert-passenger-info)) +(define-extern *__bbush-transport-path__* (inline-array vector)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wland-passenger ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wland-passenger (citizen) - ((task-arrow uint64 :offset-assert 1032) + ((task-arrow handle :offset-assert 1032) (start-pos vector :inline :offset-assert 1040) (seat int32 :offset-assert 1056) - (transport uint64 :offset-assert 1064) - (is-dead? basic :offset-assert 1072) - (align basic :offset-assert 148) - (front-back-interp float :offset-assert 1080) + (transport handle :offset-assert 1064) + (is-dead? symbol :offset-assert 1072) + ; (align basic :offset-assert 148) + (front-back-interp float :offset 1080) (left-right-interp float :offset-assert 1084) (up-down-interp float :offset-assert 1088) (original-trans vector :inline :offset-assert 1104) @@ -50225,65 +50450,61 @@ (dest-quat quaternion :inline :offset-assert 1136) (original-quat quaternion :inline :offset-assert 1152) (backup-nav-mask uint32 :offset-assert 1168) - (task-man uint64 :offset-assert 1176) - (nav-sphere-handle uint64 :offset-assert 1184) + (task-man handle :offset-assert 1176) + (nav-sphere-handle handle :offset-assert 1184) ) :method-count-assert 232 :size-assert #x4a8 :flag-assert #xe8043004a8 - (:methods - (wland-passenger-method-226 () none) ;; 226 - (wland-passenger-method-227 () none) ;; 227 - (wland-passenger-method-228 () none) ;; 228 - (wland-passenger-method-229 () none) ;; 229 - (wland-passenger-method-230 () none) ;; 230 - (wland-passenger-method-231 () none) ;; 231 - ) (:state-methods - lying-prone ;; 223 - ride-start ;; 224 + active ;; 34 + inactive ;; 191 + boarding ;; 216 + returning ;; 217 + board-vehicle ;; 218 ride ;; 219 exit-vehicle ;; 220 - board-vehicle ;; 218 - active ;; 34 - boarding ;; 216 - inactive ;; 191 - returning ;; 217 approaching-transport ;; 221 - wait-for-transport-to-open ;; 225 entering-transport ;; 222 + lying-prone ;; 223 + ride-start ;; 224 + wait-for-transport-to-open ;; 225 + ) + (:methods + (toggle-rod-of-god (_type_) none) ;; 226 + (can-board-vehicle? (_type_) symbol) ;; 227 + (wland-passenger-method-228 (_type_ vector) symbol) ;; 228 + (wland-passenger-method-229 (_type_ vector) float) ;; 229 + (wland-passenger-method-230 (_type_ vehicle vector) vector) ;; 230 + (wland-passenger-method-231 (_type_) float) ;; 231 ) ) -|# -#| (deftype wland-passenger-init-by-other-params (traffic-object-spawn-params) - ((nav-branch nav-branch :offset-assert 24) - (is-dead? basic :offset-assert 116) - (parent uint64 :offset-assert 120) + (; (nav-branch nav-branch :offset-assert 24) + (is-dead? symbol :offset-assert 116) + (parent handle :offset-assert 120) ) :method-count-assert 9 :size-assert #x80 :flag-assert #x900000080 ) -|# -;; (define-extern probe-for-transport-ground function) -;; (define-extern compute-y-height function) -;; (define-extern compute-transport-approach-pt function) -;; (define-extern update-nav-sphere function) -;; (define-extern do-spline3 function) -;; (define-extern *progress* object) -;; (define-extern wland-passenger-wcar-anim-loop function) -;; (define-extern wland-passenger-init-by-other function) -;; (define-extern *wland-passenger-nav-enemy-info* nav-enemy-info) -;; (define-extern spawn-wlander function) +(define-extern probe-for-transport-ground (function vector float)) +(define-extern compute-y-height (function process-focusable vector float)) +(define-extern compute-transport-approach-pt (function process-focusable vector vector)) +(define-extern update-nav-sphere (function handle process-focusable vector object)) +(define-extern do-spline3 (function vector vector vector vector vector float vector)) +(define-extern *progress* object) +(define-extern wland-passenger-wcar-anim-loop (function none :behavior wland-passenger)) +(define-extern wland-passenger-init-by-other (function wland-passenger-init-by-other-params object :behavior wland-passenger)) +(define-extern *wland-passenger-nav-enemy-info* nav-enemy-info) +(define-extern spawn-wlander (function desert-passenger-info process (pointer wland-passenger))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; rope-system-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype rope-knot (structure) ((pos vector :inline :offset-assert 0) (prev-pos vector :inline :offset-assert 16) @@ -50294,106 +50515,105 @@ :size-assert #x34 :flag-assert #x900000034 ) -|# -#| (deftype rope-knot-constraint (structure) ((dir vector :inline :offset-assert 0) (length float :offset-assert 16) (max-angle float :offset-assert 20) (rest-seek-rate float :offset-assert 24) - (constrained-angle-time uint64 :offset-assert 32) + (constrained-angle-time time-frame :offset-assert 32) ) :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) -|# -#| (deftype rope-knot-constraint-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data rope-knot-constraint :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype rope-knot-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data rope-knot :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| +;; +++rope-system-h:rope-system-flag +(defenum rope-system-flag + :type uint64 + :bitfield #t + (rs0 0) + (rs1 1) + (rs2 2) + (rs3 3) + (rs4 4) + (rs5 5) + (rs6 6) + ) +;; ---rope-system-h:rope-system-flag + (deftype rope-system (basic) - ((knots basic :offset-assert 4) - (knot-constraints basic :offset-assert 8) + ((knots rope-knot-array :offset-assert 4) + (knot-constraints rope-knot-constraint-array :offset-assert 8) (accum-force vector :inline :offset-assert 16) (gravity float :offset-assert 32) (gravity-dir vector :inline :offset-assert 48) (drag float :offset-assert 64) - (flags uint64 :offset-assert 72) + (flags rope-system-flag :offset-assert 72) (angular-mass-seek-rate float :offset-assert 80) ) :method-count-assert 24 :size-assert #x54 :flag-assert #x1800000054 (:methods - (rope-system-method-9 () none) ;; 9 - (rope-system-method-10 () none) ;; 10 - (rope-system-method-11 () none) ;; 11 - (rope-system-method-12 () none) ;; 12 - (rope-system-method-13 () none) ;; 13 - (rope-system-method-14 () none) ;; 14 - (rope-system-method-15 () none) ;; 15 - (rope-system-method-16 () none) ;; 16 - (rope-system-method-17 () none) ;; 17 - (rope-system-method-18 () none) ;; 18 - (rope-system-method-19 () none) ;; 19 - (rope-system-method-20 () none) ;; 20 - (rope-system-method-21 () none) ;; 21 - (rope-system-method-22 () none) ;; 22 - (rope-system-method-23 () none) ;; 23 + (init! (_type_ int) object) ;; 9 + (rope-system-method-10 (_type_) vector) ;; 10 + (rope-system-method-11 (_type_) vector) ;; 11 + (rope-system-method-12 (_type_ float) none) ;; 12 + (rope-system-method-13 (_type_) symbol) ;; 13 + (rope-system-method-14 (_type_) symbol) ;; 14 + (rope-system-method-15 (_type_) symbol) ;; 15 + (rope-system-method-16 (_type_ vector vector int) vector) ;; 16 + (rope-system-method-17 (_type_) symbol) ;; 17 + (rope-system-method-18 (_type_) object) ;; 18 + (rope-system-method-19 (_type_) symbol) ;; 19 + (rope-system-method-20 (_type_) symbol) ;; 20 + (rope-system-method-21 (_type_) rope-system-flag) ;; 21 + (rope-system-method-22 (_type_) rope-system-flag) ;; 22 + (rope-system-method-23 (_type_) symbol) ;; 23 ) ) -|# -#| (deftype rope-joint-info (structure) ((joint-index int16 :offset-assert 0) ) + :pack-me :method-count-assert 9 :size-assert #x2 :flag-assert #x900000002 ) -|# -#| (deftype rope-joint-system-info (structure) - ((joint-info-array basic :offset-assert 0) + ((joint-info-array (array rope-joint-info) :offset-assert 0) ) :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype joint-mod-world-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data joint-mod-set-world :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; rope-system ;; @@ -50404,25 +50624,22 @@ ;; rope-prim-system-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype rope-joint-system (rope-system) ((info rope-joint-system-info :offset-assert 84) - (joint-mods basic :offset-assert 88) - (proc uint64 :offset-assert 96) + (joint-mods joint-mod-world-array :offset-assert 88) + (proc handle :offset-assert 96) ) :method-count-assert 25 :size-assert #x68 :flag-assert #x1900000068 (:methods - (rope-joint-system-method-24 () none) ;; 24 + (init (_type_ rope-joint-system-info process-drawable) symbol) ;; 24 ) ) -|# -#| (deftype rope-prim-system (rope-system) - ((strip1 basic :offset-assert 84) - (strip2 basic :offset-assert 88) + ((strip1 prim-strip :offset-assert 84) + (strip2 prim-strip :offset-assert 88) (width float :offset-assert 92) (alpha float :offset-assert 96) (uv-repeat-dist float :offset-assert 100) @@ -50431,23 +50648,20 @@ :size-assert #x68 :flag-assert #x1900000068 (:methods - (rope-prim-system-method-24 () none) ;; 24 + (add-prim-vert (_type_ prim-strip vector rgba float float) none) ;; 24 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; rope-prim-system ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *rope-prim-alpha-blend* object) +(define-extern *rope-prim-alpha-blend* gs-alpha) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; neo-satellite ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype neo-sat-laser-info (structure) ((joint int16 :offset-assert 0) (rope-index int16 :offset-assert 2) @@ -50456,41 +50670,35 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype neo-sat-hash-index (structure) ((h0 float :offset-assert 0) (h1 float :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype rope-neo-sat-whip (rope-prim-system) - ((parent-handle uint64 :offset-assert 104) + ((parent-handle handle :offset-assert 104) ) :method-count-assert 25 :size-assert #x70 :flag-assert #x1900000070 ) -|# -#| (deftype neo-sat-yellow-ammo-pos (structure) ((angle float :offset-assert 0) (dist float :offset-assert 4) ) + :allow-misaligned :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype neo-sat (nav-enemy) ((nav-vector vector :inline :offset-assert 624) (y-movement float :offset-assert 640) @@ -50503,119 +50711,117 @@ (last-thrust-vec vector :inline :offset-assert 672) (disc-joint joint-mod-rotate-local :inline :offset-assert 688) (laser-rotate-angle float :offset-assert 720) - (wander-generate-time uint64 :offset-assert 728) - (hit-player? basic :offset-assert 736) + (wander-generate-time time-frame :offset-assert 728) + (hit-player? symbol :offset-assert 736) (desired-float-height float :offset-assert 740) (bob-speed-scalar float :offset-assert 744) - (on-ground? basic :offset-assert 748) + (on-ground? symbol :offset-assert 748) (current-shockwave-radius float :offset-assert 752) (active-laser-index int8 :offset-assert 756) (current-stage int8 :offset-assert 757) (fly-speed-scalar float :offset-assert 760) (last-shockwave-radius float :offset-assert 764) - (ropes basic :offset-assert 768) + (ropes (array rope-neo-sat-whip) :offset-assert 768) (max-speed float :offset-assert 772) (spin-current float :offset-assert 776) (spin-dest float :offset-assert 780) (spin-speed float :offset-assert 784) - (hashed-heights UNKNOWN 1225 :offset-assert 788) + (hashed-heights float 1225 :offset-assert 788) (shockwave-origin vector :inline :offset-assert 5696) (current-height-probe-index int16 :offset-assert 5712) (last-spawned-ring-index int16 :offset-assert 5714) (global-neo-sat-index uint8 :offset-assert 5716) - (yellow-ammo-pos UNKNOWN 4 :offset-assert 5720) - (num-yellow-ammo int8 :offset-assert 5784) + (yellow-ammo-pos neo-sat-yellow-ammo-pos 4 :inline :offset-assert 5720) + (num-yellow-ammo int8 :offset 5784) (start-thrust-pos vector :inline :offset-assert 5792) - (was-player-inside-cone? basic :offset-assert 5808) - (was-doing-cone-check? basic :offset-assert 5812) - (damage-part1 basic :offset-assert 5816) - (damage-part2 basic :offset-assert 5820) - (damage-part3 basic :offset-assert 5824) - (burst-dust-part basic :offset-assert 5828) - (warp-handle uint64 :offset-assert 5832) - (spine-joint-mods UNKNOWN 6 :offset-assert 5840) + (was-player-inside-cone? symbol :offset-assert 5808) + (was-doing-cone-check? symbol :offset-assert 5812) + (damage-part1 sparticle-launch-control :offset-assert 5816) + (damage-part2 sparticle-launch-control :offset-assert 5820) + (damage-part3 sparticle-launch-control :offset-assert 5824) + (burst-dust-part sparticle-launch-control :offset-assert 5828) + (warp-handle handle :offset-assert 5832) + (spine-joint-mods joint-mod-rotate-local 6 :inline :offset-assert 5840) (actual-laser-rotate-angle float :offset-assert 6032) (last-particle-rotate float :offset-assert 6036) (trunk-joint joint-mod-rotate-local :inline :offset-assert 6048) (ground-height float :offset-assert 6080) - (tentacle basic :offset-assert 6084) - (anim-loop? basic :offset-assert 6088) - (play-anim? basic :offset-assert 6092) + (tentacle rope-joint-system :offset-assert 6084) + (anim-loop? symbol :offset-assert 6088) + (play-anim? symbol :offset-assert 6092) (anim-speed float :offset-assert 6096) - (should-rise? basic :offset-assert 6100) - (last-play-laser-time uint64 :offset-assert 6104) - (snd-laser-burn uint32 :offset-assert 6112) - (snd-whips-loop UNKNOWN 3 :offset-assert 6116) - (sound-last-snap-time UNKNOWN 3 :offset-assert 6128) - (sound-next-play-time UNKNOWN 3 :offset-assert 6152) - (new-spin-time uint64 :offset-assert 6176) - (snd-arms-chatter uint32 :offset-assert 6184) - (was-spinning? basic :offset-assert 6188) - (snd-hover uint32 :offset-assert 6192) - (snd-spool-explosion uint32 :offset-assert 6196) - (antenna-explode-part basic :offset-assert 6200) - (next-lightning-time uint64 :offset-assert 6208) + (should-rise? symbol :offset-assert 6100) + (last-play-laser-time time-frame :offset-assert 6104) + (snd-laser-burn sound-id :offset-assert 6112) + (snd-whips-loop sound-id 3 :offset-assert 6116) + (sound-last-snap-time time-frame 3 :offset-assert 6128) + (sound-next-play-time time-frame 3 :offset-assert 6152) + (new-spin-time time-frame :offset-assert 6176) + (snd-arms-chatter sound-id :offset-assert 6184) + (was-spinning? symbol :offset-assert 6188) + (snd-hover sound-id :offset-assert 6192) + (snd-spool-explosion sound-id :offset-assert 6196) + (antenna-explode-part sparticle-launch-control :offset-assert 6200) + (next-lightning-time time-frame :offset-assert 6208) ) :method-count-assert 234 :size-assert #x1848 :flag-assert #xea17d01848 - (:methods - (neo-sat-method-198 () none) ;; 198 - (neo-sat-method-199 () none) ;; 199 - (neo-sat-method-200 () none) ;; 200 - (neo-sat-method-201 () none) ;; 201 - (neo-sat-method-202 () none) ;; 202 - (neo-sat-method-203 () none) ;; 203 - (neo-sat-method-204 () none) ;; 204 - (neo-sat-method-205 () none) ;; 205 - (neo-sat-method-206 () none) ;; 206 - (neo-sat-method-207 () none) ;; 207 - (neo-sat-method-208 () none) ;; 208 - (neo-sat-method-209 () none) ;; 209 - (neo-sat-method-210 () none) ;; 210 - (neo-sat-method-211 () none) ;; 211 - (neo-sat-method-212 () none) ;; 212 - (neo-sat-method-213 () none) ;; 213 - (neo-sat-method-214 () none) ;; 214 - (neo-sat-method-215 () none) ;; 215 - (neo-sat-method-216 () none) ;; 216 - (neo-sat-method-217 () none) ;; 217 - (neo-sat-method-218 () none) ;; 218 - (neo-sat-method-219 () none) ;; 219 - (neo-sat-method-220 () none) ;; 220 - (neo-sat-method-221 () none) ;; 221 - (neo-sat-method-222 () none) ;; 222 - (neo-sat-method-223 () none) ;; 223 - (neo-sat-method-224 () none) ;; 224 - (neo-sat-method-225 () none) ;; 225 - (neo-sat-method-226 () none) ;; 226 - (neo-sat-method-227 () none) ;; 227 - (neo-sat-method-228 () none) ;; 228 - (neo-sat-method-229 () none) ;; 229 - (neo-sat-method-230 () none) ;; 230 - (neo-sat-method-231 () none) ;; 231 - (neo-sat-method-232 () none) ;; 232 - (neo-sat-method-233 () none) ;; 233 - ) (:state-methods - sat-idle ;; 190 - ground-burst ;; 197 hostile ;; 38 - neo-sat-laser-attack ;; 194 - neo-sat-drill-attack ;; 191 - neo-sat-drill-impact ;; 195 die ;; 40 - neo-sat-sit-and-spin ;; 196 + sat-idle ;; 190 + neo-sat-drill-attack ;; 191 neo-sat-drill-prepare ;; 192 neo-sat-drill-returning ;; 193 + neo-sat-laser-attack ;; 194 + neo-sat-drill-impact ;; 195 + neo-sat-sit-and-spin ;; 196 + ground-burst ;; 197 + ) + (:methods + (neo-sat-method-198 (_type_) none) ;; 198 + (neo-sat-method-199 (_type_) none) ;; 199 + (neo-sat-method-200 (_type_) none) ;; 200 + (neo-sat-method-201 (_type_) float) ;; 201 + (neo-sat-probe-ground (_type_ vector) float) ;; 202 + (neo-sat-method-203 (_type_ symbol) vector) ;; 203 + (neo-sat-method-204 (_type_) none) ;; 204 + (neo-sat-method-205 (_type_) none) ;; 205 + (neo-sat-method-206 (_type_ int symbol) none) ;; 206 + (neo-sat-method-207 (_type_) none) ;; 207 + (neo-sat-method-208 (_type_) none) ;; 208 + (neo-sat-method-209 (_type_) float) ;; 209 + (neo-sat-method-210 (_type_) float) ;; 210 + (neo-sat-method-211 (_type_) none) ;; 211 + (neo-sat-method-212 (_type_ vector vector) vector) ;; 212 + (neo-sat-method-213 (_type_ float) int) ;; 213 + (neo-sat-method-214 (_type_ float) int) ;; 214 + (neo-sat-method-215 (_type_ float) float) ;; 215 + (neo-sat-method-216 (_type_ float) float) ;; 216 + (neo-sat-method-217 (_type_ int int) int) ;; 217 + (neo-sat-method-218 (_type_ vector) float) ;; 218 + (neo-sat-method-219 (_type_) none) ;; 219 + (neo-sat-method-220 (_type_) int) ;; 220 + (neo-sat-method-221 (_type_) symbol) ;; 221 + (neo-sat-method-222 (_type_ object vector) float) ;; 222 + (neo-sat-method-223 (_type_ vector int int) symbol) ;; 223 + (neo-sat-method-224 (_type_) none) ;; 224 + (neo-sat-method-225 (_type_ int) object) ;; 225 + (neo-sat-method-226 (_type_ int) rope-system-flag) ;; 226 + (neo-sat-method-227 (_type_ int) none) ;; 227 + (neo-sat-method-228 (_type_) none) ;; 228 + (move-to-ground-height (_type_ float) none) ;; 229 + (neo-sat-method-230 (_type_) none) ;; 230 + (spawn-shield (_type_) none) ;; 231 + (neo-sat-method-232 (_type_ vector) symbol) ;; 232 + (neo-sat-method-233 (_type_) quaternion) ;; 233 ) (:states neo-sat-drill-halting ) ) -|# -#| (deftype neo-sat-init-params (structure) ((pos vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) @@ -50624,66 +50830,63 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype neo-sat-shield (process-drawable) () :method-count-assert 26 :size-assert #xc8 :flag-assert #x1a005000c8 - (:methods - (neo-sat-shield-method-25 () none) ;; 25 - ) (:state-methods active ;; 20 - disabled ;; 24 turning-on ;; 21 turning-off ;; 22 hit ;; 23 + disabled ;; 24 + ) + (:methods + (neo-sat-shield-method-25 (_type_) none) ;; 25 ) ) -|# -;; (define-extern spt-birth-func-brightness-sat-shockwave function) -;; (define-extern spt-birth-func-part-sat-shockwave function) -;; (define-extern spt-birth-func-brightness-scorch-bits function) -;; (define-extern spt-birth-func-part-scorch-bits function) -;; (define-extern spt-birth-func-part-ground-impact function) -;; (define-extern spt-birth-func-part-ground-emerge function) -;; (define-extern *range-sat-explo-color* curve-color-fast) -;; (define-extern *range-sat-explo-alpha* curve2d-fast) -;; (define-extern *range-sat-explo-scale-x* curve2d-fast) -;; (define-extern *range-sat-explo-scale-y* curve2d-fast) -;; (define-extern *curve-sat-explo-alpha* curve2d-fast) -;; (define-extern *curve-sat-explo-scale-x* curve2d-fast) -;; (define-extern *curve-sat-explo-scale-y* curve2d-fast) -;; (define-extern *part-neo-satellite-explosion-texture-curve-settings* object) -;; (define-extern *neo-sat-laser-array* array) -;; (define-extern *neo-sat-focus-pos* object) -;; (define-extern *alive-neo-sats* array) -;; (define-extern *neo-sat-nav-enemy-info* nav-enemy-info) -;; (define-extern *neo-sat-rope-tentacle* object) -;; (define-extern *neo-satellite-nav-mesh* object) -;; (define-extern neo-sat-init-by-other function) -;; (define-extern *h0* object) -;; (define-extern *h1* object) -;; (define-extern *hs* object) -;; (define-extern *m0* object) -;; (define-extern *m1* object) -;; (define-extern *ms* object) -;; (define-extern *move-offset* object) -;; (define-extern *maxh* object) -;; (define-extern *minh* object) -;; (define-extern *maxl* object) -;; (define-extern *minl* object) -;; (define-extern sparticle-height-set function) -;; (define-extern spt-func-part-neo-sat-shockwave-hot function) -;; (define-extern sparticle-shockwave-set function) -;; (define-extern spawn-neo-sat function) -;; (define-extern compute-xz-pos function) -;; (define-extern neo-sat-inside-cone? function) -;; (define-extern neo-sat-shield-init-by-other function) +(define-extern spt-birth-func-brightness-sat-shockwave (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-part-sat-shockwave (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-brightness-scorch-bits (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-part-scorch-bits (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-ground-impact (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-ground-emerge (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern *range-sat-explo-color* curve-color-fast) +(define-extern *range-sat-explo-alpha* curve2d-fast) +(define-extern *range-sat-explo-scale-x* curve2d-fast) +(define-extern *range-sat-explo-scale-y* curve2d-fast) +(define-extern *curve-sat-explo-alpha* curve2d-fast) +(define-extern *curve-sat-explo-scale-x* curve2d-fast) +(define-extern *curve-sat-explo-scale-y* curve2d-fast) +(define-extern *part-neo-satellite-explosion-texture-curve-settings* particle-curve-settings) +(define-extern *neo-sat-laser-array* (array neo-sat-laser-info)) +(define-extern *neo-sat-focus-pos* vector) +(define-extern *alive-neo-sats* (array handle)) +(define-extern *neo-sat-nav-enemy-info* nav-enemy-info) +(define-extern *neo-sat-rope-tentacle* rope-joint-system-info) +(define-extern *neo-satellite-nav-mesh* actor-id) +(define-extern neo-sat-init-by-other (function neo-sat-init-params object :behavior neo-sat)) +(define-extern *h0* float) +(define-extern *h1* float) +(define-extern *hs* float) +(define-extern *m0* float) +(define-extern *m1* float) +(define-extern *ms* float) +(define-extern *move-offset* float) +(define-extern *maxh* float) +(define-extern *minh* float) +(define-extern *maxl* float) +(define-extern *minl* float) +(define-extern sparticle-height-set (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern spt-func-part-neo-sat-shockwave-hot (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern sparticle-shockwave-set (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spawn-neo-sat (function vector quaternion process (pointer neo-sat))) +(define-extern compute-xz-pos (function neo-sat int int vector vector)) +(define-extern neo-sat-inside-cone? (function vector float vector vector symbol)) +(define-extern neo-sat-shield-init-by-other (function object :behavior neo-sat-shield)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; railx-mood ;; @@ -50736,8 +50939,8 @@ ;; ctyslumb-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern check-drop-level-ctyslumb-drop-userdata function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern *ctyslumb-water-texture-anim-array* texture-anim-array) +(define-extern check-drop-level-ctyslumb-drop-userdata (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern *ctyslumb-water-texture-anim-array* texture-anim-array) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mech-part ;; @@ -51469,16 +51672,13 @@ ;; ctyslumc-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype cty-elevator (elevator) () :method-count-assert 52 :size-assert #x1a0 :flag-assert #x34012001a0 ) -|# -#| (deftype ctyslumc-flag (process-drawable) () :method-count-assert 21 @@ -51488,10 +51688,9 @@ idle ;; 20 ) ) -|# -;; (define-extern *ctyslumc-water-texture-anim-array* texture-anim-array) -;; (define-extern ctyslumc-flag-init-by-other function) +(define-extern *ctyslumc-water-texture-anim-array* texture-anim-array) +(define-extern ctyslumc-flag-init-by-other (function vector entity-actor object :behavior ctyslumc-flag)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; pecker-ingame ;; @@ -52034,246 +52233,6 @@ (define-extern *indax-hang-dodge-mods* surface) (define-extern *indax-hang-attack-mods* surface) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; roboguard-city ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -#| -(deftype roboguard-city (kg-squad-member) - ((los los-control :inline :offset-assert 1136) - (rotation-matrix matrix :inline :offset-assert 1312) - (me-to-focus-dir vector :inline :offset-assert 1376) - (me-to-focus-angle float :offset-assert 1392) - (robo-flags uint16 :offset-assert 1396) - (torso-aim-blend float :offset-assert 1400) - (torso-angle float :offset-assert 1404) - (torso-seek-speed float :offset-assert 1408) - (torso-to-focus-angle float :offset-assert 1412) - (last-torso-frame-num float :offset-assert 1416) - (stand-angle-threshold float :offset-assert 1420) - (attack-distance float :offset-assert 1424) - (attack-dist-scalar float :offset-assert 1428) - (fire-time uint64 :offset-assert 1432) - (last-attack-time uint64 :offset-assert 1440) - (fired-this-time? basic :offset-assert 1448) - (last-roll-time uint64 :offset-assert 1456) - (cannot-reach-target? basic :offset-assert 1464) - (cannot-reach-target-start-time uint64 :offset-assert 1472) - (frustrate-roll-time uint64 :offset-assert 1480) - (target-status squad-target-status :inline :offset-assert 1488) - (last-update-chase-pos-time uint64 :offset-assert 1560) - (random-offset-search float :offset-assert 1568) - (pursuit-start-time uint64 :offset-assert 1576) - (dizzy-start-time uint64 :offset-assert 1584) - (roll-sound uint32 :offset-assert 1592) - ) - :method-count-assert 241 - :size-assert #x63c - :flag-assert #xf105c0063c - (:methods - (roboguard-city-method-233 () none) ;; 233 - (roboguard-city-method-234 () none) ;; 234 - (roboguard-city-method-235 () none) ;; 235 - (roboguard-city-method-236 () none) ;; 236 - (roboguard-city-method-237 () none) ;; 237 - (roboguard-city-method-238 () none) ;; 238 - (roboguard-city-method-239 () none) ;; 239 - (roboguard-city-method-240 () none) ;; 240 - ) - (:state-methods - exit-transport ;; 231 - explode ;; 225 - die ;; 40 - knocked-recover ;; 32 - knocked ;; 31 - shoot-attack ;; 224 - wait ;; 190 - active ;; 34 - reposition ;; 229 - idle ;; 33 - roll-chase ;; 228 - stare ;; 37 - giant-hostile ;; 232 - dizzy ;; 230 - roll-enter ;; 226 - roll-exit ;; 227 - hostile ;; 38 - hostile-stand ;; 222 - close-attack ;; 223 - ) - ) -|# - -#| -(deftype roboguard-shot (guard-shot) - () - :method-count-assert 41 - :size-assert #x220 - :flag-assert #x2901a00220 - ) -|# - -;; (define-extern *roboguard-city-debris-params* debris-static-params) -;; (define-extern *roboguard-city-nav-enemy-info* nav-enemy-info) -;; (define-extern roboguard-city-turn-torso-post function) -;; (define-extern roboguard-city-turret-code function) -;; (define-extern roboguard-city-idle-code function) -;; (define-extern spawn-roboguard-projectile function) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; spydroid ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -#| -(deftype sensor-light-info (structure) - ((joint int16 :offset-assert 0) - (part-index int16 :offset-assert 2) - (offset vector :inline :offset-assert 16) - ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 - ) -|# - -#| -(deftype spydroid (kg-squad-member) - ((old-y-deg float :offset-assert 1124) - (diff-angle float :offset-assert 1128) - (desire-turn symbol :offset-assert 1132) ;; guessed by decompiler - (hit-target basic :offset-assert 1136) - (floor float :offset-assert 1140) - (explode-part sparticle-launch-control :offset-assert 1144) ;; guessed by decompiler - (alert-level uint8 :offset-assert 1148) - (next-check-player-time uint64 :offset-assert 1152) - (part-ids UNKNOWN 9 :offset-assert 1160) - (sensor-lights UNKNOWN 3 :offset-assert 1184) - (last-sensor-time uint64 :offset-assert 1280) - (exiting-wait? basic :offset-assert 1288) - ) - :method-count-assert 238 - :size-assert #x50c - :flag-assert #xee0490050c - (:methods - (spydroid-method-226 () none) ;; 226 - (spydroid-method-231 () none) ;; 231 - (spydroid-method-232 () none) ;; 232 - (spydroid-method-233 () none) ;; 233 - (spydroid-method-234 () none) ;; 234 - (spydroid-method-235 () none) ;; 235 - (spydroid-method-236 () none) ;; 236 - (spydroid-method-237 () none) ;; 237 - ) - (:state-methods - exit-transport ;; 230 - hunting ;; 224 - spydroid-notice ;; 227 - scan ;; 225 - attack ;; 222 - flip ;; 228 - hostile ;; 38 - active ;; 34 - wait ;; 190 - wait-for-vulnerable ;; 229 - search ;; 223 - die-falling ;; 41 - knocked ;; 31 - ) - ) -|# - -;; (define-extern *spydroid-debris-params* debris-static-params) -;; (define-extern *spydroid-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info -;; (define-extern wait-for-vulnerable-close state) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; flying-turret ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -#| -(deftype ft-gun-info (structure) - ((gun-position float :offset-assert 0) - (fire? basic :offset-assert 4) - ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 - ) -|# - -#| -(deftype flying-turret (kg-squad-member) - ((thrust-dir vector :inline :offset-assert 1136) - (speed float :offset-assert 1152) - (speed-target float :offset-assert 1156) - (ground-height float :offset-assert 1160) - (last-heading-quat quaternion :inline :offset-assert 1168) - (last-roll-quat quaternion :inline :offset-assert 1184) - (thrust-mode uint8 :offset-assert 1200) - (pursuit-start-time uint64 :offset-assert 1208) - (chase-mode uint8 :offset-assert 1216) - (last-check-chase-pos-time uint64 :offset-assert 1224) - (circle-angle float :offset-assert 1232) - (last-fire-time uint64 :offset-assert 1240) - (num-shots-fired int8 :offset-assert 1248) - (ground-point vector :inline :offset-assert 1264) - (guns UNKNOWN 2 :offset-assert 1280) - (turret-aim-blend float :offset-assert 1312) - (hit-player? basic :offset-assert 1316) - (desired-height-offset float :offset-assert 1320) - (float-height float :offset-assert 1324) - (bob-velocity float :offset-assert 1328) - (bouncing? basic :offset-assert 1332) - (bounce-start-time uint64 :offset-assert 1336) - (changed-targets? basic :offset-assert 1344) - (thruster-intensity float :offset-assert 1348) - (up-bobbing? basic :offset-assert 1352) - (bob-scale-factor float :offset-assert 1356) - (bob-scale-target float :offset-assert 1360) - (bob-t float :offset-assert 1364) - (thruster-intensity-scalar float :offset-assert 1368) - (engine-sound uint32 :offset-assert 1372) - (tilt-sound uint32 :offset-assert 1376) - (roll-sound-amount float :offset-assert 1380) - ) - :method-count-assert 231 - :size-assert #x568 - :flag-assert #xe704f00568 - (:methods - (flying-turret-method-225 () none) ;; 225 - (flying-turret-method-226 () none) ;; 226 - (flying-turret-method-227 () none) ;; 227 - (flying-turret-method-228 () none) ;; 228 - (flying-turret-method-229 () none) ;; 229 - (flying-turret-method-230 () none) ;; 230 - ) - (:state-methods - exit-transport ;; 224 - knocked ;; 31 - hostile ;; 38 - fire ;; 223 - active ;; 34 - flying-turret-base-state ;; 222 - ) - ) -|# - -#| -(deftype flying-turret-shot (guard-shot) - () - :method-count-assert 41 - :size-assert #x220 - :flag-assert #x2901a00220 - ) -|# - -;; (define-extern *flying-turret-nav-enemy-info* nav-enemy-info) -;; (define-extern *flying-turret-debris-params* debris-static-params) -;; (define-extern flying-turret-gun-aim-func function) -;; (define-extern flying-turret-gun-recoil-jmod-func function) -;; (define-extern spawn-turret-projectile function) -;; (define-extern update-ft-gun function) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; des-bbush-tasks ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -52789,163 +52748,6 @@ (define-extern *curve-terexplo-scale-y* curve2d-fast) (define-extern *part-terraformer-explosion-texture-curve-settings* particle-curve-settings) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; squad-control-h ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(deftype squad-unit-settings (structure) - ((target-count int8 :offset-assert 0) - (shot-count int8 :offset-assert 1) - (rand-shot-count int8 :offset-assert 2) - (inaccuracy float :offset-assert 4) - (acquire-delay uint16 :offset-assert 8 :decomp-as time-frame) - (shot-delay uint16 :offset-assert 10 :decomp-as time-frame) - (burst-delay uint16 :offset-assert 12 :decomp-as time-frame) - (rand-burst-delay uint16 :offset-assert 14 :decomp-as time-frame) - (rand-shot-delay uint16 :offset-assert 16 :decomp-as time-frame) - ) - :method-count-assert 9 - :size-assert #x12 - :flag-assert #x900000012 - ) - -;; +++squad-control-h:squad-target-flag -(defenum squad-target-flag - :type uint8 - :bitfield #t - (visible-now) - (visible-recently) - (visible-ever) - (updated) - (force-visible) - ) -;; ---squad-control-h:squad-target-flag - -(deftype squad-target-status (structure) - ((flags squad-target-flag :offset-assert 0) - (handle handle :offset-assert 8) - (last-seen-time time-frame :offset-assert 16) - (position vector :inline :offset-assert 32) - (velocity vector :inline :offset-assert 48) - (threat-level float :offset-assert 64) - ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 - ;; field squad-target-flag is likely a value type. - ) - -;; +++squad-control-h:squad-alert-flag -(defenum squad-alert-flag - :type uint8 - :bitfield #t - (alert-ending) - (alarm-on) - (guard-multi-focus) - (sticky-guard-settings) - (disable-pursuit-control) - (update-target-search) - (war) - ) -;; ---squad-control-h:squad-alert-flag - -(deftype squad-alert-state (structure) - ((flags squad-alert-flag :offset-assert 0) - (level uint8 :offset-assert 1) - (max-level uint8 :offset-assert 2) - (guards-in-sight-of-target int8 :offset-assert 3) - (guard-aim-count int8 :offset-assert 4) - (guard-inaccuracy-factor float :offset-assert 8) - (guard-target-level float :offset-assert 12) - (duration uint32 :offset-assert 16 :decomp-as time-frame) - (start-time time-frame :offset-assert 24) - (notify-time time-frame :offset-assert 32) - (alarm-sound-id sound-id :offset-assert 40) - (target-status-array squad-target-status 3 :inline :offset-assert 48) - (target-status squad-target-status :inline :offset 48) - ) - :method-count-assert 10 - :size-assert #x120 - :flag-assert #xa00000120 - ;; field squad-alert-flag is likely a value type. - (:methods - (init! (_type_) none) ;; 9 - ) - ) - -(deftype primary-target-pos-vel (structure) - ((position vector :inline :offset-assert 0) - (velocity vector :inline :offset-assert 16) - (time uint32 :offset 28 :score 1) - ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 - ) - -(deftype squad-control (basic) - ((sync-clock uint8 :offset-assert 4) - (sync-mask-8 uint8 :offset-assert 5) - (sync-mask-16 uint16 :offset-assert 6) - (sync-mask-32 uint32 :offset-assert 8) - (alert-state squad-alert-state :inline :offset-assert 16) - (primary-target-history primary-target-pos-vel 16 :inline :offset-assert 304) - ) - :method-count-assert 34 - :size-assert #x330 - :flag-assert #x2200000330 - (:methods - (initialize (_type_ process) none) ;; 9 - (squad-control-method-10 (_type_) none) ;; 10 - (stop-alarm-sound (_type_) none) ;; 11 - (init-alert (_type_) none) ;; 12 - (update (_type_) none) ;; 13 - (set-sync-mask (_type_) none) ;; 14 - (probe-backgnd-collision (_type_ vector vector) symbol) ;; 15 - (squad-control-method-16 (_type_ vector process-focusable squad-target-status) none) ;; 16 - (squad-control-method-17 (_type_ vector int squad-target-status) none) ;; 17 - (squad-control-method-18 (_type_ int process) int) ;; 18 - (set-alert-level0 (_type_ int) int) ;; 19 - (start-alert (_type_ int) none) ;; 20 - (set-alert-level (_type_ int) none) ;; 21 - (get-alert-level (_type_) int) ;; 22 - (set-alert-duration (_type_ time-frame) none) ;; 23 - (squad-control-method-24 (_type_) int) ;; 24 - (squad-control-method-25 (_type_ primary-target-pos-vel time-frame) none) ;; 25 - (set-pos-vel (_type_ primary-target-pos-vel) primary-target-pos-vel) ;; 26 - (squad-control-method-27 (_type_ process float) none) ;; 27 - (get-idx-in-status-arr (_type_ handle) int) ;; 28 - (valid-target-handle? (_type_ handle) symbol) ;; 29 - (get-target-focus (_type_) process-focusable) ;; 30 - (squad-control-method-31 (_type_ vector process-focusable handle float float) none) ;; 31 - (get-handle-pos (_type_ handle vector) vector) ;; 32 - (get-focus-in-range (_type_ process-focusable) process-focusable) ;; 33 - ) - ) - -;; added -(deftype squad-control-stack-type0 (structure) - ((vec0 vector :inline :offset 0) - (vec1 vector :inline :offset 16) - (float0 float :offset 32) - (byte0 int8 :offset 36) - (mesh nav-mesh :offset 40) - (cquery collide-query :inline :offset 64) - (vec2 vector :inline :offset 272) - (vec3 vector :inline :offset 288) - (float1 float :offset 604) - (float2 float :offset 608) - (float3 float :offset 612) - ) - ) - -(define-extern *waswide-squad-control* squad-control) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; squad-control ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vehicle-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -53304,7 +53106,7 @@ (look-select uint8 :offset-assert 16) (color-option-count int8 :offset-assert 17) (color-option-select int8 :offset-assert 18) - (color vector :offset-assert 20) ;; added + (color (inline-array vector) :offset-assert 20) ;; added (gun-yaw-min float :offset-assert 24) (gun-yaw-max float :offset-assert 28) (gun-pitch-min float :offset-assert 32) @@ -53398,7 +53200,7 @@ (deftype rigid-body-vehicle-constants (rigid-body-object-constants) ((flags uint32 :offset-assert 208) - (object-type uint8 :offset-assert 212) + (object-type traffic-type :offset-assert 212) (guard-type uint8 :offset-assert 213) (vehicle-type vehicle-type-u8 :offset-assert 214) (engine vehicle-engine-info :inline :offset-assert 216) @@ -53552,7 +53354,8 @@ (declare-type vehicle-physics-work structure) (deftype vehicle (rigid-body-object) - ((info rigid-body-vehicle-constants :override) + ((self vehicle :override) + (info rigid-body-vehicle-constants :override) (v-flags vehicle-flag :offset 216 :score 1) ;; rigid-body-object-flag (unknown-flags vehicle-flag :offset 296) (squad squad-control :offset-assert 304) @@ -53634,7 +53437,7 @@ (vehicle-method-70 (_type_) uint) ;; 70 ;; (vehicle-method-70 (_type_) process) (get-best-seat (_type_ vector vehicle-seat-flag int) int) ;; 71 ;; (put-rider-in-seat (_type_ int process-focusable) none) (remove-riders (_type_ handle) none) ;; 72 ;; (vehicle-method-72 (_type_) uint) - (vehicle-method-73 (_type_) none) ;; 73 ;; (get-best-seat-for-vehicle (_type_ vector int int) int) + (vehicle-method-73 (_type_) float) ;; 73 ;; (get-best-seat-for-vehicle (_type_ vector int int) int) (vehicle-method-74 (_type_ int time-frame) none) ;; 74 ;; (remove-rider (_type_ process) none) (vehicle-method-75 (_type_) none) ;; 75 ;; (vehicle-method-75 (_type_) float) (vehicle-method-76 (_type_) none) ;; 76 ;; (vehicle-method-76 (_type_ int uint) none) @@ -53692,7 +53495,7 @@ (vehicle-method-128 (_type_) symbol) ;; 128 (vehicle-method-129 (_type_) none) ;; 129 (vehicle-method-130 (_type_) none) ;; 130 ;; (vehicle-method-130 (_type_ traffic-object-spawn-params) none) - (vehicle-method-131 (_type_) none) ;; 131 + (vehicle-method-131 (_type_ traffic-object-spawn-params) none) ;; 131 (vehicle-method-132 (_type_ traffic-object-spawn-params) none) ;; 132 (vehicle-method-133 (_type_ traffic-object-spawn-params) none) ;; 133 ;; (check-player-get-on (_type_) none) (vehicle-method-134 (_type_) none) ;; 134 ;; (vehicle-method-134 (_type_ process) none) @@ -54189,9 +53992,21 @@ ;; vehicle-rider ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +++vehicle-rider:vehicle-rider-flag +(defenum vehicle-rider-flag + :type uint8 + :bitfield #t + (vr0 0) + (vr1 1) + (vr2 2) + (vr3 3) + ) +;; ---vehicle-rider:vehicle-rider-flag + (deftype vehicle-rider (process-focusable) - ((squad squad-control :offset-assert 208) - (flags uint8 :offset-assert 212) + ((parent (pointer vehicle) :override) + (squad squad-control :offset-assert 208) + (flags vehicle-rider-flag :offset-assert 212) (riding-anim int32 :offset-assert 216) (anim-t float :offset-assert 220) (anim-speed float :offset-assert 224) @@ -54201,17 +54016,17 @@ :size-assert #xe5 :flag-assert #x25007000e5 (:state-methods - inactive ;; 28, old: (active () _type_ :state) - active ;; 29, old: (taunt () _type_ :state) - taunt ;; 30, old: (got-passed () _type_ :state) - got-passed ;; 31, old: (initialize-collision (_type_) none) + inactive ;; 28 + active ;; 29 + taunt ;; 30 + got-passed ;; 31 ) (:methods - (vehicle-rider-method-32 () none) ;; 32 ;; (vehicle-rider-method-32 (_type_ traffic-object-spawn-params) none) - (vehicle-rider-method-33 () none) ;; 33 ;; (vehicle-rider-method-33 (_type_) none) - (vehicle-rider-method-34 () none) ;; 34 ;; (vehicle-rider-method-34 (_type_) none) - (vehicle-rider-method-35 () none) ;; 35 ;; (vehicle-rider-method-35 (_type_) none) - (vehicle-rider-method-36 () none) ;; 36 + (initialize-collision (_type_) none) ;; 32 + (setup-lods (_type_) none) ;; 33 + (setup (_type_) none) ;; 34 + (vehicle-rider-post (_type_) none) ;; 35 + (go-inactive (_type_) none) ;; 36 ) ) @@ -54222,8 +54037,8 @@ :flag-assert #x25007000e5 ) -;; (define-extern vehicle-rider-event-handler function) ;; (function process int symbol event-message-block object :behavior vehicle-rider) -;; (define-extern vehicle-rider-init-by-other function) ;; (function traffic-object-spawn-params none :behavior vehicle-rider) +(def-event-handler vehicle-rider-event-handler vehicle-rider) +(define-extern vehicle-rider-init-by-other (function traffic-object-spawn-params object :behavior vehicle-rider)) (define-extern vehicle-rider-spawn (function vehicle type traffic-object-spawn-params process)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -54650,241 +54465,97 @@ ;; intro-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *range-intro-dust-color* curve-color-fast) -;; (define-extern *range-intro-dust-alpha* curve2d-fast) -;; (define-extern *range-intro-dust-scale-x* curve2d-fast) -;; (define-extern *range-intro-dust-scale-y* curve2d-fast) -;; (define-extern *curve-intro-dust-alpha* curve2d-fast) -;; (define-extern *curve-intro-dust-scale-x* curve2d-fast) -;; (define-extern *curve-intro-dust-scale-y* curve2d-fast) -;; (define-extern *part-drop-dust-trail-curve-settings* object) -;; (define-extern *part-drop-dust-landing-curve-settings* object) -;; (define-extern *part-drop-dust-takeoff-curve-settings* object) -;; (define-extern *curve-intro-dust-cloud-alpha* curve2d-fast) -;; (define-extern *curve-intro-dust-cloud-scale-x* curve2d-fast) -;; (define-extern *curve-intro-dust-cloud-scale-y* curve2d-fast) -;; (define-extern *part-drop-dust-cloud-curve-settings* object) -;; (define-extern *range-intro-pecker-dust-scale-x* curve2d-fast) -;; (define-extern *range-intro-pecker-dust-scale-y* curve2d-fast) -;; (define-extern *curve-intro-pecker-dust-scale-x* curve2d-fast) -;; (define-extern *curve-intro-pecker-dust-scale-y* curve2d-fast) -;; (define-extern *part-drop-pecker-dustoff-curve-settings* object) -;; (define-extern birth-func-dust-inherit-scaler function) -;; (define-extern *range-color-desert-impact-dust* curve-color-fast) -;; (define-extern *range-alpha-desert-impact-dust* curve2d-fast) -;; (define-extern *range-scale-desert-impact-dust-x* curve2d-fast) -;; (define-extern *range-scale-desert-impact-dust-y* curve2d-fast) -;; (define-extern *curve-alpha-desert-impact-dust* curve2d-fast) -;; (define-extern *curve-desert-impact-dust-x* curve2d-fast) -;; (define-extern *curve-desert-impact-dust-y* curve2d-fast) -;; (define-extern *part-desert-impact-dust-curve-settings* object) -;; (define-extern *range-alpha-desert-impact-dust-blow* curve2d-fast) -;; (define-extern *range-scale-desert-impact-dust-blow-x* curve2d-fast) -;; (define-extern *range-scale-desert-impact-dust-blow-y* curve2d-fast) -;; (define-extern *curve-alpha-desert-impact-dust-blow* curve2d-fast) -;; (define-extern *curve-desert-impact-dust-blow-x* curve2d-fast) -;; (define-extern *curve-desert-impact-dust-blow-y* curve2d-fast) -;; (define-extern *part-desert-impact-dust-blow-curve-settings* object) +(define-extern *range-intro-dust-color* curve-color-fast) +(define-extern *range-intro-dust-alpha* curve2d-fast) +(define-extern *range-intro-dust-scale-x* curve2d-fast) +(define-extern *range-intro-dust-scale-y* curve2d-fast) +(define-extern *curve-intro-dust-alpha* curve2d-fast) +(define-extern *curve-intro-dust-scale-x* curve2d-fast) +(define-extern *curve-intro-dust-scale-y* curve2d-fast) +(define-extern *part-drop-dust-trail-curve-settings* particle-curve-settings) +(define-extern *part-drop-dust-landing-curve-settings* particle-curve-settings) +(define-extern *part-drop-dust-takeoff-curve-settings* particle-curve-settings) +(define-extern *curve-intro-dust-cloud-alpha* curve2d-fast) +(define-extern *curve-intro-dust-cloud-scale-x* curve2d-fast) +(define-extern *curve-intro-dust-cloud-scale-y* curve2d-fast) +(define-extern *part-drop-dust-cloud-curve-settings* particle-curve-settings) +(define-extern *range-intro-pecker-dust-scale-x* curve2d-fast) +(define-extern *range-intro-pecker-dust-scale-y* curve2d-fast) +(define-extern *curve-intro-pecker-dust-scale-x* curve2d-fast) +(define-extern *curve-intro-pecker-dust-scale-y* curve2d-fast) +(define-extern *part-drop-pecker-dustoff-curve-settings* particle-curve-settings) +(define-extern birth-func-dust-inherit-scaler (function sparticle-system sparticle-cpuinfo sparticle-launchinfo sparticle-launcher sparticle-launch-state none)) +(define-extern *range-color-desert-impact-dust* curve-color-fast) +(define-extern *range-alpha-desert-impact-dust* curve2d-fast) +(define-extern *range-scale-desert-impact-dust-x* curve2d-fast) +(define-extern *range-scale-desert-impact-dust-y* curve2d-fast) +(define-extern *curve-alpha-desert-impact-dust* curve2d-fast) +(define-extern *curve-desert-impact-dust-x* curve2d-fast) +(define-extern *curve-desert-impact-dust-y* curve2d-fast) +(define-extern *part-desert-impact-dust-curve-settings* particle-curve-settings) +(define-extern *range-alpha-desert-impact-dust-blow* curve2d-fast) +(define-extern *range-scale-desert-impact-dust-blow-x* curve2d-fast) +(define-extern *range-scale-desert-impact-dust-blow-y* curve2d-fast) +(define-extern *curve-alpha-desert-impact-dust-blow* curve2d-fast) +(define-extern *curve-desert-impact-dust-blow-x* curve2d-fast) +(define-extern *curve-desert-impact-dust-blow-y* curve2d-fast) +(define-extern *part-desert-impact-dust-blow-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; intro-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; wcar-catapult ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -#| -(deftype catapult-shot-sphere (process-drawable) - ((current-alpha float :offset-assert 200) - ) - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15006000d8 - (:state-methods - active ;; 20 - ) - ) -|# - -#| -(deftype catapult-shot-sphere-init-params (structure) - ((pos vector :inline :offset-assert 0) - ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 - ) -|# - -#| -(deftype v-catapult-shot (metalhead-grenade-shot) - ((trail-part basic :offset-assert 532) - ) - :method-count-assert 41 - :size-assert #x218 - :flag-assert #x2901a00218 - (:state-methods - impact ;; 22 - ) - ) -|# - -#| -(deftype v-catapult (wcar-base) - ((jmod-axles UNKNOWN 4 :offset-assert 2752) - (jmod-gun-x joint-mod-rotate-local :inline :offset-assert 2880) - (jmod-gun-y joint-mod-rotate-local :inline :offset-assert 2912) - (turret-control turret-control :inline :offset-assert 2944) - (sub-state-time uint32 :offset-assert 3040) - (sub-state int8 :offset-assert 3044) - (launch-projectile? basic :offset-assert 3048) - (targ-pos vector :inline :offset-assert 3056) - (notify-handle uint64 :offset-assert 3072) - (spawn-part? basic :offset-assert 3080) - (charge-time uint64 :offset-assert 3088) - (exploding? basic :offset-assert 3096) - ) - :method-count-assert 205 - :size-assert #xc1c - :flag-assert #xcd0ba00c1c - (:methods - (v-catapult-method-203 () none) ;; 203 - (v-catapult-method-204 () none) ;; 204 - ) - (:state-methods - die ;; 61 - hostile ;; 152 - explode ;; 60 - ) - ) -|# - -;; (define-extern *v-catapult-turret-control-info* object) -;; (define-extern *v-catapult-turret-guard-settings* object) -;; (define-extern *v-catapult-debris-longspike-params* debris-static-params) -;; (define-extern *v-catapult-debris-bar-params* debris-static-params) -;; (define-extern *v-catapult-debris-lpanel-params* debris-static-params) -;; (define-extern *v-catapult-debris-rpanel-params* debris-static-params) -;; (define-extern *v-catapult-debris-lbumperspikes-params* debris-static-params) -;; (define-extern *v-catapult-debris-rbumperspikes-params* debris-static-params) -;; (define-extern *v-catapult-debris-lfspike-params* debris-static-params) -;; (define-extern *v-catapult-debris-rfspike-params* debris-static-params) -;; (define-extern *v-catapult-debris-ltopspike-params* debris-static-params) -;; (define-extern *v-catapult-debris-rtopspike-params* debris-static-params) -;; (define-extern *v-catapult-debris-lsidespikea-params* debris-static-params) -;; (define-extern *v-catapult-debris-lsidespikeb-params* debris-static-params) -;; (define-extern *v-catapult-debris-lsidespikec-params* debris-static-params) -;; (define-extern *v-catapult-debris-lsidespiked-params* debris-static-params) -;; (define-extern *v-catapult-debris-lsidespikee-params* debris-static-params) -;; (define-extern *v-catapult-debris-rsidespikea-params* debris-static-params) -;; (define-extern *v-catapult-debris-rsidespikeb-params* debris-static-params) -;; (define-extern *v-catapult-debris-rsidespikec-params* debris-static-params) -;; (define-extern *v-catapult-debris-rsidespiked-params* debris-static-params) -;; (define-extern *v-catapult-debris-rsidespikee-params* debris-static-params) -;; (define-extern *v-catapult-debris-lfpanela-params* debris-static-params) -;; (define-extern *v-catapult-debris-rfpanela-params* debris-static-params) -;; (define-extern *v-catapult-debris-lfpanelb-params* debris-static-params) -;; (define-extern *v-catapult-debris-rfpanelb-params* debris-static-params) -;; (define-extern *v-catapult-debris-lfpanelc-params* debris-static-params) -;; (define-extern *v-catapult-debris-rfpanelc-params* debris-static-params) -;; (define-extern *v-catapult-debris-lfpaneld-params* debris-static-params) -;; (define-extern *v-catapult-debris-rfpaneld-params* debris-static-params) -;; (define-extern *v-catapult-debris-lmpanela-params* debris-static-params) -;; (define-extern *v-catapult-debris-rmpanela-params* debris-static-params) -;; (define-extern *v-catapult-debris-lmpanelb-params* debris-static-params) -;; (define-extern *v-catapult-debris-rmpanelb-params* debris-static-params) -;; (define-extern *v-catapult-debris-lmpanelc-params* debris-static-params) -;; (define-extern *v-catapult-debris-rmpanelc-params* debris-static-params) -;; (define-extern *v-catapult-debris-lmpaneld-params* debris-static-params) -;; (define-extern *v-catapult-debris-rmpaneld-params* debris-static-params) -;; (define-extern *v-catapult-debris-lrpanela-params* debris-static-params) -;; (define-extern *v-catapult-debris-rrpanela-params* debris-static-params) -;; (define-extern *v-catapult-debris-lrpanelb-params* debris-static-params) -;; (define-extern *v-catapult-debris-rrpanelb-params* debris-static-params) -;; (define-extern *v-catapult-debris-lrpanelc-params* debris-static-params) -;; (define-extern *v-catapult-debris-rrpanelc-params* debris-static-params) -;; (define-extern *v-catapult-debris-lrpaneld-params* debris-static-params) -;; (define-extern *v-catapult-debris-rrpaneld-params* debris-static-params) -;; (define-extern *range-ftexplo-dust-color* curve-color-fast) -;; (define-extern *range-ftexplo-dust-alpha* curve2d-fast) -;; (define-extern *range-ftexplo-dust-scale-x* curve2d-fast) -;; (define-extern *range-ftexplo-dust-scale-y* curve2d-fast) -;; (define-extern *curve-ftexplo-dust-alpha* curve2d-fast) -;; (define-extern *curve-ftexplo-dust-scale-x* curve2d-fast) -;; (define-extern *curve-ftexplo-dust-scale-y* curve2d-fast) -;; (define-extern *part-v-catapult-shot-explosion-dust-in-curve-settings* object) -;; (define-extern *range-ftexplo-color* curve-color-fast) -;; (define-extern *range-ftexplo-alpha* curve2d-fast) -;; (define-extern *range-ftexplo-scale-x* curve2d-fast) -;; (define-extern *range-ftexplo-scale-y* curve2d-fast) -;; (define-extern *curve-ftexplo-alpha* curve2d-fast) -;; (define-extern *curve-ftexplo-scale-x* curve2d-fast) -;; (define-extern *curve-ftexplo-scale-y* curve2d-fast) -;; (define-extern *part-v-catapult-shot-explosion-texture-curve-settings* object) -;; (define-extern catapult-shot-sphere-init-by-other function) -;; (define-extern *v-catapult-shot-impact-blur* object) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; desert-jump ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wascity-airlock-debris (process-drawable) () :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 - (:methods - (wascity-airlock-debris-method-22 () none) ;; 22 - ) (:state-methods - explode ;; 21 idle ;; 20 + explode ;; 21 + ) + (:methods + (spawn-exploder (_type_) none) ;; 22 ) ) -|# -#| (deftype beam-generator (process-drawable) - ((arrow uint64 :offset-assert 200) + ((arrow handle :offset-assert 200) (pos vector :inline :offset-assert 208) (angs vector :inline :offset-assert 224) ) :method-count-assert 24 :size-assert #xf0 :flag-assert #x18007000f0 - (:methods - (beam-generator-method-22 () none) ;; 22 - (beam-generator-method-23 () none) ;; 23 - ) (:state-methods - die ;; 21 idle ;; 20 + die ;; 21 + ) + (:methods + (check-pickup (_type_) none) ;; 22 + (rotate (_type_) none) ;; 23 ) ) -|# -#| (deftype hud-wasdoors-health (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype hud-desert-catapult-count (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype desjump-point (structure) ((pos vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) @@ -54893,60 +54564,53 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype desjump-vehicle (structure) - ((handle uint64 :offset-assert 0) + ((handle handle :offset-assert 0) (path-type uint8 :offset-assert 8) (path-pos uint8 :offset-assert 9) - (ready? basic :offset-assert 12) - (kamikaze? basic :offset-assert 16) - (wait-timer uint64 :offset-assert 24) + (ready? symbol :offset-assert 12) + (kamikaze? symbol :offset-assert 16) + (wait-timer time-frame :offset-assert 24) ) + :pack-me :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype desert-jump-manager (task-manager) - ((nav-mesh basic :offset-assert 240) - (vehicle UNKNOWN 2 :offset-assert 248) + ((nav-mesh nav-mesh :offset-assert 240) + (vehicle desjump-vehicle 2 :inline :offset-assert 248) (vehicle-count uint8 :offset-assert 312) - (v-free-list basic :offset-assert 316) + (v-free-list (array uint8) :offset-assert 316) (total-veh-spawned uint8 :offset-assert 320) - (check-timer uint64 :offset-assert 328) - (hud-wasdoors-health uint64 :offset-assert 216) - (generator uint64 :offset-assert 336) - (interceptor UNKNOWN 4 :offset-assert 344) + (check-timer time-frame :offset-assert 328) + (hud-wasdoors-health handle :offset 216) + (generator handle :offset-assert 336) + (interceptor desjump-vehicle 4 :inline :offset-assert 344) (interceptor-count uint8 :offset-assert 472) - (i-free-list basic :offset-assert 476) - (interceptor-timer uint64 :offset-assert 480) + (i-free-list (array uint8) :offset-assert 476) + (interceptor-timer time-frame :offset-assert 480) (plane vector :inline :offset-assert 496) (last-catapult-pos vector :inline :offset-assert 512) - (player-can-win? basic :offset-assert 528) + (player-can-win? symbol :offset-assert 528) ) :method-count-assert 35 :size-assert #x214 :flag-assert #x2301a00214 (:methods - (desert-jump-manager-method-32 () none) ;; 32 - (desert-jump-manager-method-33 () none) ;; 33 - (desert-jump-manager-method-34 () none) ;; 34 - ) - (:state-methods - active ;; 15 + (spawn-vehicle (_type_ uint vehicle-type) handle) ;; 32 + (spawn-beam-generator (_type_ vector) none) ;; 33 + (damage-airlock (_type_ int) none) ;; 34 ) ) -|# -;; (define-extern *wascity-airlock-exploder-params* joint-exploder-static-params) -;; (define-extern beam-generator-init-by-other function) -;; (define-extern *desjump-wasdoors-pos* object) -;; (define-extern *desjump-vehicle-path* array) -;; (define-extern part-tracker-check-parent function) +(define-extern *wascity-airlock-exploder-params* joint-exploder-static-params) +(define-extern beam-generator-init-by-other (function vector entity-actor object :behavior beam-generator)) +(define-extern *desjump-wasdoors-pos* vector) +(define-extern *desjump-vehicle-path* (array (array desjump-point))) +(define-extern part-tracker-check-parent (function part-tracker object)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; desertg-obs ;; @@ -55347,20 +55011,19 @@ ;; palroof-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern check-drop-level-palroof-drop-userdata function) ;; (function sparticle-system sparticle-cpuinfo matrix none) +(define-extern check-drop-level-palroof-drop-userdata (function sparticle-system sparticle-cpuinfo matrix none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; palcab-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern palcab-bird-bob-func function) ;; (function sparticle-system sparticle-cpuinfo matrix none :behavior palcab-part) -;; (define-extern sparticle-palcab-bird-moon function) ;; (function sparticle-system sparticle-cpuinfo matrix none) +(define-extern palcab-bird-bob-func (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-palcab-bird-moon (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; intro-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ctypal-ctyfarma (process-drawable) () :method-count-assert 21 @@ -55370,14 +55033,11 @@ idle ;; 20 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; searchlight ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype searchlight (process-drawable) ((sync sync-eased :inline :offset-assert 200) ) @@ -55385,47 +55045,49 @@ :size-assert #xf4 :flag-assert #x15008000f4 (:state-methods - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; billiards ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++billiards:billiard-ball-flag +(defenum billiard-ball-flag + :type uint32 + :bitfield #t + (bb0 0) + (bb1 1) + ) +;; ---billiards:billiard-ball-flag + (deftype billiard-ball (structure) ((pos vector :inline :offset-assert 0) (prev-pos vector :inline :offset-assert 16) (size float :offset-assert 32) - (flags uint32 :offset-assert 36) + (flags billiard-ball-flag :offset-assert 36) ) :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) -|# -#| (deftype billiard-ball-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data billiard-ball :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype billiard-table (basic) - ((billiards basic :offset-assert 4) + ((billiards billiard-ball-array :offset-assert 4) (accum-force vector :inline :offset-assert 16) (drag float :offset-assert 32) - (bounds UNKNOWN 2 :offset-assert 48) - (min-xyz vector :inline :offset-assert 48) - (max-xyz vector :inline :offset-assert 64) + (bounds vector 2 :inline :offset-assert 48 :score -1) + (min-xyz vector :inline :offset 48) + (max-xyz vector :inline :offset 64) (bounce-wall-friction float :offset-assert 80) (ball-friction float :offset-assert 84) ) @@ -55433,168 +55095,98 @@ :size-assert #x58 :flag-assert #x1000000058 (:methods - (billiard-table-method-9 () none) ;; 9 - (billiard-table-method-10 () none) ;; 10 - (billiard-table-method-11 () none) ;; 11 - (billiard-table-method-12 () none) ;; 12 - (billiard-table-method-13 () none) ;; 13 - (billiard-table-method-14 () none) ;; 14 - (billiard-table-method-15 () none) ;; 15 + (init! (_type_ int vector vector) none) ;; 9 + (billiard-table-method-10 (_type_) none) ;; 10 + (debug-draw (_type_) none) ;; 11 + (reset-accum-force (_type_) none) ;; 12 + (billiard-table-method-13 (_type_) symbol) ;; 13 + (billiard-table-method-14 (_type_) symbol) ;; 14 + (billiard-table-method-15 (_type_ float) none) ;; 15 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; guide-arrow ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype guide-arrow (process-drawable) ((bob-dir vector :inline :offset-assert 208) (base-pos vector :inline :offset-assert 224) + (pad uint8 8) ) :method-count-assert 23 :size-assert #xf8 :flag-assert #x17008000f8 - (:methods - (guide-arrow-method-22 () none) ;; 22 - ) (:state-methods - die ;; 21 idle ;; 20 + die ;; 21 + ) + (:methods + (guide-arrow-method-22 (_type_) vector) ;; 22 ) ) -|# -#| (deftype guide-arrow-init-params (structure) ((pos vector :inline :offset-assert 0) (facing vector :inline :offset-assert 16) (twist float :offset-assert 32) - (xz? basic :offset-assert 36) + (xz? symbol :offset-assert 36) ) :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) -|# -;; (define-extern guide-arrow-init-by-other function) -;; (define-extern spawn-guide-arrow function) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; kg-vehicles ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -#| -(deftype pickup-sled-sim (billiard-table) - ((mat matrix :inline :offset-assert 96) - (external-force vector :inline :offset-assert 160) - ) - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10000000b0 - ) -|# - -#| -(deftype h-kg-pickup (h-car-base) - ((fin-fr joint-mod-rotate-local :inline :offset-assert 960) - (fin-fl joint-mod-rotate-local :inline :offset-assert 992) - (fin-r joint-mod-rotate-local :inline :offset-assert 1024) - (fin-l joint-mod-rotate-local :inline :offset-assert 1056) - (rudder-l joint-mod-rotate-local :inline :offset-assert 1088) - (rudder-r joint-mod-rotate-local :inline :offset-assert 1120) - (turn-rate float :offset-assert 1152) - (target-turn-rate float :offset-assert 1156) - (camera-override? basic :offset-assert 1160) - (initial-creation-time uint64 :offset-assert 1168) - (auto-boost? basic :offset-assert 1176) - (steering-val float :offset-assert 1180) - (sled basic :offset-assert 1184) - (barrels basic :offset-assert 1188) - (taskman uint64 :offset-assert 1192) - (last-jitter-time uint64 :offset-assert 1200) - (last-slide-time uint64 :offset-assert 1208) - ) - :method-count-assert 162 - :size-assert #x4c0 - :flag-assert #xa2044004c0 - ) -|# - -#| -(deftype dark-barrel (process-focusable) - () - :method-count-assert 29 - :size-assert #xd0 - :flag-assert #x1d005000d0 - (:state-methods - idle ;; 28 - ) - ) -|# - -;; (define-extern *hijack-suck-curve* object) -;; (define-extern compute-suck-speed-scalar function) -;; (define-extern *h-kg-pickup-constants* object) -;; (define-extern dark-barrel-init-by-other function) -;; (define-extern spawn-pickup function) +(define-extern guide-arrow-init-by-other (function guide-arrow-init-params object :behavior guide-arrow)) +(define-extern spawn-guide-arrow (function guide-arrow-init-params process (pointer guide-arrow))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cty-hijack-missile ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype cty-hijack-missile-init-params (structure) ((pos vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) - (track-obj uint64 :offset-assert 32) - (is-leader? basic :offset-assert 40) + (track-obj handle :offset-assert 32) + (is-leader? symbol :offset-assert 40) ) :method-count-assert 9 :size-assert #x2c :flag-assert #x90000002c ) -|# -#| (deftype evasive-compare-params (structure) - ((data UNKNOWN 3 :offset-assert 0) - (y-val float :offset-assert 0) - (angular-velocity float :offset-assert 4) - (speed float :offset-assert 8) + ((data float 3 :offset-assert 0 :score -1) + (y-val float :offset 0) + (angular-velocity float :offset 4) + (speed float :offset 8) ) + :pack-me :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype evasive-action-info (structure) ((start-values evasive-compare-params :inline :offset-assert 0) (max-values evasive-compare-params :inline :offset-assert 12) (difficulty float :offset-assert 24) - (evaded? basic :offset-assert 28) + (evaded? symbol :offset-assert 28) ) :method-count-assert 11 :size-assert #x20 :flag-assert #xb00000020 (:methods - (evasive-action-info-method-9 () none) ;; 9 - (evasive-action-info-method-10 () none) ;; 10 + (init! (_type_ evasive-compare-params evasive-compare-params float) none) ;; 9 + (evaded? (_type_ evasive-compare-params) symbol) ;; 10 ) ) -|# -#| (deftype hijack-missile-bobber (structure) ((start-val float :offset-assert 0) (current-val float :offset-assert 4) - (total-time uint64 :offset-assert 8) - (current-time uint64 :offset-assert 16) + (total-time time-frame :offset-assert 8) + (current-time time-frame :offset-assert 16) (current-size-scalar float :offset-assert 24) (dir float :offset-assert 28) (num-iterations float :offset-assert 32) @@ -55609,27 +55201,27 @@ (current-speed float :offset-assert 68) (output-scale float :offset-assert 72) (output-val float :offset-assert 76) - (charge-time uint64 :offset-assert 80) - (wait-time uint64 :offset-assert 88) - (turning? basic :offset-assert 96) + (charge-time time-frame :offset-assert 80) + (wait-time time-frame :offset-assert 88) + (turning? symbol :offset-assert 96) ) + :pack-me :method-count-assert 12 :size-assert #x64 :flag-assert #xc00000064 (:methods - (hijack-missile-bobber-method-9 () none) ;; 9 - (hijack-missile-bobber-method-10 () none) ;; 10 - (hijack-missile-bobber-method-11 () none) ;; 11 + (init! (_type_) none) ;; 9 + (hijack-missile-bobber-method-10 (_type_) time-frame) ;; 10 + (hijack-missile-bobber-method-11 (_type_) time-frame) ;; 11 ) ) -|# -#| (deftype cty-hijack-missile (process-focusable) - ((tracked-player-positions basic :offset-assert 208) + ((root collide-shape-moving :override) + (tracked-player-positions vector-array :offset-assert 208) (current-track-index uint32 :offset-assert 212) - (last-record-time uint64 :offset-assert 216) - (track-obj uint64 :offset-assert 224) + (last-record-time time-frame :offset-assert 216) + (track-obj handle :offset-assert 224) (current-speed float :offset-assert 232) (target-speed float :offset-assert 236) (lunge-speed float :offset-assert 240) @@ -55637,14 +55229,14 @@ (evasive-info evasive-action-info :inline :offset-assert 272) (target-pos vector :inline :offset-assert 304) (flee-vec vector :inline :offset-assert 320) - (is-leader? basic :offset-assert 336) + (is-leader? symbol :offset-assert 336) (offset-dist float :offset-assert 340) (vel-factor float :offset-assert 344) (original-quat quaternion :inline :offset-assert 352) (rotate-deg float :offset-assert 368) (basetrans vector :inline :offset-assert 384) (lisa lissajous-interp :inline :offset-assert 400) - (next-lisa-time uint64 :offset-assert 488) + (next-lisa-time time-frame :offset-assert 488) (lisa-pt vector :inline :offset-assert 496) (circle-mag float :offset-assert 512) (last-trans vector :inline :offset-assert 528) @@ -55655,160 +55247,157 @@ (scale-factor float :offset-assert 560) (missile-dist float :offset-assert 564) (stage int8 :offset-assert 568) - (particle-trail basic :offset-assert 572) - (particle-trail-thrust basic :offset-assert 576) - (peel-off-sound uint32 :offset-assert 580) + (particle-trail sparticle-subsampler :offset-assert 572) + (particle-trail-thrust sparticle-subsampler :offset-assert 576) + (peel-off-sound sound-id :offset-assert 580) (bobber hijack-missile-bobber :inline :offset-assert 584) ) :method-count-assert 54 :size-assert #x2ac :flag-assert #x36023002ac - (:methods - (cty-hijack-missile-method-29 () none) ;; 29 - (cty-hijack-missile-method-32 () none) ;; 32 - (cty-hijack-missile-method-33 () none) ;; 33 - (cty-hijack-missile-method-34 () none) ;; 34 - (cty-hijack-missile-method-43 () none) ;; 43 - (cty-hijack-missile-method-44 () none) ;; 44 - (cty-hijack-missile-method-45 () none) ;; 45 - (cty-hijack-missile-method-46 () none) ;; 46 - (cty-hijack-missile-method-47 () none) ;; 47 - (cty-hijack-missile-method-48 () none) ;; 48 - (cty-hijack-missile-method-49 () none) ;; 49 - (cty-hijack-missile-method-50 () none) ;; 50 - (cty-hijack-missile-method-51 () none) ;; 51 - (cty-hijack-missile-method-52 () none) ;; 52 - (cty-hijack-missile-method-53 () none) ;; 53 - ) (:state-methods + idle ;; 28 + undefined0 ;; 29 chasing ;; 30 - chasing-2 ;; 38 - fake-chase ;; 42 + explode ;; 31 + undefined1 ;; 32 + undefined2 ;; 33 + undefined3 ;; 34 + lunge-prepare ;; 35 lure ;; 36 lure-die ;; 37 - lunge-prepare ;; 35 - explode ;; 31 - explode-tiny ;; 40 + chasing-2 ;; 38 die ;; 39 + explode-tiny ;; 40 initial-launch ;; 41 - idle ;; 28 + fake-chase ;; 42 + ) + (:methods + (go-idle (_type_) object) ;; 43 + (cty-hijack-missile-method-44 (_type_) none) ;; 44 + (probe-ground (_type_ vector vector) symbol) ;; 45 + (get-tracked-obj-pos (_type_ vector) vector) ;; 46 + (cty-hijack-missile-method-47 (_type_ vector int) vector) ;; 47 + (cty-hijack-missile-method-48 (_type_ vector) vector) ;; 48 + (cty-hijack-missile-method-49 (_type_) none) ;; 49 + (event-handler (_type_ process int symbol event-message-block) object) ;; 50 + (cty-hijack-missile-method-51 (_type_) none) ;; 51 + (cty-hijack-missile-method-52 (_type_ symbol) float) ;; 52 + (cty-hijack-missile-method-53 (_type_) none) ;; 53 ) ) -|# -;; (define-extern *missile-dist-near* object) -;; (define-extern *missile-dist-far* object) -;; (define-extern cty-hijack-missile-init-by-other function) -;; (define-extern compute-target-speed function) -;; (define-extern cty-hijack-missile-chase-event-handler function) -;; (define-extern *k0* object) -;; (define-extern *k1* object) -;; (define-extern *missile-dist-start* object) -;; (define-extern *accel-scalar* object) -;; (define-extern *use-lunging* object) +(define-extern *missile-dist-near* float) +(define-extern *missile-dist-far* float) +(define-extern cty-hijack-missile-init-by-other (function cty-hijack-missile-init-params object :behavior cty-hijack-missile)) +(define-extern compute-target-speed (function float)) +(def-event-handler cty-hijack-missile-chase-event-handler cty-hijack-missile) +(define-extern *k0* float) +(define-extern *k1* float) +(define-extern *missile-dist-start* float) +(define-extern *accel-scalar* float) +(define-extern *use-lunging* symbol) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cty-hijack ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype cty-hijack-manager (task-manager) - ((hpickup uint64 :offset-assert 240) - (missiles basic :offset-assert 248) + ((hpickup handle :offset-assert 240) + (missiles (array handle) :offset-assert 248) (current-leader-missile int8 :offset-assert 252) - (task-arrow uint64 :offset-assert 256) - (alert-expire-time uint64 :offset-assert 264) - (lure-hit-time uint64 :offset-assert 280) - (naughty-ottsel-lure uint64 :offset-assert 288) - (missile-sound uint32 :offset-assert 296) - (vehicle-is-visible? basic :offset-assert 300) - (last-check-vehicle-vis-time uint64 :offset-assert 304) + (task-arrow handle :offset-assert 256) + (alert-expire-time time-frame :offset-assert 264) + (lure-hit-time time-frame :offset 280) + (naughty-ottsel-lure handle :offset-assert 288) + (missile-sound sound-id :offset-assert 296) + (vehicle-is-visible? symbol :offset-assert 300) + (last-check-vehicle-vis-time time-frame :offset-assert 304) ) :method-count-assert 41 :size-assert #x138 :flag-assert #x2900c00138 - (:methods - (cty-hijack-manager-method-35 () none) ;; 35 - (cty-hijack-manager-method-36 () none) ;; 36 - (cty-hijack-manager-method-37 () none) ;; 37 - (cty-hijack-manager-method-38 () none) ;; 38 - (cty-hijack-manager-method-39 () none) ;; 39 - (cty-hijack-manager-method-40 () none) ;; 40 - ) (:state-methods player-riding ;; 32 - show-missile-launch ;; 34 decoy-stage ;; 33 - active ;; 15 - wait ;; 14 - fail ;; 18 + show-missile-launch ;; 34 + ) + (:methods + (cty-hijack-manager-method-35 (_type_) none) ;; 35 + (spawn-missile (_type_ vector quaternion int) handle) ;; 36 + (spawn-missiles-from-launcher (_type_ int) none) ;; 37 + (guide-arrow-spawn (_type_) symbol) ;; 38 + (cty-hijack-manager-method-39 (_type_ int) none) ;; 39 + (reset-hijack-speech (_type_) symbol) ;; 40 ) ) -|# -#| (deftype hijack-speech-instance (speech-instance) () :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| +;; +++cty-hijack:hijack-speech-info-flag +(defenum hijack-speech-info-flag + :type uint64 + :bitfield #t + (hsi0 0) + (hsi1 1) + (hsi2 2) + (hsi3 3) + (hsi4 4) + (hsi5 5) + ) +;; ---cty-hijack:hijack-speech-info-flag + (deftype hijack-speech-info (structure) - ((speeches basic :offset-assert 0) - (flags uint64 :offset-assert 8) - (play-time uint64 :offset-assert 16) + ((speeches (array hijack-speech-instance) :offset-assert 0) + (flags hijack-speech-info-flag :offset-assert 8) + (play-time time-frame :offset-assert 16) ) :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype cty-missile-lure-init-params (structure) ((pos vector :inline :offset-assert 0) (orient quaternion :inline :offset-assert 16) - (is-naughty-ottsel? basic :offset-assert 32) + (is-naughty-ottsel? symbol :offset-assert 32) ) :method-count-assert 9 :size-assert #x24 :flag-assert #x900000024 ) -|# -#| (deftype cty-missile-lure (process-focusable) - ((state-time uint64 :offset-assert 192) - (minimap connection-minimap :offset-assert 216) - (is-naughty-ottsel? basic :offset-assert 220) - (lock-open? basic :offset-assert 224) - (hum-sound uint32 :offset-assert 228) - (sirens2 basic :offset-assert 232) - (raise-sound uint32 :offset-assert 236) + ((minimap connection-minimap :offset 216) + (is-naughty-ottsel? symbol :offset-assert 220) + (lock-open? symbol :offset-assert 224) + (hum-sound sound-id :offset-assert 228) + (sirens2 sparticle-launch-control :offset-assert 232) + (raise-sound sound-id :offset-assert 236) ) :method-count-assert 37 :size-assert #xf0 :flag-assert #x25007000f0 - (:methods - (cty-missile-lure-method-35 () none) ;; 35 - (cty-missile-lure-method-36 () none) ;; 36 - ) (:state-methods + idle ;; 28 active ;; 29 + complete ;; 30 closing ;; 31 opening ;; 32 - complete ;; 30 - idle ;; 28 naughty-ottsel-wait ;; 33 naughty-ottsel-lure ;; 34 ) + (:methods + (go-idle (_type_) object) ;; 35 + (find-and-lure-missiles (_type_) symbol) ;; 36 + ) ) -|# -#| (deftype cty-lure-info (structure) ((pos vector :inline :offset-assert 0) ) @@ -55816,9 +55405,7 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype cty-missile-launcher (process-drawable) () :method-count-assert 22 @@ -55829,9 +55416,7 @@ recoil ;; 21 ) ) -|# -#| (deftype guide-arrow-info (structure) ((pos vector :inline :offset-assert 0) (facing vector :inline :offset-assert 16) @@ -55840,24 +55425,23 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -;; (define-extern *cty-hijack-speech-list* object) -;; (define-extern *pickup-start-pos* object) -;; (define-extern *pickup-start-angle* object) -;; (define-extern *hijack-speech* array) -;; (define-extern debug-reset-hijack-speech function) -;; (define-extern cty-missile-lure-init-by-other function) -;; (define-extern *cty-hijack-lure-positions* array) -;; (define-extern *naughty-ottsel-pos* object) -;; (define-extern *ctyport-hijack-fail* object) -;; (define-extern *pre-hijack-kg-squad-member-settings* object) -;; (define-extern *post-hijack-kg-squad-member-settings* object) -;; (define-extern *missile-fire-order* array) -;; (define-extern *missile-fire-frames* array) -;; (define-extern *missile-closer-chase-normal* object) -;; (define-extern *missile-closer-chase-pos* object) -;; (define-extern *guide-arrow-list* array) +(define-extern *cty-hijack-speech-list* (inline-array talker-speech-class)) +(define-extern *pickup-start-pos* vector) +(define-extern *pickup-start-angle* float) +(define-extern *hijack-speech* (array hijack-speech-info)) +(define-extern debug-reset-hijack-speech (function symbol)) +(define-extern cty-missile-lure-init-by-other (function cty-missile-lure-init-params object :behavior cty-missile-lure)) +(define-extern *cty-hijack-lure-positions* (array cty-lure-info)) +(define-extern *naughty-ottsel-pos* vector) +(define-extern *ctyport-hijack-fail* resetter-params) +(define-extern *pre-hijack-kg-squad-member-settings* kg-squad-member-settings) +(define-extern *post-hijack-kg-squad-member-settings* kg-squad-member-settings) +(define-extern *missile-fire-order* (array int32)) +(define-extern *missile-fire-frames* (array float)) +(define-extern *missile-closer-chase-normal* vector) +(define-extern *missile-closer-chase-pos* vector) +(define-extern *guide-arrow-list* (array guide-arrow-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; for-turret-shot ;; @@ -57440,7 +57024,6 @@ ;; ctyfarm-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype farm-marrow (process-drawable) () :method-count-assert 21 @@ -57450,9 +57033,7 @@ idle ;; 20 ) ) -|# -#| (deftype farm-beetree (process-drawable) () :method-count-assert 21 @@ -57462,9 +57043,7 @@ idle ;; 20 ) ) -|# -#| (deftype farm-cabbage (process-drawable) () :method-count-assert 21 @@ -57474,9 +57053,7 @@ idle ;; 20 ) ) -|# -#| (deftype farm-small-cabbage (process-drawable) () :method-count-assert 21 @@ -57486,9 +57063,7 @@ idle ;; 20 ) ) -|# -#| (deftype farm-chilirots (process-drawable) () :method-count-assert 21 @@ -57498,9 +57073,7 @@ idle ;; 20 ) ) -|# -#| (deftype farm-sprinkler-barrels (process-drawable) () :method-count-assert 21 @@ -57510,14 +57083,13 @@ idle ;; 20 ) ) -|# -;; (define-extern check-farm-piece-ground function) ;; (function sparticle-system sparticle-cpuinfo matrix none) -;; (define-extern farm-activate function) ;; (function level none) -;; (define-extern birth-func-ctyfarma-drip function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern check-drop-level-ctyfarma-drop-userdata function) ;; (function sparticle-system sparticle-cpuinfo matrix none) -;; (define-extern birth-func-ctyfarmb-drip function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern check-drop-level-ctyfarmb-drop-userdata function) ;; (function sparticle-system sparticle-cpuinfo matrix none) +(define-extern check-farm-piece-ground (function sparticle-system sparticle-cpuinfo matrix none)) +(define-extern farm-activate (function level none)) +(define-extern birth-func-ctyfarma-drip (function int sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern check-drop-level-ctyfarma-drop-userdata (function sparticle-system sparticle-cpuinfo matrix none)) +(define-extern birth-func-ctyfarmb-drip (function int sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern check-drop-level-ctyfarmb-drop-userdata (function sparticle-system sparticle-cpuinfo matrix none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyfarma-part ;; @@ -58758,6 +58330,136 @@ (define-extern *v-marauder-turret-control-info* turret-control-info) (define-extern *v-marauder-turret-guard-settings* squad-unit-settings) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; wcar-catapult ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +(deftype catapult-shot-sphere (process-drawable) + ((current-alpha float :offset-assert 200) + (pad uint8 12) + ) + :method-count-assert 21 + :size-assert #xd8 + :flag-assert #x15006000d8 + (:state-methods + active ;; 20 + ) + ) + +(deftype catapult-shot-sphere-init-params (structure) + ((pos vector :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype v-catapult-shot (metalhead-grenade-shot) + ((trail-part sparticle-launch-control :offset-assert 532) + ) + :method-count-assert 41 + :size-assert #x218 + :flag-assert #x2901a00218 + (:state-methods + impact ;; 22 + ) + ) + +(deftype v-catapult (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline :offset-assert 2752) + (jmod-gun-x joint-mod-rotate-local :inline :offset-assert 2880) + (jmod-gun-y joint-mod-rotate-local :inline :offset-assert 2912) + (turret-control turret-control :inline :offset-assert 2944) + (sub-state-time uint32 :offset-assert 3040) + (sub-state int8 :offset-assert 3044) + (launch-projectile? symbol :offset-assert 3048) + (targ-pos vector :inline :offset-assert 3056) + (notify-handle handle :offset-assert 3072) + (spawn-part? symbol :offset-assert 3080) + (charge-time time-frame :offset-assert 3088) + (exploding? symbol :offset-assert 3096) + ) + :method-count-assert 205 + :size-assert #xc1c + :flag-assert #xcd0ba00c1c + (:state-methods + explode ;; 60 + die ;; 61 + hostile ;; 152 + ) + (:methods + (fire-catapult-shot (_type_ vector vector) none) ;; 203 + (v-catapult-method-204 (_type_) symbol) ;; 204 + ) + ) + +(define-extern *v-catapult-turret-control-info* turret-control-info) +(define-extern *v-catapult-turret-guard-settings* squad-unit-settings) +(define-extern *v-catapult-debris-longspike-params* debris-static-params) +(define-extern *v-catapult-debris-bar-params* debris-static-params) +(define-extern *v-catapult-debris-lpanel-params* debris-static-params) +(define-extern *v-catapult-debris-rpanel-params* debris-static-params) +(define-extern *v-catapult-debris-lbumperspikes-params* debris-static-params) +(define-extern *v-catapult-debris-rbumperspikes-params* debris-static-params) +(define-extern *v-catapult-debris-lfspike-params* debris-static-params) +(define-extern *v-catapult-debris-rfspike-params* debris-static-params) +(define-extern *v-catapult-debris-ltopspike-params* debris-static-params) +(define-extern *v-catapult-debris-rtopspike-params* debris-static-params) +(define-extern *v-catapult-debris-lsidespikea-params* debris-static-params) +(define-extern *v-catapult-debris-lsidespikeb-params* debris-static-params) +(define-extern *v-catapult-debris-lsidespikec-params* debris-static-params) +(define-extern *v-catapult-debris-lsidespiked-params* debris-static-params) +(define-extern *v-catapult-debris-lsidespikee-params* debris-static-params) +(define-extern *v-catapult-debris-rsidespikea-params* debris-static-params) +(define-extern *v-catapult-debris-rsidespikeb-params* debris-static-params) +(define-extern *v-catapult-debris-rsidespikec-params* debris-static-params) +(define-extern *v-catapult-debris-rsidespiked-params* debris-static-params) +(define-extern *v-catapult-debris-rsidespikee-params* debris-static-params) +(define-extern *v-catapult-debris-lfpanela-params* debris-static-params) +(define-extern *v-catapult-debris-rfpanela-params* debris-static-params) +(define-extern *v-catapult-debris-lfpanelb-params* debris-static-params) +(define-extern *v-catapult-debris-rfpanelb-params* debris-static-params) +(define-extern *v-catapult-debris-lfpanelc-params* debris-static-params) +(define-extern *v-catapult-debris-rfpanelc-params* debris-static-params) +(define-extern *v-catapult-debris-lfpaneld-params* debris-static-params) +(define-extern *v-catapult-debris-rfpaneld-params* debris-static-params) +(define-extern *v-catapult-debris-lmpanela-params* debris-static-params) +(define-extern *v-catapult-debris-rmpanela-params* debris-static-params) +(define-extern *v-catapult-debris-lmpanelb-params* debris-static-params) +(define-extern *v-catapult-debris-rmpanelb-params* debris-static-params) +(define-extern *v-catapult-debris-lmpanelc-params* debris-static-params) +(define-extern *v-catapult-debris-rmpanelc-params* debris-static-params) +(define-extern *v-catapult-debris-lmpaneld-params* debris-static-params) +(define-extern *v-catapult-debris-rmpaneld-params* debris-static-params) +(define-extern *v-catapult-debris-lrpanela-params* debris-static-params) +(define-extern *v-catapult-debris-rrpanela-params* debris-static-params) +(define-extern *v-catapult-debris-lrpanelb-params* debris-static-params) +(define-extern *v-catapult-debris-rrpanelb-params* debris-static-params) +(define-extern *v-catapult-debris-lrpanelc-params* debris-static-params) +(define-extern *v-catapult-debris-rrpanelc-params* debris-static-params) +(define-extern *v-catapult-debris-lrpaneld-params* debris-static-params) +(define-extern *v-catapult-debris-rrpaneld-params* debris-static-params) +(define-extern *range-ftexplo-dust-color* curve-color-fast) +(define-extern *range-ftexplo-dust-alpha* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-dust-alpha* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *part-v-catapult-shot-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-ftexplo-color* curve-color-fast) +(define-extern *range-ftexplo-alpha* curve2d-fast) +(define-extern *range-ftexplo-scale-x* curve2d-fast) +(define-extern *range-ftexplo-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-alpha* curve2d-fast) +(define-extern *curve-ftexplo-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-scale-y* curve2d-fast) +(define-extern *part-v-catapult-shot-explosion-texture-curve-settings* particle-curve-settings) +(define-extern catapult-shot-sphere-init-by-other (function catapult-shot-sphere-init-params object :behavior catapult-shot-sphere)) +(define-extern *v-catapult-shot-impact-blur* curve2d-piecewise) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; w-parking-spot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -59640,22 +59342,19 @@ ;; ctyindb-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *ctyindb-steam-b-particle-list* array) -;; (define-extern birth-func-texture-group-steam-b-ctyindb function) +(define-extern *ctyindb-steam-b-particle-list* (array int32)) +(define-extern birth-func-texture-group-steam-b-ctyindb (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyindb-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype industrialb-board-vent (bouncer) () :method-count-assert 27 :size-assert #xd8 :flag-assert #x1b006000d8 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; basebutton ;; @@ -61251,128 +60950,6 @@ (define-extern was-pre-heart-init (function entity-actor object :behavior was-pre-heart)) (define-extern *was-pre-game* (pointer was-pre-game)) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; metalhead-grunt ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -#| -(deftype mh-grunt-anim-info (structure) - ((anim-index int32 :offset-assert 0) - (travel-speed meters :offset-assert 4) - ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 - ) -|# - -#| -(deftype mh-grunt-global-info (basic) - ((patrol-anim UNKNOWN 2 :offset-assert 4) - (charge-anim UNKNOWN 1 :offset-assert 20) - (attack-anim UNKNOWN 1 :offset-assert 28) - ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 - ) -|# - -#| -(deftype metalhead-grunt (mh-squad-member) - ((patrol-anim mh-grunt-anim-info :offset-assert 1080) ;; grunt-anim-info - (charge-anim mh-grunt-anim-info :offset-assert 1084) ;; grunt-anim-info - (attack-anim mh-grunt-anim-info :offset-assert 1088) ;; grunt-anim-info - (intro-path path-control :offset-assert 1092) ;; guessed by decompiler - (circle-radial-dist float :offset-assert 244) - (use-charge-anim-index int8 :offset-assert 1100) - (jumping-ambush-path-pt int8 :offset-assert 1101) - (mh-grunt-flags uint8 :offset-assert 1102) - (state-timeout2 uint64 :offset-assert 1104) - (next-warn-time uint64 :offset-assert 1112) ;; time-frame - (dest vector :inline :offset-assert 1120) - (focus-pos vector :inline :offset-assert 352) - ) - :method-count-assert 231 - :size-assert #x480 - :flag-assert #xe704000480 - (:methods - (metalhead-grunt-method-228 () none) ;; 228 - (metalhead-grunt-method-229 () none) ;; 229 - (metalhead-grunt-method-230 () none) ;; 230 - ) - (:state-methods - in-ditch ;; 192 - wait-for-focus ;; 226 - knocked-recover ;; 32 - spin-attack ;; 227 - attack ;; 222 - hostile ;; 38 - active ;; 34 - jumping-ambush-cont ;; 225 - die-fast ;; 42 - jumping-ambush ;; 224 - stop-chase ;; 158 - falling-ambush ;; 223 - ) - ) -|# - -;; (define-extern *fact-info-mh-grunt-defaults* fact-info-enemy-defaults) -;; (define-extern *metalhead-grunt-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info -;; (define-extern *mh-grunt-global-info* mh-grunt-global-info) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; metalhead-predator ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -#| -(deftype metalhead-predator-shot (metalhead-shot) - () - :method-count-assert 41 - :size-assert #x210 - :flag-assert #x2901900210 - ) -|# - -#| -(deftype metalhead-predator (mh-squad-member) - ((los los-control :inline :offset-assert 1088) - (want-stop symbol :offset-assert 1252) ;; guessed by decompiler - (target-pos vector :inline :offset-assert 1264) - (curr-node int32 :offset-assert 1280) - (hide-pos vector :inline :offset-assert 1296) - (next-change uint64 :offset-assert 1312) ;; int64 - (shoot-angle float :offset-assert 1320) ;; degrees - (miss-amount float :offset-assert 1324) - (ambient-sound-id sound-id :offset-assert 1328) ;; guessed by decompiler - (shock-effect-time uint64 :offset-assert 1336) ;; time-frame - (shock-effect-end uint64 :offset-assert 1344) ;; int64 - (fade float :offset-assert 1352) - (dest-fade float :offset-assert 1356) - ) - :method-count-assert 228 - :size-assert #x550 - :flag-assert #xe404d00550 - (:methods - (metalhead-predator-method-224 () none) ;; 224 - (metalhead-predator-method-225 () none) ;; 225 - (metalhead-predator-method-226 () none) ;; 226 - (metalhead-predator-method-227 () none) ;; 227 - ) - (:state-methods - die-fast ;; 42 - in-ditch ;; 192 - close-attack ;; 223 - fire ;; 222 - hostile ;; 38 - active ;; 34 - ) - ) -|# - -;; (define-extern *metalhead-predator-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; terraformer-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -61648,32 +61225,29 @@ ;; freehq-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern part-freehq-sphere-vert-line-flicker function) -;; (define-extern birth-func-freehq-sphere function) -;; (define-extern sparticle-kill-at-scale-eqline function) -;; (define-extern sparticle-kill-at-scale-mediumb function) -;; (define-extern sparticle-kill-at-scale function) -;; (define-extern sparticle-kill-at-scale-squares function) -;; (define-extern *range-landscape-scale-x* curve2d-fast) -;; (define-extern *range-landscape-scale-y* curve2d-fast) -;; (define-extern *curve-landscape-scale-x-temp* curve2d-fast) -;; (define-extern *curve-landscape-scale-x* curve2d-fast) -;; (define-extern *curve-landscape-scale-y* curve2d-fast) -;; (define-extern *part-freehq-giant-landscape-curve-settings* object) +(define-extern part-freehq-sphere-vert-line-flicker (function sparticle-system sparticle-cpuinfo sparticle-launchinfo sparticle-launcher sparticle-launch-state none)) +(define-extern birth-func-freehq-sphere (function sparticle-system sparticle-cpuinfo sparticle-launchinfo sparticle-launcher sparticle-launch-state none)) +(define-extern sparticle-kill-at-scale-eqline (function sparticle-system sparticle-cpuinfo sparticle-launchinfo sparticle-launcher sparticle-launch-state none)) +(define-extern sparticle-kill-at-scale-mediumb (function sparticle-system sparticle-cpuinfo sparticle-launchinfo sparticle-launcher sparticle-launch-state none)) +(define-extern sparticle-kill-at-scale (function sparticle-system sparticle-cpuinfo sparticle-launchinfo sparticle-launcher sparticle-launch-state none)) +(define-extern sparticle-kill-at-scale-squares (function sparticle-system sparticle-cpuinfo sparticle-launchinfo sparticle-launcher sparticle-launch-state none)) +(define-extern *range-landscape-scale-x* curve2d-fast) +(define-extern *range-landscape-scale-y* curve2d-fast) +(define-extern *curve-landscape-scale-x-temp* curve2d-fast) +(define-extern *curve-landscape-scale-x* curve2d-fast) +(define-extern *curve-landscape-scale-y* curve2d-fast) +(define-extern *part-freehq-giant-landscape-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; freehq-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype freehq-sml-door (com-airlock) () :method-count-assert 30 :size-assert #x1b0 :flag-assert #x1e013001b0 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hover-nav-towera ;; @@ -61842,16 +61416,23 @@ ;; cty-destroy-grid ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype jinx-hud (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| +;; +++cty-destroy-grid:jinx-flag +(defenum jinx-flag + :type uint32 + :bitfield #t + (j0 0) + (j1 1) + (j2 2) + ) +;; ---cty-destroy-grid:jinx-flag + (deftype jinx (civilian) ((min-speed float :offset-assert 1124) (max-speed float :offset-assert 1128) @@ -61862,103 +61443,92 @@ (player-blocking float :offset-assert 1148) (follow-dir vector :inline :offset-assert 1152) (destination vector :inline :offset-assert 1168) - (nav-mesh-aid uint32 :offset-assert 1184) - (health-handle uint64 :offset-assert 1192) ;; handle + (nav-mesh-aid actor-id :offset-assert 1184) + (health-handle handle :offset-assert 1192) ;; handle (box-time float :offset-assert 1200) - (attacker-info city-attacker-info :offset-assert 1016) - (mission-squad basic :offset-assert 1020) - (jinx-flags uint32 :offset-assert 1212) + (jinx-flags jinx-flag :offset 1212) ) :method-count-assert 246 :size-assert #x4c0 :flag-assert #xf6044004c0 - (:methods - (jinx-method-237 () none) ;; 237 - (jinx-method-240 () none) ;; 240 - (jinx-method-241 () none) ;; 241 - (jinx-method-242 () none) ;; 242 - (jinx-method-243 () none) ;; 243 - (jinx-method-244 () none) ;; 244 - (jinx-method-245 () none) ;; 245 - ) (:state-methods - traveling-blocked ;; 234 - do-power-box ;; 239 - die ;; 40 - traveling ;; 235 - exit-vehicle ;; 227 knocked-recover ;; 32 - go-power-box ;; 238 - board-vehicle ;; 225 + die ;; 40 die-fast ;; 42 - move-to-vehicle ;; 224 - waiting-idle ;; 236 wait-for-ride ;; 223 + move-to-vehicle ;; 224 + board-vehicle ;; 225 + exit-vehicle ;; 227 + traveling-blocked ;; 234 + traveling ;; 235 + waiting-idle ;; 236 + undefined0 ;; 237 + go-power-box ;; 238 + do-power-box ;; 239 + ) + (:methods + (adjust-target-speed (_type_) none) ;; 240 + (player-blocking-travel? (_type_) symbol) ;; 241 + (travel-anim (_type_) int) ;; 242 + (update-nav-mesh (_type_) none) ;; 243 + (move-cam-to-jinx (_type_) object) ;; 244 + (set-cam-height (_type_ vector) float) ;; 245 ) ) -|# -#| (deftype task-manager-city-destroy-grid (task-manager) - ((jinx uint64 :offset-assert 236) - (actor-group uint32 :offset-assert 244) - (actor-group-count int32 :offset-assert 248) - (next-box uint32 :offset-assert 252) - (arrow-h uint64 :offset-assert 260) - (goal-pos vector :inline :offset-assert 268) - (goal-pos-front vector :inline :offset-assert 284) - (sub-state uint32 :offset-assert 300) - (vehicle uint64 :offset-assert 308) - (wall-h uint64 :offset-assert 316) - (sound-name basic :offset-assert 324) - (id uint32 :offset-assert 328) - (delay uint64 :offset-assert 332) - (delay-start uint64 :offset-assert 340) - (start-time uint64 :offset-assert 164) - (end-time uint64 :offset-assert 356) - (intro-play? basic :offset-assert 364) + ((jinx handle :offset-assert 240) + (actor-group (pointer actor-group) :offset-assert 248) + (actor-group-count int32 :offset-assert 252) + (next-box uint32 :offset-assert 256) + (arrow-h handle :offset-assert 264) + (goal-pos vector :inline :offset-assert 272) + (goal-pos-front vector :inline :offset-assert 288) + (sub-state uint32 :offset-assert 304) + (vehicle handle :offset-assert 312) + (wall-h handle :offset-assert 320) + (sound-name string :offset-assert 328) + (id sound-id :offset-assert 332) + (delay time-frame :offset-assert 336) + (delay-start time-frame :offset-assert 344) + (end-time time-frame :offset 360) + (intro-play? symbol :offset-assert 368) ) :method-count-assert 34 :size-assert #x174 :flag-assert #x2201000174 (:methods - (task-manager-city-destroy-grid-method-32 () none) ;; 32 - (task-manager-city-destroy-grid-method-33 () none) ;; 33 - ) - (:state-methods - active ;; 15 - wait ;; 14 + (update-jinx-speech (_type_) none) ;; 32 + (set-speech-name (_type_ string int int) none) ;; 33 ) ) -|# -#| (deftype com-power-box (process-drawable) - ((sound-id uint32 :offset-assert 200) + ((root collide-shape :override) + (sound-id sound-id :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc (:state-methods - explode ;; 21 idle ;; 20 + explode ;; 21 ) ) -|# -;; (define-extern *jinx-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info -;; (define-extern *citizen-jinx-global-info* civilian-global-info) -;; (define-extern board-vehicle-get-in-car-jump function) -;; (define-extern board-vehicle-get-in-car-land function) -;; (define-extern board-vehicle-get-in-car-sit function) -;; (define-extern board-vehicle-get-in-car-end function) -;; (define-extern *cty-destroy-grid-kg-squad-member-settings* object) -;; (define-extern *cty-destroy-grid-mh-squad-member-settings* object) -;; (define-extern *jinx-exit-vehicle-speech-index* object) -;; (define-extern *jinx-board-vehicle-speech-index* object) -;; (define-extern *jinx-exit-vehicle-speech* array) -;; (define-extern *jinx-board-vehicle-speech* array) -;; (define-extern *combox-debris-params* debris-static-params) +(define-extern *jinx-nav-enemy-info* nav-enemy-info) +(define-extern *citizen-jinx-global-info* civilian-global-info) +(define-extern board-vehicle-get-in-car-jump (function vector quaternion symbol vector :behavior jinx)) +(define-extern board-vehicle-get-in-car-land (function symbol quaternion :behavior jinx)) +(define-extern board-vehicle-get-in-car-sit (function symbol quaternion :behavior jinx)) +(define-extern board-vehicle-get-in-car-end (function none :behavior jinx)) +(define-extern *cty-destroy-grid-kg-squad-member-settings* (inline-array kg-squad-member-settings)) +(define-extern *cty-destroy-grid-mh-squad-member-settings* (inline-array mh-squad-member-settings)) +(define-extern *jinx-exit-vehicle-speech-index* int) +(define-extern *jinx-board-vehicle-speech-index* int) +(define-extern *jinx-exit-vehicle-speech* (array string)) +(define-extern *jinx-board-vehicle-speech* (array string)) +(define-extern *combox-debris-params* debris-static-params) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; prim-beam ;; @@ -63586,8 +63156,8 @@ ;; onintent-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern check-bubble-surface-onintent function) ;; (function sparticle-system sparticle-cpuinfo matrix symbol) -;; (define-extern check-onintent-bugs function) ;; (function sparticle-system sparticle-cpuinfo matrix none) +(define-extern check-bubble-surface-onintent (function sparticle-system sparticle-cpuinfo matrix symbol)) +(define-extern check-onintent-bugs (function sparticle-system sparticle-cpuinfo matrix none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; onintent-scenes ;; @@ -63869,32 +63439,27 @@ ;; ctyinda-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *ctyinda-steam-particle-list* array) -;; (define-extern birth-func-texture-group-steam-ctyinda function) +(define-extern *ctyinda-steam-particle-list* (array int32)) +(define-extern birth-func-texture-group-steam-ctyinda (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyinda-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ctyinda-vingate (elec-gate) () :method-count-assert 31 :size-assert #x200 :flag-assert #x1f01800200 ) -|# -#| (deftype industrial-board-vent (bouncer) () :method-count-assert 27 :size-assert #xd8 :flag-assert #x1b006000d8 ) -|# -#| (deftype ctyinda-evil-streetlamp (process-drawable) () :method-count-assert 21 @@ -63904,9 +63469,8 @@ idle ;; 20 ) ) -|# -;; (define-extern *vingate-elec-gate-params* object) +(define-extern *vingate-elec-gate-params* elec-gate-params) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; kanga-lizard ;; @@ -64984,127 +64548,112 @@ ;; cty-sniper-battery ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype cty-sniper-button-top (process-drawable) - ((is-up basic :offset-assert 200) - (colormode uint64 :offset-assert 208) + ((is-up symbol :offset-assert 200) + (colormode handle :offset-assert 208) ) :method-count-assert 23 :size-assert #xd8 :flag-assert #x17006000d8 (:state-methods - going-down ;; 22 - going-up ;; 21 idle ;; 20 + going-up ;; 21 + going-down ;; 22 ) ) -|# -#| (deftype cty-sniper-button (process-drawable) - ((stay-down-time uint64 :offset-assert 200) - (lid uint64 :offset-assert 208) + ((stay-down-time time-frame :offset-assert 200) + (lid handle :offset-assert 208) ) :method-count-assert 26 :size-assert #xd8 :flag-assert #x1a006000d8 - (:methods - (cty-sniper-button-method-25 () none) ;; 25 - ) (:state-methods - moribund ;; 24 - bail-up ;; 23 - idle-down ;; 22 - going-down ;; 21 idle-up ;; 20 + going-down ;; 21 + idle-down ;; 22 + bail-up ;; 23 + moribund ;; 24 + ) + (:methods + (cty-sniper-button-method-25 (_type_) object) ;; 25 ) ) -|# -#| (deftype cty-sniper-battery (process-focusable) ((incoming-attack-id uint32 :offset-assert 208) - (actor-group uint32 :offset-assert 212) + (actor-group (pointer actor-group) :offset-assert 212) (actor-group-count int32 :offset-assert 216) - (known-vulnerable-this-frame basic :offset-assert 220) - (during-movement-sound uint32 :offset-assert 224) - (run-once basic :offset-assert 228) - (halted basic :offset-assert 232) + (known-vulnerable-this-frame symbol :offset-assert 220) + (during-movement-sound sound-id :offset-assert 224) + (run-once symbol :offset-assert 228) + (halted symbol :offset-assert 232) ) :method-count-assert 33 :size-assert #xec :flag-assert #x21007000ec - (:methods - (cty-sniper-battery-method-32 () none) ;; 32 - ) (:state-methods - explode ;; 31 - die ;; 30 - vulnerable ;; 29 idle ;; 28 + vulnerable ;; 29 + die ;; 30 + explode ;; 31 + ) + (:methods + (cty-sniper-battery-method-32 (_type_) symbol) ;; 32 ) ) -|# -;; (define-extern cty-sniper-button-top-handler function) -;; (define-extern cty-sniper-button-top-genpost function) -;; (define-extern cty-sniper-button-top-init-by-other function) -;; (define-extern *cty-sniper-battery-exploder-params* joint-exploder-static-params) -;; (define-extern cty-sniper-battery-handler function) -;; (define-extern cty-sniper-battery-init-by-other function) +(def-event-handler cty-sniper-button-top-handler cty-sniper-button-top) +(define-extern cty-sniper-button-top-genpost (function object :behavior cty-sniper-button-top)) +(define-extern cty-sniper-button-top-init-by-other (function vector quaternion object :behavior cty-sniper-button-top)) +(define-extern *cty-sniper-battery-exploder-params* joint-exploder-static-params) +(def-event-handler cty-sniper-battery-handler cty-sniper-battery) +(define-extern cty-sniper-battery-init-by-other (function vector quaternion object :behavior cty-sniper-battery)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cty-sniper-turret ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype task-manager-city-sniper-fight (task-manager) - ((sniper-turrets-marker-entity basic :offset-assert 236) - (check-timer uint64 :offset-assert 244) - (actor-group uint32 :offset-assert 252) - (actor-group-count int32 :offset-assert 256) - (cur-group int8 :offset-assert 260) - (win-time uint64 :offset-assert 268) - (music-started basic :offset-assert 276) - (torn-said-turret-rising basic :offset-assert 280) - (torn-said-dodge basic :offset-assert 284) - (torn-said-battery-retract basic :offset-assert 288) - (torn-speech-one-down basic :offset-assert 292) - (dax-said-bop-the-core basic :offset-assert 296) - (last-torn-speech-time uint64 :offset-assert 300) - (battery-retractions-since-last-kaboom int32 :offset-assert 308) - (minimap connection-minimap :offset-assert 312) + ((sniper-turrets-marker-entity entity-actor :offset-assert 240) + (check-timer time-frame :offset-assert 248) + (actor-group (pointer actor-group) :offset-assert 256) + (actor-group-count int32 :offset-assert 260) + (cur-group int8 :offset-assert 264) + (win-time time-frame :offset-assert 272) + (music-started symbol :offset-assert 280) + (torn-said-turret-rising symbol :offset-assert 284) + (torn-said-dodge symbol :offset-assert 288) + (torn-said-battery-retract symbol :offset-assert 292) + (torn-speech-one-down symbol :offset-assert 296) + (dax-said-bop-the-core symbol :offset-assert 300) + (last-torn-speech-time time-frame :offset-assert 304) + (battery-retractions-since-last-kaboom int32 :offset-assert 312) + (minimap connection-minimap :offset-assert 316) ) :method-count-assert 33 :size-assert #x140 :flag-assert #x2100c00140 (:methods - (task-manager-city-sniper-fight-method-32 () none) ;; 32 - ) - (:state-methods - wait ;; 14 - active ;; 15 + (task-manager-city-sniper-fight-method-32 (_type_) none) ;; 32 ) ) -|# -#| (deftype hud-cty-sniper-fight (hud) - ((buttons uint32 :offset-assert 2756) + ((buttons (pointer actor-group) :offset-assert 2756) (num-buttons int8 :offset-assert 2760) ) :method-count-assert 28 :size-assert #xac9 :flag-assert #x1c0a500ac9 (:methods - (hud-cty-sniper-fight-method-27 () none) ;; 27 + (draw-hud-buttons (_type_ (pointer actor-group)) symbol) ;; 27 ) ) -|# -#| (deftype cty-sniper-turret-shot (projectile) - ((hit-actor? basic :offset-assert 512) + ((hit-actor? symbol :offset-assert 512) (tail-pos vector :inline :offset-assert 528) ) :method-count-assert 41 @@ -65114,12 +64663,30 @@ impact ;; 22 ) ) -|# -#| +;; +++cty-sniper-turret:cty-sniper-turret-flag +(defenum cty-sniper-turret-flag + :type uint16 + :bitfield #t + (cst0 0) + (cst1 1) + (cst2 2) + (cst3 3) + (cst4 4) + (cst5 5) + (cst6 6) + (cst7 7) + (cst8 8) + (cst9 9) + (cst10 10) + (cst11 11) + (cst12 12) + ) +;; ---cty-sniper-turret:cty-sniper-turret-flag + (deftype cty-sniper-turret (process-focusable) ((los los-control :inline :offset-assert 208) - (reticle uint64 :offset-assert 376) + (reticle handle :offset-assert 376) (tank-quat quaternion :inline :offset-assert 384) (rotate-quat quaternion :inline :offset-assert 400) (rotate-rate float :offset-assert 416) @@ -65129,7 +64696,7 @@ (offset vector :inline :offset-assert 432) (sight-pos vector :inline :offset-assert 448) (firing-sight-pos vector :inline :offset-assert 464) - (gun-timer uint64 :offset-assert 480) + (gun-timer time-frame :offset-assert 480) (gun-elev-jmod joint-mod-rotate-world :inline :offset-assert 496) (gun-elev-joint-index int32 :offset-assert 528) (gun-elev-desired-rotation quaternion :inline :offset-assert 544) @@ -65144,41 +64711,39 @@ (gun-elbow-jmod joint-mod-rotate-local :inline :offset-assert 656) (gun-shoulder-jmod joint-mod-rotate-local :inline :offset-assert 688) (pos-cam-offset vector :inline :offset-assert 720) - (flags uint16 :offset-assert 736) - (turn-sound-id uint32 :offset-assert 740) - (h-reticle-strip uint64 :offset-assert 744) + (flags cty-sniper-turret-flag :offset-assert 736) + (turn-sound-id sound-id :offset-assert 740) + (h-reticle-strip handle :offset-assert 744) (minimap connection-minimap :offset-assert 752) - (actor-group uint32 :offset-assert 756) + (actor-group (pointer actor-group) :offset-assert 756) (actor-group-count int32 :offset-assert 760) - (hud-buttons uint64 :offset-assert 768) + (hud-buttons handle :offset-assert 768) ) :method-count-assert 42 :size-assert #x308 :flag-assert #x2a02900308 - (:methods - (cty-sniper-turret-method-35 () none) ;; 35 - (cty-sniper-turret-method-36 () none) ;; 36 - (cty-sniper-turret-method-37 () none) ;; 37 - (cty-sniper-turret-method-38 () none) ;; 38 - (cty-sniper-turret-method-39 () none) ;; 39 - (cty-sniper-turret-method-40 () none) ;; 40 - (cty-sniper-turret-method-41 () none) ;; 41 - ) (:state-methods - explode ;; 34 - die ;; 33 - fire ;; 31 - ready ;; 30 - locked-on ;; 32 - asleep ;; 29 waiting-for-batteries ;; 28 + asleep ;; 29 + (ready symbol) ;; 30 + fire ;; 31 + locked-on ;; 32 + die ;; 33 + explode ;; 34 + ) + (:methods + (cty-sniper-turret-method-35 (_type_) none) ;; 35 + (fire-shot (_type_) (pointer process)) ;; 36 + (cty-sniper-turret-method-37 (_type_ vector float) symbol) ;; 37 + (cty-sniper-turret-method-38 (_type_ vector quaternion vector float) object) ;; 38 + (cty-sniper-turret-method-39 (_type_) symbol) ;; 39 + (cty-sniper-turret-method-40 (_type_) symbol) ;; 40 + (cty-sniper-turret-method-41 (_type_) symbol) ;; 41 ) ) -|# -#| (deftype simple-prim-turret-reticle (simple-prim) - ((h-parent-turret uint64 :offset-assert 208) + ((h-parent-turret handle :offset-assert 208) ) :method-count-assert 26 :size-assert #xd8 @@ -65187,75 +64752,81 @@ active ;; 20 ) ) -|# -#| +;; +++cty-sniper-turret:cty-sniper-turret-reticle-flag +(defenum cty-sniper-turret-reticle-flag + :type uint8 + :bitfield #t + (cstr0 0) + (cstr1 1) + ) +;; ---cty-sniper-turret:cty-sniper-turret-reticle-flag + (deftype cty-sniper-turret-reticle (process) - ((ring-inner basic :offset-assert 128) - (ring-middle basic :offset-assert 132) - (ring-outer basic :offset-assert 136) + ((ring-inner prim-strip :offset-assert 128) + (ring-middle prim-strip :offset-assert 132) + (ring-outer prim-strip :offset-assert 136) (ring-inner-radius float :offset-assert 140) (ring-middle-radius float :offset-assert 144) (ring-outer-radius float :offset-assert 148) - (h-parent-turret uint64 :offset-assert 152) - (root basic :offset-assert 160) - (wander-offset UNKNOWN 2 :offset-assert 176) - (wander-offset-reset-time uint64 :offset-assert 208) + (h-parent-turret handle :offset-assert 152) + (root collide-shape :offset-assert 160) + (wander-offset vector 2 :inline :offset-assert 176) + (wander-offset-reset-time time-frame :offset-assert 208) (inner-ring-offset float :offset-assert 216) (middle-ring-offset float :offset-assert 220) (outer-ring-offset float :offset-assert 224) (ring-scale-multiplier float :offset-assert 228) - (reticle-looping-sound uint32 :offset-assert 232) - (reticle-lockon-sound uint32 :offset-assert 236) - (current-color uint32 :offset-assert 240) + (reticle-looping-sound sound-id :offset-assert 232) + (reticle-lockon-sound sound-id :offset-assert 236) + (current-color rgba :offset-assert 240) (current-alpha uint8 :offset-assert 244) - (lockon-start-time uint64 :offset-assert 248) - (flags uint8 :offset-assert 256) + (lockon-start-time time-frame :offset-assert 248) + (flags cty-sniper-turret-reticle-flag :offset-assert 256) ) :method-count-assert 21 :size-assert #x101 :flag-assert #x1500900101 - (:methods - (cty-sniper-turret-reticle-method-16 () none) ;; 16 - (cty-sniper-turret-reticle-method-17 () none) ;; 17 - (cty-sniper-turret-reticle-method-18 () none) ;; 18 - (cty-sniper-turret-reticle-method-19 () none) ;; 19 - (cty-sniper-turret-reticle-method-20 () none) ;; 20 - ) (:state-methods - lock ;; 15 idle ;; 14 + lock ;; 15 + ) + (:methods + (gen-prim-verts (_type_) none) ;; 16 + (init-strips (_type_) none) ;; 17 + (get-alpha (_type_) uint) ;; 18 + (cty-sniper-turret-reticle-method-19 (_type_) none) ;; 19 + (get-curr-color (_type_) rgba) ;; 20 ) ) -|# -;; (define-extern *cty-sniper-fight-kg-squad-member-settings* object) -;; (define-extern *range-ftexplo-dust-color* curve-color-fast) -;; (define-extern *range-ftexplo-dust-alpha* curve2d-fast) -;; (define-extern *range-ftexplo-dust-scale-x* curve2d-fast) -;; (define-extern *range-ftexplo-dust-scale-y* curve2d-fast) -;; (define-extern *curve-ftexplo-dust-alpha* curve2d-fast) -;; (define-extern *curve-ftexplo-dust-scale-x* curve2d-fast) -;; (define-extern *curve-ftexplo-dust-scale-y* curve2d-fast) -;; (define-extern *part-sniper-turret-explosion-dust-in-curve-settings* object) -;; (define-extern *range-ftexplo-color* curve-color-fast) -;; (define-extern *range-ftexplo-alpha* curve2d-fast) -;; (define-extern *range-ftexplo-scale-x* curve2d-fast) -;; (define-extern *range-ftexplo-scale-y* curve2d-fast) -;; (define-extern *curve-ftexplo-alpha* curve2d-fast) -;; (define-extern *curve-ftexplo-scale-x* curve2d-fast) -;; (define-extern *curve-ftexplo-scale-y* curve2d-fast) -;; (define-extern *part-sniper-turret-explosion-texture-curve-settings* object) -;; (define-extern cty-sniper-turret-shot-move function) -;; (define-extern spawn-cty-sniper-turret-projectile function) -;; (define-extern cty-sniper-turret-reticle-init-by-other function) -;; (define-extern sloppy-lead-player-location function) -;; (define-extern cty-sniper-turret-reticle-post function) -;; (define-extern cty-sniper-turret-reticle-handler function) -;; (define-extern *cty-sniper-turret-exploder-params* joint-exploder-static-params) -;; (define-extern citysniper-draw-2d-hud function) -;; (define-extern sniper-turret-post function) -;; (define-extern cty-sniper-turret-handler function) +(define-extern *cty-sniper-fight-kg-squad-member-settings* (inline-array kg-squad-member-settings)) +(define-extern *range-ftexplo-dust-color* curve-color-fast) +(define-extern *range-ftexplo-dust-alpha* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-dust-alpha* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *part-sniper-turret-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-ftexplo-color* curve-color-fast) +(define-extern *range-ftexplo-alpha* curve2d-fast) +(define-extern *range-ftexplo-scale-x* curve2d-fast) +(define-extern *range-ftexplo-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-alpha* curve2d-fast) +(define-extern *curve-ftexplo-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-scale-y* curve2d-fast) +(define-extern *part-sniper-turret-explosion-texture-curve-settings* particle-curve-settings) +(define-extern cty-sniper-turret-shot-move (function cty-sniper-turret-shot none)) +(define-extern spawn-cty-sniper-turret-projectile (function cty-sniper-turret vector vector float vector (pointer cty-sniper-turret-shot))) +(define-extern cty-sniper-turret-reticle-init-by-other (function vector vector texture-id object :behavior cty-sniper-turret-reticle)) +(define-extern sloppy-lead-player-location (function vector vector float vector)) +(define-extern cty-sniper-turret-reticle-post (function none :behavior cty-sniper-turret-reticle)) +(def-event-handler cty-sniper-turret-reticle-handler cty-sniper-turret-reticle) +(define-extern *cty-sniper-turret-exploder-params* joint-exploder-static-params) +(define-extern citysniper-draw-2d-hud (function vector symbol)) +(define-extern sniper-turret-post (function none :behavior cty-sniper-turret)) +(def-event-handler cty-sniper-turret-handler cty-sniper-turret) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; forest-obs-h ;; @@ -66322,138 +65893,128 @@ ;; wlander-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wlander-anim-info (structure) - ((anim-index UNKNOWN 2 :offset-assert 0) - (anim-index-front int32 :offset-assert 0) - (anim-index-back int32 :offset-assert 4) + ((anim-index int32 2 :offset-assert 0) + (anim-index-front int32 :offset 0) + (anim-index-back int32 :offset 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype wlander-global-info (basic) ((prev-yellow-hit int8 :offset-assert 4) (prev-blue-hit int8 :offset-assert 5) - (knocked UNKNOWN 2 :offset-assert 8) - (knocked-land UNKNOWN 2 :offset-assert 16) - (anim-knocked-front int32 :offset-assert 8) - (anim-knocked-back int32 :offset-assert 12) - (anim-knocked-front-land int32 :offset-assert 16) - (anim-knocked-back-land int32 :offset-assert 20) - (yellow-hit-anim UNKNOWN 2 :offset-assert 24) - (yellow-land-anim UNKNOWN 2 :offset-assert 40) - (blue-hit-anim UNKNOWN 1 :offset-assert 56) + (knocked int32 2 :offset-assert 8) + (knocked-land int32 2 :offset-assert 16) + (anim-knocked-front int32 :offset 8) + (anim-knocked-back int32 :offset 12) + (anim-knocked-front-land int32 :offset 16) + (anim-knocked-back-land int32 :offset 20) + (yellow-hit-anim wlander-anim-info 2 :inline :offset-assert 24) + (yellow-land-anim wlander-anim-info 2 :inline :offset-assert 40) + (blue-hit-anim wlander-anim-info 1 :inline :offset-assert 56) ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wlander-male ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wlander (civilian) - ((mad-level float :offset-assert 1128) + (; (info wlander-global-info :override) + (mad-level float :offset 1128) (los los-control :inline :offset-assert 1136) (target-pos vector :inline :offset-assert 1312) (gun-joint int32 :offset-assert 1328) (gun-axis int32 :offset-assert 1332) (gun-length float :offset-assert 1336) - (shoot-time uint64 :offset-assert 1344) - (last-time-far uint64 :offset-assert 1352) - (last-time-los uint64 :offset-assert 1360) + (shoot-time time-frame :offset-assert 1344) + (last-time-far time-frame :offset-assert 1352) + (last-time-los time-frame :offset-assert 1360) (shot-sound int32 :offset-assert 1368) (knocked-collide basic :offset-assert 1372) - (knocked-speed-scale float :offset-assert 1384) - (male basic :offset-assert 1388) + (knocked-speed-scale float :offset 1384) + (male symbol :offset-assert 1388) ) :method-count-assert 243 :size-assert #x570 :flag-assert #xf304f00570 - (:methods - (wlander-method-238 () none) ;; 238 - (wlander-method-239 () none) ;; 239 - (wlander-method-240 () none) ;; 240 - (wlander-method-241 () none) ;; 241 - (wlander-method-242 () none) ;; 242 - ) (:state-methods - gun-shoot ;; 234 - close-attack ;; 235 - panic ;; 237 - hostile ;; 38 - active ;; 34 - standing ;; 236 knocked ;; 31 knocked-recover ;; 32 + active ;; 34 + hostile ;; 38 + gun-shoot ;; 234 + close-attack ;; 235 + standing ;; 236 + panic ;; 237 + ) + (:methods + (call-for-help (_type_ float) none) ;; 238 + (fire-shot (_type_) none) ;; 239 + (toggle-cspec (_type_ symbol int) none) ;; 240 + (search-for-focus (_type_) none) ;; 241 + (try-activate (_type_) symbol) ;; 242 ) ) -|# -#| (deftype wlander-male (wlander) () :method-count-assert 243 :size-assert #x570 :flag-assert #xf304f00570 (:state-methods + gun-shoot ;; 234 close-attack ;; 235 standing ;; 236 - gun-shoot ;; 234 ) ) -|# -#| (deftype wlander-female (wlander) - ((gunout basic :offset-assert 1392) + ((gunout symbol :offset-assert 1392) ) :method-count-assert 243 :size-assert #x574 :flag-assert #xf305000574 (:state-methods + wait ;; 190 gun-shoot ;; 234 close-attack ;; 235 - wait ;; 190 ) ) -|# -;; (define-extern wlander-travel-anim function) -;; (define-extern *wlander-male-nav-enemy-info* nav-enemy-info) -;; (define-extern wlander-male-joint-callback function) -;; (define-extern *wlander-female-nav-enemy-info* nav-enemy-info) -;; (define-extern wlander-female-joint-callback function) +(define-extern wlander-travel-anim (function object time-frame none :behavior wlander)) +(define-extern *wlander-male-nav-enemy-info* nav-enemy-info) +(define-extern wlander-male-joint-callback (function draw-control cspace-array joint-control none)) +(define-extern *wlander-female-nav-enemy-info* nav-enemy-info) +(define-extern wlander-female-joint-callback (function draw-control cspace-array joint-control none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wlander-female ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype waster-b (civilian) () :method-count-assert 234 :size-assert #x464 :flag-assert #xea03f00464 (:state-methods - wait ;; 190 - get-up-back ;; 221 - get-up-front ;; 220 knocked ;; 31 + wait ;; 190 + get-up-front ;; 220 + get-up-back ;; 221 ) ) -|# -;; (define-extern *waster-b-global-info* civilian-global-info) -;; (define-extern *waster-b-nav-enemy-info* nav-enemy-info) +(define-extern *waster-b-global-info* civilian-global-info) +(define-extern *waster-b-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; waswide-init ;; @@ -68864,20 +68425,29 @@ ;; external-player-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++external-player-control:player-controller-flag +(defenum player-controller-flag + :type uint32 + :bitfield #t + (pc0 0) + (pc1 1) + (lock-features 2) + (letterbox 3) + (pc4 4) + ) +;; ---external-player-control:player-controller-flag + (deftype player-controller-init-params (structure) - ((mode basic :offset-assert 0) - (flags uint32 :offset-assert 4) + ((mode symbol :offset-assert 0) + (flags player-controller-flag :offset-assert 4) (targ-pos vector :inline :offset-assert 16) - (notify-proc uint64 :offset-assert 32) + (notify-proc handle :offset-assert 32) ) :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) -|# -#| (deftype player-controller (process-focusable) ((params player-controller-init-params :inline :offset-assert 208) (targ-pos vector :inline :offset-assert 256) @@ -68885,27 +68455,26 @@ :method-count-assert 36 :size-assert #x110 :flag-assert #x2400900110 - (:methods - (player-controller-method-32 () none) ;; 32 - (player-controller-method-33 () none) ;; 33 - (player-controller-method-34 () none) ;; 34 - (player-controller-method-35 () none) ;; 35 - ) (:state-methods - active ;; 29 - lock ;; 31 - clip-to-nav-mesh ;; 30 idle ;; 28 + active ;; 29 + clip-to-nav-mesh ;; 30 + lock ;; 31 + ) + (:methods + (set-nav-params (_type_) none) ;; 32 + (set-nav-mesh (_type_) none) ;; 33 + (set-params (_type_ player-controller-init-params) object) ;; 34 + (event-handler (_type_ process int symbol event-message-block) object) ;; 35 ) ) -|# -;; (define-extern *target-controller-pad* cpad-info) -;; (define-extern setup-control-pad function) -;; (define-extern set-pad-world-dir function) -(define-extern override-player-controls (function int)) -;; (define-extern player-controller-init-by-other function) -;; (define-extern player-controller-event-handler function) +(define-extern *target-controller-pad* cpad-info) +(define-extern setup-control-pad (function cpad-info none)) +(define-extern set-pad-world-dir (function cpad-info vector float none)) +(define-extern override-player-controls (function cpad-info int)) +(define-extern player-controller-init-by-other (function player-controller-init-params object :behavior player-controller)) +(def-event-handler player-controller-event-handler player-controller) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-marauder-b ;; @@ -68933,12 +68502,11 @@ ;; desert-chase-path-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype deschase-node (structure) ((position vector :inline :offset-assert 0) - (pos-x float :offset-assert 0) - (pos-y float :offset-assert 4) - (pos-z float :offset-assert 8) + (pos-x float :offset 0) + (pos-y float :offset 4) + (pos-z float :offset 8) (speed float :offset-assert 16) (next-node int32 :offset-assert 20) ) @@ -68946,328 +68514,289 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype deschase-path (structure) ((node-count uint16 :offset-assert 0) - (node uint32 :offset-assert 4) + (node (inline-array deschase-node) :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; desert-chase-path ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *desert-chase-marauder-path* object) +(define-extern *desert-chase-marauder-path* deschase-path) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; desert-chase ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype deschase-point (structure) ((pos vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) - (i-node int8 :offset-assert 12) + (i-node int8 :offset 12) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype v-catapult-shot-embers (metalhead-grenade-shot) - ((ptracker-proc uint64 :offset-assert 536) + ((ptracker-proc handle :offset-assert 536) ) :method-count-assert 41 :size-assert #x220 :flag-assert #x2901a00220 - (:state-methods - impact ;; 22 - ) ) -|# -#| (deftype catapult-target (process-drawable) ((alpha float :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc - (:methods - (catapult-target-method-21 () none) ;; 21 - ) (:state-methods idle ;; 20 ) + (:methods + (catapult-target-method-21 (_type_) none) ;; 21 + ) ) -|# -#| (deftype deschase-vehicle (structure) - ((handle uint64 :offset-assert 0) - (wait-timer uint64 :offset-assert 8) - (shot-fired? basic :offset-assert 16) + ((handle handle :offset-assert 0) + (wait-timer time-frame :offset-assert 8) + (shot-fired? symbol :offset-assert 16) ) + :allow-misaligned :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype desert-chase-ambush-manager (task-manager) - ((marauder-nav-mesh basic :offset-assert 240) - (marauder UNKNOWN 5 :offset-assert 248) - (m-free-list basic :offset-assert 288) - (marauder-count uint8 :offset-assert 292) - (total-spawned uint8 :offset-assert 293) - (check-timer uint64 :offset-assert 296) - (marauder-entity basic :offset-assert 304) - (h-player-controller uint64 :offset-assert 312) - (player-moved? basic :offset-assert 320) - (vehicle-nav-mesh basic :offset-assert 324) - (vehicle UNKNOWN 4 :offset-assert 328) - (vehicle-count uint8 :offset-assert 456) - (v-free-list basic :offset-assert 460) - (total-veh-spawned uint8 :offset-assert 464) - (target-point UNKNOWN 4 :offset-assert 480) - (last-shot-time uint64 :offset-assert 544) + ((marauder-nav-mesh nav-mesh :offset-assert 240) + (marauder handle 5 :offset-assert 248) + (m-free-list (array uint8) :offset-assert 288) + (marauder-count uint8 :offset-assert 292) + (total-spawned uint8 :offset-assert 293) + (check-timer time-frame :offset-assert 296) + (marauder-entity entity-actor :offset-assert 304) + (h-player-controller handle :offset-assert 312) + (player-moved? symbol :offset-assert 320) + (vehicle-nav-mesh nav-mesh :offset-assert 324) + (vehicle deschase-vehicle 4 :inline :offset-assert 328) + (vehicle-count uint8 :offset-assert 456) + (v-free-list (array uint8) :offset-assert 460) + (total-veh-spawned uint8 :offset-assert 464) + (target-point vector 4 :inline :offset-assert 480) + (last-shot-time time-frame :offset-assert 544) ) :method-count-assert 36 :size-assert #x228 :flag-assert #x2401b00228 (:methods - (desert-chase-ambush-manager-method-32 () none) ;; 32 - (desert-chase-ambush-manager-method-33 () none) ;; 33 - (desert-chase-ambush-manager-method-34 () none) ;; 34 - (desert-chase-ambush-manager-method-35 () none) ;; 35 - ) - (:state-methods - active ;; 15 + (spawn-marauder (_type_ deschase-point) none) ;; 32 + (spawn-v-catapult (_type_ int) handle) ;; 33 + (fire-catapult-shot (_type_ vector vector) none) ;; 34 + (desert-chase-ambush-manager-method-35 (_type_ int) none) ;; 35 ) ) -|# -#| (deftype deschase-artifact (process-drawable) - ((arrow uint64 :offset-assert 200) + ((arrow handle :offset-assert 200) (pos vector :inline :offset-assert 208) (angs vector :inline :offset-assert 224) ) :method-count-assert 23 :size-assert #xf0 :flag-assert #x17007000f0 - (:methods - (deschase-artifact-method-21 () none) ;; 21 - (deschase-artifact-method-22 () none) ;; 22 - ) (:state-methods idle ;; 20 ) + (:methods + (check-pickup (_type_) none) ;; 21 + (rotate (_type_) none) ;; 22 + ) ) -|# -#| (deftype hud-desert-chase-marauders (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype deschase-vehicle-control (structure) - ((vehicle uint64 :offset-assert 0) - (target uint64 :offset-assert 8) + ((vehicle handle :offset-assert 0) + (target handle :offset-assert 8) (path deschase-path :offset-assert 16) (speed float :offset-assert 20) (i-node int32 :offset-assert 24) (max-dist float :offset-assert 28) (speed-factor float :offset-assert 32) ) + :allow-misaligned :method-count-assert 13 :size-assert #x24 :flag-assert #xd00000024 (:methods - (deschase-vehicle-control-method-9 () none) ;; 9 - (deschase-vehicle-control-method-10 () none) ;; 10 - (deschase-vehicle-control-method-11 () none) ;; 11 - (deschase-vehicle-control-method-12 () none) ;; 12 + (deschase-vehicle-control-method-9 (_type_) none) ;; 9 + (deschase-vehicle-control-method-10 (_type_) none) ;; 10 + (deschase-vehicle-control-method-11 (_type_) none) ;; 11 + (deschase-vehicle-control-method-12 (_type_) none) ;; 12 ) ) -|# -#| (deftype desert-chase-chase-manager (task-manager) - ((h-player-controller uint64 :offset-assert 240) - (check-timer uint64 :offset-assert 248) - (speech-time uint64 :offset-assert 256) + ((h-player-controller handle :offset-assert 240) + (check-timer time-frame :offset-assert 248) + (speech-time time-frame :offset-assert 256) (last-speech int8 :offset-assert 264) (death-count int16 :offset-assert 266) (max-dist float :offset-assert 268) (suck-factor float :offset-assert 272) - (player-moved? basic :offset-assert 276) - (control-array UNKNOWN 4 :offset-assert 280) - (minimap connection-minimap :offset-assert 472) - (artifact uint64 :offset-assert 480) + (player-moved? symbol :offset-assert 276) + (control-array deschase-vehicle-control 4 :inline :offset-assert 280) + (minimap connection-minimap :offset 472) + (artifact handle :offset-assert 480) ) :method-count-assert 34 :size-assert #x1e8 :flag-assert #x22017001e8 (:methods - (desert-chase-chase-manager-method-32 () none) ;; 32 - (desert-chase-chase-manager-method-33 () none) ;; 33 - ) - (:state-methods - complete ;; 16 - active ;; 15 + (spawn-chase-vehicle (_type_ deschase-vehicle deschase-point) none) ;; 32 + (update-chase-status (_type_) none) ;; 33 ) ) -|# -;; (define-extern *stronghold-inside-point* object) -;; (define-extern *stronghold-vehicle-stop-point* object) -;; (define-extern *stronghold-player-goto-point* object) -;; (define-extern *stronghold-marauder-start* array) -;; (define-extern *deschase-catapult-spawn-point* array) -;; (define-extern catapult-target-handler function) -;; (define-extern catapult-target-init-by-other function) -;; (define-extern desert-chase-ambush-intro-sequence function) -;; (define-extern deschase-artifact-init-by-other function) -;; (define-extern deschase-artifact-spawn function) -;; (define-extern *stronghold-vehicle-start* array) -;; (define-extern *desert-chase-vehicle-start* array) -;; (define-extern desert-chase-chase-intro-sequence function) +(define-extern *stronghold-inside-point* vector) +(define-extern *stronghold-vehicle-stop-point* vector) +(define-extern *stronghold-player-goto-point* vector) +(define-extern *stronghold-marauder-start* (array deschase-point)) +(define-extern *deschase-catapult-spawn-point* (array deschase-point)) +(def-event-handler catapult-target-handler catapult-target) +(define-extern catapult-target-init-by-other (function vector object :behavior catapult-target)) +(define-extern desert-chase-ambush-intro-sequence (function none :behavior desert-chase-ambush-manager)) +(define-extern deschase-artifact-init-by-other (function vector object :behavior deschase-artifact)) +(define-extern deschase-artifact-spawn (function process vector deschase-artifact)) +(define-extern *stronghold-vehicle-start* (array deschase-point)) +(define-extern *desert-chase-vehicle-start* (array deschase-point)) +(define-extern desert-chase-chase-intro-sequence (function none :behavior desert-chase-chase-manager)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyport-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype hiphog-exterior-marquee (process-drawable) ((rot vector :inline :offset-assert 208) (master-enable uint32 :offset-assert 224) - (mode uint32 :offset-assert 240) + (mode uint32 :offset 240) (counter int32 :offset-assert 244) (parts sparticle-launch-control 1 :offset-assert 248) ;; guessed by decompiler ) :method-count-assert 22 :size-assert #xfc :flag-assert #x16008000fc - (:methods - (hiphog-exterior-marquee-method-21 () none) ;; 21 ;; (hiphog-exterior-marquee-method-21 (_type_) none) - ) (:state-methods - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 + ) + (:methods + (hiphog-exterior-marquee-method-21 (_type_) none) ;; 21 ) ) -|# -#| (deftype farthy (process-drawable) - ((new-trans-hook basic :offset-assert 200) - (cur-trans-hook basic :offset-assert 204) + ((new-trans-hook (function none) :offset-assert 200) + (cur-trans-hook (function none) :offset-assert 204) ) :method-count-assert 21 :size-assert #xd0 :flag-assert #x15005000d0 (:state-methods - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 ) ) -|# -;; (define-extern check-drop-level-ctyport-drop-userdata function) ;; (function sparticle-system sparticle-cpuinfo matrix none) -;; (define-extern *hiphog-exterior-marquee* array) ;; (array object) -;; (define-extern ctyport-sparticle-mode-animate function) -;; (define-extern *hiphog-exterior-marquee-group-ids* array) ;; (array int32) -;; (define-extern *hiphog-exterior-marquee-daxter-group-ids* array) ;; (array int32) -;; (define-extern *range-color-rubble-flame* curve-color-fast) -;; (define-extern *range-alpha-rubble-flame* curve2d-fast) -;; (define-extern *range-scale-rubble-flame-x* curve2d-fast) -;; (define-extern *range-scale-rubble-flame-y* curve2d-fast) -;; (define-extern *r-curve-rubble-flame* curve2d-fast) -;; (define-extern *g-curve-rubble-flame* curve2d-fast) -;; (define-extern *b-curve-rubble-flame* curve2d-fast) -;; (define-extern *curve-alpha-rubble-flame* curve2d-fast) -;; (define-extern *curve-scale-rubble-flame-x* curve2d-fast) -;; (define-extern *curve-scale-rubble-flame-y* curve2d-fast) -;; (define-extern *part-ctyport-rubble-fire-flame-curve-settings* object) +(define-extern check-drop-level-ctyport-drop-userdata (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern *hiphog-exterior-marquee* (array (array object))) +(define-extern ctyport-sparticle-mode-animate (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d none)) +(define-extern *hiphog-exterior-marquee-group-ids* (array int32)) +(define-extern *hiphog-exterior-marquee-daxter-group-ids* (array int32)) +(define-extern *range-color-rubble-flame* curve-color-fast) +(define-extern *range-alpha-rubble-flame* curve2d-fast) +(define-extern *range-scale-rubble-flame-x* curve2d-fast) +(define-extern *range-scale-rubble-flame-y* curve2d-fast) +(define-extern *r-curve-rubble-flame* curve2d-fast) +(define-extern *g-curve-rubble-flame* curve2d-fast) +(define-extern *b-curve-rubble-flame* curve2d-fast) +(define-extern *curve-alpha-rubble-flame* curve2d-fast) +(define-extern *curve-scale-rubble-flame-x* curve2d-fast) +(define-extern *curve-scale-rubble-flame-y* curve2d-fast) +(define-extern *part-ctyport-rubble-fire-flame-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyport-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype port-board-vent (bouncer) () :method-count-assert 27 :size-assert #xd8 :flag-assert #x1b006000d8 ) -|# -;; (define-extern spt-birth-func-brightness-daxter-crush-dust function) -;; (define-extern *range-dax-sign-explo-dust-color* curve-color-fast) -;; (define-extern *range-dax-sign-explo-dust-alpha* curve2d-fast) -;; (define-extern *range-dax-sign-explo-dust-scale-x* curve2d-fast) -;; (define-extern *range-dax-sign-explo-dust-scale-y* curve2d-fast) -;; (define-extern *curve-dax-sign-explo-dust-alpha* curve2d-fast) -;; (define-extern *curve-dax-sign-explo-dust-scale-x* curve2d-fast) -;; (define-extern *curve-dax-sign-explo-dust-scale-y* curve2d-fast) -;; (define-extern *part-daxter-sign-explosion-dust-in-curve-settings* object) -;; (define-extern *range-dax-sign-explo-color* curve-color-fast) -;; (define-extern *range-dax-sign-explo-alpha* curve2d-fast) -;; (define-extern *range-dax-sign-explo-scale-x* curve2d-fast) -;; (define-extern *range-dax-sign-explo-scale-y* curve2d-fast) -;; (define-extern *curve-dax-sign-explo-alpha* curve2d-fast) -;; (define-extern *curve-dax-sign-explo-scale-x* curve2d-fast) -;; (define-extern *curve-dax-sign-explo-scale-y* curve2d-fast) -;; (define-extern *part-daxter-sign-explosion-texture-curve-settings* object) -;; (define-extern *range-fma-barrier-explo-big-color* curve-color-fast) -;; (define-extern *range-fma-barrier-explo-big-alpha* curve2d-fast) -;; (define-extern *range-fma-barrier-explo-big-scale-x* curve2d-fast) -;; (define-extern *range-fma-barrier-explo-big-scale-y* curve2d-fast) -;; (define-extern *curve-fma-barrier-explo-big-alpha* curve2d-fast) -;; (define-extern *curve-fma-barrier-explo-big-scale-x* curve2d-fast) -;; (define-extern *curve-fma-barrier-explo-big-scale-y* curve2d-fast) -;; (define-extern *part-fma-barrier-explosion-big-texture-curve-settings* object) +(define-extern spt-birth-func-brightness-daxter-crush-dust (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern *range-dax-sign-explo-dust-color* curve-color-fast) +(define-extern *range-dax-sign-explo-dust-alpha* curve2d-fast) +(define-extern *range-dax-sign-explo-dust-scale-x* curve2d-fast) +(define-extern *range-dax-sign-explo-dust-scale-y* curve2d-fast) +(define-extern *curve-dax-sign-explo-dust-alpha* curve2d-fast) +(define-extern *curve-dax-sign-explo-dust-scale-x* curve2d-fast) +(define-extern *curve-dax-sign-explo-dust-scale-y* curve2d-fast) +(define-extern *part-daxter-sign-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-dax-sign-explo-color* curve-color-fast) +(define-extern *range-dax-sign-explo-alpha* curve2d-fast) +(define-extern *range-dax-sign-explo-scale-x* curve2d-fast) +(define-extern *range-dax-sign-explo-scale-y* curve2d-fast) +(define-extern *curve-dax-sign-explo-alpha* curve2d-fast) +(define-extern *curve-dax-sign-explo-scale-x* curve2d-fast) +(define-extern *curve-dax-sign-explo-scale-y* curve2d-fast) +(define-extern *part-daxter-sign-explosion-texture-curve-settings* particle-curve-settings) +(define-extern *range-fma-barrier-explo-big-color* curve-color-fast) +(define-extern *range-fma-barrier-explo-big-alpha* curve2d-fast) +(define-extern *range-fma-barrier-explo-big-scale-x* curve2d-fast) +(define-extern *range-fma-barrier-explo-big-scale-y* curve2d-fast) +(define-extern *curve-fma-barrier-explo-big-alpha* curve2d-fast) +(define-extern *curve-fma-barrier-explo-big-scale-x* curve2d-fast) +(define-extern *curve-fma-barrier-explo-big-scale-y* curve2d-fast) +(define-extern *part-fma-barrier-explosion-big-texture-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cty-guard-projectile ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype vehicle-grenade (projectile-bounce) ((blast-radius float :offset-assert 548) ) :method-count-assert 45 :size-assert #x228 :flag-assert #x2d01b00228 - (:methods - (vehicle-grenade-method-44 () none) ;; 44 - ) (:state-methods - sitting ;; 41 impact ;; 22 + sitting ;; 41 + ) + (:methods + (vehicle-grenade-method-44 (_type_) none) ;; 44 ) ) -|# -#| (deftype vehicle-grenade-deflect (vehicle-grenade) - ((has-been-deflected basic :offset-assert 552) - (has-hit-ground basic :offset-assert 556) + ((has-been-deflected symbol :offset-assert 552) + (has-hit-ground symbol :offset-assert 556) ) :method-count-assert 45 :size-assert #x230 @@ -69276,9 +68805,7 @@ moving ;; 23 ) ) -|# -#| (deftype guard-lazer-shot (projectile) () :method-count-assert 41 @@ -69288,9 +68815,8 @@ dissipate ;; 21 ) ) -|# -;; (define-extern guard-lazer-shot-move function) ;; (function guard-lazer-shot none) +(define-extern guard-lazer-shot-move (function guard-lazer-shot none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; trail-graph ;; @@ -69302,16 +68828,13 @@ ;; bike ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype h-bike-base (hvehicle) () :method-count-assert 162 :size-assert #x3b0 :flag-assert #xa2033003b0 ) -|# -#| (deftype h-bike-a (h-bike-base) ((fin-fl joint-mod-rotate-local :inline :offset-assert 944) (fin-fr joint-mod-rotate-local :inline :offset-assert 976) @@ -69325,9 +68848,7 @@ :size-assert #x490 :flag-assert #xa204100490 ) -|# -#| (deftype h-bike-b (h-bike-base) ((fin-rl joint-mod-rotate-local :inline :offset-assert 944) (fin-rr joint-mod-rotate-local :inline :offset-assert 976) @@ -69342,9 +68863,7 @@ :size-assert #x4b0 :flag-assert #xa2043004b0 ) -|# -#| (deftype h-bike-c (h-bike-base) ((fin-fl joint-mod-rotate-local :inline :offset-assert 944) (fin-fr joint-mod-rotate-local :inline :offset-assert 976) @@ -69362,38 +68881,43 @@ :size-assert #x510 :flag-assert #xa204900510 ) -|# -#| (deftype h-bike-d (h-bike-a) () :method-count-assert 162 :size-assert #x490 :flag-assert #xa204100490 ) -|# -;; (define-extern *h-bike-explosion-info* vehicle-explosion-info) -;; (define-extern *h-bike-a-constants* object) -;; (define-extern *h-bike-b-constants* object) -;; (define-extern *h-bike-c-constants* object) -;; (define-extern *h-bike-d-constants* object) +(deftype bike-stack-var0 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (vec2 vector :inline :offset 32) + (mat matrix :inline :offset 48) + (vec3 vector :inline :offset 112) + (vec4 vector :inline :offset 128) + (vec5 vector :inline :offset 144) + ) + ) + +(define-extern *h-bike-explosion-info* vehicle-explosion-info) +(define-extern *h-bike-a-constants* rigid-body-vehicle-constants) +(define-extern *h-bike-b-constants* rigid-body-vehicle-constants) +(define-extern *h-bike-c-constants* rigid-body-vehicle-constants) +(define-extern *h-bike-d-constants* rigid-body-vehicle-constants) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; car ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype h-car-base (hvehicle) - ((rider-hand-joint-array UNKNOWN 2 :offset-assert 944) + ((rider-hand-joint-array int8 2 :offset-assert 944) ) :method-count-assert 162 :size-assert #x3b2 :flag-assert #xa2034003b2 ) -|# -#| (deftype h-car-a (h-car-base) ((steering-wheel-l joint-mod-rotate-local :inline :offset-assert 960) (steering-wheel-r joint-mod-rotate-local :inline :offset-assert 992) @@ -69409,9 +68933,7 @@ :size-assert #x4e0 :flag-assert #xa2046004e0 ) -|# -#| (deftype h-car-b (h-car-base) ((steering-wheel-l joint-mod-rotate-local :inline :offset-assert 960) (steering-wheel-r joint-mod-rotate-local :inline :offset-assert 992) @@ -69424,9 +68946,7 @@ :size-assert #x480 :flag-assert #xa204000480 ) -|# -#| (deftype h-car-c (h-car-base) ((steering-wheel joint-mod-rotate-local :inline :offset-assert 960) (fin-fl joint-mod-rotate-local :inline :offset-assert 992) @@ -69440,183 +68960,688 @@ :size-assert #x4a0 :flag-assert #xa2042004a0 ) -|# -;; (define-extern *h-car-explosion-info* vehicle-explosion-info) -;; (define-extern *h-car-a-constants* object) -;; (define-extern *h-car-b-constants* object) -;; (define-extern *h-car-c-constants* object) -;; (define-extern *h-hellcat-constants* object) +(define-extern *h-car-explosion-info* vehicle-explosion-info) +(define-extern *h-car-a-constants* rigid-body-vehicle-constants) +(define-extern *h-car-b-constants* rigid-body-vehicle-constants) +(define-extern *h-car-c-constants* rigid-body-vehicle-constants) +(define-extern *h-hellcat-constants* rigid-body-vehicle-constants) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; h-torpedo ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +(deftype htorpedo (h-bike-c) + ((speed float :offset-assert 1296) + (target-speed float :offset-assert 1300) + (pitch float :offset-assert 1304) + (target-pitch float :offset-assert 1308) + (max-pitch float :offset-assert 1312) + (roll float :offset-assert 1316) + (target-roll float :offset-assert 1320) + (turn-rate float :offset-assert 1324) + (target-turn-rate float :offset-assert 1328) + (ground-height float :offset-assert 1332) + (ground-offset float :offset-assert 1336) + (down-force float :offset-assert 1340) + (want-jump? symbol :offset-assert 1344) + (jump-state uint8 :offset 1360) + (on-water? symbol :offset-assert 1364) + (cam-pitch float :offset-assert 1368) + (cam-roll float :offset-assert 1372) + (target-cam-roll float :offset-assert 1376) + (based-cam-roll float :offset-assert 1380) + (last-quat quaternion :inline :offset-assert 1392) + (override-camera? symbol :offset-assert 1408) + (under-water? symbol :offset-assert 1412) + (next-bob-cam-time time-frame :offset-assert 1416) + (thrust-sound sound-id :offset-assert 1424) + (ground-sound sound-id :offset-assert 1428) + (reverb-dest float :offset-assert 1432) + (pitch-current float :offset-assert 1436) + (ground-vol-current float :offset-assert 1440) + (last-slice-val float :offset-assert 1444) + (evasive-sound sound-id :offset-assert 1448) + (evasive-volume float :offset-assert 1452) + (stopping-evasive? symbol :offset-assert 1456) + (spawn-splash? symbol :offset-assert 1460) + (wake-sound sound-id :offset-assert 1464) + (heat-haze sparticle-launch-control :offset-assert 1468) + (last-land-speech-time time-frame :offset-assert 1472) + (last-jump-speech-time time-frame :offset-assert 1480) + ) + :method-count-assert 171 + :size-assert #x5d0 + :flag-assert #xab055005d0 + (:state-methods + undefined0 ;; 162 + hide ;; 163 + ) + (:methods + (htorpedo-method-164 () none) ;; 164 + (find-ground-height (_type_) float) ;; 165 + (htorpedo-method-166 (_type_ float) none) ;; 166 + (htorpedo-method-167 (_type_ float) float) ;; 167 + (htorpedo-method-168 (_type_ float) float) ;; 168 + (probe-ground (_type_ vector float) float) ;; 169 + (update-sound (_type_) none) ;; 170 + ) + ) + +(deftype light-trail-tracker-torpedo (light-trail-tracker) + () + :method-count-assert 21 + :size-assert #xac + :flag-assert #x15003000ac + ) + +(define-extern *growing-curve-torpedo* curve2d-piecewise) +(define-extern *water-simple-alpha-curve-fade-out-torpedo* curve2d-piecewise) +(define-extern *color-curve-tan-brown-torpedo* curve-color-piecewise) +(define-extern *water-simple-alpha-curve-in-torpedo* curve2d-piecewise) +(define-extern *torpedo-wake-trail* light-trail-composition) +(define-extern spt-func-nuke-water-splash (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern *range-torp-explo-color* curve-color-fast) +(define-extern *range-torp-explo-alpha* curve2d-fast) +(define-extern *range-torp-explo-scale-x* curve2d-fast) +(define-extern *range-torp-explo-scale-y* curve2d-fast) +(define-extern *curve-torp-explo-alpha* curve2d-fast) +(define-extern *curve-torp-explo-scale-x* curve2d-fast) +(define-extern *curve-torp-explo-scale-y* curve2d-fast) +(define-extern *part-torpedo-explosion-texture-curve-settings* particle-curve-settings) +(define-extern PHYSICS_SCALAR float) +(define-extern *torpedo-speech-list* (inline-array talker-speech-class)) +(define-extern *torpedo-jump-speech* (array uint16)) +(define-extern *torpedo-land-speech* (array uint16)) +(define-extern *h-torpedo-constants* rigid-body-vehicle-constants) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; kg-vehicles ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +(deftype pickup-sled-sim (billiard-table) + ((mat matrix :inline :offset-assert 96) + (external-force vector :inline :offset-assert 160) + ) + :method-count-assert 16 + :size-assert #xb0 + :flag-assert #x10000000b0 + ) + +(deftype h-kg-pickup (h-car-base) + ((fin-fr joint-mod-rotate-local :inline :offset-assert 960) + (fin-fl joint-mod-rotate-local :inline :offset-assert 992) + (fin-r joint-mod-rotate-local :inline :offset-assert 1024) + (fin-l joint-mod-rotate-local :inline :offset-assert 1056) + (rudder-l joint-mod-rotate-local :inline :offset-assert 1088) + (rudder-r joint-mod-rotate-local :inline :offset-assert 1120) + (turn-rate float :offset-assert 1152) + (target-turn-rate float :offset-assert 1156) + (camera-override? symbol :offset-assert 1160) + (initial-creation-time time-frame :offset-assert 1168) + (auto-boost? symbol :offset-assert 1176) + (steering-val float :offset-assert 1180) + (sled pickup-sled-sim :offset-assert 1184) + (barrels handle-array :offset-assert 1188) + (taskman handle :offset-assert 1192) + (last-jitter-time time-frame :offset-assert 1200) + (last-slide-time time-frame :offset-assert 1208) + ) + :method-count-assert 162 + :size-assert #x4c0 + :flag-assert #xa2044004c0 + ) + +(deftype dark-barrel (process-focusable) + () + :method-count-assert 29 + :size-assert #xd0 + :flag-assert #x1d005000d0 + (:state-methods + idle ;; 28 + ) + ) + +(define-extern *hijack-suck-curve* curve2d-piecewise) +(define-extern compute-suck-speed-scalar (function float)) +(define-extern *h-kg-pickup-constants* rigid-body-vehicle-constants) +(define-extern dark-barrel-init-by-other (function object :behavior dark-barrel)) +(define-extern spawn-pickup (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; test-bike ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype test-bike (h-bike-c) () :method-count-assert 162 :size-assert #x510 :flag-assert #xa204900510 ) -|# -#| (deftype evan-test-bike (h-bike-a) () :method-count-assert 162 :size-assert #x490 :flag-assert #xa204100490 ) -|# -;; (define-extern *test-bike-constants* object) ;; rigid-body-vehicle-constants -;; (define-extern *evan-test-bike-constants* object) ;; rigid-body-vehicle-constants +(define-extern *test-bike-constants* rigid-body-vehicle-constants) +(define-extern *evan-test-bike-constants* rigid-body-vehicle-constants) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; citizen-enemy ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype citizen-enemy (citizen) - ((next-update-target uint64 :offset-assert 1032) ;; time-frame + ((next-update-target time-frame :offset-assert 1032) ;; time-frame (minimap connection-minimap :offset-assert 1040) ) :method-count-assert 218 :size-assert #x414 :flag-assert #xda03a00414 - (:methods - (citizen-enemy-method-216 () none) ;; 216 - (citizen-enemy-method-217 () none) ;; 217 - ) (:state-methods - inactive ;; 191 active ;; 34 + inactive ;; 191 + ) + (:methods + (set-traffic-danger (_type_) none) ;; 216 + (find-new-focus (_type_) object) ;; 217 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; kg-squad-member-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype hatred-instance-info (structure) - ((hated-target uint64 :offset-assert 0) + ((hated-target handle :offset-assert 0) (hatred-value float :offset-assert 8) ) + :pack-me :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype kg-squad-member (citizen) - ((hatred-memory UNKNOWN 3 :offset-assert 1032) - (last-choose-new-enemy-time uint64 :offset-assert 1080) - (current-enemy uint64 :offset-assert 1088) + ((squad kg-squad-control :override) + (hatred-memory hatred-instance-info 3 :inline :offset-assert 1032) + (last-choose-new-enemy-time time-frame :offset-assert 1080) + (current-enemy handle :offset-assert 1088) (kg-type uint8 :offset-assert 1096) - (choose-new-enemy-delay-time uint64 :offset-assert 1104) - (next-update-target-time uint64 :offset-assert 1112) + (choose-new-enemy-delay-time time-frame :offset-assert 1104) + (next-update-target-time time-frame :offset-assert 1112) (minimap connection-minimap :offset-assert 1120) ) :method-count-assert 222 :size-assert #x464 :flag-assert #xde03f00464 (:methods - (kg-squad-member-method-216 () none) ;; 216 - (kg-squad-member-method-217 () none) ;; 217 - (kg-squad-member-method-218 () none) ;; 218 - (kg-squad-member-method-219 () none) ;; 219 - (kg-squad-member-method-220 () none) ;; 220 - (kg-squad-member-method-221 () none) ;; 221 + (kg-squad-member-method-216 (_type_ process) float) ;; 216 + (enemy->hatred-val (_type_ process) float) ;; 217 + (get-hatred-val-for-target (_type_ handle) float) ;; 218 + (kg-squad-member-method-219 (_type_ process-focusable) symbol) ;; 219 + (kg-squad-member-method-220 (_type_) symbol) ;; 220 + (get-current-enemy (_type_) process) ;; 221 ) ) -|# +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; roboguard-city ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +;; +++roboguard-city:robo-flag +(defenum robo-flag + :type uint16 + :bitfield #t + (r0 0) + (r1 1) + (r2 2) + (r3 3) + (r4 4) + (r5 5) + (r6 6) + (r7 7) + (r8 8) + (r9 9) + (r10 10) + (r11 11) + (r12 12) + (r13 13) + (r14 14) + (r15 15) + ) +;; ---roboguard-city:robo-flag + +(deftype roboguard-city (kg-squad-member) + ((los los-control :inline :offset-assert 1136) + (rotation-matrix matrix :inline :offset-assert 1312) + (me-to-focus-dir vector :inline :offset-assert 1376) + (me-to-focus-angle float :offset-assert 1392) + (robo-flags robo-flag :offset-assert 1396) + (torso-aim-blend float :offset-assert 1400) + (torso-angle float :offset-assert 1404) + (torso-seek-speed float :offset-assert 1408) + (torso-to-focus-angle float :offset-assert 1412) + (last-torso-frame-num float :offset-assert 1416) + (stand-angle-threshold float :offset-assert 1420) + (attack-distance float :offset-assert 1424) + (attack-dist-scalar float :offset-assert 1428) + (fire-time time-frame :offset-assert 1432) + (last-attack-time time-frame :offset-assert 1440) + (fired-this-time? symbol :offset-assert 1448) + (last-roll-time time-frame :offset-assert 1456) + (cannot-reach-target? symbol :offset-assert 1464) + (cannot-reach-target-start-time time-frame :offset-assert 1472) + (frustrate-roll-time time-frame :offset-assert 1480) + (target-status squad-target-status :inline :offset-assert 1488) + (last-update-chase-pos-time time-frame :offset-assert 1560) + (random-offset-search float :offset-assert 1568) + (pursuit-start-time time-frame :offset-assert 1576) + (dizzy-start-time time-frame :offset-assert 1584) + (roll-sound sound-id :offset-assert 1592) + ) + :method-count-assert 241 + :size-assert #x63c + :flag-assert #xf105c0063c + (:state-methods + knocked ;; 31 + knocked-recover ;; 32 + idle ;; 33 + active ;; 34 + stare ;; 37 + hostile ;; 38 + die ;; 40 + wait ;; 190 + hostile-stand ;; 222 + close-attack ;; 223 + shoot-attack ;; 224 + explode ;; 225 + roll-enter ;; 226 + roll-exit ;; 227 + roll-chase ;; 228 + reposition ;; 229 + dizzy ;; 230 + exit-transport ;; 231 + giant-hostile ;; 232 + ) + (:methods + (roboguard-city-method-233 (_type_ vector vector) symbol) ;; 233 + (fire-shot-from-joint-idx (_type_ int) none) ;; 234 + (roboguard-city-method-235 (_type_) int) ;; 235 + (roboguard-city-method-236 (_type_) int) ;; 236 + (roboguard-city-method-237 (_type_) object) ;; 237 + (roboguard-city-method-238 (_type_ symbol) robo-flag) ;; 238 + (roboguard-city-method-239 (_type_) robo-flag) ;; 239 + (init-draw-params (_type_) none) ;; 240 + ) + ) + +(deftype roboguard-shot (guard-shot) + () + :method-count-assert 41 + :size-assert #x220 + :flag-assert #x2901a00220 + ) + +(define-extern *roboguard-city-debris-params* debris-static-params) +(define-extern *roboguard-city-nav-enemy-info* nav-enemy-info) +(define-extern roboguard-city-turn-torso-post (function none :behavior roboguard-city)) +(define-extern roboguard-city-turret-code (function none :behavior roboguard-city)) +(define-extern roboguard-city-idle-code (function none :behavior roboguard-city)) +(define-extern spawn-roboguard-projectile (function roboguard-city vector vector float vector (pointer roboguard-shot))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; spydroid ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +(deftype sensor-light-info (structure) + ((joint int16 :offset-assert 0) + (part-index int16 :offset-assert 2) + (offset vector :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype spydroid (kg-squad-member) + ((old-y-deg float :offset-assert 1124) + (diff-angle float :offset-assert 1128) + (desire-turn symbol :offset-assert 1132) ;; guessed by decompiler + (hit-target symbol :offset-assert 1136) + (floor float :offset-assert 1140) + (explode-part sparticle-launch-control :offset-assert 1144) ;; guessed by decompiler + (alert-level uint8 :offset-assert 1148) + (next-check-player-time time-frame :offset-assert 1152) + (part-ids int16 9 :offset-assert 1160) + (sensor-lights sensor-light-info 3 :inline :offset-assert 1184) + (last-sensor-time time-frame :offset-assert 1280) + (exiting-wait? symbol :offset-assert 1288) + ) + :method-count-assert 238 + :size-assert #x50c + :flag-assert #xee0490050c + (:state-methods + attack ;; 222 + search ;; 223 + hunting ;; 224 + scan ;; 225 + undefined0 ;; 226 + spydroid-notice ;; 227 + flip ;; 228 + wait-for-vulnerable ;; 229 + exit-transport ;; 230 + ) + (:methods + (spydroid-method-231 (_type_ uint) object) ;; 231 + (spydroid-method-232 (_type_) int) ;; 232 + (spydroid-method-233 (_type_) int) ;; 233 + (spydroid-method-234 (_type_ vector) float) ;; 234 + (spydroid-method-235 (_type_) symbol) ;; 235 + (spydroid-method-236 (_type_) object) ;; 236 + (spydroid-method-237 (_type_ traffic-danger-info) symbol) ;; 237 + ) + (:states + wait-for-vulnerable-close + ) + ) + +(define-extern *spydroid-debris-params* debris-static-params) +(define-extern *spydroid-nav-enemy-info* nav-enemy-info) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; flying-turret ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +(deftype ft-gun-info (structure) + ((gun-position float :offset-assert 0) + (fire? symbol :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype flying-turret (kg-squad-member) + ((thrust-dir vector :inline :offset-assert 1136) + (speed float :offset-assert 1152) + (speed-target float :offset-assert 1156) + (ground-height float :offset-assert 1160) + (last-heading-quat quaternion :inline :offset-assert 1168) + (last-roll-quat quaternion :inline :offset-assert 1184) + (thrust-mode uint8 :offset-assert 1200) + (pursuit-start-time time-frame :offset-assert 1208) + (chase-mode uint8 :offset-assert 1216) + (last-check-chase-pos-time time-frame :offset-assert 1224) + (circle-angle float :offset-assert 1232) + (last-fire-time time-frame :offset-assert 1240) + (num-shots-fired int8 :offset-assert 1248) + (ground-point vector :inline :offset-assert 1264) + (guns ft-gun-info 2 :inline :offset-assert 1280) + (turret-aim-blend float :offset-assert 1312) + (hit-player? symbol :offset-assert 1316) + (desired-height-offset float :offset-assert 1320) + (float-height float :offset-assert 1324) + (bob-velocity float :offset-assert 1328) + (bouncing? symbol :offset-assert 1332) + (bounce-start-time time-frame :offset-assert 1336) + (changed-targets? symbol :offset-assert 1344) + (thruster-intensity float :offset-assert 1348) + (up-bobbing? symbol :offset-assert 1352) + (bob-scale-factor float :offset-assert 1356) + (bob-scale-target float :offset-assert 1360) + (bob-t float :offset-assert 1364) + (thruster-intensity-scalar float :offset-assert 1368) + (engine-sound sound-id :offset-assert 1372) + (tilt-sound sound-id :offset-assert 1376) + (roll-sound-amount float :offset-assert 1380) + ) + :method-count-assert 231 + :size-assert #x568 + :flag-assert #xe704f00568 + (:state-methods + flying-turret-base-state ;; 222 + fire ;; 223 + exit-transport ;; 224 + ) + (:methods + (flying-turret-method-225 (_type_) float) ;; 225 + (flying-turret-method-226 (_type_) none) ;; 226 + (flying-turret-method-227 (_type_) quaternion) ;; 227 + (fire-shot-from-joint-idx (_type_ int) (pointer process)) ;; 228 + (flying-turret-method-229 (_type_) none) ;; 229 + (flying-turret-method-230 (_type_ uint) uint) ;; 230 + ) + ) + +(deftype flying-turret-shot (guard-shot) + () + :method-count-assert 41 + :size-assert #x220 + :flag-assert #x2901a00220 + ) + +(define-extern *flying-turret-nav-enemy-info* nav-enemy-info) +(define-extern *flying-turret-debris-params* debris-static-params) +(define-extern flying-turret-gun-aim-func (function cspace transformq none)) +(define-extern flying-turret-gun-recoil-jmod-func (function cspace transformq none)) +(define-extern spawn-turret-projectile (function flying-turret vector vector float vector (pointer process))) +(define-extern update-ft-gun (function ft-gun-info float float float float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mh-squad-member-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype mh-squad-member (citizen-enemy) - ((last-choose-new-enemy-time uint64 :offset-assert 1048) - (current-enemy uint64 :offset-assert 1056) - (choose-new-enemy-delay-time uint64 :offset-assert 1064) - (next-update-target-time uint64 :offset-assert 1072) + ((squad mh-squad-control :override) + (last-choose-new-enemy-time time-frame :offset-assert 1048) + (current-enemy handle :offset-assert 1056) + (choose-new-enemy-delay-time time-frame :offset-assert 1064) + (next-update-target-time time-frame :offset-assert 1072) ) :method-count-assert 222 :size-assert #x438 :flag-assert #xde03c00438 (:methods - (mh-squad-member-method-218 () none) ;; 218 - (mh-squad-member-method-219 () none) ;; 219 - (mh-squad-member-method-220 () none) ;; 220 - (mh-squad-member-method-221 () none) ;; 221 + (get-hatred-val-for-proc (_type_ process) float) ;; 218 + (pfoc-in-range? (_type_ process-focusable) symbol) ;; 219 + (enemy->hatred-val (_type_ process) float) ;; 220 + (get-current-enemy (_type_) process) ;; 221 ) ) -|# +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; metalhead-grunt ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +(deftype mh-grunt-anim-info (structure) + ((anim-index int32 :offset-assert 0) + (travel-speed meters :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype mh-grunt-global-info (basic) + ((patrol-anim mh-grunt-anim-info 2 :inline :offset-assert 4) + (charge-anim mh-grunt-anim-info 1 :inline :offset-assert 20) + (attack-anim mh-grunt-anim-info 1 :inline :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; +++metalhead-grunt:mh-grunt-flag +(defenum mh-grunt-flag + :type uint8 + :bitfield #t + (mg0 0) + (mg1 1) + (mg2 2) + ) +;; ---metalhead-grunt:mh-grunt-flag + +(deftype metalhead-grunt (mh-squad-member) + ((patrol-anim mh-grunt-anim-info :offset-assert 1080) ;; grunt-anim-info + (charge-anim mh-grunt-anim-info :offset-assert 1084) ;; grunt-anim-info + (attack-anim mh-grunt-anim-info :offset-assert 1088) ;; grunt-anim-info + (intro-path path-control :offset-assert 1092) ;; guessed by decompiler + ; (circle-radial-dist float :offset-assert 244) + (use-charge-anim-index int8 :offset 1100) + (jumping-ambush-path-pt int8 :offset-assert 1101) + (mh-grunt-flags mh-grunt-flag :offset-assert 1102) + (state-timeout2 time-frame :offset-assert 1104) + (next-warn-time time-frame :offset-assert 1112) ;; time-frame + (dest vector :inline :offset-assert 1120) + ;; (focus-pos vector :inline :offset-assert 352) + (pad uint8 16) + ) + :method-count-assert 231 + :size-assert #x480 + :flag-assert #xe704000480 + (:state-methods + knocked-recover ;; 32 + active ;; 34 + hostile ;; 38 + die-fast ;; 42 + stop-chase ;; 158 + in-ditch ;; 192 + attack ;; 222 + falling-ambush ;; 223 + jumping-ambush ;; 224 + jumping-ambush-cont ;; 225 + wait-for-focus ;; 226 + spin-attack ;; 227 + ) + (:methods + (metalhead-grunt-method-228 (_type_ float) process-focusable) ;; 228 + (get-nav-info (_type_) nav-enemy-info) ;; 229 + (metalhead-grunt-method-230 (_type_ symbol) object) ;; 230 + ) + ) + +(define-extern *fact-info-mh-grunt-defaults* fact-info-enemy-defaults) +(define-extern *metalhead-grunt-nav-enemy-info* nav-enemy-info) +(define-extern *mh-grunt-global-info* mh-grunt-global-info) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; metalhead-predator ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +(deftype metalhead-predator-shot (metalhead-shot) + () + :method-count-assert 41 + :size-assert #x210 + :flag-assert #x2901900210 + ) + +(deftype metalhead-predator (mh-squad-member) + ((los los-control :inline :offset-assert 1088) + (want-stop symbol :offset-assert 1252) ;; guessed by decompiler + (target-pos vector :inline :offset-assert 1264) + (curr-node int32 :offset-assert 1280) + (hide-pos vector :inline :offset-assert 1296) + (next-change time-frame :offset-assert 1312) ;; int64 + (shoot-angle float :offset-assert 1320) ;; degrees + (miss-amount float :offset-assert 1324) + (ambient-sound-id sound-id :offset-assert 1328) ;; guessed by decompiler + (shock-effect-time time-frame :offset-assert 1336) ;; time-frame + (shock-effect-end time-frame :offset-assert 1344) ;; int64 + (fade float :offset-assert 1352) + (dest-fade float :offset-assert 1356) + ) + :method-count-assert 228 + :size-assert #x550 + :flag-assert #xe404d00550 + (:state-methods + active ;; 34 + hostile ;; 38 + die-fast ;; 42 + in-ditch ;; 192 + fire ;; 222 + close-attack ;; 223 + ) + (:methods + (toggle-collide-deadly (_type_ symbol) none) ;; 224 + (metalhead-predator-method-225 (_type_ int float) none) ;; 225 + (metalhead-predator-method-226 (_type_ vector vector vector) symbol) ;; 226 + (metalhead-predator-method-227 (_type_) none) ;; 227 + ) + ) + +(define-extern *metalhead-predator-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; guard ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *guard-died-recently?* object) -;; (define-extern *crimson-guard-global-info* guard-global-info) ;; guard-global-info -;; (define-extern *crimson-guard-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info -;; (define-extern *guard-min-id-hack* object) ;; int -;; (define-extern do-spline function) ;; (function vector vector vector vector vector float vector) -;; (define-extern guard-type->city-target-type function) -;; (define-extern orient-towards-code function) -;; (define-extern go-active-if-necessary function) +(define-extern *guard-died-recently?* symbol) +(define-extern *crimson-guard-global-info* guard-global-info) +(define-extern *crimson-guard-nav-enemy-info* nav-enemy-info) +(define-extern *guard-min-id-hack* int) +(define-extern do-spline (function vector vector vector vector vector float vector)) +(define-extern guard-type->city-target-type (function guard-type city-target-type)) +(define-extern orient-towards-code (function degrees symbol :behavior crimson-guard)) +(define-extern go-active-if-necessary (function object :behavior crimson-guard)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; guard-grenade ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype reload-grenade-spawn-params (structure) - ((owner uint64 :offset-assert 0) + ((owner handle :offset-assert 0) (joint-index uint16 :offset-assert 8) ) :method-count-assert 9 :size-assert #xa :flag-assert #x90000000a ) -|# -#| (deftype reload-grenade (process-drawable) - ((owner uint64 :offset-assert 200) + ((owner handle :offset-assert 200) (joint-index uint16 :offset-assert 208) ) :method-count-assert 25 :size-assert #xd2 :flag-assert #x19006000d2 - (:methods - (reload-grenade-method-24 () none) ;; 24 - ) (:state-methods - die ;; 23 - shrinking ;; 22 - visible ;; 21 dormant ;; 20 + visible ;; 21 + shrinking ;; 22 + die ;; 23 + ) + (:methods + (move-to-joint (_type_) quaternion) ;; 24 ) ) -|# -;; (define-extern reload-grenade-init-by-other function) -;; (define-extern reload-grenade-spawn function) +(define-extern reload-grenade-init-by-other (function reload-grenade-spawn-params object :behavior reload-grenade)) +(define-extern reload-grenade-spawn (function crimson-guard type reload-grenade-spawn-params reload-grenade)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; guard-tazer ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern spread-lightning-lazer function) ;; (function lightning-control vector vector vector none) +(define-extern spread-lightning-lazer (function lightning-control vector vector vector symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; guard-rifle ;; @@ -69627,74 +69652,68 @@ ;; guard-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern debug-active function) +(define-extern debug-active (function symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; citizen-norm ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype citizen-norm (civilian) () :method-count-assert 235 :size-assert #x464 :flag-assert #xeb03f00464 (:state-methods - wait ;; 190 - knocked-off-vehicle ;; 234 - get-up-back ;; 221 - get-up-front ;; 220 knocked ;; 31 + wait ;; 190 + get-up-front ;; 220 + get-up-back ;; 221 + knocked-off-vehicle ;; 234 ) ) -|# -;; (define-extern *citizen-norm-global-info* civilian-global-info) ;; civilian-global-info -;; (define-extern *citizen-norm-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info +(define-extern *citizen-norm-global-info* civilian-global-info) +(define-extern *citizen-norm-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; citizen-fat ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype citizen-fat (civilian) () :method-count-assert 234 :size-assert #x464 :flag-assert #xea03f00464 (:state-methods - wait ;; 190 - get-up-back ;; 221 - get-up-front ;; 220 knocked ;; 31 + wait ;; 190 + get-up-front ;; 220 + get-up-back ;; 221 ) ) -|# -;; (define-extern *citizen-fat-global-info* civilian-global-info) ;; civilian-global-info -;; (define-extern *citizen-fat-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info +(define-extern *citizen-fat-global-info* civilian-global-info) +(define-extern *citizen-fat-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; citizen-chick ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype citizen-chick (civilian) () :method-count-assert 234 :size-assert #x464 :flag-assert #xea03f00464 (:state-methods - wait ;; 190 - get-up-back ;; 221 - get-up-front ;; 220 knocked ;; 31 + wait ;; 190 + get-up-front ;; 220 + get-up-back ;; 221 ) ) -|# -;; (define-extern *citizen-chick-global-info* civilian-global-info) ;; civilian-global-info -;; (define-extern *citizen-chick-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info +(define-extern *citizen-chick-global-info* civilian-global-info) +(define-extern *citizen-chick-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; kg-squad-member ;; @@ -69710,15 +69729,14 @@ ;; metalhead-flitter ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype metalhead-flitter (mh-squad-member) ((move-angle float :offset-assert 1080) (heading symbol :offset-assert 1084) ;; guessed by decompiler - (change-dir-time uint64 :offset-assert 1088) ;; time-frame - (last-change-dir uint64 :offset-assert 1096) - (off-screen-timer uint64 :offset-assert 1104) - (amb-sound-timer uint64 :offset-assert 1112) - (attack-time uint64 :offset-assert 1120) ;; time-frame + (change-dir-time time-frame :offset-assert 1088) ;; time-frame + (last-change-dir time-frame :offset-assert 1096) + (off-screen-timer time-frame :offset-assert 1104) + (amb-sound-timer time-frame :offset-assert 1112) + (attack-time time-frame :offset-assert 1120) ;; time-frame (target-pos vector :inline :offset-assert 1136) (attack-pos vector :inline :offset-assert 1152) (base-height float :offset-assert 1168) @@ -69726,57 +69744,56 @@ :method-count-assert 229 :size-assert #x494 :flag-assert #xe504200494 - (:methods - (metalhead-flitter-method-224 () none) ;; 224 - (metalhead-flitter-method-225 () none) ;; 225 - (metalhead-flitter-method-226 () none) ;; 226 - (metalhead-flitter-method-227 () none) ;; 227 - (metalhead-flitter-method-228 () none) ;; 228 - ) (:state-methods - die-fast ;; 42 - in-ditch ;; 192 - victory ;; 39 - circling ;; 157 - attack ;; 222 - die ;; 40 - hostile ;; 38 - stare ;; 37 - ambush-jumping ;; 223 active ;; 34 + stare ;; 37 + hostile ;; 38 + victory ;; 39 + die ;; 40 + die-fast ;; 42 ambush ;; 47 + circling ;; 157 + in-ditch ;; 192 + attack ;; 222 + ambush-jumping ;; 223 + ) + (:methods + (metalhead-flitter-method-224 (_type_) none) ;; 224 + (metalhead-flitter-method-225 (_type_) none) ;; 225 + (metalhead-flitter-method-226 (_type_ process-focusable) symbol) ;; 226 + (metalhead-flitter-method-227 (_type_ symbol) none) ;; 227 + (metalhead-flitter-method-228 (_type_) float) ;; 228 ) ) -|# -;; (define-extern *fact-info-mh-flitter-defaults* fact-info-enemy-defaults) -;; (define-extern *metalhead-flitter-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info -;; (define-extern metalhead-flitter-fall-and-play-death-anim function) ;; (function int float time-frame none :behavior metalhead-flitter) +(define-extern *fact-info-mh-flitter-defaults* fact-info-enemy-defaults) +(define-extern *metalhead-flitter-nav-enemy-info* nav-enemy-info) +(define-extern metalhead-flitter-fall-and-play-death-anim (function int float time-frame none :behavior metalhead-flitter)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; kg-squad-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *default-kg-squad-member-settings* object) -;; (define-extern *alert-kg-squad-member-settings* object) -;; (define-extern *war-kg-squad-member-settings* object) +(define-extern *default-kg-squad-member-settings* (inline-array kg-squad-member-settings)) +(define-extern *alert-kg-squad-member-settings* (inline-array kg-squad-member-settings)) +(define-extern *war-kg-squad-member-settings* (inline-array kg-squad-member-settings)) (define-extern set-kg-primary-target (function handle float none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ff-squad-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *alert-level-settings* object) ;; (inline-array traffic-alert-state-settings) -;; (define-extern *ff-war-alert-state-settings* object) -;; (define-extern *ff-guard-type-mask* object) +(define-extern *alert-level-settings* squad-alert-state-settings) +(define-extern *ff-war-alert-state-settings* squad-alert-state-settings) +(define-extern *ff-guard-type-mask* int) (define-extern set-ff-primary-target (function handle float none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mh-squad-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *default-mh-squad-member-settings* object) -;; (define-extern *war-mh-squad-member-settings* object) +(define-extern *default-mh-squad-member-settings* (inline-array kg-squad-member-settings)) +(define-extern *war-mh-squad-member-settings* (inline-array kg-squad-member-settings)) (define-extern set-mh-primary-target (function handle float none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -69801,7 +69818,6 @@ ;; ctywide-init ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype dummy-alloc (structure) ((val uint32 :offset-assert 0) ) @@ -69809,68 +69825,67 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -;; (define-extern update-level-info function) -;; (define-extern ctywide-login function) ;; (function none) -;; (define-extern ctywide-activate function) ;; (function level symbol none) -;; (define-extern ctywide-deactivate function) ;; (function none) -;; (define-extern ctywide-logout function) -;; (define-extern *traffic-alert-level-force* object) ;; symbol -;; (define-extern lwide-activate function) ;; (function level symbol none) -;; (define-extern lwide-deactivate function) ;; (function none) +(define-extern update-level-info (function level none)) +(define-extern ctywide-login (function level none)) +(define-extern ctywide-activate (function level symbol none)) +(define-extern ctywide-deactivate (function level none)) +(define-extern ctywide-logout (function level none)) +(define-extern *traffic-alert-level-force* symbol) +(define-extern lwide-activate (function level symbol none)) +(define-extern lwide-deactivate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-texture ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *security-texture-anim-array* texture-anim-array) ;; (texture-anim-array texture-anim) -;; (define-extern set-security-color! function) ;; (function vector vector) -;; (define-extern set-security-flash! function) ;; (function vector vector) -;; (define-extern set-security-texture-masks! function) ;; (function vector symbol) +(define-extern *security-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern set-security-color! (function vector vector)) +(define-extern set-security-flash! (function vector vector)) +(define-extern set-security-texture-masks! (function vector symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern birth-func-ctywide-baron-propoganda-ticker-rotate function) ;; (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none) -;; (define-extern *range-color-gas-flame* curve-color-fast) -;; (define-extern *range-alpha-gas-flame* curve2d-fast) -;; (define-extern *range-scale-gas-flame-x* curve2d-fast) -;; (define-extern *range-scale-gas-flame-y* curve2d-fast) -;; (define-extern *r-curve-gas-flame* curve2d-fast) -;; (define-extern *g-curve-gas-flame* curve2d-fast) -;; (define-extern *b-curve-gas-flame* curve2d-fast) -;; (define-extern *curve-alpha-gas-flame* curve2d-fast) -;; (define-extern *curve-gas-flame-x* curve2d-fast) -;; (define-extern *curve-gas-flame-y* curve2d-fast) -;; (define-extern *part-ctyind-hot-gas-curve-settings* object) -;; (define-extern *range-kgpickup-dust-color* curve-color-fast) -;; (define-extern *range-kgpickup-dust-alpha* curve2d-fast) -;; (define-extern *range-kgpickup-dust-scale-x* curve2d-fast) -;; (define-extern *range-kgpickup-dust-scale-y* curve2d-fast) -;; (define-extern *curve-kgpickup-dust-alpha* curve2d-fast) -;; (define-extern *curve-kgpickup-dust-scale-x* curve2d-fast) -;; (define-extern *curve-kgpickup-dust-scale-y* curve2d-fast) -;; (define-extern *part-hijack-kgpickup-explosion-dust-in-curve-settings* object) -;; (define-extern *range-kgpickup-color* curve-color-fast) -;; (define-extern *range-kgpickup-alpha* curve2d-fast) -;; (define-extern *range-kgpickup-scale-x* curve2d-fast) -;; (define-extern *range-kgpickup-scale-y* curve2d-fast) -;; (define-extern *curve-kgpickup-alpha* curve2d-fast) -;; (define-extern *curve-kgpickup-scale-x* curve2d-fast) -;; (define-extern *curve-kgpickup-scale-y* curve2d-fast) -;; (define-extern *part-hijack-kgpickup-explosion-texture-curve-settings* object) +(define-extern birth-func-ctywide-baron-propoganda-ticker-rotate (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern *range-color-gas-flame* curve-color-fast) +(define-extern *range-alpha-gas-flame* curve2d-fast) +(define-extern *range-scale-gas-flame-x* curve2d-fast) +(define-extern *range-scale-gas-flame-y* curve2d-fast) +(define-extern *r-curve-gas-flame* curve2d-fast) +(define-extern *g-curve-gas-flame* curve2d-fast) +(define-extern *b-curve-gas-flame* curve2d-fast) +(define-extern *curve-alpha-gas-flame* curve2d-fast) +(define-extern *curve-gas-flame-x* curve2d-fast) +(define-extern *curve-gas-flame-y* curve2d-fast) +(define-extern *part-ctyind-hot-gas-curve-settings* particle-curve-settings) +(define-extern *range-kgpickup-dust-color* curve-color-fast) +(define-extern *range-kgpickup-dust-alpha* curve2d-fast) +(define-extern *range-kgpickup-dust-scale-x* curve2d-fast) +(define-extern *range-kgpickup-dust-scale-y* curve2d-fast) +(define-extern *curve-kgpickup-dust-alpha* curve2d-fast) +(define-extern *curve-kgpickup-dust-scale-x* curve2d-fast) +(define-extern *curve-kgpickup-dust-scale-y* curve2d-fast) +(define-extern *part-hijack-kgpickup-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-kgpickup-color* curve-color-fast) +(define-extern *range-kgpickup-alpha* curve2d-fast) +(define-extern *range-kgpickup-scale-x* curve2d-fast) +(define-extern *range-kgpickup-scale-y* curve2d-fast) +(define-extern *curve-kgpickup-alpha* curve2d-fast) +(define-extern *curve-kgpickup-scale-x* curve2d-fast) +(define-extern *curve-kgpickup-scale-y* curve2d-fast) +(define-extern *part-hijack-kgpickup-explosion-texture-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype security-wall (process-drawable) - ((pass int32 :offset-assert 200) + ((root collide-shape :override) + (pass pickup-type :offset-assert 200) (incoming-attack-id uint32 :offset-assert 204) - (next-message-time uint64 :offset-assert 208) ;; int64 + (next-message-time time-frame :offset-assert 208) ;; int64 (message int32 :offset-assert 216) (plane plane :inline :offset-assert 224) (color vector :inline :offset-assert 240) @@ -69882,63 +69897,57 @@ :method-count-assert 25 :size-assert #x11c :flag-assert #x1900a0011c - (:methods - (security-wall-method-22 () none) ;; 22 ;; (security-wall-method-22 (_type_ path-control float) vector) - (security-wall-method-23 () none) ;; 23 ;; (security-wall-method-23 (_type_) none) - (security-wall-method-24 () none) ;; 24 ;; (security-wall-method-24 (_type_) none) - ) (:state-methods - idle-open ;; 20, old: (idle-open () _type_ :state) - idle-close ;; 21, old: (idle-close () _type_ :state) + idle-open ;; 20 + idle-close ;; 21 + ) + (:methods + (init-wall (_type_ vector vector float) vector) ;; 22 ;; (security-wall-method-22 (_type_ path-control float) vector) + (play-speech (_type_) none) ;; 23 + (security-wall-method-24 (_type_) none) ;; 24 ;; (security-wall-method-24 (_type_) none) ) ) -|# -#| (deftype security-wall-child (security-wall) - ((hidden? basic :offset-assert 284) + ((hidden? symbol :offset-assert 284) ) :method-count-assert 26 :size-assert #x120 :flag-assert #x1a00a00120 (:state-methods - hide-wall ;; 25 idle-close ;; 21 + hide-wall ;; 25 ) ) -|# -#| (deftype parking-spot (process-drawable) - ((vehicle uint64 :offset-assert 200) ;; handle + ((vehicle handle :offset-assert 200) ;; handle (spawned symbol :offset-assert 208) ;; guessed by decompiler (minimap connection-minimap :offset-assert 212) (test-sphere sphere :inline :offset-assert 224) - (expire-time uint64 :offset-assert 240) - (last-update-time uint64 :offset-assert 248) + (expire-time time-frame :offset-assert 240) + (last-update-time time-frame :offset-assert 248) ) :method-count-assert 27 :size-assert #x100 :flag-assert #x1b00800100 - (:methods - (parking-spot-method-21 () none) ;; 21 ;; (parking-spot-method-21 (_type_) none) - (parking-spot-method-22 () none) ;; 22 ;; (parking-spot-method-22 (_type_) none) - (parking-spot-method-23 () none) ;; 23 ;; (parking-spot-method-23 (_type_ uint) none) - (parking-spot-method-24 () none) ;; 24 ;; (parking-spot-method-24 (_type_) none) - (parking-spot-method-25 () none) ;; 25 - (parking-spot-method-26 () none) ;; 26 - ) (:state-methods - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 + ) + (:methods + (parking-spot-method-21 (_type_) none) ;; 21 ;; (parking-spot-method-21 (_type_) none) + (parking-spot-method-22 (_type_) none) ;; 22 ;; (parking-spot-method-22 (_type_) none) + (parking-spot-method-23 (_type_ traffic-type) none) ;; 23 ;; (parking-spot-method-23 (_type_ uint) none) + (parking-spot-method-24 (_type_) none) ;; 24 ;; (parking-spot-method-24 (_type_) none) + (parking-spot-method-25 (_type_ symbol) symbol) ;; 25 + (parking-spot-method-26 (_type_) symbol) ;; 26 ) ) -|# -#| (deftype propa (process-focusable) ((sound-id sound-id :offset-assert 208) ;; guessed by decompiler (sound-index uint32 :offset-assert 212) - (handle uint64 :offset-assert 216) ;; handle + (handle handle :offset-assert 216) ;; handle (y-rot float :offset-assert 224) (hit-points int32 :offset-assert 228) (incoming-attack-id uint32 :offset-assert 232) @@ -69946,19 +69955,17 @@ :method-count-assert 33 :size-assert #xec :flag-assert #x21007000ec - (:methods - (propa-method-30 () none) ;; 30 ;; (propa-method-30 (_type_) none) - (propa-method-31 () none) ;; 31 ;; (propa-method-31 (_type_ vector) none) - (propa-method-32 () none) ;; 32 - ) (:state-methods - idle ;; 28, old: (broken () _type_ :state) - broken ;; 29, old: (propa-method-29 (_type_) none) + idle ;; 28 + broken ;; 29 + ) + (:methods + (propa-method-30 (_type_) none) ;; 30 + (propa-method-31 (_type_) none) ;; 31 + (propa-method-32 (_type_ vector) none) ;; 32 ) ) -|# -#| (deftype burning-bush (process-focusable) ((task game-task-control :offset-assert 208) ;; guessed by decompiler (part-off sparticle-launch-control :offset-assert 212) ;; guessed by decompiler @@ -69972,26 +69979,24 @@ :method-count-assert 35 :size-assert #xf0 :flag-assert #x23007000f0 - (:methods - (burning-bush-method-32 () none) ;; 32 ;; (burning-bush-method-32 (_type_) object) - (burning-bush-method-33 () none) ;; 33 - (burning-bush-method-34 () none) ;; 34 - ) (:state-methods - menu ;; 30, old: (burning-bush-method-30 (_type_) none) - talking ;; 29, old: (menu () _type_ :state) - idle ;; 28, old: (talking () _type_ :state) - collect-gems ;; 31, old: (burning-bush-method-31 (_type_) none) + idle ;; 28 + talking ;; 29 + menu ;; 30 + collect-gems ;; 31 + ) + (:methods + (burning-bush-method-32 (_type_) none) ;; 32 ;; (burning-bush-method-32 (_type_) object) + (burning-bush-method-33 (_type_) none) ;; 33 + (burning-bush-method-34 (_type_) object) ;; 34 ) ) -|# -#| (deftype city-burning-bush-get-on-info (structure) ((trans vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) (camera-trans vector :inline :offset-assert 32) - (camera-rot UNKNOWN 9 :offset-assert 48) + (camera-rot float 9 :offset-assert 48) (time float :offset-assert 84) (fov float :offset-assert 88) ) @@ -69999,42 +70004,33 @@ :size-assert #x5c :flag-assert #x90000005c ) -|# -#| (deftype task-manager-ctywide-bbush-get-to (task-manager) - ((skill uint64 :offset-assert 240) + ((skill handle :offset-assert 240) ) :method-count-assert 33 :size-assert #xf8 :flag-assert #x21008000f8 (:methods - (task-manager-ctywide-bbush-get-to-method-32 () none) ;; 32 - ) - (:state-methods - active ;; 15 + (task-manager-ctywide-bbush-get-to-method-32 (_type_) none) ;; 32 ) ) -|# -#| (deftype ctyn-lamp (process-focusable) () :method-count-assert 32 :size-assert #xd0 :flag-assert #x20005000d0 - (:methods - (ctyn-lamp-method-30 () none) ;; 30 ;; (ctyn-lamp-method-30 (_type_) none) - (ctyn-lamp-method-31 () none) ;; 31 - ) (:state-methods - die ;; 29, old: (ctyn-lamp-method-29 (_type_) none) - idle ;; 28, old: (die () _type_ :state) + idle ;; 28 + die ;; 29 + ) + (:methods + (ctyn-lamp-method-30 (_type_) none) ;; 30 ;; (ctyn-lamp-method-30 (_type_) none) + (ctyn-lamp-method-31 (_type_) none) ;; 31 ) ) -|# -#| (deftype fac-lowrez-move (structure) ((light light-state :inline :offset-assert 0) (roty float :offset-assert 8) @@ -70043,13 +70039,12 @@ (wobble float :offset-assert 20) (bob float :offset-assert 24) ) + :pack-me :method-count-assert 9 :size-assert #x1c :flag-assert #x90000001c ) -|# -#| (deftype fac-lorez (process-drawable) ((move-info fac-lowrez-move :inline :offset-assert 200) ) @@ -70060,217 +70055,171 @@ idle ;; 20 ) ) -|# -#| (deftype flitter-spawner (process-drawable) - ((root basic :offset-assert 124) - (actor-group uint32 :offset-assert 200) - (actor-group-count int32 :offset-assert 204) - (spawner basic :offset-assert 208) - (desired-spawn-count int32 :offset-assert 212) - (spawn-times basic :offset-assert 216) - (last-seen-times basic :offset-assert 220) + ((actor-group (pointer actor-group) :offset 204) + (actor-group-count int32 :offset-assert 208) + (spawner proc-focusable-spawner :offset-assert 212) + (desired-spawn-count int32 :offset-assert 216) + (spawn-times (array time-frame) :offset-assert 220) + (last-seen-times (array time-frame) :offset-assert 224) ) :method-count-assert 22 :size-assert #xe4 :flag-assert #x16007000e4 - (:methods - (flitter-spawner-method-21 () none) ;; 21 - ) (:state-methods active ;; 20 ) + (:methods + (spawn-flitter (_type_ entity-actor) object) ;; 21 + ) ) -|# -#| (deftype flitter-point (process-hidden) () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 ) -|# -#| (deftype board-score-hud (hud-goal) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype task-manager-bbush-board (task-manager) ((score float :offset-assert 240) - (challenge-done basic :offset-assert 244) - (hud-score uint64 :offset-assert 248) - (hud-goal uint64 :offset-assert 256) + (challenge-done symbol :offset-assert 244) + (hud-score handle :offset-assert 248) + (hud-goal handle :offset-assert 256) (game-score uint8 :offset-assert 264) - (new-high-score basic :offset-assert 268) + (new-high-score symbol :offset-assert 268) (goal-cup uint8 :offset-assert 272) (last-cup uint8 :offset-assert 273) - (roll-back-task? basic :offset-assert 276) + (roll-back-task? symbol :offset-assert 276) ) :method-count-assert 35 :size-assert #x118 :flag-assert #x2300a00118 (:methods - (task-manager-bbush-board-method-32 () none) ;; 32 - (task-manager-bbush-board-method-33 () none) ;; 33 - (task-manager-bbush-board-method-34 () none) ;; 34 - ) - (:state-methods - resolution ;; 17 - active ;; 15 + (task-manager-bbush-board-method-32 (_type_) none) ;; 32 + (task-manager-bbush-board-method-33 (_type_) none) ;; 33 + (task-manager-bbush-board-method-34 (_type_ float) none) ;; 34 ) ) -|# -#| (deftype mh-tower-smoke-cty (process-drawable) () :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 (:state-methods - die ;; 21 idle ;; 20 + die ;; 21 ) ) -|# -;; (define-extern security-wall-child-init-by-other function) -;; (define-extern spawn-security-wall function) -;; (define-extern parking-spot-spawn function) -;; (define-extern *propa-sounds* array) ;; (array string) -;; (define-extern *propa-sounds-class-3* array) ;; (array string) -;; (define-extern *propa-sounds-class-2* array) ;; (array string) -;; (define-extern *propa-sounds-class-1* array) ;; (array string) -;; (define-extern *propa-sounds-metalheads* array) ;; (array string) -;; (define-extern *propa-sounds-baron-construction* array) ;; (array string) -;; (define-extern propa-pu->knocked-type function) ;; (function penetrate knocked-type) -;; (define-extern *city-burning-bush-get-on-info* array) -;; (define-extern *ctyn-lamp-exploder-params* joint-exploder-static-params) ;; joint-exploder-static-params +(define-extern security-wall-child-init-by-other (function vector vector float symbol object :behavior security-wall-child)) +(define-extern spawn-security-wall (function process vector vector float symbol handle)) +(define-extern parking-spot-spawn (function traffic-object-spawn-params vehicle)) +(define-extern *propa-sounds* (array string)) +(define-extern *propa-sounds-class-3* (array string)) +(define-extern *propa-sounds-class-2* (array string)) +(define-extern *propa-sounds-class-1* (array string)) +(define-extern *propa-sounds-metalheads* (array string)) +(define-extern *propa-sounds-baron-construction* (array string)) +(define-extern propa-pu->knocked-type (function penetrate knocked-type)) +(define-extern *city-burning-bush-get-on-info* (array city-burning-bush-get-on-info)) +(define-extern *ctyn-lamp-exploder-params* joint-exploder-static-params) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-tasks ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype task-manager-city-vehicle-training-hover-zone-1 (task-manager) - ((speech-id uint32 :offset-assert 240) + ((speech-id sound-id :offset-assert 240) ) :method-count-assert 32 :size-assert #xf4 :flag-assert #x20008000f4 - (:state-methods - complete ;; 16 - fail ;; 18 - active ;; 15 - ) ) -|# -#| (deftype task-manager-city-vehicle-training-hover-zone-2 (task-manager) - ((speech-id uint32 :offset-assert 240) + ((speech-id sound-id :offset-assert 240) ) :method-count-assert 32 :size-assert #xf4 :flag-assert #x20008000f4 - (:state-methods - active ;; 15 - ) ) -|# -#| (deftype cty-hijack-intro (task-manager) () :method-count-assert 32 :size-assert #xf0 :flag-assert #x20007000f0 - (:state-methods - active ;; 15 - ) ) -|# -#| (deftype task-manager-force-load-borrows (task-manager) () :method-count-assert 32 :size-assert #xf0 :flag-assert #x20007000f0 - (:state-methods - active ;; 15 - ) ) -|# -#| (deftype task-manager-blackout (task-manager) () :method-count-assert 32 :size-assert #xf0 :flag-assert #x20007000f0 - (:state-methods - active ;; 15 - ) ) -|# -;; (define-extern wait-for-speech-end function) ;; (function sound-id none) +(define-extern wait-for-speech-end (function sound-id symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern spt-birth-func-brightness-part-fma-dark-eco-steam function) -;; (define-extern *range-fma-city-barrier-explo-big-color* curve-color-fast) -;; (define-extern *range-fma-city-barrier-explo-big-alpha* curve2d-fast) -;; (define-extern *range-fma-city-barrier-explo-big-scale-x* curve2d-fast) -;; (define-extern *range-fma-city-barrier-explo-big-scale-y* curve2d-fast) -;; (define-extern *curve-fma-city-barrier-explo-big-alpha* curve2d-fast) -;; (define-extern *curve-fma-city-barrier-explo-big-scale-x* curve2d-fast) -;; (define-extern *curve-fma-city-barrier-explo-big-scale-y* curve2d-fast) -;; (define-extern *part-fma-city-barrier-explosion-big-texture-curve-settings* object) +(define-extern spt-birth-func-brightness-part-fma-dark-eco-steam (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern *range-fma-city-barrier-explo-big-color* curve-color-fast) +(define-extern *range-fma-city-barrier-explo-big-alpha* curve2d-fast) +(define-extern *range-fma-city-barrier-explo-big-scale-x* curve2d-fast) +(define-extern *range-fma-city-barrier-explo-big-scale-y* curve2d-fast) +(define-extern *curve-fma-city-barrier-explo-big-alpha* curve2d-fast) +(define-extern *curve-fma-city-barrier-explo-big-scale-x* curve2d-fast) +(define-extern *curve-fma-city-barrier-explo-big-scale-y* curve2d-fast) +(define-extern *part-fma-city-barrier-explosion-big-texture-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-speech ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern restore-city-speeches function) ;; (function none) +(define-extern restore-city-speeches (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyport-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype boat-manager (process) - ((mesh basic :offset-assert 128) + ((mesh nav-mesh :offset-assert 128) (paths path-control 4 :offset-assert 132) ;; guessed by decompiler - (boats-stop? basic :offset-assert 148) + (boats-stop? symbol :offset-assert 148) ) :method-count-assert 17 :size-assert #x98 :flag-assert #x1100200098 - (:methods - (boat-manager-method-15 () none) ;; 15 ;; (boat-manager-method-15 (_type_) none) - (boat-manager-method-16 () none) ;; 16 - ) (:state-methods - idle ;; 14, old: (idle () _type_ :state) + idle ;; 14 + ) + (:methods + (boat-manager-method-15 (_type_) none) ;; 15 + (boat-manager-method-16 (_type_) symbol) ;; 16 ) ) -|# -#| (deftype boat-base (vehicle) - ((manager uint64 :offset-assert 696) + ((manager handle :offset-assert 696) (angle float :offset-assert 704) (y-rot float :offset-assert 708) (path-num uint32 :offset-assert 712) @@ -70285,9 +70234,7 @@ waiting ;; 57 ) ) -|# -#| (deftype barge (boat-base) ((engine sound-id :offset-assert 720) ;; guessed by decompiler (bow-wash sound-id :offset-assert 724) ;; guessed by decompiler @@ -70296,9 +70243,8 @@ :size-assert #x2d8 :flag-assert #x98026002d8 ) -|# -;; (define-extern *barge-constants* object) ;; rigid-body-vehicle-constants +(define-extern *barge-constants* rigid-body-vehicle-constants) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mhcity-part ;; @@ -70581,44 +70527,40 @@ ;; krimson-wall ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype krimson-wall-break (process-drawable) - ((art-name basic :offset-assert 200) - (anim basic :offset-assert 204) - (pillar UNKNOWN 2 :offset-assert 208) - (level-name basic :offset-assert 216) + ((art-name string :offset-assert 200) + (anim spool-anim :offset-assert 204) + (pillar (pointer manipy) 2 :offset-assert 208) + (level-name symbol :offset-assert 216) ) :method-count-assert 23 :size-assert #xdc :flag-assert #x17006000dc (:state-methods - done ;; 22 - explode ;; 21 idle ;; 20 + explode ;; 21 + done ;; 22 ) ) -|# -#| (deftype krimson-wall (process-focusable) - ((alt-actor UNKNOWN 2 :offset-assert 208) + ((alt-actor entity-actor 2 :offset-assert 208) (collision-part int32 :offset-assert 216) (width float :offset-assert 220) ) :method-count-assert 31 :size-assert #xe0 :flag-assert #x1f006000e0 - (:methods - (krimson-wall-method-30 () none) ;; 30 - ) (:state-methods - die ;; 29 idle ;; 28 + die ;; 29 + ) + (:methods + (krimson-wall-method-30 (_type_ symbol) none) ;; 30 ) ) -|# -;; (define-extern krimson-wall-break-init-by-other function) +(define-extern krimson-wall-break-init-by-other (function entity-actor symbol object :behavior krimson-wall-break)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; trail ;; diff --git a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc index 38da1dcc21..f3e1787669 100644 --- a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc @@ -864,5 +864,80 @@ [22, "(function game-task object)"], [26, "(function vector :behavior manipy)"], [30, "(function object :behavior manipy)"] - ] + ], + "ff-squad-control": [ + [6, "(function process-focusable traffic-object-type-info none)"], + [7, "(function process-focusable traffic-object-type-info none)"], + [8, "(function process-focusable traffic-object-type-info none)"], + [9, "(function crimson-guard traffic-object-type-info none)"] + ], + "guard": [ + [31, "(function crimson-guard collide-shape vector symbol)"], + [49, "(function process city-attacker-info int)"] + ], + "guard-tazer": [ + [7, "(function collide-shape-prim none)"], + [13, "(function collide-shape-prim none)"] + ], + "roboguard-city": [ + [13, "(function cspace transformq none)"], + [78, "(function roboguard-city symbol quaternion :behavior process)"] + ], + "ctywide-obs": [[93, "(function symbol)"]], + "ctywide-scenes": [ + [1, "(function none :behavior scene-player)"], + [2, "(function none :behavior scene-player)"], + [3, "(function none :behavior scene-player)"] + ], + "ctyport-obs": [[5, "(function collide-shape-prim none)"]], + "ctyport-scenes": [ + [3, "(function none :behavior scene-player)"], + [4, "(function none :behavior scene-player)"], + [5, "(function none :behavior scene-player)"], + [6, "(function none :behavior scene-player)"] + ], + "ctyport-attack": [[45, "(function object :behavior process)"]], + "intro-scenes": [ + [0, "(function none :behavior scene-player)"], + [1, "(function none :behavior scene-player)"], + [2, "(function none :behavior scene-player)"], + [3, "(function none :behavior scene-player)"], + [4, "(function none :behavior scene-player)"], + [5, "(function none :behavior scene-player)"], + [6, "(function none :behavior scene-player)"], + [7, "(function none :behavior scene-player)"], + [8, "(function none :behavior scene-player)"], + [9, "(function none :behavior scene-player)"], + [10, "(function none :behavior scene-player)"], + [11, "(function none :behavior scene-player)"], + [12, "(function none :behavior scene-player)"], + [13, "(function none :behavior scene-player)"], + [14, "(function none :behavior scene-player)"], + [15, "(function none :behavior scene-player)"], + [16, "(function none :behavior scene-player)"], + [17, "(function none :behavior scene-player)"], + [18, "(function none :behavior scene-player)"], + [19, "(function none :behavior scene-player)"], + [20, "(function none :behavior scene-player)"], + [21, "(function none :behavior scene-player)"], + [22, "(function none :behavior scene-player)"], + [23, "(function none :behavior scene-player)"], + [24, "(function none :behavior scene-player)"], + [25, "(function none :behavior scene-player)"], + [26, "(function none :behavior scene-player)"], + [27, "(function none :behavior scene-player)"], + [28, "(function none :behavior scene-player)"], + [29, "(function none :behavior scene-player)"], + [30, "(function none :behavior scene-player)"], + [31, "(function none :behavior scene-player)"], + [32, "(function none :behavior scene-player)"], + [33, "(function none :behavior scene-player)"], + [34, "(function none :behavior scene-player)"], + [35, "(function none :behavior scene-player)"], + [36, "(function none :behavior scene-player)"], + [37, "(function none :behavior scene-player)"], + [38, "(function none :behavior scene-player)"], + [39, "(function none :behavior scene-player)"] + ], + "freehq-scenes": [[0, "(function none :behavior scene-player)"]] } diff --git a/decompiler/config/jak3/ntsc_v1/art_info.jsonc b/decompiler/config/jak3/ntsc_v1/art_info.jsonc index 35b9be11c6..2726552dd6 100644 --- a/decompiler/config/jak3/ntsc_v1/art_info.jsonc +++ b/decompiler/config/jak3/ntsc_v1/art_info.jsonc @@ -25,7 +25,9 @@ "maker": "dm-robot-ag", "mh-wasp": "neo-wasp-ag", "factory-boss": "errol-lowres-ag", - "fac-robotank-turret": "fac-robotank-ag" + "fac-robotank-turret": "fac-robotank-ag", + "neo-sat-shield": "neo-satellite-shield-ag", + "neo-sat": "neo-satellite-ag" }, // remap names for types in an entire file (higher priority) diff --git a/decompiler/config/jak3/ntsc_v1/hacks.jsonc b/decompiler/config/jak3/ntsc_v1/hacks.jsonc index 1f0f219ed9..7d78365b6c 100644 --- a/decompiler/config/jak3/ntsc_v1/hacks.jsonc +++ b/decompiler/config/jak3/ntsc_v1/hacks.jsonc @@ -108,7 +108,6 @@ "(method 10 manipulator)", "(method 46 ff-squad-control)", "(method 33 rub-tower)", - "(method 261 crimson-guard)", "memcpy" ], @@ -225,7 +224,10 @@ "update-sound-info", "insert-into-sound-list", // title-obs - "(anon-function 22 title-obs)" + "(anon-function 22 title-obs)", + "cty-faction-evaluate-commands", + "traffic-manager-event-handler", + "(method 20 cty-faction-manager)" ], // If format is used with the wrong number of arguments, @@ -448,7 +450,21 @@ "generic-merc-execute-all": [7, 15], "check-enemy": [0, 1], "(method 91 h-warf)": [0], - "(method 51 h-warf)": [5] + "(method 51 h-warf)": [5], + "(method 44 nav-graph)": [0, 7, 8, 26, 34], + "(method 15 city-level-info)": [0, 1, 2, 6, 7, 9, 11, 13], + "(method 10 traffic-suppressor)": [0, 1, 2, 4], + "(method 18 traffic-tracker)": [5, 6, 7, 8], + "(method 21 traffic-tracker)": [0], + "(method 9 cty-faction-manager)": [8], + "(method 46 traffic-engine)": [0, 1, 2, 4], + "(method 42 traffic-engine)": [6], + "(method 17 traffic-manager)": [7, 19, 27, 28, 29, 30, 41], + "(anon-function 10 guard-rifle)": [9], + "(method 261 crimson-guard)": [52, 64], + "(anon-function 13 metalhead-predator)": [24, 25], + "(anon-function 90 ctywide-obs)": [4], + "(anon-function 10 cty-sniper-turret)": [44] }, // Sometimes the game might use format strings that are fetched dynamically, @@ -544,7 +560,13 @@ "(method 32 task-manager-dark-punch-training)": [[53, 0]], "(method 32 task-manager-lightjak-training-shield)": [[53, 0]], "(trans credits highres-viewer-manager)": [[185, 0]], - "(trans idle hirez-viewer)": [[356, 0]] + "(trans idle hirez-viewer)": [[356, 0]], + "(trans idle burning-bush)": [ + [171, 1], + [202, 0] + ], + "(method 33 task-manager-bbush-board)": [[86, 0]], + "(method 17 board-score-hud)": [[71, 0]] }, "mips2c_functions_by_name": [ diff --git a/decompiler/config/jak3/ntsc_v1/inputs.jsonc b/decompiler/config/jak3/ntsc_v1/inputs.jsonc index f5d2489560..23b34df809 100644 --- a/decompiler/config/jak3/ntsc_v1/inputs.jsonc +++ b/decompiler/config/jak3/ntsc_v1/inputs.jsonc @@ -37,34 +37,34 @@ "DGO/DESA.DGO", "DGO/DESB.DGO", "DGO/DESBATTL.DGO", - // "DGO/DESBCST.DGO", + "DGO/DESBCST.DGO", "DGO/DESBOSS1.DGO", "DGO/DESBOSS2.DGO", - // "DGO/DESC.DGO", + "DGO/DESC.DGO", "DGO/DESCHASE.DGO", "DGO/DESD.DGO", - // "DGO/DESE.DGO", - // "DGO/DESERROL.DGO", + "DGO/DESE.DGO", + "DGO/DESERROL.DGO", "DGO/DESF.DGO", "DGO/DESG.DGO", - // "DGO/DESH.DGO", + "DGO/DESH.DGO", "DGO/DESHOVER.DGO", - // "DGO/DESHUNT.DGO", + "DGO/DESHUNT.DGO", "DGO/DESINTER.DGO", - // "DGO/DESJUMP.DGO", + "DGO/DESJUMP.DGO", "DGO/DESLIZ.DGO", "DGO/DESOASIS.DGO", "DGO/DESRACE1.DGO", "DGO/DESRACE2.DGO", "DGO/DESRALLY.DGO", "DGO/DESRESC.DGO", - // "DGO/DESRESCC.DGO", - // "DGO/DESRESCG.DGO", + "DGO/DESRESCC.DGO", + "DGO/DESRESCG.DGO", "DGO/DESTRACK.DGO", "DGO/DESW.DGO", "DGO/DST.DGO", "DGO/OASISCST.DGO", - // "DGO/WARPCAST.DGO", // air train + "DGO/WARPCAST.DGO", // air train // nest "DGO/NSA.DGO", "DGO/NSB.DGO", @@ -117,10 +117,10 @@ "DGO/GUNGAME2.DGO", "DGO/POWERGD.DGO", "DGO/FREEHQ.DGO", - // "DGO/FREECAST.DGO", - // "DGO/CITYCAST.DGO", - // "DGO/GRIDCST.DGO", // city-destroy-grid-res - // "DGO/SLUMBSET.DGO", // sewer-met-hum-intro + "DGO/FREECAST.DGO", + "DGO/CITYCAST.DGO", + "DGO/GRIDCST.DGO", // city-destroy-grid-res + "DGO/SLUMBSET.DGO", // sewer-met-hum-intro // sewer "DGO/SEA.DGO", "DGO/SEB.DGO", @@ -207,7 +207,7 @@ // test "DGO/HALFPIPE.DGO", // borrow - // "DGO/LASHELIN.DGO", + "DGO/LASHELIN.DGO", "DGO/LBBRING1.DGO", "DGO/LBBRING2.DGO", "DGO/LBBRING3.DGO", @@ -225,27 +225,27 @@ "DGO/LBBTCHA2.DGO", "DGO/LBBTCHA3.DGO", "DGO/LBIPED.DGO", - // "DGO/LBLOWCST.DGO", - // "DGO/LBLOWTKG.DGO", - // "DGO/LBLOWTMH.DGO", - // "DGO/LBOMBBOT.DGO", - // "DGO/LCITYSML.DGO", - // "DGO/LCTYASS.DGO", - // "DGO/LCTYBLOW.DGO", + "DGO/LBLOWCST.DGO", + "DGO/LBLOWTKG.DGO", + "DGO/LBLOWTMH.DGO", + "DGO/LBOMBBOT.DGO", + "DGO/LCITYSML.DGO", + "DGO/LCTYASS.DGO", + "DGO/LCTYBLOW.DGO", "DGO/LCTYDEST.DGO", - // "DGO/LCTYHIJK.DGO", - // "DGO/LCTYPALT.DGO", - // "DGO/LCTYPATK.DGO", - // "DGO/LCTYPROT.DGO", - // "DGO/LCTYSNPR.DGO", - // "DGO/LDAMKLEV.DGO", - // "DGO/LDAMPECK.DGO", - // "DGO/LDAMPKSM.DGO", - // "DGO/LDAMSIG.DGO", + "DGO/LCTYHIJK.DGO", + "DGO/LCTYPALT.DGO", + "DGO/LCTYPATK.DGO", + "DGO/LCTYPROT.DGO", + "DGO/LCTYSNPR.DGO", + "DGO/LDAMKLEV.DGO", + "DGO/LDAMPECK.DGO", + "DGO/LDAMPKSM.DGO", + "DGO/LDAMSIG.DGO", "DGO/LDAX.DGO", - // "DGO/LDESGCST.DGO", - // "DGO/LDMPCKGN.DGO", - // "DGO/LERROL.DGO", + "DGO/LDESGCST.DGO", + "DGO/LDMPCKGN.DGO", + "DGO/LERROL.DGO", "DGO/LFACB.DGO", "DGO/LFACCAR.DGO", "DGO/LFACCITY.DGO", @@ -255,23 +255,23 @@ "DGO/LFACTORY.DGO", "DGO/LFORM.DGO", "DGO/LFORP.DGO", - // "DGO/LFORRING.DGO", + "DGO/LFORRING.DGO", "DGO/LFREEOUT.DGO", - // "DGO/LGUNNORM.DGO", - // "DGO/LGUNRNC.DGO", + "DGO/LGUNNORM.DGO", + "DGO/LGUNRNC.DGO", "DGO/LJAK.DGO", "DGO/LJAKC.DGO", "DGO/LJAKCKLV.DGO", "DGO/LJAKKLEV.DGO", "DGO/LJAKNDAX.DGO", "DGO/LJAKSIG.DGO", - // "DGO/LJINX.DGO", - // "DGO/LJKCDMKL.DGO", - // "DGO/LJKDMPK.DGO", - // "DGO/LJKDXVIN.DGO", + "DGO/LJINX.DGO", + "DGO/LJKCDMKL.DGO", + "DGO/LJKDMPK.DGO", + "DGO/LJKDXVIN.DGO", "DGO/LJKFEET.DGO", - // "DGO/LJNDKLEV.DGO", - // "DGO/LKEIRA.DGO", + "DGO/LJNDKLEV.DGO", + "DGO/LKEIRA.DGO", "DGO/LKLEEVER.DGO", "DGO/LMECH.DGO", "DGO/LMHCA.DGO", @@ -280,34 +280,34 @@ "DGO/LNSTOA.DGO", "DGO/LNSTOBB.DGO", "DGO/LNSTOBC.DGO", - // "DGO/LONINSIM.DGO", - // "DGO/LOUTRO.DGO", - // "DGO/LOUTRO2.DGO", - // "DGO/LOUTRO3.DGO", - // "DGO/LPATK.DGO", - // "DGO/LPATKCS.DGO", - // "DGO/LPRECC.DGO", - // "DGO/LPRENME.DGO", - // "DGO/LPTRL.DGO", - // "DGO/LSAMOS.DGO", + "DGO/LONINSIM.DGO", + "DGO/LOUTRO.DGO", + "DGO/LOUTRO2.DGO", + "DGO/LOUTRO3.DGO", + "DGO/LPATK.DGO", + "DGO/LPATKCS.DGO", + "DGO/LPRECC.DGO", + "DGO/LPRENME.DGO", + "DGO/LPTRL.DGO", + "DGO/LSAMOS.DGO", "DGO/LSEEMWCA.DGO", "DGO/LSIG.DGO", "DGO/LSIGJAKC.DGO", "DGO/LSIGKLV.DGO", "DGO/LSNKWHLS.DGO", - // "DGO/LTNFXHIP.DGO", - // "DGO/LTNJXHIP.DGO", + "DGO/LTNFXHIP.DGO", + "DGO/LTNJXHIP.DGO", "DGO/LTORN.DGO", - // "DGO/LTORNJNX.DGO", - // "DGO/LTORNSAM.DGO", + "DGO/LTORNJNX.DGO", + "DGO/LTORNSAM.DGO", "DGO/LTOWA.DGO", "DGO/LTOWB.DGO", "DGO/LTOWCITY.DGO", "DGO/LTRTWHLS.DGO", - // "DGO/LVINCST.DGO", + "DGO/LVINCST.DGO", "DGO/LWASBBV.DGO", "DGO/LWASSIG.DGO", - // "DGO/LWLANDM.DGO", + "DGO/LWLANDM.DGO", "DGO/LWSTDPCK.DGO" ], diff --git a/decompiler/config/jak3/ntsc_v1/label_types.jsonc b/decompiler/config/jak3/ntsc_v1/label_types.jsonc index f64b25bb19..30d8881890 100644 --- a/decompiler/config/jak3/ntsc_v1/label_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/label_types.jsonc @@ -1551,7 +1551,354 @@ ["L345", "vector"], ["L346", "vector"] ], - "title-obs": [ - ["L651", "vector"] + "title-obs": [["L651", "vector"]], + "formations": [["L7", "(inline-array formation-info)", 2]], + "citizen": [["L302", "attack-info"]], + "desert-rescue": [ + ["L552", "(inline-array talker-speech-class)", 85], + ["L422", "(inline-array vector)", 50] + ], + "neo-satellite": [ + ["L808", "uint64", true], + ["L806", "uint64", true], + ["L809", "uint64", true], + ["L805", "uint64", true], + ["L807", "uint64", true], + ["L804", "uint64", true], + ["L681", "uint64", true], + ["L683", "uint64", true], + ["L666", "uint64", true], + ["L678", "uint64", true], + ["L516", "attack-info"], + ["L667", "uint64", true], + ["L665", "uint64", true], + ["L670", "uint64", true], + ["L668", "uint64", true], + ["L671", "uint64", true], + ["L680", "uint64", true], + ["L672", "uint64", true], + ["L677", "uint64", true], + ["L682", "uint64", true], + ["L674", "uint64", true], + ["L673", "uint64", true], + ["L679", "uint64", true], + ["L499", "attack-info"], + ["L676", "uint64", true], + ["L675", "uint64", true], + ["L669", "uint64", true], + ["L500", "attack-info"], + ["L501", "attack-info"] + ], + "desert-rescue-bbush": [["L67", "(inline-array vector)", 50]], + "guard-states": [ + ["L238", "uint64", true], + ["L237", "uint64", true], + ["L239", "uint64", true] + ], + "guard-grenade": [ + ["L139", "uint64", true], + ["L138", "uint64", true], + ["L123", "uint64", true], + ["L124", "uint64", true] + ], + "guard-rifle": [ + ["L93", "uint64", true], + ["L92", "uint64", true] + ], + "cty-guard-projectile": [["L95", "attack-info"]], + "bike": [ + ["L31", "(inline-array vector)", 2], + ["L32", "(inline-array vector)", 2] + ], + "metalhead-flitter": [ + ["L170", "vector"], + ["L171", "vector"] + ], + "metalhead-grunt": [ + ["L159", "vector"], + ["L158", "vector"] + ], + "metalhead-predator": [ + ["L189", "uint64", true], + ["L190", "uint64", true], + ["L163", "uint64", true], + ["L166", "uint64", true], + ["L165", "uint64", true], + ["L164", "uint64", true], + ["L142", "vector"], + ["L143", "vector"] + ], + "roboguard-city": [ + ["L441", "uint64", true], + ["L442", "uint64", true], + ["L403", "uint64", true], + ["L402", "uint64", true], + ["L401", "uint64", true], + ["L404", "uint64", true], + ["L405", "uint64", true] + ], + "spydroid": [ + ["L243", "vector"], + ["L242", "vector"], + ["L241", "vector"], + ["L246", "vector"], + ["L247", "vector"], + ["L251", "vector"], + ["L250", "vector"], + ["L252", "vector"], + ["L253", "vector"], + ["L254", "vector"], + ["L255", "vector"], + ["L256", "vector"], + ["L257", "vector"], + ["L258", "vector"], + ["L259", "vector"], + ["L260", "vector"] + ], + "ctywide-obs": [ + ["L972", "uint64", true], + ["L969", "uint64", true], + ["L977", "uint64", true], + ["L970", "uint64", true], + ["L966", "uint64", true], + ["L964", "uint64", true], + ["L971", "uint64", true], + ["L973", "uint64", true], + ["L965", "uint64", true], + ["L975", "uint64", true], + ["L974", "uint64", true], + ["L968", "uint64", true], + ["L976", "uint64", true], + ["L967", "uint64", true], + ["L978", "uint64", true], + ["L743", "uint64", true], + ["L593", "vector"], + ["L751", "uint64", true], + ["L744", "uint64", true], + ["L746", "uint64", true], + ["L720", "vector"], + ["L726", "attack-info"], + ["L745", "uint64", true], + ["L748", "uint64", true], + ["L750", "uint64", true], + ["L749", "uint64", true], + ["L742", "uint64", true], + ["L747", "uint64", true] + ], + "ctywide-scenes": [["L968", "sphere"]], + "ctyport-part": [ + ["L507", "uint64", true], + ["L506", "uint64", true], + ["L224", "vector4w"], + ["L225", "vector4w"], + ["L227", "vector4w"], + ["L228", "vector4w"], + ["L229", "vector4w"], + ["L230", "vector4w"], + ["L232", "vector4w"], + ["L233", "vector4w"], + ["L234", "vector4w"], + ["L235", "vector4w"], + ["L236", "vector4w"], + ["L237", "vector4w"], + ["L238", "vector4w"], + ["L239", "vector4w"], + ["L240", "vector4w"], + ["L242", "vector4w"], + ["L243", "vector4w"], + ["L244", "vector4w"], + ["L245", "vector4w"], + ["L246", "vector4w"], + ["L247", "vector4w"], + ["L248", "vector4w"], + ["L249", "vector4w"], + ["L250", "vector4w"], + ["L251", "vector4w"], + ["L253", "vector4w"], + ["L254", "vector4w"], + ["L255", "vector4w"], + ["L256", "vector4w"], + ["L257", "vector4w"], + ["L258", "vector4w"], + ["L259", "vector4w"], + ["L260", "vector4w"], + ["L261", "vector4w"], + ["L262", "vector4w"], + ["L263", "vector4w"], + ["L264", "vector4w"], + ["L265", "vector4w"], + ["L266", "vector4w"], + ["L267", "vector4w"], + ["L268", "vector4w"], + ["L270", "vector4w"], + ["L271", "vector4w"], + ["L272", "vector4w"], + ["L273", "vector4w"], + ["L274", "vector4w"], + ["L275", "vector4w"], + ["L276", "vector4w"], + ["L277", "vector4w"], + ["L278", "vector4w"], + ["L279", "vector4w"], + ["L280", "vector4w"], + ["L281", "vector4w"], + ["L282", "vector4w"], + ["L283", "vector4w"], + ["L285", "vector4w"], + ["L287", "vector4w"] + ], + "ctyport-obs": [["L86", "attack-info"]], + "h-torpedo": [ + ["L191", "(inline-array talker-speech-class)", 5], + ["L184", "attack-info"] + ], + "krimson-wall": [["L62", "(inline-array vector)", 2]], + "ctyport-attack": [ + ["L727", "uint64", true], + ["L726", "uint64", true], + ["L725", "uint64", true], + ["L729", "uint64", true], + ["L724", "uint64", true], + ["L730", "uint64", true], + ["L728", "uint64", true], + ["L723", "uint64", true], + ["L593", "(inline-array talker-speech-class)", 49], + ["L493", "(inline-array vector)", 100], + ["L645", "uint64", true], + ["L646", "uint64", true], + ["L643", "uint64", true], + ["L644", "uint64", true], + ["L406", "vector"] + ], + "wcar-catapult": [ + ["L168", "vector"], + ["L169", "vector"], + ["L170", "vector"], + ["L171", "vector"], + ["L172", "vector"], + ["L173", "vector"], + ["L174", "vector"], + ["L167", "attack-info"], + ["L166", "vector"], + ["L165", "attack-info"] + ], + "desert-jump": [ + ["L222", "attack-info"], + ["L221", "vector"], + ["L225", "attack-info"], + ["L224", "vector"] + ], + "desert-chase": [ + ["L491", "attack-info"], + ["L475", "vector"] + ], + "bombbot": [ + ["L836", "uint64", true], + ["L831", "uint64", true], + ["L834", "uint64", true], + ["L835", "uint64", true], + ["L830", "uint64", true], + ["L833", "uint64", true], + ["L832", "uint64", true], + ["L827", "uint64", true], + ["L829", "uint64", true], + ["L828", "uint64", true], + ["L647", "attack-info"], + ["L646", "attack-info"], + ["L687", "uint64", true], + ["L685", "uint64", true], + ["L677", "uint64", true], + ["L542", "vector"], + ["L683", "uint64", true], + ["L682", "uint64", true], + ["L692", "uint64", true], + ["L690", "uint64", true], + ["L686", "uint64", true], + ["L610", "vector"], + ["L680", "uint64", true], + ["L693", "uint64", true], + ["L684", "uint64", true], + ["L681", "uint64", true], + ["L689", "uint64", true], + ["L691", "uint64", true], + ["L688", "uint64", true], + ["L679", "uint64", true], + ["L678", "uint64", true], + ["L620", "vector"], + ["L619", "attack-info"], + ["L556", "(inline-array kg-squad-member-settings)", 4] + ], + "ctyport-attack-bbush": [ + ["L143", "uint64", true], + ["L72", "vector"] + ], + "cty-hijack-missile": [["L207", "attack-info"]], + "cty-hijack": [["L526", "(inline-array talker-speech-class)", 52]], + "kg-squad-control": [ + ["L92", "(inline-array kg-squad-member-settings)", 4], + ["L91", "(inline-array kg-squad-member-settings)", 4], + ["L90", "(inline-array kg-squad-member-settings)", 4] + ], + "mh-squad-control": [ + ["L40", "(inline-array kg-squad-member-settings)", 3], + ["L39", "(inline-array kg-squad-member-settings)", 3] + ], + "intro-scenes": [ + ["L7337", "uint64", true], + ["L7338", "uint64", true], + ["L7339", "uint64", true], + ["L7340", "uint64", true] + ], + "cty-destroy-grid": [ + ["L466", "(inline-array kg-squad-member-settings)", 4], + ["L465", "(inline-array mh-squad-member-settings)", 3], + ["L446", "vector"], + ["L442", "vector"], + ["L438", "vector"] + ], + "cty-sniper-battery": [ + ["L282", "uint64", true], + ["L283", "uint64", true], + ["L281", "uint64", true], + ["L249", "uint64", true], + ["L251", "uint64", true], + ["L230", "vector"], + ["L250", "uint64", true], + ["L246", "uint64", true], + ["L247", "uint64", true], + ["L248", "uint64", true], + ["L236", "vector"], + ["L235", "vector"], + ["L234", "vector"], + ["L233", "vector"], + ["L232", "vector"], + ["L231", "vector"] + ], + "cty-sniper-turret": [ + ["L705", "uint64", true], + ["L709", "uint64", true], + ["L708", "uint64", true], + ["L707", "uint64", true], + ["L710", "uint64", true], + ["L706", "uint64", true], + ["L579", "(inline-array kg-squad-member-settings)", 4], + ["L426", "vector"], + ["L424", "vector"], + ["L587", "uint64", true], + ["L583", "uint64", true], + ["L594", "uint64", true], + ["L591", "uint64", true], + ["L584", "uint64", true], + ["L586", "uint64", true], + ["L585", "uint64", true], + ["L582", "uint64", true], + ["L588", "uint64", true], + ["L592", "uint64", true], + ["L581", "uint64", true], + ["L589", "uint64", true], + ["L590", "uint64", true], + ["L580", "uint64", true], + ["L593", "uint64", true], + ["L595", "uint64", true] ] } diff --git a/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc b/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc index 5a617ff4cc..c658b27625 100644 --- a/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc +++ b/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc @@ -5,5 +5,6 @@ "(method 11 elevator)": 1024, "scene-player-init": 1024, "task-manager-init-by-other": 2048, - "race-manager-init-by-other": 1024 + "race-manager-init-by-other": 1024, + "neo-sat-shield-init-by-other": 64 } diff --git a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc index c16c66cebe..5c6afb1de6 100644 --- a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc +++ b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc @@ -1,5 +1,5 @@ { - "quaternion-smooth-seek!": [[16, "quaternion"]], + "quaternion-smooth-seek!": [[16, ["inline-array", "quaternion", 2]]], "eul->matrix": [[16, "vector"]], "segment-segment-find-intersection-xz": [[16, "vector"]], "vector-line-xz-distance-point!": [[16, "matrix"]], @@ -1945,5 +1945,381 @@ [16, ["array", "symbol", 10]], [64, "event-message-block"], // this memory is reused as both mc-slot-info and event-message-block [368, ["array", "symbol", 10]] - ] + ], + "(method 9 nav-node)": [[48, ["inline-array", "vector", 2]]], + "(method 10 nav-node)": [[16, "vector"]], + "(method 9 nav-graph)": [[16, "matrix"]], + "(method 9 grid-info)": [[16, "vector"]], + "(method 11 grid-info)": [[16, "bounding-box"]], + "(method 13 grid-info)": [[16, "bounding-box"]], + "(method 9 city-level-info)": [ + [16, "vis-ray"], + [192, "vector"], + [208, "vector"], + [224, "vector"], + [128, "vector"], + [144, "vector"] + ], + "(method 11 city-level-info)": [[16, "vector"]], + "(method 12 city-level-info)": [[16, ["inline-array", "vector", 7]]], + "(method 17 city-level-info)": [[16, ["inline-array", "vis-grid-pos", 2]]], + "(method 16 city-level-info)": [ + [48, "vis-grid-box"], + [64, "vis-grid-box"] + ], + "(method 15 city-level-info)": [ + [32, "vis-grid-box"], + [16, "vis-grid-box"] + ], + "(method 14 traffic-level-data)": [ + [32, "vector"], + [48, "vector"], + [64, "vector"] + ], + "(method 18 city-level-info)": [[16, "bounding-box"]], + "(method 13 traffic-suppressor)": [ + [16, "bounding-box"], + [48, "vector4w"] + ], + "(method 22 traffic-tracker)": [[16, "traffic-engine-stack-var0"]], + "(method 22 traffic-engine)": [[16, "traffic-danger-info"]], + "(method 43 traffic-engine)": [[16, ["array", "collide-shape", 64]]], + "(method 52 traffic-engine)": [[16, "vector"]], + "(method 54 traffic-engine)": [ + [16, ["inline-array", "traffic-suppression-box", 2]], + [80, ["array", "collide-shape", 40]] + ], + "(method 53 traffic-engine)": [[16, ["array", "collide-shape", 40]]], + "(trans active formation-object)": [[48, "traffic-danger-info"]], + "(method 37 formation-object)": [[96, "vector"]], + "(method 38 formation-object)": [[16, "vector"]], + "(method 30 formation-object)": [[16, "msg-get-num-inactive"]], + "(method 204 citizen)": [ + [16, "vector"], + [32, "iter-seg"] + ], + "(method 207 citizen)": [ + [80, "vector"], + [32, "iter-seg"] + ], + "(method 202 citizen)": [ + [64, "vector"], + [80, "vector"] + ], + "(method 160 citizen)": [[16, "vector"]], + "(method 203 citizen)": [ + [80, "vector"], + [96, "vector"] + ], + "(method 45 formation-object)": [[16, "msg-get-inactive-objects"]], + "(trans move-to-vehicle civilian)": [ + [32, "vector"], + [128, "vector"] + ], + "civilian-flee-post": [ + [48, "vector"], + [80, "vector"] + ], + "civilian-avoid-danger-post": [[112, "vector"]], + "civilian-clear-path-post": [[96, "vector"]], + "(method 239 wlander)": [[48, "vector"]], + "(method 242 wlander)": [[32, "vector"]], + "(method 238 wlander)": [ + [32, ["array", "collide-shape", 64]], + [288, "vector"] + ], + "(method 241 wlander)": [ + [32, ["array", "collide-shape", 64]], + [288, "vector"] + ], + "(method 13 flee-info)": [ + [48, "vector"], + [64, "vector"] + ], + "(method 15 rope-system)": [ + [64, "vector"], + [80, "vector"], + [96, "vector"] + ], + "(enter rescue-start task-manager-desert-rescue)": [ + [16, "desert-rescue-transport-init-params"] + ], + "(code board-vehicle wland-passenger)": [ + [128, "vector"], + [176, "vector"] + ], + "(trans boarding wland-passenger)": [[32, "vector"]], + "(enter approaching-transport wland-passenger)": [[16, "vector"]], + "(method 231 wland-passenger)": [[16, "matrix"]], + "spawn-wlander": [[16, "wland-passenger-init-by-other-params"]], + "update-nav-sphere": [[64, "vector"]], + "compute-transport-approach-pt": [[48, "vector"]], + "(method 19 rope-prim-system)": [ + [48, "matrix"], + [16, "vector"], + [32, "vector"], + [208, "rgbaf"], + [224, "rgbaf"] + ], + "(method 211 neo-sat)": [[16, "vector"]], + "(method 232 neo-sat)": [[32, "vector"]], + "(method 220 neo-sat)": [[16, "vector"]], + "(method 221 neo-sat)": [[32, "vector"]], + "(method 206 neo-sat)": [ + [32, "vector"], + [48, "collide-query"] + ], + "(method 227 neo-sat)": [[16, "collide-query"]], + "spawn-neo-sat": [[16, "neo-sat-init-params"]], + "desert-rescue-transport-init-by-other": [ + [16, "light-trail-tracker-spawn-params"] + ], + "(method 254 crimson-guard)": [ + [16, "vector"], + [96, "vector"] + ], + "(method 255 crimson-guard)": [[64, "vector"]], + "(enter grenade-throw-post-reloading crimson-guard)": [ + [16, "reload-grenade-spawn-params"] + ], + "(method 46 ff-squad-control)": [[112, "ff-squad-control-stack-var0"]], + "(method 16 ff-squad-control)": [[192, ["array", "float", 16]]], + "(method 45 ff-squad-control)": [[16, "vector"]], + "(method 258 crimson-guard)": [[16, "collide-query"]], + "(method 259 crimson-guard)": [ + [96, "vector"], + [32, "vector"], + [48, "vector"], + [160, "vector"], + [176, "vector"] + ], + "(method 212 crimson-guard)": [[16, "shield-sphere-spawn-params"]], + "(method 266 crimson-guard)": [ + [32, "vector"], + [656, "vector"], + [720, "vector"] + ], + "(code sitting vehicle-grenade)": [[16, "traffic-danger-info"]], + "(method 44 vehicle-grenade)": [[16, "traffic-danger-info"]], + "(method 31 vehicle-grenade)": [[16, "vector"]], + "(method 264 crimson-guard)": [[32, "vector"]], + "(method 78 h-bike-base)": [[16, "bike-stack-var0"]], + "(method 217 citizen-enemy)": [[32, ["array", "collide-shape", 64]]], + "(method 225 metalhead-predator)": [ + [160, "vector"], + [176, "vector"], + [208, "vector"] + ], + "(trans close-attack roboguard-city)": [ + [32, ["array", "collide-shape", 384]] + ], + "(code roll-chase roboguard-city)": [[16, "vector"]], + "spawn-roboguard-projectile": [[16, "projectile-init-by-other-params"]], + "(method 237 roboguard-city)": [[16, "vector"]], + "(code flip spydroid)": [[16, "vector"]], + "(trans fire flying-turret)": [[16, "ft-gun-info"]], + "(method 161 flying-turret)": [[16, "vector"]], + "(method 31 h-kg-pickup)": [[48, "vector"]], + "(method 11 flitter-spawner)": [[32, "traffic-object-spawn-params"]], + "(method 21 flitter-spawner)": [[16, "traffic-object-spawn-params"]], + "(code active task-manager-ctywide-bbush-get-to)": [ + [160, "vector"], + [176, "matrix"] + ], + "(trans talking burning-bush)": [ + [32, "vector"], + [64, "vector"] + ], + "(method 32 propa)": [[16, ["array", "collide-shape", 64]]], + "(event idle propa)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 23 parking-spot)": [ + [16, "cquery-with-vec"], + [560, ["inline-array", "vector", 1]] + ], + "(method 24 parking-spot)": [[16, "cquery-with-vec"]], + "(method 11 security-wall)": [[32, "vector"]], + "(method 24 security-wall)": [[16, ["inline-array", "vector", 1]]], + "(trans menu burning-bush)": [[128, "vector"]], + "check-drop-level-ctyport-drop-userdata": [[16, "vector"]], + "(method 16 boat-manager)": [[16, "matrix"]], + "(method 31 boat-base)": [[16, "matrix"]], + "(method 30 boat-base)": [[96, ["inline-array", "vector", 6]]], + "(trans idle krimson-wall-break)": [[16, "matrix"]], + "(trans explode krimson-wall-break)": [[16, "vector"]], + "(method 35 htorpedo)": [[16, "light-trail-tracker-spawn-params"]], + "(enter start-mission ctyport-attack-manager)": [ + [16, ["array", "symbol", 10]] + ], + "(method 49 ctyport-attack-manager)": [ + [64, ["array", "collide-shape", 384]], + [32, "vector"] + ], + "(method 44 ctyport-attack-manager)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 45 ctyport-attack-manager)": [[16, "vector"]], + "(method 79 v-catapult)": [[16, ["inline-array", "quaternion", 3]]], + "(method 33 desert-jump-manager)": [[16, "vector"]], + "(code active desert-jump-manager)": [[96, ["array", "symbol", 10]]], + "(method 32 desert-jump-manager)": [ + [16, "mystery-traffic-object-spawn-params0"] + ], + "(method 23 beam-generator)": [[16, "matrix"]], + "(trans active player-controller)": [ + [32, "vector"], + [48, "vector"] + ], + "(code active desert-chase-ambush-manager)": [ + [16, ["inline-array", "traffic-object-spawn-params", 1]] + ], + "(method 34 desert-chase-ambush-manager)": [ + [16, "projectile-init-by-other-params"] + ], + "(method 33 desert-chase-ambush-manager)": [ + [16, "mystery-traffic-object-spawn-params0"] + ], + "(method 32 desert-chase-ambush-manager)": [ + [16, "marauder-init-by-other-params"] + ], + "(method 22 deschase-artifact)": [[16, "matrix"]], + "(method 12 deschase-vehicle-control)": [ + [64, ["array", "collide-shape", 128]], + [16, "matrix"] + ], + "(method 32 desert-chase-chase-manager)": [ + [16, "traffic-object-spawn-params"] + ], + "desert-chase-chase-intro-sequence": [[16, "player-controller-init-params"]], + "(method 32 bombbot-bomb)": [[592, "vector"]], + "bombbot-player-init-by-other": [[96, "vector"]], + "(trans hostile bombbot-player)": [[16, "vector"]], + "(post hostile bombbot-player)": [ + [576, "vector"], + [16, "vector"], + [592, "vector"] + ], + "(method 197 bombbot-player)": [ + [80, "matrix"], + [144, "vector"], + [720, "vector"], + [736, "vector"] + ], + "(method 196 bombbot-player)": [ + [16, "vector"], + [32, "vector"], + [48, "collide-query"], + [592, ["array", "collide-shape", 64]], + [848, "vector"] + ], + "(method 139 bombbot-player)": [ + [560, "vector"], + [576, "vector"], + [592, "vector"], + [608, "vector"], + [1168, "vector"], + [1216, "collide-query"] + ], + "(post hostile bomb-bot)": [[16, "vector"]], + "(trans hostile bomb-bot)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 196 bomb-bot)": [[16, ["array", "collide-shape", 64]]], + "(method 198 bombbot)": [ + [48, "vector"], + [64, "vector"], + [144, "vector"] + ], + "bombbot-gun-callback": [ + [32, "vector"], + [80, "vector"] + ], + "bombbot-gun-swivel-callback": [ + [16, "vector"], + [80, "vector"] + ], + "bombbot-callback": [ + [16, "vector"], + [32, "quaternion"], + [48, "vector"], + [64, "vector"] + ], + "(enter explode bombbot)": [ + [112, "vector"], + [128, "vector"], + [144, "vector"], + [256, "vector"] + ], + "(trans drop-bombs bombbot)": [[32, "vector"]], + "(trans hostile bombbot)": [[32, "vector"]], + "(method 160 bombbot)": [[32, "vector"]], + "(method 197 bombbot)": [ + [80, "matrix"], + [144, "vector"], + [720, "vector"], + [736, "vector"] + ], + "(method 203 bombbot)": [ + [80, "vector"], + [176, "vector"], + [400, "vector"] + ], + "(method 204 bombbot)": [[80, "vector"]], + "(method 194 bombbot)": [ + [608, "vector"], + [592, "vector"], + [624, "vector"], + [672, "vector"], + [720, "vector"] + ], + "(method 196 bombbot)": [[16, ["array", "collide-shape", 64]]], + "(method 25 bombbot-shot)": [[32, "vector"]], + "(enter blow-wall bombbot)": [[16, ["array", "symbol", 10]]], + "check-drop-level-ctysluma-drop-userdata": [[16, "vector"]], + "check-drop-level-ctyslumb-drop-userdata": [[16, "vector"]], + "(method 36 cty-missile-lure)": [[16, "vector"]], + "(method 36 cty-hijack-manager)": [[16, "cty-hijack-missile-init-params"]], + "(enter player-riding cty-hijack-manager)": [ + [96, "cty-missile-lure-init-params"], + [144, "cty-missile-lure-init-params"] + ], + "(method 38 cty-hijack-manager)": [ + [64, "vector"], + [80, "vector"] + ], + "(code wait ctyport-attack-manager-bbush)": [[96, ["array", "symbol", 10]]], + "check-drop-level-palroof-drop-userdata": [[16, "vector"]], + "check-drop-level-ctyfarmb-drop-userdata": [[16, "vector"]], + "check-drop-level-ctyfarma-drop-userdata": [[16, "vector"]], + "(method 11 com-power-box)": [ + [16, "vector"], + [48, "vector"] + ], + "(enter active task-manager-city-destroy-grid)": [ + [224, "enemy-init-by-other-params"] + ], + "(code exit-vehicle jinx)": [ + [32, "vector"], + [64, "vector"] + ], + "(code board-vehicle jinx)": [[16, "vector"]], + "(trans move-to-vehicle jinx)": [ + [32, "vector"], + [128, "vector"] + ], + "(post moribund cty-sniper-button)": [[16, "vector"]], + "(method 11 cty-sniper-turret)": [[32, "vector"]], + "sniper-turret-post": [[112, "vector"]], + "citysniper-draw-2d-hud": [ + [16, ["inline-array", "vector4w", 4]], + [80, "vector4w"] + ], + "(enter lock cty-sniper-turret-reticle)": [[16, "vector"]], + "(enter impact cty-sniper-turret-shot)": [[16, "traffic-danger-info"]], + "(method 25 cty-sniper-turret-shot)": [[32, "vector"]], + "cty-sniper-turret-handler": [[96, "vector"]] } diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index cf031600b8..4458c62095 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -5198,11 +5198,7 @@ [15, "a0", "process-focusable"], [18, "a0", "process-focusable"] ], - "(method 119 nav-enemy)": [ - [78, "s5", "nav-enemy-info"], - ["_stack_", 16, "res-tag"] - ], - "(method 118 nav-enemy)": [[3, "a1", "nav-enemy-info"]], + "(method 119 nav-enemy)": [["_stack_", 16, "res-tag"]], "(method 59 nav-enemy)": [ [57, "a0", "process-focusable"], [60, "a0", "process-focusable"] @@ -6766,7 +6762,6 @@ [255, "gp", "process-focusable"], [265, "gp", "process-focusable"] ], - "(method 119 egg-spider)": [[2, "a1", "nav-enemy-info"]], "(method 23 spider-manager)": [ [18, "v1", "egg-spider"], [24, "v1", "egg-spider"], @@ -7894,7 +7889,6 @@ [23, "v1", "dm-mine-spider"], [33, "s3", "int"] ], - "(method 119 dm-mine-spider)": [[2, "a1", "nav-enemy-info"]], "(method 82 dm-mine-spider)": [ [14, "v1", "process-drawable"], [29, "s3", "collide-shape"] @@ -8010,7 +8004,6 @@ [13, "v1", "int"], [86, "a0", "part-tracker"] ], - "(method 119 marauder)": [[2, "a1", "nav-enemy-info"]], "(code lava-die marauder)": [[34, "v1", "art-joint-anim"]], "(code attack-run marauder)": [ [21, "v1", "art-joint-anim"], @@ -9275,5 +9268,1288 @@ [[59, 149], "gp", "mc-slot-info"], // (+ sp-0 64) is reused as both mc-slot-info and event-message-block [354, "v1", "process-drawable"], [356, "s4", "quaternion"] + ], + "(method 42 nav-graph)": [[27, "v1", "uint"]], + "(method 44 nav-graph)": [ + [[102, 125], "s0", "mysql-nav-edge"], + [144, "s0", "mysql-nav-edge"], + [236, "s0", "mysql-nav-edge"], + [246, "v1", "mysql-nav-edge"], + [254, "v1", "mysql-nav-edge"] + ], + "make-nav-graph": [ + [[28, 31], "v1", "mysql-nav-graph-level-info"], + [31, "v1", "mysql-nav-graph-level-info"] + ], + "(method 9 city-level-info)": [[387, "v1", "nav-segment"]], + "(method 11 city-level-info)": [[27, "a3", "(pointer int8)"]], + "(method 26 traffic-tracker)": [[26, "a0", "process-focusable"]], + "(method 25 traffic-tracker)": [[24, "a0", "process-focusable"]], + "(method 17 traffic-tracker)": [[23, "s1", "process-focusable"]], + "(method 21 traffic-tracker)": [[42, "s3", "vehicle"]], + "(method 44 traffic-engine)": [ + [115, "a3", "uint"], + [130, "a3", "uint"], + [99, "a2", "uint"], + [49, "t0", "uint"], + [66, "a2", "nav-branch"], + [65, "a3", "int"], + [76, "t0", "int"], + [98, "a3", "int"], + [114, "t0", "int"], + [129, "a2", "int"] + ], + "(method 19 traffic-engine)": [ + [19, "v1", "process-focusable"], + [30, "v1", "hvehicle"] + ], + "(method 52 traffic-engine)": [ + [36, "a2", "process-focusable"], + [[312, 341], "s2", "nav-segment"], + [149, "s3", "process-focusable"], + [160, "s3", "process-focusable"], + [169, "s3", "citizen"], + [79, "s3", "process-focusable"], + [90, "s3", "process-focusable"], + [113, "s3", "vehicle"] + ], + "(method 34 formation-object)": [ + [26, "a0", "process-focusable"], + [29, "a0", "process-focusable"] + ], + "(method 47 formation-object)": [[[20, 25], "v1", "citizen"]], + "traffic-manager-event-handler": [ + [[363, 370], "s5", "level"], + [[386, 395], "v1", "msg-get-num-inactive"], + [[399, 405], "v1", "msg-get-num-inactive"], + [74, "v1", "float"], + [166, "v1", "float"], + [509, "v1", "float"], + [[408, 412], "v1", "msg-get-inactive-objects"], + [[109, 113], "s5", "traffic-object-spawn-params"] + ], + "(method 41 formation-object)": [ + [[85, 181], "s5", "traffic-object-spawn-params"] + ], + "(method 12 mission-squad-control)": [ + [28, "v1", "process-drawable"], + [41, "v1", "process-focusable"] + ], + "(code wait citizen)": [[22, "v1", "art-joint-anim"]], + "(code in-ditch citizen)": [ + [23, "v1", "art-joint-anim"], + [122, "v1", "art-joint-anim"] + ], + "(method 82 citizen)": [ + [108, "v1", "vector"], + [[190, 321], "s5", "traffic-object-spawn-params"] + ], + "(method 59 citizen)": [[[99, 108], "a0", "process-focusable"]], + "(method 63 citizen)": [[[31, 60], "v1", "target"]], + "(post active citizen)": [ + [92, "a0", "formation-object"], + [94, "a0", "formation-object"] + ], + "(trans active citizen)": [ + [97, "a0", "formation-object"], + [101, "a0", "formation-object"] + ], + "(trans wait citizen)": [[[42, 45], "a0", "formation-object"]], + "(method 206 citizen)": [[[10, 62], "s4", "vehicle"]], + "(code on-ground civilian)": [[20, "v1", "art-joint-anim"]], + "(code dive civilian)": [[20, "v1", "art-joint-anim"]], + "(code cower-ground civilian)": [ + [22, "v1", "art-joint-anim"], + [84, "v1", "art-joint-anim"], + [155, "v1", "art-joint-anim"] + ], + "(method 233 civilian)": [[40, "v1", "ragdoll-proc"]], + "(event wait-for-ride civilian)": [[[3, 7], "a0", "process"]], + "(trans wait-for-ride civilian)": [[31, "v1", "vehicle"]], + "(code wait-for-ride civilian)": [[22, "v1", "art-joint-anim"]], + "(method 232 civilian)": [[[11, 44], "s3", "vehicle"]], + "(trans move-to-vehicle civilian)": [[[11, 53], "s0", "vehicle"]], + "(code board-vehicle civilian)": [ + [[116, 137], "s2", "vehicle"], + [[264, 284], "s5", "vehicle"], + [[358, 365], "a0", "vehicle"] + ], + "(trans ride civilian)": [[[9, 15], "v1", "vehicle"]], + "(code exit-vehicle civilian)": [ + [[13, 19], "a0", "vehicle"], + [[69, 83], "s5", "vehicle"], + [[199, 204], "v1", "vehicle"], + [[252, 262], "a0", "vehicle"], + [[157, 172], "s4", "vehicle"] + ], + "(trans exit-vehicle civilian)": [[[9, 15], "v1", "vehicle"]], + "(code wait-at-dest civilian)": [[22, "v1", "art-joint-anim"]], + "(event ride civilian)": [[5, "a0", "vector"]], + "(trans board-vehicle civilian)": [[[9, 15], "v1", "vehicle"]], + "(method 82 civilian)": [ + [[23, 26], "a0", "traffic-danger-info"], + [[69, 72], "a0", "traffic-danger-info"], + [[97, 109], "v1", "traffic-danger-info"] + ], + "civilian-flee-post": [[[71, 79], "s5", "nav-branch"]], + "(method 32 squad-control-city)": [[[50, 58], "s4", "process-focusable"]], + "(method 34 squad-control-city)": [ + [[85, 98], "a0", "process-focusable"], + [[24, 41], "a0", "vehicle"] + ], + "(method 35 squad-control-city)": [ + [[17, 51], "s2", "process-focusable"], + [99, "v1", "connection"], + [100, "v1", "collide-shape"], + [105, "v1", "collide-shape"], + [114, "s1", "process-focusable"], + [177, "s1", "process-focusable"], + [195, "s1", "process-focusable"], + [235, "v1", "connection"], + [236, "v1", "collide-shape"], + [241, "v1", "collide-shape"], + [250, "s1", "process-focusable"], + [313, "s1", "process-focusable"], + [331, "s1", "process-focusable"], + [370, "v1", "connection"], + [371, "v1", "collide-shape"], + [376, "v1", "collide-shape"], + [385, "s1", "process-focusable"], + [448, "s1", "process-focusable"], + [466, "s1", "process-focusable"] + ], + "(method 17 traffic-manager)": [ + [38, "s1", "int"], + [[115, 123], "s1", "int"] + ], + "(method 50 traffic-engine)": [ + [6, "a1", "int"], + [14, "a1", "int"], + [22, "a1", "int"] + ], + "(code gun-shoot wlander-female)": [ + [27, "v1", "art-joint-anim"], + [79, "v1", "art-joint-anim"], + [497, "v1", "process-focusable"], + [510, "v1", "art-joint-anim"], + [563, "v1", "art-joint-anim"], + [147, "s5", "process-focusable"], + [150, "s5", "process-focusable"], + [194, "v1", "art-joint-anim"], + [246, "v1", "art-joint-anim"], + [306, "v1", "art-joint-anim"], + [362, "v1", "art-joint-anim"], + [427, "v1", "art-joint-anim"] + ], + "(code close-attack wlander-female)": [[123, "v1", "art-joint-anim"]], + "(code wait wlander-female)": [ + [16, "v1", "art-joint-anim"], + [67, "v1", "art-joint-anim"] + ], + "(method 86 wlander-female)": [ + [18, "v1", "art-joint-anim"], + [46, "v1", "art-joint-anim"] + ], + "(method 85 wlander-female)": [ + [18, "v1", "art-joint-anim"], + [46, "v1", "art-joint-anim"] + ], + "(code close-attack wlander-male)": [[123, "v1", "art-joint-anim"]], + "(code standing wlander-male)": [[22, "v1", "art-joint-anim"]], + "(code gun-shoot wlander-male)": [ + [24, "v1", "art-joint-anim"], + [442, "v1", "process-focusable"], + [455, "v1", "art-joint-anim"], + [508, "v1", "art-joint-anim"], + [92, "s5", "process-focusable"], + [95, "s5", "process-focusable"], + [139, "v1", "art-joint-anim"], + [191, "v1", "art-joint-anim"], + [251, "v1", "art-joint-anim"], + [307, "v1", "art-joint-anim"], + [372, "v1", "art-joint-anim"] + ], + "(method 85 wlander-male)": [ + [18, "v1", "art-joint-anim"], + [46, "v1", "art-joint-anim"] + ], + "(method 86 wlander-male)": [ + [18, "v1", "art-joint-anim"], + [46, "v1", "art-joint-anim"] + ], + "(trans gun-shoot wlander)": [ + [19, "gp", "process-focusable"], + [23, "gp", "process-focusable"], + [27, "gp", "process-focusable"], + [[57, 59], "gp", "process-focusable"], + [71, "gp", "process-focusable"], + [91, "gp", "process-focusable"], + [94, "gp", "process-focusable"] + ], + "(trans hostile wlander)": [[[30, 111], "gp", "process-focusable"]], + "(code wait waster-b)": [ + [101, "v1", "art-joint-anim"], + [150, "v1", "art-joint-anim"] + ], + "(exit get-up-back waster-b)": [ + [9, "v1", "collide-shape-prim-group"], + [[12, 24], "v1", "collide-shape-prim-group"] + ], + "(exit get-up-front waster-b)": [[[9, 24], "v1", "collide-shape-prim-group"]], + "(enter knocked waster-b)": [[[8, 22], "v1", "collide-shape-prim-group"]], + "(method 86 waster-b)": [[30, "v1", "art-joint-anim"]], + "(method 85 waster-b)": [ + [40, "a1", "art-joint-anim"], + [92, "a1", "art-joint-anim"], + [140, "s4", "art-joint-anim"], + [28, "a0", "civilian-global-info"], + [80, "a0", "civilian-global-info"] + ], + "(method 87 waster-b)": [[58, "v1", "art-joint-anim"]], + "(method 55 waster-b)": [[[27, 31], "a0", "process-focusable"]], + "(method 240 wlander)": [[4, "v1", "collide-shape-prim-group"]], + "(method 239 wlander)": [ + [23, "s4", "process-focusable"], + [42, "s4", "process-focusable"], + [59, "s4", "process-focusable"], + [67, "s4", "process-focusable"], + [85, "s4", "process-focusable"], + [69, "s4", "process-focusable"] + ], + "(method 82 wlander)": [ + [10, "a0", "float"], + [[8, 19], "v1", "handle"], + [[182, 186], "v1", "process-focusable"], + [[198, 211], "v1", "traffic-danger-info"] + ], + "(method 125 wlander)": [[[14, 51], "s5", "ragdoll-proc"]], + "(method 126 wlander)": [[[14, 24], "v1", "ragdoll-proc"]], + "(method 241 wlander)": [ + [43, "a1", "process-focusable"], + [47, "a1", "process-focusable"], + [51, "a1", "process-focusable"] + ], + "(method 13 flee-info)": [[79, "s4", "nav-branch"]], + "(enter wait-for-vehicle-return task-manager-desert-rescue)": [ + [[28, 33], "a0", "process-focusable"] + ], + "(code active wland-passenger)": [ + [112, "v1", "art-joint-anim"], + [171, "v1", "art-joint-anim"], + [22, "v1", "art-joint-anim"], + [40, "v1", "float"], + [80, "v1", "float"] + ], + "(trans race-home task-manager-desert-rescue)": [ + [58, "v1", "process-focusable"] + ], + "(code board-vehicle wland-passenger)": [ + [19, "v1", "art-joint-anim"], + [[58, 66], "s5", "vehicle"], + [[103, 112], "s5", "vehicle"], + [161, "v1", "art-joint-anim"], + [217, "s5", "vehicle"], + [236, "s5", "vehicle"], + [240, "s5", "vehicle"], + [[315, 336], "gp", "vehicle"], + [[349, 356], "a0", "vehicle"] + ], + "(trans board-vehicle wland-passenger)": [[[9, 15], "v1", "vehicle"]], + "(trans boarding wland-passenger)": [[56, "v0", "vehicle"]], + "(event ride wland-passenger)": [[[12, 15], "v1", "vehicle"]], + "(method 231 wland-passenger)": [ + [[10, 35], "s5", "vehicle"], + [[48, 54], "v1", "vehicle"] + ], + "(method 228 wland-passenger)": [[[11, 44], "s3", "vehicle"]], + "(code exit-vehicle wland-passenger)": [ + [[13, 19], "a0", "vehicle"], + [34, "v1", "art-joint-anim"], + [[61, 107], "gp", "vehicle"], + [[161, 182], "gp", "vehicle"], + [[211, 230], "s4", "vehicle"], + [266, "v1", "art-joint-anim"], + [345, "v1", "art-joint-anim"] + ], + "(trans exit-vehicle wland-passenger)": [[[9, 15], "v1", "vehicle"]], + "(enter entering-transport wland-passenger)": [[[39, 44], "a0", "vehicle"]], + "(method 227 wland-passenger)": [[11, "v0", "vehicle"]], + "update-nav-sphere": [ + [72, "f30", "float"], + [116, "f30", "float"] + ], + "(method 19 rope-joint-system)": [ + [23, "s4", "process-drawable"], + [37, "s4", "process-drawable"], + [51, "s4", "process-drawable"] + ], + "(method 19 rope-prim-system)": [ + ["_stack_", 132, "float"], + ["_stack_", 136, "float"] + ], + "(code turning-on neo-sat-shield)": [[10, "v1", "art-joint-anim"]], + "(code turning-off neo-sat-shield)": [[10, "v1", "art-joint-anim"]], + "(code hit neo-sat-shield)": [[10, "v1", "art-joint-anim"]], + "(method 25 neo-sat-shield)": [[13, "a0", "process-focusable"]], + "(code sat-idle neo-sat)": [[10, "v1", "art-joint-anim"]], + "(enter neo-sat-drill-prepare neo-sat)": [[27, "v1", "art-joint-anim"]], + "(enter neo-sat-drill-impact neo-sat)": [ + [213, "v1", "float"], + [231, "v1", "float"] + ], + "(method 211 neo-sat)": [ + [[369, 372], "v1", "process-focusable"], + [375, "v1", "collide-shape-moving"], + [18, "v1", "float"], + [107, "v1", "float"], + [162, "v1", "float"], + [212, "v1", "float"] + ], + "(code die neo-sat)": [ + [18, "v1", "art-joint-anim"], + [[255, 262], "gp", "handle"], + [78, "v1", "time-frame"] + ], + "(trans hostile neo-sat)": [[45, "v1", "float"]], + "(code active neo-sat-shield)": [[14, "v1", "art-joint-anim"]], + "(method 10 rope-neo-sat-whip)": [[[17, 30], "s5", "neo-sat"]], + "(method 82 neo-sat)": [[[58, 62], "v1", "process"]], + "(method 59 neo-sat)": [[[133, 137], "a0", "process-focusable"]], + "(method 203 neo-sat)": [[[28, 33], "a1", "process-focusable"]], + "(method 209 neo-sat)": [ + [55, "v1", "float"], + [94, "v1", "float"], + [117, "v1", "float"], + [138, "v1", "float"] + ], + "(method 210 neo-sat)": [[143, "v1", "process-focusable"]], + "(method 62 neo-sat)": [[14, "a0", "attack-info"]], + "(method 206 neo-sat)": [[128, "v1", "collide-shape-prim-sphere"]], + "(method 227 neo-sat)": [ + [91, "v1", "collide-shape-prim-sphere"], + [106, "v1", "collide-shape-moving"] + ], + "(trans neo-sat-laser-attack neo-sat)": [[54, "v1", "float"]], + "sparticle-height-set": [[[17, 33], "a0", "neo-sat"]], + "sparticle-shockwave-set": [[[17, 30], "a0", "neo-sat"]], + "(method 10 rope-joint-system)": [[28, "v1", "process-drawable"]], + "(method 9 rope-system)": [ + [62, "a0", "vector"], + [51, "a0", "vector"] + ], + "(method 20 rope-system)": [ + [11, "a1", "vector"], + [16, "a1", "vector"] + ], + "(code preparing-for-launch desert-rescue-transport)": [ + [10, "v1", "art-joint-anim"] + ], + "(code waiting-for-passenger desert-rescue-transport)": [ + [14, "v1", "art-joint-anim"] + ], + "(method 45 task-manager-desert-rescue)": [ + [[40, 48], "a0", "process-focusable"] + ], + "(method 48 task-manager-desert-rescue)": [[20, "f30", "float"]], + "(trans fight task-manager-desert-rescue)": [[67, "v1", "process-focusable"]], + "(trans pickup-passenger task-manager-desert-rescue)": [ + [[18, 27], "gp", "wland-passenger"], + [[84, 89], "a0", "process-focusable"], + [212, "v1", "process-focusable"] + ], + "(trans drop-off-passenger task-manager-desert-rescue)": [ + [67, "v1", "process-focusable"] + ], + "(trans play-dead-wlander-movie task-manager-desert-rescue)": [ + [[17, 25], "v1", "wland-passenger"] + ], + "(event play-dead-wlander-movie task-manager-desert-rescue)": [ + [[12, 19], "v1", "wland-passenger"] + ], + "(trans active task-manager-desert-rescue)": [[264, "a0", "vehicle"]], + "(method 43 task-manager-desert-rescue)": [[25, "v0", "handle"]], + "(method 43 desert-rescue-transport)": [ + [[63, 70], "v1", "tread-trail-tracker"], + [77, "v1", "tread-trail-tracker"], + [[107, 114], "v1", "tread-trail-tracker"], + [121, "v1", "tread-trail-tracker"] + ], + "(method 37 desert-rescue-transport)": [[23, "s4", "float"]], + "(trans active task-manager-desert-rescue-bbush)": [[66, "a0", "vehicle"]], + "(method 34 vehicle-rider)": [[[10, 33], "s5", "vehicle"]], + "(code get-up-front crimson-guard)": [[20, "v1", "art-joint-anim"]], + "(code get-up-back crimson-guard)": [[20, "v1", "art-joint-anim"]], + "(code close-attack-active crimson-guard)": [ + [15, "v1", "art-joint-anim"], + [48, "v1", "collide-shape-prim-group"] + ], + "(exit close-attack-active crimson-guard)": [ + [2, "v1", "collide-shape-prim-group"] + ], + "(code close-attack crimson-guard)": [ + [15, "v1", "art-joint-anim"], + [48, "v1", "collide-shape-prim-group"] + ], + "(exit close-attack crimson-guard)": [[2, "v1", "collide-shape-prim-group"]], + "(code roll-right crimson-guard)": [ + [[87, 98], "a0", "process-focusable"], + [[174, 185], "a0", "process-focusable"] + ], + "(code roll-left crimson-guard)": [ + [[87, 98], "a0", "process-focusable"], + [[174, 185], "a0", "process-focusable"] + ], + "(code arrest crimson-guard)": [ + [22, "v1", "art-joint-anim"], + [164, "v1", "art-joint-anim"], + [99, "v1", "art-joint-anim"] + ], + "(code waiting-ambush crimson-guard)": [ + [22, "v1", "art-joint-anim"], + [139, "v1", "art-joint-anim"], + [71, "v1", "art-joint-anim"] + ], + "orient-towards-code": [ + [35, "v1", "art-joint-anim"], + [103, "v1", "art-joint-anim"] + ], + "(code rifle-reload crimson-guard)": [ + [14, "v1", "art-joint-anim"], + [115, "a0", "process-focusable"], + [164, "v1", "art-joint-anim"], + [33, "v1", "float"], + [74, "v1", "float"] + ], + "(code gun-shoot crimson-guard)": [ + [28, "v1", "art-joint-anim"], + [166, "v1", "process-focusable"], + [276, "a0", "process-focusable"], + [314, "v1", "art-joint-anim"] + ], + "(trans gun-shoot crimson-guard)": [[[12, 55], "gp", "process-focusable"]], + "(trans rifle-hostile crimson-guard)": [[22, "v1", "process-focusable"]], + "(method 114 crimson-guard)": [[[2, 40], "s4", "touching-shapes-entry"]], + "(method 82 crimson-guard)": [ + [[203, 213], "s5", "traffic-danger-info"], + [238, "s5", "traffic-danger-info"], + [296, "s5", "traffic-danger-info"], + [[310, 322], "v1", "traffic-danger-info"], + [[471, 475], "v1", "process-focusable"] + ], + "(method 86 crimson-guard)": [ + [23, "a1", "art-joint-anim"], + [77, "a1", "art-joint-anim"], + [109, "a1", "art-joint-anim"], + [141, "v1", "art-joint-anim"], + [183, "a1", "art-joint-anim"], + [67, "v1", "guard-global-info"] + ], + "(code attack crimson-guard)": [[146, "a0", "process-focusable"]], + "(trans attack crimson-guard)": [ + [38, "v1", "process-focusable"], + [43, "v1", "process-focusable"], + [83, "a0", "process-focusable"] + ], + "(code attack-tazer crimson-guard)": [ + [14, "v1", "art-joint-anim"], + [67, "v1", "collide-shape-prim-group"], + [158, "v1", "collide-shape-prim-group"], + [195, "v1", "art-joint-anim"] + ], + "(trans attack-tazer crimson-guard)": [[[38, 44], "v1", "process-focusable"]], + "(enter grenade-hostile crimson-guard)": [[16, "v1", "float"]], + "(code grenade-throw-post-reloading crimson-guard)": [ + [14, "v1", "art-joint-anim"], + [123, "v1", "art-joint-anim"] + ], + "(method 24 reload-grenade)": [[[10, 26], "s5", "process-focusable"]], + "(method 264 crimson-guard)": [[[67, 73], "a0", "process-focusable"]], + "(method 194 crimson-guard)": [[80, "v1", "float"]], + "(method 46 ff-squad-control)": [ + [278, "t2", "ff-squad-control"], + [[158, 227], "s0", "crimson-guard"], + [221, "a0", "ff-squad-control"], + [[60, 109], "a3", "vehicle"], + [[285, 289], "t2", "traffic-guard-type-array"], + [297, "t2", "traffic-guard-type-array"], + [18, "a1", "ff-squad-control"], + [229, "v1", "ff-squad-control"], + [319, "a1", "ff-squad-control"] + ], + "(method 252 crimson-guard)": [ + [74, "s5", "process-focusable"], + [69, "s5", "process-focusable"], + [126, "s5", "process-focusable"], + [146, "s5", "process-focusable"], + [202, "s5", "process-focusable"], + [205, "s5", "process-focusable"] + ], + "(method 51 ff-squad-control)": [ + [13, "v1", "connection"], + [14, "v1", "collide-shape"], + [18, "v1", "collide-shape"], + [27, "s2", "process-focusable"], + [36, "s2", "process-focusable"], + [50, "s3", "connection"], + [67, "v1", "connection"], + [68, "v1", "collide-shape"], + [72, "v1", "collide-shape"], + [81, "s2", "process-focusable"], + [119, "v1", "connection"], + [120, "v1", "collide-shape"], + [124, "v1", "collide-shape"], + [133, "s2", "process-focusable"] + ], + "(method 39 ff-squad-control)": [[[7, 12], "gp", "crimson-guard"]], + "(method 43 ff-squad-control)": [[8, "gp", "crimson-guard"]], + "(method 16 ff-squad-control)": [ + ["_stack_", 176, "(array crimson-guard)"], + ["_stack_", 180, "(array float)"], + [[49, 82], "s2", "crimson-guard"] + ], + "(method 282 crimson-guard)": [ + ["_stack_", 24, "float"], + ["_stack_", 32, "float"], + [28, "v1", "float"] + ], + "(method 12 ff-squad-control)": [ + [28, "a1", "traffic-guard-type-array"], + [30, "a1", "traffic-guard-type-array"] + ], + "(method 55 ff-squad-control)": [[5, "v1", "ff-squad-control"]], + "(method 45 ff-squad-control)": [ + [130, "t0", "ff-squad-control"], + [[37, 92], "a2", "squad-alert-state-settings"], + [[44, 104], "a1", "traffic-guard-type-array"] + ], + "(code knocked-recover crimson-guard)": [[23, "a1", "art-joint-anim"]], + "(method 289 crimson-guard)": [[21, "v1", "float"]], + "(method 258 crimson-guard)": [[152, "v1", "collide-shape-prim"]], + "(method 212 crimson-guard)": [[[246, 249], "v1", "vehicle"]], + "(method 265 crimson-guard)": [ + [22, "s4", "process-focusable"], + [52, "s4", "process-focusable"] + ], + "(method 261 crimson-guard)": [[177, "v1", "process-focusable"]], + "(code impact vehicle-grenade)": [[33, "a0", "process"]], + "(post moving vehicle-grenade-deflect)": [[19, "t9", "(function none)"]], + "(code moving vehicle-grenade-deflect)": [[4, "t9", "(function none)"]], + "(method 35 vehicle-grenade-deflect)": [ + [[53, 58], "a0", "process-focusable"], + [102, "v1", "target"] + ], + "(method 38 guard-lazer-shot)": [[[28, 37], "a0", "process-focusable"]], + "(code sitting vehicle-grenade)": [[27, "a0", "float"]], + "(code wait citizen-fat)": [ + [101, "v1", "art-joint-anim"], + [150, "v1", "art-joint-anim"] + ], + "(exit get-up-back citizen-fat)": [ + [[9, 24], "v1", "collide-shape-prim-group"] + ], + "(exit get-up-front citizen-fat)": [ + [[9, 24], "v1", "collide-shape-prim-group"] + ], + "(enter knocked citizen-fat)": [[[8, 22], "v1", "collide-shape-prim-group"]], + "(method 86 citizen-fat)": [[30, "v1", "art-joint-anim"]], + "(method 85 citizen-fat)": [ + [40, "a1", "art-joint-anim"], + [92, "a1", "art-joint-anim"], + [140, "s4", "art-joint-anim"], + [28, "a0", "civilian-global-info"], + [80, "a0", "civilian-global-info"] + ], + "(method 87 citizen-fat)": [[58, "v1", "art-joint-anim"]], + "(method 55 citizen-fat)": [[[24, 31], "a0", "process-focusable"]], + "(code wait citizen-norm)": [ + [101, "v1", "art-joint-anim"], + [150, "v1", "art-joint-anim"] + ], + "(method 212 citizen-norm)": [[[36, 39], "v1", "vehicle"]], + "(exit get-up-back citizen-norm)": [ + [[9, 24], "v1", "collide-shape-prim-group"] + ], + "(exit get-up-front citizen-norm)": [ + [[9, 24], "v1", "collide-shape-prim-group"] + ], + "(enter knocked citizen-norm)": [[[8, 22], "v1", "collide-shape-prim-group"]], + "(method 86 citizen-norm)": [[33, "v1", "art-joint-anim"]], + "(method 85 citizen-norm)": [ + [19, "v1", "art-joint-anim"], + [58, "v1", "art-joint-anim"], + [118, "a1", "art-joint-anim"], + [170, "a1", "art-joint-anim"], + [233, "s4", "art-joint-anim"], + [106, "a0", "civilian-global-info"], + [158, "a0", "civilian-global-info"] + ], + "(method 87 citizen-norm)": [[58, "v1", "art-joint-anim"]], + "(method 55 citizen-norm)": [[[32, 39], "a0", "process-focusable"]], + "(code wait citizen-chick)": [[22, "v1", "art-joint-anim"]], + "(exit get-up-back citizen-chick)": [ + [[9, 24], "v1", "collide-shape-prim-group"] + ], + "(exit get-up-front citizen-chick)": [ + [[9, 24], "v1", "collide-shape-prim-group"] + ], + "(enter knocked citizen-chick)": [ + [[8, 22], "v1", "collide-shape-prim-group"] + ], + "(method 86 citizen-chick)": [[30, "v1", "art-joint-anim"]], + "(method 87 citizen-chick)": [[58, "v1", "art-joint-anim"]], + "(method 55 citizen-chick)": [[[24, 31], "a0", "process-focusable"]], + "(method 85 citizen-chick)": [ + [40, "a1", "art-joint-anim"], + [92, "a1", "art-joint-anim"], + [140, "s4", "art-joint-anim"], + [28, "a0", "civilian-global-info"], + [80, "a0", "civilian-global-info"] + ], + "(code active citizen-enemy)": [[30, "v1", "art-joint-anim"]], + "(method 217 citizen-enemy)": [ + [46, "s1", "process-focusable"], + [50, "s1", "process-focusable"], + [72, "s1", "process-focusable"] + ], + "(method 84 citizen-enemy)": [[45, "v1", "process-focusable"]], + "(trans active mh-squad-member)": [ + [29, "v1", "process-focusable"], + [34, "v1", "process-focusable"] + ], + "(method 217 mh-squad-member)": [[71, "a0", "process-focusable"]], + "(method 84 mh-squad-member)": [[40, "v1", "process-focusable"]], + "(method 84 kg-squad-member)": [[40, "v1", "process-focusable"]], + "(code circling metalhead-flitter)": [[27, "v1", "art-joint-anim"]], + "(trans circling metalhead-flitter)": [[[10, 15], "gp", "process-focusable"]], + "(code stare metalhead-flitter)": [[126, "v1", "art-joint-anim"]], + "(code attack metalhead-flitter)": [ + [35, "v1", "art-joint-anim"], + [161, "v1", "art-joint-anim"] + ], + "(trans attack metalhead-flitter)": [[[16, 57], "gp", "process-focusable"]], + "(post stare metalhead-flitter)": [[9, "t9", "(function none)"]], + "(post active metalhead-flitter)": [[9, "t9", "(function none)"]], + "(method 224 metalhead-flitter)": [[[17, 56], "s3", "process-focusable"]], + "(code ambush-jumping metalhead-flitter)": [ + [14, "v1", "art-joint-anim"], + [251, "v1", "art-joint-anim"] + ], + "(enter ambush metalhead-flitter)": [[[44, 54], "a0", "process-focusable"]], + "(method 86 metalhead-flitter)": [[15, "a1", "art-joint-anim"]], + "(method 85 metalhead-flitter)": [ + [14, "v1", "art-joint-anim"], + [69, "v1", "art-joint-anim"] + ], + "(method 227 metalhead-flitter)": [[4, "v1", "collide-shape-prim-group"]], + "(method 51 kg-squad-control)": [ + [[37, 52], "a2", "kg-squad-settings"], + [[86, 94], "t0", "kg-squad-settings"], + [[114, 124], "t0", "kg-squad-member"] + ], + "(method 52 kg-squad-control)": [[[25, 33], "a3", "kg-squad-member"]], + "(method 38 kg-squad-control)": [[[0, 5], "a1", "kg-squad-member"]], + "(method 43 kg-squad-control)": [[[3, 6], "v1", "kg-squad-member"]], + "(method 39 kg-squad-control)": [[[0, 5], "a1", "kg-squad-member"]], + "(method 39 mh-squad-control)": [[[0, 5], "a1", "mh-squad-member"]], + "(method 48 mh-squad-control)": [[[10, 18], "a3", "mh-squad-settings"]], + "(code knocked-recover metalhead-grunt)": [ + [[13, 16], "v1", "ragdoll-proc"], + [40, "v1", "art-joint-anim"], + [69, "v1", "art-joint-anim"] + ], + "(trans wait-for-focus metalhead-grunt)": [ + [[10, 41], "s5", "process-focusable"] + ], + "(code stop-chase metalhead-grunt)": [[77, "gp", "art-joint-anim"]], + "(code spin-attack metalhead-grunt)": [ + [45, "gp", "art-joint-anim"], + [[69, 77], "a0", "process-focusable"] + ], + "(enter spin-attack metalhead-grunt)": [ + [[34, 48], "gp", "process-focusable"] + ], + "(code attack metalhead-grunt)": [ + [55, "gp", "art-joint-anim"], + [[150, 156], "a0", "mh-grunt-anim-info"] + ], + "(code hostile metalhead-grunt)": [[38, "gp", "art-joint-anim"]], + "(code active metalhead-grunt)": [ + [203, "gp", "art-joint-anim"], + [247, "gp", "art-joint-anim"], + [330, "v1", "art-joint-anim"], + [390, "v1", "art-joint-anim"], + [119, "gp", "art-joint-anim"] + ], + "(code falling-ambush metalhead-grunt)": [[18, "v1", "art-joint-anim"]], + "(method 85 metalhead-predator)": [ + [22, "v1", "art-joint-anim"], + [54, "v1", "art-joint-anim"], + [97, "v1", "art-joint-anim"], + [127, "v1", "art-joint-anim"], + [161, "v1", "art-joint-anim"], + [193, "v1", "art-joint-anim"] + ], + "(code close-attack metalhead-predator)": [ + [15, "v1", "art-joint-anim"], + [93, "v1", "art-joint-anim"] + ], + "(code hostile metalhead-predator)": [ + [14, "v1", "art-joint-anim"], + [67, "v1", "art-joint-anim"] + ], + "(trans hostile metalhead-predator)": [[[16, 59], "gp", "process-focusable"]], + "(trans fire metalhead-predator)": [[[10, 26], "v1", "process-focusable"]], + "(code fire metalhead-predator)": [ + [26, "v1", "art-joint-anim"], + [[95, 125], "s5", "process-focusable"] + ], + "(method 224 metalhead-predator)": [ + [[4, 20], "v1", "collide-shape-prim-group"] + ], + "(method 59 metalhead-predator)": [[[14, 33], "s5", "process-focusable"]], + "(method 86 metalhead-predator)": [ + [22, "v1", "art-joint-anim"], + [54, "v1", "art-joint-anim"], + [90, "v1", "art-joint-anim"], + [124, "v1", "art-joint-anim"], + [156, "v1", "art-joint-anim"] + ], + "(method 225 metalhead-predator)": [[[65, 211], "s3", "process-focusable"]], + "(code close-attack roboguard-city)": [ + [30, "v1", "art-joint-anim"], + [58, "v1", "art-joint-anim"], + [144, "a0", "collide-shape-prim-group"], + [168, "v1", "art-joint-anim"], + [196, "v1", "art-joint-anim"], + [252, "v1", "collide-shape-prim-group"], + [269, "v1", "art-joint-anim"], + [297, "v1", "art-joint-anim"], + [[353, 358], "v1", "collide-shape-prim-group"] + ], + "(trans close-attack roboguard-city)": [ + [4, "v1", "collide-shape-prim-group"], + [54, "s3", "process-focusable"], + [[66, 71], "s3", "process-focusable"] + ], + "(code roll-exit roboguard-city)": [[25, "v1", "art-joint-anim"]], + "(code roll-enter roboguard-city)": [[14, "v1", "art-joint-anim"]], + "(trans dizzy roboguard-city)": [ + [52, "v1", "float"], + [80, "v1", "float"], + [108, "v1", "float"], + [136, "v1", "float"], + [164, "v1", "float"], + [192, "v1", "float"], + [220, "v1", "float"], + [248, "v1", "float"] + ], + "roboguard-city-turret-code": [ + [75, "a1", "art-joint-anim"], + [168, "a1", "art-joint-anim"] + ], + "(code dizzy roboguard-city)": [[14, "v1", "art-joint-anim"]], + "(method 238 roboguard-city)": [[40, "v1", "float"]], + "(method 236 roboguard-city)": [[144, "v1", "float"]], + "(method 86 roboguard-city)": [ + [33, "a2", "art-joint-anim"], + [62, "a2", "art-joint-anim"] + ], + "(method 85 roboguard-city)": [ + [39, "v1", "art-joint-anim"], + [67, "v1", "art-joint-anim"] + ], + "(method 59 roboguard-city)": [[[16, 35], "s5", "process-focusable"]], + "(method 194 roboguard-city)": [ + [27, "v1", "float"], + [53, "v1", "float"], + [244, "v1", "float"] + ], + "(method 237 roboguard-city)": [[112, "a0", "process-focusable"]], + "(anon-function 13 roboguard-city)": [[[2, 76], "s3", "roboguard-city"]], + "(code exit-transport spydroid)": [[14, "v1", "art-joint-anim"]], + "(method 236 spydroid)": [[71, "a0", "process-focusable"]], + "(enter hunting spydroid)": [[5, "t9", "(function none)"]], + "(method 194 spydroid)": [[48, "v1", "float"]], + "(code spydroid-notice spydroid)": [[14, "v1", "art-joint-anim"]], + "(code scan spydroid)": [[14, "v1", "art-joint-anim"]], + "(trans spydroid-notice spydroid)": [[[53, 60], "a0", "process-focusable"]], + "(code flip spydroid)": [[[18, 26], "a0", "process-focusable"]], + "(code wait-for-vulnerable-close)": [[28, "v1", "art-joint-anim"]], + "(method 233 spydroid)": [ + [26, "s4", "process-focusable"], + [52, "s4", "process-focusable"] + ], + "(method 82 spydroid)": [[4, "v1", "enemy-jump-info"]], + "(trans hostile spydroid)": [[[10, 23], "gp", "process-focusable"]], + "(code wait-for-vulnerable spydroid)": [[14, "v1", "art-joint-anim"]], + "(trans wait-for-vulnerable spydroid)": [ + [[10, 66], "gp", "process-focusable"] + ], + "(trans wait-for-vulnerable-close)": [[[10, 66], "gp", "process-focusable"]], + "(code attack spydroid)": [ + [[16, 24], "a0", "process-focusable"], + [51, "v1", "art-joint-anim"], + [157, "v1", "art-joint-anim"] + ], + "(event active spydroid)": [[[3, 13], "gp", "traffic-danger-info"]], + "(event search spydroid)": [[[3, 13], "gp", "traffic-danger-info"]], + "(method 232 spydroid)": [[[40, 47], "a0", "process-focusable"]], + "(code fire flying-turret)": [[21, "v1", "art-joint-anim"]], + "(method 194 flying-turret)": [ + [26, "v1", "float"], + [137, "v1", "float"] + ], + "(method 228 flying-turret)": [[99, "v1", "float"]], + "(method 227 flying-turret)": [ + [165, "v1", "float"], + [213, "v1", "float"] + ], + "(method 226 flying-turret)": [[90, "a0", "process-focusable"]], + "(method 140 flying-turret)": [[[29, 35], "a0", "process-focusable"]], + "(trans hostile flying-turret)": [[323, "v1", "process-focusable"]], + "flying-turret-gun-aim-func": [[[2, 46], "s4", "flying-turret"]], + "(method 14 billiard-table)": [[129, "a1", "billiard-table"]], + "(method 13 billiard-table)": [ + [18, "v1", "float"], + [34, "v1", "float"], + [50, "v1", "float"] + ], + "compute-suck-speed-scalar": [[1, "v1", "float"]], + "(method 30 h-kg-pickup)": [[[181, 207], "s4", "dark-barrel"]], + "(code resolution task-manager-bbush-board)": [[40, "gp", "handle"]], + "(code active task-manager-bbush-board)": [ + [47, "gp", "handle"], + [96, "gp", "handle"] + ], + "(method 11 flitter-spawner)": [ + [24, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "(method 21 task-manager-desert-rescue-bbush)": [["_stack_", 16, "res-tag"]], + "(trans active flitter-spawner)": [ + [[195, 217], "s5", "process-focusable"], + [33, "v1", "process-focusable"] + ], + "(event idle ctyn-lamp)": [[13, "s5", "joint-exploder"]], + "(method 32 propa)": [ + [38, "s1", "process-focusable"], + [42, "s1", "process-focusable"], + [46, "s1", "process-focusable"] + ], + "(post idle propa)": [ + [193, "a0", "process-focusable"], + [92, "v0", "sound-rpc-set-param"] + ], + "(event idle propa)": [ + [[12, 15], "v1", "attack-info"], + [[62, 65], "a0", "collide-shape-prim-group"] + ], + "(method 21 parking-spot)": [[[10, 158], "s5", "vehicle"]], + "(method 23 parking-spot)": [[[66, 69], "v1", "vehicle"]], + "parking-spot-spawn": [[[11, 15], "v0", "vehicle"]], + "(event idle-close security-wall)": [ + [[23, 28], "v1", "attack-info"], + [56, "s3", "process-drawable"], + [133, "v1", "process-drawable"], + [149, "v1", "process-drawable"], + [156, "v1", "process-drawable"], + [159, "a0", "process-drawable"], + [173, "v1", "process-drawable"], + [180, "v1", "process-drawable"], + [183, "a0", "process-drawable"], + [196, "v1", "process-drawable"], + [199, "a0", "process-drawable"], + [281, "v1", "process-drawable"], + [291, "a0", "collide-shape"], + [[204, 208], "a2", "float"] + ], + "(method 33 task-manager-bbush-board)": [[55, "v1", "hud"]], + "(code active task-manager-city-vehicle-training-hover-zone-2)": [ + [[24, 28], "v1", "vehicle"], + [103, "v1", "vehicle"] + ], + "(code complete task-manager-city-vehicle-training-hover-zone-1)": [ + [10, "t9", "(function none)"] + ], + "(code fail task-manager-city-vehicle-training-hover-zone-1)": [ + [12, "t9", "(function none)"] + ], + "(code active task-manager-city-vehicle-training-hover-zone-1)": [ + [137, "v1", "vehicle"], + [201, "t9", "(function none)"] + ], + "(event active task-manager-bbush-board)": [[4, "v1", "float"]], + "(code idle farthy)": [[10, "v1", "art-joint-anim"]], + "ctyport-sparticle-mode-animate": [ + [5, "v1", "(array symbol)"], + [11, "a1", "(array int32)"], + [18, "a1", "(array int32)"], + [21, "a1", "(array int32)"], + [27, "a0", "(array int32)"], + [28, "v1", "(array int32)"], + [44, "v1", "(pointer int32)"], + [46, "v1", "(pointer int32)"], + [16, "a1", "(pointer uint32)"], + [32, "a2", "int"], + [33, "a1", "(pointer uint64)"] + ], + "(method 30 boat-base)": [ + [280, "v1", "boat-manager"], + [330, "v1", "boat-manager"] + ], + "(method 35 htorpedo)": [[[96, 107], "s3", "particle-local-space-info"]], + "(method 17 light-trail-tracker-torpedo)": [[1, "v1", "htorpedo"]], + "(event player-control htorpedo)": [[5, "v1", "float"]], + "(event waiting htorpedo)": [[5, "v1", "float"]], + "(method 15 ctyport-attack-hud)": [[137, "v1", "float"]], + "(enter start-mission ctyport-attack-manager)": [[77, "v1", "float"]], + "(trans get-on-nuke ctyport-attack-manager)": [ + [[133, 138], "a0", "process-focusable"] + ], + "(method 49 ctyport-attack-manager)": [[[52, 68], "s4", "process-focusable"]], + "(anon-function 45 ctyport-attack)": [ + [13, "a0", "ctyport-attack-manager"], + [16, "a0", "ctyport-attack-manager"] + ], + "(method 44 ctyport-attack-manager)": [ + [137, "v1", "float"], + [163, "v1", "float"] + ], + "(method 51 ctyport-attack-manager)": [[31, "v0", "entity-actor"]], + "(event menacing ctyport-mine)": [[14, "v1", "vector"]], + "(event idle ctyport-mine)": [[22, "v1", "vector"]], + "(event hidden ctyport-mine)": [[6, "v1", "vector"]], + "ctyport-mine-init-by-other": [ + [118, "v1", "float"], + [141, "v1", "float"], + [167, "v1", "float"], + [193, "v1", "float"] + ], + "(method 47 ctyport-attack-manager)": [[39, "a1", "process-focusable"]], + "(trans head-to-wall ctyport-attack-manager)": [ + [45, "v1", "process-focusable"] + ], + "(trans pickup-nukes ctyport-attack-manager)": [ + [175, "v1", "process-focusable"] + ], + "(code explode krimson-wall-break)": [[18, "v0", "art-joint-anim"]], + "update-mood-ctygenb": [[[61, 97], "gp", "ctygenb-states"]], + "update-mood-ctyslumc": [[[30, 62], "s5", "ctyslumc-states"]], + "update-mood-ctyslumb": [[[30, 62], "s5", "ctyslumb-states"]], + "update-mood-mountain": [[[50, 83], "gp", "mountain-states"]], + "update-mood-atoll": [[[30, 48], "s4", "atoll-states"]], + "(code die v-catapult)": [[13, "t9", "(function none)"]], + "(post hostile v-catapult)": [[4, "t9", "(function none)"]], + "(code active catapult-shot-sphere)": [ + [14, "v1", "art-joint-anim"], + [66, "v1", "art-joint-anim"] + ], + "(method 90 v-catapult)": [ + [54, "v1", "art-joint-anim"], + [143, "v1", "art-joint-anim"] + ], + "(method 62 v-catapult)": [[[4, 41], "s5", "collide-shape-prim-group"]], + "(method 49 v-catapult)": [ + [[4, 16], "a0", "vector"], + [[5, 19], "v1", "process"] + ], + "(code explode wascity-airlock-debris)": [ + [3, "v0", "entity-actor"], + [7, "v0", "entity-actor"] + ], + "(method 26 desert-jump-manager)": [ + [[374, 379], "s4", "process-focusable"], + [405, "s4", "process-focusable"], + [531, "s4", "process-focusable"], + [[80, 318], "s3", "process-focusable"], + [518, "v1", "float"], + [631, "v1", "float"], + [458, "v1", "float"], + [167, "v1", "float"] + ], + "(code active desert-jump-manager)": [ + [443, "a0", "process-focusable"], + [83, "v0", "entity-actor"], + [518, "v1", "float"], + [63, "v1", "float"], + [183, "a0", "int"], + [236, "a0", "int"] + ], + "(method 30 desert-jump-manager)": [[[16, 21], "v1", "projectile"]], + "(method 32 desert-jump-manager)": [ + [122, "s2", "wvehicle"], + [225, "v1", "float"], + [240, "v1", "float"] + ], + "(method 22 beam-generator)": [[[26, 30], "a1", "process-focusable"]], + "(method 21 deschase-artifact)": [[[26, 30], "a1", "process-focusable"]], + "(method 35 player-controller)": [[12, "v1", "vector"]], + "(code active desert-chase-ambush-manager)": [[136, "a2", "float"]], + "(method 34 desert-chase-ambush-manager)": [[72, "v1", "handle"]], + "(method 32 desert-chase-ambush-manager)": [[[90, 137], "s2", "marauder"]], + "(method 10 deschase-vehicle-control)": [ + [[17, 26], "v1", "process-focusable"] + ], + "(method 12 deschase-vehicle-control)": [ + [[16, 32], "gp", "process-focusable"], + [46, "v0", "(array collide-shape)"] + ], + "(method 26 desert-chase-chase-manager)": [ + [[19, 24], "a0", "process-focusable"], + [66, "a0", "process-focusable"] + ], + "(method 33 desert-chase-chase-manager)": [[28, "a0", "process-focusable"]], + "(code complete desert-chase-chase-manager)": [[14, "t9", "(function none)"]], + "desert-chase-ambush-intro-sequence": [ + [325, "v1", "float"], + [404, "a2", "float"] + ], + "(code active desert-chase-chase-manager)": [ + [[399, 420], "s5", "process-focusable"], + [529, "s5", "process-focusable"], + [538, "s5", "process-focusable"], + [358, "s3", "process-focusable"], + [360, "v1", "process-focusable"] + ], + "catapult-target-handler": [[4, "v1", "vector"]], + "(event back bombbot-bomb)": [[[13, 53], "s3", "process-focusable"]], + "(enter explode bombbot-bomb)": [[59, "a0", "process"]], + "(method 26 task-manager-port-fight)": [[[315, 343], "s2", "bombbot"]], + "(code hostile bombbot-player)": [[38, "v1", "art-joint-anim"]], + "(method 196 bombbot-player)": [[[214, 218], "a0", "process-focusable"]], + "(trans hostile bomb-bot)": [[[34, 61], "gp", "process-focusable"]], + "(method 196 bomb-bot)": [ + [[1, 119], "gp", "process-focusable"], + [[30, 68], "s2", "process-focusable"] + ], + "(method 84 bombbot)": [[27, "v1", "process-focusable"]], + "bombbot-gun-callback": [[[6, 76], "s4", "bombbot"]], + "bombbot-gun-swivel-callback": [[[4, 87], "s3", "bombbot"]], + "bombbot-head-callback": [[[2, 56], "s4", "bombbot"]], + "bombbot-callback": [[[2, 190], "s4", "bombbot"]], + "(enter explode bombbot)": [[110, "a0", "process"]], + "(code die bombbot)": [[11, "v1", "art-joint-anim"]], + "(code blow-wall bombbot)": [[10, "v1", "art-joint-anim"]], + "(code drop-bombs bombbot)": [[10, "v1", "art-joint-anim"]], + "(code hostile bombbot)": [[10, "v1", "art-joint-anim"]], + "(trans hostile bombbot)": [[[45, 94], "v1", "process-focusable"]], + "(enter hostile bombbot)": [[15, "v1", "collide-shape-prim-group"]], + "(method 200 bombbot)": [[4, "v1", "collide-shape-prim-group"]], + "(method 194 bombbot)": [ + ["_stack_", 896, "float"], + ["_stack_", 912, "float"] + ], + "(method 196 bombbot)": [ + [[68, 76], "s1", "process-focusable"], + [110, "gp", "process-focusable"] + ], + "(method 51 ctyport-attack-manager-bbush)": [[12, "v0", "entity-actor"]], + "(code wait ctyport-attack-manager-bbush)": [ + [136, "v0", "entity-actor"], + [[141, 144], "a0", "process-focusable"] + ], + "(method 46 cty-hijack-missile)": [[[17, 24], "a0", "process-focusable"]], + "(trans chasing-2 cty-hijack-missile)": [[75, "v1", "process-focusable"]], + "(trans fake-chase cty-hijack-missile)": [ + [342, "v1", "process-focusable"], + [74, "v1", "float"], + [94, "v1", "float"], + [117, "v1", "float"], + [137, "v1", "float"], + [157, "v1", "float"] + ], + "(method 53 cty-hijack-missile)": [[13, "v1", "float"]], + "(method 51 cty-hijack-missile)": [ + [[17, 196], "s5", "process-focusable"], + [[461, 467], "v1", "vehicle"], + [[588, 594], "v1", "vehicle"], + [263, "v1", "float"], + [286, "v1", "float"], + [309, "v1", "float"], + [329, "v1", "float"], + [349, "v1", "float"], + [371, "v1", "float"], + [394, "v1", "float"], + [414, "v1", "float"], + [434, "v1", "float"], + ["_stack_", 72, "float"], + ["_stack_", 80, "float"] + ], + "(method 48 cty-hijack-missile)": [[[17, 25], "v1", "h-kg-pickup"]], + "(method 47 cty-hijack-missile)": [[[19, 86], "s2", "h-kg-pickup"]], + "(method 50 cty-hijack-missile)": [ + [[74, 79], "a0", "process-focusable"], + [176, "v1", "process-focusable"], + [228, "v1", "process-focusable"] + ], + "(method 11 hijack-missile-bobber)": [ + [20, "v1", "float"], + [59, "v1", "float"] + ], + "(method 36 cty-missile-lure)": [ + [16, "v1", "connection"], + [17, "v1", "collide-shape"], + [21, "v1", "collide-shape"], + [60, "v1", "connection"], + [61, "v1", "collide-shape"], + [65, "v1", "collide-shape"], + [103, "v1", "connection"], + [104, "v1", "collide-shape"], + [108, "v1", "collide-shape"] + ], + "(code opening cty-missile-lure)": [[25, "v1", "art-joint-anim"]], + "(code closing cty-missile-lure)": [[19, "v1", "art-joint-anim"]], + "(code active cty-missile-lure)": [[10, "v1", "art-joint-anim"]], + "(trans active cty-hijack-manager)": [ + [[18, 45], "gp", "process-focusable"], + [104, "v1", "process-focusable"], + [[136, 151], "gp", "process-focusable"], + [169, "gp", "process-focusable"] + ], + "(trans decoy-stage cty-hijack-manager)": [ + [29, "v1", "process-focusable"], + [450, "v1", "process-focusable"] + ], + "(code show-missile-launch cty-hijack-manager)": [ + [78, "a0", "process-focusable"] + ], + "(enter player-riding cty-hijack-manager)": [ + [[42, 45], "a0", "boat-manager"] + ], + "(code recoil cty-missile-launcher)": [[14, "v1", "art-joint-anim"]], + "(trans player-riding cty-hijack-manager)": [ + [25, "v1", "process-focusable"], + [183, "v1", "process-focusable"] + ], + "(code idle cty-missile-launcher)": [[14, "v1", "art-joint-anim"]], + "(method 37 cty-hijack-manager)": [[[27, 34], "s4", "process-focusable"]], + "(enter fail cty-hijack-manager)": [ + [7, "v0", "(state resetter-params cty-hijack-manager)"] + ], + "(method 20 ctyport-attack-manager-bbush)": [["_stack_", 96, "res-tag"]], + "(code idle farm-sprinkler-barrels)": [[10, "v1", "art-joint-anim"]], + "(code explode com-power-box)": [ + [77, "v1", "collide-shape-prim-group"], + [116, "a0", "process"] + ], + "(enter active task-manager-city-destroy-grid)": [ + ["_stack_", 272, "res-tag"] + ], + "(code wait task-manager-city-destroy-grid)": [[40, "t9", "(function none)"]], + "(code die jinx)": [[37, "v1", "art-joint-anim"]], + "(post die jinx)": [[11, "t9", "(function none)"]], + "(method 32 task-manager-city-destroy-grid)": [ + [118, "s5", "process-focusable"], + [132, "gp", "process-drawable"], + [135, "gp", "process-drawable"], + [100, "v0", "sound-rpc-set-param"] + ], + "(method 84 jinx)": [[45, "v1", "process-focusable"]], + "(code do-power-box jinx)": [ + [19, "v1", "art-joint-anim"], + [83, "v1", "art-joint-anim"], + [135, "v1", "art-joint-anim"], + [254, "v1", "art-joint-anim"], + [194, "v1", "art-joint-anim"] + ], + "(code waiting-idle jinx)": [ + [159, "v1", "art-joint-anim"], + [81, "v1", "art-joint-anim"] + ], + "(code board-vehicle jinx)": [ + [14, "v1", "art-joint-anim"], + [77, "v1", "art-joint-anim"], + [134, "v1", "art-joint-anim"], + [189, "v1", "art-joint-anim"], + [244, "v1", "art-joint-anim"], + [[297, 304], "a0", "vehicle"] + ], + "(code wait-for-ride jinx)": [ + [159, "v1", "art-joint-anim"], + [81, "v1", "art-joint-anim"] + ], + "(method 232 jinx)": [[[11, 44], "s3", "vehicle"]], + "(code exit-vehicle jinx)": [ + [[9, 15], "a0", "vehicle"], + [108, "v1", "art-joint-anim"], + [162, "v1", "art-joint-anim"], + [217, "v1", "art-joint-anim"], + [281, "v1", "art-joint-anim"], + [[35, 50], "s5", "vehicle"], + [[71, 78], "a0", "vehicle"] + ], + "board-vehicle-get-in-car-end": [[[9, 30], "gp", "vehicle"]], + "board-vehicle-get-in-car-sit": [[[10, 31], "s4", "vehicle"]], + "board-vehicle-get-in-car-land": [[[10, 31], "s4", "vehicle"]], + "board-vehicle-get-in-car-jump": [[[12, 34], "s0", "vehicle"]], + "(enter wait-for-ride jinx)": [[[14, 21], "a0", "vehicle"]], + "(trans wait-for-ride jinx)": [[16, "v1", "vehicle"]], + "(enter move-to-vehicle jinx)": [[[9, 30], "gp", "vehicle"]], + "(trans move-to-vehicle jinx)": [[[11, 46], "s0", "vehicle"]], + "(method 26 task-manager-city-destroy-grid)": [ + [[17, 666], "s5", "jinx"], + [[193, 210], "v1", "vehicle"], + [[253, 287], "a2", "vehicle"], + [[494, 664], "s4", "vehicle"] + ], + "check-onintent-bugs": [[[31, 49], "s3", "sprite-vec-data-2d"]], + "(method 11 cty-sniper-battery)": [ + [185, "v1", "art-joint-anim"], + ["_stack_", 16, "res-tag"] + ], + "cty-sniper-battery-handler": [ + [11, "v1", "vector"], + [[18, 25], "a1", "attack-info"], + [41, "a1", "attack-info"], + [43, "a1", "attack-info"], + [45, "a1", "attack-info"], + [47, "a1", "attack-info"] + ], + "(code bail-up cty-sniper-button)": [[35, "v1", "art-joint-anim"]], + "(code idle-down cty-sniper-button)": [[65, "v1", "art-joint-anim"]], + "(code going-down cty-sniper-button)": [ + [52, "v1", "art-joint-anim"], + [27, "v1", "float"] + ], + "(event idle-up cty-sniper-button)": [[[3, 5], "v1", "attack-info"]], + "(code going-down cty-sniper-button-top)": [[10, "v1", "art-joint-anim"]], + "(code going-up cty-sniper-button-top)": [[10, "v1", "art-joint-anim"]], + "(code vulnerable cty-sniper-battery)": [[17, "v1", "art-joint-anim"]], + "(code idle cty-sniper-battery)": [[12, "v1", "art-joint-anim"]], + "(code explode cty-sniper-battery)": [[198, "v1", "process-drawable"]], + "(method 11 cty-sniper-turret)": [ + ["_stack_", 16, "res-tag"], + [14, "v0", "(pointer actor-group)"] + ], + "(code die cty-sniper-turret)": [[142, "v1", "art-joint-anim"]], + "(code ready cty-sniper-turret)": [ + [11, "v1", "art-joint-anim"], + [66, "v1", "art-joint-anim"], + [95, "v1", "art-joint-anim"] + ], + "(code locked-on cty-sniper-turret)": [[33, "v1", "art-joint-anim"]], + "(code asleep cty-sniper-turret)": [[10, "v1", "art-joint-anim"]], + "(trans idle cty-sniper-turret-reticle)": [ + [50, "v1", "float"], + [70, "v1", "float"] + ], + "(enter idle cty-sniper-turret-reticle)": [ + [23, "v1", "float"], + [43, "v1", "float"] + ], + "cty-sniper-turret-reticle-handler": [[7, "a0", "vector"]], + "(method 15 hud-cty-sniper-fight)": [[86, "v1", "cty-sniper-button-top"]], + "(method 22 simple-prim-turret-reticle)": [[3, "v1", "cty-sniper-turret"]], + "cty-sniper-turret-handler": [ + [75, "v1", "collide-shape-prim-group"], + [265, "v0", "(pointer actor-group)"], + [[268, 271], "a0", "hud-cty-sniper-fight"], + [284, "v1", "collide-shape-prim-group"], + [[439, 448], "s5", "cspace"], + [17, "v1", "float"] + ], + "(method 26 task-manager-city-sniper-fight)": [["_stack_", 16, "res-tag"]], + "(code active task-manager-city-sniper-fight)": [ + [80, "a1", "process-drawable"] ] } diff --git a/decompiler/config/jak3/ntsc_v1/var_names.jsonc b/decompiler/config/jak3/ntsc_v1/var_names.jsonc index 6e620655ae..887d8657b4 100644 --- a/decompiler/config/jak3/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak3/ntsc_v1/var_names.jsonc @@ -2074,5 +2074,40 @@ "vars": { "s4-0": ["sname", "sound-name"] } + }, + "symbol->city-target-type": { + "vars": { + "v0-0": ["type", "city-target-type"] + } + }, + "city-target-type->traffic-object-type": { + "vars": { + "v0-0": ["type", "traffic-type"] + } + }, + "city-target-type->cty-faction": { + "vars": { + "v0-0": ["type", "cty-faction"] + } + }, + "map-symbol-to-nav-territory-type": { + "vars": { + "v0-0": ["type", "nav-territory-type"] + } + }, + "guard-type->city-target-type": { + "vars": { + "v0-0": ["type", "city-target-type"] + } + }, + "(code die neo-sat)": { + "vars": { + "gp-0": ["hand", "handle"] + } + }, + "(method 48 task-manager-desert-rescue)": { + "vars": { + "f30-0": ["f30-0", "float"] + } } } diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index d02b2b4c41..172ee7fb39 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -997,6 +997,7 @@ const std::unordered_map< {"vehicle-rider-info", {{"grab-rail-array", ArrayFieldDecompMeta(TypeSpec("vehicle-grab-rail-info"), 48)}, {"attach-point-array", ArrayFieldDecompMeta(TypeSpec("vehicle-attach-point"), 32)}}}, + {"vehicle-setup-info", {{"color", ArrayFieldDecompMeta(TypeSpec("vector"), 16)}}}, {"desbeast-path", {{"node", ArrayFieldDecompMeta(TypeSpec("desbeast-node"), 32)}}}, {"race-info", {{"turbo-pad-array", ArrayFieldDecompMeta(TypeSpec("race-turbo-pad"), 32)}, @@ -1031,6 +1032,12 @@ const std::unordered_map< {"speeches", ArrayFieldDecompMeta(TypeSpec("bot-speech-info"), 16)}, {"dirs", ArrayFieldDecompMeta(TypeSpec("vector"), 16)}, {"speech-tunings", ArrayFieldDecompMeta(TypeSpec("bot-speech-tuning"), 16)}}}, + {"ctyport-mine-layout", + {{"stored-handles", + ArrayFieldDecompMeta(TypeSpec("handle"), + 8, + ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}}, + {"deschase-path", {{"node", ArrayFieldDecompMeta(TypeSpec("deschase-node"), 32)}}}, }}}; goos::Object decompile_structure(const TypeSpec& type, diff --git a/goal_src/jak3/engine/ai/enemy-h.gc b/goal_src/jak3/engine/ai/enemy-h.gc index 75881f6c25..0939586e86 100644 --- a/goal_src/jak3/engine/ai/enemy-h.gc +++ b/goal_src/jak3/engine/ai/enemy-h.gc @@ -331,7 +331,7 @@ (get-damage-from-attack (_type_ object event-message-block) float) (enemy-method-63 (_type_ float) float) (update-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware) - (penetrate->next-state (_type_) symbol) + (penetrate->next-state (_type_ process event-message-block float) symbol) (get-penetrated-by (_type_) penetrate) (coin-flip? (_type_) symbol) (get-enemy-aware (_type_ enemy-aware) enemy-aware) diff --git a/goal_src/jak3/engine/ai/enemy.gc b/goal_src/jak3/engine/ai/enemy.gc index 2878e6f721..9b4abc8985 100644 --- a/goal_src/jak3/engine/ai/enemy.gc +++ b/goal_src/jak3/engine/ai/enemy.gc @@ -1682,28 +1682,28 @@ ) ) (send-event (ppointer->process (-> this parent)) 'child-hit) - (let ((f0-1 (the-as number 0.0))) + (let ((f0-1 0.0)) (if (not *debug-unkillable*) (set! f0-1 (damage-enemy! this proc block)) ) - ) - (let ((s2-2 (penetrate->next-state this))) - (when s2-2 - (logclear! (-> this enemy-flags) (enemy-flag use-trigger)) - (send-attack-to-all-tshapes this (the-as process-focusable proc) block) - (let ((a1-17 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-17 from) (process->ppointer proc)) - (set! (-> a1-17 num-params) argc) - (set! (-> a1-17 message) s2-2) - (set! (-> a1-17 param 0) (-> block param 0)) - (set! (-> a1-17 param 1) (-> block param 1)) - (set! (-> a1-17 param 2) (-> block param 2)) - (set! (-> a1-17 param 3) (-> block param 3)) - (set! (-> a1-17 param 4) (-> block param 4)) - (set! (-> a1-17 param 5) (-> block param 5)) - (send-event-function this a1-17) + (let ((s2-2 (penetrate->next-state this proc block f0-1))) + (when s2-2 + (logclear! (-> this enemy-flags) (enemy-flag use-trigger)) + (send-attack-to-all-tshapes this (the-as process-focusable proc) block) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) (process->ppointer proc)) + (set! (-> a1-17 num-params) argc) + (set! (-> a1-17 message) s2-2) + (set! (-> a1-17 param 0) (-> block param 0)) + (set! (-> a1-17 param 1) (-> block param 1)) + (set! (-> a1-17 param 2) (-> block param 2)) + (set! (-> a1-17 param 3) (-> block param 3)) + (set! (-> a1-17 param 4) (-> block param 4)) + (set! (-> a1-17 param 5) (-> block param 5)) + (send-event-function this a1-17) + ) + #t ) - #t ) ) ) @@ -2097,7 +2097,7 @@ ) ) -(defmethod penetrate->next-state ((this enemy)) +(defmethod penetrate->next-state ((this enemy) (arg0 process) (arg1 event-message-block) (arg2 float)) (let ((gp-0 (-> this incoming penetrate-using))) (cond ((and (logtest? (penetrate jak-dark-blackhole) gp-0) #t) diff --git a/goal_src/jak3/engine/ai/traffic-h.gc b/goal_src/jak3/engine/ai/traffic-h.gc index 80233a53af..07879866e7 100644 --- a/goal_src/jak3/engine/ai/traffic-h.gc +++ b/goal_src/jak3/engine/ai/traffic-h.gc @@ -66,6 +66,8 @@ (guard-transport 26) (kg-pickup 27) (bike-d 28) + (max 29) + (invalid0 -1) (invalid #xffffffff) ) ;; ---traffic-h:traffic-type @@ -117,6 +119,16 @@ ;; ---vehicle-type-u8 +;; +++guard-type +(defenum guard-type + :type uint8 + (tazer 0) + (rifle 1) + (grenade 2) + ) +;; ---guard-type + + ;; DECOMP BEGINS (define *traffic-manager* (the-as traffic-manager #f)) @@ -155,7 +167,7 @@ ) (deftype traffic-object-spawn-params (structure) - ((object-type uint8) + ((object-type traffic-type) (behavior uint64) (id uint32) (nav-mesh nav-mesh) @@ -164,10 +176,10 @@ (rotation quaternion :inline) (velocity vector :inline) (handle handle) - (handle-parent uint64) + (handle-parent handle) (guard-type uint8) (user-data uint32) - (entity basic) + (entity entity) (flags traffic-spawn-flags) (proc process) ) diff --git a/goal_src/jak3/engine/common-obs/bouncer.gc b/goal_src/jak3/engine/common-obs/bouncer.gc index 958bb0b16f..e6aaf502a1 100644 --- a/goal_src/jak3/engine/common-obs/bouncer.gc +++ b/goal_src/jak3/engine/common-obs/bouncer.gc @@ -20,8 +20,8 @@ smush ) (:methods - (bouncer-method-23 (_type_) none) - (bouncer-method-24 (_type_) none) + (init-skel! (_type_) none) + (init-collision! (_type_) none) (play-sound (_type_) none) (bouncer-method-26 (_type_) none) ) @@ -209,13 +209,13 @@ (none) ) -(defmethod bouncer-method-23 ((this bouncer)) +(defmethod init-skel! ((this bouncer)) (break!) 0 (none) ) -(defmethod bouncer-method-24 ((this bouncer)) +(defmethod init-collision! ((this bouncer)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) @@ -239,9 +239,9 @@ (defmethod init-from-entity! ((this bouncer) (arg0 entity-actor)) (set! (-> this mods) #f) - (bouncer-method-24 this) + (init-collision! this) (process-drawable-from-entity! this arg0) - (bouncer-method-23 this) + (init-skel! this) (nav-mesh-connect-from-ent this) (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) (set! (-> this use-alternate-jump?) (= (res-lump-value arg0 'behavior-type uint128 :time -1000000000.0) 1)) diff --git a/goal_src/jak3/engine/common-obs/generic-obs-h.gc b/goal_src/jak3/engine/common-obs/generic-obs-h.gc index 5eda0097d0..1998ae6fd5 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs-h.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs-h.gc @@ -109,13 +109,14 @@ (deftype part-tracker (process) - ((root trsqv) - (mat matrix :inline) - (offset vector :inline) + ((parent (pointer process) :override) + (root trsqv) + (mat matrix :inline) + (offset vector :inline) (userdata uint64) - (user-time time-frame 2) - (user-vector vector :inline) - (user-handle uint32 2 :offset 288) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle uint32 2 :offset 288) (part sparticle-launch-control) (callback (function part-tracker vector)) (linger-callback (function part-tracker vector)) diff --git a/goal_src/jak3/engine/common-obs/generic-obs.gc b/goal_src/jak3/engine/common-obs/generic-obs.gc index 2b250597c3..964e9526b4 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs.gc @@ -1782,6 +1782,13 @@ ) ) ) + ;; Note: there's some changes here to skip setting things if arg4 is #f. + ;; the address of #f is misaligned, but on ps2 the lq instruction will silently mask. + ;; Loading from #f doesn't really make sense, so this was likely just a mistake in the + ;; original game. + ;; the OpenGOAL compiler uses vmovaps, which will crash on a misaligned load because + ;; this has been useful for finding errors. So to prevent this crash, we skip the load + ;; if the argument is #f. (some callers of this directly pass #f, so it's not a bug higher up). (cond ((>= 256 (the-as int arg4)) (set! (-> self target-joint0) (the-as int arg4)) @@ -1789,7 +1796,10 @@ ) (else (set! (-> self target-joint0) -1) - (set! (-> self offset0 quad) (-> arg4 quad)) + ;: og:preserve-this hack, fixed bug in original game + (when arg4 + (set! (-> self offset0 quad) (-> arg4 quad)) + ) ) ) (cond @@ -1799,7 +1809,10 @@ ) (else (set! (-> self target-joint1) -1) - (set! (-> self offset1 quad) (-> arg5 quad)) + ;: og:preserve-this hack, fixed bug in original game + (when arg5 + (set! (-> self offset1 quad) (-> arg5 quad)) + ) ) ) (set! (-> self root) (new 'process 'trsqv)) diff --git a/goal_src/jak3/engine/common-obs/speech-manager.gc b/goal_src/jak3/engine/common-obs/speech-manager.gc index 2e09508c77..9fb2535d34 100644 --- a/goal_src/jak3/engine/common-obs/speech-manager.gc +++ b/goal_src/jak3/engine/common-obs/speech-manager.gc @@ -5,5 +5,122 @@ ;; name in dgo: speech-manager ;; dgos: GAME +;; +++speech-info-flag +(defenum speech-info-flag + :type uint64 + :bitfield #t + (si0 0) + (si1 1) + (si2 2) + (si3 3) + (si4 4) + (si5 5) + (si6 6) + (si7 7) + (si8 8) + ) +;; ---speech-info-flag + + ;; DECOMP BEGINS +(deftype speech-instance (structure) + ((speech uint16) + (num-play-times int8) + (probability float) + ) + ) + + +(deftype speech-info (structure) + ((speeches (array speech-instance)) + (flags speech-info-flag) + (play-time time-frame) + ) + ) + + +(defun mark-speech-played ((arg0 speech-info) (arg1 int)) + (logior! (-> arg0 flags) (speech-info-flag si6 si7)) + (+! (-> arg0 speeches arg1 num-play-times) 1) + (let ((v0-0 (current-time))) + (set! (-> arg0 play-time) v0-0) + v0-0 + ) + ) + +(defun speech-play ((arg0 (array speech-info)) (arg1 int) (arg2 (inline-array talker-speech-class)) (arg3 vector)) + (local-vars (v0-0 int)) + (let ((s1-0 (-> arg0 arg1)) + (v1-2 #xf4240) + (a1-1 0) + (s2-0 #f) + ) + (if (and (logtest? (-> s1-0 flags) (speech-info-flag si0)) (logtest? (-> s1-0 flags) (speech-info-flag si6))) + (return -1) + ) + (when (and (logtest? (-> s1-0 flags) (speech-info-flag si3)) (logtest? (-> s1-0 flags) (speech-info-flag si7))) + (set! s2-0 #t) + (set! s1-0 (-> arg0 (+ arg1 1))) + ) + (if (and (logtest? (-> s1-0 flags) (speech-info-flag si0)) (logtest? (-> s1-0 flags) (speech-info-flag si6))) + (return -1) + ) + (dotimes (a0-20 (-> s1-0 speeches length)) + (set! v1-2 (min (-> s1-0 speeches a0-20 num-play-times) v1-2)) + ) + (if (and (> v1-2 0) (logtest? (-> s1-0 flags) (speech-info-flag si4))) + (return -1) + ) + (dotimes (a0-26 (-> s1-0 speeches length)) + (if (< v1-2 (-> s1-0 speeches a0-26 num-play-times)) + (set! a1-1 (logior a1-1 (ash 1 a0-26))) + ) + ) + (let ((s0-0 0)) + (set! s0-0 (cond + ((logtest? (-> s1-0 flags) (speech-info-flag si5)) + (dotimes (v1-7 (-> s1-0 speeches length)) + (when (not (logtest? a1-1 (ash 1 v1-7))) + (set! s0-0 v1-7) + 0 + (goto cfg-45) + ) + ) + (label cfg-45) + s0-0 + ) + (else + (rand-vu-int-count-excluding (-> s1-0 speeches length) a1-1) + ) + ) + ) + (if (logtest? (-> s1-0 flags) (speech-info-flag si8)) + (set! arg2 *talker-speech*) + ) + (mark-speech-played s1-0 s0-0) + (talker-spawn-func (-> arg2 (-> s1-0 speeches s0-0 speech)) *entity-pool* arg3 (the-as region #f)) + (if s2-0 + (set-time! (-> arg0 arg1 play-time)) + ) + (return s0-0) + ) + ) + v0-0 + ) + +(defun speeches-reset ((arg0 (array speech-info))) + (dotimes (v1-0 (-> arg0 length)) + (logclear! (-> arg0 v1-0 flags) (speech-info-flag si6)) + (set! (-> arg0 v1-0 play-time) 0) + ) + #f + ) + +(defun speeches-debug-reset ((arg0 (array speech-info))) + (dotimes (v1-0 (-> arg0 length)) + (logclear! (-> arg0 v1-0 flags) (speech-info-flag si6 si7)) + (set! (-> arg0 0 play-time) 0) + ) + #f + ) diff --git a/goal_src/jak3/engine/debug/nav/mysql-nav-graph.gc b/goal_src/jak3/engine/debug/nav/mysql-nav-graph.gc index 476d4b990d..b9dd54228a 100644 --- a/goal_src/jak3/engine/debug/nav/mysql-nav-graph.gc +++ b/goal_src/jak3/engine/debug/nav/mysql-nav-graph.gc @@ -97,14 +97,14 @@ (data_int_1 uint32) ) (:methods - (mysql-nav-node-method-9 () none) - (mysql-nav-node-method-10 () none) + (exec-sql! (_type_) symbol) + (temp-edge-size (_type_) int) ) ) (deftype mysql-nav-node-array (inline-array-class) - ((data mysql-nav-node :dynamic) + ((data mysql-nav-node :inline :dynamic) ) ) @@ -201,21 +201,21 @@ (level-info-array mysql-nav-graph-level-info 32 :inline) ) (:methods - (new (symbol type) _type_) - (mysql-nav-graph-method-9 () none) - (mysql-nav-graph-method-10 () none) - (mysql-nav-graph-method-11 () none) - (mysql-nav-graph-method-12 () none) - (mysql-nav-graph-method-13 () none) - (mysql-nav-graph-method-14 () none) - (mysql-nav-graph-method-15 () none) - (mysql-nav-graph-method-16 () none) - (mysql-nav-graph-method-17 () none) - (mysql-nav-graph-method-18 () none) - (mysql-nav-graph-method-19 () none) - (mysql-nav-graph-method-20 () none) - (mysql-nav-graph-method-21 () none) - (mysql-nav-graph-method-22 () none) - (mysql-nav-graph-method-23 () none) + (new (symbol type string) _type_) + (init-from-sql! (_type_ string string) symbol) + (exec-sql! (_type_) symbol) + (indexof-nav-node (_type_ int) int) + (indexof-nav-edge (_type_ int) int) + (mysql-nav-graph-method-13 (_type_) none) + (mysql-nav-graph-method-14 (_type_) none) + (mysql-nav-graph-method-15 (_type_) none) + (mysql-nav-graph-method-16 (_type_) none) + (mysql-nav-graph-method-17 (_type_) none) + (lookup-level-info2 (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info) + (mysql-nav-graph-method-19 (_type_) none) + (mysql-nav-graph-method-20 (_type_) none) + (mysql-nav-graph-method-21 (_type_) none) + (mysql-nav-graph-method-22 (_type_) none) + (mysql-nav-graph-method-23 (_type_) none) ) ) diff --git a/goal_src/jak3/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak3/engine/debug/nav/nav-graph-editor.gc index 2bbcb6f3f0..acb102e391 100644 --- a/goal_src/jak3/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak3/engine/debug/nav/nav-graph-editor.gc @@ -125,3 +125,8 @@ (define *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) + +;; stub +(defun get-nav-graph-editor () + (the nav-graph-editor #f) + ) \ No newline at end of file diff --git a/goal_src/jak3/engine/entity/entity-table.gc b/goal_src/jak3/engine/entity/entity-table.gc index c7e29b8fcf..695f2a6d39 100644 --- a/goal_src/jak3/engine/entity/entity-table.gc +++ b/goal_src/jak3/engine/entity/entity-table.gc @@ -65,7 +65,7 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref krimson-wall :method-count 0) + :ptype (type-ref krimson-wall :method-count 31) :pool '*16k-dead-pool* :heap-size #x4000 ) @@ -129,11 +129,6 @@ :pool '*16k-dead-pool* :heap-size #x4000 ) - (new 'static 'entity-info - :ptype (type-ref a :method-count 0) - :pool '*16k-dead-pool* - :heap-size #x4000 - ) (new 'static 'entity-info :ptype (type-ref mhcity-grunt-egg-b :method-count 32) :pool '*16k-dead-pool* @@ -200,22 +195,17 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref a :method-count 0) + :ptype (type-ref searchlight :method-count 21) :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref searchlight :method-count 0) + :ptype (type-ref ctyn-lamp :method-count 32) :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref ctyn-lamp :method-count 0) - :pool '*16k-dead-pool* - :heap-size #x4000 - ) - (new 'static 'entity-info - :ptype (type-ref burning-bush :method-count 0) + :ptype (type-ref burning-bush :method-count 35) :pool '*16k-dead-pool* :heap-size #x4000 ) @@ -225,17 +215,17 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref barge :method-count 0) + :ptype (type-ref barge :method-count 152) :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref boat-manager :method-count 0) + :ptype (type-ref boat-manager :method-count 17) :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref propa :method-count 0) + :ptype (type-ref propa :method-count 33) :pool '*16k-dead-pool* :heap-size #x4000 ) @@ -250,12 +240,12 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref parking-spot :method-count 0) + :ptype (type-ref parking-spot :method-count 27) :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref security-wall :method-count 0) + :ptype (type-ref security-wall :method-count 25) :pool '*16k-dead-pool* :heap-size #x4000 ) diff --git a/goal_src/jak3/engine/game/game-info.gc b/goal_src/jak3/engine/game/game-info.gc index c502a89c28..930c57b44b 100644 --- a/goal_src/jak3/engine/game/game-info.gc +++ b/goal_src/jak3/engine/game/game-info.gc @@ -12,7 +12,7 @@ (define-extern process-drawable-shock-effect (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher int int float object)) (define-extern *lightning-darkjak-pill* lightning-spec) (define-extern ready-hud (function symbol int none)) -(define-extern override-player-controls (function int)) +(define-extern override-player-controls (function cpad-info int)) (define-extern *highscore-info-array* (array highscore-info)) (define-extern *user* symbol) @@ -1904,10 +1904,7 @@ (defmethod adjust-to-screen-flip ((this cpad-info)) (if (and (not (paused?)) (zero? (-> this number)) (-> *setting-control* user-current player-control-override)) - (when (nonzero? override-player-controls) ;; og:preserve-this not-yet-implemented check - ;; added nonzero check, but I suspect there's a bug we're even getting here... - (override-player-controls) - ) + (override-player-controls this) ) (when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! (-> this leftx) (- 255 (the-as int (-> this leftx)))) diff --git a/goal_src/jak3/engine/game/settings-h.gc b/goal_src/jak3/engine/game/settings-h.gc index 912f544733..6a44590ffe 100644 --- a/goal_src/jak3/engine/game/settings-h.gc +++ b/goal_src/jak3/engine/game/settings-h.gc @@ -446,7 +446,7 @@ (borrow-hold-count uint32) (borrow-hold pair 3) (cloth symbol) - (player-control-override symbol) + (player-control-override cpad-info) (player-control-mask uint32) (gun-special-mode symbol) (airlock-command pair) diff --git a/goal_src/jak3/engine/game/settings.gc b/goal_src/jak3/engine/game/settings.gc index 2fe58d2dc1..4502f73bcf 100644 --- a/goal_src/jak3/engine/game/settings.gc +++ b/goal_src/jak3/engine/game/settings.gc @@ -173,7 +173,7 @@ (set! (-> this mh-enemy-settings) (the-as symbol arg3)) ) (('player-control-override) - (set! (-> this player-control-override) (the-as symbol arg3)) + (set! (-> this player-control-override) (the-as cpad-info arg3)) ) (('player-control-mask) (set! (-> this player-control-mask) arg3) diff --git a/goal_src/jak3/engine/game/task/task-control-h.gc b/goal_src/jak3/engine/game/task/task-control-h.gc index e646260dfe..f8aceba382 100644 --- a/goal_src/jak3/engine/game/task/task-control-h.gc +++ b/goal_src/jak3/engine/game/task/task-control-h.gc @@ -46,12 +46,12 @@ (declare-type editable-player process) (define-extern *editable* (pointer editable-player)) -;; temporarily forward declared as symbols (declare-type mission-squad-control basic) (declare-type cty-attack-controller mission-squad-control) -(define-extern *cty-faction-manager* symbol) +(declare-type cty-faction-manager basic) +(define-extern *cty-faction-manager* cty-faction-manager) (define-extern *cty-attack-controller* cty-attack-controller) -(set! *cty-faction-manager* #f) +(set! *cty-faction-manager* (the cty-faction-manager #f)) (set! *cty-attack-controller* (the cty-attack-controller #f)) (define-extern cty-attack-reset (function symbol symbol symbol none)) diff --git a/goal_src/jak3/engine/gfx/mood/mood-funcs.gc b/goal_src/jak3/engine/gfx/mood/mood-funcs.gc index 6349200f6e..ad34916b28 100644 --- a/goal_src/jak3/engine/gfx/mood/mood-funcs.gc +++ b/goal_src/jak3/engine/gfx/mood/mood-funcs.gc @@ -176,6 +176,34 @@ ) ) +(defbehavior update-mood-ctyslumb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> (the-as ctyslumb-states s5-1) spec-0)) + (set! (-> (the-as ctyslumb-states s5-1) spec-0 initial-valuef) + (* 32.0 (-> (the-as ctyslumb-states s5-1) light fade)) + ) + ) + (if (nonzero? (-> (the-as ctyslumb-states s5-1) spec-1)) + (set! (-> (the-as ctyslumb-states s5-1) spec-1 initial-valuef) + (* 8.0 (-> (the-as ctyslumb-states s5-1) light fade)) + ) + ) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) (-> (the-as ctyslumb-states s5-1) flicker)) + (if (not (paused?)) + (set! (-> (the-as ctyslumb-states s5-1) flicker) (rand-vu-float-range 0.8 1.0)) + ) + ) + ) + 0 + (none) + ) + (deftype ctyslumc-states (structure) ((light light-state :inline) (spec-0 sp-field-init-spec) @@ -204,6 +232,34 @@ (none) ) +(defbehavior update-mood-ctyslumc time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> (the-as ctyslumc-states s5-1) spec-0)) + (set! (-> (the-as ctyslumc-states s5-1) spec-0 initial-valuef) + (* 32.0 (-> (the-as ctyslumc-states s5-1) light fade)) + ) + ) + (if (nonzero? (-> (the-as ctyslumc-states s5-1) spec-1)) + (set! (-> (the-as ctyslumc-states s5-1) spec-1 initial-valuef) + (* 8.0 (-> (the-as ctyslumc-states s5-1) light fade)) + ) + ) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) (-> (the-as ctyslumc-states s5-1) flicker)) + (if (not (paused?)) + (set! (-> (the-as ctyslumc-states s5-1) flicker) (rand-vu-float-range 0.8 1.0)) + ) + ) + ) + 0 + (none) + ) + (deftype ctygenb-states (structure) ((light light-state :inline) (flame flames-state :inline) @@ -250,6 +306,42 @@ ) ) +(defbehavior update-mood-ctygenb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 1 8 1.0 0.000390625 1.5) + (when (or (>= arg1 18.0) (>= 6.0 arg1)) + (update-mood-flicker arg0 7 15) + (let ((f1-2 (-> (the-as ctygenb-states gp-1) next-flicker)) + (f0-2 (-> arg0 times 7 w)) + ) + (set! (-> arg0 times 7 w) f1-2) + (if (nonzero? (-> (the-as ctygenb-states gp-1) spec-0)) + (set! (-> (the-as ctygenb-states gp-1) spec-0 initial-valuef) (* 40.0 f0-2)) + ) + (if (nonzero? (-> (the-as ctygenb-states gp-1) spec-1)) + (set! (-> (the-as ctygenb-states gp-1) spec-1 initial-valuef) (* 20.0 f0-2)) + ) + (if (nonzero? (-> (the-as ctygenb-states gp-1) spec-2)) + (set! (-> (the-as ctygenb-states gp-1) spec-2 initial-valuef) (* 20.0 f0-2)) + ) + (if (nonzero? (-> (the-as ctygenb-states gp-1) spec-3)) + (set! (-> (the-as ctygenb-states gp-1) spec-3 initial-valuef) (* 8.0 f0-2)) + ) + (set! (-> (the-as ctygenb-states gp-1) next-flicker) f0-2) + ) + ) + ) + ) + 0 + (none) + ) + (define *mhcity-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog @@ -296,7 +388,21 @@ ) ) -;; ERROR: function has no type analysis. Cannot decompile. +(defun overide-mhcity-fog ((arg0 mood-context) (arg1 float) (arg2 int)) + (when (not (-> *time-of-day-context* overide-enable)) + (let* ((f30-0 (vector-vector-distance (target-pos 0) (new 'static 'vector :x -1072496.6 :y -22159.36 :z 4246978.5))) + (f0-0 (vector-vector-distance (target-pos 0) (new 'static 'vector :x -1118986.2 :y -30474.24 :z 3107348.5))) + (f0-5 (fmin + (fmax 0.0 (fmin 1.0 (* 0.0000032552084 (+ -1228800.0 f30-0)))) + (fmax 0.0 (fmin 1.0 (* 0.0000032552084 (+ -737280.0 f0-0)))) + ) + ) + ) + (overide-mood-fog arg0 arg1 (the-as int *mhcity-mood-fog-table*) f0-5) + ) + ) + (none) + ) (deftype mhcitya-states (structure) ((pulse pulse-state :inline) @@ -315,6 +421,23 @@ ) ) +(defbehavior update-mood-mhcitya time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((s5-0 arg2)) + (copy-mood-exterior arg0) + (overide-mhcity-fog arg0 arg1 arg2) + (when (and (= (-> *level* level s5-0 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (set! (-> arg0 times 5 w) 1.0) + (update-mood-pulse arg0 6 0 0.75 0.25 (* 32768.0 (seconds-per-frame)) 0.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + (deftype mhcityb-states (structure) ((pulse pulse-state :inline) ) @@ -332,6 +455,75 @@ ) ) +(defbehavior update-mood-mhcityb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((s5-0 arg2)) + (copy-mood-exterior arg0) + (overide-mhcity-fog arg0 arg1 arg2) + (when (and (= (-> *level* level s5-0 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (set! (-> arg0 times 5 w) 1.0) + (update-mood-pulse arg0 6 0 0.75 0.25 (* 32768.0 (seconds-per-frame)) 0.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +(defun calc-lmhcity-palettes ((arg0 mood-context)) + (let ((v1-3 (mod (-> *display* part-clock frame-counter) 4800))) + (dotimes (a1-1 8) + (let* ((a2-1 (* 600 a1-1)) + (a3-0 (+ a2-1 1200)) + ) + (cond + ((= a1-1 7) + (if (< v1-3 (mod a3-0 4800)) + (set! (-> arg0 times a1-1 w) (- 1.0 (* 0.0016666667 (the float v1-3)))) + ) + (if (< a2-1 v1-3) + (set! (-> arg0 times a1-1 w) (* 0.0016666667 (the float (- v1-3 a2-1)))) + ) + ) + (else + (when (and (< v1-3 a3-0) (< a2-1 v1-3)) + (let ((f0-5 (* 0.0016666667 (the float (- v1-3 a2-1))))) + (if (< 1.0 f0-5) + (set! (-> arg0 times a1-1 w) (- 2.0 f0-5)) + (set! (-> arg0 times a1-1 w) f0-5) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +(defbehavior update-mood-lmhcitya time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (overide-mhcity-fog arg0 arg1 arg2) + (if (< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + (calc-lmhcity-palettes arg0) + ) + 0 + (none) + ) + +(defbehavior update-mood-lmhcityb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (overide-mhcity-fog arg0 arg1 arg2) + (if (< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + (calc-lmhcity-palettes arg0) + ) + 0 + (none) + ) + (deftype ctyport-states (structure) ((light light-state :inline) (spec-0 sp-field-init-spec) @@ -340,7 +532,46 @@ ) -(define *ctyport-level* (the-as level-group #f)) +(define *ctyport-level* (the-as level #f)) + +(defbehavior update-mood-ctyport time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((s4-0 arg2)) + (copy-mood-exterior arg0) + (overide-mhcity-fog arg0 arg1 arg2) + (when (and (!= s4-0 -1) + (= (-> *level* level s4-0 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defun reset-marquee-color! () + (set! *ctyport-level* (level-get *level* 'ctyport)) + (if *ctyport-level* + (set-vector! (-> *ctyport-level* mood-context times 6) 0.0 0.0 0.0 1.0) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun add-marquee-color! ((arg0 float) (arg1 float) (arg2 float)) + (when *ctyport-level* + (let ((v1-2 (-> *ctyport-level* mood-context))) + (+! (-> v1-2 times 6 x) arg0) + (+! (-> v1-2 times 6 y) arg1) + (+! (-> v1-2 times 6 z) arg2) + ) + ) + (none) + ) (deftype ctymarka-states (structure) ((light light-state :inline) @@ -438,6 +669,47 @@ ) ) +(defbehavior update-mood-mountain time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 0.875 0.25 2.0 0.0 1.0) + (update-mood-light arg0 6 8 1.0 0.0 arg1 0.0 1.0) + (set! (-> arg0 times 7 w) 1.0) + (let* ((f0-1 (-> arg0 times 5 w)) + (f1-1 (* 24.0 f0-1)) + (f0-2 (* 20.0 f0-1)) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-0)) + (set! (-> (the-as mountain-states gp-1) spec-0 initial-valuef) f1-1) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-1)) + (set! (-> (the-as mountain-states gp-1) spec-1 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-2)) + (set! (-> (the-as mountain-states gp-1) spec-2 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-3)) + (set! (-> (the-as mountain-states gp-1) spec-3 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-4)) + (set! (-> (the-as mountain-states gp-1) spec-4 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-5)) + (set! (-> (the-as mountain-states gp-1) spec-5 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-6)) + (set! (-> (the-as mountain-states gp-1) spec-6 initial-valuef) f0-2) + ) + ) + ) + ) + 0 + (none) + ) + (deftype ctyinda-states (structure) ((light light-state :inline) ) @@ -497,6 +769,40 @@ 0 (none) ) + +(deftype atoll-states (structure) + ((light light-state :inline) + (explosion float) + ) + ) + + +(defun init-mood-atoll ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state)) + (f0-0 0.0) + ) + (set! (-> v1-0 2) (the-as uint f0-0)) + f0-0 + ) + ) + +(defbehavior update-mood-atoll time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 7 w) (-> (the-as atoll-states s4-1) explosion)) + (if (not (paused?)) + (seek! (-> (the-as atoll-states s4-1) explosion) 0.0 (* 2.0 (seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + (defun set-atoll-explosion! ((arg0 float)) (let ((v1-1 (level-get *level* 'atoll))) (when v1-1 diff --git a/goal_src/jak3/engine/math/matrix-compose.gc b/goal_src/jak3/engine/math/matrix-compose.gc index 1fac1e1a2e..9687c33cec 100644 --- a/goal_src/jak3/engine/math/matrix-compose.gc +++ b/goal_src/jak3/engine/math/matrix-compose.gc @@ -59,7 +59,7 @@ arg0 ) -(defun matrix-u-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) +(defun matrix-u-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) (set! (-> arg0 uvec quad) (-> arg1 quad)) (vector-cross! (-> arg0 fvec) arg2 arg1) (vector-normalize! (-> arg0 fvec) 1.0) diff --git a/goal_src/jak3/engine/math/quaternion.gc b/goal_src/jak3/engine/math/quaternion.gc index b9f4dbd645..64016e6662 100644 --- a/goal_src/jak3/engine/math/quaternion.gc +++ b/goal_src/jak3/engine/math/quaternion.gc @@ -156,8 +156,8 @@ ;; ERROR: Bad vector register dependency: vf2 (defun quaternion-conjugate! ((arg0 quaternion) (arg1 quaternion)) "Set arg0 to the conjugate of arg1 (negate only ijk). -If arg1 is normalized, this is equivalent to the inverse -NOTE: this gives you the inverse rotation." + If arg1 is normalized, this is equivalent to the inverse + NOTE: this gives you the inverse rotation." (rlet ((vf1 :class vf) (vf2 :class vf) ) @@ -259,7 +259,7 @@ NOTE: this gives you the inverse rotation." ;; ERROR: Bad vector register dependency: vf3 (defun quaternion-inverse! ((arg0 quaternion) (arg1 quaternion)) "Invert a quaternion. The inverse will satisfy q * q^-1 = identity, even if q is not normalized. -If your quaternion is normalized, it is faster/more accurate to do quaternion-conjugate!" + If your quaternion is normalized, it is faster/more accurate to do quaternion-conjugate!" (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -339,9 +339,9 @@ If your quaternion is normalized, it is faster/more accurate to do quaternion-co (defun quaternion-right-mult-matrix! ((arg0 matrix) (arg1 quaternion)) "Place quaternion coefficients into a matrix. -You can convert a quaternion to a matrix by taking the product of this -right-mult and left-mult matrix, but this method is not used. -Instead, quaternion->matrix is a more efficient implementation." + You can convert a quaternion to a matrix by taking the product of this + right-mult and left-mult matrix, but this method is not used. + Instead, quaternion->matrix is a more efficient implementation." (let ((f3-0 (-> arg1 x)) (f2-0 (-> arg1 y)) (f1-0 (-> arg1 z)) @@ -674,7 +674,7 @@ Instead, quaternion->matrix is a more efficient implementation." (defun quaternion-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) "Real quaternion slerp. Spherical-linear interpolation is a nice way to interpolate -between quaternions." + between quaternions." (local-vars (v1-15 float)) (rlet ((acc :class vf) (vf1 :class vf) @@ -739,8 +739,8 @@ between quaternions." (defun quaternion-pseudo-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) "This is a bad interpolation between quaternions. It lerps then normalizes. -It will behave extremely poorly for 180 rotations. -It is unused." + It will behave extremely poorly for 180 rotations. + It is unused." (rlet ((acc :class vf) (vf1 :class vf) (vf2 :class vf) @@ -773,7 +773,7 @@ It is unused." (defun quaternion-pseudo-seek ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) "Seek one quaternion toward another. Not using real slerp, so this is only good if the quaternions -are pretty similar." + are pretty similar." (let ((s3-0 (new 'stack-no-clear 'quaternion))) (let ((s5-0 (new 'stack-no-clear 'quaternion))) (quaternion-copy! s3-0 arg2) @@ -797,16 +797,16 @@ are pretty similar." (defun quaternion-smooth-seek! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) "Another hacky rotation interpolation." - (let ((gp-0 (new 'stack-no-clear 'quaternion))) - (quaternion-copy! (the-as quaternion (&-> gp-0 x)) arg2) - (if (< (quaternion-dot (the-as quaternion (&-> gp-0 x)) arg1) 0.0) - (quaternion-negate! (the-as quaternion (&-> gp-0 x)) (the-as quaternion (&-> gp-0 x))) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (quaternion-copy! (-> gp-0 0) arg2) + (if (< (quaternion-dot (-> gp-0 0) arg1) 0.0) + (quaternion-negate! (-> gp-0 0) (-> gp-0 0)) ) - (quaternion-! (&+ gp-0 16) (the-as quaternion (&-> gp-0 x)) arg1) - (quaternion-float*! (&+ gp-0 16) (&+ gp-0 16) (fmin 1.0 arg3)) - (quaternion+! (the-as quaternion (&-> gp-0 x)) arg1 (&+ gp-0 16)) - (quaternion-normalize! (the-as quaternion (&-> gp-0 x))) - (quaternion-copy! arg0 (the-as quaternion (&-> gp-0 x))) + (quaternion-! (-> gp-0 1) (-> gp-0 0) arg1) + (quaternion-float*! (-> gp-0 1) (-> gp-0 1) (fmin 1.0 arg3)) + (quaternion+! (-> gp-0 0) arg1 (-> gp-0 1)) + (quaternion-normalize! (-> gp-0 0)) + (quaternion-copy! arg0 (-> gp-0 0)) ) ) diff --git a/goal_src/jak3/engine/nav/nav-enemy-h.gc b/goal_src/jak3/engine/nav/nav-enemy-h.gc index b33cb8aad9..22c9a0b955 100644 --- a/goal_src/jak3/engine/nav/nav-enemy-h.gc +++ b/goal_src/jak3/engine/nav/nav-enemy-h.gc @@ -57,6 +57,8 @@ debug-control ) (:methods + (init-enemy-info! (_type_ nav-enemy-info) none :replace) + (init-enemy-defaults! (_type_ nav-enemy-info) object :replace) (normalize-heading! (_type_ nav-control) none) (nav-enemy-method-161 (_type_ nav-control) none) (nav-enemy-method-162 (_type_) none) diff --git a/goal_src/jak3/engine/nav/nav-enemy.gc b/goal_src/jak3/engine/nav/nav-enemy.gc index cf5df01ef1..29bf57f9d5 100644 --- a/goal_src/jak3/engine/nav/nav-enemy.gc +++ b/goal_src/jak3/engine/nav/nav-enemy.gc @@ -613,9 +613,9 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod init-enemy-info! ((this nav-enemy) (arg0 enemy-info)) - (set! (-> this enemy-info) (the-as nav-enemy-info arg0)) - (set! (-> (the-as nav-enemy-info arg0) callback-info) *default-nav-callback-info*) +(defmethod init-enemy-info! ((this nav-enemy) (arg0 nav-enemy-info)) + (set! (-> this enemy-info) arg0) + (set! (-> arg0 callback-info) *default-nav-callback-info*) (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) (set! (-> this neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) this (-> this enemy-info neck-joint)) @@ -630,7 +630,8 @@ (none) ) -(defmethod init-enemy-defaults! ((this nav-enemy) (arg0 enemy-info)) +;; WARN: Return type mismatch int vs object. +(defmethod init-enemy-defaults! ((this nav-enemy) (arg0 nav-enemy-info)) (local-vars (sv-16 res-tag)) (rlet ((acc :class vf) (vf0 :class vf) @@ -674,7 +675,7 @@ ) (set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) ) - (get-nav-control this (-> (the-as nav-enemy-info arg0) nav-mesh)) + (get-nav-control this (-> arg0 nav-mesh)) (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) (let ((v1-32 this)) (set! (-> v1-32 enemy-flags) (the-as enemy-flag (logclear (-> v1-32 enemy-flags) (enemy-flag ef37)))) @@ -848,7 +849,6 @@ (set! (-> this draw light-index) (the-as uint 10)) ) 0 - (none) ) ) @@ -2233,8 +2233,11 @@ (t9-0) ) ) - (let ((v1-4 (-> self nav))) - (logclear! (-> v1-4 shape nav-flags) (nav-flags has-extra-sphere)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-4 (-> self nav))) + (logclear! (-> v1-4 shape nav-flags) (nav-flags has-extra-sphere)) + ) ) 0 ) diff --git a/goal_src/jak3/engine/physics/rigid-body-h.gc b/goal_src/jak3/engine/physics/rigid-body-h.gc index ce31d4f37e..c979725f5a 100644 --- a/goal_src/jak3/engine/physics/rigid-body-h.gc +++ b/goal_src/jak3/engine/physics/rigid-body-h.gc @@ -183,7 +183,7 @@ (rigid-body-control-method-22 (_type_ vector vector) none) (rigid-body-control-method-23 (_type_ vector vector) none) (rigid-body-control-method-24 (_type_ vector vector) none) - (rigid-body-control-method-25 (_type_ vector) none) + (rigid-body-control-method-25 (_type_ vector) vector) (rigid-body-control-method-26 (_type_) none) (init! (_type_ rigid-body-info vector quaternion (function rigid-body-object float)) none) (rigid-body-control-method-28 (_type_ vector quaternion) none) @@ -212,7 +212,7 @@ active ) (:methods - (rigid-body-object-method-30 (_type_) none) + (rigid-body-object-method-30 (_type_) object) (apply-gravity! (_type_ float) none) (rigid-body-object-method-32 (_type_) none) (alloc-rbody-control! (_type_ rigid-body-object-constants) none) diff --git a/goal_src/jak3/engine/physics/rigid-body.gc b/goal_src/jak3/engine/physics/rigid-body.gc index 4d6c61a8ed..d23a6745c4 100644 --- a/goal_src/jak3/engine/physics/rigid-body.gc +++ b/goal_src/jak3/engine/physics/rigid-body.gc @@ -776,13 +776,12 @@ (none) ) -;; WARN: Return type mismatch vector vs none. (defmethod rigid-body-control-method-25 ((this rigid-body-control) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-rotate*! gp-0 (-> this info cm-offset-joint) (-> this matrix)) (vector-! arg0 (-> this position) gp-0) ) - (none) + arg0 ) (defmethod debug-print-force-torque ((this rigid-body-control) (arg0 object)) @@ -1014,10 +1013,10 @@ (none) ) +;; WARN: Return type mismatch int vs object. (defmethod rigid-body-object-method-30 ((this rigid-body-object)) (ja-post) 0 - (none) ) (defmethod rbody-post ((this rigid-body-object)) diff --git a/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc b/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc index 9c5ab0df7c..efb559f70f 100644 --- a/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc +++ b/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc @@ -111,7 +111,7 @@ O(n^2) 'check everybody against everybody' collision loop." (update-from-spheres (_type_) none) (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none) (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol) - (add-sphere-with-mask-and-id (_type_ vector int int) symbol) + (add-sphere-with-mask-and-id (_type_ vector vector float int) symbol) (sphere-hash-method-32 (_type_ sphere int) symbol) ) ) @@ -136,7 +136,7 @@ O(n^2) 'check everybody against everybody' collision loop." (fill-actor-list-for-box (_type_ vector (pointer collide-shape) int) int) (fill-actor-list-for-sphere (_type_ vector vector float (pointer collide-shape) int int) int) (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int) - (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int) + (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape)) int) (spatial-hash-method-39 (_type_ object hash-object-info) int) ) ) diff --git a/goal_src/jak3/engine/target/target-handler.gc b/goal_src/jak3/engine/target/target-handler.gc index 8cdbe52c83..8b3102abb4 100644 --- a/goal_src/jak3/engine/target/target-handler.gc +++ b/goal_src/jak3/engine/target/target-handler.gc @@ -1327,7 +1327,7 @@ (let ((s5-1 (the-as object (-> arg3 param 1)))) (when (not (the-as uint s5-1)) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 object-type) (traffic-type guard-a)) (set! (-> s4-0 behavior) (the-as uint 4)) (set! (-> s4-0 id) (the-as uint 0)) (set! (-> s4-0 nav-mesh) #f) diff --git a/goal_src/jak3/game.gp b/goal_src/jak3/game.gp index 2c45eb55b7..b98bc025de 100644 --- a/goal_src/jak3/game.gp +++ b/goal_src/jak3/game.gp @@ -105,50 +105,51 @@ (cgo-file "wasseem.gd" common-dep) (cgo-file "wca.gd" common-dep) (cgo-file "wcb.gd" common-dep) +(cgo-file "wasleapr.gd" common-dep) (cgo-file "wcaseem.gd" common-dep) (cgo-file "wascast.gd" common-dep) -(cgo-file "desresc.gd" common-dep) -(cgo-file "wasleapr.gd" common-dep) +(cgo-file "cwi.gd" common-dep) ;; ctywide (cgo-file "wasall.gd" common-dep) -(cgo-file "wwd.gd" common-dep) ;; waswide +(cgo-file "desresc.gd" common-dep) (cgo-file "wsd.gd" common-dep) ;; wasdoors (garage) (cgo-file "waspgame.gd" common-dep) +(cgo-file "wwd.gd" common-dep) ;; waswide ; ;; arena (cgo-file "wasstada.gd" common-dep) (cgo-file "wasstadb.gd" common-dep) (cgo-file "wasstadc.gd" common-dep) (cgo-file "arenacst.gd" common-dep) ; ;; desert -; (cgo-file "desa.gd" common-dep) +(cgo-file "desa.gd" common-dep) (cgo-file "desb.gd" common-dep) (cgo-file "desbattl.gd" common-dep) -; (cgo-file "desbcst.gd" common-dep) -; (cgo-file "desc.gd" common-dep) -; (cgo-file "deschase.gd" common-dep) +(cgo-file "desbcst.gd" common-dep) +(cgo-file "desc.gd" common-dep) +(cgo-file "deschase.gd" common-dep) (cgo-file "desd.gd" common-dep) -; (cgo-file "dese.gd" common-dep) -; (cgo-file "deserrol.gd" common-dep) +(cgo-file "dese.gd" common-dep) +(cgo-file "deserrol.gd" common-dep) (cgo-file "desf.gd" common-dep) (cgo-file "desg.gd" common-dep) -; (cgo-file "desh.gd" common-dep) +(cgo-file "desh.gd" common-dep) (cgo-file "deshover.gd" common-dep) -; (cgo-file "deshunt.gd" common-dep) +(cgo-file "deshunt.gd" common-dep) (cgo-file "desinter.gd" common-dep) -; (cgo-file "desjump.gd" common-dep) +(cgo-file "desjump.gd" common-dep) (cgo-file "desliz.gd" common-dep) (cgo-file "desoasis.gd" common-dep) (cgo-file "desrace1.gd" common-dep) (cgo-file "desrace2.gd" common-dep) (cgo-file "desrally.gd" common-dep) -; (cgo-file "desrescc.gd" common-dep) -; (cgo-file "desrescg.gd" common-dep) +(cgo-file "desrescc.gd" common-dep) +(cgo-file "desrescg.gd" common-dep) (cgo-file "destrack.gd" common-dep) (cgo-file "dst.gd" common-dep) (cgo-file "desw.gd" common-dep) (cgo-file "desboss1.gd" common-dep) (cgo-file "desboss2.gd" common-dep) -; (cgo-file "oasiscst.gd" common-dep) -; (cgo-file "warpcast.gd" common-dep) ;; air train +(cgo-file "oasiscst.gd" common-dep) +(cgo-file "warpcast.gd" common-dep) ;; air train ; ;; nest (cgo-file "nsa.gd" common-dep) (cgo-file "nsb.gd" common-dep) @@ -173,54 +174,53 @@ (cgo-file "mined.gd" common-dep) (cgo-file "minee.gd" common-dep) ; ;; city -(cgo-file "cwi.gd" common-dep) ;; ctywide -; (cgo-file "cfa.gd" common-dep) ;; ctyfarm -; (cgo-file "cfb.gd" common-dep) -; (cgo-file "cgb.gd" common-dep) ;; ctygen -; (cgo-file "cia.gd" common-dep) ;; ctyind -; (cgo-file "cib.gd" common-dep) -; (cgo-file "cpo.gd" common-dep) ;; ctyport -; (cgo-file "cta.gd" common-dep) -; (cgo-file "ctb.gd" common-dep) -; (cgo-file "ctc.gd" common-dep) -; (cgo-file "ctypepa.gd" common-dep) ;; citizens -; (cgo-file "ctypepb.gd" common-dep) ;; predator -; (cgo-file "ctypepc.gd" common-dep) ;; empty -; (cgo-file "ctypesa.gd" common-dep) ;; guards -; (cgo-file "ctypesb.gd" common-dep) ;; metal heads -; (cgo-file "ctypesc.gd" common-dep) ;; kg -; (cgo-file "ctycara.gd" common-dep) ;; cars -; (cgo-file "ctycarb.gd" common-dep) ;; bikes -; (cgo-file "ctycarc.gd" common-dep) ;; hellcat -; (cgo-file "ctycarkg.gd" common-dep) ;; empty -; (cgo-file "onintent.gd" common-dep) -; (cgo-file "hhg.gd" common-dep) ;; hiphog -; (cgo-file "gga.gd" common-dep) ;; gungame -; (cgo-file "gungame1.gd" common-dep) -; (cgo-file "gungame2.gd" common-dep) -; (cgo-file "powergd.gd" common-dep) +(cgo-file "cfa.gd" common-dep) ;; ctyfarm +(cgo-file "cfb.gd" common-dep) +(cgo-file "cgb.gd" common-dep) ;; ctygen +(cgo-file "cia.gd" common-dep) ;; ctyind +(cgo-file "cib.gd" common-dep) +(cgo-file "cpo.gd" common-dep) ;; ctyport +(cgo-file "cta.gd" common-dep) +(cgo-file "ctb.gd" common-dep) +(cgo-file "ctc.gd" common-dep) +(cgo-file "ctypepa.gd" common-dep) ;; citizens +(cgo-file "ctypepb.gd" common-dep) ;; predator +(cgo-file "ctypepc.gd" common-dep) ;; empty +(cgo-file "ctypesa.gd" common-dep) ;; guards +(cgo-file "ctypesb.gd" common-dep) ;; metal heads +(cgo-file "ctypesc.gd" common-dep) ;; kg +(cgo-file "ctycara.gd" common-dep) ;; cars +(cgo-file "ctycarb.gd" common-dep) ;; bikes +(cgo-file "ctycarc.gd" common-dep) ;; hellcat +(cgo-file "ctycarkg.gd" common-dep) ;; empty +(cgo-file "onintent.gd" common-dep) +(cgo-file "hhg.gd" common-dep) ;; hiphog +(cgo-file "gga.gd" common-dep) ;; gungame +(cgo-file "gungame1.gd" common-dep) +(cgo-file "gungame2.gd" common-dep) +(cgo-file "powergd.gd" common-dep) (cgo-file "freehq.gd" common-dep) -; (cgo-file "vin.gd" common-dep) -; (cgo-file "freecast.gd" common-dep) -; (cgo-file "citycast.gd" common-dep) -; (cgo-file "gridcst.gd" common-dep) ;; city-destroy-grid-res -; (cgo-file "slumbset.gd" common-dep) ;; sewer-met-hum-intro +(cgo-file "vin.gd" common-dep) +(cgo-file "freecast.gd" common-dep) +(cgo-file "citycast.gd" common-dep) +(cgo-file "gridcst.gd" common-dep) ;; city-destroy-grid-res +(cgo-file "slumbset.gd" common-dep) ;; sewer-met-hum-intro ; ;; sewer (cgo-file "sea.gd" common-dep) -; (cgo-file "seb.gd" common-dep) -; (cgo-file "sec.gd" common-dep) -; (cgo-file "sed.gd" common-dep) -; (cgo-file "see.gd" common-dep) -; (cgo-file "sef.gd" common-dep) -; (cgo-file "seg.gd" common-dep) -; (cgo-file "seh.gd" common-dep) -; (cgo-file "sei.gd" common-dep) -; (cgo-file "sej.gd" common-dep) -; (cgo-file "sek.gd" common-dep) -; (cgo-file "sel.gd" common-dep) -; (cgo-file "sem.gd" common-dep) -; (cgo-file "sen.gd" common-dep) -; (cgo-file "seo.gd" common-dep) +(cgo-file "seb.gd" common-dep) +(cgo-file "sec.gd" common-dep) +(cgo-file "sed.gd" common-dep) +(cgo-file "see.gd" common-dep) +(cgo-file "sef.gd" common-dep) +(cgo-file "seg.gd" common-dep) +(cgo-file "seh.gd" common-dep) +(cgo-file "sei.gd" common-dep) +(cgo-file "sej.gd" common-dep) +(cgo-file "sek.gd" common-dep) +(cgo-file "sel.gd" common-dep) +(cgo-file "sem.gd" common-dep) +(cgo-file "sen.gd" common-dep) +(cgo-file "seo.gd" common-dep) ; ;; mhcity (cgo-file "mhca.gd" common-dep) (cgo-file "mhcb.gd" common-dep) @@ -245,11 +245,11 @@ (cgo-file "staa.gd" common-dep) (cgo-file "stb.gd" common-dep) ; ;; rubble -; (cgo-file "rbct.gd" common-dep) -; (cgo-file "ruba.gd" common-dep) -; (cgo-file "ruba2.gd" common-dep) -; (cgo-file "rubb.gd" common-dep) -; (cgo-file "rubc.gd" common-dep) +(cgo-file "rbct.gd" common-dep) +(cgo-file "ruba.gd" common-dep) +(cgo-file "ruba2.gd" common-dep) +(cgo-file "rubb.gd" common-dep) +(cgo-file "rubc.gd" common-dep) ; ;; comb (cgo-file "comba.gd" common-dep) (cgo-file "combb.gd" common-dep) @@ -276,8 +276,8 @@ (cgo-file "win.gd" common-dep) ;; wasintro (cgo-file "title.gd" common-dep) (cgo-file "inttitle.gd" common-dep) -; (cgo-file "intpalrf.gd" common-dep) ;; intro-palace-roof -; (cgo-file "ipf.gd" common-dep) ;; intro-palace-fall +(cgo-file "intpalrf.gd" common-dep) ;; intro-palace-roof +(cgo-file "ipf.gd" common-dep) ;; intro-palace-fall (cgo-file "introcst.gd" common-dep) ; ;; outro ; (cgo-file "outcast3.gd" common-dep) @@ -292,7 +292,7 @@ ;; test (cgo-file "halfpipe.gd" common-dep) ; ;; borrow -; (cgo-file "lashelin.gd" common-dep) +(cgo-file "lashelin.gd" common-dep) (cgo-file "lbbring1.gd" common-dep) (cgo-file "lbbring2.gd" common-dep) (cgo-file "lbbring3.gd" common-dep) @@ -309,28 +309,28 @@ (cgo-file "lbbtcha1.gd" common-dep) (cgo-file "lbbtcha2.gd" common-dep) (cgo-file "lbbtcha3.gd" common-dep) -; (cgo-file "lbiped.gd" common-dep) -; (cgo-file "lblowcst.gd" common-dep) -; (cgo-file "lblowtkg.gd" common-dep) -; (cgo-file "lblowtmh.gd" common-dep) -; (cgo-file "lbombbot.gd" common-dep) -; (cgo-file "lcitysml.gd" common-dep) -; (cgo-file "lctyass.gd" common-dep) -; (cgo-file "lctyblow.gd" common-dep) +(cgo-file "lbiped.gd" common-dep) +(cgo-file "lblowcst.gd" common-dep) +(cgo-file "lblowtkg.gd" common-dep) +(cgo-file "lblowtmh.gd" common-dep) +(cgo-file "lbombbot.gd" common-dep) +(cgo-file "lcitysml.gd" common-dep) +(cgo-file "lctyass.gd" common-dep) +(cgo-file "lctyblow.gd" common-dep) (cgo-file "lctydest.gd" common-dep) -; (cgo-file "lctyhijk.gd" common-dep) -; (cgo-file "lctypalt.gd" common-dep) -; (cgo-file "lctypatk.gd" common-dep) -; (cgo-file "lctyprot.gd" common-dep) -; (cgo-file "lctysnpr.gd" common-dep) -; (cgo-file "ldamklev.gd" common-dep) -; (cgo-file "ldampeck.gd" common-dep) -; (cgo-file "ldampksm.gd" common-dep) -; (cgo-file "ldamsig.gd" common-dep) -; (cgo-file "ldax.gd" common-dep) -; (cgo-file "ldesgcst.gd" common-dep) -; (cgo-file "ldmpckgn.gd" common-dep) -; (cgo-file "lerrol.gd" common-dep) +(cgo-file "lctyhijk.gd" common-dep) +(cgo-file "lctypalt.gd" common-dep) +(cgo-file "lctypatk.gd" common-dep) +(cgo-file "lctyprot.gd" common-dep) +(cgo-file "lctysnpr.gd" common-dep) +(cgo-file "ldamklev.gd" common-dep) +(cgo-file "ldampeck.gd" common-dep) +(cgo-file "ldampksm.gd" common-dep) +(cgo-file "ldamsig.gd" common-dep) +(cgo-file "ldax.gd" common-dep) +(cgo-file "ldesgcst.gd" common-dep) +(cgo-file "ldmpckgn.gd" common-dep) +(cgo-file "lerrol.gd" common-dep) (cgo-file "lfacb.gd" common-dep) (cgo-file "lfaccar.gd" common-dep) (cgo-file "lfaccity.gd" common-dep) @@ -339,60 +339,60 @@ (cgo-file "lfactory.gd" common-dep) (cgo-file "lform.gd" common-dep) (cgo-file "lforp.gd" common-dep) -; (cgo-file "lforring.gd" common-dep) +(cgo-file "lforring.gd" common-dep) (cgo-file "lfreeout.gd" common-dep) -; (cgo-file "lgunnorm.gd" common-dep) -; (cgo-file "lgunrnc.gd" common-dep) -; (cgo-file "ljak.gd" common-dep) -; (cgo-file "ljakc.gd" common-dep) -; (cgo-file "ljakcklv.gd" common-dep) -; (cgo-file "ljakklev.gd" common-dep) -; (cgo-file "ljakndax.gd" common-dep) -; (cgo-file "ljaksig.gd" common-dep) -; (cgo-file "ljinx.gd" common-dep) -; (cgo-file "ljkcdmkl.gd" common-dep) -; (cgo-file "ljkdmpk.gd" common-dep) -; (cgo-file "ljkdxvin.gd" common-dep) -; (cgo-file "ljkfeet.gd" common-dep) -; (cgo-file "ljndklev.gd" common-dep) -; (cgo-file "lkeira.gd" common-dep) +(cgo-file "lgunnorm.gd" common-dep) +(cgo-file "lgunrnc.gd" common-dep) +(cgo-file "ljak.gd" common-dep) +(cgo-file "ljakc.gd" common-dep) +(cgo-file "ljakcklv.gd" common-dep) +(cgo-file "ljakklev.gd" common-dep) +(cgo-file "ljakndax.gd" common-dep) +(cgo-file "ljaksig.gd" common-dep) +(cgo-file "ljinx.gd" common-dep) +(cgo-file "ljkcdmkl.gd" common-dep) +(cgo-file "ljkdmpk.gd" common-dep) +(cgo-file "ljkdxvin.gd" common-dep) +(cgo-file "ljkfeet.gd" common-dep) +(cgo-file "ljndklev.gd" common-dep) +(cgo-file "lkeira.gd" common-dep) (cgo-file "lkleever.gd" common-dep) -; (cgo-file "lmech.gd" common-dep) -; (cgo-file "lmhca.gd" common-dep) -; (cgo-file "lmhcb.gd" common-dep) +(cgo-file "lmech.gd" common-dep) +(cgo-file "lmhca.gd" common-dep) +(cgo-file "lmhcb.gd" common-dep) (cgo-file "lnstcst.gd" common-dep) (cgo-file "lnstoa.gd" common-dep) (cgo-file "lnstobb.gd" common-dep) (cgo-file "lnstobc.gd" common-dep) -; (cgo-file "loninsim.gd" common-dep) -; (cgo-file "loutro.gd" common-dep) -; (cgo-file "loutro2.gd" common-dep) -; (cgo-file "loutro3.gd" common-dep) -; (cgo-file "lpatk.gd" common-dep) -; (cgo-file "lpatkcs.gd" common-dep) -; (cgo-file "lprecc.gd" common-dep) -; (cgo-file "lprenme.gd" common-dep) -; (cgo-file "lptrl.gd" common-dep) -; (cgo-file "lsamos.gd" common-dep) -; (cgo-file "lseemwca.gd" common-dep) -; (cgo-file "lsig.gd" common-dep) -; (cgo-file "lsigjakc.gd" common-dep) -; (cgo-file "lsigklv.gd" common-dep) -; (cgo-file "lsnkwhls.gd" common-dep) -; (cgo-file "ltnfxhip.gd" common-dep) -; (cgo-file "ltnjxhip.gd" common-dep) +(cgo-file "loninsim.gd" common-dep) +(cgo-file "loutro.gd" common-dep) +(cgo-file "loutro2.gd" common-dep) +(cgo-file "loutro3.gd" common-dep) +(cgo-file "lpatk.gd" common-dep) +(cgo-file "lpatkcs.gd" common-dep) +(cgo-file "lprecc.gd" common-dep) +(cgo-file "lprenme.gd" common-dep) +(cgo-file "lptrl.gd" common-dep) +(cgo-file "lsamos.gd" common-dep) +(cgo-file "lseemwca.gd" common-dep) +(cgo-file "lsig.gd" common-dep) +(cgo-file "lsigjakc.gd" common-dep) +(cgo-file "lsigklv.gd" common-dep) +(cgo-file "lsnkwhls.gd" common-dep) +(cgo-file "ltnfxhip.gd" common-dep) +(cgo-file "ltnjxhip.gd" common-dep) (cgo-file "ltorn.gd" common-dep) -; (cgo-file "ltornjnx.gd" common-dep) -; (cgo-file "ltornsam.gd" common-dep) +(cgo-file "ltornjnx.gd" common-dep) +(cgo-file "ltornsam.gd" common-dep) (cgo-file "ltowa.gd" common-dep) (cgo-file "ltowb.gd" common-dep) -; (cgo-file "ltowcity.gd" common-dep) -; (cgo-file "ltrtwhls.gd" common-dep) -; (cgo-file "lvincst.gd" common-dep) +(cgo-file "ltowcity.gd" common-dep) +(cgo-file "ltrtwhls.gd" common-dep) +(cgo-file "lvincst.gd" common-dep) (cgo-file "lwasbbv.gd" common-dep) (cgo-file "lwassig.gd" common-dep) -; (cgo-file "lwlandm.gd" common-dep) -; (cgo-file "lwstdpck.gd" common-dep) +(cgo-file "lwlandm.gd" common-dep) +(cgo-file "lwstdpck.gd" common-dep) ;;;;;;;;;;;;;;;;;;;;; ;; ANIMATIONS diff --git a/goal_src/jak3/kernel/gkernel-h.gc b/goal_src/jak3/kernel/gkernel-h.gc index 26947f288d..fd9f8b1c0c 100644 --- a/goal_src/jak3/kernel/gkernel-h.gc +++ b/goal_src/jak3/kernel/gkernel-h.gc @@ -503,6 +503,8 @@ ) ) +(define-extern sql-query (function string sql-result)) + (defmethod new sql-result ((allocation symbol) (type-to-make type) (num-elts int)) (let ((v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* num-elts 4)))))) (set! (-> v0-0 allocated-length) num-elts) diff --git a/goal_src/jak3/levels/city/bombbot/bombbot-h.gc b/goal_src/jak3/levels/city/bombbot/bombbot-h.gc index 5e501386a9..e812ebf7f1 100644 --- a/goal_src/jak3/levels/city/bombbot/bombbot-h.gc +++ b/goal_src/jak3/levels/city/bombbot/bombbot-h.gc @@ -7,3 +7,18 @@ ;; DECOMP BEGINS +(deftype bombbot-node (structure) + ((position vector :inline) + (nav-mesh-id uint32) + (pos-x float :overlay-at (-> position data 0)) + (pos-y float :overlay-at (-> position data 1)) + (pos-z float :overlay-at (-> position data 2)) + ) + ) + + +(deftype bombbot-path (structure) + ((node-count uint16) + (node (inline-array bombbot-node)) + ) + ) diff --git a/goal_src/jak3/levels/city/bombbot/bombbot-path.gc b/goal_src/jak3/levels/city/bombbot/bombbot-path.gc index aa2e7692f3..5bf7a73869 100644 --- a/goal_src/jak3/levels/city/bombbot/bombbot-path.gc +++ b/goal_src/jak3/levels/city/bombbot/bombbot-path.gc @@ -7,3 +7,323 @@ ;; DECOMP BEGINS +(define *bombbot-path-1* (new 'static 'bombbot-path + :node-count #x1a + :node (new 'static 'inline-array bombbot-node 26 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3188752.0 :y 36837.375 :z 4562738.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3368644.2 :y 38390.58 :z 4564130.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3344854.8 :y 37134.336 :z 4787486.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3156208.8 :y 36825.906 :z 4910489.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3129548.5 :y 21854.617 :z 4974263.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3042602.5 :y 21854.617 :z 5196430.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3041685.0 :y 23431.578 :z 5524438.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2993126.5 :y 37686.887 :z 5613157.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2495119.0 :y 35662.645 :z 5980937.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2339598.0 :y 21355.725 :z 6003916.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2262150.2 :y 59038.105 :z 5923388.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2180239.0 :y 35246.08 :z 5821602.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1952091.8 :y 35853.516 :z 5631917.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1751604.9 :y 35736.37 :z 5485034.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1448083.0 :y 35713.023 :z 5357034.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1314705.0 :y 35742.105 :z 5355600.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1213759.1 :y 35739.24 :z 5574696.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1029807.7 :y 21646.541 :z 5602098.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 859164.25 :y 35728.18 :z 5558681.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 599088.75 :y 35690.496 :z 5614919.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 425897.56 :y 21671.936 :z 5574573.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 319768.56 :y 35787.57 :z 5516492.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 198957.06 :y 35702.375 :z 5363874.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -16781.72 :y 35688.86 :z 5447925.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -171277.92 :y 35687.63 :z 5526486.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -245257.83 :y 35740.47 :z 5498510.0) + :nav-mesh-id #x48cc + ) + ) + ) + ) + +(define *bombbot-path-2* (new 'static 'bombbot-path + :node-count #x13 + :node (new 'static 'inline-array bombbot-node 19 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 678289.0 :y 75894.375 :z 7158250.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 456621.66 :y 38754.305 :z 7149895.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 306988.66 :y 35926.426 :z 7006288.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 90236.11 :y 35590.965 :z 6990314.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -12922.471 :y 37856.05 :z 7003176.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -181574.86 :y 38684.67 :z 6889676.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -353365.2 :y 38691.227 :z 6788505.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -536272.5 :y 38694.91 :z 6712606.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -716230.25 :y 38694.91 :z 6647766.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -971501.2 :y 35638.887 :z 6573997.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -944987.75 :y 39357.234 :z 6461029.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -891641.44 :y 35729.0 :z 6265159.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -728891.0 :y 22151.578 :z 6013049.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -691502.7 :y 58701.414 :z 5967584.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -663629.44 :y 59321.14 :z 5927321.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -627445.4 :y 36782.9 :z 5872270.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -499105.38 :y 39462.91 :z 5756435.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -312820.12 :y 39460.863 :z 5599559.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -285647.66 :y 35911.68 :z 5513133.5) + :nav-mesh-id #x48cc + ) + ) + ) + ) + +(define *bombbot-path-3* (new 'static 'bombbot-path + :node-count #x1e + :node (new 'static 'inline-array bombbot-node 30 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 898383.44 :y 75904.2 :z 7154400.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1118834.2 :y 37430.066 :z 7158537.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1231044.2 :y 35595.06 :z 7033977.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1379135.1 :y 35604.89 :z 6973930.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1589264.0 :y 38142.363 :z 7005346.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1762479.8 :y 38840.32 :z 6881197.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1929727.6 :y 38840.32 :z 6786538.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2108796.0 :y 38839.91 :z 6696426.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2299584.0 :y 38838.68 :z 6626221.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2481209.0 :y 38954.598 :z 6580919.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2566069.8 :y 35751.527 :z 6524190.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2466766.5 :y 35799.86 :z 6277282.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2411699.5 :y 21411.84 :z 6167714.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2305486.5 :y 27477.197 :z 5986835.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2269335.2 :y 58792.754 :z 5942926.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2240413.0 :y 59187.2 :z 5908069.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2206146.2 :y 38379.52 :z 5861088.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2025377.4 :y 35845.734 :z 5707038.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1818201.8 :y 35773.234 :z 5546884.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1670160.0 :y 35714.664 :z 5444770.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1417973.4 :y 35841.23 :z 5324144.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1311366.8 :y 35716.71 :z 5391236.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1236283.0 :y 39460.863 :z 5595545.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 915504.75 :y 39461.273 :z 5583134.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 672419.44 :y 39462.504 :z 5586779.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 337580.03 :y 39460.863 :z 5599272.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 211252.02 :y 39461.273 :z 5322137.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -17915.904 :y 39462.504 :z 5413191.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -151299.28 :y 35697.05 :z 5497281.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -220205.47 :y 35749.477 :z 5472501.0) + :nav-mesh-id #x48cc + ) + ) + ) + ) diff --git a/goal_src/jak3/levels/city/bombbot/bombbot.gc b/goal_src/jak3/levels/city/bombbot/bombbot.gc index 7be9b3f4f8..e5c6198b30 100644 --- a/goal_src/jak3/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak3/levels/city/bombbot/bombbot.gc @@ -7,3 +7,5127 @@ ;; DECOMP BEGINS +(define *bombbot-hint* (the-as sound-id 1)) + +(define *bombbot-hint-time* 0.0) + +(deftype bombbot-hud (hud) + () + ) + + +(defmethod draw ((this bombbot-hud)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + 256 + (+ (the int (* 50.0 (-> this offset))) 376) + ) + (set! (-> this sprites 0 pos z) #xfffff0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 62 -9) + (set! (-> this sprites 1 pos z) #xfffff0) + (let ((f0-4 (* 0.01 (the float (-> this values 0 current))))) + (set! (-> this sprites 1 color x) 0) + (set! (-> this sprites 1 color y) 0) + (set! (-> this sprites 1 color z) 0) + (set! (-> this sprites 1 scale-x) (* -30.5 (- 1.0 f0-4))) + ) + (set! (-> this sprites 1 scale-y) 4.8) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this bombbot-hud)) + (set! (-> this values 0 target) (the int (-> *game-info* health-bar))) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this bombbot-hud)) + (set! (-> this level) (level-get *level* 'lbombbot)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #x950))) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture common-white common))) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 5.0) + 0 + (none) + ) + +(define *bombbot-body-constants* (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.8 + :angular-damping 0.8 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2) (meters 2) (meters 2)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.02 + :gravity (meters 10) + :idle-distance (meters 200) + :attack-force-scale 2.0 + ) + :name '*bombbot-body-constants* + ) + ) + +(defpart 2055 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y :copy scale-x) + (:r 196.0 128.0) + (:g 196.0 128.0) + (:b 196.0 128.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2056 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 40)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 2057 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2058 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2059 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:birth-func 'birth-func-laser-pointer) + (:num 1.0) + (:scale-x (meters 0.15) (meters 0.1)) + (:scale-y (meters 40)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 64.0 32.0) + (:fade-a -4.266667) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x401a00 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + #x403900 + ) + ) + (:func 'sparticle-texture-animate) + ) + ) + +(defpart 2060 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.05)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 100.0 28.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +(defpart 2061 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b 32.0 32.0) + (:a 32.0 32.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +(defpart 2062 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g :copy r) + (:b 128.0 64.0) + (:a 96.0 32.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +(defpartgroup group-bombbot-bomb-warning-glow + :id 525 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2063 :flags (sp6)) (sp-item 2064 :flags (sp6))) + ) + +(defpart 2063 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 1361.25)) + (:fade-a -0.32) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 2064 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 32.0) + (:omega (degrees 1361.25)) + (:fade-a -0.64) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defskelgroup skel-bombbot-bomb bombbot-bomb bombbot-bomb-lod0-jg bombbot-bomb-idle-ja + ((bombbot-bomb-lod0-mg (meters 20)) (bombbot-bomb-lod1-mg (meters 40)) (bombbot-bomb-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :shadow bombbot-bomb-shadow-mg + ) + +(deftype bombbot-bomb (process-focusable) + ((parent (pointer process-focusable) :override) + (root collide-shape-moving :override) + (explode-part sparticle-launch-control) + (rot-axis vector :inline) + (rot-angle float) + (warning-glow-part sparticle-launch-control) + (next-countdown-tick time-frame) + (fizzle-timer time-frame) + ) + (:state-methods + idle + smoke + explode + back + ) + (:methods + (bombbot-bomb-method-32 (_type_) none) + (bombbot-bomb-method-33 (_type_) none) + ) + ) + + +(defmethod bombbot-bomb-method-32 ((this bombbot-bomb)) + (local-vars (at-0 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> this root))) + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-0 (-> s5-0 root-prim))) + (set! (-> a1-0 start-pos quad) (-> s5-0 trans quad)) + (let ((a0-2 (-> a1-0 move-dist))) + (.lvf vf1 (&-> (-> s5-0 transv) quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-2 quad) vf1) + ) + (let ((a0-3 a1-0)) + (set! (-> a0-3 radius) (-> v1-0 prim-core world-sphere w)) + (set! (-> a0-3 collide-with) (-> v1-0 prim-core collide-with)) + (set! (-> a0-3 ignore-process0) this) + (set! (-> a0-3 ignore-process1) #f) + (set! (-> a0-3 ignore-pat) (-> s5-0 pat-ignore-mask)) + (set! (-> a0-3 action-mask) (collide-action solid)) + ) + ) + (fill-using-line-sphere *collide-cache* a1-0) + ) + (integrate-and-collide! s5-0 (-> s5-0 transv)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector-cross! s5-1 (-> this root transv) *y-vector*) + (vector-normalize! s5-1 1.0) + (set! (-> this rot-axis quad) (-> s5-1 quad)) + ) + (let ((s5-2 (new 'stack-no-clear 'quaternion))) + (new 'stack-no-clear 'vector) + (quaternion-vector-angle! s5-2 (-> this rot-axis) (* (-> this rot-angle) (seconds-per-frame))) + (quaternion-normalize! s5-2) + (quaternion*! (-> this root quat) s5-2 (-> this root quat)) + ) + (quaternion-normalize! (-> this root quat)) + (let ((a1-6 (-> this root))) + (when (logtest? (-> a1-6 status) (collide-status touch-surface)) + (let ((a0-14 (-> a1-6 transv))) + (let ((v1-20 (-> a1-6 transv))) + (let ((a1-7 (-> a1-6 transv))) + (let ((a2-8 (* -15.0 (seconds-per-frame)))) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-7 quad)) + ) + (.lvf vf4 (&-> v1-20 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 (&-> a0-14 quad) vf6) + ) + (set! (-> this rot-angle) (* -4.0 (vector-length (-> this root transv)))) + ) + ) + 0 + (none) + ) + ) + +(defmethod bombbot-bomb-method-33 ((this bombbot-bomb)) + (let ((s5-0 (- (current-time) (-> this state-time)))) + (when (< (seconds 7) s5-0) + (let ((f0-0 (rand-vu-float-range 0.5 0.8))) + (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) + ) + ) + (if (< (seconds 9) s5-0) + (go (method-of-object this explode)) + ) + (let* ((v1-11 (* s5-0 s5-0)) + (a0-4 2700) + (v1-12 (- (* a0-4 a0-4) v1-11)) + ) + (when (< v1-12 (-> this next-countdown-tick)) + (let ((a0-8 540)) + (set! (-> this next-countdown-tick) (the-as time-frame (- v1-12 (mod v1-12 (* a0-8 a0-8))))) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector<-cspace! s5-1 (-> this node-list data 7)) + (spawn (-> this warning-glow-part) s5-1) + (vector<-cspace! s5-1 (-> this node-list data 6)) + (spawn (-> this warning-glow-part) s5-1) + (vector<-cspace! s5-1 (-> this node-list data 5)) + (spawn (-> this warning-glow-part) s5-1) + (vector<-cspace! s5-1 (-> this node-list data 4)) + (spawn (-> this warning-glow-part) s5-1) + ) + (sound-play "grenade-timer") + ) + ) + ) + 0 + (none) + ) + +(defbehavior bombbot-bomb-handler bombbot-bomb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case arg2 + (('attack) + (cond + ((= (-> arg0 type) target) + (let* ((gp-0 (ppointer->process (-> self parent))) + (s3-0 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + (s5-0 (new 'stack-no-clear 'traj3d-params)) + (gp-1 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (when s3-0 + (vector-rotate-around-y! gp-1 *x-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (let ((s2-1 (-> s5-0 dest))) + (let ((v1-6 (get-trans s3-0 3))) + (let ((a0-6 gp-1)) + (let ((a1-7 8192.0)) + (.mov vf7 a1-7) + ) + (.lvf vf5 (&-> a0-6 quad)) + ) + (.lvf vf4 (&-> v1-6 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-1 quad) vf6) + ) + (let ((s1-1 (-> s5-0 dest))) + (let ((s2-2 (-> s5-0 dest))) + (let ((v1-8 (get-transv s3-0))) + (let ((a0-9 2.0)) + (.mov vf7 a0-9) + ) + (.lvf vf5 (&-> v1-8 quad)) + ) + (.lvf vf4 (&-> s2-2 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 (&-> s1-1 quad) vf6) + ) + (set! (-> s5-0 src quad) (-> self root trans quad)) + (set! (-> s5-0 initial-tilt) (* 182.04445 (rand-vu-float-range 30.0 50.0))) + (set! (-> s5-0 gravity) 184320.0) + (when (traj3d-calc-initial-velocity-using-tilt s5-0) + (vector-! gp-1 (-> self root trans) (target-pos 0)) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (set! (-> s4-0 quad) (-> s5-0 initial-velocity quad)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (cond + ((< 0.7 (vector-dot gp-1 s4-0)) + (set! (-> self root transv quad) (-> s5-0 initial-velocity quad)) + ) + (else + (let ((t9-10 vector-normalize!) + (a0-22 gp-1) + (v1-20 (-> s5-0 initial-velocity)) + ) + (t9-10 a0-22 (sqrtf (+ (* (-> v1-20 x) (-> v1-20 x)) (* (-> v1-20 z) (-> v1-20 z))))) + ) + (set! (-> gp-1 y) (-> s5-0 initial-velocity y)) + (set! (-> self root transv quad) (-> gp-1 quad)) + ) + ) + (go-virtual back) + ) + ) + ) + ) + (else + #f + ) + ) + ) + ) + ) + ) + +(defstate back (bombbot-bomb) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (let* ((s4-0 proc) + (s3-0 (if (type? s4-0 process-drawable) + s4-0 + ) + ) + ) + (when s3-0 + (let ((a0-3 (-> (the-as process-focusable s3-0) root)) + (a1-2 (new 'stack-no-clear 'collide-query)) + ) + (let ((v1-4 (-> self root root-prim prim-core)) + (a0-5 (-> a0-3 root-prim prim-core)) + ) + 0.0 + (set! (-> a1-2 start-pos quad) (-> v1-4 world-sphere quad)) + (vector-! (-> a1-2 move-dist) (the-as vector a0-5) (the-as vector v1-4)) + ) + (let ((v1-5 a1-2)) + (set! (-> v1-5 radius) 40.96) + (set! (-> v1-5 collide-with) (collide-spec backgnd)) + (set! (-> v1-5 ignore-process0) #f) + (set! (-> v1-5 ignore-process1) #f) + (set! (-> v1-5 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-5 action-mask) (collide-action solid)) + ) + (when (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0) + (cond + ((logtest? (process-mask vehicle) (-> (the-as process-focusable s3-0) mask)) + (let ((s4-2 + (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-focusable s3-0) root trans) (-> self root trans)) + ) + ) + 0.0 + (let ((f30-0 (-> self root root-prim local-sphere w))) + (vector-normalize! s4-2 1.0) + (+! (-> s4-2 y) 0.25) + (if (< 0.0 f30-0) + (send-event + proc + 'attack + (-> block param 0) + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 20.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor (* 0.000012207031 f30-0)) + (attacker-velocity s4-2) + ) + ) + ) + ) + ) + ) + ) + (else + (send-event + proc + 'attack + (-> block param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'explode)) + ) + ) + ) + ) + ) + ) + ) + ) + (go-virtual explode) + ) + (else + #f + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-3 (-> self root root-prim))) + (logior! (-> v1-3 prim-core collide-with) (collide-spec enemy)) + (logclear! (-> v1-3 prim-core collide-with) (collide-spec jak)) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (set! (-> self root transv y) (- (-> self root transv y) (* 184320.0 (seconds-per-frame)))) + (bombbot-bomb-method-32 self) + (if (time-elapsed? (-> self state-time) (seconds 5)) + (go-virtual explode) + ) + (ja :num! (loop!)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (if (logtest? (-> self root status) (collide-status touch-surface)) + (go-virtual explode) + ) + ) + ) + +(defstate explode (bombbot-bomb) + :virtual #t + :enter (behavior () + (ja-channel-set! 0) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "grenade-explode") + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 12288.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 219)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 self) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (cond + ((not (time-elapsed? (-> self state-time) (seconds 2))) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (+! (-> a1-0 y) 2048.0) + (spawn (-> self explode-part) a1-0) + ) + ) + ((not (-> self child)) + (deactivate self) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +(define *daxter-speech* 0) + +(defstate smoke (bombbot-bomb) + :virtual #t + :event bombbot-bomb-handler + :enter (behavior () + (let* ((v1-0 2700) + (v1-1 (* v1-0 v1-0)) + (a0-0 540) + ) + (set! (-> self next-countdown-tick) (the-as time-frame (- v1-1 (mod v1-1 (* a0-0 a0-0))))) + ) + (set-time! (-> self state-time)) + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (= *bombbot-hint* 1) + (< (the int *bombbot-hint-time*) (current-time)) + (< (vector-vector-distance (-> self root trans) (camera-pos)) 204800.0) + ) + (set! *bombbot-hint-time* (the float (+ (current-time) (seconds 40)))) + (let ((v1-18 *daxter-speech*)) + (cond + ((zero? v1-18) + (talker-spawn-func (-> *talker-speech* 168) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-18 1) + (talker-spawn-func (-> *talker-speech* 166) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-18 2) + (talker-spawn-func (-> *talker-speech* 167) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! *daxter-speech* (+ *daxter-speech* 1)) + (when (= *daxter-speech* 3) + (set! *daxter-speech* 0) + 0 + ) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (bombbot-bomb-method-33 self) + (ja :num! (loop!)) + ) + :code sleep-code + :post ja-post + ) + +(defstate idle (bombbot-bomb) + :virtual #t + :event bombbot-bomb-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (set! (-> self root transv y) (- (-> self root transv y) (* 184320.0 (seconds-per-frame)))) + (bombbot-bomb-method-32 self) + (if (time-elapsed? (-> self state-time) (seconds 5)) + (go-virtual explode) + ) + (if (< (vector-length (-> self root transv)) 2048.0) + (go-virtual smoke) + ) + (ja :num! (loop!)) + ) + :code sleep-code + :post (behavior () + (transform-post) + ) + ) + +(defmethod deactivate ((this bombbot-bomb)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this explode-part)) + (kill-particles (-> this explode-part)) + ) + (if (nonzero? (-> this warning-glow-part)) + (kill-particles (-> this warning-glow-part)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch process-focusable vs bombbot-bomb. +(defmethod relocate ((this bombbot-bomb) (offset int)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) offset) + ) + (if (nonzero? (-> this warning-glow-part)) + (&+! (-> this warning-glow-part) offset) + ) + (the-as bombbot-bomb ((method-of-type process-focusable relocate) this offset)) + ) + +(defun bombbot-bomb-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((f0-0 (rand-vu-float-range 1.2 1.4))) + (vector--float*! arg2 arg3 (-> arg0 surface-normal) (* (vector-dot arg3 (-> arg0 surface-normal)) f0-0)) + ) + (-> arg0 status) + ) + +(defbehavior bombbot-bomb-init-by-other bombbot-bomb ((arg0 vector) (arg1 vector)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) bombbot-bomb-reaction) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec backgnd jak bot enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 2048.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-9 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s4-0 max-iteration-count) (the-as uint 8)) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot-bomb" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> self root scale) 0.5 0.5 0.5 1.0) + (quaternion-set! (-> self root quat) 0.0 0.0 0.0 1.0) + (set! (-> self root transv quad) (-> arg1 quad)) + (set! (-> self draw light-index) (the-as uint 10)) + (set! (-> self root dynam gravity y) 184320.0) + (set! (-> self root dynam gravity-length) 184320.0) + (set! (-> self root dynam gravity-max) 184320.0) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (vector-cross! s5-2 arg1 *z-vector*) + (vector-normalize! s5-2 1.0) + (set! (-> self rot-axis quad) (-> s5-2 quad)) + ) + (set! (-> self rot-angle) 65536.0) + (set! (-> self explode-part) (create-launch-control (-> *part-group-id-table* 219) self)) + (set! (-> self warning-glow-part) (create-launch-control (-> *part-group-id-table* 525) self)) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual idle) + ) + +(defskelgroup skel-bombbot bombbot bombbot-lod0-jg bombbot-idle-ja + ((bombbot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :shadow bombbot-shadow-mg + ) + +(deftype bombbot-foot (structure) + ((pos-offset vector :inline) + (joint-index uint32) + (offset float) + (position vector :inline) + (next-position vector :inline) + (real-position vector :inline) + (speed vector :inline) + (moving symbol) + (main-y float) + (delta-y float) + ) + ) + + +(deftype bombbot (nav-enemy) + ((joint-ik joint-mod-ik 4) + (feet bombbot-foot 4 :inline) + (legs-strength float 4) + (last-trans vector :inline) + (linear-speed vector :inline) + (last-quat quaternion :inline) + (y-angular-velocity float) + (main-quat quaternion :inline) + (main-spd-y float) + (main-pos-y float) + (main-pos vector :inline) + (city-path bombbot-path) + (current-node uint32) + (shot-count uint32) + (next-shoot time-frame) + (stop-shoot time-frame) + (next-target time-frame) + (start-target time-frame) + (beep-time time-frame) + (target-pos vector :inline) + (start-target-pos vector :inline) + (start-target-vel vector :inline) + (target-delta vector :inline) + (top-quat quaternion :inline) + (gun-swivel-quat quaternion :inline) + (gun-quat quaternion :inline) + (angle-turret float) + (angle-gun float) + (extra-angle-gun float) + (drop-angle float) + (drop-num uint32) + (hit-axis vector :inline) + (rigidbody rigid-body-control) + (info rigid-body-object-constants) + (explosing symbol) + (minimap connection-minimap) + (head-sound sound-id) + (cannon-sound sound-id) + (last-head-roty-speed float) + (head-roty-speed float) + (last-cannon-roty-speed float) + (cannon-roty-speed float) + (shoot-duration float) + (y-angle float) + (gun-rotation-speed float) + (gun-type uint32) + (drop-mask uint32) + (attacker-info city-attacker-info) + (mission-squad mission-squad-control) + (max-hit-points float) + ) + (:state-methods + explode + blow-wall + undefined + drop-bombs + ) + (:methods + (bombbot-method-194 (_type_) none) + (bombbot-method-195 (_type_) none) + (bombbot-method-196 (_type_ vector) none) + (bombbot-method-197 (_type_) none) + (bombbot-method-198 (_type_) none) + (bombbot-method-199 (_type_) none) + (toggle-cspec-deadly (_type_ symbol int) none) + (valid-target? (_type_ process-focusable) object) + (bombbot-method-202 (_type_) none) + (bombbot-method-203 (_type_) none) + (bombbot-method-204 (_type_) none) + (bombbot-method-205 (_type_) none) + (fire-shot (_type_ vector vector) (pointer projectile)) + (bombbot-method-207 (_type_) symbol) + (bombbot-method-208 (_type_ vector vector) vector) + ) + ) + + +(define *bombbot-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim 3 + :knocked-land-anim 3 + :die-anim 3 + :die-falling-anim 3 + :victory-anim -1 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint -1 + :look-at-joint 4 + :bullseye-joint 4 + :sound-hit (static-sound-name "bb-impact") + :sound-die (static-sound-name "bombbot-die") + :notice-distance (meters 20) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 100.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 400) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 400) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 2) + :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! (-> *bombbot-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + +(define *bombbot-ik-limb-setup* (new 'static 'boxed-array :type ik-limb-setup + (new 'static 'ik-limb-setup :elbow-index 19 :hand-dist 14880.768) + (new 'static 'ik-limb-setup :elbow-index 13 :hand-dist -14880.768) + (new 'static 'ik-limb-setup :elbow-index 15 :hand-dist 14880.768) + (new 'static 'ik-limb-setup :elbow-index 17 :hand-dist -14880.768) + ) + ) + +(defun bombbot-do-spline ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +(defmethod toggle-cspec-deadly ((this bombbot) (arg0 symbol) (arg1 int)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a3-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) + (when (= (-> a3-1 prim-id) arg1) + (cond + (arg0 + (logior! (-> a3-1 prim-core action) (collide-action deadly)) + (set! (-> a3-1 prim-core collide-as) (collide-spec enemy)) + (set! (-> a3-1 prim-core collide-with) + (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + ) + (else + (logclear! (-> a3-1 prim-core action) (collide-action deadly)) + (set! (-> a3-1 prim-core collide-as) (collide-spec enemy)) + (set! (-> a3-1 prim-core collide-with) + (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod bombbot-method-204 ((this bombbot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s1-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> this node-list data 6 bone transform)) + (v1-2 (-> a2-0 rvec quad)) + (a0-1 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s1-0 rvec quad) v1-2) + (set! (-> s1-0 uvec quad) a0-1) + (set! (-> s1-0 fvec quad) a1-0) + (set! (-> s1-0 trans quad) a2-1) + ) + (new 'stack-no-clear 'vector) + (let ((s3-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (f30-0 (lerp-scale 1.0 0.0 (* 0.0033333334 (the float (- (-> this next-target) (current-time)))) 2.5 3.5)) + ) + (if (= (-> this focus handle) #f) + (set! f30-0 0.0) + ) + (matrix->trans s1-0 gp-0) + (let ((a1-3 gp-0)) + (let ((v1-10 gp-0)) + (let ((a0-4 (-> s1-0 fvec))) + (let ((a2-6 8192.0)) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> a1-3 quad) vf6) + ) + (vector-normalize-copy! s5-0 (-> s1-0 fvec) 819200.0) + (set! (-> s3-0 start-pos quad) (-> gp-0 quad)) + (set! (-> s3-0 move-dist quad) (-> s5-0 quad)) + (let ((v1-13 s3-0)) + (set! (-> v1-13 radius) 40.96) + (set! (-> v1-13 collide-with) (collide-spec backgnd enemy hit-by-others-list)) + (set! (-> v1-13 ignore-process0) this) + (set! (-> v1-13 ignore-process1) #f) + (set! (-> v1-13 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-13 action-mask) (collide-action solid)) + ) + (let ((f0-4 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) + (when (>= f0-4 0.0) + (vector+float*! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist) f0-4) + (vector-float*! s5-0 s5-0 f0-4) + (let* ((s1-1 (-> s3-0 best-other-tri collide-ptr)) + (s2-1 (if (type? s1-1 collide-shape-prim) + s1-1 + ) + ) + (v1-22 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s3-0 start-pos) s4-0) 1638.4)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> s4-0 quad)) + (vector+! s3-1 s3-1 v1-22) + (cond + (s2-1 + (launch-particles (-> *part-id-table* 2061) s3-1) + (launch-particles (-> *part-id-table* 2060) s3-1) + ) + (else + (launch-particles (-> *part-id-table* 2062) s3-1) + ) + ) + ) + ) + ) + (set! (-> *part-id-table* 2059 init-specs 5 initial-valuef) (* 255.0 f30-0)) + (set! (-> *part-id-table* 2059 init-specs 7 initial-valuef) (* 255.0 (- 1.0 f30-0))) + ) + (draw-beam (-> *part-id-table* 2059) gp-0 s5-0 #t) + ) + ) + 0 + (none) + ) + ) + +(defmethod valid-target? ((this bombbot) (arg0 process-focusable)) + (and arg0 + (!= this arg0) + (not (focus-test? arg0 inactive)) + (not (focus-test? arg0 disable)) + (not (focus-test? arg0 dead)) + (not (logtest? (process-mask crate) (-> arg0 mask))) + arg0 + (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + +(defmethod bombbot-method-207 ((this bombbot)) + #t + ) + +(defmethod bombbot-method-202 ((this bombbot)) + (set! (-> this last-head-roty-speed) (-> this head-roty-speed)) + (set! (-> this head-roty-speed) (vector-y-angle (-> this node-list data 4 bone transform fvec))) + (set! (-> this last-cannon-roty-speed) (-> this cannon-roty-speed)) + (set! (-> this cannon-roty-speed) (vector-y-angle (-> this node-list data 6 bone transform fvec))) + (let ((f0-6 (deg- (-> this last-head-roty-speed) (-> this head-roty-speed)))) + (cond + ((< 364.0889 (fabs f0-6)) + (when (zero? (-> this head-sound)) + (let ((s5-0 sound-play-by-spec) + (s4-0 (static-sound-spec "bb-turret-loop" :group 0 :volume 0.0 :mask (pitch))) + ) + (set! (-> s4-0 volume) 1024) + (set! (-> s4-0 pitch-mod) 0) + (set! (-> this head-sound) (s5-0 s4-0 (new-sound-id) (-> this root trans))) + ) + ) + ) + (else + (when (nonzero? (-> this head-sound)) + (sound-play "bb-turret-end") + (sound-stop (-> this head-sound)) + (set! (-> this head-sound) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + (let ((f0-10 (deg- (-> this last-cannon-roty-speed) (-> this cannon-roty-speed)))) + (cond + ((< 364.0889 (fabs f0-10)) + (when (zero? (-> this cannon-sound)) + (let ((s5-2 sound-play-by-spec) + (s4-2 (static-sound-spec "bb-laser-loop" :group 0 :volume 0.0 :mask (pitch))) + ) + (set! (-> s4-2 volume) 1024) + (set! (-> s4-2 pitch-mod) 0) + (set! (-> this cannon-sound) (s5-2 s4-2 (new-sound-id) (-> this root trans))) + ) + ) + ) + (else + (when (nonzero? (-> this cannon-sound)) + (sound-stop (-> this cannon-sound)) + (sound-play "bb-laser-end") + (set! (-> this cannon-sound) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + (none) + ) + +(defmethod bombbot-method-195 ((this bombbot)) + (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) + (set! (-> a1-0 sphere r) 40960.0) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (vector-reset! (-> a1-0 velocity)) + (set! (-> a1-0 notify-radius) 122880.0) + (set! (-> a1-0 danger-level) 1.0) + (set! (-> a1-0 decay-rate) 0.0) + (set! (-> a1-0 flags) (the-as uint 1)) + (set! (-> a1-0 danger-type) (the-as uint 0)) + (add-danger *traffic-engine* a1-0) + ) + (none) + ) + +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +(defmethod bombbot-method-194 ((this bombbot)) + (local-vars + (at-0 int) + (sv-864 vector) + (sv-880 vector) + (sv-896 float) + (sv-912 float) + (sv-928 (function vector vector float)) + (sv-944 uint) + (sv-960 uint) + ) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-0 (-> s5-0 bbox)) + (a0-2 (-> this root trans)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 24576.0) + (set! (-> a1-0 y) 22528.0) + (set! (-> a1-0 z) 24576.0) + (set! (-> a1-0 w) 1.0) + (vector-! (the-as vector v1-0) a0-2 a1-0) + ) + (let ((v1-2 (-> s5-0 bbox max)) + (a0-4 (-> this root trans)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 24576.0) + (set! (-> a1-1 y) 22528.0) + (set! (-> a1-1 z) 24576.0) + (set! (-> a1-1 w) 1.0) + (vector+! v1-2 a0-4 a1-1) + ) + (set! (-> s5-0 collide-with) (collide-spec backgnd)) + (set! (-> s5-0 ignore-process0) #f) + (set! (-> s5-0 ignore-process1) #f) + (set! (-> s5-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (fill-using-bounding-box *collide-cache* s5-0) + (dotimes (s4-0 4) + (-> this joint-ik s4-0 shoulder-matrix-no-ik) + (-> this joint-ik s4-0 elbow-matrix-no-ik) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> this node-list data 3 bone transform uvec quad)) + (new 'stack-no-clear 'vector) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((f30-0 0.4)) + (vector-normalize! s2-0 1.0) + (let ((s1-0 (-> this feet s4-0))) + (let* ((f0-10 (+ (* 0.004166667 (the float (mod (current-time) 240))) (-> s1-0 offset))) + (f28-0 (- f0-10 (* (the float (the int (/ f0-10 1.0))) 1.0))) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((>= f30-0 f28-0) + (toggle-cspec-deadly this #t (+ s4-0 1)) + (vector-orient-by-quat! s3-0 (-> s1-0 pos-offset) (-> this root quat)) + (let ((f26-0 (- f30-0 f28-0))) + (set! sv-880 s0-0) + (set! sv-864 (new 'stack-no-clear 'vector)) + (set! (-> sv-864 x) 0.0) + (set! (-> sv-864 y) (sin (* (-> this y-angular-velocity) (-> pp clock frames-per-second)))) + (set! (-> sv-864 z) 0.0) + (set! (-> sv-864 w) 1.0) + (let ((v1-40 s3-0)) + (.lvf vf1 (&-> sv-864 quad)) + (.lvf vf2 (&-> v1-40 quad)) + ) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> sv-880 quad) vf3) + (let ((a1-6 s0-0) + (v1-42 s0-0) + (a0-12 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> (-> this linear-speed) quad)) + (let ((f0-17 (-> pp clock frames-per-second))) + (.mov at-0 f0-17) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-12 quad) vf1) + (vector+! a1-6 v1-42 a0-12) + ) + (let ((a1-8 (-> s1-0 speed))) + (let ((v1-43 (-> s1-0 speed))) + (let ((a0-14 (vector-! (new 'stack-no-clear 'vector) s0-0 (-> s1-0 speed)))) + (let ((a2-15 (* 4.0 (seconds-per-frame)))) + (.mov vf7 a2-15) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-43 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 (&-> a1-8 quad) vf6) + ) + (let ((a1-9 s3-0)) + (let ((v1-44 s3-0)) + (let ((a0-15 (-> s1-0 speed))) + (let ((a2-17 (+ 0.2 f26-0))) + (.mov vf7 a2-17) + ) + (.lvf vf5 (&-> a0-15 quad)) + ) + (.lvf vf4 (&-> v1-44 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 (&-> a1-9 quad) vf6) + ) + ) + (vector+! s3-0 s3-0 (-> this root trans)) + (let ((a1-12 (-> s5-0 start-pos))) + (let ((v1-46 s3-0)) + (let ((a0-18 s2-0)) + (let ((a2-19 24576.0)) + (.mov vf7 a2-19) + ) + (.lvf vf5 (&-> a0-18 quad)) + ) + (.lvf vf4 (&-> v1-46 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 (&-> a1-12 quad) vf6) + ) + (vector-float*! (-> s5-0 move-dist) s2-0 -49152.0) + (let ((v1-49 s5-0)) + (set! (-> v1-49 radius) 40.96) + (set! (-> v1-49 collide-with) (collide-spec backgnd)) + (set! (-> v1-49 ignore-process0) #f) + (set! (-> v1-49 ignore-process1) #f) + (set! (-> v1-49 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-49 action-mask) (collide-action solid)) + ) + (let ((f0-25 (probe-using-line-sphere *collide-cache* s5-0))) + (when (>= f0-25 0.0) + (let ((v1-51 (new 'stack-no-clear 'vector))) + (let ((a0-26 (-> s5-0 start-pos))) + (let ((a1-15 (-> s5-0 move-dist))) + (let ((a2-20 f0-25)) + (.mov vf7 a2-20) + ) + (.lvf vf5 (&-> a1-15 quad)) + ) + (.lvf vf4 (&-> a0-26 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 (&-> v1-51 quad) vf6) + (- (-> s3-0 y) (-> v1-51 y)) + (set! (-> s3-0 quad) (-> v1-51 quad)) + ) + ) + ) + (set! (-> s1-0 next-position quad) (-> s3-0 quad)) + (set! (-> s1-0 moving) #t) + (let ((a1-16 s3-0)) + (let ((v1-55 (-> s1-0 position))) + (let ((a0-31 (vector-! (new 'stack-no-clear 'vector) (-> s1-0 next-position) (-> s1-0 position)))) + (let ((a2-22 (/ f28-0 f30-0))) + (.mov vf7 a2-22) + ) + (.lvf vf5 (&-> a0-31 quad)) + ) + (.lvf vf4 (&-> v1-55 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 (&-> a1-16 quad) vf6) + ) + (let ((t9-6 bombbot-do-spline) + (a0-32 (new 'stack-no-clear 'vector)) + (a1-17 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-17 x) 0.0) + (set! (-> a1-17 y) 0.0) + (set! (-> a1-17 z) 0.0) + (set! (-> a1-17 w) 1.0) + (let ((a2-23 (new 'stack-no-clear 'vector))) + (set! (-> a2-23 x) 0.0) + (set! (-> a2-23 y) 0.0) + (set! (-> a2-23 z) 0.5) + (set! (-> a2-23 w) 1.0) + (let ((a3-1 (new 'stack-no-clear 'vector))) + (set! (-> a3-1 x) 0.0) + (set! (-> a3-1 y) 0.0) + (set! (-> a3-1 z) 1.0) + (set! (-> a3-1 w) 1.0) + (let ((t0-0 (new 'stack-no-clear 'vector))) + (set! (-> t0-0 x) 0.0) + (set! (-> t0-0 y) 4.0) + (set! (-> t0-0 z) 0.0) + (set! (-> t0-0 w) 1.0) + (let ((v0-6 (t9-6 a0-32 a1-17 a2-23 a3-1 t0-0 (/ f28-0 f30-0)))) + (set! (-> s1-0 delta-y) (* 0.05 (-> v0-6 y) (vector-length (-> s1-0 speed)))) + ) + ) + ) + ) + ) + (+! (-> s3-0 y) (-> s1-0 delta-y)) + ) + (else + (toggle-cspec-deadly this #f (+ s4-0 1)) + (when (-> s1-0 moving) + (set! (-> s1-0 position quad) (-> s1-0 next-position quad)) + (set! (-> s1-0 moving) #f) + (let ((s0-1 lerp-scale)) + (set! sv-896 (the-as float 819.2)) + (set! sv-912 (the-as float 0.0)) + (set! sv-928 vector-vector-distance) + (let* ((a0-36 (camera-pos)) + (a1-19 (-> s1-0 position)) + (a2-25 (sv-928 a0-36 a1-19)) + (a3-2 40960.0) + (t0-1 409600.0) + (f30-1 (s0-1 sv-896 sv-912 a2-25 a3-2 t0-1)) + ) + (when (and (!= f30-1 0.0) (< 16384.0 (vector-length (-> s1-0 speed)))) + (if (bombbot-method-207 this) + (activate! *camera-smush-control* f30-1 37 600 1.0 0.1 (-> pp clock)) + ) + (cond + ((logtest? (-> *part-group-id-table* 23 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s1-0 position quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 23)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s1-0 position quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 23)) + ) + ) + (when (or (zero? s4-0) (= s4-0 1)) + (cond + ((and *target* (focus-test? *target* grabbed)) + (let ((s0-4 sound-play-by-name)) + (set! sv-944 (make-u128 #x6d6163 (the-as uint #x2d6b6c61772d6262))) + (let ((a1-28 (new-sound-id)) + (a2-37 1024) + (a3-8 0) + (t0-3 0) + (t1-2 0) + (t2-1 (-> s1-0 position)) + ) + (s0-4 (the-as sound-name sv-944) a1-28 a2-37 a3-8 t0-3 (the-as sound-group t1-2) t2-1) + ) + ) + ) + (else + (let ((s0-5 sound-play-by-name)) + (set! sv-960 (make-u128 0 (the-as uint #x6b6c61772d6262))) + (let ((a1-29 (new-sound-id)) + (a2-38 1024) + (a3-9 0) + (t0-4 0) + (t1-3 0) + (t2-2 (-> s1-0 position)) + ) + (s0-5 (the-as sound-name sv-960) a1-29 a2-38 a3-9 t0-4 (the-as sound-group t1-3) t2-2) + ) + ) + ) + ) + (if (bombbot-method-207 this) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (* 0.00061035156 f30-1))) (seconds 0.2)) + ) + ) + ) + ) + ) + ) + (set! (-> s1-0 delta-y) 0.0) + (set! (-> s3-0 quad) (-> s1-0 position quad)) + ) + ) + ) + (let ((a1-31 (-> s5-0 start-pos))) + (let ((v1-133 s3-0)) + (let ((a0-62 s2-0)) + (let ((a2-41 12288.0)) + (.mov vf7 a2-41) + ) + (.lvf vf5 (&-> a0-62 quad)) + ) + (.lvf vf4 (&-> v1-133 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 (&-> a1-31 quad) vf6) + ) + (vector-float*! (-> s5-0 move-dist) s2-0 -24576.0) + (let ((v1-136 s5-0)) + (set! (-> v1-136 radius) 40.96) + (set! (-> v1-136 collide-with) (collide-spec backgnd)) + (set! (-> v1-136 ignore-process0) #f) + (set! (-> v1-136 ignore-process1) #f) + (set! (-> v1-136 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-136 action-mask) (collide-action solid)) + ) + (let ((f0-63 (probe-using-line-sphere *collide-cache* s5-0))) + (when (>= f0-63 0.0) + (let ((s0-6 (new 'stack-no-clear 'vector))) + (let ((v1-139 (-> s5-0 start-pos))) + (let ((a0-69 (-> s5-0 move-dist))) + (let ((a1-34 f0-63)) + (.mov vf7 a1-34) + ) + (.lvf vf5 (&-> a0-69 quad)) + ) + (.lvf vf4 (&-> v1-139 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 (&-> s0-6 quad) vf6) + (let ((f0-65 (- (-> s3-0 y) (-> s0-6 y)))) + (lerp-scale 1.0 0.0 f0-65 0.0 8192.0) + ) + (- (-> s0-6 y) (-> this root trans y)) + (vector-dot s2-0 (vector-! (new 'stack-no-clear 'vector) s0-6 (-> this root trans))) + ) + ) + ) + (set! (-> s1-0 real-position quad) (-> s3-0 quad)) + ) + ) + (set-ik-target! (-> this joint-ik s4-0) s3-0) + ) + ) + ) + ) + 0 + (none) + ) + ) + ) + +(defmethod enemy-common-post ((this bombbot)) + (local-vars (sv-48 sparticle-launcher) (sv-52 sparticle-launcher)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) + (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + (cond + ((= (-> this nav state mesh) *default-nav-mesh*) + (dotimes (s5-0 4) + (enable-set! (-> this joint-ik s5-0) #f) + ) + ) + (else + (bombbot-method-194 this) + (dotimes (s5-1 4) + (enable-set! (-> this joint-ik s5-1) #t) + ) + ) + ) + (vector-! (-> this linear-speed) (-> this root trans) (-> this last-trans)) + (set! (-> this last-trans quad) (-> this root trans quad)) + (set! (-> this y-angular-velocity) + (deg- (quaternion-y-angle (-> this root quat)) (quaternion-y-angle (-> this last-quat))) + ) + (quaternion-copy! (-> this last-quat) (-> this root quat)) + (set! (-> this rigidbody force-callback) + (the-as (function rigid-body-object float none) (method-of-object this bombbot-method-198)) + ) + (bombbot-method-199 this) + (set! sv-48 (the-as sparticle-launcher #f)) + (set! sv-52 (the-as sparticle-launcher #f)) + (cond + ((< (-> this hit-points) (* 0.33 (-> this max-hit-points))) + (set! sv-48 (-> *part-id-table* 925)) + (set! sv-52 (-> *part-id-table* 921)) + ) + ((< (-> this hit-points) (* 0.66 (-> this max-hit-points))) + (set! sv-48 (-> *part-id-table* 928)) + ) + (else + (if (< (rand-vu) 0.05) + (set! sv-48 (-> *part-id-table* 930)) + ) + ) + ) + (when sv-48 + (let ((gp-1 (-> this node-list data 4 bone transform)) + (s5-3 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-1 2) + (vector-matrix*! + s5-3 + (vector-rotate-around-y! (new 'stack-no-clear 'vector) (new 'static 'vector :z 6144.0 :w 1.0) (if (< s4-1 1) + 5461.3335 + 38229.332 + ) + ) + gp-1 + ) + (vector-! *particle-vel* s5-3 (matrix->trans gp-1 (new 'stack-no-clear 'vector))) + (+! (-> *particle-vel* y) 4096.0) + (vector-float*! *particle-vel* *particle-vel* 0.0033333334) + (when (and sv-52 (< (rand-vu) 0.005)) + (let ((t9-15 sp-launch-particles-var) + (a0-23 *sp-particle-system-2d*) + (a1-10 sv-48) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> s5-3 quad)) + (t9-15 a0-23 a1-10 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (let ((t9-16 sp-launch-particles-var) + (a0-24 *sp-particle-system-2d*) + (a1-11 sv-48) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s5-3 quad)) + (t9-16 a0-24 a1-11 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod run-logic? ((this bombbot)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod get-trans ((this bombbot) (arg0 int)) + "Get the `trans` for this process." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (cond + ((= arg0 4) + (let ((v0-0 (new 'static 'vector))) + (let ((v1-2 (-> this root trans))) + (let ((a0-1 *y-vector*)) + (let ((a1-2 12288.0)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-2 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + (else + ((method-of-type nav-enemy get-trans) this arg0) + ) + ) + ) + ) + +(defmethod penetrate->next-state ((this bombbot) (arg0 process) (arg1 event-message-block) (arg2 float)) + ((method-of-type nav-enemy penetrate->next-state) this arg0 arg1 arg2) + 'hit-flinch + ) + +(defmethod get-damage-from-attack ((this bombbot) (arg0 object) (arg1 event-message-block)) + (-> arg1 param 1) + (let* ((t9-0 (method-of-type nav-enemy get-damage-from-attack)) + (f30-0 (t9-0 this arg0 arg1)) + ) + (cond + ((if (type? arg0 bombbot-bomb) + arg0 + ) + (set! *bombbot-hint* (new 'static 'sound-id)) + (if (rand-vu-percent? 0.1) + (talker-spawn-func (-> *talker-speech* 169) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (* 15.0 f30-0) + ) + ((logtest? (penetrate dark-punch) (-> this incoming penetrate-using)) + (* 2.0 f30-0) + ) + (else + f30-0 + ) + ) + ) + ) + +(defmethod event-handler ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('nav-mesh-kill) + (change-to *default-nav-mesh* this) + #t + ) + (('hit-flinch) + (cond + ((= (-> this hit-points) 0.0) + (if (not (and (-> this next-state) (= (-> this next-state name) 'die))) + (go-die this) + ) + ) + (else + (let ((a1-2 (-> arg3 param 1))) + (when arg0 + (let ((v1-8 (find-offending-process-focusable arg0 (the-as attack-info a1-2)))) + (when v1-8 + (let ((s5-1 (new 'stack-no-clear 'vector))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> v1-8 root trans quad)) + (let ((s3-1 (matrix->trans (-> this node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) + (+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> s4-1 z) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (vector-! s5-1 s3-1 s4-1) + ) + ) + (vector-normalize! s5-1 4096000.0) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) + (apply-impact! + (-> this rigidbody) + (rigid-body-control-method-25 (-> this rigidbody) (new 'stack-no-clear 'vector)) + s5-1 + ) + ) + ) + ) + ) + ) + (play-damage-sound this 0) + 'back + ) + ) + ) + (('explode) + (if (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + (go (method-of-object this explode)) + ) + ) + (('blow-wall) + (go (method-of-object this blow-wall)) + ) + (('touched 'touch 'attack) + (if (logtest? (process-mask vehicle) (-> arg0 mask)) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'mine)) + ) + ) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate notice (bombbot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-best-state self) + ) + ) + +(defmethod bombbot-method-196 ((this bombbot) (arg0 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as process-drawable #f))) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (countdown (s2-0 (fill-actor-list-for-box *actor-hash* arg0 s3-0 64)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-3 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-3 + (let* ((s0-0 (-> a0-3 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (!= this s1-1) + (not (focus-test? this inactive)) + (not (focus-test? this disable)) + (not (focus-test? this dead)) + (not (logtest? (process-mask guard) (-> s1-1 mask))) + (not (logtest? (process-mask crate) (-> s1-1 mask))) + (logtest? (process-mask guard vehicle) (-> s1-1 mask)) + s1-1 + (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> (the-as process-focusable s1-1) root trans)))) + (when (or (not gp-0) (< f0-0 f30-0)) + (set! gp-0 s1-1) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + ) + ) + (if (and *target* (< (vector-vector-distance (target-pos 0) arg0) (-> arg0 w))) + (set! gp-0 *target*) + ) + (cond + (gp-0 + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (let ((v1-34 (-> this target-pos))) + (let ((a0-16 (-> gp-0 root trans))) + (let ((a1-8 (-> gp-0 root transv))) + (let ((a2-1 0.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-8 quad)) + ) + (.lvf vf4 (&-> a0-16 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 (&-> v1-34 quad) vf6) + ) + (set! (-> this start-target-pos quad) (-> gp-0 root trans quad)) + (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) + (try-update-focus (-> this focus) (the-as process-focusable gp-0) this) + ) + (else + (clear-focused (-> this focus)) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod bombbot-method-208 ((this bombbot) (arg0 vector) (arg1 vector)) + (set! (-> arg1 quad) (-> this target-pos quad)) + arg1 + ) + +(defmethod bombbot-method-203 ((this bombbot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> this node-list data 6 bone transform)) + (v1-2 (-> a2-0 rvec quad)) + (a0-1 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s4-0 rvec quad) v1-2) + (set! (-> s4-0 uvec quad) a0-1) + (set! (-> s4-0 fvec quad) a1-0) + (set! (-> s4-0 trans quad) a2-1) + ) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) + (matrix->trans s4-0 s3-0) + (let ((a1-2 s3-0)) + (let ((v1-5 s3-0)) + (let ((a0-3 (-> s4-0 fvec))) + (let ((a2-3 8192.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.lvf vf4 (&-> v1-5 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 (&-> a1-2 quad) vf6) + ) + (vector-normalize-copy! s2-0 (-> s4-0 fvec) 819200.0) + (set! (-> s5-0 dest quad) (-> (bombbot-method-208 this s3-0 (new 'stack-no-clear 'vector)) quad)) + (set! (-> s5-0 src quad) (-> s3-0 quad)) + (set! (-> s5-0 initial-tilt) (+ 3640.889 (-> this angle-gun))) + (set! (-> s5-0 gravity) 184320.0) + (when (traj3d-calc-initial-velocity-using-tilt s5-0) + (new 'stack-no-clear 'vector) + (sound-play "bb-fire-grenade") + (process-spawn bombbot-bomb (-> s5-0 src) (-> s5-0 initial-velocity) :name "bombbot-bomb" :to this) + (let ((s4-4 (new 'stack-no-clear 'vector))) + (set! (-> s4-4 quad) (-> s5-0 initial-velocity quad)) + (vector-normalize! s4-4 -2048000.0) + (vector-inv-orient-by-quat! s4-4 s4-4 (-> this root quat)) + (apply-impact! + (-> this rigidbody) + (rigid-body-control-method-25 (-> this rigidbody) (new 'stack-no-clear 'vector)) + s4-4 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(deftype bombbot-shot (guard-shot) + () + ) + + +(defmethod projectile-method-24 ((this bombbot-shot)) + 0 + (none) + ) + +(set! (-> *lightning-spec-id-table* 24) (new 'static 'lightning-spec + :name "bombbot-lightning-shock" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :b #x40 :a #x80) + :end-color (new 'static 'rgba :r #x80 :b #x40 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +(defmethod projectile-method-25 ((this bombbot-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((v1-1 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (a2-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) + ) + (vector-length a2-1) + (let ((a3-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 a2-1)) + (let ((t0-1 0.8)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> a3-0 quad) vf6) + ) + (let ((f30-0 (-> *part-id-table* 2056 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2056 init-specs 4 initial-valuef) (* 2.0 (vector-length a2-1))) + (draw-beam (-> *part-id-table* 2056) a1-0 a2-1 #f) + (set! (-> *part-id-table* 2056 init-specs 4 initial-valuef) f30-0) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this bombbot-shot)) + (dotimes (s5-0 5) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 256 + 0 + 40960.0 + ) + ) + 0 + (none) + ) + +(defstate impact (bombbot-shot) + :virtual #t + :code (behavior () + (while (-> self child) + (suspend) + ) + (go-virtual die) + ) + ) + +(defmethod play-impact-sound ((this bombbot-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "bb-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "bb-shot-hit") + ) + ) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this bombbot-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'guard-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) guard-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer bombbot-shot). +(defun spawn-bombbot-projectile ((arg0 bombbot) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector) (arg5 float)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) arg5) + (logior! (-> gp-0 options) (projectile-options po14)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 1.0) + ) + (the-as (pointer bombbot-shot) (spawn-projectile bombbot-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; WARN: Return type mismatch (pointer bombbot-shot) vs (pointer projectile). +(defmethod fire-shot ((this bombbot) (arg0 vector) (arg1 vector)) + (the-as (pointer projectile) (spawn-bombbot-projectile this arg0 arg1 819200.0 (the-as vector #f) 2.0)) + ) + +(defmethod bombbot-method-197 ((this bombbot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (handle->process (-> this focus handle)) + (cond + ((nonzero? (-> this gun-type)) + (when (>= (+ (current-time) (seconds -1)) (-> this next-shoot)) + (set-time! (-> this next-shoot)) + (bombbot-method-203 this) + ) + ) + (else + (when (>= (+ (current-time) (seconds -0.2)) (-> this next-shoot)) + (set-time! (-> this next-shoot)) + (handle->process (-> this focus handle)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> this node-list data 6 bone transform)) + (v1-27 (-> a2-0 rvec quad)) + (a0-12 (-> a2-0 uvec quad)) + (a1-2 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 rvec quad) v1-27) + (set! (-> s5-0 uvec quad) a0-12) + (set! (-> s5-0 fvec quad) a1-2) + (set! (-> s5-0 trans quad) a2-1) + ) + (new 'stack-no-clear 'matrix) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (matrix->trans s5-0 s3-0) + (let ((a1-4 s3-0)) + (let ((v1-32 s3-0)) + (let ((a0-14 (-> s5-0 fvec))) + (let ((a2-3 8192.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-32 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 (&-> a1-4 quad) vf6) + ) + (vector-normalize-copy! s4-0 (-> s5-0 fvec) 819200.0) + (fire-shot this s3-0 (vector+! (new 'stack-no-clear 'vector) s3-0 s4-0)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> s4-0 quad)) + (vector-normalize! s5-1 -2048000.0) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) + (apply-impact! + (-> this rigidbody) + (rigid-body-control-method-25 (-> this rigidbody) (new 'stack-no-clear 'vector)) + s5-1 + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod normalize-heading! ((this bombbot) (arg0 nav-control)) + (let ((a0-1 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((a2-0 (-> this nav state))) + (set! (-> a0-1 quad) (-> a2-0 heading quad)) + ) + (let ((f0-1 (deg-diff (-> this y-angle) (vector-y-angle a0-1)))) + (let ((f1-0 7281.778)) + (while (< 8192.0 f0-1) + (set! f0-1 (+ -16384.0 f0-1)) + ) + (while (< f0-1 -8192.0) + (set! f0-1 (+ 16384.0 f0-1)) + ) + (cond + ((< f1-0 f0-1) + (set! f0-1 f1-0) + ) + ((< f0-1 (- f1-0)) + (set! f0-1 (- f1-0)) + ) + ) + ) + (+! (-> this y-angle) (* f0-1 (seconds-per-frame))) + ) + ) + (quaternion-vector-angle! (-> this root quat) *y-vector* (-> this y-angle)) + 0 + (none) + ) + +(defmethod nav-enemy-method-176 ((this bombbot)) + (let ((t9-0 (method-of-type nav-enemy nav-enemy-method-176))) + (t9-0 this) + ) + (logclear! (-> this nav state nav flags) (nav-control-flag update-heading-from-facing)) + 0 + (none) + ) + +(defmethod nav-enemy-method-177 ((this bombbot)) + (let ((t9-0 (method-of-type nav-enemy nav-enemy-method-177))) + (t9-0 this) + ) + (logclear! (-> this nav state nav flags) (nav-control-flag update-heading-from-facing)) + 0 + (none) + ) + +(defmethod bombbot-method-205 ((this bombbot)) + (when (= (-> this nav state mesh) *default-nav-mesh*) + (let ((a0-4 (find-nearest-nav-mesh (-> this root trans) 0.0))) + (when a0-4 + (change-to a0-4 this) + (dotimes (s5-0 4) + (let ((s4-0 (-> this feet s5-0))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s3-0 (-> s4-0 pos-offset) (-> this root quat)) + (vector+! s3-0 s3-0 (-> this root trans)) + (set! (-> s4-0 next-position quad) (-> s3-0 quad)) + (set! (-> s4-0 position quad) (-> s3-0 quad)) + ) + (set! (-> s4-0 delta-y) 0.0) + ) + (set! (-> this legs-strength s5-0) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate hostile (bombbot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-11 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 0))) + (set! (-> v1-11 prim-core collide-as) (collide-spec)) + (set! (-> v1-11 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self next-shoot) 0) + 0 + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (if (>= (+ (current-time) (seconds -13)) (-> self stop-shoot)) + (go-virtual drop-bombs) + ) + (when (< (-> self next-target) (current-time)) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (set! (-> a1-0 w) 204800.0) + (bombbot-method-196 self a1-0) + ) + (set! (-> self next-target) (+ (current-time) (seconds 5))) + (set! (-> self gun-type) (the-as uint 0)) + 0 + ) + (let ((v1-19 (the-as process-focusable (handle->process (-> self focus handle))))) + (when v1-19 + (when (< (current-time) (+ (-> self next-target) (seconds -3.5))) + (set-time! (-> self start-target)) + (set! (-> self start-target-pos quad) (-> v1-19 root trans quad)) + (set! (-> self start-target-vel quad) (-> v1-19 root transv quad)) + (vector-! (-> self target-delta) (-> v1-19 root trans) (-> self root trans)) + ) + (let ((a2-2 (-> self target-pos))) + (let ((a0-21 (-> self start-target-pos))) + (let ((a1-12 (-> self start-target-vel))) + (let ((a3-4 (* 0.0033333334 (the float (- (current-time) (-> self start-target)))))) + (.mov vf7 a3-4) + ) + (.lvf vf5 (&-> a1-12 quad)) + ) + (.lvf vf4 (&-> a0-21 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 (&-> a2-2 quad) vf6) + ) + (if (= (-> v1-19 type) target) + (set! (-> self target-pos quad) (-> self start-target-pos quad)) + ) + (if (< (+ (-> self next-target) (seconds -1)) (current-time)) + (bombbot-method-197 self) + (bombbot-method-204 self) + ) + ) + ) + (bombbot-method-205 self) + (new 'stack-no-clear 'vector) + (let ((f0-4 (* 0.25 (+ (-> self feet 0 next-position y) + (-> self feet 1 next-position y) + (-> self feet 2 next-position y) + (-> self feet 3 next-position y) + ) + ) + ) + ) + (if (!= (-> self nav state mesh) *default-nav-mesh*) + (+! (-> self root trans y) (* 4.0 (seconds-per-frame) (- f0-4 (-> self root trans y)))) + ) + ) + (if (= (vector-length (-> self root transv)) 0.0) + (set-time! (-> self state-time)) + ) + (bombbot-method-202 self) + (bombbot-method-195 self) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! bombbot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (-> self current-node) + (let ((gp-1 (min (the-as int (+ (-> self current-node) 1)) (the-as int (+ (-> self city-path node-count) -1))))) + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (vector-v+! + (-> self root trans) + (-> self root trans) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self city-path node gp-1)) (-> self root trans)) + (-> *bombbot-nav-enemy-info* run-travel-speed) + ) + ) + (seek! (-> self root trans y) (-> self city-path node gp-1 position y) (* 16384.0 (seconds-per-frame))) + (enemy-common-post self) + (update-transforms (-> self root)) + ) + (else + (let ((v1-25 (-> self nav state)) + (a0-10 (-> self city-path node gp-1)) + ) + (logclear! (-> v1-25 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-25 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-25 target-pos quad) (-> a0-10 position quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (the-as vector (-> self city-path node gp-1))) 32768.0) + (set! (-> self current-node) + (the-as + uint + (min (the-as int (+ (-> self current-node) 1)) (the-as int (+ (-> self city-path node-count) -1))) + ) + ) + ) + ) + ) + ) + +(defstate drop-bombs (bombbot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self start-target)) + (set! (-> self next-target) 0) + (nav-enemy-method-178 self) + (set! (-> self drop-mask) (the-as uint 0)) + (set! (-> self drop-angle) (rotate-y<-vector+vector + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)) + *x-vector* + ) + ) + (set! (-> self drop-num) (the-as uint 5)) + ) + :exit (behavior () + (set-time! (-> self stop-shoot)) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (and (nonzero? (-> self drop-num)) (< (-> self next-target) (current-time))) + (let ((v1-5 (enemy-method-131 self 5 (the-as int (-> self drop-mask))))) + (logior! (-> self drop-mask) (ash 1 v1-5)) + (set! (-> self next-shoot) (+ (current-time) (seconds 0.8))) + (set! (-> self next-target) (+ (current-time) (seconds 1))) + (set! (-> self gun-type) (the-as uint 1)) + (let ((gp-0 (-> self target-pos))) + (let ((s5-0 (-> self root trans))) + (let ((v1-7 (vector-rotate-around-y! + (new 'stack-no-clear 'vector) + *x-vector* + (+ 16384.0 (* 3640.889 (the float (+ v1-5 -2))) (-> self drop-angle)) + ) + ) + ) + (let ((a0-15 61440.0)) + (.mov vf7 a0-15) + ) + (.lvf vf5 (&-> v1-7 quad)) + ) + (.lvf vf4 (&-> s5-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 (&-> gp-0 quad) vf6) + ) + ) + (+! (-> self drop-num) -1) + ) + (when (< (-> self next-shoot) (current-time)) + (set! (-> self next-shoot) (+ (current-time) (seconds 10))) + (bombbot-method-203 self) + ) + (if (>= (+ (current-time) (seconds -12)) (-> self start-target)) + (go-virtual hostile) + ) + (bombbot-method-205 self) + (new 'stack-no-clear 'vector) + (let ((f0-5 (* 0.25 (+ (-> self feet 0 next-position y) + (-> self feet 1 next-position y) + (-> self feet 2 next-position y) + (-> self feet 3 next-position y) + ) + ) + ) + ) + (if (!= (-> self nav state mesh) *default-nav-mesh*) + (+! (-> self root trans y) (* 4.0 (seconds-per-frame) (- f0-5 (-> self root trans y)))) + ) + ) + (if (= (vector-length (-> self root transv)) 0.0) + (set-time! (-> self state-time)) + ) + (bombbot-method-202 self) + (bombbot-method-195 self) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! bombbot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (enemy-common-post self) + (update-transforms (-> self root)) + ) + (else + (nav-enemy-method-187 self) + ) + ) + ) + ) + +(defstate blow-wall (bombbot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((a1-0 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-0 9) #f) + (set! (-> a1-0 8) #f) + (set! (-> a1-0 7) #f) + (set! (-> a1-0 6) #f) + (set! (-> a1-0 5) #f) + (set! (-> a1-0 4) #f) + (set! (-> a1-0 3) #f) + (set! (-> a1-0 2) 'hiphog) + (set! (-> a1-0 1) 'ctyindb) + (set! (-> a1-0 0) 'ctywide-kg) + (want-levels *load-state* a1-0) + ) + ) + :exit (behavior () + (sound-stop (-> self head-sound)) + (sound-stop (-> self cannon-sound)) + ) + :trans (behavior () + (bombbot-method-202 self) + ) + :code (behavior () + (until #f + (ja-no-eval :group! bombbot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (set! (-> self root transv y) 0.0) + (let ((v1-2 (-> self nav state)) + (a0-0 (new 'static 'vector :x 4290273.5 :y 29286.4 :z 1817763.9 :w 1.0)) + ) + (logclear! (-> v1-2 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-2 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-2 target-pos quad) (-> a0-0 quad)) + ) + 0 + (when (logtest? (-> self nav state flags) (nav-state-flag at-target)) + (sound-play "bb-explode") + (go-virtual explode) + ) + (let ((v1-13 (-> self nav))) + (set! (-> v1-13 target-speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +(defstate die (bombbot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (set! (-> self explosing) #f) + (set! (-> self beep-time) 0) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((v1-0 (-> self nav))) + (set! (-> v1-0 target-speed) + (- (-> self nav target-speed) (* 0.4 (seconds-per-frame) (-> self nav target-speed))) + ) + ) + 0 + (if (>= (- (current-time) (-> self state-time)) 0) + (seek! (-> self legs-strength 0) 0.8 (* 10.0 (seconds-per-frame))) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.8)) + (seek! (-> self legs-strength 3) 0.4 (* 10.0 (seconds-per-frame))) + ) + (if (time-elapsed? (-> self state-time) (seconds 1.6)) + (seek! (-> self legs-strength 1) 0.0 (* 10.0 (seconds-per-frame))) + ) + (if (time-elapsed? (-> self state-time) (seconds 2.4)) + (seek! (-> self legs-strength 2) 0.5 (* 10.0 (seconds-per-frame))) + ) + (when (time-elapsed? (-> self state-time) (seconds 2.8)) + (sound-play "bb-explode") + (go-virtual explode) + ) + (when (< (-> self beep-time) (current-time)) + (sound-play "bb-beep") + (set! (-> self beep-time) + (+ (current-time) (the int (* 0.2 (the float (- (seconds 2.8) (- (current-time) (-> self state-time))))))) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + (ja-no-eval :group! bombbot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (set! (-> self root transv y) 0.0) + (nav-enemy-method-187 self) + ) + ) + +(define *bombbot-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 7 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 15 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 18 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 19 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 16 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 17 :group "skel-kg-debris-d") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +(defstate explode (bombbot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (set! (-> self explosing) #f) + (set-time! (-> self state-time)) + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-1 duration) (seconds 3)) + (set! (-> a1-1 gravity) -163840.0) + (set! (-> a1-1 scale-rand-lo) 1.0) + (set! (-> a1-1 scale-rand-hi) 3.0) + (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self root trans quad)) + (debris-spawn self a1-1 *bombbot-debris-params* (the-as process-drawable #f)) + ) + (let ((v1-15 (new 'stack-no-clear 'vector))) + (set! (-> v1-15 quad) (-> self root trans quad)) + (+! (-> v1-15 y) 2048.0) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self node-list data 3 bone transform trans quad)) + (new 'stack-no-clear 'vector) + 4.0 + (+! (-> s5-0 y) 8192.0) + (activate! *camera-smush-control* 1024.0 37 210 1.0 0.995 (-> self clock)) + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> s5-0 quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) 61440.0) + (set! (-> gp-0 scale) 1.0) + (set! (-> gp-0 group) (-> *part-group-id-table* 217)) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-0 damage) 2.0) + (set! (-> gp-0 damage-scale) 1.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle #f)) + (explosion-spawn gp-0 self) + ) + ) + (dotimes (gp-1 4) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 (* 16384.0 (the float gp-1)))) + (set-vector! s4-0 (cos f30-0) 0.0 (sin f30-0) 1.0) + ) + (vector-float*! s4-0 s4-0 (* 4096.0 (+ 2.0 (* 2.0 (rand-vu))))) + (set! (-> s5-1 quad) (-> self root trans quad)) + (vector+! (-> self root trans) (-> self root trans) s4-0) + (set! (-> self fact pickup-type) (pickup-type ammo-random)) + (set! (-> self fact pickup-amount) 10.0) + (set! (-> self fact pickup-spawn-amount) 2.0) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + (set! (-> self root trans quad) (-> s5-1 quad)) + ) + ) + (set! (-> self explosing) #t) + (set! (-> self root nav-flags) (nav-flags)) + (let ((v1-62 (-> self root root-prim))) + (set! (-> v1-62 prim-core collide-as) (collide-spec)) + (set! (-> v1-62 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-set! 0) + (ja-post) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defmethod relocate ((this bombbot) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this joint-ik v1-0)) + (&+! (-> this joint-ik v1-0) offset) + ) + ) + (if (nonzero? (-> this rigidbody)) + (&+! (-> this rigidbody) offset) + ) + (call-parent-method this offset) + ) + +(defmethod init-enemy-collision! ((this bombbot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 34) 0))) + (set! (-> s5-0 total-prims) (the-as uint 35)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 32768.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec bot enemy)) + (set! (-> v1-12 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set-vector! (-> v1-12 local-sphere) 0.0 20480.0 0.0 20480.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 1638.4 0.0 8192.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-16 transform-index) 19) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-18 transform-index) 19) + (set-vector! (-> v1-18 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-20 transform-index) 19) + (set-vector! (-> v1-20 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-22 transform-index) 19) + (set-vector! (-> v1-22 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-24 transform-index) 18) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-26 transform-index) 18) + (set-vector! (-> v1-26 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-28 transform-index) 18) + (set-vector! (-> v1-28 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-30 transform-index) 18) + (set-vector! (-> v1-30 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-32 transform-index) 13) + (set-vector! (-> v1-32 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-34 transform-index) 13) + (set-vector! (-> v1-34 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-36 transform-index) 13) + (set-vector! (-> v1-36 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-38 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-38 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-38 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-38 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-38 transform-index) 13) + (set-vector! (-> v1-38 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-40 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-40 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-40 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-40 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-40 transform-index) 12) + (set-vector! (-> v1-40 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-42 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-42 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-42 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-42 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-42 transform-index) 12) + (set-vector! (-> v1-42 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-44 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-44 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-44 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-44 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-44 transform-index) 12) + (set-vector! (-> v1-44 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-46 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-46 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-46 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-46 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-46 transform-index) 12) + (set-vector! (-> v1-46 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-48 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-48 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-48 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-48 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-48 transform-index) 17) + (set-vector! (-> v1-48 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-50 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-50 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-50 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-50 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-50 transform-index) 17) + (set-vector! (-> v1-50 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-52 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-52 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-52 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-52 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-52 transform-index) 17) + (set-vector! (-> v1-52 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-54 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-54 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-54 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-54 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-54 transform-index) 17) + (set-vector! (-> v1-54 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-56 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-56 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-56 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-56 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-56 transform-index) 16) + (set-vector! (-> v1-56 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-58 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-58 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-58 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-58 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-58 transform-index) 16) + (set-vector! (-> v1-58 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-60 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-60 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-60 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-60 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-60 transform-index) 16) + (set-vector! (-> v1-60 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-62 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-62 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-62 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-62 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-62 transform-index) 16) + (set-vector! (-> v1-62 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-64 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-64 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-64 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-64 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-64 transform-index) 15) + (set-vector! (-> v1-64 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-66 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-66 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-66 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-66 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-66 transform-index) 15) + (set-vector! (-> v1-66 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-68 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-68 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-68 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-68 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-68 transform-index) 15) + (set-vector! (-> v1-68 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-70 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-70 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-70 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-70 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-70 transform-index) 15) + (set-vector! (-> v1-70 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-72 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-72 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-72 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-72 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-72 transform-index) 14) + (set-vector! (-> v1-72 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-74 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-74 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-74 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-74 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-74 transform-index) 14) + (set-vector! (-> v1-74 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-76 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-76 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-76 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-76 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-76 transform-index) 14) + (set-vector! (-> v1-76 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-78 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-78 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-78 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-78 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-78 transform-index) 14) + (set-vector! (-> v1-78 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (set! (-> s5-0 nav-radius) 22528.0) + (let ((v1-80 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-80 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-80 prim-core collide-with)) + ) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + (set! (-> this root max-iteration-count) (the-as uint 8)) + 0 + (none) + ) + +(defmethod coin-flip? ((this bombbot)) + #f + ) + +(defun bombbot-callback ((arg0 cspace) (arg1 transformq)) + (local-vars + (sv-176 (function quaternion quaternion quaternion quaternion)) + (sv-192 quaternion) + (sv-208 quaternion) + (sv-224 vector) + (sv-240 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) *unity-quaternion*)) + ) + (let ((f30-0 0.0) + (s2-0 (vector-reset! (new 'stack-no-clear 'vector))) + ) + (dotimes (s0-0 4) + (let ((v1-3 (-> s4-0 feet s0-0))) + (let ((a1-2 s2-0)) + (let ((a0-2 s2-0)) + (let ((a2-1 (+ (the-as uint (-> s4-0 feet 0 real-position)) (* 112 s0-0)))) + (let ((a3-3 0.25)) + (.mov vf7 a3-3) + ) + (.lvf vf5 (&-> (the-as (pointer int128) a2-1))) + ) + (.lvf vf4 (&-> a0-2 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 (&-> a1-2 quad) vf6) + ) + (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y))) + (set! (-> v1-3 main-y) (-> v1-3 delta-y)) + (+! f30-0 (* 0.25 (-> v1-3 main-y))) + (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) + (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) + (new 'stack-no-clear 'vector) + (set! sv-224 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-3 pos-offset) 1.0)) + ) + (set! sv-240 (vector-normalize-copy! (new 'stack-no-clear 'vector) s1-0 1.0)) + (let ((f0-8 (vector-vector-angle-safe sv-224 sv-240))) + (when (!= f0-8 0.0) + (set! sv-176 quaternion*!) + (set! sv-192 s3-0) + (set! sv-208 s3-0) + (let ((t9-4 quaternion-vector-angle!) + (a0-14 (new 'stack-no-clear 'quaternion)) + (a1-8 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> sv-224 quad)) + (.lvf vf2 (&-> sv-240 quad)) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> a1-8 quad) vf3) + (let ((a2-5 (t9-4 a0-14 a1-8 f0-8))) + (sv-176 sv-192 sv-208 a2-5) + ) + ) + ) + ) + ) + (let* ((f0-9 0.0) + (f0-10 (+ -16384.0 f0-9)) + (f2-0 (- f30-0 (-> s4-0 main-pos-y))) + (f1-7 (- (-> s4-0 main-spd-y))) + (f0-12 (+ f0-10 (* 60.0 f2-0) (* 10.0 f1-7))) + ) + (+! (-> s4-0 main-spd-y) (* f0-12 (seconds-per-frame))) + ) + (+! (-> s4-0 main-pos-y) (* (-> s4-0 main-spd-y) (seconds-per-frame))) + (vector-! s2-0 s2-0 (-> s4-0 root trans)) + (vector-inv-orient-by-quat! s2-0 s2-0 (-> s4-0 root quat)) + (let ((a1-13 (-> s4-0 main-pos))) + (let ((v1-19 (-> s4-0 main-pos))) + (let ((a0-20 (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-0 main-pos)))) + (let ((a2-10 (* 4.0 (seconds-per-frame)))) + (.mov vf7 a2-10) + ) + (.lvf vf5 (&-> a0-20 quad)) + ) + (.lvf vf4 (&-> v1-19 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 (&-> a1-13 quad) vf6) + ) + ) + (quaternion-slerp! (-> s4-0 main-quat) (-> s4-0 main-quat) s3-0 0.8) + ) + (quaternion-copy! (-> arg1 quat) (-> s4-0 main-quat)) + (set! (-> arg1 trans quad) (-> s4-0 main-pos quad)) + (set! (-> arg1 trans y) (+ 16384.0 (-> s4-0 main-pos-y))) + (quaternion-copy! (-> arg1 quat) (the-as quaternion (-> s4-0 rigidbody rot))) + (set! (-> arg1 trans quad) + (-> (rigid-body-control-method-25 (-> s4-0 rigidbody) (new 'stack-no-clear 'vector)) quad) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +(defun bombbot-head-callback ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((a1-1 (-> s4-0 nav state))) + (set! (-> s2-0 quad) (-> a1-1 target-pos quad)) + ) + (vector-! s2-0 s2-0 (-> s4-0 root trans)) + (set! (-> s2-0 y) 0.0) + (let ((a1-6 (-> s4-0 nav state))) + (set! (-> s2-0 quad) (-> a1-6 heading quad)) + ) + (vector-normalize! s2-0 1.0) + (quaternion-from-two-vectors! + s3-0 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root quat)) + s2-0 + ) + (quaternion-smooth-seek! (-> s4-0 top-quat) (-> s4-0 top-quat) s3-0 (* 4.0 (seconds-per-frame))) + ) + (quaternion-copy! (-> arg1 quat) (-> s4-0 top-quat)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +(defun bombbot-gun-swivel-callback ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-128 vector) (sv-144 vector) (sv-160 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s3-0 (the-as bombbot (-> arg0 param1)))) + (set! sv-160 (new 'stack-no-clear 'vector)) + (let ((s4-0 (new 'stack-no-clear 'quaternion)) + (s0-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector))) + ) + (set! sv-144 sv-160) + (set! sv-128 (-> s3-0 target-pos)) + (let ((v0-2 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) + (.lvf vf4 (&-> sv-128 quad)) + (.lvf vf5 (&-> v0-2 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-144 quad) vf6) + (rot-zxy-from-vector! s0-0 (-> arg0 bone transform fvec)) + (rot-zxy-from-vector! s0-0 *z-vector*) + (rot-zxy-from-vector! s1-0 sv-160) + (set! (-> s2-0 x) (deg- (-> s1-0 x) (-> s0-0 x))) + (set! (-> s2-0 y) (deg- (-> s1-0 y) (-> s0-0 y))) + (set! (-> s2-0 y) (deg- (-> s1-0 y) 0.0)) + (set! (-> s3-0 angle-turret) (deg-seek (-> s3-0 angle-turret) (-> s2-0 y) (* 36408.89 (seconds-per-frame)))) + (quaternion-vector-angle! s4-0 *up-vector* (-> s3-0 angle-turret)) + (quaternion->matrix (-> arg0 bone transform) s4-0) + (set! (-> arg0 bone transform trans quad) (-> s5-0 quad)) + ) + ) + 0 + (none) + ) + ) + +(defun bombbot-gun-callback ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-112 vector) (sv-128 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-128 s0-0) + (set! sv-112 (-> s4-0 target-pos)) + (let ((v0-1 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) + (.lvf vf4 (&-> sv-112 quad)) + (.lvf vf5 (&-> v0-1 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-128 quad) vf6) + (rot-zxy-from-vector! s2-0 (-> arg0 bone transform fvec)) + (rot-zxy-from-vector! s1-0 s0-0) + (set! (-> s3-0 x) (fmax -4551.1113 (fmin 4551.1113 (deg- (-> s1-0 x) (-> s2-0 x))))) + (set! (-> s3-0 y) (deg- (-> s1-0 y) (-> s2-0 y))) + (set! (-> s4-0 angle-gun) + (deg-seek (-> s4-0 angle-gun) (-> s3-0 x) (* (-> s4-0 gun-rotation-speed) (seconds-per-frame))) + ) + ) + ) + (quaternion-vector-angle! (-> arg1 quat) *x-vector* (+ (-> s4-0 angle-gun) (-> s4-0 extra-angle-gun))) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +(deftype spring-setup (structure) + ((bpos1 vector) + (wpos2 vector) + ) + ) + + +(define *bombbot-spring-setup* (new 'static 'boxed-array :type spring-setup + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x 4096.0 :y -4096.0 :z 4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x 6144.0 :y 14336.0 :z 6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x 4096.0 :y -4096.0 :z -4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x 6144.0 :y 14336.0 :z -6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x -4096.0 :y -4096.0 :z -4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x -6144.0 :y 14336.0 :z -6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x -4096.0 :y -4096.0 :z 4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x -6144.0 :y 14336.0 :z 6144.0 :w 1.0) + ) + ) + ) + +(defmethod bombbot-method-198 ((this bombbot)) + (local-vars (at-0 int) (sv-160 vector) (sv-176 vector)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (vector-reset! a1-0) + (set! (-> a1-0 y) (* -1.0 (-> this info extra gravity) (-> this rigidbody info mass))) + (add-force! (-> this rigidbody) a1-0) + ) + (rigid-body-control-method-26 (-> this rigidbody)) + (logclear! (-> this rigidbody flags) (rigid-body-flag active)) + (dotimes (s5-0 4) + (let ((s4-0 (vector-matrix*! + (new 'stack-no-clear 'vector) + (-> *bombbot-spring-setup* s5-0 bpos1) + (-> this rigidbody matrix) + ) + ) + ) + (set! sv-160 (new 'stack-no-clear 'vector)) + (let ((v1-19 (-> *bombbot-spring-setup* s5-0 wpos2 quad))) + (set! (-> sv-160 quad) v1-19) + ) + (set! sv-176 (new 'stack-no-clear 'vector)) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> sv-160 y) (* (-> this legs-strength s5-0) (-> sv-160 y))) + (+! (-> sv-160 y) (-> this feet s5-0 main-y)) + 0.0 + 0.0 + 0.0 + (rigid-body-control-method-23 (-> this rigidbody) s4-0 sv-176) + (let ((v1-31 s0-0)) + (.lvf vf4 (&-> s4-0 quad)) + (.lvf vf5 (&-> sv-160 quad)) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-31 quad) vf6) + ) + (let ((a1-4 s1-0) + (v1-32 *null-vector*) + ) + (vector-! a1-4 sv-176 v1-32) + ) + (let ((f0-10 (vector-length s0-0))) + (vector-float*! s2-0 s0-0 (/ 1.0 f0-10)) + (let ((f0-12 (* 60.0 (+ -40.96 f0-10))) + (f1-8 (* 0.8 (vector-dot s1-0 s2-0))) + ) + (vector-float*! s3-0 s2-0 (- (+ f0-12 f1-8))) + ) + ) + (apply-impact! (-> this rigidbody) s4-0 s3-0) + ) + ) + ) + (let ((v1-48 (new 'stack-no-clear 'vector))) + (.lvf vf1 (&-> (-> this linear-speed) quad)) + (let ((f0-15 (-> pp clock frames-per-second))) + (.mov at-0 f0-15) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-48 quad) vf1) + ) + 0 + (none) + ) + ) + ) + +(defmethod bombbot-method-199 ((this bombbot)) + (rigid-body-control-method-10 + (-> this rigidbody) + (the-as rigid-body-object this) + (seconds-per-frame) + 0.033333335 + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this bombbot)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *bombbot-nav-enemy-info*) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (let ((v1-7 (-> this nav))) + (set! (-> v1-7 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (dotimes (s5-1 4) + (set! (-> this joint-ik s5-1) + (new + 'process + 'joint-mod-ik + this + (-> *bombbot-ik-limb-setup* s5-1 elbow-index) + (-> *bombbot-ik-limb-setup* s5-1 hand-dist) + ) + ) + (set! (-> this joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + ) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 3 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 2 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 3 flags) (joint-mod-ik-flags elbow-rot-neg)) + (let ((f1-0 11878.4) + (f0-6 10240.0) + ) + (let ((f2-0 -10240.0)) + (let ((v1-51 (-> this feet))) + (set! (-> v1-51 0 pos-offset x) f1-0) + (set! (-> v1-51 0 pos-offset y) 0.0) + (set! (-> v1-51 0 pos-offset z) f0-6) + (set! (-> v1-51 0 pos-offset w) 1.0) + ) + (set! (-> this feet 0 offset) 0.0) + (let ((v1-52 (-> this feet 1))) + (set! (-> v1-52 pos-offset x) f1-0) + (set! (-> v1-52 pos-offset y) 0.0) + (set! (-> v1-52 pos-offset z) f2-0) + (set! (-> v1-52 pos-offset w) 1.0) + ) + (set! (-> this feet 1 offset) 0.5) + (let ((v1-54 (-> this feet 2))) + (set! (-> v1-54 pos-offset x) (- f1-0)) + (set! (-> v1-54 pos-offset y) 0.0) + (set! (-> v1-54 pos-offset z) f2-0) + (set! (-> v1-54 pos-offset w) 1.0) + ) + ) + (set! (-> this feet 2 offset) 0.1) + (let ((v1-56 (-> this feet 3))) + (set! (-> v1-56 pos-offset x) (- f1-0)) + (set! (-> v1-56 pos-offset y) 0.0) + (set! (-> v1-56 pos-offset z) f0-6) + (set! (-> v1-56 pos-offset w) 1.0) + ) + ) + (set! (-> this feet 3 offset) 0.6) + (quaternion-copy! (-> this last-quat) (-> this root quat)) + (quaternion-copy! (-> this main-quat) *unity-quaternion*) + (let ((v1-60 (-> this nav))) + (set! (-> v1-60 sphere-mask) (the-as uint 68)) + ) + 0 + (let ((a0-28 (-> this node-list data 3))) + (set! (-> a0-28 param0) bombbot-callback) + (set! (-> a0-28 param1) this) + ) + (let ((a0-29 (-> this node-list data 4))) + (set! (-> a0-29 param0) bombbot-head-callback) + (set! (-> a0-29 param1) this) + ) + (let ((a0-30 (-> this node-list data 5))) + (set! (-> a0-30 param0) bombbot-gun-swivel-callback) + (set! (-> a0-30 param1) this) + ) + (let ((a0-31 (-> this node-list data 6))) + (set! (-> a0-31 param0) bombbot-gun-callback) + (set! (-> a0-31 param1) this) + ) + (set! (-> this rigidbody) (new 'process 'rigid-body-control this)) + (set! (-> this info) *bombbot-body-constants*) + (init! + (-> this rigidbody) + (-> this info info) + *null-vector* + *unity-quaternion* + (the-as (function rigid-body-object float) (method-of-object this bombbot-method-198)) + ) + (set! (-> this head-sound) (new 'static 'sound-id)) + (set! (-> this cannon-sound) (new 'static 'sound-id)) + (set! (-> this gun-rotation-speed) 7281.778) + (set! (-> this extra-angle-gun) 0.0) + (transform-post) + (dotimes (s5-2 4) + (let ((s4-1 (-> this feet s5-2))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> this root quat)) + (vector+! s3-0 s3-0 (-> this root trans)) + (set! (-> s4-1 next-position quad) (-> s3-0 quad)) + (set! (-> s4-1 position quad) (-> s3-0 quad)) + ) + (set! (-> s4-1 delta-y) 0.0) + ) + (set! (-> this legs-strength s5-2) 1.0) + ) + (set! (-> this draw light-index) (the-as uint 10)) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! s5-3 (-> this root quat)) + (set! (-> this y-angle) (vector-y-angle s5-3)) + (set! (-> this nav state heading quad) (-> s5-3 quad)) + ) + 0 + (set! (-> this max-hit-points) (-> this hit-points)) + 0 + (none) + ) + +(deftype bombbot-spawn-params (structure) + ((position vector :inline) + (quat quaternion :inline) + (nav-mesh nav-mesh) + (path bombbot-path) + (first-node uint32) + (stop-offset float) + ) + ) + + +;; WARN: Return type mismatch object vs none. +(defbehavior bombbot-init-by-other bombbot ((arg0 bombbot-spawn-params)) + (stack-size-set! (-> self main-thread) 512) + (set! (-> self city-path) (-> arg0 path)) + (set! (-> self current-node) (-> arg0 first-node)) + (init-enemy-collision! self) + (set! (-> self root trans quad) (-> self city-path node (-> self current-node) position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (vector-identity! (-> self root scale)) + (-> arg0 nav-mesh) + (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + (init-enemy! self) + (set! (-> self shot-count) (the-as uint 5)) + (set! (-> self last-trans quad) (-> self root trans quad)) + (logior! (-> self mask) (process-mask kg-robot)) + (set! (-> self minimap) #f) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) + (logior! (-> self mask) (process-mask enemy)) + (set! (-> self stop-shoot) (+ (current-time) (the int (-> arg0 stop-offset)))) + (set! (-> self shoot-duration) 1.0) + (set! (-> self draw light-index) (the-as uint 10)) + (go-virtual hostile) + (none) + ) + +(defmethod send-attack-on-jump-or-knocked ((this bombbot) (arg0 process) (arg1 event-message-block)) + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-1 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask guard vehicle civilian kg-robot metalhead) (-> arg0 mask)) + (and v1-1 + (not (logtest? (-> (the-as process-focusable v1-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + +(deftype bomb-bot (bombbot) + () + ) + + +(defmethod bombbot-method-196 ((this bomb-bot) (arg0 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as process-focusable #f))) + (let ((f30-0 (the-as float #x7f800000)) + (s4-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (countdown (s3-0 (fill-actor-list-for-box *actor-hash* arg0 s4-0 64)) + (let* ((s2-0 (-> s4-0 s3-0)) + (a0-3 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (when a0-3 + (let* ((s1-0 (-> a0-3 process)) + (s2-1 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when (and (the-as process-focusable s2-1) + (and (!= this (the-as process-focusable s2-1)) + (not (focus-test? this inactive)) + (not (focus-test? this disable)) + (not (focus-test? this dead)) + (let ((s1-1 (the-as process-focusable s2-1))) + (and (if (type? s1-1 bombbot) + s1-1 + ) + (the-as process-focusable s2-1) + (not (logtest? (-> (the-as process-focusable s2-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + ) + ) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> (the-as process-focusable s2-1) root trans)))) + (when (or (not gp-0) (< f0-0 f30-0)) + (set! gp-0 (the-as process-focusable s2-1)) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + ) + ) + (cond + (gp-0 + (set! (-> this target-pos quad) (-> (get-trans gp-0 3) quad)) + (let ((v1-25 (-> this target-pos))) + (let ((a0-12 (-> gp-0 root trans))) + (let ((a1-7 (-> gp-0 root transv))) + (let ((a2-1 0.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-7 quad)) + ) + (.lvf vf4 (&-> a0-12 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 (&-> v1-25 quad) vf6) + ) + (set! (-> this start-target-pos quad) (-> this target-pos quad)) + (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) + (try-update-focus (-> this focus) gp-0 this) + ) + (else + (clear-focused (-> this focus)) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod go-idle2 ((this bomb-bot)) + (go (method-of-object this hostile)) + ) + +(defstate hostile (bomb-bot) + :virtual #t + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (< (-> self next-target) (current-time)) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (set! (-> a1-0 w) 409600.0) + (bombbot-method-196 self a1-0) + ) + (set! (-> self next-target) (+ (current-time) (seconds 4))) + (set! (-> self gun-type) (the-as uint 0)) + 0 + ) + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when gp-0 + (when (< (current-time) (+ (-> self next-target) (seconds -2))) + (set-time! (-> self start-target)) + (set! (-> self start-target-pos quad) (-> (get-trans gp-0 3) quad)) + (set! (-> self start-target-vel quad) (-> gp-0 root transv quad)) + (vector-! (-> self target-delta) (-> gp-0 root trans) (-> self root trans)) + ) + (let ((a1-5 (-> self target-pos))) + (let ((v1-26 (-> self start-target-pos))) + (let ((a0-17 (-> self start-target-vel))) + (let ((a2-4 (* 0.0033333334 (the float (- (current-time) (-> self start-target)))))) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-17 quad)) + ) + (.lvf vf4 (&-> v1-26 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 (&-> a1-5 quad) vf6) + ) + (set! (-> self target-pos quad) (-> self start-target-pos quad)) + (if (< (+ (-> self next-target) (seconds -1)) (current-time)) + (bombbot-method-197 self) + (bombbot-method-204 self) + ) + ) + ) + (bombbot-method-205 self) + (new 'stack-no-clear 'vector) + (let ((f0-4 (* 0.25 (+ (-> self feet 0 next-position y) + (-> self feet 1 next-position y) + (-> self feet 2 next-position y) + (-> self feet 3 next-position y) + ) + ) + ) + ) + (if (!= (-> self nav state mesh) *default-nav-mesh*) + (+! (-> self root trans y) (* 4.0 (seconds-per-frame) (- f0-4 (-> self root trans y)))) + ) + ) + (if (= (vector-length (-> self root transv)) 0.0) + (set-time! (-> self state-time)) + ) + (bombbot-method-202 self) + (bombbot-method-195 self) + ) + ) + :post (behavior () + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (enemy-common-post self) + (update-transforms (-> self root)) + ) + (else + (if (logtest? (-> self nav state flags) (nav-state-flag at-target)) + (nav-enemy-method-164 self) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> self nav state target-pos quad)) + (nav-enemy-method-187 self) + ) + ) + ) + ) + +(defmethod init-from-entity! ((this bomb-bot) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (init-enemy-collision! this) + (process-drawable-from-entity! this arg0) + (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + (init-enemy! this) + (set! (-> this shot-count) (the-as uint 5)) + (set! (-> this last-trans quad) (-> this root trans quad)) + (logior! (-> this mask) (process-mask kg-robot)) + (set! (-> this minimap) #f) + (logior! (-> this mask) (process-mask enemy)) + (set-time! (-> this stop-shoot)) + (set! (-> this shoot-duration) 1.0) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this hit-points) 35.0) + (let ((v1-19 (-> this nav state)) + (a0-13 (-> this root trans)) + ) + (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-19 target-pos quad) (-> a0-13 quad)) + ) + 0 + (set! (-> this max-hit-points) (-> this hit-points)) + (go (method-of-object this hostile)) + ) + +(deftype bombbot-player (bombbot) + ((camera-x-angle float) + (hold-fire symbol) + (hold-fire-time time-frame) + (health-hud handle) + ) + (:state-methods + done + ) + ) + + +(defmethod move-above-ground! ((this bombbot-player) (arg0 vector) (arg1 move-above-ground-params)) + (let ((a1-1 (new 'stack-no-clear 'collide-query))) + (find-ground + (-> this root) + a1-1 + (-> this enemy-info gnd-collide-with) + 16384.0 + 81920.0 + 1024.0 + (the-as process #f) + ) + ) + (-> *math-camera* inv-camera-rot) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> *math-camera* inv-camera-rot fvec quad)) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((a1-2 (new 'stack-no-clear 'collide-query))) + (new 'stack-no-clear 'vector) + (let ((v1-10 (-> a1-2 bbox)) + (a0-6 (-> this root trans)) + (a2-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-2 x) 40960.0) + (set! (-> a2-2 y) -8192.0) + (set! (-> a2-2 z) 40960.0) + (set! (-> a2-2 w) 1.0) + (vector-! (the-as vector v1-10) a0-6 a2-2) + ) + (let ((v1-12 (-> a1-2 bbox max)) + (a0-8 (-> this root trans)) + (a2-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-3 x) 40960.0) + (set! (-> a2-3 y) 32768.0) + (set! (-> a2-3 z) 40960.0) + (set! (-> a2-3 w) 1.0) + (vector+! v1-12 a0-8 a2-3) + ) + (set! (-> a1-2 collide-with) (collide-spec backgnd)) + (set! (-> a1-2 ignore-process0) #f) + (set! (-> a1-2 ignore-process1) #f) + (set! (-> a1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (fill-using-bounding-box *collide-cache* a1-2) + ) + (dotimes (s4-0 (-> *collide-cache* num-tris)) + (let ((a0-11 (-> *collide-cache* tris s4-0))) + (when (!= (-> a0-11 pat mode) (pat-mode wall)) + (mem-copy! + (the-as pointer (-> *collide-cache* tris s4-0)) + (the-as pointer (-> *collide-cache* tris (+ (-> *collide-cache* num-tris) -1))) + 64 + ) + (+! (-> *collide-cache* num-tris) -1) + (+! (-> *collide-cache* prims 0 num-tris) -1) + (+! s4-0 -1) + ) + ) + ) + (let ((v1-40 (new 'stack-no-clear 'collide-query)) + (a0-19 (-> this root)) + ) + (set! (-> v1-40 collide-with) (collide-spec backgnd)) + (set! (-> v1-40 ignore-process0) this) + (set! (-> v1-40 ignore-process1) #f) + (set! (-> v1-40 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-40 action-mask) (collide-action solid)) + (integrate-and-collide! a0-19 arg0) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod enemy-common-post ((this bombbot-player)) + (let ((t9-0 (method-of-type bombbot enemy-common-post))) + (t9-0 this) + ) + (set! (-> *game-info* health-bar) (* 100.0 (/ (-> this hit-points) (-> this max-hit-points)))) + (let ((f0-3 (* 0.25 (+ (-> this feet 0 next-position y) + (-> this feet 1 next-position y) + (-> this feet 2 next-position y) + (-> this feet 3 next-position y) + ) + ) + ) + ) + (when (!= (-> this nav state mesh) *default-nav-mesh*) + (+! (-> this root trans y) (* 4.0 (seconds-per-frame) (- f0-3 (-> this root trans y)))) + (if (< (-> this root trans y) (+ -12288.0 (-> this root gspot-pos y))) + (set! (-> this root trans y) (+ -12288.0 (-> this root gspot-pos y))) + ) + ) + ) + (none) + ) + +(defmethod get-trans ((this bombbot-player) (arg0 int)) + "Get the `trans` for this process." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (cond + ((= arg0 4) + (let ((gp-0 (new 'static 'vector))) + (let ((v1-2 (-> this root trans))) + (let ((a0-1 *y-vector*)) + (let ((a1-2 12288.0)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-2 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 (&-> gp-0 quad) vf6) + (let ((s4-0 gp-0)) + (let ((s5-0 gp-0)) + (let ((v1-3 (-> (camera-matrix) rvec))) + (let ((a0-2 0.0)) + (.mov vf7 a0-2) + ) + (.lvf vf5 (&-> v1-3 quad)) + ) + (.lvf vf4 (&-> s5-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 (&-> s4-0 quad) vf6) + ) + gp-0 + ) + ) + (else + ((method-of-type nav-enemy get-trans) this arg0) + ) + ) + ) + ) + +(defmethod bombbot-method-196 ((this bombbot-player) (arg0 vector)) + (local-vars + (sv-864 process-drawable) + (sv-868 number) + (sv-872 vector) + (sv-876 vector) + (sv-880 collide-query) + (sv-884 (pointer collide-shape)) + (sv-888 vector) + (sv-896 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! sv-864 (the-as process-drawable #f)) + ;; og:preserve-this + (set! sv-868 (the-as float #x7f800000)) + (set! sv-872 (new 'stack-no-clear 'vector)) + (set! sv-876 (new 'stack-no-clear 'vector)) + (set! sv-880 (new 'stack-no-clear 'collide-query)) + (set! sv-884 (new 'stack-no-clear 'array 'collide-shape 64)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> (camera-matrix) fvec quad)) + (set! sv-888 s5-0) + ) + (set! sv-896 0) + (set! (-> sv-888 y) 0.0) + (vector-normalize! sv-888 1.0) + (let ((s5-1 sv-876)) + (let ((v1-8 (camera-pos))) + (let ((a0-2 sv-888)) + (let ((a1-3 40960.0)) + (.mov vf7 a1-3) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-8 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 (&-> s5-1 quad) vf6) + ) + (set! (-> sv-876 quad) (-> (get-trans this 4) quad)) + (matrix->trans (-> this node-list data 6 bone transform) sv-872) + (set! (-> sv-876 y) (-> sv-872 y)) + (vector-normalize-copy! sv-872 sv-888 204800.0) + (set! (-> sv-880 start-pos quad) (-> sv-876 quad)) + (set! (-> sv-880 move-dist quad) (-> sv-872 quad)) + (let ((v1-20 sv-880)) + (set! (-> v1-20 radius) 40.96) + (set! (-> v1-20 collide-with) (collide-spec backgnd)) + (set! (-> v1-20 ignore-process0) this) + (set! (-> v1-20 ignore-process1) #f) + (set! (-> v1-20 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-20 action-mask) (collide-action solid)) + ) + (let ((f0-5 (fill-and-probe-using-line-sphere *collide-cache* sv-880))) + (if (>= f0-5 0.0) + (vector-float*! sv-872 sv-872 f0-5) + ) + ) + (set! sv-896 (fill-actor-list-for-sphere *actor-hash* sv-876 sv-872 40960.0 sv-884 64 -1)) + (countdown (s5-3 sv-896) + (let* ((s4-0 (-> sv-884 s5-3)) + (a0-19 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (when a0-19 + (let* ((s3-0 (-> a0-19 process)) + (s4-1 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (when (and s4-1 + (valid-target? this (the-as process-focusable s4-1)) + (not (logtest? (process-mask guard) (-> s4-1 mask))) + (not (logtest? (process-mask civilian) (-> s4-1 mask))) + (not (logtest? (process-mask vehicle) (-> s4-1 mask))) + ) + (vector-! s3-1 (-> s4-1 root trans) (-> this root trans)) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (when (< (cos 2730.6667) (vector-dot s3-1 sv-888)) + (let ((f0-8 (vector-vector-xz-distance (-> this root trans) (-> s4-1 root trans)))) + (when (and (or (not sv-864) (< f0-8 (the-as float sv-868))) + (< (-> s4-1 root trans y) (+ 61440.0 (-> this root trans y))) + ) + (set! sv-864 s4-1) + (set! sv-868 f0-8) + ) + ) + ) + ) + ) + ) + ) + (cond + (sv-864 + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable sv-864) 3) quad)) + (set! (-> this start-target-pos quad) (-> sv-864 root trans quad)) + (set! (-> this start-target-vel quad) (-> sv-864 root transv quad)) + (try-update-focus (-> this focus) (the-as process-focusable sv-864) this) + ) + (else + (vector+! (-> this target-pos) sv-876 sv-872) + (clear-focused (-> this focus)) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod bombbot-method-197 ((this bombbot-player)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (handle->process (-> this focus handle)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> this node-list data 6 bone transform)) + (v1-7 (-> a2-0 rvec quad)) + (a0-5 (-> a2-0 uvec quad)) + (a1-1 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 rvec quad) v1-7) + (set! (-> s5-0 uvec quad) a0-5) + (set! (-> s5-0 fvec quad) a1-1) + (set! (-> s5-0 trans quad) a2-1) + ) + (new 'stack-no-clear 'matrix) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (matrix->trans s5-0 s3-0) + (let ((a1-3 s3-0)) + (let ((v1-12 s3-0)) + (let ((a0-7 (-> s5-0 fvec))) + (let ((a2-3 8192.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-7 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> a1-3 quad) vf6) + ) + (vector-normalize-copy! s4-0 (-> s5-0 fvec) 614400.0) + (spawn-bombbot-projectile + this + s3-0 + (vector+! (new 'stack-no-clear 'vector) s3-0 s4-0) + 819200.0 + (the-as vector #f) + 3.0 + ) + (launch-particles (-> *part-id-table* 2055) s3-0) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> s4-0 quad)) + (vector-normalize! s5-1 -2048000.0) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) + (apply-impact! + (-> this rigidbody) + (rigid-body-control-method-25 (-> this rigidbody) (new 'stack-no-clear 'vector)) + s5-1 + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defstate hostile (bombbot-player) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self camera-x-angle) 25.0) + (let ((f30-0 (* 182.04445 (-> self camera-x-angle)))) + (set-setting! 'string-min-height 'abs (+ -4096.0 (* 61440.0 (sin f30-0))) 0) + (set-setting! 'string-max-height 'abs (+ 4096.0 (* 61440.0 (sin f30-0))) 0) + (set-setting! 'string-min-length 'abs (+ -4096.0 (* 61440.0 (cos f30-0))) 0) + (set-setting! 'string-max-length 'abs (+ 4096.0 (* 61440.0 (cos f30-0))) 0) + ) + (set-setting! 'immediate-string-min-max #f 0.0 0) + (logior! (-> self focus-status) (focus-status dangerous)) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (sound-stop (-> self head-sound)) + (sound-stop (-> self cannon-sound)) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((f0-1 (the float (+ (-> *cpad-list* cpads 0 righty) -128)))) + (when (< 32.0 (fabs f0-1)) + (set! (-> self camera-x-angle) (- (-> self camera-x-angle) (* 0.3 (seconds-per-frame) f0-1))) + (if (< 25.0 (-> self camera-x-angle)) + (set! (-> self camera-x-angle) 25.0) + ) + (if (< (-> self camera-x-angle) -4.0) + (set! (-> self camera-x-angle) -4.0) + ) + ) + ) + (let ((f30-0 (* 182.04445 (-> self camera-x-angle)))) + (set-setting! 'string-min-height 'abs (+ -4096.0 (* 61440.0 (sin f30-0))) 0) + (set-setting! 'string-max-height 'abs (+ 4096.0 (* 61440.0 (sin f30-0))) 0) + (set-setting! 'string-min-length 'abs (+ -4096.0 (* 61440.0 (cos f30-0))) 0) + (set-setting! 'string-max-length 'abs (+ 4096.0 (* 61440.0 (cos f30-0))) 0) + (set-setting! 'slave-options 'set 0.0 (cam-slave-options BOMBBOT)) + (if *camera* + (vector-normalize! (-> *camera* slave 0 view-flat) (+ 4096.0 (* 61440.0 (cos f30-0)))) + ) + ) + (set-setting! 'immediate-string-min-max #f 0.0 0) + (let* ((v1-45 *game-info*) + (a0-13 (+ (-> v1-45 attack-id) 1)) + ) + (set! (-> v1-45 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((s5-5 (-> self target-pos))) + (let ((gp-5 (camera-pos))) + (let ((v1-46 (-> (camera-matrix) fvec))) + (let ((a0-15 204800.0)) + (.mov vf7 a0-15) + ) + (.lvf vf5 (&-> v1-46 quad)) + ) + (.lvf vf4 (&-> gp-5 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 (&-> s5-5 quad) vf6) + ) + (let ((a1-7 (new 'stack-no-clear 'vector))) + (set! (-> a1-7 quad) (-> self root trans quad)) + (set! (-> a1-7 w) 204800.0) + (bombbot-method-196 self a1-7) + ) + (set! (-> self next-target) (+ (current-time) (seconds 2))) + (set-time! (-> self start-target)) + (cond + ((and (-> self hold-fire) (>= (+ (current-time) (seconds -0.3)) (-> self hold-fire-time))) + (+! (-> self extra-angle-gun) (* -8192.0 (seconds-per-frame))) + (if (< (-> self extra-angle-gun) -3640.889) + (set! (-> self extra-angle-gun) -3640.889) + ) + ) + (else + (+! (-> self extra-angle-gun) (* 18204.445 (seconds-per-frame))) + (if (< 0.0 (-> self extra-angle-gun)) + (set! (-> self extra-angle-gun) 0.0) + ) + (bombbot-method-204 self) + ) + ) + (when (handle->process (-> self focus handle)) + ) + (when (and (cpad-pressed? 0 r1) (>= (+ (current-time) (seconds -0.02)) (-> self next-shoot))) + (set-time! (-> self next-shoot)) + (bombbot-method-197 self) + ) + (bombbot-method-205 self) + (if (= (vector-length (-> self root transv)) 0.0) + (set-time! (-> self state-time)) + ) + (bombbot-method-202 self) + (bombbot-method-195 self) + (send-event *camera* 'change-target self) + ) + ) + :code (behavior () + (local-vars (v1-1 object)) + (until v1-1 + (suspend) + (set! v1-1 + (and *target* (not (focus-test? *target* teleporting)) (send-event *target* 'change-mode 'grab-ride #t)) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (-> self root) + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (enemy-common-post self) + (update-transforms (-> self root)) + ) + (else + (-> *math-camera* inv-camera-rot) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (vector-rotate90-around-y! s4-0 gp-0) + (vector-cross! gp-0 (-> self root gspot-normal) s4-0) + ) + (vector-rotate-around-y! gp-0 gp-0 (-> *cpad-list* cpads 0 stick0-dir)) + (let ((v1-17 s5-0)) + (let ((a0-10 (-> self root trans))) + (let ((a1-3 gp-0)) + (let ((a2-4 (* 12288.0 (-> *cpad-list* cpads 0 stick0-speed)))) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-10 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 (&-> v1-17 quad) vf6) + ) + (set! (-> self root transv y) 0.0) + (when (< 0.4 (-> *cpad-list* cpads 0 stick0-speed)) + (let ((v1-24 (-> self nav state))) + (logclear! (-> v1-24 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-24 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-24 target-pos quad) (-> s5-0 quad)) + ) + 0 + (when *target* + (quaternion-look-at! (-> *target* control dir-targ) gp-0 *up-vector*) + (quaternion-look-at! (-> *target* control quat) gp-0 *up-vector*) + ) + ) + ) + ) + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 target-speed) (* 49152.0 (-> *cpad-list* cpads 0 stick0-speed))) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + ) + ) + ) + +(defstate explode (bombbot-player) + :virtual #t + :code (behavior () + (send-event (handle->process (-> self health-hud)) 'hide-and-die) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defstate done (bombbot-player) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('dead) + #t + ) + ) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch none vs sound-id. +(defmethod play-damage-sound ((this bombbot-player) (arg0 int)) + ((method-of-type bombbot play-damage-sound) this arg0) + (the-as sound-id (if (zero? arg0) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) + ) + ) + ) + +(defbehavior bombbot-player-init-by-other bombbot-player ((arg0 bombbot-spawn-params)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (stack-size-set! (-> self main-thread) 512) + (set! (-> self city-path) (-> arg0 path)) + (set! (-> self current-node) (the-as uint 0)) + (init-enemy-collision! self) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (vector-identity! (-> self root scale)) + (-> arg0 nav-mesh) + (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + (init-enemy! self) + (set! (-> self gun-rotation-speed) 7281.778) + (set! (-> self shot-count) (the-as uint 5)) + (set! (-> self last-trans quad) (-> self root trans quad)) + (set! (-> self minimap) #f) + (logior! (-> self mask) (process-mask enemy guard)) + (send-event *camera* 'change-target self) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'teleport-to-vector-start-string) + (let ((v1-25 (new 'stack-no-clear 'vector))) + (let ((a0-16 (-> arg0 position))) + (let ((a2-0 *z-vector*)) + (let ((a3-1 40960.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> a0-16 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 (&-> v1-25 quad) vf6) + (set! (-> a1-3 param 0) (the-as uint v1-25)) + ) + (send-event-function *camera* a1-3) + ) + (set! (-> self shoot-duration) 1.0) + (set! (-> self hold-fire) #f) + (set! (-> self draw light-index) (the-as uint 10)) + (set! (-> self max-hit-points) (the float (+ (* 50 (the int (you-suck-scale *game-info* #f 0))) 50))) + (set! (-> self hit-points) (-> self max-hit-points)) + (set! (-> self health-hud) + (ppointer->handle (process-spawn bombbot-hud :init hud-init-by-other :name "bombbot-hud" :to self)) + ) + (set! (-> self mission-squad) *cty-attack-controller*) + (when (-> self mission-squad) + (set! (-> self attacker-info) (allocate-attacker (-> self mission-squad))) + (init! (-> self attacker-info) self 13) + (set! (-> self attacker-info max-num-attackers) (the-as uint 16)) + (logior! (-> self attacker-info flags) (city-attacker-info-flag cai1 cai4)) + ) + (go-virtual hostile) + ) + ) + +(deftype task-manager-blow-barricade (task-manager) + ((check-timer time-frame) + (bombbot-h handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (done? int32) + (minimap connection-minimap) + (wall-h handle) + (start-point vector :inline) + ) + (:methods + (task-manager-blow-barricade-method-32 (_type_) none) + ) + ) + + +(defstate active (task-manager-blow-barricade) + :virtual #t + :parent (task-manager-blow-barricade active) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('checkpoint) + #f + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (remove-setting! 'entity-name) + ) + :trans (behavior () + (let ((gp-0 (entity-by-name "krimson-wall-6"))) + (when gp-0 + (if (not (-> self wall-h)) + (set! (-> self wall-h) + (ppointer->handle + (process-spawn krimson-wall-break gp-0 'lbombbot :name "krimson-wall-break" :to *entity-pool*) + ) + ) + ) + ) + ) + (if (and (zero? (-> self done?)) (not (handle->process (-> self bombbot-h)))) + (send-event self 'fail) + ) + (let ((s3-0 (new 'static 'vector :x 4199997.5 :y 30146.56 :z 1763819.5 :w 1.0)) + (s4-0 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (target-pos 0) quad)) + (if (and (< 4096000.0 (vector-vector-distance s5-1 s3-0)) + (< 819200.0 (vector-vector-distance s5-1 (-> self start-point))) + ) + (send-event self 'fail) + ) + (vector+! s4-0 s3-0 (new 'static 'vector :z -163840.0 :w 1.0)) + (vector+! gp-1 s3-0 (new 'static 'vector :x 102400.0 :z 163840.0 :w 1.0)) + (when (and (zero? (-> self done?)) + (< (-> s4-0 x) (-> s5-1 x)) + (< (-> s4-0 z) (-> s5-1 z)) + (< (-> s5-1 x) (-> gp-1 x)) + (< (-> s5-1 z) (-> gp-1 z)) + ) + (set! (-> self done?) 1) + (set-setting! 'entity-name "camera-305" 0.0 0) + (send-event (handle->process (-> self bombbot-h)) 'blow-wall) + ) + ) + (when (= (-> self done?) 1) + (let ((v1-48 (handle->process (-> self bombbot-h)))) + (when (and v1-48 (-> v1-48 next-state) (= (-> v1-48 next-state name) 'explode)) + (set! (-> self done?) 2) + (let ((v1-55 (entity-by-name "krimson-wall-6"))) + (if v1-55 + (send-event (-> v1-55 extra process) 'break) + ) + ) + (send-event (handle->process (-> self wall-h)) 'break) + ) + ) + ) + (when (= (-> self done?) 2) + (when (send-event (handle->process (-> self wall-h)) 'done) + (when (process-release? *target*) + (send-event *target* 'continue (get-continue-by-name *game-info* "hiphog-start")) + (send-event self 'complete) + ) + ) + ) + ) + :code sleep-code + ) + +(defmethod task-manager-blow-barricade-method-32 ((this task-manager-blow-barricade)) + 0 + (none) + ) + +(define *blow-barricade-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-blow-barricade)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this wall-h) (the-as handle #f)) + (set-setting! 'music 'blowbarr 0.0 0) + (set! (-> this minimap) (add-icon! + *minimap* + this + (the-as uint 12) + (the-as int #f) + (new 'static 'vector :x 4199997.5 :y 30146.56 :z 1763819.5 :w 1.0) + 0 + ) + ) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'city-sound '(citybbf) 0.0 2) + (set-setting! 'disable-parking-spots? #t 0.0 0) + (when *cty-attack-controller* + (let ((s5-0 (push-back-hatred *cty-attack-controller*))) + (set! (-> s5-0 hatred) 0.6) + (set! (-> s5-0 hatred-dist) 245760.0) + (set! (-> s5-0 dist-scale) 0.5) + (set! (-> s5-0 attacker-scale) 0.01) + (set! (-> s5-0 max-consider-dist) 614400.0) + (set-hatred-indices-for-all *cty-attack-controller* 0 (get-hatred-at-idx *cty-attack-controller* 9 0) s5-0 13) + ) + ) + (set-vector! (-> this start-point) 2538700.8 31539.2 6048399.5 1.0) + (when (or (zero? (-> this bombbot-h)) (not (handle->process (-> this bombbot-h)))) + (let ((s5-1 (new 'stack 'bombbot-spawn-params))) + (set! (-> s5-1 nav-mesh) (get-nav-mesh (the-as actor-id #x48e9))) + (set! (-> s5-1 position quad) (-> this start-point quad)) + (set! (-> s5-1 position quad) (-> (target-pos 0) quad)) + (quaternion-copy! (-> s5-1 quat) (new 'static 'quaternion :y 0.841 :w 0.5409)) + (set! (-> this bombbot-h) + (ppointer->handle (process-spawn bombbot-player s5-1 :name "bombbot-player" :to this)) + ) + ) + ) + (set! (-> this done?) 0) + (set-setting! 'pickups #f 0.0 0) + (none) + ) + +(deftype task-manager-port-fight (task-manager) + ((check-timer time-frame) + (bombbot-h handle 4) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (done? int32) + (minimap connection-minimap) + (min-time uint32) + (intro-state int32 :offset 312) + (target-far-enough? symbol :offset 328) + ) + (:state-methods + fail-screen + ) + (:methods + (add-danger (_type_) none) + ) + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-port-fight)) + (if (not (-> this target-far-enough?)) + (add-danger this) + ) + (cond + ((zero? (-> this intro-state)) + (set! (-> this intro-time) (+ (current-time) (seconds 2))) + (+! (-> this intro-state) 1) + ) + ((= (-> this intro-state) 1) + (if (< (-> this intro-time) (current-time)) + (+! (-> this intro-state) 1) + ) + ) + ((= (-> this intro-state) 2) + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (if (process-grab? *target* #f) + (+! (-> this intro-state) 1) + ) + ) + ((= (-> this intro-state) 3) + (set-setting! 'interp-time 'abs 150.0 0) + (+! (-> this intro-state) 1) + ) + ((= (-> this intro-state) 4) + (send-event *camera* 'change-target (handle->process (-> this bombbot-h 1))) + (+! (-> this intro-state) 1) + (set! (-> this intro-time) (+ (current-time) (seconds 3))) + (sound-play "bb-cam-out") + (persist-with-delay *setting-control* 'blur-a (seconds 1) 'blur-a 'abs 0.5 0) + ) + ((= (-> this intro-state) 5) + (remove-setting! 'mode-name) + (when (< (-> this intro-time) (current-time)) + (remove-setting! 'interp-time) + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (+! (-> this intro-state) 1) + ) + ) + ((= (-> this intro-state) 6) + (set-setting! 'interp-time 'abs 150.0 0) + (+! (-> this intro-state) 1) + ) + ((= (-> this intro-state) 7) + (send-event *camera* 'change-target *target*) + (+! (-> this intro-state) 1) + (sound-play "bb-cam-in") + (persist-with-delay *setting-control* 'blur-a (seconds 1) 'blur-a 'abs 0.5 0) + ) + ((= (-> this intro-state) 8) + (remove-setting! 'mode-name) + (when (< (-> this intro-time) (current-time)) + (remove-setting! 'interp-time) + (if (process-release? *target*) + (+! (-> this intro-state) 1) + ) + ) + ) + ) + (when (and (-> this next-state) (= (-> this next-state name) 'active)) + (let ((s5-2 0)) + (let ((s4-2 10000)) + (dotimes (s3-0 3) + (when (-> this bombbot-h s3-0) + (let* ((s1-0 (handle->process (-> this bombbot-h s3-0))) + (s2-0 (if (type? s1-0 bombbot) + (the-as bombbot s1-0) + ) + ) + ) + (when s2-0 + (+! s5-2 1) + (let ((v1-114 + (the int (* 0.000030517578 (vector-vector-xz-distance + (-> s2-0 root trans) + (the-as vector (-> s2-0 city-path node (+ (-> s2-0 city-path node-count) -1))) + ) + ) + ) + ) + ) + (if (< v1-114 s4-2) + (set! s4-2 v1-114) + ) + ) + (when (= (-> s2-0 current-node) (+ (-> s2-0 city-path node-count) -1)) + ) + ) + ) + ) + ) + (set! (-> this min-time) (the-as uint s4-2)) + (cond + ((< s4-2 10) + (set! (-> *game-info* timer) (the-as time-frame (the int (* 300.0 (the float s4-2))))) + (if (not (-> this hud-timer)) + (set! (-> this hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to this)) + ) + ) + (if (zero? s4-2) + (go (method-of-object this fail-screen)) + ) + ) + (else + (when (handle->process (-> this hud-timer)) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (set! (-> this hud-timer) (the-as handle #f)) + ) + ) + ) + ) + (if (zero? s5-2) + (send-event this 'complete) + ) + ) + ) + (none) + ) + +(defstate active (task-manager-port-fight) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((gp-0 (new 'stack 'bombbot-spawn-params))) + (quaternion-copy! (-> gp-0 quat) (new 'static 'quaternion :y 0.841 :w 0.5409)) + (set! (-> gp-0 path) *bombbot-path-1*) + (set! (-> gp-0 first-node) (the-as uint 4)) + (set! (-> gp-0 stop-offset) 1500.0) + (set! (-> self bombbot-h 0) (ppointer->handle (process-spawn bombbot gp-0 :name "bombbot" :to self))) + (set! (-> gp-0 path) *bombbot-path-2*) + (set! (-> gp-0 first-node) (the-as uint 0)) + (set! (-> gp-0 stop-offset) 1500.0) + (set! (-> self bombbot-h 1) (ppointer->handle (process-spawn bombbot gp-0 :name "bombbot" :to self))) + (set! (-> gp-0 path) *bombbot-path-3*) + (set! (-> gp-0 first-node) (the-as uint 0)) + (set! (-> gp-0 stop-offset) 2100.0) + (set! (-> self bombbot-h 2) (ppointer->handle (process-spawn bombbot gp-0 :name "bombbot" :to self))) + ) + ) + ) + +(defstate fail-screen (task-manager-port-fight) + :virtual #t + :parent (task-manager-port-fight active) + :code (behavior () + (when (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead)))) + (cond + ((= (status-of-level-and-borrows *level* 'ctyport #f) 'active) + (set-setting! 'entity-name "camera-321" 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) + (suspend) + ) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) + (dotimes (gp-1 3) + (let ((s5-0 (handle->process (-> self bombbot-h gp-1)))) + (when s5-0 + (if (type? s5-0 bombbot) + (send-event s5-0 'explode) + ) + ) + ) + ) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.3))) + (suspend) + ) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (seconds-per-frame) + (bucket-id tex-hud-hud-alpha) + #x3fffff + #x33001 + #t + ) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) + (suspend) + ) + (set-setting! 'interp-time 'abs 0.0 0) + (remove-setting! 'entity-name) + ) + (else + ) + ) + ) + (send-event self 'fail) + (sleep-code) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod task-manager-method-25 ((this task-manager-port-fight)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (disable *screen-filter*) + (when (-> this hud-timer) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (set! (-> this hud-timer) (the-as handle #f)) + ) + (none) + ) + +(defmethod add-danger ((this task-manager-port-fight)) + (when *traffic-engine* + (let ((gp-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> gp-0 sphere quad) (-> (new 'static 'vector :x -242360.31 :y 31621.12 :z 5512233.0 :w 1.0) quad)) + (if (< 614400.0 (vector-vector-xz-distance (target-pos 0) (-> gp-0 sphere))) + (set! (-> this target-far-enough?) #t) + ) + (set! (-> gp-0 sphere r) 819200.0) + (vector-reset! (-> gp-0 velocity)) + (set! (-> gp-0 notify-radius) 819200.0) + (set! (-> gp-0 danger-level) 1.0) + (set! (-> gp-0 decay-rate) 0.0) + (set! (-> gp-0 flags) (the-as uint 1)) + (set! (-> gp-0 danger-type) (the-as uint 0)) + (add-danger *traffic-engine* gp-0) + ) + ) + 0 + (none) + ) + +(defstate wait (task-manager-port-fight) + :virtual #t + :code (behavior () + (while (or (not *target*) (not *spawn-actors*)) + (suspend) + ) + (set-time-limit self) + (while (or (not (level-get-target-inside *level*)) (!= (-> (level-get-target-inside *level*) name) 'ctyport)) + (suspend) + ) + (set-setting! 'airlock #f 0.0 0) + (go-virtual active) + ) + ) + +(defmethod set-time-limit ((this task-manager-port-fight)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! *bombbot-hint* (the-as sound-id 1)) + (set! *bombbot-hint-time* 0.0) + (set! (-> this bombbot-h 0) (the-as handle #f)) + (set! (-> this bombbot-h 1) (the-as handle #f)) + (set! (-> this bombbot-h 2) (the-as handle #f)) + (set! (-> this bombbot-h 3) (the-as handle #f)) + (set-setting! 'city-sound '(citybbh) 0.0 2) + (set-setting! 'music 'cityfi 0.0 0) + (set! (-> this hud-timer) (the-as handle #f)) + (set! (-> this target-far-enough?) #f) + (add-danger this) + (set! (-> this done?) 0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/common/cty-faction-h.gc b/goal_src/jak3/levels/city/common/cty-faction-h.gc index 1068a5ae69..d2fb66d83a 100644 --- a/goal_src/jak3/levels/city/common/cty-faction-h.gc +++ b/goal_src/jak3/levels/city/common/cty-faction-h.gc @@ -5,5 +5,174 @@ ;; name in dgo: cty-faction-h ;; dgos: DESRESC, HGA, WWD, CWI, LFACTORY +;; +++cty-faction-update-flag +(defenum cty-faction-update-flag + :type uint8 + :bitfield #t + (cfu0 0) + ) +;; ---cty-faction-update-flag + + +;; +++faction-spawn-flag +(defenum faction-spawn-flag + :type uint8 + :bitfield #t + (fs0 0) + (fs1 1) + (fs2 2) + (fs3 3) + ) +;; ---faction-spawn-flag + + +;; +++cty-faction-level +(defenum cty-faction-level + (pesc 0) + (pesb 1) + (pesa 2) + (pepa 3) + (car 4) + (pepc 5) + (pepb 6) + ) +;; ---cty-faction-level + + +;; +++nav-territory-type +(defenum nav-territory-type + :type uint8 + (port-ff-deep 0) + (port-ff-near-kg 1) + (port-ff-kg-border 2) + (inda-kg-ff-border 3) + (inda-kg 4) + (inda-kg-deep 5) + (indb-kg-deep 6) + (indb-kg 7) + (indb-kg-ff-border 8) + (sluma-ff-kg-border 9) + (sluma-ff 10) + (sluma-ff-deep 11) + (slumb-ff-deep 12) + (slumc-ff-deep 13) + (genc-border 14) + (genc 15) + (port-ff-near-mh 16) + (port-ff-mh-border 17) + (mhcity-mh-ff-border 18) + (mhcity-mh 19) + (mhcity-mh-deep 20) + (special0 21) + (special1 22) + (special2 23) + (special3 24) + (special4 25) + (special5 26) + (special6 27) + (special7 28) + (special8 29) + (invalid 128) + ) +;; ---nav-territory-type + + ;; DECOMP BEGINS +(deftype cty-faction-info (structure) + ((data int8 6) + (ff-guard int8 :overlay-at (-> data 0)) + (ff-ped int8 :overlay-at (-> data 1)) + (kg-guard int8 :overlay-at (-> data 2)) + (kg-ped int8 :overlay-at (-> data 3)) + (mh-guard int8 :overlay-at (-> data 4)) + (mh-ped int8 :overlay-at (-> data 5)) + ) + :allow-misaligned + ) + + +(deftype cty-faction-strength (structure) + ((data int8 3) + (ff-strength int8 :overlay-at (-> data 0)) + (kg-strength int8 :overlay-at (-> data 1)) + (mh-strength int8 :overlay-at (-> data 2)) + ) + :allow-misaligned + ) + + +(deftype territory-faction-mode (structure) + ((data int8 3) + (ff-mode uint8 :overlay-at (-> data 0)) + (kg-mode uint8 :overlay-at (-> data 1)) + (mh-mode uint8 :overlay-at (-> data 2)) + ) + :allow-misaligned + ) + + +(deftype territory-faction-flag (structure) + ((data uint8 3) + (ff-mode uint8 :overlay-at (-> data 0)) + (kg-mode uint8 :overlay-at (-> data 1)) + (mh-mode uint8 :overlay-at (-> data 2)) + ) + :pack-me + ) + + +(deftype faction-spawn-info (structure) + ((faction-type uint8) + (current-level uint8) + (requested-level uint8) + (flags faction-spawn-flag) + ) + :allow-misaligned + ) + + +(deftype cty-faction-manager (basic) + ((faction-array cty-faction-info 30) + (faction-mod-array cty-faction-info 30 :inline) + (global-faction-strength-mod cty-faction-strength :inline) + (territory-faction-strength-mod cty-faction-strength 4 :inline) + (permission-cache uint8 30 :offset 671) + (last-requested-level symbol) + (territory-faction-modes territory-faction-mode 30 :inline) + (territory-flags uint8 30) + (last-active-territories uint32) + (update-flags cty-faction-update-flag) + (target-exclusive-branch-index uint8) + (territory-faction-flags territory-faction-flag :inline) + (faction-spawn faction-spawn-info 7 :inline) + (last-change-music-time time-frame :offset 1344) + (start-fight-music-time time-frame) + ) + (:methods + (cty-faction-manager-method-9 (_type_ int symbol) int) + (cty-faction-manager-method-10 (_type_ int symbol) int) + (cty-faction-manager-method-11 (_type_ int) uint) + (cty-faction-manager-method-12 (_type_ int int) int) + (cty-faction-manager-method-13 (_type_) symbol) + (cty-faction-manager-method-14 (_type_ nav-territory-type int int) int) + (restore-defaults (_type_) cty-faction-update-flag) + (cty-faction-manager-method-16 (_type_ nav-territory-type) int) + (cty-faction-manager-method-17 (_type_ symbol) int) + (cty-faction-manager-method-18 (_type_ symbol) int) + (cty-faction-manager-method-19 (_type_) symbol) + (cty-faction-manager-method-20 (_type_ uint) int) + (cty-faction-manager-method-21 (_type_ int) symbol) + (cty-faction-manager-method-22 (_type_) cty-faction-update-flag) + (cty-faction-manager-method-23 (_type_ uint) symbol) + (cty-faction-manager-method-24 (_type_) symbol) + (faction-spawn (_type_ int int symbol symbol) faction-spawn-flag) + ) + ) + + +(defmethod cty-faction-manager-method-12 ((this cty-faction-manager) (arg0 int) (arg1 int)) + (-> this territory-faction-modes 0 data (+ arg1 (* arg0 16))) + ) + +(define *cty-faction-manager* (the-as cty-faction-manager #f)) diff --git a/goal_src/jak3/levels/city/common/cty-guard-projectile.gc b/goal_src/jak3/levels/city/common/cty-guard-projectile.gc index 6f8b535b8f..77d896ab1d 100644 --- a/goal_src/jak3/levels/city/common/cty-guard-projectile.gc +++ b/goal_src/jak3/levels/city/common/cty-guard-projectile.gc @@ -7,3 +7,591 @@ ;; DECOMP BEGINS +(deftype vehicle-grenade (projectile-bounce) + ((blast-radius float) + ) + (:methods + (vehicle-grenade-method-44 (_type_) none) + ) + ) + + +(defskelgroup skel-vehicle-grenade gun gun-grenade-lod0-jg gun-grenade-idle-ja + ((gun-grenade-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :texture-level 10 + ) + +(defmethod play-impact-sound ((this vehicle-grenade) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "grenade-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "grenade-explode") + ) + ) + ) + 0 + (none) + ) + +(defmethod setup-collision! ((this vehicle-grenade)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) projectile-bounce-reaction) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate explode)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 819.2) + (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! (-> s5-0 max-iteration-count) (the-as uint 2)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set-collide-with! + (-> this root) + (collide-spec + backgnd + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set-collide-as! (-> this root) (collide-spec enemy)) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +(defmethod projectile-method-40 ((this vehicle-grenade)) + 256 + ) + +(defmethod init-proj-settings! ((this vehicle-grenade)) + (ctywide-entity-hack) + (set! (-> this attack-mode) 'eco-dark) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-vehicle-grenade" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-3 (method-of-type projectile-bounce init-proj-settings!))) + (t9-3 this) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 213) this)) + (set! (-> this blast-radius) 16384.0) + (set! (-> this max-speed) 90112.0) + (set! (-> this timeout) (seconds 4)) + (let ((v1-11 (new 'stack-no-clear 'vector))) + (set! (-> v1-11 x) 2.0) + (set! (-> v1-11 y) 2.0) + (set! (-> v1-11 z) 2.0) + (set! (-> v1-11 w) 1.0) + (set! (-> this root scale quad) (-> v1-11 quad)) + ) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this vehicle-grenade)) + (spawn (-> this part) (-> this root trans)) + (ja-post) + 0 + (none) + ) + +(defmethod projectile-bounce-method-42 ((this vehicle-grenade)) + (spawn (-> this part) (-> this root trans)) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod projectile-method-39 ((this vehicle-grenade)) + (let* ((a2-0 (-> this root)) + (v1-0 (-> a2-0 status)) + ) + (if (logtest? v1-0 (collide-status touch-surface)) + (vector-float*! (-> a2-0 transv) (-> a2-0 transv) 0.2) + ) + (when (and (logtest? v1-0 (collide-status impact-surface)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) + ) + (set-time! (-> this played-bounce-time)) + (sound-play "grenade-bounce") + ) + ) + (none) + ) + +(defstate impact (vehicle-grenade) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (if (send-event + proc + 'attack + (-> block param 0) + (static-attack-info :mask (vehicle-impulse-factor) ((id (-> self attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'explode) + ) + ) + ) + #t + ) + ) + ) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) (-> self blast-radius)) + (set! (-> gp-0 scale) 1.0) + (set! (-> gp-0 group) (-> *part-group-id-table* 104)) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-0 damage) 6.0) + (set! (-> gp-0 damage-scale) 1.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle #f)) + (explosion-spawn gp-0 self) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-17 (-> self root root-prim))) + (set! (-> v1-17 prim-core collide-as) (collide-spec)) + (set! (-> v1-17 prim-core collide-with) (collide-spec)) + ) + 0 + (while (-> self child) + (suspend) + ) + (deactivate self) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-grenade-method-44 ((this vehicle-grenade)) + (when *traffic-manager* + (let ((v1-1 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-1 sphere quad) (-> this root trans quad)) + (set! (-> v1-1 sphere r) (-> this blast-radius)) + (set! (-> v1-1 velocity quad) (-> this root transv quad)) + (set! (-> v1-1 notify-radius) 122880.0) + (set! (-> v1-1 danger-level) 2.0) + (set! (-> v1-1 decay-rate) 0.0) + (set! (-> v1-1 flags) (the-as uint 1)) + (set! (-> v1-1 danger-type) (the-as uint 6)) + (set! (-> v1-1 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere v1-1) + ) + ) + (none) + ) + +(defstate sitting (vehicle-grenade) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (vehicle-grenade-method-44 self) + ) + :code (behavior () + (until #f + (when (time-elapsed? (-> self state-time) (seconds 0.5)) + (set-time! (-> self state-time)) + (vehicle-grenade-method-44 self) + ) + (suspend) + ) + #f + (when *traffic-manager* + (let ((v1-10 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-10 sphere quad) (-> self root trans quad)) + (set! (-> v1-10 sphere r) (the-as float (* (the int (-> self blast-radius)) 2))) + (set! (-> v1-10 velocity quad) (-> self root transv quad)) + (set! (-> v1-10 notify-radius) 122880.0) + (set! (-> v1-10 danger-level) 2.0) + (set! (-> v1-10 decay-rate) 0.0) + (set! (-> v1-10 flags) (the-as uint 1)) + (set! (-> v1-10 danger-type) (the-as uint 6)) + (set! (-> v1-10 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere v1-10) + ) + ) + ) + ) + +(deftype vehicle-grenade-deflect (vehicle-grenade) + ((has-been-deflected symbol) + (has-hit-ground symbol) + ) + ) + + +;; WARN: Return type mismatch symbol vs none. +(defmethod init-proj-settings! ((this vehicle-grenade-deflect)) + (set! (-> this has-been-deflected) #f) + (let ((t9-0 (method-of-type vehicle-grenade init-proj-settings!))) + (t9-0 this) + ) + (set! (-> this has-hit-ground) #f) + (none) + ) + +(defstate moving (vehicle-grenade-deflect) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type vehicle-grenade moving) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type vehicle-grenade moving) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type vehicle-grenade moving) trans))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (let ((t9-0 (-> (method-of-type vehicle-grenade moving) code))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + :post (behavior () + (when (logtest? (-> self root status) (collide-status on-ground)) + (set! (-> self has-hit-ground) #t) + (if (= (-> self charge-level) 0.0) + (go-virtual impact) + ) + ) + (let ((t9-1 (-> (method-of-type vehicle-grenade moving) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +(defmethod proj-event-handler ((this vehicle-grenade-deflect) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (format #t "attack") + (when (and (!= (-> this owner-handle) arg0) + (not (-> this has-been-deflected)) + (logtest? (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3) (penetrate spin)) + (-> this next-state) + (let ((v1-7 (-> this next-state name))) + (or (= v1-7 'moving) (= v1-7 'sitting)) + ) + ) + (let* ((s4-1 (new 'stack-no-clear 'vector)) + (s3-0 (handle->process (-> this owner-handle))) + (s4-2 (vector-! + s4-1 + (get-trans + (the-as process-focusable (if (type? s3-0 process-focusable) + (the-as process-focusable s3-0) + ) + ) + 0 + ) + (-> this root trans) + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (the-as uint128 0)) + (set! (-> s4-2 y) 0.0) + (let ((f28-0 1274.3112) + (f30-0 245760.0) + ) + (vector-normalize! s4-2 1.0) + (when (-> this has-hit-ground) + (set! f28-0 3276.8) + (set! f30-0 204800.0) + ) + (let* ((s2-0 arg0) + (a0-16 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + 0.0 + (let ((f26-0 -0.3) + (v1-22 a0-16) + ) + (when (= (-> a0-16 type) target) + (if (-> this has-hit-ground) + (set! f26-0 0.7) + ) + (set! (-> s3-1 quad) (-> (the-as target v1-22) control to-target-pt-xz quad)) + (vector-normalize! s3-1 1.0) + (set! (-> s3-1 y) 0.0) + (if (< (vector-dot s3-1 s4-2) f26-0) + (set! (-> s4-2 quad) (-> s3-1 quad)) + ) + ) + ) + ) + (set! (-> s4-2 y) (tan f28-0)) + (vector-normalize! s4-2 1.0) + (let ((v1-29 (-> s4-2 quad))) + (set! (-> this root transv quad) v1-29) + ) + (vector-normalize! (-> this root transv) f30-0) + ) + ) + (set! (-> this has-been-deflected) #t) + (set! (-> this owner-handle) (process->handle arg0)) + (set! (-> this ignore-handle) (-> this owner-handle)) + (if (and (-> this next-state) (= (-> this next-state name) 'sitting)) + (go (method-of-object this moving)) + ) + ) + ) + (('touched 'touch) + (if (or (not (-> this has-been-deflected)) (!= (process->handle arg0) (-> this owner-handle))) + ((method-of-type projectile proj-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + (else + ((method-of-type projectile proj-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(set! (-> *lightning-spec-id-table* 19) (new 'static 'lightning-spec + :name "lightning-trail-crimson-guard" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(set! (-> *lightning-spec-id-table* 20) (new 'static 'lightning-spec + :name "lightning-fractal-crimson-guard" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(defpart 1163 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 1164 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup part-crimson-lightning-glow + :id 254 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1164 :fade-after (meters 100) :flags (sp6)) (sp-item 1163 :fade-after (meters 100) :flags (sp6))) + ) + +(deftype guard-lazer-shot (projectile) + () + ) + + +(defstate dissipate (guard-lazer-shot) + :virtual #t + :enter (behavior () + (go-virtual impact) + ) + ) + +(defmethod made-impact? ((this guard-lazer-shot)) + (let ((gp-0 (-> this root)) + (s5-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((v1-0 s5-0)) + (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) + (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> v1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-0 action-mask) (collide-action solid)) + ) + (let ((a0-2 (the-as process-focusable (handle->process (-> this notify-handle))))) + (when a0-2 + (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans a0-2 3))) + (f0-2 (- (vector-length s4-1))) + ) + (fill-and-try-snap-to-surface gp-0 s4-1 f0-2 0.0 -3072.0 s5-0) + ) + ) + ) + ) + ) + +(defun guard-lazer-shot-move ((arg0 guard-lazer-shot)) + (projectile-move-fill-line-sphere arg0) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + 0 + (none) + ) + +(defmethod setup-collision! ((this guard-lazer-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum 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 enemy-yellow-shot)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 1228.8) + (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! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this guard-lazer-shot)) + (set! (-> this attack-mode) 'shock) + (set! (-> this max-speed) 131072.0) + (set! (-> this timeout) (seconds 0.125)) + (set! (-> this move) guard-lazer-shot-move) + (set! (-> this damage) 3.0) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) + (set! (-> this vehicle-damage-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + 0 + (none) + ) + +(defmethod deal-damage! ((this guard-lazer-shot) (arg0 process) (arg1 event-message-block)) + (if (logtest? (process-mask kg-robot) (-> arg0 mask)) + (set! (-> this damage) 5.0) + ) + (call-parent-method this arg0 arg1) + ) diff --git a/goal_src/jak3/levels/city/common/ctywide-init.gc b/goal_src/jak3/levels/city/common/ctywide-init.gc index 5d21a2f8c1..b1f7cffe47 100644 --- a/goal_src/jak3/levels/city/common/ctywide-init.gc +++ b/goal_src/jak3/levels/city/common/ctywide-init.gc @@ -5,5 +5,212 @@ ;; name in dgo: ctywide-init ;; dgos: CWI +(define-extern restore-city-speeches (function none)) + ;; DECOMP BEGINS +(defun update-level-info ((arg0 level)) + (let ((v1-0 *traffic-info*)) + (dotimes (a0-1 44) + (let ((a1-1 (-> v1-0 traffic-object-type-from-vehicle-type a0-1))) + (if (< (the-as uint a1-1) (the-as uint 29)) + (set! (-> v1-0 traffic-object-levels a1-1) (-> v1-0 vehicle-levels a0-1)) + ) + ) + ) + (let ((a0-4 *traffic-engine*)) + (when a0-4 + (dotimes (a1-5 29) + (set! (-> a0-4 object-type-info-array a1-5 level) (-> v1-0 traffic-object-levels a1-5)) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype dummy-alloc (structure) + ((val uint32) + ) + ) + + +(defun ctywide-login ((arg0 level)) + (format 0 "citywide-login~%") + (malloc 'loading-level #x1b800) + (set! *traffic-engine* (new 'loading-level 'traffic-engine)) + (set! *ff-squad-control* (new 'loading-level 'ff-squad-control)) + (set! *kg-squad-control* (new 'loading-level 'kg-squad-control)) + (set! *mh-squad-control* (new 'loading-level 'mh-squad-control)) + (set! *city-borrow-manager* (new 'loading-level 'cty-borrow-manager)) + (set! *cty-faction-manager* (new 'loading-level 'cty-faction-manager)) + (initialize-cty-attack-controller) + (let ((t9-9 cty-attack-reset) + (a0-9 #f) + (a1-8 #f) + ) + (t9-9 a0-9 a1-8 #f) + (init! *city-borrow-manager*) + (initialize *ff-squad-control* (the-as process a1-8)) + (initialize *kg-squad-control* (the-as process a1-8)) + (initialize *mh-squad-control* (the-as process a1-8)) + ) + (clear-borrow-holds! *city-borrow-manager*) + (set! *city-mode* 'ctywide) + 0 + (none) + ) + +(defun ctywide-activate ((arg0 level) (arg1 symbol)) + (cty-attack-reset #f #f #f) + (format 0 "ctywide-activate (mode ~s, *spawn-actors* ~s)~%" arg1 (if *spawn-actors* + "#t" + "#f" + ) + ) + (let ((v1-1 *traffic-info*)) + (when v1-1 + (set! (-> v1-1 ctywide-level) arg0) + (set! (-> v1-1 vehicle-level) arg0) + (set! (-> v1-1 restore-speech-callback) restore-city-speeches) + ) + ) + (vehicle-manager-kill) + (set! *traffic-fast-spawn* (or (= arg1 'life) (= arg1 'debug))) + (cond + ((and (= arg1 'debug) (not *spawn-actors*)) + (traffic-kill) + ) + (else + (restore-defaults *cty-faction-manager*) + (traffic-start) + (clear-borrow-holds! *city-borrow-manager*) + (add-squad-to-traffic-engine *ff-squad-control* *traffic-engine*) + (squad-control-method-10 *ff-squad-control*) + (add-squad-to-traffic-engine *kg-squad-control* *traffic-engine*) + (squad-control-method-10 *kg-squad-control*) + (add-squad-to-traffic-engine *mh-squad-control* *traffic-engine*) + (squad-control-method-10 *mh-squad-control*) + (restore-default-settings *traffic-engine*) + ) + ) + (let ((v1-27 *traffic-info*)) + (if (not (-> v1-27 vehicle-levels 6)) + (set! (-> v1-27 vehicle-levels 6) 'ctywide) + ) + ) + (when *traffic-engine* + (let ((v1-31 (-> *traffic-engine* object-type-info-array 28))) + (logior! (-> v1-31 flags) (traffic-type-flag ttf3)) + ) + ) + 0 + (none) + ) + +(defun ctywide-deactivate ((arg0 level)) + (format 0 "ctywide-deactivate~%") + (set! (-> *traffic-info* ctywide-level) #f) + (persist-with-delay *setting-control* 'cty-faction-music 0 'music 'city1 0.0 0) + 0 + (none) + ) + +(defun ctywide-logout ((arg0 level)) + (set! *traffic-engine* #f) + (set! *ff-squad-control* #f) + (set! *kg-squad-control* #f) + (set! *mh-squad-control* #f) + (clear-callback! *city-borrow-manager*) + (set! *city-borrow-manager* #f) + (set! *cty-faction-manager* #f) + (set! *trail-graph* #f) + (set! *city-mode* #f) + (set! *cty-attack-controller* #f) + (let ((v1-2 *traffic-info*)) + (set! (-> v1-2 vehicle-levels 6) #f) + (set! (-> v1-2 restore-speech-callback) #f) + ) + (when *traffic-engine* + (let ((v1-7 (-> *traffic-engine* object-type-info-array 28))) + (logclear! (-> v1-7 flags) (traffic-type-flag ttf3)) + ) + ) + 0 + (none) + ) + +(define *traffic-alert-level-force* #f) + +(defun lwide-activate ((arg0 level) (arg1 symbol)) + (format #t "lwide-activate ~s~%" arg0) + (let ((v1-0 *traffic-info*) + (a0-2 (-> arg0 name)) + ) + (set! (-> v1-0 restore-speech-callback) restore-city-speeches) + (case (-> arg0 name) + (('ctycara) + (set! (-> v1-0 vehicle-levels 3) a0-2) + (set! (-> v1-0 vehicle-levels 4) a0-2) + (set! (-> v1-0 vehicle-levels 5) a0-2) + ) + (('ctycarb) + (set! (-> v1-0 vehicle-levels 0) a0-2) + (set! (-> v1-0 vehicle-levels 1) a0-2) + (set! (-> v1-0 vehicle-levels 2) a0-2) + ) + (('ctypepa) + (set! (-> v1-0 traffic-object-levels 0) a0-2) + (set! (-> v1-0 traffic-object-levels 1) a0-2) + (set! (-> v1-0 traffic-object-levels 2) a0-2) + (set! (-> v1-0 traffic-object-levels 3) a0-2) + ) + (('ctypesb) + (set! (-> v1-0 traffic-object-levels 8) a0-2) + (set! (-> v1-0 traffic-object-levels 9) a0-2) + ) + (('ctypepb) + (set! (-> v1-0 traffic-object-levels 10) a0-2) + ) + (('ctypesa) + (set! (-> v1-0 traffic-object-levels 4) a0-2) + (set! (-> v1-0 traffic-object-levels 6) a0-2) + (set! (-> v1-0 traffic-object-levels 13) a0-2) + ) + (('ctypesc) + (set! (-> v1-0 traffic-object-levels 14) a0-2) + (set! (-> v1-0 traffic-object-levels 15) a0-2) + (set! (-> v1-0 traffic-object-levels 16) a0-2) + ) + (('lctyhijk) + (set! (-> v1-0 vehicle-levels 11) a0-2) + ) + ) + (update-level-info (the-as level a0-2)) + ) + 0 + (none) + ) + +(defun lwide-deactivate ((arg0 level)) + (let ((v1-0 *traffic-info*)) + (dotimes (a1-0 44) + (if (= (-> v1-0 vehicle-levels a1-0) (-> arg0 name)) + (set! (-> v1-0 vehicle-levels a1-0) #f) + ) + ) + (dotimes (a1-3 29) + (if (= (-> v1-0 traffic-object-levels a1-3) (-> arg0 name)) + (set! (-> v1-0 traffic-object-levels a1-3) #f) + ) + ) + ) + (let ((v1-3 *traffic-info*)) + (set! (-> v1-3 vehicle-level) #f) + (set! (-> v1-3 restore-speech-callback) #f) + ) + (update-level-info arg0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/common/ff-squad-control.gc b/goal_src/jak3/levels/city/common/ff-squad-control.gc index ee4f857e89..8d3d5873b4 100644 --- a/goal_src/jak3/levels/city/common/ff-squad-control.gc +++ b/goal_src/jak3/levels/city/common/ff-squad-control.gc @@ -5,5 +5,904 @@ ;; name in dgo: ff-squad-control ;; dgos: CWI +(deftype ff-squad-control-stack-var0 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (vec2 nav-find-poly-parms :inline :offset 32) + (cquery collide-query :inline :offset 80) + (vec5 vector :inline :offset 608) + (vec6 vector :inline :offset 624) + ) + ) + +(define-extern *traffic-alert-level-force* symbol) + ;; DECOMP BEGINS +(define *alert-level-settings* (new 'static 'squad-alert-state-settings + :ped-tazer (new 'static 'squad-unit-settings + :target-count 3 + :shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 2) + ) + :ped-rifle (new 'static 'squad-unit-settings + :target-count 3 + :shot-count 2 + :rand-shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 2) + ) + :ped-grenade (new 'static 'squad-unit-settings + :target-count 1 + :shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 2) + ) + :bike-turret (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 5) + ) + :hellcat-turret (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 5) + ) + ) + ) + +(define *ff-war-alert-state-settings* (new 'static 'squad-alert-state-settings + :ped-tazer (new 'static 'squad-unit-settings + :target-count 4 + :shot-count 1 + :inaccuracy 0.125 + :acquire-delay (seconds 0.5) + :shot-delay (seconds 0.25) + :burst-delay (seconds 2) + ) + :ped-rifle (new 'static 'squad-unit-settings + :target-count 7 + :shot-count 2 + :rand-shot-count 2 + :inaccuracy 0.125 + :acquire-delay (seconds 0.5) + :shot-delay (seconds 0.15) + :burst-delay (seconds 2) + ) + :ped-grenade (new 'static 'squad-unit-settings + :target-count 3 + :shot-count 1 + :inaccuracy 0.125 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 3) + ) + :bike-turret (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 2 + :inaccuracy 0.125 + :acquire-delay (seconds 0.5) + :shot-delay (seconds 0.25) + :burst-delay (seconds 3) + ) + :hellcat-turret (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 2 + :inaccuracy 0.125 + :acquire-delay (seconds 0.5) + :shot-delay (seconds 0.25) + :burst-delay (seconds 3) + ) + ) + ) + +(define *ff-guard-type-mask* 63) + +(defmethod squad-control-method-10 ((this ff-squad-control)) + (call-parent-method this) + (dotimes (v1-0 3) + (set! (-> this guard-type-info-array 0 data v1-0 object-type) (traffic-type guard-a)) + (set! (-> this guard-type-info-array 1 data v1-0 object-type) (traffic-type guard-a)) + (set! (-> this guard-type-info-array 2 data v1-0 object-type) (traffic-type guard-a)) + (set! (-> this guard-type-info-array 3 data v1-0 object-type) (traffic-type wlander-male)) + (set! (-> this guard-type-info-array 4 data v1-0 object-type) (traffic-type guard-bike)) + (set! (-> this guard-type-info-array 5 data v1-0 object-type) (traffic-type guard-car)) + ) + (dotimes (v1-3 29) + (set! (-> this guard-type-mask-from-object-type v1-3) (the-as uint 0)) + ) + (dotimes (v1-6 10) + (when (logtest? *ff-guard-type-mask* (ash 1 v1-6)) + (let ((a0-17 (-> this guard-type-info-array v1-6 guard-info-normal object-type))) + (set! (-> this guard-type-mask-from-object-type a0-17) + (the-as uint (logior (ash 1 v1-6) (-> this guard-type-mask-from-object-type a0-17))) + ) + ) + ) + ) + (init-alert this) + (none) + ) + +(defmethod init-alert ((this ff-squad-control)) + (let ((t9-0 (-> *traffic-info* restore-speech-callback))) + (if t9-0 + (t9-0) + ) + ) + (let ((t9-1 (method-of-type squad-control init-alert))) + (t9-1 this) + ) + (dotimes (v1-4 3) + (dotimes (a0-2 10) + (when (logtest? *ff-guard-type-mask* (ash 1 a0-2)) + (let ((a1-6 (the-as traffic-guard-type-array (+ (+ (* v1-4 16) 1780 (* 48 a0-2)) (the-as int this))))) + (set! (-> a1-6 guard-info-normal min-target-count) 0) + (set! (-> a1-6 guard-info-normal max-target-count) 127) + ) + ) + ) + ) + (set-guard-target-level this 1.0) + 0 + (none) + ) + +(defmethod ff-squad-control-method-56 ((this ff-squad-control) (arg0 int) (arg1 int) (arg2 int)) + (let ((v1-3 (-> this guard-type-info-array (the-as uint arg0)))) + (set! (-> v1-3 guard-info-normal min-target-count) (max 0 (min 127 arg1))) + (set! (-> v1-3 guard-info-normal max-target-count) (max 0 (min 127 arg2))) + ) + 0 + (none) + ) + +(defmethod squad-control-method-16 ((this ff-squad-control) (arg0 vector) (arg1 process-focusable) (arg2 squad-target-status)) + (local-vars (sv-176 (array crimson-guard)) (sv-180 (array float)) (sv-184 int)) + (let ((t9-0 (method-of-type squad-control squad-control-method-16))) + (t9-0 this arg0 arg1 arg2) + ) + (let ((s4-0 (get-idx-in-status-arr this (-> arg2 handle)))) + (set! sv-176 (the-as (array crimson-guard) (new 'stack 'boxed-array crimson-guard 16))) + (set! sv-180 (the-as (array float) (new 'stack 'boxed-array float 16))) + (set! sv-184 0) + (dotimes (s3-0 (the-as int (-> this traffic tracker1 active-object-count))) + (case (-> this traffic tracker1 active-object-type-list s3-0) + (((traffic-type guard-a)) + (let ((s2-0 (the-as crimson-guard (handle->process (-> this traffic tracker1 active-object-list s3-0))))) + (when (and s2-0 (not (focus-test? s2-0 dead inactive)) (= (-> s2-0 target-status handle) (-> arg2 handle))) + (set! (-> sv-176 sv-184) s2-0) + (set! (-> sv-180 sv-184) (vector-vector-distance (-> s2-0 root trans) (-> arg2 position))) + (set! sv-184 (+ sv-184 1)) + (set! (-> s2-0 move-index) -1) + ) + ) + ) + ) + ) + (let ((a0-14 #t)) + (while a0-14 + (set! a0-14 #f) + (dotimes (v1-32 (+ sv-184 -1)) + (when (< (-> sv-180 (+ v1-32 1)) (-> sv-180 v1-32)) + (let ((a0-17 (-> sv-176 v1-32)) + (f0-2 (-> sv-180 v1-32)) + ) + (set! (-> sv-176 v1-32) (-> sv-176 (+ v1-32 1))) + (set! (-> sv-176 (+ v1-32 1)) a0-17) + (set! (-> sv-180 v1-32) (-> sv-180 (+ v1-32 1))) + (set! (-> sv-180 (+ v1-32 1)) f0-2) + ) + (set! a0-14 #t) + ) + ) + ) + ) + (cond + ((< s4-0 0) + ) + (else + (let ((s3-1 (new 'stack-no-clear 'array 'float 16))) + (dotimes (v1-37 16) + (set! (-> s3-1 v1-37) 0.0) + ) + (dotimes (s2-1 sv-184) + (crimson-guard-method-282 (-> sv-176 s2-1) (-> arg2 position) (-> this target-formation-array s4-0) s3-1 16) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod squad-control-city-method-35 ((this ff-squad-control) (arg0 citizen) (arg1 handle)) + (cond + ((type? arg0 citizen) + (let ((a0-2 arg0)) + (cond + ((!= (-> a0-2 faction-mode) 1) + (if (zero? (-> this alert-state level)) + (the-as process-focusable #f) + (get-focus-in-range this arg0) + ) + ) + (else + (call-parent-method this arg0 arg1) + ) + ) + ) + ) + (else + (ff-squad-control-method-51 + this + arg0 + (collide-spec jak enemy hit-by-others-list player-list bot-targetable jak-vehicle) + ) + ) + ) + ) + +;; WARN: Return type mismatch process-drawable vs process-focusable. +(defmethod ff-squad-control-method-51 ((this ff-squad-control) (arg0 process-focusable) (arg1 collide-spec)) + (let ((gp-0 (the-as process-drawable #f))) + (let ((f30-0 (the-as float #x7f800000))) + (when (logtest? arg1 (collide-spec player-list)) + (let ((v1-4 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((s3-0 (-> v1-4 next0))) + (while (!= v1-4 (-> *collide-player-list* alive-list-end)) + (let ((v1-5 (the-as collide-shape (-> (the-as connection v1-4) param1)))) + (when (logtest? arg1 (-> v1-5 root-prim prim-core collide-as)) + (let* ((s1-0 (-> v1-5 process)) + (s2-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when (and s2-0 (not (focus-test? (the-as process-focusable s2-0) disable dead inactive)) (!= arg0 s2-0)) + (let ((f0-0 (vector-vector-xz-distance (-> arg0 root trans) (-> (the-as process-focusable s2-0) root trans)))) + (when (or (not gp-0) (< f0-0 f30-0)) + (set! gp-0 s2-0) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + (set! v1-4 s3-0) + *collide-player-list* + (set! s3-0 (-> (the-as connection s3-0) next0)) + ) + ) + ) + ) + (when (logtest? arg1 (collide-spec hit-by-player-list hit-by-others-list)) + (when (logtest? arg1 (collide-spec hit-by-player-list)) + (let ((v1-22 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((s3-1 (-> v1-22 next0))) + (while (!= v1-22 (-> *collide-hit-by-player-list* alive-list-end)) + (let ((v1-23 (the-as collide-shape (-> (the-as connection v1-22) param1)))) + (when (logtest? arg1 (-> v1-23 root-prim prim-core collide-as)) + (let* ((s1-1 (-> v1-23 process)) + (s2-1 (if (type? s1-1 process-focusable) + s1-1 + ) + ) + ) + (when (and s2-1 (not (focus-test? (the-as process-focusable s2-1) disable dead inactive)) (!= arg0 s2-1)) + (let ((f0-1 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-1 root trans)))) + (when (or (not gp-0) (< f0-1 f30-0)) + (set! gp-0 s2-1) + (set! f30-0 f0-1) + ) + ) + ) + ) + ) + ) + (set! v1-22 s3-1) + *collide-hit-by-player-list* + (set! s3-1 (-> s3-1 next0)) + ) + ) + ) + ) + (when (logtest? arg1 (collide-spec hit-by-others-list)) + (let ((v1-38 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((s3-2 (-> v1-38 next0))) + (while (!= v1-38 (-> *collide-hit-by-others-list* alive-list-end)) + (let ((v1-39 (the-as collide-shape (-> (the-as connection v1-38) param1)))) + (when (logtest? arg1 (-> v1-39 root-prim prim-core collide-as)) + (let* ((s1-2 (-> v1-39 process)) + (s2-2 (if (type? s1-2 process-focusable) + s1-2 + ) + ) + ) + (when (and s2-2 (not (focus-test? (the-as process-focusable s2-2) disable dead inactive)) (!= arg0 s2-2)) + (let ((f0-2 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-2 root trans)))) + (when (or (not gp-0) (< f0-2 f30-0)) + (set! gp-0 s2-2) + (set! f30-0 f0-2) + ) + ) + ) + ) + ) + ) + (set! v1-38 s3-2) + *collide-hit-by-others-list* + (set! s3-2 (-> s3-2 next0)) + ) + ) + ) + ) + ) + ) + (the-as process-focusable gp-0) + ) + ) + +(defmethod ff-squad-control-method-48 ((this ff-squad-control)) + (let ((v0-0 0)) + (dotimes (v1-0 10) + (if (logtest? *ff-guard-type-mask* (ash 1 v1-0)) + (+! v0-0 (-> this guard-type-info-array v1-0 guard-info-normal count)) + ) + ) + ) + (none) + ) + +(defmethod get-focus ((this ff-squad-control)) + (get-target-focus this) + ) + +(defmethod set-guard-target-level ((this ff-squad-control) (arg0 float)) + (set! (-> this alert-state guard-target-level) arg0) + 0 + (none) + ) + +(defmethod get-unit-settings-by-idx ((this ff-squad-control) (arg0 int)) + (-> this settings guard-settings-array arg0) + ) + +;; WARN: Return type mismatch uint vs none. +(defmethod ff-squad-control-method-54 ((this ff-squad-control) (arg0 int)) + (-> this traffic object-type-info-array arg0 guard-type) + (none) + ) + +(defmethod ff-squad-control-method-55 ((this ff-squad-control) (arg0 int) (arg1 int)) + (-> (the-as ff-squad-control (+ (the-as uint this) (* (the-as uint 48) (the-as uint arg0)) (* arg1 16))) + guard-type-info-array + 0 + guard-info-normal + change-to-type + ) + ) + +(defmethod ff-squad-control-method-46 ((this ff-squad-control)) + (local-vars (a0-62 int) (s0-2 int) (sv-96 traffic-target-formation) (sv-100 squad-target-status)) + (dotimes (v1-0 3) + (dotimes (a0-1 10) + (when (logtest? *ff-guard-type-mask* (ash 1 a0-1)) + (set! (-> (the-as ff-squad-control (+ (the-as uint this) (* 48 a0-1) (* v1-0 16))) + guard-type-info-array + 0 + guard-info-normal + count + ) + 0 + ) + 0 + ) + ) + ) + (let* ((f0-0 122880.0) + (f0-2 (* f0-0 f0-0)) + (a0-4 (the-as vehicle #f)) + (v1-5 0) + ) + (let ((a1-8 0)) + (dotimes (a2-3 (the-as int (-> this traffic tracker0 active-object-count))) + (case (-> this traffic tracker0 active-object-type-list a2-3) + (((traffic-type guard-bike) (traffic-type guard-car)) + (let ((a3-8 (the-as vehicle (handle->process (-> this traffic tracker0 active-object-list a2-3))))) + (when (and a3-8 (not (focus-test? a3-8 dead inactive)) (logtest? (vehicle-flag alert) (-> a3-8 v-flags))) + (let ((t0-14 (-> a3-8 info guard-type))) + (+! (-> this guard-type-info-array t0-14 guard-info-normal count) 1) + ) + (when (and (logtest? (vehicle-flag in-pursuit) (-> a3-8 v-flags)) + (logtest? (vehicle-flag target-in-sight) (-> a3-8 v-flags)) + ) + (+! a1-8 1) + (when (not (logtest? (-> a3-8 draw status) (draw-control-status on-screen))) + (+! v1-5 1) + (let ((f1-0 (-> a3-8 target-distance2))) + (when (< f0-2 f1-0) + (set! f0-2 f1-0) + (set! a0-4 a3-8) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> this alert-state guards-in-sight-of-target) a1-8) + ) + (when (< 2 v1-5) + (if (not (logtest? (-> this alert-state flags) (squad-alert-flag disable-pursuit-control))) + (send-event a0-4 'end-pursuit) + ) + ) + ) + (let ((f30-0 122880.0) + (s5-0 (the-as crimson-guard #f)) + (s4-0 0) + ) + (let ((s3-0 0)) + (let ((s2-0 0)) + (dotimes (s1-0 (the-as int (-> this traffic tracker1 active-object-count))) + (case (-> this traffic tracker1 active-object-type-list s1-0) + (((traffic-type guard-a)) + (let ((s0-0 (the-as crimson-guard (handle->process (-> this traffic tracker1 active-object-list s1-0))))) + (when (and s0-0 (not (logtest? (-> s0-0 focus-status) (focus-status dead inactive)))) + (when (and (logtest? (-> s0-0 flags) (citizen-flag in-pursuit)) + (logtest? (-> s0-0 flags) (citizen-flag target-in-sight)) + (= (-> s0-0 faction-mode) 0) + ) + (+! s3-0 1) + (when (not (logtest? (-> s0-0 draw status) (draw-control-status on-screen))) + (+! s4-0 1) + (let ((f0-3 (-> s0-0 target-self-dist))) + (when (< f30-0 f0-3) + (set! f30-0 f0-3) + (set! s5-0 s0-0) + ) + (if (and (< 327680.0 f0-3) + (not (logtest? (-> this alert-state flags) (squad-alert-flag disable-pursuit-control))) + ) + (send-event s0-0 'end-pursuit) + ) + ) + ) + ) + (let ((v1-45 (-> s0-0 guard-type))) + (when (< (the-as uint v1-45) (the-as uint 10)) + (+! s2-0 1) + (+! (-> (the-as + ff-squad-control + (+ (the-as uint this) (* (the-as uint 48) (the-as uint v1-45)) (* (-> s0-0 faction-mode) 16)) + ) + guard-type-info-array + 0 + guard-info-normal + count + ) + 1 + ) + ) + ) + ) + ) + ) + ) + ) + ) + (+! (-> this alert-state guards-in-sight-of-target) s3-0) + ) + (when (< 2 s4-0) + (if (not (logtest? (-> this alert-state flags) (squad-alert-flag disable-pursuit-control))) + (send-event s5-0 'end-pursuit) + ) + ) + ) + (dotimes (v1-63 3) + (let ((a0-27 -1) + (a1-19 -1) + ) + (let ((a2-7 0) + (a3-12 9) + ) + (dotimes (t0-29 10) + (when (logtest? *ff-guard-type-mask* (ash 1 t0-29)) + (when (= (-> (the-as ff-squad-control (+ (the-as uint this) (* 48 t0-29) (* v1-63 16))) + guard-type-info-array + 0 + guard-info-normal + object-type + ) + (traffic-type guard-a) + ) + (let ((t2-13 (the-as traffic-guard-type-array (+ (+ (* v1-63 16) 1780 (* 48 t0-29)) (the-as int this))))) + (set! (-> t2-13 guard-info-normal change-to-type) (the-as traffic-type t0-29)) + (let ((t1-22 (- (-> t2-13 guard-info-normal target-count) (-> t2-13 guard-info-normal count)))) + (when (< a2-7 t1-22) + (set! a0-27 t0-29) + (set! a2-7 t1-22) + ) + (when (and (< t1-22 a3-12) (> (-> t2-13 guard-info-normal count) 0)) + (set! a1-19 t0-29) + (set! a3-12 t1-22) + ) + ) + ) + ) + ) + ) + ) + (when (and (!= a0-27 -1) (!= a1-19 -1)) + (set! (-> (the-as ff-squad-control (+ (the-as uint this) (* 48 a1-19) (* v1-63 16))) + guard-type-info-array + 0 + guard-info-normal + change-to-type + ) + (the-as traffic-type a0-27) + ) + (set! (-> this traffic object-type-info-array 6 guard-type) (the-as uint a0-27)) + ) + ) + ) + (dotimes (s5-1 3) + (set! sv-96 (-> this target-formation-array s5-1)) + (set! sv-100 (-> this alert-state target-status-array s5-1)) + (when (and (logtest? (-> sv-100 flags) (squad-target-flag visible-ever updated)) + (< (+ (current-time) (seconds -5)) (-> sv-100 last-seen-time)) + (handle->process (-> sv-100 handle)) + ) + (let ((s4-1 (new 'stack-no-clear 'ff-squad-control-stack-var0))) + (set! (-> s4-1 vec0 quad) (-> sv-100 position quad)) + (let ((s3-1 (find-nearest-nav-mesh (-> s4-1 vec0) (the-as float #x7f800000)))) + (when s3-1 + (set! (-> s4-1 vec2 y-threshold) 40960.0) + (set! (-> s4-1 vec2 ignore) (the-as uint 2)) + (vector-! (the-as vector (-> s4-1 vec2)) (-> s4-1 vec0) (the-as vector (-> s3-1 bounds))) + (nav-mesh-method-46 s3-1 (the-as nav-poly (-> s4-1 vec2))) + (let ((s2-1 (-> s4-1 vec2 poly))) + (when s2-1 + (project-point-into-poly-2d s3-1 s2-1 (the-as vector (-> s4-1 vec2)) (the-as vector (-> s4-1 vec2))) + (vector+! (-> s4-1 vec0) (the-as vector (-> s4-1 vec2)) (the-as vector (-> s3-1 bounds))) + (dotimes (s1-1 16) + (when (= (-> this traffic sync-mask-8) (ash 1 (logand s1-1 7))) + (set! (-> s4-1 vec5 w) (* 182.04445 (* 22.5 (the float s1-1)))) + (set! (-> s4-1 vec6 x) 163840.0) + (vector-rotate-around-y! (-> s4-1 vec1) *x-vector* (-> s4-1 vec5 w)) + (vector-float*! (-> s4-1 vec1) (-> s4-1 vec1) (-> s4-1 vec6 x)) + (clamp-vector-to-mesh-cross-gaps + s3-1 + (the-as vector (-> s4-1 vec2)) + s2-1 + (-> s4-1 vec1) + (-> s4-1 vec6 x) + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (set! (-> s4-1 cquery start-pos quad) (-> sv-100 position quad)) + (set! (-> s4-1 cquery move-dist quad) (-> s4-1 vec1 quad)) + (let ((v1-107 (-> s4-1 cquery))) + (set! (-> v1-107 radius) 2048.0) + (set! (-> v1-107 collide-with) (collide-spec backgnd)) + (set! (-> v1-107 ignore-process0) #f) + (set! (-> v1-107 ignore-process1) #f) + (set! (-> v1-107 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-107 action-mask) (collide-action solid)) + ) + (set! (-> s4-1 vec6 y) (fill-and-probe-using-line-sphere *collide-cache* (-> s4-1 cquery))) + (cond + ((>= (-> s4-1 vec6 y) 0.0) + (let ((s0-1 0) + (v1-111 + (- (* (-> s4-1 vec6 x) (-> s4-1 vec6 y)) (vector-vector-distance (-> sv-100 position) (-> s4-1 vec0))) + ) + ) + (let ((a0-61 (the int v1-111))) + (set-on-less-than a0-62 s0-1 a0-61) + ) + (move-if-not-zero s0-2 v1-111 a0-62 s0-1) + ) + (set! (-> sv-96 circle-range s1-1) (the float s0-2)) + ) + (else + (set! (-> sv-96 circle-range s1-1) (-> s4-1 vec6 x)) + ) + ) + 0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod ff-squad-control-method-45 ((this ff-squad-control)) + (let ((s5-0 (get-target-focus this))) + (let ((a1-0 (-> this alert-state level))) + (mem-copy! + (the-as pointer (-> this settings)) + (the-as pointer (+ (the-as uint *alert-level-settings*) (* 320 (the-as int a1-0)))) + 320 + ) + ) + (mem-copy! (the-as pointer (-> this settings-war)) (the-as pointer *ff-war-alert-state-settings*) 320) + (dotimes (v1-2 3) + (dotimes (a0-4 10) + (when (logtest? *ff-guard-type-mask* (ash 1 a0-4)) + (let ((a2-7 (the-as squad-alert-state-settings (+ (+ (* a0-4 32) 820 (* 320 v1-2)) (the-as int this)))) + (a1-13 (the-as traffic-guard-type-array (+ (+ (* v1-2 16) 1780 (* 48 a0-4)) (the-as int this)))) + ) + (set! (-> a2-7 ped-tazer inaccuracy) + (fmax 0.0 (fmin 1.0 (* (-> a2-7 ped-tazer inaccuracy) (-> this alert-state guard-inaccuracy-factor)))) + ) + (when (and s5-0 (= (-> s5-0 type) target)) + (when (focus-test? *target* pilot) + (set! (-> a2-7 ped-tazer acquire-delay) + (the-as uint (the int (* 0.75 (the float (-> a2-7 ped-tazer acquire-delay))))) + ) + (set! (-> a2-7 ped-tazer shot-delay) + (the-as uint (the int (* 0.6 (the float (-> a2-7 ped-tazer shot-delay))))) + ) + (set! (-> a2-7 ped-tazer burst-delay) + (the-as uint (the int (* 0.8 (the float (-> a2-7 ped-tazer burst-delay))))) + ) + ) + ) + (set! (-> a1-13 guard-info-normal target-count) + (max + (min + (the int (* (the float (-> a2-7 ped-tazer target-count)) (-> this alert-state guard-target-level))) + (-> a1-13 guard-info-normal max-target-count) + ) + (-> a1-13 guard-info-normal min-target-count) + ) + ) + ) + ) + ) + ) + ) + (dotimes (v1-5 3) + (dotimes (a0-7 29) + (let ((a2-12 (-> this guard-type-mask-from-object-type a0-7))) + (when (nonzero? a2-12) + (let ((a3-20 0) + (a1-17 0) + ) + (while (nonzero? a2-12) + (if (logtest? a2-12 1) + (+! a1-17 (-> (the-as ff-squad-control (+ (the-as uint this) (* 48 a3-20) (* v1-5 16))) + guard-type-info-array + 0 + guard-info-normal + target-count + ) + ) + ) + (+! a3-20 1) + (set! a2-12 (shr a2-12 1)) + ) + (set! (-> this traffic object-type-info-array 0 target-counts (+ v1-5 (* a0-7 32))) a1-17) + ) + ) + ) + ) + ) + (let ((s5-1 #f)) + (when (not (logtest? (-> this alert-state flags) (squad-alert-flag war))) + (when *traffic-alert-level-force* + (set! (-> this alert-state level) (the-as uint 3)) + (logclear! (-> this alert-state flags) (squad-alert-flag alert-ending)) + (set-time! (-> this alert-state start-time)) + ) + (when (>= (-> this alert-state level) (the-as uint 1)) + (set! s5-1 #t) + (cond + ((logtest? (-> this alert-state flags) (squad-alert-flag alert-ending)) + (cond + ((> (the-as int (ff-squad-control-method-48 this)) 0) + (set-time! (-> this alert-state start-time)) + ) + (else + (when (time-elapsed? (-> this alert-state start-time) (seconds 3)) + (set! s5-1 #f) + (set! (-> this alert-state level) (the-as uint 0)) + (logclear! (-> this alert-state flags) (squad-alert-flag alert-ending)) + ) + ) + ) + ) + (else + (let ((s4-0 + (+ (- (-> this alert-state start-time) (current-time)) (the-as time-frame (-> this alert-state duration))) + ) + ) + (if (and (get-target-focus this) + (= (-> (get-target-focus this) type) target) + (-> *target* next-state) + (= (-> *target* next-state name) 'target-hide) + ) + (set! s4-0 (- s4-0 (the-as time-frame (* (- (current-time) (-> *target* state-time)) 2)))) + ) + (if (> s4-0 0) + 0 + (logior! (-> this alert-state flags) (squad-alert-flag alert-ending)) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (if (not (logtest? (-> this alert-state flags) (squad-alert-flag alarm-on))) + (logior! (-> this alert-state flags) (squad-alert-flag alarm-on)) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> (target-pos 0) quad)) + (if #t + (ff-squad-control-method-47 this) + ) + (let ((v1-65 0)) + (dotimes (a0-26 29) + (let ((a1-20 (-> this traffic object-type-info-array a0-26))) + (if #t + (+! v1-65 (-> a1-20 killed-count)) + ) + ) + ) + (if (and (>= v1-65 (the-as int (* (-> this alert-state level) 8))) + (< (-> this alert-state level) (-> this alert-state max-level)) + ) + (start-alert this (the-as int (+ (-> this alert-state level) 1))) + ) + ) + ) + (else + (when (logtest? (-> this alert-state flags) (squad-alert-flag alarm-on)) + (logclear! (-> this alert-state flags) (squad-alert-flag alarm-on)) + (ff-squad-control-method-47 this) + (let ((v1-79 (-> this alert-state target-status-array))) + (logclear! (-> v1-79 0 flags) (squad-target-flag visible-now visible-recently visible-ever)) + ) + (dotimes (v1-80 29) + (set! (-> this traffic object-type-info-array v1-80 killed-count) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod ff-squad-control-method-47 ((this ff-squad-control)) + (set-time! (-> this alert-state notify-time)) + (cond + ((> (-> this alert-state level) 0) + (if (and (not (logtest? (-> this alert-state flags) (squad-alert-flag alert-ending))) (get-target-focus this)) + (for-all-active-processes + (-> this traffic) + (lambda ((arg0 crimson-guard) (arg1 traffic-object-type-info)) + (when (logtest? (-> arg1 flags) (traffic-type-flag ttf0)) + (let ((a0-1 arg0)) + (if (!= (-> a0-1 faction-mode) 1) + (send-event arg0 'alert-begin (get-target-focus *ff-squad-control*)) + ) + ) + ) + (none) + ) + ) + ) + ) + (else + (for-all-active-processes + (-> this traffic) + (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) + (if (logtest? (-> arg1 flags) (traffic-type-flag ttf0)) + (send-event arg0 'alert-end) + ) + (none) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod end-pursuit-for-all ((this ff-squad-control) (arg0 int)) + (for-all-active-processes-of-type + (-> this traffic tracker-array (-> this traffic object-type-info-array arg0 tracker-index)) + (the-as traffic-type arg0) + (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) (send-event arg0 'end-pursuit) (none)) + ) + 0 + (none) + ) + +(defmethod set-pos-vel ((this ff-squad-control) (arg0 primary-target-pos-vel)) + (squad-control-method-25 this arg0 (seconds 0.45)) + arg0 + ) + +(defmethod update ((this ff-squad-control)) + (call-parent-method this) + (ff-squad-control-method-45 this) + (ff-squad-control-method-46 this) + (when *cty-faction-manager* + (let ((a2-0 (if (> (-> this alert-state level) 0) + (the-as int (+ (-> this alert-state level) 3)) + 3 + ) + ) + ) + (faction-spawn *cty-faction-manager* 2 a2-0 #f #f) + ) + ) + 0 + (none) + ) + +(defmethod squad-control-city-method-39 ((this ff-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (if (type? arg0 crimson-guard) + (crimson-guard-method-288 (the-as crimson-guard arg0) arg1) + ) + ) + +(defmethod squad-control-city-method-43 ((this ff-squad-control) (arg0 process-focusable)) + (if (type? arg0 crimson-guard) + (time-elapsed? (-> (the-as crimson-guard arg0) last-choose-new-enemy-time) (seconds 4)) + #t + ) + ) + +(defun set-ff-primary-target ((arg0 handle) (arg1 float)) + (when *ff-squad-control* + (let* ((s5-0 *ff-squad-control*) + (s4-0 (method-of-object s5-0 squad-control-method-27)) + (s3-0 (handle->process arg0)) + ) + (s4-0 + s5-0 + (if (type? s3-0 process-focusable) + s3-0 + ) + arg1 + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/common/guard-grenade.gc b/goal_src/jak3/levels/city/common/guard-grenade.gc index 9fdfddfcd0..6234f27fef 100644 --- a/goal_src/jak3/levels/city/common/guard-grenade.gc +++ b/goal_src/jak3/levels/city/common/guard-grenade.gc @@ -7,3 +7,519 @@ ;; DECOMP BEGINS +(defmethod crimson-guard-method-264 ((this crimson-guard)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14)))) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'traj3d-params)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0)) + (f30-0 1.0) + ) + (set! (-> s3-1 y) 0.0) + (vector-rotate-around-y! s3-1 s3-1 (* 182.04445 (+ (if (zero? (rand-vu-int-count 2)) + 90.0 + -90.0 + ) + (rand-vu-float-range -45.0 45.0) + ) + ) + ) + (set! f30-0 + (cond + ((!= (-> (handle->process (-> this focus handle)) type) target) + (set! (-> s3-1 quad) (the-as uint128 0)) + (set! (-> s5-0 dest quad) + (-> (get-trans (the-as process-focusable (handle->process (-> this focus handle))) 3) quad) + ) + 0.0 + ) + (else + (if (logtest? (-> this draw status) (draw-control-status on-screen)) + (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 2.0))) + (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 3.0))) + ) + (set! (-> s5-0 dest quad) + (-> (vector+! (new 'stack-no-clear 'vector) s3-1 (-> this target-pos-predict-miss)) quad) + ) + f30-0 + ) + ) + ) + (set! (-> s5-0 src quad) (-> s4-0 quad)) + (set! (-> s5-0 initial-tilt) 8192.0) + (set! (-> s5-0 gravity) 184320.0) + (when (traj3d-calc-initial-velocity-using-tilt s5-0) + (let ((a1-14 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> a1-14 ent) (-> this entity)) + (set! (-> a1-14 charge) f30-0) + (set! (-> a1-14 options) (projectile-options)) + (logclear! (-> a1-14 options) (projectile-options po14 po15 po16)) + (set! (-> a1-14 pos quad) (-> s5-0 src quad)) + (set! (-> a1-14 vel quad) (-> s5-0 initial-velocity quad)) + (set! (-> a1-14 notify-handle) (the-as handle #f)) + (set! (-> a1-14 owner-handle) (process->handle this)) + (set! (-> a1-14 target-handle) (the-as handle #f)) + (set! (-> a1-14 target-pos quad) (the-as uint128 0)) + (set! (-> a1-14 ignore-handle) (process->handle this)) + (let* ((v1-38 *game-info*) + (a0-37 (+ (-> v1-38 attack-id) 1)) + ) + (set! (-> v1-38 attack-id) a0-37) + (set! (-> a1-14 attack-id) a0-37) + ) + (set! (-> a1-14 timeout) (seconds 4)) + (spawn-projectile vehicle-grenade-deflect a1-14 this *default-dead-pool*) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate grenade-throw-post-retreating (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (set-time! (-> self state-time)) + (nav-enemy-method-177 self) + (flee-info-method-12 (-> self flee-behavior) self) + (set-time! (-> self last-check-player-time)) + (go-active-if-necessary) + (set! (-> self danger-pos quad) (-> self focus-pos quad)) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (go-active-if-necessary) + (+! (-> self total-flee-time) + (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)) + ) + (when (time-elapsed? (-> self last-check-player-time) (seconds 0.5)) + (set-time! (-> self last-check-player-time)) + (set! (-> self danger-pos quad) (-> self focus-pos quad)) + ) + (flee-info-method-11 (-> self flee-behavior) self) + (cond + ((< (seconds 2) (-> self total-flee-time)) + (set! (-> self urgent-fire) #t) + (go-hostile self) + ) + ((>= (-> self target-self-xz-dist) (* 1.2 (-> self grenade-guard-min-player-dist))) + (go-virtual grenade-throw-post-reloading) + ) + ((< (-> self target-self-xz-dist) 16384.0) + (go-virtual close-attack) + ) + ) + ) + :code (behavior () + (loop + (let ((a2-0 (new 'stack-no-clear 'vector))) + (let ((a1-0 (-> self nav state))) + (set! (-> a2-0 quad) (-> a1-0 target-pos quad)) + ) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 2) *color-red*) + ) + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 60) + ) + ) + :post (behavior () + (flee-info-method-13 (-> self flee-behavior) self) + ) + ) + +(deftype reload-grenade-spawn-params (structure) + ((owner handle) + (joint-index uint16) + ) + ) + + +(deftype reload-grenade (process-drawable) + ((owner handle) + (joint-index uint16) + ) + (:state-methods + dormant + visible + shrinking + die + ) + (:methods + (move-to-joint (_type_) quaternion) + ) + ) + + +;; WARN: Return type mismatch int vs object. +(defbehavior reload-grenade-init-by-other reload-grenade ((arg0 reload-grenade-spawn-params)) + (ctywide-entity-hack) + (stack-size-set! (-> self main-thread) 128) + (set! (-> self owner) (-> arg0 owner)) + (set! (-> self joint-index) (-> arg0 joint-index)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-vehicle-grenade" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> self root scale) 1.4 1.4 1.4 1.0) + (go-virtual dormant) + 0 + ) + +(defstate dormant (reload-grenade) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('wake-up) + (go-virtual visible) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code sleep-code + ) + +(defstate visible (reload-grenade) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('sleep) + (go-virtual shrinking) + ) + ) + ) + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let* ((f0-1 (fmin 1.0 (* 0.016666668 (the float (- (current-time) (-> self state-time)))))) + (f0-2 (lerp 0.01 1.4 f0-1)) + ) + (set-vector! (-> self root scale) f0-2 f0-2 f0-2 1.0) + ) + (move-to-joint self) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defstate shrinking (reload-grenade) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let* ((f0-1 (fmin 1.0 (* 0.016666668 (the float (- (current-time) (-> self state-time)))))) + (f0-2 (lerp 1.4 0.01 f0-1)) + ) + (set-vector! (-> self root scale) f0-2 f0-2 f0-2 1.0) + ) + (move-to-joint self) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) + (go-virtual die) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defstate die (reload-grenade) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + '() + ) + ) + +(defmethod move-to-joint ((this reload-grenade)) + (let ((s5-0 (the-as process-focusable (handle->process (-> this owner))))) + (when s5-0 + (vector<-cspace! (-> this root trans) (-> s5-0 node-list data (-> this joint-index))) + (matrix->quaternion (-> this root quat) (-> s5-0 node-list data (-> this joint-index) bone transform)) + ) + ) + ) + +;; WARN: Return type mismatch process vs reload-grenade. +(defun reload-grenade-spawn ((arg0 crimson-guard) (arg1 type) (arg2 reload-grenade-spawn-params)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* arg1 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg0 "grenade" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 reload-grenade-init-by-other arg2) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as reload-grenade gp-0) + ) + ) + +(defstate grenade-throw-post-reloading (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-time! (-> self state-time)) + (set! (-> self urgent-fire) #f) + (let ((a2-0 (new 'stack-no-clear 'reload-grenade-spawn-params))) + (set! (-> a2-0 owner) (process->handle self)) + (set! (-> a2-0 joint-index) (the-as uint 9)) + (set! (-> self reloading-ammo) (process->handle (reload-grenade-spawn self reload-grenade a2-0))) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((a0-3 (handle->process (-> self reloading-ammo)))) + (if a0-3 + (send-event a0-3 'sleep) + ) + ) + (set! (-> self reloading-ammo) (the-as handle #f)) + ) + :trans (behavior () + (when (>= (* 0.5 (-> self grenade-guard-min-player-dist)) (-> self target-self-xz-dist)) + (cond + ((not (time-elapsed? (-> self state-time) (seconds 1.5))) + (+! (-> self num-times-reloading-interrupted) 1) + (cond + ((>= (-> self num-times-reloading-interrupted) 2) + (set! (-> self num-times-reloading-interrupted) 0) + (set! (-> self urgent-fire) #t) + (go-hostile self) + ) + (else + (go-virtual grenade-throw-post-retreating) + ) + ) + ) + (else + (set! (-> self urgent-fire) #t) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-grenade-reload-ja :num! (seek! max 0.92) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-0 (handle->process (-> self reloading-ammo))) + (f0-4 (ja-frame-num 0)) + ) + (when gp-0 + (cond + ((and (>= f0-4 4.0) (< f0-4 13.0)) + (send-event gp-0 'wake-up) + ) + ((< 14.0 f0-4) + (send-event gp-0 'sleep) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max 0.92)) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! crimson-guard-cock-gun-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (crimson-guard-method-285 self 1) + (go-hostile self) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate grenade-throw (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) 0.0) + ) + 0 + (let ((v1-12 (-> self nav state))) + (set! (-> v1-12 speed) 0.0) + ) + 0 + (let ((a0-8 (-> self nav state)) + (v1-15 *null-vector*) + ) + (set! (-> a0-8 velocity quad) (-> v1-15 quad)) + ) + 0 + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (set-time! (-> self last-fire-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-grenade-attack-ja + :num! (seek! (ja-aframe 12.0 0) 1.5) + :frame-num (ja-aframe 1.0 0) + ) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 1.5)) + ) + (go-active-if-necessary) + (crimson-guard-method-264 self) + (crimson-guard-method-285 self -1) + (set! (-> self urgent-fire) #f) + (set! (-> self grenade-guard-min-player-dist) 81920.0) + (ja-no-eval :group! crimson-guard-grenade-attack-ja + :num! (seek! (ja-aframe 32.0 0)) + :frame-num (ja-aframe 22.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 32.0 0))) + ) + (ja-no-eval :group! crimson-guard-grenade-attack-ja + :num! (seek! (ja-aframe 37.0 0)) + :frame-num (ja-aframe 33.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 37.0 0))) + ) + (set! (-> self total-flee-time) 0) + (cond + ((crimson-guard-method-272 self) + (crimson-guard-method-275 self) + ) + ((>= (-> self target-self-xz-dist) (-> self grenade-guard-min-player-dist)) + (go-virtual grenade-throw-post-reloading) + ) + (else + (go-virtual grenade-throw-post-retreating) + ) + ) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate grenade-hostile (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (crimson-guard-method-251 self) + (let* ((f30-0 150.0) + (v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-5 (the-as number (logior #x3f800000 v1-4))) + ) + (set! (-> self rand-state-time) (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-5)))))) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (crimson-guard-method-252 self) + (cond + ((> (-> self ammo-count) 0) + (if (and (or (time-elapsed? (-> self state-time) (-> self rand-state-time)) (-> self urgent-fire)) + (and (logtest? (-> self flags) (citizen-flag target-in-sight)) (< (-> self target-self-xz-dist) 81920.0)) + ) + (go-virtual grenade-throw) + ) + ) + (else + (if (or (and (time-elapsed? (-> self state-time) (seconds 1.5)) (not (-> self urgent-fire))) + (>= (-> self target-self-xz-dist) (* 0.75 (-> self grenade-guard-min-player-dist))) + ) + (go-virtual grenade-throw-post-reloading) + ) + ) + ) + (when (< (vector-vector-xz-distance (-> self root trans) (-> self move-position)) 8192.0) + (crimson-guard-method-289 self (-> self last-quick-target-spot-angle)) + (go-virtual grenade-throw-post-reloading) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (crimson-guard-method-253 self) + (crimson-guard-method-254 self) + ) + ) diff --git a/goal_src/jak3/levels/city/common/guard-rifle.gc b/goal_src/jak3/levels/city/common/guard-rifle.gc index 252badb0a8..5f13376e18 100644 --- a/goal_src/jak3/levels/city/common/guard-rifle.gc +++ b/goal_src/jak3/levels/city/common/guard-rifle.gc @@ -7,3 +7,345 @@ ;; DECOMP BEGINS +(defmethod crimson-guard-method-255 ((this crimson-guard)) + (let ((s5-0 (-> this target-pos-predict-miss)) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) + ) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 s3-0) 1.0) + (new 'stack-no-clear 'vector) + (spawn-guard-projectile this s3-0 s5-0 819200.0 s4-0) + ) + (crimson-guard-method-285 this -1) + 0 + (none) + ) + +(defmethod crimson-guard-method-257 ((this crimson-guard)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a0-3)) + ) + (vector-normalize! s3-1 409600.0) + (and (crimson-guard-method-256 this) + (zero? (crimson-guard-method-258 this s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) + ) + ) + ) + ) + +(defstate gun-shoot (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (if (zero? (-> self ammo-count)) + (go-virtual rifle-reload) + ) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self other-side) (if (< (rand-vu) 0.5) + #t + #f + ) + ) + (nav-enemy-method-177 self) + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logclear (-> v1-11 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-11 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-14 self)) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logclear (-> v1-14 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-17 (-> self nav state))) + (set! (-> v1-17 speed) 0.0) + ) + 0 + (let ((a0-9 (-> self nav state)) + (v1-20 *null-vector*) + ) + (set! (-> a0-9 velocity quad) (-> v1-20 quad)) + ) + 0 + (set-time! (-> self state-time)) + (set-time! (-> self last-time-see-target)) + (set! (-> self miss-amount) (lerp-scale 0.0 16384.0 (-> self target-self-dist) 40960.0 122880.0)) + (set! (-> self miss-amount) 16384.0) + (let ((v1-30 (handle->process (-> self focus handle)))) + (if (and v1-30 (logtest? (process-mask enemy) (-> v1-30 mask))) + (set! (-> self miss-amount) 0.0) + ) + ) + (set-time! (-> self next-shot)) + (set! (-> self joint-enable) #t) + ) + :exit (behavior () + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :trans (behavior () + (go-active-if-necessary) + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when gp-0 + (when (not (and gp-0 (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))))) + (set! (-> self miss-amount) (lerp-scale 0.0 16384.0 (-> self target-self-dist) 40960.0 122880.0)) + (set! (-> self miss-amount) 16384.0) + ) + (if (and (< (-> self target-self-xz-dist) 16384.0) + (and (< (fabs (-> self target-y-angle)) 7281.778) + gp-0 + (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + (go-virtual close-attack) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) + (or (not (logtest? (-> self flags) (citizen-flag target-in-sight))) + (< 184320.0 (-> self target-self-xz-dist)) + (< 10922.667 (fabs (-> self target-y-angle))) + ) + ) + (go-hostile self) + ) + ) + ) + ) + :code (behavior () + (local-vars (v1-33 object)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 0 anim-index)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (label cfg-3) + (when (crimson-guard-method-257 self) + (set! v1-33 #t) + (goto cfg-10) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (set! v1-33 #f) + (goto cfg-10) + ) + (suspend) + (b! (not #f) cfg-3 :delay (set! v1-33 #f)) + (label cfg-10) + (when v1-33 + (set-time! (-> self state-time)) + (let ((gp-1 (min 3 (the-as int (+ (logand (rand-uint31-gen *random-generator*) 3) 1))))) + (until #f + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 1 anim-index)) :num! min) + (set! (-> self already-shot) #t) + (lerp-scale 1.0 0.2 (-> self target-self-dist) 20480.0 122880.0) + (let ((f0-8 1.0)) + (cond + ((logtest? (-> self draw status) (draw-control-status on-screen)) + (let ((v1-58 (handle->process (-> self focus handle)))) + (when v1-58 + (if (or (< (-> self target-vel) 40.96) + (and (focus-test? (the-as process-focusable v1-58) pilot) (< (-> self target-pos y) 49152.0)) + ) + (set! (-> self miss-amount) (- (-> self miss-amount) (* 12288.0 f0-8))) + (set! (-> self miss-amount) (- (-> self miss-amount) (* 4096.0 f0-8))) + ) + ) + ) + ) + (else + (set! (-> self miss-amount) (- (-> self miss-amount) (* 3276.8 f0-8))) + ) + ) + ) + (if (< (-> self miss-amount) 0.0) + (set! (-> self miss-amount) 0.0) + ) + (crimson-guard-method-255 self) + (set-time! (-> self last-fire-time)) + (until (ja-done? 0) + (ja :num! (seek!)) + (suspend) + ) + (if (zero? (-> self ammo-count)) + (go-virtual rifle-reload) + ) + (+! gp-1 -1) + (if (or (< gp-1 0) + (not (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + ) + (goto cfg-59) + ) + ) + ) + #f + ) + (label cfg-59) + (let ((f30-1 (rnd-float-range self 0.9 1.1))) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 2 anim-index)) + :num! (seek! max f30-1) + :frame-num 0.0 + ) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (crimson-guard-method-268 self) + ) + :post (behavior () + (citizen-method-213 self) + (nav-enemy-method-187 self) + ) + ) + +(defstate rifle-reload (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim crimson-guard-grenade-reload-ja)) + (set! (-> gp-0 param 0) + (the float (+ (-> (the-as art-joint-anim crimson-guard-grenade-reload-ja) frames num-frames) -1)) + ) + (let* ((f30-0 1.1) + (f28-0 0.39999998) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> gp-0 param 1) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-15))))) + ) + (set! (-> gp-0 frame-num) 0.0) + (joint-control-channel-group! gp-0 (the-as art-joint-anim crimson-guard-grenade-reload-ja) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (let* ((f30-1 1.1) + (f28-1 0.39999998) + (v1-29 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-30 (the-as number (logior #x3f800000 v1-29))) + ) + (set! (-> gp-1 param 1) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-30))))) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (crimson-guard-method-285 self 3) + (set! (-> self last-fire-time) 0) + (let ((v1-36 #f)) + (let ((a0-13 (handle->process (-> self focus handle)))) + (if (and a0-13 (focus-test? (the-as process-focusable a0-13) ignore)) + (set! v1-36 #t) + ) + ) + (when (and (not v1-36) (or (>= 40960.0 (-> self target-self-xz-dist)) + (= (-> self ammo-count) (crimson-guard-method-286 self)) + (time-elapsed? (-> self last-fire-time) (-> self rand-state-time)) + ) + ) + 0 + (goto cfg-26) + ) + ) + ) + #f + (label cfg-26) + (ja-channel-push! 1 0) + (ja-no-eval :group! crimson-guard-cock-gun-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (go-hostile self) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defstate rifle-hostile (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (crimson-guard-method-251 self) + (set! (-> self rand-state-time) (the-as time-frame (the int (* 300.0 (rnd-float-range self 2.5 4.5))))) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (crimson-guard-method-252 self) + (let ((v1-4 (handle->process (-> self focus handle)))) + (if (or (not v1-4) + (not (and v1-4 + (not (logtest? (-> (the-as process-focusable v1-4) focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + ) + (go-virtual rifle-reload) + ) + ) + (when (and (< (-> self target-self-xz-dist) 163840.0) + (or (< 40960.0 (-> self target-self-xz-dist)) (>= 2 (the-as int (-> self focus aware)))) + ) + (when (and (logtest? (-> self flags) (citizen-flag target-in-sight)) + (< (vector-vector-xz-distance (-> self root trans) (-> self move-position)) 20480.0) + ) + (if (or (time-elapsed? (-> self last-fire-time) (-> self rand-state-time)) (= (-> self faction-mode) 1)) + (go-virtual gun-shoot) + (go-virtual rifle-reload) + ) + ) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-position)) 8192.0) + (crimson-guard-method-289 self (-> self last-quick-target-spot-angle)) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (crimson-guard-method-253 self) + (crimson-guard-method-254 self) + ) + ) diff --git a/goal_src/jak3/levels/city/common/guard-states.gc b/goal_src/jak3/levels/city/common/guard-states.gc index cb51118cf5..e93ce08b36 100644 --- a/goal_src/jak3/levels/city/common/guard-states.gc +++ b/goal_src/jak3/levels/city/common/guard-states.gc @@ -7,3 +7,1173 @@ ;; DECOMP BEGINS +(defstate knocked-recover (crimson-guard) + :virtual #t + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((a0-3 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-3 flags) (nav-state-flag directional-mode)) + (set! (-> a0-3 travel quad) (-> v1-3 quad)) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (set! (-> self hit-face) (the-as uint -1)) + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((v1-1 (if (zero? (-> self hit-face)) + (-> self anim-get-up-front) + (-> self anim-get-up-back) + ) + ) + ) + (ja-no-eval :group! (-> self draw art-group data v1-1) :num! (seek! max (-> self speed-scale)) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (if (enemy-method-109 self) + (go-die self) + (go-best-state self) + ) + ) + ) + +(defstate get-up-front (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (set! (-> self hit-face) (the-as uint -1)) + (enemy-method-50 self 0) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-get-up-front)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (set! (-> self hit-face) (the-as uint -1)) + (go-best-state self) + ) + :post (behavior () + (reset-penetrate! self) + (let ((a0-1 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-3 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +(defstate get-up-back (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (set! (-> self hit-face) (the-as uint -1)) + (enemy-method-50 self 0) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-get-up-back)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (set! (-> self hit-face) (the-as uint -1)) + (go-best-state self) + ) + :post (behavior () + (reset-penetrate! self) + (let ((a0-1 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-3 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +(defstate knocked (crimson-guard) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (if (= (-> self hit-points) 0.0) + (set! (-> self root penetrated-by) (the-as penetrate -1)) + ) + (set! (-> self hit-face) + (the-as + uint + (if (< (vector-dot (-> self root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + 0.0 + ) + 1 + 0 + ) + ) + ) + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (reset-penetrate! self) + ) + ) + +(defstate knocked-off-vehicle (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + '() + ) + :code (behavior () + (suspend) + (citizen-method-206 self) + ) + ) + +(defun debug-active () + #f + ) + +(defstate active (crimson-guard) + :virtual #t + :enter (behavior () + (when (not (-> self nav)) + (format #t "++++++++++++++ guard::active : nav = #f +++++++++++++++~%") + (go-inactive self) + ) + (let ((t9-2 (-> (method-of-type citizen active) enter))) + (if t9-2 + (t9-2) + ) + ) + (logclear! (-> self flags) (citizen-flag in-pursuit hostile)) + (set! (-> self already-shot) #f) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type citizen active) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (logtest? (-> self draw status) (draw-control-status on-screen)) + (let ((f0-0 61440.0)) + (cond + ((< (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> self root trans))) + (speech-control-method-13 *speech-control* self (speech-type guard-chatter) (-> self traffic-id)) + (speech-control-method-17 *speech-control* (speech-type guard-chatter-jak) 0.2) + ) + (else + (speech-control-method-13 *speech-control* self (speech-type guard-chatter-jak) (-> self traffic-id)) + (speech-control-method-17 *speech-control* (speech-type guard-chatter) 0.2) + ) + ) + ) + ) + (crimson-guard-method-270 self) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (handle->process (-> self target-status handle)) + (go-hostile self) + ) + ) + ) + ) + +(defstate close-attack-active (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let* ((v1-5 *game-info*) + (a0-8 (+ (-> v1-5 attack-id) 1)) + ) + (set! (-> v1-5 attack-id) a0-8) + (set! (-> self attack-id) a0-8) + ) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) 0.0) + ) + 0 + (logior! (-> self focus-status) (focus-status dangerous)) + ) + :exit (behavior () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (logclear! (-> v1-3 prim-core action) (collide-action deadly)) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-0 #f)) + (ja-no-eval :group! crimson-guard-rifle-butt-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (< 3.5 (ja-frame-num 0)) (not gp-0)) + (let ((v1-22 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (logior! (-> v1-22 prim-core action) (collide-action deadly)) + ) + (set! gp-0 #t) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-virtual active) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate inactive (crimson-guard) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((t9-0 (-> (method-of-type citizen inactive) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self flags) (citizen-flag in-pursuit hostile)) + (set! (-> self already-shot) #f) + ) + ) + +(defstate search (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (nav-enemy-method-177 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self enemy-info run-travel-speed))) + ) + 0 + (if (zero? (-> self controller branch)) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + '() + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (if (and (nonzero? (-> self controller branch)) + (let ((f0-0 (vector-vector-xz-distance-squared (-> self root trans) (-> self dest-point))) + (f1-0 16384.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + ) + (let ((a0-2 (-> self nav state)) + (v1-9 (-> self dest-point)) + ) + (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-2 target-pos quad) (-> v1-9 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod crimson-guard-method-251 ((this crimson-guard)) + ((-> (method-of-type nav-enemy hostile) enter)) + (nav-enemy-method-177 this) + (when (-> this nav) + (let ((v1-6 (-> this nav))) + (set! (-> v1-6 target-speed) (* (-> this speed-scale) (-> this enemy-info run-travel-speed))) + ) + 0 + ) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + (logclear! (-> this flags) (citizen-flag in-formation)) + (set! (-> this root nav-radius) 6144.0) + (none) + ) + +(defmethod crimson-guard-method-252 ((this crimson-guard)) + (go-active-if-necessary) + (speech-control-method-17 *speech-control* (speech-type guard-chatter) 0.2) + (speech-control-method-17 *speech-control* (speech-type guard-chatter-jak) 0.2) + (cond + (*guard-died-recently?* + (speech-control-method-13 *speech-control* this (speech-type guard-witness-death) (-> this traffic-id)) + (set! *guard-died-recently?* #f) + ) + (else + (speech-control-method-13 *speech-control* this (speech-type guard-generic-battle) (-> this traffic-id)) + ) + ) + (if (crimson-guard-method-270 this) + (go-hostile this) + ) + (let* ((s4-0 (-> this target-status)) + (s3-0 (handle->process (-> s4-0 handle))) + (s5-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (if (and s5-0 (or (focus-test? (the-as process-focusable s5-0) inactive) + (focus-test? (the-as process-focusable s5-0) disable) + ) + ) + (set! s5-0 (the-as process #f)) + ) + (cond + ((not s5-0) + ) + (else + (when (and (logtest? (-> this nav state flags) (nav-state-flag at-target)) + (not (logtest? (-> s4-0 flags) (squad-target-flag visible-recently))) + ) + (logclear! (-> this flags) (citizen-flag persistent)) + (citizen-method-208 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this search)) + ) + (when (or (logtest? (-> s4-0 flags) (squad-target-flag visible-recently)) + (not (logtest? (-> s5-0 mask) (process-mask target))) + ) + (cond + ((focus-test? (the-as process-focusable s5-0) arrestable) + (if (and (< (-> this target-self-xz-dist) 28672.0) + (< (fabs (-> this target-y-angle)) 7281.778) + (>= 8192.0 (fabs (- (-> (get-trans (the-as process-focusable s5-0) 1) y) (-> this root trans y)))) + ) + (go (method-of-object this arrest)) + ) + ) + (else + (if (crimson-guard-method-269 this (the-as process-focusable s5-0)) + (go (method-of-object this close-attack)) + ) + ) + ) + ) + (let ((f0-7 (* 2.0 (crimson-guard-method-283 this)))) + (when (and (time-elapsed? (-> this state-time) (seconds 1)) + (< (* f0-7 f0-7) + (vector-vector-xz-distance-squared (-> this root trans) (get-trans (the-as process-focusable s5-0) 0)) + ) + ) + (set-time! (-> this state-time)) + (crimson-guard-method-289 this 0.0) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod crimson-guard-method-253 ((this crimson-guard)) + 0 + (none) + ) + +(defmethod crimson-guard-method-254 ((this crimson-guard)) + (local-vars (sv-112 vector) (sv-128 vector) (sv-144 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (handle->process (-> this focus handle)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this move-position quad)) + (when (< 8192000.0 (-> this target-self-xz-dist)) + (let ((s3-0 (-> this root trans)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! (-> s1-0 quad) (-> s5-0 quad)) + (vector-z-quaternion! s2-0 (-> this root quat)) + (let ((f30-0 (* 182.04445 (* 60.0 (the float (- (-> this traffic-id) *guard-min-id-hack*)))))) + (set! sv-128 s0-0) + (set! (-> sv-128 x) (cos f30-0)) + (set! (-> sv-128 y) 0.0) + (set! (-> sv-128 z) (sin f30-0)) + ) + (set! (-> sv-128 w) 1.0) + (let ((a1-2 s1-0)) + (let ((v1-21 s1-0)) + (let ((a0-13 s0-0)) + (let ((a2-1 12288.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-13 quad)) + ) + (.lvf vf4 (&-> v1-21 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 (&-> a1-2 quad) vf6) + ) + (let ((f30-2 (* 0.5 (vector-vector-xz-distance s3-0 s1-0)))) + (vector-normalize! s2-0 (* 0.5 f30-2)) + (vector-normalize! s0-0 (* 2.0 f30-2)) + ) + (set! sv-144 0) + (while (< sv-144 10) + (do-spline s4-0 s3-0 s2-0 s1-0 s0-0 (* 0.1 (the float sv-144))) + (do-spline sv-112 s3-0 s2-0 s1-0 s0-0 (* 0.1 (the float (+ sv-144 1)))) + (add-debug-line #t (bucket-id debug-no-zbuf1) s4-0 sv-112 *color-red* #f (the-as rgba -1)) + (set! sv-144 (+ sv-144 1)) + ) + (do-spline s4-0 s3-0 s2-0 s1-0 s0-0 0.9) + (set! (-> s4-0 quad) (-> s5-0 quad)) + ) + ) + (let ((v1-39 (-> this nav state))) + (logclear! (-> v1-39 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-39 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-39 target-pos quad) (-> s5-0 quad)) + ) + ) + 0 + (nav-enemy-method-187 this) + (none) + ) + ) + +(defstate hostile (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (crimson-guard-method-251 self) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (crimson-guard-method-252 self) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (crimson-guard-method-253 self) + (crimson-guard-method-254 self) + ) + ) + +(defstate close-attack (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-4 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-4 enemy-flags))) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-4 enemy-flags)))) + ) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-4 enemy-flags)))) + (set! (-> v1-4 nav callback-info) (-> v1-4 enemy-info callback-info)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self urgent-fire) #f) + (let* ((v1-9 *game-info*) + (a0-17 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a0-17) + (set! (-> self attack-id) a0-17) + ) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 target-speed) 0.0) + ) + 0 + ) + :exit (behavior () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (logclear! (-> v1-3 prim-core action) (collide-action deadly)) + ) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (crimson-guard-method-261 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-0 #f)) + (ja-no-eval :group! crimson-guard-rifle-butt-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (< 3.5 (ja-frame-num 0)) (not gp-0)) + (let ((v1-22 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (logior! (-> v1-22 prim-core action) (collide-action deadly)) + ) + (set! gp-0 #t) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-hostile self) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate flee-danger (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (set-time! (-> self state-time)) + (nav-enemy-method-177 self) + (flee-info-method-12 (-> self flee-behavior) self) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (flee-info-method-11 (-> self flee-behavior) self) + (if (time-elapsed? (-> self state-time) (seconds 4)) + (go-hostile self) + ) + (if (< 81920.0 (vector-vector-xz-distance (-> self root trans) (-> self danger-pos))) + (go-virtual active) + ) + ) + :code (behavior () + (loop + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 60) + ) + ) + :post (behavior () + (flee-info-method-13 (-> self flee-behavior) self) + ) + ) + +(defstate roll-right (crimson-guard) + :virtual #t + :event enemy-event-handler + :code (behavior () + (vector-reset! (-> self root transv)) + (vector-x-quaternion! (-> self root transv) (-> self root quat)) + (set! (-> self root transv y) 24576.0) + (vector-xz-normalize! (-> self root transv) 40960.0) + (let ((v1-7 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-7 enemy-flags))) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-7 enemy-flags)))) + ) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-7 enemy-flags)))) + (set! (-> v1-7 nav callback-info) (-> v1-7 enemy-info callback-info)) + ) + 0 + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 6.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (let ((a0-20 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-20 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans a0-20 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 6.0 0))) + ) + ) + (else + (ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 9.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (let ((a0-33 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-33 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans a0-33 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 9.0 0))) + ) + ) + ) + (let ((v1-58 self)) + (set! (-> v1-58 enemy-flags) (the-as enemy-flag (logclear (-> v1-58 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-58 nav callback-info) *null-nav-callback-info*) + ) + 0 + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 6.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 11.0 0))) + ) + ) + (else + (ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 9.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 11.0 0))) + ) + ) + ) + (go-virtual gun-shoot) + ) + :post (behavior () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef37) (-> a0-0 enemy-flags)) + (vector-v++! + (-> self root transv) + (compute-acc-due-to-gravity (-> self root) (new 'stack-no-clear 'vector) 0.0) + ) + (let ((a2-1 (new 'stack-no-clear 'collide-query)) + (a0-5 (-> self root)) + ) + (set! (-> a2-1 collide-with) (-> a0-5 root-prim prim-core collide-with)) + (set! (-> a2-1 ignore-process0) self) + (set! (-> a2-1 ignore-process1) #f) + (set! (-> a2-1 ignore-pat) (-> a0-5 pat-ignore-mask)) + (set! (-> a2-1 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide a0-5 (-> self root transv) a2-1 (meters 0)) + ) + ) + ) + (nav-enemy-simple-post) + ) + ) + +(defstate roll-left (crimson-guard) + :virtual #t + :event enemy-event-handler + :code (behavior () + (vector-reset! (-> self root transv)) + (vector-x-quaternion! (-> self root transv) (-> self root quat)) + (set! (-> self root transv y) 24576.0) + (vector-xz-normalize! (-> self root transv) -40960.0) + (let ((v1-7 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-7 enemy-flags))) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-7 enemy-flags)))) + ) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-7 enemy-flags)))) + (set! (-> v1-7 nav callback-info) (-> v1-7 enemy-info callback-info)) + ) + 0 + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 9.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (let ((a0-20 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-20 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans a0-20 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 9.0 0))) + ) + ) + (else + (ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 6.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (let ((a0-33 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-33 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans a0-33 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 6.0 0))) + ) + ) + ) + (let ((v1-58 self)) + (set! (-> v1-58 enemy-flags) (the-as enemy-flag (logclear (-> v1-58 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-58 nav callback-info) *null-nav-callback-info*) + ) + 0 + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 9.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 11.0 0))) + ) + ) + (else + (ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 6.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 11.0 0))) + ) + ) + ) + (go-virtual gun-shoot) + ) + :post (-> (method-of-type crimson-guard roll-right) post) + ) + +(defstate arrest (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (nav-enemy-method-178 self) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (vector-reset! (-> self root transv)) + (let ((a0-9 (-> self nav state)) + (v1-12 *null-vector*) + ) + (set! (-> a0-9 velocity quad) (-> v1-12 quad)) + ) + 0 + (set-time! (-> self state-time)) + (set-time! (-> self last-time-see-target)) + (set! (-> self miss-amount) 0.0) + (set-time! (-> self next-shot)) + (set! (-> self joint-enable) #t) + (crimson-guard-method-262 self) + ) + :exit (behavior () + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :trans (behavior () + (send-event (handle->process (-> self focus handle)) 'arrest) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! crimson-guard-idle-to-stab-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (until #f + (if (or (not (logtest? (-> self flags) (citizen-flag target-in-sight))) + (< 49152.0 (-> self target-self-xz-dist)) + (< 10922.667 (fabs (-> self target-y-angle))) + ) + (goto cfg-17) + ) + (ja-no-eval :group! crimson-guard-stab-idle-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (label cfg-17) + (let ((f30-1 (rnd-float-range self 0.9 1.1))) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-stab-idle-to-idle-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (go-hostile self) + ) + :post (behavior () + (citizen-method-213 self) + (nav-enemy-simple-post) + ) + ) + +(defstate waiting-ambush (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (nav-enemy-method-178 self) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (vector-reset! (-> self root transv)) + (let ((a0-9 (-> self nav state)) + (v1-12 *null-vector*) + ) + (set! (-> a0-9 velocity quad) (-> v1-12 quad)) + ) + 0 + (set-time! (-> self state-time)) + (set! (-> self miss-amount) 0.0) + (set-time! (-> self next-shot)) + (set! (-> self joint-enable) #t) + (crimson-guard-method-262 self) + ) + :exit (behavior () + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! crimson-guard-idle-to-stab-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (while (not (logtest? (-> self flags) (citizen-flag target-in-sight))) + (ja-no-eval :group! crimson-guard-stab-idle-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((f30-1 (rnd-float-range self 0.9 1.1))) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-stab-idle-to-idle-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (go-hostile self) + ) + :post (behavior () + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (nav-enemy-simple-post) + ) + ) + +(defstate exit-transport (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) + (logclear! (-> self flags) (citizen-flag hostile)) + (nav-enemy-method-177 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self enemy-info run-travel-speed))) + ) + 0 + (set! (-> self already-shot) #f) + ) + :exit (behavior () + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + (if (-> self nav) + (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) + ) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (not (-> self already-shot)) + (crimson-guard-method-265 self 1.0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s5-0 (new 'stack 'collide-query)) + ) + (let ((a0-3 gp-0)) + (let ((v1-8 gp-0)) + (let ((a1-4 20480.0)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> s4-0 quad)) + (.lvf vf4 (&-> v1-8 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 (&-> a0-3 quad) vf6) + ) + (if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y)) + ) + ) + ) + (when (!= (crimson-guard-method-266 self (-> self event-param-point)) 0.0) + (let* ((v1-16 (-> self nav)) + (a1-7 (-> self event-param-point)) + (f0-3 (-> v1-16 extra-nav-sphere w)) + ) + (set! (-> v1-16 extra-nav-sphere quad) (-> a1-7 quad)) + (set! (-> v1-16 extra-nav-sphere w) f0-3) + ) + 0 + (let ((v1-19 (-> self nav))) + (set! (-> v1-19 extra-nav-sphere w) (-> self nav-radius-backup)) + ) + 0 + (let ((v1-21 (-> self nav))) + (logior! (-> v1-21 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (set! (-> self already-shot) #t) + ) + (crimson-guard-method-265 self 0.0) + ) + ) + ) + :code (behavior () + (while (not (-> self already-shot)) + (suspend) + ) + (set-time! (-> self state-time)) + (ja-channel-set! 1) + (let ((gp-0 (current-time)) + (s5-0 150) + (f30-0 2.0) + ) + (ja-no-eval :group! crimson-guard-run-ja :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? gp-0 s5-0) + (crimson-guard-method-265 self (* 0.006666667 (the float (- (current-time) (-> self state-time))))) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event self 'jump 0 (-> self event-param-point)) + (sleep-code) + ) + :post (behavior () + (ja-post) + ) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod go-hostile ((this crimson-guard)) + (let ((v1-2 (handle->process (-> this focus handle)))) + (cond + (v1-2 + (logior! (-> this flags) (citizen-flag hostile)) + (if (and (not (logtest? (-> v1-2 mask) (process-mask target))) + (-> this next-state) + (= (-> this next-state name) 'active) + ) + (speech-control-method-13 *speech-control* this (speech-type guard-go-hostile) (-> this traffic-id)) + ) + (cond + (#f + ) + (else + (case (-> this guard-type) + (((guard-type rifle)) + (go (method-of-object this rifle-hostile)) + ) + (((guard-type tazer)) + (go (method-of-object this tazer-hostile)) + ) + (((guard-type grenade)) + (go (method-of-object this grenade-hostile)) + ) + ) + ) + ) + ) + (else + (go (method-of-object this active)) + ) + ) + ) + 0 + ) diff --git a/goal_src/jak3/levels/city/common/guard-tazer.gc b/goal_src/jak3/levels/city/common/guard-tazer.gc index be7d726cdc..5c48dcd70d 100644 --- a/goal_src/jak3/levels/city/common/guard-tazer.gc +++ b/goal_src/jak3/levels/city/common/guard-tazer.gc @@ -7,3 +7,638 @@ ;; DECOMP BEGINS +(defun spread-lightning-lazer ((arg0 lightning-control) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (sv-640 int) (sv-656 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg2 quad)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'quaternion)) + ) + (vector-length arg2) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (set! (-> s1-0 quad) (-> arg3 quad)) + (let ((s0-0 (new 'stack-no-clear 'collide-query))) + (set! sv-640 0) + (while (< sv-640 6) + (let ((v1-6 s0-0)) + (set! (-> v1-6 radius) 2867.2) + (set! (-> v1-6 collide-with) + (collide-spec jak bot civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-6 ignore-process0) #f) + (set! (-> v1-6 ignore-process1) #f) + (set! (-> v1-6 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-6 action-mask) (collide-action solid)) + ) + (set! (-> s0-0 start-pos quad) (-> s5-0 quad)) + (set! (-> s0-0 move-dist quad) (-> s4-0 quad)) + (set-from-point-offset-pad! (-> s0-0 bbox) (-> s0-0 start-pos) (-> s0-0 move-dist) (-> s0-0 radius)) + (fill-using-bounding-box *collide-cache* s0-0) + (set! (-> s0-0 radius) 409.6) + (let ((f0-4 (probe-using-line-sphere *collide-cache* s0-0))) + (cond + ((>= f0-4 0.0) + (let ((a1-4 s3-0)) + (let ((v1-13 (-> s0-0 start-pos))) + (let ((a0-12 (-> s0-0 move-dist))) + (let ((a2-2 f0-4)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-12 quad)) + ) + (.lvf vf4 (&-> v1-13 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 (&-> a1-4 quad) vf6) + ) + (set! (-> s5-0 quad) (-> s3-0 quad)) + ) + (else + (vector+! (-> s0-0 start-pos) s5-0 s4-0) + (let ((a1-7 (-> s0-0 start-pos))) + (let ((v1-16 (-> s0-0 start-pos))) + (let ((a0-16 s1-0)) + (let ((a2-4 -2048.0)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-16 quad)) + ) + (.lvf vf4 (&-> v1-16 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 (&-> a1-7 quad) vf6) + ) + (vector-negate! (-> s0-0 move-dist) s4-0) + (set! f0-4 (probe-using-line-sphere *collide-cache* s0-0)) + (when (>= f0-4 0.0) + (let ((a1-10 s3-0)) + (let ((v1-19 (-> s0-0 start-pos))) + (let ((a0-19 (-> s0-0 move-dist))) + (let ((a2-5 f0-4)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-19 quad)) + ) + (.lvf vf4 (&-> v1-19 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 (&-> a1-10 quad) vf6) + ) + (let ((a1-11 s3-0)) + (let ((v1-20 s3-0)) + (let ((a0-20 s1-0)) + (let ((a2-7 2048.0)) + (.mov vf7 a2-7) + ) + (.lvf vf5 (&-> a0-20 quad)) + ) + (.lvf vf4 (&-> v1-20 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 (&-> a1-11 quad) vf6) + ) + (set! (-> s5-0 quad) (-> s3-0 quad)) + ) + ) + ) + (cond + ((>= f0-4 0.0) + (+! (-> s3-0 x) (rand-vu-float-range -819.2 819.2)) + (+! (-> s3-0 y) (rand-vu-float-range -819.2 819.2)) + (+! (-> s3-0 z) (rand-vu-float-range -819.2 819.2)) + (set-point! arg0 (-> arg0 state points-to-draw) s3-0) + (+! (-> arg0 state points-to-draw) 1) + (set! sv-656 (-> s0-0 best-other-tri normal)) + (quaternion-from-two-vectors! s2-0 s1-0 sv-656) + (vector-orient-by-quat! s4-0 s4-0 s2-0) + (set! (-> s1-0 quad) (-> sv-656 quad)) + (vector-flatten! s4-0 s4-0 sv-656) + ) + (else + (vector+! s5-0 s5-0 s4-0) + (when (< sv-640 6) + (set-point! arg0 (-> arg0 state points-to-draw) s5-0) + (+! (-> arg0 state points-to-draw) 1) + ) + ) + ) + ) + (set! sv-640 (+ sv-640 1)) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod crimson-guard-method-263 ((this crimson-guard)) + (local-vars (sv-832 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) + (s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0)) + (s1-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0) 16384.0) + ) + (s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'collide-query)) + ) + (when (< 1820.4445 (vector-vector-angle-safe s2-0 s1-0)) + (let* ((a1-9 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) s2-0 s1-0) 1.0)) + (a2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-9 1820.4445)) + ) + (vector-orient-by-quat! s1-0 s2-0 a2-1) + ) + ) + (let ((a0-12 s4-0)) + (let ((v1-8 s4-0)) + (let ((a1-12 0.2)) + (.mov vf7 a1-12) + ) + (.lvf vf5 (&-> s2-0 quad)) + (.lvf vf4 (&-> v1-8 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 (&-> a0-12 quad) vf6) + ) + (vector+! s5-0 s4-0 s1-0) + (let ((v1-10 s3-0)) + (set! (-> v1-10 radius) 409.6) + (set! (-> v1-10 collide-with) + (collide-spec jak bot civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-10 ignore-process0) #f) + (set! (-> v1-10 ignore-process1) #f) + (set! (-> v1-10 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-10 action-mask) (collide-action solid)) + ) + (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) + (set! (-> s3-0 move-dist quad) (-> s1-0 quad)) + (set! (-> this l-control state points-to-draw) 0) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (cond + ((>= f0-3 0.0) + (vector-float*! s1-0 (-> s3-0 move-dist) f0-3) + (vector+! s5-0 s4-0 s1-0) + (point-in-plane-<-point+normal! s2-1 s5-0 (-> s3-0 best-other-tri normal)) + (vector-! s2-1 s2-1 s5-0) + (let ((s1-1 quaternion-vector-angle!) + (s0-0 (new 'stack-no-clear 'quaternion)) + ) + (set! sv-832 (-> s3-0 best-other-tri normal)) + (let* ((a2-3 (rand-vu-float-range 0.0 65536.0)) + (a2-4 (s1-1 s0-0 sv-832 a2-3)) + ) + (vector-orient-by-quat! s2-1 s2-1 a2-4) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) + ) + ) + (set-point! (-> this l-control) 0 s4-0) + (set-point! (-> this l-control) 1 s5-0) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 19)) + (+! (-> this l-control state points-to-draw) 2) + (let* ((s1-6 (-> s3-0 best-other-tri collide-ptr)) + (v1-91 (if (type? s1-6 collide-shape-prim) + s1-6 + ) + ) + (s1-7 #t) + ) + (when v1-91 + (set! s1-7 #f) + (let ((s0-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s0-1 ent) (-> this entity)) + (set! (-> s0-1 charge) 1.0) + (set! (-> s0-1 options) (projectile-options)) + (logclear! (-> s0-1 options) (projectile-options po14 po15 po16)) + (set! (-> s0-1 notify-handle) (process->handle this)) + (set! (-> s0-1 owner-handle) (the-as handle #f)) + (set! (-> s0-1 target-handle) (the-as handle #f)) + (set! (-> s0-1 target-pos quad) (the-as uint128 0)) + (set! (-> s0-1 ignore-handle) (process->handle this)) + (set! (-> s0-1 attack-id) (-> this attack-id)) + (set! (-> s0-1 timeout) (seconds 4)) + (set! (-> s0-1 pos quad) (-> s4-0 quad)) + (vector-! (-> s0-1 vel) s5-0 s4-0) + (vector-normalize! (-> s0-1 vel) 131072.0) + (spawn-projectile guard-lazer-shot s0-1 this *default-dead-pool*) + ) + ) + ) + (spread-lightning-lazer (-> this l-control) s5-0 s2-1 (-> s3-0 best-other-tri normal)) + ) + (else + (cond + ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) + ) + ) + (set! (-> this l-control state points-to-draw) 9) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 20)) + (let ((v1-176 s4-0)) + (set! (-> this l-control state meet data 0 quad) (-> v1-176 quad)) + ) + (let ((a0-97 (-> this l-control)) + (v1-178 s5-0) + ) + (set! (-> a0-97 state meet data (+ (-> a0-97 state points-to-draw) -1) quad) (-> v1-178 quad)) + ) + ) + ) + ) + ) + (none) + ) + ) + +(defstate attack (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self joint-enable) #t) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-5 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-8 self)) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logclear (-> v1-8 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self miss-amount) 0.0) + (set-time! (-> self state-time)) + (set! (-> self lazer-sound) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (if (nonzero? (-> self lazer-sound)) + (sound-stop (-> self lazer-sound)) + ) + (iterate-prims + (-> self root) + (lambda ((arg0 collide-shape-prim)) (logclear! (-> arg0 prim-core action) (collide-action deadly)) (none)) + ) + (let ((v1-5 (-> self l-control)) + (a0-2 0) + ) + (let ((a1-2 (!= a0-2 (-> v1-5 state mode)))) + (case a0-2 + ((3) + (if a1-2 + (set! (-> v1-5 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-5 state start-color) (-> v1-5 spec start-color)) + (set! (-> v1-5 state end-color) (-> v1-5 spec end-color)) + ) + ) + ) + (set! (-> v1-5 state mode) (the-as uint a0-2)) + ) + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 1)) + (or (< 32768.0 (-> self target-self-xz-dist)) (not (logtest? (-> self flags) (citizen-flag target-in-sight)))) + ) + (go-hostile self) + ) + (let ((v1-12 (handle->process (-> self focus handle)))) + (if (and v1-12 (or (focus-test? (the-as process-focusable v1-12) inactive) + (focus-test? (the-as process-focusable v1-12) disable) + ) + ) + (set! v1-12 (the-as process #f)) + ) + (cond + ((not v1-12) + (go-virtual active) + ) + ((and (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + (< (fabs (-> self target-y-angle)) 8192.0) + ) + (if (< (-> self target-self-xz-dist) 16384.0) + (go-virtual close-attack) + (go-virtual attack-tazer) + ) + ) + (else + (set! (-> self next-shot) (+ (current-time) (seconds 1))) + ) + ) + ) + ) + :code (behavior () + (local-vars (v1-37 symbol)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-idle-to-stab-idle-ja :num! (seek! (ja-aframe 7.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + (until #f + (while (or (< 7281.778 (fabs (-> self target-y-angle))) (>= (-> self next-shot) (current-time))) + (when (not (orient-towards-code (the-as degrees #x45e38e39))) + (let ((v1-17 (ja-group))) + (if (not (and v1-17 (= v1-17 crimson-guard-stab-idle-loop-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! crimson-guard-stab-idle-loop-ja :num! (loop!)) + (until v1-37 + (suspend) + (ja :num! (loop!)) + (set! v1-37 + (or (< (current-time) (-> self next-shot)) + (< (-> self target-self-xz-dist) 16384.0) + (not (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + (>= (fabs (-> self target-y-angle)) 7281.778) + ) + ) + ) + ) + (when (< (-> self target-self-xz-dist) 16384.0) + (set! (-> self next-shot) 0) + 0 + ) + (suspend) + ) + ) + #f + ) + :post (behavior () + (citizen-method-213 self) + (nav-enemy-method-187 self) + ) + ) + +(defstate attack-tazer (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self joint-enable) #t) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-5 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-8 self)) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logclear (-> v1-8 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self miss-amount) 0.0) + (set-time! (-> self state-time)) + (set! (-> self lazer-sound) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (if (nonzero? (-> self lazer-sound)) + (sound-stop (-> self lazer-sound)) + ) + (iterate-prims + (-> self root) + (lambda ((arg0 collide-shape-prim)) (logclear! (-> arg0 prim-core action) (collide-action deadly)) (none)) + ) + (let ((v1-5 (-> self l-control)) + (a0-2 0) + ) + (let ((a1-2 (!= a0-2 (-> v1-5 state mode)))) + (case a0-2 + ((3) + (if a1-2 + (set! (-> v1-5 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-5 state start-color) (-> v1-5 spec start-color)) + (set! (-> v1-5 state end-color) (-> v1-5 spec end-color)) + ) + ) + ) + (set! (-> v1-5 state mode) (the-as uint a0-2)) + ) + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 1)) + (or (< 32768.0 (-> self target-self-xz-dist)) (not (logtest? (-> self flags) (citizen-flag target-in-sight)))) + ) + (go-hostile self) + ) + (let ((v1-12 (handle->process (-> self focus handle)))) + (if (and v1-12 (or (focus-test? (the-as process-focusable v1-12) inactive) + (focus-test? (the-as process-focusable v1-12) disable) + ) + ) + (set! v1-12 (the-as process #f)) + ) + (if (not v1-12) + (go-virtual active) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! crimson-guard-stab-idle-to-attack-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (crimson-guard-method-262 self) + (set! (-> self next-shot) (+ (current-time) (seconds 0.1))) + (let ((v1-32 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 2))) + (logior! (-> v1-32 prim-core action) (collide-action deadly)) + ) + (let* ((v1-33 *game-info*) + (a0-8 (+ (-> v1-33 attack-id) 1)) + ) + (set! (-> v1-33 attack-id) a0-8) + (set! (-> self attack-id) a0-8) + ) + (set! (-> self lazer-sound) (sound-play "guard-zap")) + (let ((v1-35 (-> self l-control)) + (a0-11 1) + ) + (let ((a1-5 (!= a0-11 (-> v1-35 state mode)))) + (case a0-11 + ((3) + (if a1-5 + (set! (-> v1-35 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-35 state start-color) (-> v1-35 spec start-color)) + (set! (-> v1-35 state end-color) (-> v1-35 spec end-color)) + ) + ) + ) + (set! (-> v1-35 state mode) (the-as uint a0-11)) + ) + (let ((gp-1 (current-time)) + (s5-1 150) + (f30-0 1.0) + ) + (ja-no-eval :group! crimson-guard-stab-attack-ja :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? gp-1 s5-1) + (crimson-guard-method-263 self) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (let ((v1-58 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 2))) + (logclear! (-> v1-58 prim-core action) (collide-action deadly)) + ) + (let ((v1-59 (-> self l-control)) + (a0-17 3) + ) + (let ((a1-18 (!= a0-17 (-> v1-59 state mode)))) + (case a0-17 + ((3) + (if a1-18 + (set! (-> v1-59 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-59 state start-color) (-> v1-59 spec start-color)) + (set! (-> v1-59 state end-color) (-> v1-59 spec end-color)) + ) + ) + ) + (set! (-> v1-59 state mode) (the-as uint a0-17)) + ) + (ja-no-eval :group! crimson-guard-stab-attack-to-stab-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + :post (behavior () + (citizen-method-213 self) + (nav-enemy-method-187 self) + ) + ) + +(defstate tazer-hostile (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (crimson-guard-method-251 self) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (crimson-guard-method-252 self) + (if (or (< (-> self target-self-xz-dist) 32768.0) (>= 2 (the-as int (-> self focus aware)))) + (go-virtual attack) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-position)) 8192.0) + (crimson-guard-method-289 self (-> self last-quick-target-spot-angle)) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (crimson-guard-method-253 self) + (crimson-guard-method-254 self) + ) + ) diff --git a/goal_src/jak3/levels/city/common/kg-squad-control.gc b/goal_src/jak3/levels/city/common/kg-squad-control.gc index f82e2cdd13..ffb22e4030 100644 --- a/goal_src/jak3/levels/city/common/kg-squad-control.gc +++ b/goal_src/jak3/levels/city/common/kg-squad-control.gc @@ -7,3 +7,370 @@ ;; DECOMP BEGINS +(define *default-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 1 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 4 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +(define *alert-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 4 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +(define *war-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 5 + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 4 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 5 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +;; WARN: Return type mismatch pointer vs none. +(defmethod copy-squad-settings-to-idx ((this kg-squad-control) (arg0 (inline-array kg-squad-member-settings)) (arg1 int)) + (mem-copy! (the-as pointer (-> this squad-settings arg1)) (the-as pointer arg0) 64) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init-alert ((this kg-squad-control)) + (copy-squad-settings-to-idx this *default-kg-squad-member-settings* 0) + (copy-squad-settings-to-idx this *war-kg-squad-member-settings* 1) + (copy-squad-settings-to-idx this *default-kg-squad-member-settings* 2) + (set! (-> this alert-level) 0) + (call-parent-method this) + (kg-squad-control-method-51 this) + (none) + ) + +(defmethod squad-control-method-10 ((this kg-squad-control)) + (set! (-> this active-squad-member-list length) 0) + (set! (-> this guard-to-traffic-mapping 6) (traffic-type roboguard)) + (set! (-> this guard-to-traffic-mapping 7) (traffic-type roboguard)) + (set! (-> this guard-to-traffic-mapping 8) (traffic-type flying-turret)) + (set! (-> this guard-to-traffic-mapping 9) (traffic-type spydroid)) + (logior! (-> this used-guard-types) (kg-squad-used-guard-types kg6)) + (logior! (-> this used-guard-types) (kg-squad-used-guard-types kg7)) + (logior! (-> this used-guard-types) (kg-squad-used-guard-types kg8)) + (logior! (-> this used-guard-types) (kg-squad-used-guard-types kg9)) + (set! (-> this guard-to-squad-setting-mapping 6) (the-as uint 0)) + (set! (-> this guard-to-squad-setting-mapping 7) (the-as uint 1)) + (set! (-> this guard-to-squad-setting-mapping 8) (the-as uint 2)) + (set! (-> this guard-to-squad-setting-mapping 9) (the-as uint 3)) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch handle-array vs none. +(defmethod initialize ((this kg-squad-control) (arg0 process)) + (set! (-> this active-squad-member-list) (new 'loading-level 'handle-array 126)) + (none) + ) + +(defmethod add-squad-member ((this kg-squad-control) (arg0 process)) + (push-back (-> this active-squad-member-list) (process->handle arg0)) + ) + +(defmethod pop-squad-member-from-list ((this kg-squad-control) (arg0 process)) + (let ((v1-2 (process->handle arg0))) + (dotimes (a1-4 (-> this active-squad-member-list length)) + (when (= (-> this active-squad-member-list data0 a1-4) v1-2) + (pop-front (-> this active-squad-member-list) a1-4) + (return 0) + ) + ) + ) + (the-as int #f) + ) + +(defmethod kg-squad-control-method-52 ((this kg-squad-control) (arg0 process) (arg1 process)) + (let ((v1-2 (process->handle arg1)) + (v0-0 0) + ) + (dotimes (a2-4 (-> this active-squad-member-list length)) + (let ((a3-3 (the-as kg-squad-member (handle->process (-> this active-squad-member-list data0 a2-4))))) + (if (and a3-3 (!= a3-3 arg0) (= (-> a3-3 current-enemy) v1-2)) + (+! v0-0 1) + ) + ) + ) + v0-0 + ) + ) + +(defmethod kg-squad-control-method-51 ((this kg-squad-control)) + (local-vars (a1-8 symbol)) + (dotimes (v1-0 3) + (dotimes (a1-0 10) + (when (logtest? (-> this used-guard-types) (ash 1 a1-0)) + (set! (-> this + traffic + object-type-info-array + 0 + target-counts + (+ v1-0 (* (-> this guard-to-traffic-mapping a1-0) 32)) + ) + 0 + ) + 0 + ) + ) + ) + (dotimes (v1-3 3) + (dotimes (a1-3 4) + (let ((a2-12 (the-as kg-squad-settings (+ (+ (* a1-3 16) 860 (* v1-3 64)) (the-as int this))))) + (+! (-> this + traffic + object-type-info-array + 0 + target-counts + (+ v1-3 (* (-> a2-12 roboguard-settings object-type) 32)) + ) + (max + (min (-> a2-12 roboguard-settings target-count) (-> a2-12 roboguard-settings max-target-count)) + (-> a2-12 roboguard-settings min-target-count) + ) + ) + ) + ) + ) + (dotimes (v1-6 3) + (let ((a1-6 (new 'static 'boxed-array :type int8 :length 0 :allocated-length 10)) + (a2-17 (new 'static 'boxed-array :type int8 :length 0 :allocated-length 10)) + ) + (dotimes (a3-10 10) + (set! (-> a1-6 a3-10) 0) + (set! (-> a2-17 a3-10) 0) + ) + (dotimes (a3-13 4) + (let ((t0-13 (the-as kg-squad-settings (+ (+ (* a3-13 16) 860 (* v1-6 64)) (the-as int this))))) + (set! (-> a2-17 (-> t0-13 roboguard-settings enemy-type)) + (max + (min (-> t0-13 roboguard-settings target-count) (-> t0-13 roboguard-settings max-target-count)) + (-> t0-13 roboguard-settings min-target-count) + ) + ) + ) + ) + (dotimes (a3-16 (-> this active-squad-member-list length)) + (let ((t0-19 (the-as kg-squad-member (handle->process (-> this active-squad-member-list data0 a3-16))))) + (when t0-19 + (if (= (-> t0-19 faction-mode) v1-6) + (+! (-> a1-6 (-> t0-19 kg-type)) 1) + ) + ) + ) + ) + (dotimes (a3-19 10) + (when (< (-> a1-6 a3-19) (-> a2-17 a3-19)) + (dotimes (t0-28 10) + (when (< (-> a2-17 t0-28) (-> a1-6 t0-28)) + (set! (-> this enemy-type-seek-from) (the-as uint t0-28)) + (set! (-> this enemy-type-seek-to) (the-as uint a3-19)) + (set! a1-8 #t) + (goto cfg-47) + ) + ) + ) + ) + ) + (set! a1-8 #f) + (label cfg-47) + (when (not a1-8) + (set! (-> this enemy-type-seek-from-list v1-6) (the-as uint 11)) + (set! (-> this enemy-type-seek-to-list v1-6) (the-as uint 11)) + ) + ) + #f + ) + +(defmethod update ((this kg-squad-control)) + (cond + ((-> *setting-control* user-current kg-enemy-settings) + (set! (-> this city-mode) (squad-city-mode two)) + (copy-squad-settings-to-idx + this + (the-as (inline-array kg-squad-member-settings) (-> *setting-control* user-current kg-enemy-settings)) + 0 + ) + ) + (else + (set! (-> this city-mode) (squad-city-mode zero)) + (copy-squad-settings-to-idx this *default-kg-squad-member-settings* 0) + ) + ) + (kg-squad-control-method-51 this) + (kg-squad-control-method-53 this) + (when *cty-faction-manager* + (let ((a2-2 (cond + ((-> *setting-control* user-current kg-enemy-settings) + 7 + ) + ((> (-> this alert-level) 0) + 7 + ) + (else + 3 + ) + ) + ) + ) + (faction-spawn *cty-faction-manager* 0 a2-2 #f (if (-> *setting-control* user-current kg-enemy-settings) + #t + ) + ) + ) + ) + (call-parent-method this) + (none) + ) + +(defmethod increment-alert-level ((this kg-squad-control) (arg0 int)) + (let ((v0-0 (+ (-> this alert-level) arg0))) + (set! (-> this alert-level) v0-0) + v0-0 + ) + ) + +(defmethod set-alert-level1 ((this kg-squad-control) (arg0 int)) + (set! (-> this alert-level) arg0) + arg0 + ) + +(defmethod kg-squad-control-method-53 ((this kg-squad-control)) + (cond + ((> (-> this alert-level) 0) + (if (not (-> *setting-control* user-current kg-enemy-settings)) + (copy-squad-settings-to-idx this *alert-kg-squad-member-settings* 0) + ) + ) + (else + (copy-squad-settings-to-idx this *default-kg-squad-member-settings* 0) + ) + ) + 0 + (none) + ) + +(defmethod get-alert-level1 ((this kg-squad-control)) + (-> this alert-level) + ) + +(defmethod squad-control-city-method-38 ((this kg-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (kg-squad-member-method-219 (the-as kg-squad-member arg0) arg1) + ) + +(defmethod squad-control-city-method-40 ((this kg-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (if (not (logtest? (process-mask kg-robot) (-> arg1 mask))) + (set! (-> this current-target-attackers) (kg-squad-control-method-52 this arg0 arg1)) + ) + (none) + ) + +(defmethod squad-control-city-method-41 ((this kg-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (not (logtest? (process-mask kg-robot) (-> arg1 mask))) + ) + +(defmethod squad-control-city-method-42 ((this kg-squad-control)) + (if (< 4 (-> this current-target-attackers)) + 100000.0 + (+ 1.0 (the float (-> this current-target-attackers))) + ) + ) + +(defmethod squad-control-city-method-43 ((this kg-squad-control) (arg0 process-focusable)) + (let ((v1-0 arg0)) + (time-elapsed? + (-> (the-as kg-squad-member v1-0) last-choose-new-enemy-time) + (-> (the-as kg-squad-member v1-0) choose-new-enemy-delay-time) + ) + ) + ) + +(defmethod squad-control-city-method-39 ((this kg-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (kg-squad-member-method-216 (the-as kg-squad-member arg0) arg1) + ) + +(defun set-kg-primary-target ((arg0 handle) (arg1 float)) + (when *kg-squad-control* + (let* ((s5-0 *kg-squad-control*) + (s4-0 (method-of-object s5-0 squad-control-method-27)) + (s3-0 (handle->process arg0)) + ) + (s4-0 + s5-0 + (if (type? s3-0 process-focusable) + s3-0 + ) + arg1 + ) + ) + ) + 0 + (none) + ) + +(defmethod kg-squad-control-method-54 ((this kg-squad-control)) + (-> *setting-control* user-current kg-difficulty) + ) diff --git a/goal_src/jak3/levels/city/common/kg-squad-member-h.gc b/goal_src/jak3/levels/city/common/kg-squad-member-h.gc index 1f8dd51d1e..8e0017c773 100644 --- a/goal_src/jak3/levels/city/common/kg-squad-member-h.gc +++ b/goal_src/jak3/levels/city/common/kg-squad-member-h.gc @@ -7,3 +7,30 @@ ;; DECOMP BEGINS +(deftype hatred-instance-info (structure) + ((hated-target handle) + (hatred-value float) + ) + :pack-me + ) + + +(deftype kg-squad-member (citizen) + ((squad kg-squad-control :override) + (hatred-memory hatred-instance-info 3 :inline) + (last-choose-new-enemy-time time-frame) + (current-enemy handle) + (kg-type uint8) + (choose-new-enemy-delay-time time-frame) + (next-update-target-time time-frame) + (minimap connection-minimap) + ) + (:methods + (kg-squad-member-method-216 (_type_ process) float) + (enemy->hatred-val (_type_ process) float) + (get-hatred-val-for-target (_type_ handle) float) + (kg-squad-member-method-219 (_type_ process-focusable) symbol) + (kg-squad-member-method-220 (_type_) symbol) + (get-current-enemy (_type_) process) + ) + ) diff --git a/goal_src/jak3/levels/city/common/kg-squad-member.gc b/goal_src/jak3/levels/city/common/kg-squad-member.gc index f34e675fde..b806cf3fe4 100644 --- a/goal_src/jak3/levels/city/common/kg-squad-member.gc +++ b/goal_src/jak3/levels/city/common/kg-squad-member.gc @@ -7,3 +7,247 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch symbol vs none. +(defmethod set-squad ((this kg-squad-member)) + (set! (-> this squad) *kg-squad-control*) + (set! (-> this minimap) #f) + (none) + ) + +(defmethod citizen-method-194 ((this kg-squad-member)) + (dotimes (v1-0 3) + (set! (-> this hatred-memory v1-0 hated-target) (the-as handle #f)) + (set! (-> this hatred-memory v1-0 hatred-value) 0.0) + ) + (set! (-> this last-choose-new-enemy-time) 0) + (set! (-> this choose-new-enemy-delay-time) (seconds 3)) + (set! (-> this current-enemy) (the-as handle #f)) + (logior! (-> this mask) (process-mask kg-robot)) + (set! (-> this next-update-target-time) 0) + (set! (-> this faction-mode) (the-as uint 0)) + (set! (-> this fact fade-time) (seconds 10)) + (logior! (-> this fact options) (actor-option fade-out no-distance-check-fadeout)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 139) (the-as int #f) (the-as vector #t) 0)) + ) + (call-parent-method this) + (none) + ) + +;; WARN: disable def twice: 6. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod get-current-enemy ((this kg-squad-member)) + (if #t + (handle->process (-> this attacker-info enemy)) + (squad-control-city-method-35 (-> this squad) this (-> this current-enemy)) + ) + ) + +(defmethod go-from-behavior ((this kg-squad-member) (arg0 traffic-object-spawn-params)) + (add-squad-member (-> this squad) this) + (call-parent-method this arg0) + (none) + ) + +(defmethod go-inactive ((this kg-squad-member)) + (pop-squad-member-from-list (-> this squad) this) + (call-parent-method this) + (none) + ) + +(defstate inactive (kg-squad-member) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((t9-0 (-> (method-of-type citizen inactive) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +(defmethod deactivate ((this kg-squad-member)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (pop-squad-member-from-list (-> this squad) this) + (call-parent-method this) + (none) + ) + +(defmethod enemy->hatred-val ((this kg-squad-member) (arg0 process)) + (cond + ((logtest? (process-mask guard) (-> arg0 mask)) + 0.5 + ) + ((logtest? (process-mask metalhead) (-> arg0 mask)) + -0.01 + ) + ((= (-> arg0 type) target) + 0.3 + ) + ((logtest? (process-mask civilian) (-> arg0 mask)) + 0.02 + ) + ((logtest? (process-mask kg-robot) (-> arg0 mask)) + -1.0 + ) + ((and (logtest? (process-mask vehicle) (-> arg0 mask)) (not (logtest? (process-mask enemy) (-> arg0 mask)))) + 0.01 + ) + (else + -1.0 + ) + ) + ) + +(defmethod get-hatred-val-for-target ((this kg-squad-member) (arg0 handle)) + (dotimes (v1-0 3) + (if (= arg0 (-> this hatred-memory v1-0 hated-target)) + (return (-> this hatred-memory v1-0 hatred-value)) + ) + ) + 0.0 + ) + +(defmethod kg-squad-member-method-216 ((this kg-squad-member) (arg0 process)) + (let ((f30-0 (enemy->hatred-val this arg0)) + (f0-0 (get-hatred-val-for-target this (process->handle arg0))) + ) + 0.0 + (+ f0-0 f30-0) + ) + ) + +(defmethod kg-squad-member-method-219 ((this kg-squad-member) (arg0 process-focusable)) + (let* ((s4-0 (get-trans arg0 0)) + (f0-0 (vector-vector-xz-distance-squared (-> this root trans) s4-0)) + (f1-0 409600.0) + ) + (or (and (< f0-0 (* f1-0 f1-0)) (< (fabs (- (-> s4-0 y) (-> this root trans y))) 61440.0)) + (< 0.0 (get-hatred-val-for-target this (process->handle arg0))) + ) + ) + ) + +(defmethod enemy-common-post ((this kg-squad-member)) + (local-vars (s5-0 int)) + (when (focus-test? this dangerous) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + ) + (cond + ((logtest? (-> this flags) (citizen-flag in-mission)) + (set! (-> this faction-mode) (the-as uint 2)) + ) + ((nonzero? (-> this controller branch)) + (let ((v1-15 (get-city-mode (-> this squad)))) + 0 + (cond + ((= v1-15 (squad-city-mode two)) + (set! s5-0 2) + ) + (else + (let ((v1-17 *cty-faction-manager*) + (a1-2 (-> this controller branch clock-type)) + ) + (set! s5-0 (-> v1-17 territory-faction-modes 0 data (+ 1 (* a1-2 16)))) + ) + ) + ) + ) + (when (!= (-> this faction-mode) s5-0) + (if (not (send-event this 'change-faction-mode s5-0 (-> this faction-mode))) + (set! (-> this faction-mode) (the-as uint s5-0)) + ) + ) + ) + ) + (call-parent-method this) + (none) + ) + +(defmethod send-attack-on-jump-or-knocked ((this kg-squad-member) (arg0 process) (arg1 event-message-block)) + (cond + (#f + ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-2 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask enemy guard civilian metalhead) (-> arg0 mask)) + (not (logtest? (process-mask kg-robot) (-> arg0 mask))) + (and v1-2 + (not (logtest? (-> (the-as process-focusable v1-2) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +(defmethod kg-squad-member-method-220 ((this kg-squad-member)) + (if (or (not (-> this draw)) (not (logtest? (-> this draw status) (draw-control-status on-screen)))) + (return #f) + ) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (math-camera-pos))) + (f1-0 122880.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (return #t) + ) + ) + #f + ) + +(defstate in-ditch (kg-squad-member) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + +(defstate die-fast (kg-squad-member) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) diff --git a/goal_src/jak3/levels/city/common/krimson-wall.gc b/goal_src/jak3/levels/city/common/krimson-wall.gc index ceec14fc12..18f928c4ce 100644 --- a/goal_src/jak3/levels/city/common/krimson-wall.gc +++ b/goal_src/jak3/levels/city/common/krimson-wall.gc @@ -7,3 +7,463 @@ ;; DECOMP BEGINS +(defpartgroup group-krimson-wall + :id 329 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 1419 :flags (is-3d sp7) :period (seconds 2) :length (seconds 0.035)) + (sp-item 1420 :fade-after (meters 40) :flags (is-3d sp7)) + ) + ) + +(defpart 1419 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 11)) + (:scale-x (meters 18)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-z (degrees 90)) + (:scale-y (meters 54)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 + 20 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1420 + :init-specs ((:texture (static1 level-default-sprite)) + (:num 1.0) + (:y (meters 11)) + (:scale-x (meters 18)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-z (degrees 90) 1 (degrees 180)) + (:scale-y (meters 180)) + (:r 255.0) + (:g 10.0) + (:b 10.0) + (:a 4.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defskelgroup skel-krimson-wall-break krimson-wall-break krimson-wall-break-lod0-jg krimson-wall-break-idle-ja + ((krimson-wall-break-lod0-mg (meters 999999))) + :bounds (static-spherem -40 0 0 400) + :origin-joint-index 3 + ) + +(deftype krimson-wall-break (process-drawable) + ((art-name string) + (anim spool-anim) + (pillar (pointer manipy) 2) + (level-name symbol) + ) + (:state-methods + idle + explode + done + ) + ) + + +(defstate idle (krimson-wall-break) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('break) + (go-virtual explode) + ) + ) + ) + :enter (behavior () + '() + ) + :trans (behavior () + (let* ((v1-0 (new 'stack-no-clear 'matrix)) + (a3-0 (-> self node-list data 2 bone transform)) + (a0-2 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-0 rvec quad) a0-2) + (set! (-> v1-0 uvec quad) a1-0) + (set! (-> v1-0 fvec quad) a2-0) + (set! (-> v1-0 trans quad) a3-1) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate explode (krimson-wall-break) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (not (time-elapsed? (-> self state-time) (seconds 0.5))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (+! (-> gp-0 z) (* 4096.0 (rand-vu-float-range -60.0 60.0))) + (+! (-> gp-0 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> gp-0 y) (* 4096.0 (rand-vu-float-range 0.0 25.0))) + (let ((v1-9 (rand-vu-int-count 2))) + (cond + ((zero? v1-9) + (cond + ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) + ) + ) + ) + ((= v1-9 1) + (cond + ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 218)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 218)) + ) + ) + ) + ) + ) + ) + ) + ) + :code (behavior () + (let* ((gp-0 (-> self draw art-group)) + (s5-0 (method-of-object gp-0 get-art-by-name-method)) + ) + (format (clear *temp-string*) "~S-end" (-> self art-name)) + (let ((gp-1 (s5-0 gp-0 *temp-string* art-joint-anim))) + (ja-play-spooled-anim + (-> self anim) + (ja-group) + ;; og:preserve-this + (the art-joint-anim gp-1) + (the-as (function process-drawable symbol) false-func) + (spooler-flags) + ) + (ja-channel-set! 1) + (set! (-> self skel root-channel 0 frame-group) (the art-joint-anim gp-1)) + ) + ) + (suspend) + (go-virtual done) + ) + :post ja-post + ) + +(defstate done (krimson-wall-break) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('done) + #t + ) + ) + ) + :code sleep-code + ) + +(defmethod init-from-entity! ((this krimson-wall-break) (arg0 entity-actor)) + (local-vars (sv-96 entity)) + (set! (-> this level) (level-get *level* (-> this level-name))) + (stack-size-set! (-> this main-thread) 512) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-krimson-wall-break" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this anim) + (new 'static 'spool-anim :name "krimson-wall-break-1" :anim-name "break" :parts 2 :command-list '()) + ) + (set! (-> this art-name) (res-lump-struct arg0 'art-name string)) + (let ((s4-1 (-> this root trans)) + (s5-1 (-> this root trans)) + ) + (let ((s2-0 (entity-actor-lookup arg0 'alt-actor 0)) + (v0-8 (entity-actor-lookup arg0 'alt-actor 1)) + ) + (if s2-0 + (set! s4-1 (-> s2-0 extra trans)) + ) + (if v0-8 + (set! s5-1 (-> v0-8 extra trans)) + ) + ) + (let ((s3-1 (get-process *default-dead-pool* manipy #x20000 1))) + (set! (-> this pillar 0) + (the-as + (pointer manipy) + (when s3-1 + (let ((t9-10 (method-of-type manipy activate))) + (t9-10 (the-as manipy s3-1) this "krimson-wall-break" (the-as pointer #x70004000)) + ) + (let ((s2-1 run-function-in-process) + (s1-0 s3-1) + (s0-0 manipy-init) + ) + (set! sv-96 (-> this level entity data 0 entity)) + (let ((t0-1 (art-group-get-by-name *level* "skel-krimson-wall-break" (the-as (pointer level) #f))) + (t1-1 #f) + (t2-1 0) + ) + ((the-as (function object object object object object object object none) s2-1) + s1-0 + s0-0 + s4-1 + sv-96 + t0-1 + t1-1 + t2-1 + ) + ) + ) + (-> s3-1 ppointer) + ) + ) + ) + ) + (send-event (ppointer->process (-> this pillar 0)) 'anim-mode 'clone-anim) + (send-event (ppointer->process (-> this pillar 0)) 'prefix "a-") + (set! (-> this pillar 1) + (process-spawn + manipy + :init manipy-init + s5-1 + (-> this level entity data 0 entity) + (art-group-get-by-name *level* "skel-krimson-wall-break" (the-as (pointer level) #f)) + #f + 0 + :name "krimson-wall-break" + :to this + :stack-size #x20000 + ) + ) + ) + (send-event (ppointer->process (-> this pillar 1)) 'anim-mode 'clone-anim) + (send-event (ppointer->process (-> this pillar 1)) 'prefix "b-") + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) (-> this anim name) -99.0 0) + (go (method-of-object this idle)) + ) + +(defbehavior krimson-wall-break-init-by-other krimson-wall-break ((arg0 entity-actor) (arg1 symbol)) + (set! (-> self level-name) arg1) + (init-from-entity! self arg0) + ) + +(defskelgroup skel-krimson-wall krimson-wall krimson-wall-lod0-jg krimson-wall-idle-ja + ((krimson-wall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 13 0 16) + ) + +(deftype krimson-wall (process-focusable) + ((alt-actor entity-actor 2) + (collision-part int32) + (width float) + ) + (:state-methods + idle + die + ) + (:methods + (krimson-wall-method-30 (_type_ symbol) none) + ) + ) + + +(defstate idle (krimson-wall) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('break) + (when (and (-> self alt-actor 0) (-> self alt-actor 1)) + (send-event (-> self alt-actor 0 extra process) 'kill) + (send-event (-> self alt-actor 1 extra process) 'kill) + (go-virtual die) + ) + ) + (('kill) + (go-virtual die) + ) + ) + ) + :trans (behavior () + (when (nonzero? (-> self collision-part)) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defstate die (krimson-wall) + :virtual #t + :code (behavior () + (suspend) + (cleanup-for-death self) + ) + ) + +(defmethod krimson-wall-method-30 ((this krimson-wall) (arg0 symbol)) + (cond + (arg0 + (let ((gp-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (let ((f30-0 (-> this width))) + (let ((t9-0 vector-matrix*!) + (a0-1 (-> gp-0 0)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 0.0) + (set! (-> a1-1 y) 0.0) + (set! (-> a1-1 z) f30-0) + (set! (-> a1-1 w) 1.0) + (t9-0 a0-1 a1-1 (-> this node-list data 2 bone transform)) + ) + (let ((t9-1 vector-matrix*!) + (a0-2 (-> gp-0 1)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) 0.0) + (set! (-> a1-2 y) 0.0) + (set! (-> a1-2 z) (- f30-0)) + (set! (-> a1-2 w) 1.0) + (t9-1 a0-2 a1-2 (-> this node-list data 2 bone transform)) + ) + ) + (if (nonzero? (-> this alt-actor 0)) + (set! (-> gp-0 0 quad) (-> this alt-actor 0 extra trans quad)) + ) + (if (nonzero? (-> this alt-actor 1)) + (set! (-> gp-0 1 quad) (-> this alt-actor 1 extra trans quad)) + ) + (spawn-security-wall this (-> gp-0 0) (-> gp-0 1) 77824.0 #f) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 1) (-> gp-0 0)))) + (vector-normalize! s4-1 40960.0) + (vector+float*! (-> gp-0 0) (-> gp-0 0) s4-1 -1.0) + (vector+float*! (-> gp-0 1) (-> gp-0 1) s4-1 1.0) + ) + (+! (-> gp-0 0 y) 61440.0) + (+! (-> gp-0 1 y) 61440.0) + (spawn-security-wall this (-> gp-0 0) (-> gp-0 1) 102400.0 #t) + ) + ) + (else + (let ((gp-1 (-> this child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'off) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this krimson-wall) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable no-standon)) + (set-vector! (-> s3-0 local-sphere) 0.0 53248.0 0.0 65536.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 53248.0 0.0 65536.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-11 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this entity) arg0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-krimson-wall" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (transform-post) + (set! (-> this collision-part) (res-lump-value arg0 'extra-id int :time -1000000000.0)) + (set! (-> this width) (res-lump-float arg0 'dist :default 81920.0)) + (set! (-> this alt-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this alt-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) + (format #t "collision part ~D~%" (-> this collision-part)) + (if (nonzero? (-> this collision-part)) + (krimson-wall-method-30 this #t) + ) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/city/common/mh-squad-control.gc b/goal_src/jak3/levels/city/common/mh-squad-control.gc index cc820b555e..9191975336 100644 --- a/goal_src/jak3/levels/city/common/mh-squad-control.gc +++ b/goal_src/jak3/levels/city/common/mh-squad-control.gc @@ -7,3 +7,180 @@ ;; DECOMP BEGINS +(define *default-mh-squad-member-settings* + (new 'static 'inline-array kg-squad-member-settings 3 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-grunt) + :max-target-count #x7f + :target-count 4 + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-flitter) + :max-target-count #x7f + :target-count 3 + ) + (new 'static 'kg-squad-member-settings :object-type (traffic-type metalhead-predator) :max-target-count #x7f) + ) + ) + +(define *war-mh-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 3 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-grunt) + :max-target-count #x7f + :target-count 5 + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-flitter) + :max-target-count #x7f + :target-count 5 + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-predator) + :max-target-count #x7f + :target-count 2 + ) + ) + ) + +;; WARN: Return type mismatch pointer vs none. +(defmethod copy-squad-settings-to-idx ((this mh-squad-control) (arg0 (inline-array mh-squad-member-settings)) (arg1 int)) + (mem-copy! (the-as pointer (-> this squad-settings (the-as uint arg1))) (the-as pointer arg0) 48) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init-alert ((this mh-squad-control)) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) *default-mh-squad-member-settings*) + 0 + ) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) *war-mh-squad-member-settings*) + 1 + ) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) *default-mh-squad-member-settings*) + 2 + ) + (set! (-> this alert-level) 0) + (call-parent-method this) + (mh-squad-control-method-48 this) + (none) + ) + +(defmethod squad-control-method-10 ((this mh-squad-control)) + (set! (-> this active-squad-member-list length) 0) + (dotimes (v1-1 29) + (set! (-> this map-traffic-object-type-to-squad v1-1) (traffic-type invalid0)) + ) + (set! (-> this map-traffic-object-type-to-squad 8) (traffic-type civilian-male)) + (set! (-> this map-traffic-object-type-to-squad 9) (traffic-type civilian-female)) + (set! (-> this map-traffic-object-type-to-squad 10) (traffic-type civilian-fat)) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch handle-array vs none. +(defmethod initialize ((this mh-squad-control) (arg0 process)) + (set! (-> this active-squad-member-list) (new 'loading-level 'handle-array 126)) + (none) + ) + +(defmethod add-squad-member ((this mh-squad-control) (arg0 process)) + (push-back (-> this active-squad-member-list) (process->handle arg0)) + ) + +(defmethod pop-squad-member-from-list ((this mh-squad-control) (arg0 process)) + (let ((v1-2 (process->handle arg0))) + (dotimes (a1-4 (-> this active-squad-member-list length)) + (when (= (-> this active-squad-member-list data0 a1-4) v1-2) + (pop-front (-> this active-squad-member-list) a1-4) + (return 0) + ) + ) + ) + (the-as int #f) + ) + +(defmethod mh-squad-control-method-48 ((this mh-squad-control)) + (dotimes (v1-0 3) + (dotimes (a1-0 3) + (let ((a3-2 (the-as mh-squad-settings (+ (+ (* a1-0 16) 828 (* 48 v1-0)) (the-as int this))))) + (set! (-> this traffic object-type-info-array 0 target-counts (+ v1-0 (* (-> a3-2 grunt-settings object-type) 32))) + (max + (min (-> a3-2 grunt-settings target-count) (-> a3-2 grunt-settings max-target-count)) + (-> a3-2 grunt-settings min-target-count) + ) + ) + ) + ) + ) + #f + ) + +(defmethod update ((this mh-squad-control)) + (cond + ((-> *setting-control* user-current mh-enemy-settings) + (set! (-> this city-mode) (squad-city-mode two)) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) (-> *setting-control* user-current mh-enemy-settings)) + 0 + ) + ) + (else + (set! (-> this city-mode) (squad-city-mode zero)) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) *default-mh-squad-member-settings*) + 0 + ) + ) + ) + (when *cty-faction-manager* + (let ((a2-2 (if (-> *setting-control* user-current mh-enemy-settings) + 7 + 3 + ) + ) + ) + (faction-spawn *cty-faction-manager* 1 a2-2 #f (if (-> *setting-control* user-current mh-enemy-settings) + #t + ) + ) + ) + ) + (mh-squad-control-method-48 this) + (call-parent-method this) + (none) + ) + +(defmethod squad-control-city-method-41 ((this mh-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (not (logtest? (process-mask metalhead) (-> arg1 mask))) + ) + +(defmethod squad-control-city-method-39 ((this mh-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (get-hatred-val-for-proc (the-as mh-squad-member arg0) arg1) + ) + +(defun set-mh-primary-target ((arg0 handle) (arg1 float)) + (when *mh-squad-control* + (let* ((s5-0 *mh-squad-control*) + (s4-0 (method-of-object s5-0 squad-control-method-27)) + (s3-0 (handle->process arg0)) + ) + (s4-0 + s5-0 + (if (type? s3-0 process-focusable) + s3-0 + ) + arg1 + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/common/mh-squad-member-h.gc b/goal_src/jak3/levels/city/common/mh-squad-member-h.gc index d4fc3fe9fc..48f47d27b4 100644 --- a/goal_src/jak3/levels/city/common/mh-squad-member-h.gc +++ b/goal_src/jak3/levels/city/common/mh-squad-member-h.gc @@ -7,3 +7,17 @@ ;; DECOMP BEGINS +(deftype mh-squad-member (citizen-enemy) + ((squad mh-squad-control :override) + (last-choose-new-enemy-time time-frame) + (current-enemy handle) + (choose-new-enemy-delay-time time-frame) + (next-update-target-time time-frame) + ) + (:methods + (get-hatred-val-for-proc (_type_ process) float) + (pfoc-in-range? (_type_ process-focusable) symbol) + (enemy->hatred-val (_type_ process) float) + (get-current-enemy (_type_) process) + ) + ) diff --git a/goal_src/jak3/levels/city/common/mh-squad-member.gc b/goal_src/jak3/levels/city/common/mh-squad-member.gc index 9c65e4b31e..4428e34d96 100644 --- a/goal_src/jak3/levels/city/common/mh-squad-member.gc +++ b/goal_src/jak3/levels/city/common/mh-squad-member.gc @@ -7,3 +7,283 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch mh-squad-control vs none. +(defmethod set-squad ((this mh-squad-member)) + (set! (-> this squad) *mh-squad-control*) + (none) + ) + +(defmethod citizen-method-194 ((this mh-squad-member)) + (set! (-> this last-choose-new-enemy-time) 0) + (set! (-> this choose-new-enemy-delay-time) (seconds 3)) + (set! (-> this current-enemy) (the-as handle #f)) + (set! (-> this mask) (the-as process-mask (logior (process-mask metalhead) (-> this mask)))) + (set! (-> this faction-mode) (the-as uint 0)) + (set! (-> this next-update-target-time) 0) + (set! (-> this fact pickup-type) (pickup-type eco-pill-dark)) + (if (zero? (mod (the-as int (rand-uint31-gen *random-generator*)) 11)) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + ) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this fact fade-time) (seconds 10)) + (call-parent-method this) + (none) + ) + +(defmethod go-from-behavior ((this mh-squad-member) (arg0 traffic-object-spawn-params)) + (add-squad-member (-> this squad) this) + (call-parent-method this arg0) + (none) + ) + +(defmethod go-inactive ((this mh-squad-member)) + (pop-squad-member-from-list (-> this squad) this) + (call-parent-method this) + (none) + ) + +(defmethod deactivate ((this mh-squad-member)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (pop-squad-member-from-list (-> this squad) this) + (call-parent-method this) + (none) + ) + +(defmethod enemy->hatred-val ((this mh-squad-member) (arg0 process)) + (cond + ((logtest? (process-mask metalhead) (-> arg0 mask)) + -1.0 + ) + ((logtest? (process-mask guard) (-> arg0 mask)) + 0.5 + ) + ((= (-> arg0 type) target) + 0.49 + ) + ((logtest? (process-mask civilian) (-> arg0 mask)) + 0.2 + ) + ((logtest? (process-mask kg-robot) (-> arg0 mask)) + -0.01 + ) + ((and (logtest? (process-mask vehicle) (-> arg0 mask)) (not (logtest? (process-mask enemy) (-> arg0 mask)))) + 0.01 + ) + (else + -1.0 + ) + ) + ) + +(defmethod get-hatred-val-for-proc ((this mh-squad-member) (arg0 process)) + (let ((f1-0 (enemy->hatred-val this arg0))) + 0.0 + f1-0 + ) + ) + +(defmethod pfoc-in-range? ((this mh-squad-member) (arg0 process-focusable)) + (let* ((s5-0 (get-trans arg0 0)) + (f0-0 (vector-vector-xz-distance-squared (-> this root trans) s5-0)) + (f1-0 245760.0) + ) + (and (< f0-0 (* f1-0 f1-0)) (< (fabs (- (-> s5-0 y) (-> this root trans y))) 61440.0)) + ) + ) + +(defmethod enemy-common-post ((this mh-squad-member)) + (local-vars (s5-0 int)) + (when (focus-test? this dangerous) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + ) + (cond + ((logtest? (-> this flags) (citizen-flag in-mission)) + (set! (-> this faction-mode) (the-as uint 2)) + ) + ((nonzero? (-> this controller branch)) + (let ((v1-15 (get-city-mode (-> this squad)))) + 0 + (cond + ((= v1-15 (squad-city-mode two)) + (set! s5-0 2) + ) + (else + (let ((v1-17 *cty-faction-manager*) + (a1-2 (-> this controller branch clock-type)) + ) + (set! s5-0 (-> v1-17 territory-faction-modes 0 data (+ 1 (* a1-2 16)))) + ) + ) + ) + ) + (when (!= (-> this faction-mode) s5-0) + (if (not (send-event this 'change-faction-mode s5-0 (-> this faction-mode))) + (set! (-> this faction-mode) (the-as uint s5-0)) + ) + ) + ) + ) + (find-new-focus this) + ((method-of-type citizen enemy-common-post) this) + (none) + ) + +(defmethod send-attack-on-jump-or-knocked ((this mh-squad-member) (arg0 process) (arg1 event-message-block)) + (cond + (#f + ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-2 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask enemy guard civilian kg-robot) (-> arg0 mask)) + (not (logtest? (process-mask metalhead) (-> arg0 mask))) + (and v1-2 + (not (logtest? (-> (the-as process-focusable v1-2) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +;; WARN: disable def twice: 6. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod get-current-enemy ((this mh-squad-member)) + (if #t + (handle->process (-> this attacker-info enemy)) + (squad-control-city-method-35 (-> this squad) this (-> this current-enemy)) + ) + ) + +;; WARN: disable def twice: 120. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod find-new-focus ((this mh-squad-member)) + (local-vars (v0-6 object)) + (when (not (handle->process (-> this current-enemy))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + (let ((a0-6 (get-current-enemy this))) + (if a0-6 + (set! (-> this current-enemy) (process->handle a0-6)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 3))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (let* ((s5-0 (handle->process (-> this current-enemy))) + (a0-18 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and a0-18 + (not (logtest? (-> (the-as process-focusable a0-18) focus-status) (focus-status disable dead inactive))) + ) + (let* ((s5-1 this) + (s4-0 (method-of-object s5-1 enemy-method-70)) + (s3-0 (handle->process (-> this current-enemy))) + ) + (s4-0 + s5-1 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus this) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (f1-0 266240.0) + ) + (cond + ((< f0-0 (* f1-0 f1-0)) + (when (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (set! v0-6 (logior (-> this flags) (citizen-flag persistent))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + (else + (set! v0-6 (logclear (-> this flags) (citizen-flag persistent))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + ) + ) + (else + (set! (-> this focus handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent)) + (if (and (-> this next-state) (= (-> this next-state name) 'hostile)) + (go (method-of-object this active)) + ) + ) + ) + ) + ) + +(defstate active (mh-squad-member) + :virtual #t + :trans (behavior () + (when (handle->process (-> self current-enemy)) + (let* ((gp-0 (handle->process (-> self current-enemy))) + (v1-7 (if (type? gp-0 process-focusable) + (the-as process-focusable gp-0) + ) + ) + ) + (if (not (or (focus-test? v1-7 inactive) (focus-test? v1-7 disable))) + (go-virtual hostile) + ) + ) + ) + (let ((t9-3 (-> (find-parent-state) trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) diff --git a/goal_src/jak3/levels/city/common/nav-graph-h.gc b/goal_src/jak3/levels/city/common/nav-graph-h.gc index 66da253b34..0aeb2a7aa9 100644 --- a/goal_src/jak3/levels/city/common/nav-graph-h.gc +++ b/goal_src/jak3/levels/city/common/nav-graph-h.gc @@ -80,21 +80,21 @@ (max-user-count uint8) (user-count uint8) (width uint8) - (flags uint8) + (flags nav-branch-flags) ) (:methods - (nav-branch-method-9 () none) - (nav-branch-method-10 () none) + (set-default-density-speed-and-width (_type_) none) + (debug-print (_type_ object int) none) (get-density (_type_) float) (get-speed-limit (_type_) float) (get-width (_type_) float) (user-limit-reached? (_type_) symbol) (dest-node-id-at-max? (_type_) symbol) - (nav-branch-method-16 () none) - (nav-branch-method-17 () none) - (nav-branch-method-18 () none) - (nav-branch-method-19 () none) - (nav-branch-method-20 () none) + (set-density (_type_ float) none) + (set-speed-limit (_type_ float) none) + (set-width (_type_ float) none) + (set-src-node (_type_ nav-node) none) + (set-dst-node (_type_ nav-node) none) ) ) @@ -116,15 +116,15 @@ (level symbol :overlay-at (-> data 7)) ) (:methods - (nav-node-method-9 () none) - (nav-node-method-10 () none) - (nav-node-method-11 () none) - (nav-node-method-12 () none) - (nav-node-method-13 () none) - (nav-node-method-14 () none) - (nav-node-method-15 () none) - (nav-node-method-16 () none) - (nav-node-method-17 () none) + (debug-draw (_type_) none) + (debug-print (_type_ symbol string) none) + (remove-branch-by-idx (_type_ int) none) + (init-from-pt-and-heading (_type_ vector vector) none) + (set-pos-xyz (_type_ vector) none) + (set-angle-from-heading (_type_ vector) none) + (set-id-and-link-branches-back (_type_ uint) none) + (set-radius (_type_ float) none) + (set-angle (_type_ float) none) (get-position (_type_ vector) vector) (calc-sine-and-cosine! (_type_ vector) vector) (get-angle (_type_) float) @@ -202,43 +202,43 @@ (pad1 uint32 6) ) (:methods - (new (symbol type) _type_) - (nav-graph-method-9 () none) - (nav-graph-method-10 () none) - (nav-graph-method-11 () none) - (nav-graph-method-12 () none) - (nav-graph-method-13 () none) - (nav-graph-method-14 () none) - (nav-graph-method-15 () none) - (nav-graph-method-16 () none) - (nav-graph-method-17 () none) - (nav-graph-method-18 () none) - (nav-graph-method-19 () none) - (nav-graph-method-20 () none) - (nav-graph-method-21 () none) - (nav-graph-method-22 () none) - (nav-graph-method-23 () none) - (nav-graph-method-24 () none) - (nav-graph-method-25 () none) - (nav-graph-method-26 () none) - (nav-graph-method-27 () none) - (nav-graph-method-28 () none) - (nav-graph-method-29 () none) - (nav-graph-method-30 () none) - (nav-graph-method-31 () none) - (nav-graph-method-32 () none) - (nav-graph-method-33 () none) - (nav-graph-method-34 () none) - (nav-graph-method-35 () none) - (nav-graph-method-36 () none) - (nav-graph-method-37 () none) - (nav-graph-method-38 () none) - (nav-graph-method-39 () none) - (nav-graph-method-40 () none) + (new (symbol type int int int uint) _type_) + (debug-draw-nodes (_type_) none) + (find-nearest-nav-node (_type_ vector symbol) nav-node) + (print-nav-graph (_type_) none) + (set-first-node (_type_) none) + (nav-graph-method-13 (_type_ int int) none) + (nav-graph-method-14 (_type_ int int) none) + (reset! (_type_) none) + (add-node (_type_ int) nav-node) + (link-node-to-graph (_type_ nav-node) none) + (reset-branch-array (_type_ nav-node int) none) + (nav-graph-method-19 (_type_ int int int int int int) none) + (nav-graph-method-20 (_type_ int int) none) + (move-selected-to-height-map-height (_type_) none) + (select-nodes-in-range (_type_ int int) none) + (deselect-nodes-in-range (_type_ int int) none) + (toggle-select-nodes-in-range (_type_ int int) none) + (select-nodes-in-level (_type_ symbol symbol) none) + (select-nodes-by-nav-mesh-id (_type_ int symbol) none) + (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none) + (print-selected-nodes (_type_) none) + (assign-selected-nodes-to-level (_type_ symbol) none) + (assign-selected-nodes-to-nav-mesh (_type_ uint) none) + (set-radius-of-selected-nodes (_type_ float) none) + (set-speed-limit-of-selected (_type_ float) none) + (set-density-of-selected (_type_ float) none) + (set-width-of-selected (_type_ float) none) + (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) + (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) + (offset-pos-of-selected (_type_ vector) none) + (nav-graph-method-38 (_type_) none) + (nav-graph-method-39 (_type_) none) + (nav-graph-method-40 (_type_ int) int) (node-at-idx (_type_ int) nav-node) - (nav-graph-method-42 () none) - (nav-graph-method-43 () none) - (nav-graph-method-44 () none) + (patch-nodes (_type_) none) + (copy-to-mysql-graph (_type_ mysql-nav-graph string) none) + (from-editor (_type_ mysql-nav-graph symbol) none) ) ) diff --git a/goal_src/jak3/levels/city/common/nav-graph.gc b/goal_src/jak3/levels/city/common/nav-graph.gc index 3a37136a1f..f6d00abd1a 100644 --- a/goal_src/jak3/levels/city/common/nav-graph.gc +++ b/goal_src/jak3/levels/city/common/nav-graph.gc @@ -7,3 +7,1355 @@ ;; DECOMP BEGINS +(defmethod set-density ((this nav-branch) (arg0 float)) + (set! (-> this density) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 128.0 arg0))))))) + 0 + (none) + ) + +(defmethod set-speed-limit ((this nav-branch) (arg0 float)) + (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + 0 + (none) + ) + +(defmethod set-width ((this nav-branch) (arg0 float)) + (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) + 0 + (none) + ) + +(defmethod set-src-node ((this nav-branch) (arg0 nav-node)) + (set! (-> this src-node) arg0) + 0 + (none) + ) + +(defmethod set-dst-node ((this nav-branch) (arg0 nav-node)) + (set! (-> this dest-node) arg0) + 0 + (none) + ) + +(defmethod set-default-density-speed-and-width ((this nav-branch)) + (set-density this 0.25) + (set-speed-limit this 61440.0) + (set-width this 16384.0) + 0 + (none) + ) + +(defmethod debug-draw ((this nav-node)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'sphere)) + ) + (let ((a1-0 this) + (v1-0 gp-0) + ) + (set! (-> v1-0 quad) (-> a1-0 position quad)) + (set! (-> v1-0 w) 1.0) + ) + (set! (-> s4-0 quad) (-> gp-0 quad)) + (let ((v1-2 this)) + (set! (-> s4-0 r) (* 1024.0 (the float (-> v1-2 radius)))) + ) + (when (logtest? (-> this flags) (nav-node-flag-byte selected)) + (let ((v1-8 (new 'stack-no-clear 'inline-array 'vector 2))) + (let ((a1-3 (-> v1-8 0))) + (let ((a0-6 gp-0)) + (let ((a2-1 -8192.0)) + (.mov vf6 a2-1) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-3 quad) vf5) + ) + (let ((a1-4 (-> v1-8 1))) + (let ((a0-7 gp-0)) + (let ((a2-3 8192.0)) + (.mov vf6 a2-3) + ) + (.lvf vf4 (&-> a0-7 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-4 quad) vf5) + ) + (add-debug-box #t (bucket-id debug) (-> v1-8 0) (-> v1-8 1) *color-yellow*) + ) + ) + (when (and (not (logtest? (-> this flags) (nav-node-flag-byte hidden))) + (let ((f0-6 (vector-vector-distance-squared gp-0 (camera-pos))) + (f1-2 327680.0) + ) + (and (< f0-6 (* f1-2 f1-2)) (sphere-in-view-frustum? s4-0)) + ) + ) + (add-debug-x #t (bucket-id debug) gp-0 *color-red*) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 583) + ) + (format (clear *temp-string*) "~D ~D" (-> this id) (-> this nav-mesh-id)) + (s4-1 + s3-1 + (the-as bucket-id s2-1) + *temp-string* + gp-0 + (if (logtest? (-> this flags) (nav-node-flag-byte blocked)) + (font-color red) + (font-color cyan) + ) + (the-as vector2h #f) + ) + ) + (let ((s4-2 add-debug-vector) + (s3-2 #t) + (s2-2 583) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (let ((f0-8 (the float (-> this angle))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (sincos! s5-1 f0-8) + (set! (-> s1-1 x) (-> s5-1 y)) + (set! (-> s1-1 y) 0.0) + (set! (-> s1-1 z) (- (-> s5-1 x))) + ) + (set! (-> s1-1 w) 1.0) + (s4-2 s3-2 (the-as bucket-id s2-2) gp-0 s1-1 (meters 2) *color-green*) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod debug-print ((this nav-branch) (arg0 object) (arg1 int)) + (format arg0 "~S~T~T~T (new-nav-branch :dest-node-id ~d~%" arg1 (-> this dest-node id)) + (let ((t9-1 format) + (a0-2 arg0) + (a1-2 "~S~T~T~T~T~T :density ~4,,3f~%") + (a2-2 arg1) + (v1-1 this) + ) + (t9-1 a0-2 a1-2 a2-2 (* 0.0078125 (the float (-> v1-1 density)))) + ) + (let ((t9-2 format) + (a0-3 arg0) + (a1-3 "~S~T~T~T~T~T :width ~4,,3M~%") + (a2-3 arg1) + (v1-3 this) + ) + (t9-2 a0-3 a1-3 a2-3 (* 256.0 (the float (-> v1-3 width)))) + ) + (let ((t9-3 format) + (a0-4 arg0) + (a1-4 "~S~T~T~T~T~T :speed-limit ~4,,3M~%") + (a2-4 arg1) + (v1-5 this) + ) + (t9-3 a0-4 a1-4 a2-4 (* 1024.0 (the float (-> v1-5 speed-limit)))) + ) + (when (nonzero? (-> this clock-type)) + (let ((t9-4 format) + (a0-5 arg0) + (a1-5 "~S~T~T~T~T~T :clock-type ~S~%") + (a2-5 arg1) + (v1-9 (-> this clock-type)) + ) + (t9-4 a0-5 a1-5 a2-5 (cond + ((= v1-9 (nav-branch-clock-type clock3)) + "clock3" + ) + ((= v1-9 (nav-branch-clock-type no-clock)) + "no-clock" + ) + ((= v1-9 (nav-branch-clock-type clock2)) + "clock2" + ) + ((= v1-9 (nav-branch-clock-type clock4)) + "clock4" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format arg0 "~S~T~T~T~T~T :clock-mask (" arg1) + (let ((s4-1 (-> this clock-mask))) + (if (= (logand s4-1 (nav-branch-clock-mask phase-1a)) (nav-branch-clock-mask phase-1a)) + (format arg0 "phase-1a ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-2a)) (nav-branch-clock-mask phase-2a)) + (format arg0 "phase-2a ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-1)) (nav-branch-clock-mask phase-1)) + (format arg0 "phase-1 ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-3a)) (nav-branch-clock-mask phase-3a)) + (format arg0 "phase-3a ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-2)) (nav-branch-clock-mask phase-2)) + (format arg0 "phase-2 ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-4a)) (nav-branch-clock-mask phase-4a)) + (format arg0 "phase-4a ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-3)) (nav-branch-clock-mask phase-3)) + (format arg0 "phase-3 ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-4)) (nav-branch-clock-mask phase-4)) + (format arg0 "phase-4 ") + ) + ) + (format arg0 ")~%") + ) + (format arg0 "~S~T~T~T~T~T )~%" arg1) + 0 + (none) + ) + +(defmethod debug-print ((this nav-node) (arg0 symbol) (arg1 string)) + (format arg0 "~S (new-nav-node :id ~d~%" arg1 (-> this id)) + (format arg0 "~S~T :branch-list (~%" arg1) + (dotimes (s3-0 (-> this branch-count)) + (debug-print (-> this branch-array s3-0) arg0 (the-as int arg1)) + ) + (format arg0 "~S~T~T~T )~%" arg1) + (let* ((v1-6 (-> this flags)) + (s3-1 (logclear v1-6 (nav-node-flag-byte visited blocked))) + ) + (when (nonzero? s3-1) + (format arg0 "~S~T :flags (" arg1) + (if (= (logand s3-1 (nav-node-flag-byte blocked)) (nav-node-flag-byte blocked)) + (format arg0 "blocked ") + ) + (if (= (logand s3-1 (nav-node-flag-byte selected)) (nav-node-flag-byte selected)) + (format arg0 "selected ") + ) + (if (= (logand s3-1 (nav-node-flag-byte pedestrian)) (nav-node-flag-byte pedestrian)) + (format arg0 "pedestrian ") + ) + (if (= (logand s3-1 (nav-node-flag-byte visited)) (nav-node-flag-byte visited)) + (format arg0 "visited ") + ) + (if (= (logand s3-1 (nav-node-flag-byte hidden)) (nav-node-flag-byte hidden)) + (format arg0 "hidden ") + ) + (format arg0 ")~%") + ) + ) + (let ((v1-24 (new 'stack-no-clear 'vector))) + (let ((a2-6 this) + (a0-19 v1-24) + ) + (set! (-> a0-19 quad) (-> a2-6 position quad)) + (set! (-> a0-19 w) 1.0) + ) + (format arg0 "~S~T :position (~4,,2M ~4,,2M ~4,,2M)~%" arg1 (-> v1-24 x) (-> v1-24 y) (-> v1-24 z)) + ) + (format arg0 "~S~T :angle ~4,,3f~%" arg1 (* 0.005493164 (the float (-> this angle)))) + (let ((t9-13 format) + (a0-22 arg0) + (a1-16 "~S~T :radius ~4,,2M~%") + (a2-11 arg1) + (v1-30 this) + ) + (t9-13 a0-22 a1-16 a2-11 (* 1024.0 (the float (-> v1-30 radius)))) + ) + (if (nonzero? (-> this nav-mesh-id)) + (format arg0 "~S~T :nav-mesh-id ~d~%" arg1 (-> this nav-mesh-id)) + ) + (if (-> this level) + (format arg0 "~S~T :level ~s~%" arg1 (-> this level)) + ) + (format arg0 "~S~T )~%" arg1) + 0 + (none) + ) + +(defmethod set-pos-xyz ((this nav-node) (arg0 vector)) + (let ((f0-0 (-> this position w))) + (set! (-> this position quad) (-> arg0 quad)) + (set! (-> this position w) f0-0) + ) + 0 + (none) + ) + +(defmethod set-angle-from-heading ((this nav-node) (arg0 vector)) + (set! (-> this angle) (the-as uint (the int (atan (- (-> arg0 z)) (-> arg0 x))))) + 0 + (none) + ) + +(defmethod set-radius ((this nav-node) (arg0 float)) + (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + 0 + (none) + ) + +(defmethod set-angle ((this nav-node) (arg0 float)) + (set! (-> this angle) (the-as uint (the int (+ 0.5 arg0)))) + 0 + (none) + ) + +(defmethod set-id-and-link-branches-back ((this nav-node) (arg0 uint)) + (set! (-> this id) arg0) + (dotimes (v1-0 (-> this branch-count)) + (set! (-> this branch-array v1-0 src-node) this) + ) + 0 + (none) + ) + +(defmethod init-from-pt-and-heading ((this nav-node) (arg0 vector) (arg1 vector)) + (set-pos-xyz this arg0) + (set-angle-from-heading this arg1) + (set! (-> this flags) (nav-node-flag-byte pedestrian selected)) + (set-radius this 32768.0) + (set! (-> this level) 'ctyport) + (set! (-> this nav-mesh-id) (the-as uint 0)) + (dotimes (s5-1 (-> this branch-count)) + (set-default-density-speed-and-width (-> this branch-array s5-1)) + ) + 0 + (none) + ) + +(defmethod remove-branch-by-idx ((this nav-node) (arg0 int)) + (when (and (>= arg0 0) (< arg0 (-> this branch-count))) + (let ((s5-0 (+ arg0 1)) + (s4-0 arg0) + ) + (while (< s5-0 (-> this branch-count)) + (mem-copy! (the-as pointer (-> this branch-array s4-0)) (the-as pointer (-> this branch-array s5-0)) 16) + (+! s5-0 1) + (+! s4-0 1) + ) + ) + (+! (-> this branch-count) -1) + ) + 0 + (none) + ) + +(defmethod reset-branch-array ((this nav-graph) (arg0 nav-node) (arg1 int)) + (set! (-> arg0 branch-array) (the-as (inline-array nav-branch) (-> this branch-array (-> this branch-count)))) + (set! (-> arg0 branch-count) arg1) + (+! (-> this branch-count) arg1) + (dotimes (s4-0 arg1) + (let ((s3-0 (-> arg0 branch-array s4-0))) + (set-default-density-speed-and-width s3-0) + (set! (-> s3-0 src-node) arg0) + (set! (-> s3-0 dest-node) #f) + ) + ) + 0 + (none) + ) + +(defmethod add-node ((this nav-graph) (arg0 int)) + (let ((s4-0 (the-as nav-node #f))) + (let ((s5-0 (-> this node-count)) + (v1-1 (+ arg0 -1 (-> this branch-count))) + ) + (when (and (< s5-0 2000) (< v1-1 2500)) + (set! s4-0 (-> this node-array s5-0)) + (reset-branch-array this s4-0 arg0) + (set-id-and-link-branches-back s4-0 (the-as uint s5-0)) + (+! (-> this node-count) 1) + ) + ) + s4-0 + ) + ) + +(defmethod link-node-to-graph ((this nav-graph) (arg0 nav-node)) + (when (> (-> arg0 branch-count) 0) + (let ((a0-1 (-> arg0 branch-array 0)) + (t9-0 (method-of-type nav-branch set-dst-node)) + (a2-0 this) + (v1-4 (-> this first-node)) + (a1-1 (the-as nav-node #f)) + ) + (if (and (>= v1-4 0) (< v1-4 (-> a2-0 node-count))) + (set! a1-1 (-> a2-0 node-array v1-4)) + ) + (t9-0 a0-1 a1-1) + ) + (let ((v1-9 (+ (-> arg0 id) -1))) + (when (>= v1-9 (the-as uint (-> this first-node))) + (let ((v1-11 (-> this node-array v1-9))) + (set! (-> v1-11 branch-count) 1) + (set-dst-node (-> v1-11 branch-array 0) arg0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod nav-graph-method-13 ((this nav-graph) (arg0 int) (arg1 int)) + (when (and (< arg0 (-> this node-count)) (> arg1 0)) + (let ((s4-1 (min arg1 (- (-> this node-count) arg0)))) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) + (dotimes (s1-0 (-> s2-0 branch-count)) + (let ((v1-9 (nav-graph-method-40 this (the-as int (-> s2-0 branch-array s1-0 dest-node))))) + (when (and (>= v1-9 arg0) (< v1-9 (+ arg0 s4-1))) + (let ((v1-11 (-> this node-array v1-9))) + (cond + ((= (-> v1-11 branch-count) 1) + (let ((v1-14 (-> v1-11 branch-array 0 dest-node id))) + (if (or (< v1-14 (the-as uint arg0)) (>= v1-14 (the-as uint (+ arg0 s4-1)))) + (set-dst-node (-> s2-0 branch-array s1-0) (-> this node-array v1-14)) + (remove-branch-by-idx s2-0 s1-0) + ) + ) + ) + (else + (remove-branch-by-idx s2-0 s1-0) + ) + ) + ) + ) + ) + ) + ) + ) + (dotimes (s3-1 (-> this node-count)) + (let ((s2-1 (-> this node-array s3-1))) + (dotimes (s1-1 (-> s2-1 branch-count)) + (let ((v1-28 (nav-graph-method-40 this (the-as int (-> s2-1 branch-array s1-1 dest-node))))) + (if (>= v1-28 (+ arg0 s4-1)) + (set-dst-node (-> s2-1 branch-array s1-1) (-> this node-array (- v1-28 s4-1))) + ) + ) + ) + ) + ) + (let ((s3-2 arg0) + (s2-2 (-> this node-array (+ arg0 s4-1))) + (s1-2 (-> this node-array arg0)) + ) + (countdown (s0-0 (- (-> this node-count) (+ arg0 s4-1))) + (mem-copy! (the-as pointer s1-2) (the-as pointer s2-2) 32) + (set-id-and-link-branches-back s1-2 (the-as uint s3-2)) + (&+! s2-2 32) + (&+! s1-2 32) + (+! s3-2 1) + ) + ) + (set! (-> this node-count) (- (-> this node-count) s4-1)) + (if (< arg0 (-> this first-node)) + (set! (-> this first-node) (- (-> this first-node) s4-1)) + ) + ) + ) + 0 + (none) + ) + +(defmethod nav-graph-method-14 ((this nav-graph) (arg0 int) (arg1 int)) + (when (and (< arg0 (-> this node-count)) (> arg1 0)) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) + (dotimes (s1-0 (-> s2-0 branch-count)) + (let ((v1-7 (nav-graph-method-40 this (the-as int (-> s2-0 branch-array s1-0 dest-node))))) + (if (< arg0 v1-7) + (set-dst-node (-> s2-0 branch-array s1-0) (-> this node-array (+ v1-7 arg1))) + ) + ) + ) + ) + ) + (let* ((s3-1 (+ arg1 -1 (-> this node-count))) + (s2-1 (-> this node-array (- s3-1 arg1))) + (s1-1 (-> this node-array s3-1)) + ) + (countdown (s0-0 (- (-> this node-count) arg0)) + (mem-copy! (the-as pointer s1-1) (the-as pointer s2-1) 32) + (set-id-and-link-branches-back s1-1 (the-as uint s3-1)) + ;; og:preserve-this + (&+! s2-1 -32) + (&+! s1-1 -32) + (+! s3-1 -1) + ) + ) + (+! (-> this node-count) arg1) + (+! (-> this first-node) arg1) + (let ((s3-2 (-> this node-array arg0)) + (s2-2 (-> this node-array arg0)) + ) + (dotimes (s1-2 arg1) + (mem-copy! (the-as pointer s2-2) (the-as pointer s3-2) 32) + (set-id-and-link-branches-back s2-2 (the-as uint arg0)) + (+! (-> s2-2 position y) (* 8192.0 (the float (+ s1-2 1)))) + (reset-branch-array this s2-2 1) + (set-dst-node (-> s2-2 branch-array 0) (-> this node-array (+ arg0 1))) + (&+! s2-2 32) + (+! arg0 1) + ) + ) + ) + 0 + (none) + ) + +(defmethod reset! ((this nav-graph)) + (set! (-> this node-count) 0) + (set! (-> this branch-count) 0) + (set! (-> this first-node) 0) + (set! (-> this patched) #f) + 0 + (none) + ) + +(defmethod set-first-node ((this nav-graph)) + (set! (-> this first-node) (-> this node-count)) + 0 + (none) + ) + +(defmethod print-selected-nodes ((this nav-graph)) + (let ((s4-0 0) + (s1-0 0) + (v1-0 #f) + (s3-0 0) + (gp-0 0) + ) + (dotimes (s2-0 (-> this node-count)) + (let* ((a0-2 (-> this node-array s2-0)) + (s0-1 (logtest? (-> a0-2 flags) (nav-node-flag-byte selected))) + ) + (when s0-1 + (+! gp-0 1) + (if (not v1-0) + (set! s4-0 s2-0) + ) + (set! s1-0 s2-0) + ) + (set! v1-0 (and (not s0-1) v1-0)) + (when (or v1-0 (and s0-1 (= s2-0 (+ (-> this node-count) -1)))) + (if (> s3-0 0) + (format #t ", ") + ) + (if (= s4-0 s1-0) + (format #t "~d" s4-0) + (format #t "~d-~d" s4-0 s1-0) + ) + (+! s3-0 1) + ) + (set! v1-0 s0-1) + ) + ) + (format #t "~%") + (format #t "~d nodes selected~%" gp-0) + ) + 0 + (none) + ) + +(defmethod select-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) + (a2-3 arg0) + ) + (+ (- 1 arg0) v1-3) + (while (>= v1-3 a2-3) + (let ((a1-4 (-> this node-array a2-3))) + (logior! (-> a1-4 flags) (nav-node-flag-byte selected)) + ) + (+! a2-3 1) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +(defmethod deselect-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) + (a2-3 arg0) + ) + (+ (- 1 arg0) v1-3) + (while (>= v1-3 a2-3) + (let ((a1-4 (-> this node-array a2-3))) + (logclear! (-> a1-4 flags) (nav-node-flag-byte selected)) + ) + (+! a2-3 1) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +(defmethod toggle-select-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) + (a2-3 arg0) + ) + (+ (- 1 arg0) v1-3) + (while (>= v1-3 a2-3) + (let ((a1-4 (-> this node-array a2-3))) + (logxor! (-> a1-4 flags) (nav-node-flag-byte selected)) + ) + (+! a2-3 1) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +(defmethod select-nodes-in-level ((this nav-graph) (arg0 symbol) (arg1 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((a3-1 (-> this node-array v1-0)) + (t0-2 (= (-> a3-1 level) arg0)) + ) + (case arg1 + (('set) + (logclear! (-> a3-1 flags) (nav-node-flag-byte selected)) + (if t0-2 + (logior! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('and) + (if (not t0-2) + (logclear! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('or) + (if t0-2 + (logior! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +(defmethod select-nodes-by-nav-mesh-id ((this nav-graph) (arg0 int) (arg1 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((a3-1 (-> this node-array v1-0)) + (t0-2 (= (-> a3-1 nav-mesh-id) arg0)) + ) + (case arg1 + (('set) + (logclear! (-> a3-1 flags) (nav-node-flag-byte selected)) + (if t0-2 + (logior! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('and) + (if (not t0-2) + (logclear! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('or) + (if t0-2 + (logior! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +(defmethod select-nodes-by-flags ((this nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((t0-1 (-> this node-array v1-0)) + (t1-3 (= (logand (-> t0-1 flags) arg1) arg0)) + ) + (case arg2 + (('set) + (logclear! (-> t0-1 flags) (nav-node-flag-byte selected)) + (if t1-3 + (logior! (-> t0-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('and) + (if (not t1-3) + (logclear! (-> t0-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('or) + (if t1-3 + (logior! (-> t0-1 flags) (nav-node-flag-byte selected)) + ) + ) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +(defmethod assign-selected-nodes-to-level ((this nav-graph) (arg0 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) + (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) + (set! (-> a2-1 level) arg0) + ) + ) + ) + 0 + (none) + ) + +(defmethod assign-selected-nodes-to-nav-mesh ((this nav-graph) (arg0 uint)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) + (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) + (set! (-> a2-1 nav-mesh-id) arg0) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-radius-of-selected-nodes ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((a0-2 (-> this node-array s4-0))) + (if (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) + (set-radius a0-2 arg0) + ) + ) + ) + 0 + (none) + ) + +(defmethod or-flags-of-selected-nodes ((this nav-graph) (arg0 nav-node-flag-byte)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) + (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) + (logior! (-> a2-1 flags) arg0) + ) + ) + ) + 0 + (none) + ) + +(defmethod and-flags-of-selected-nodes ((this nav-graph) (arg0 nav-node-flag-byte)) + (let ((v1-0 (lognot arg0))) + (dotimes (a1-1 (-> this node-count)) + (let ((a2-1 (-> this node-array a1-1))) + (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) + (logand! (-> a2-1 flags) v1-0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-speed-limit-of-selected ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) + (dotimes (s2-0 (-> s3-0 branch-count)) + (set-speed-limit (-> s3-0 branch-array s2-0) arg0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-density-of-selected ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) + (dotimes (s2-0 (-> s3-0 branch-count)) + (set-density (-> s3-0 branch-array s2-0) arg0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-width-of-selected ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) + (dotimes (s2-0 (-> s3-0 branch-count)) + (set-width (-> s3-0 branch-array s2-0) arg0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod offset-pos-of-selected ((this nav-graph) (arg0 vector)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (dotimes (s3-0 (-> this node-count)) + (let ((a0-2 (-> this node-array s3-0))) + (when (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) + (let ((a2-0 a0-2) + (v1-4 s4-0) + ) + (set! (-> v1-4 quad) (-> a2-0 position quad)) + (set! (-> v1-4 w) 1.0) + ) + (vector+! s4-0 s4-0 arg0) + (set-pos-xyz a0-2 s4-0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod nav-graph-method-38 ((this nav-graph)) + (let ((s5-0 (new 'stack-no-clear 'vehicle-controller)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) + (when (and (logtest? (-> s2-0 flags) (nav-node-flag-byte selected)) (= (-> s2-0 branch-count) 1)) + (let ((a1-0 (-> s2-0 branch-array 0))) + (-> a1-0 dest-node) + (vehicle-controller-method-13 s5-0 a1-0 (-> s2-0 position)) + ) + (vehicle-controller-method-11 s5-0) + (vector-! s4-0 (-> s5-0 target-point) (-> s2-0 position)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (set-angle-from-heading s2-0 s4-0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod debug-draw-nodes ((this nav-graph)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (when (not (logtest? (-> s3-0 flags) (nav-node-flag-byte hidden))) + (debug-draw s3-0) + (let ((a1-0 s3-0) + (v1-6 (-> s5-0 rvec)) + ) + (set! (-> v1-6 quad) (-> a1-0 position quad)) + (set! (-> v1-6 w) 1.0) + ) + (dotimes (s2-0 (-> s3-0 branch-count)) + (let ((v1-9 (-> s3-0 branch-array s2-0 dest-node))) + (when v1-9 + (let ((a2-0 v1-9) + (a0-7 (-> s5-0 uvec)) + ) + (set! (-> a0-7 quad) (-> a2-0 position quad)) + (set! (-> a0-7 w) 1.0) + ) + (vector-! (-> s5-0 fvec) (-> s5-0 uvec) (-> s5-0 rvec)) + (let* ((f0-2 (vector-length (-> s5-0 fvec))) + (f1-2 (fmax (* 0.75 f0-2) (+ -8192.0 f0-2))) + ) + (vector-float*! (-> s5-0 fvec) (-> s5-0 fvec) (/ f1-2 f0-2)) + ) + (vector+! (-> s5-0 trans) (-> s5-0 rvec) (-> s5-0 fvec)) + (add-debug-line + #t + (bucket-id debug) + (-> s5-0 rvec) + (-> s5-0 trans) + (cond + ((= (-> v1-9 id) #xffff) + *color-dark-blue* + ) + ((logtest? (-> s3-0 flags) (nav-node-flag-byte pedestrian)) + *color-dark-red* + ) + (else + *color-dark-green* + ) + ) + #f + *color-white* + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod find-nearest-nav-node ((this nav-graph) (arg0 vector) (arg1 symbol)) + (let ((gp-0 (the-as nav-node #f))) + (let* ((f0-0 409600000.0) + (f30-0 (* f0-0 f0-0)) + ) + (dotimes (s2-0 (-> this node-count)) + (let ((s1-0 (-> this node-array s2-0)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (when (and (not (logtest? (-> s1-0 flags) (nav-node-flag-byte hidden))) + (or (not arg1) (and arg1 (logtest? (-> s1-0 flags) (nav-node-flag-byte selected)))) + ) + (let ((a2-1 s1-0) + (v1-8 a1-1) + ) + (set! (-> v1-8 quad) (-> a2-1 position quad)) + (set! (-> v1-8 w) 1.0) + ) + (let ((f0-3 (vector-vector-distance-squared arg0 a1-1))) + (when (< f0-3 f30-0) + (set! gp-0 s1-0) + (set! f30-0 f0-3) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + +(defmethod move-selected-to-height-map-height ((this nav-graph)) + (dotimes (s5-0 (-> this node-count)) + (let ((s4-0 (-> this node-array s5-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (when (and (not (logtest? (-> s4-0 flags) (nav-node-flag-byte hidden))) + (not (logtest? (-> s4-0 flags) (nav-node-flag-byte pedestrian))) + (logtest? (-> s4-0 flags) (nav-node-flag-byte selected)) + ) + (let ((a1-0 s4-0) + (v1-8 s3-0) + ) + (set! (-> v1-8 quad) (-> a1-0 position quad)) + (set! (-> v1-8 w) 1.0) + ) + (let ((a1-3 s3-0)) + (set! (-> s3-0 y) (get-height-at-point *traffic-height-map* a1-3)) + ) + (set-pos-xyz s4-0 s3-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod nav-graph-method-39 ((this nav-graph)) + (local-vars (sv-80 entity-nav-mesh) (sv-96 entity-nav-mesh)) + (dotimes (s5-0 (-> this node-count)) + (let ((s4-0 (-> this node-array s5-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((a1-0 s4-0) + (v1-1 s3-0) + ) + (set! (-> v1-1 quad) (-> a1-0 position quad)) + (set! (-> v1-1 w) 1.0) + ) + (when (logtest? (-> s4-0 flags) (nav-node-flag-byte pedestrian)) + (dotimes (s2-0 (-> *level* length)) + (let ((v1-8 (-> *level* level s2-0))) + (when (= (-> v1-8 status) 'active) + (let ((s1-0 (-> v1-8 bsp nav-meshes))) + (when (nonzero? s1-0) + (dotimes (s0-0 (-> s1-0 length)) + (set! sv-80 (-> s1-0 s0-0)) + (-> sv-80 aid) + (set! sv-96 sv-80) + (let ((v1-16 (if (type? sv-96 entity-nav-mesh) + sv-96 + ) + ) + ) + (when v1-16 + (let ((a0-10 (-> v1-16 nav-mesh)) + (a1-5 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-5 vertex)) s3-0 (the-as vector (-> a0-10 bounds))) + (set! (-> a1-5 vertex1 x) 40960.0) + (set! (-> a1-5 data 20) (the-as uint 2)) + (if (nav-mesh-method-45 a0-10 a1-5) + (set! (-> s4-0 nav-mesh-id) (-> sv-80 aid)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod nav-graph-method-19 ((this nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) + (let ((gp-0 (-> this node-array arg0)) + (s0-0 (-> this node-array arg1)) + (s4-0 (-> this node-array arg2)) + (s2-0 (-> this node-array arg3)) + (s1-0 (-> this node-array arg4)) + (s3-0 (-> this node-array arg5)) + ) + (reset-branch-array this s0-0 2) + (set-dst-node (-> s0-0 branch-array 0) s4-0) + (set-dst-node (-> s0-0 branch-array 1) s1-0) + (reset-branch-array this s2-0 2) + (set-dst-node (-> s2-0 branch-array 0) s1-0) + (set-dst-node (-> s2-0 branch-array 1) gp-0) + (reset-branch-array this s3-0 2) + (set-dst-node (-> s3-0 branch-array 0) gp-0) + (set-dst-node (-> s3-0 branch-array 1) s4-0) + ) + (none) + ) + +(defmethod nav-graph-method-40 ((this nav-graph) (arg0 int)) + -1 + (shr (- arg0 (the-as int (-> this node-array 0))) 5) + ) + +(defmethod nav-graph-method-20 ((this nav-graph) (arg0 int) (arg1 int)) + (let ((gp-0 (-> this node-array arg0)) + (s5-0 (-> this node-array arg1)) + ) + (reset-branch-array this gp-0 1) + (set-dst-node (-> gp-0 branch-array 0) s5-0) + ) + (none) + ) + +(defmethod print-nav-graph ((this nav-graph)) + (format #t "(define *traffic-nav-graph*~%") + (format #t " (new-nav-graph~%") + (format #t " :node-list (~%") + (dotimes (s5-0 (-> this node-count)) + (let ((a0-5 (-> this node-array s5-0))) + (set! (-> a0-5 id) (the-as uint s5-0)) + (debug-print a0-5 #t " ") + ) + ) + (format #t "~T~T )~%") + (format #t " )~%") + (format #t " )~%") + 0 + (none) + ) + +(defmethod patch-nodes ((this nav-graph)) + (when (not (-> this patched)) + (set! (-> this patched) #t) + (let ((s5-0 0)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (dotimes (s2-0 (-> s3-0 branch-count)) + (let ((s1-0 (-> s3-0 branch-array s2-0))) + (+! s5-0 1) + (set-src-node s1-0 s3-0) + (let ((v1-7 (the-as object (-> s1-0 dest-node)))) + (set-dst-node s1-0 (-> this node-array (the-as uint v1-7))) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Function (method 43 nav-graph) has a return type of none, but the expression builder found a return statement. +(defmethod copy-to-mysql-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 string)) + (set! (-> arg0 node-array length) 0) + (set! (-> arg0 edge-array length) 0) + (set! (-> arg0 visnode-array length) 0) + (set! (-> arg0 graph-type) (the-as basic (mysql-nav-graph-method-21 arg0))) + (let ((s3-0 (clear *temp-string*))) + (format s3-0 "select nav_graph_id from nav_graph where name='~S'" arg1) + (let ((a2-2 (sql-query s3-0))) + (when (!= (-> a2-2 content-type) 'select) + (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 this) + (return #f) + ) + (set! (-> arg0 nav_graph_id) (the-as uint (string->int (the-as string (-> a2-2 sql-data 0))))) + ) + ) + (dotimes (v1-9 (-> this node-count)) + (let ((a1-7 (-> arg0 node-array data (-> arg0 node-array length))) + (a0-12 (-> this node-array v1-9)) + ) + (logior! (-> a1-7 mysql-save-flag) (mysql-save-flag insert)) + (set! (-> a1-7 runtime-id) (-> a0-12 id)) + (set! (-> a1-7 nav_graph_id) (-> arg0 nav_graph_id)) + (let ((t0-0 a0-12) + (a2-8 (-> a1-7 position)) + ) + (set! (-> a2-8 quad) (-> t0-0 position quad)) + (set! (-> a2-8 w) 1.0) + ) + (set! (-> a1-7 level_name) (-> a0-12 level)) + (set! (-> a1-7 angle) (the float (-> a0-12 angle))) + (let ((a2-13 a0-12)) + (set! (-> a1-7 radius) (* 1024.0 (the float (-> a2-13 radius)))) + ) + (set! (-> a1-7 nav_node_flag) (the-as nav-node-flag (-> a0-12 flags))) + (set! (-> a1-7 nav_mesh_id) (-> a0-12 nav-mesh-id)) + (+! (-> arg0 node-array length) 1) + (dotimes (a1-11 (-> a0-12 branch-count)) + (let ((a2-22 (-> arg0 edge-array data (-> arg0 edge-array length))) + (a3-8 (-> a0-12 branch-array a1-11)) + ) + (logior! (-> a2-22 mysql-save-flag) (mysql-save-flag insert)) + (set! (-> a2-22 nav_graph_id) (-> arg0 nav_graph_id)) + (set! (-> a2-22 runtime-id) (the-as uint (-> arg0 edge-array length))) + (set! (-> a2-22 runtime-node-id-1) (the-as int (-> a0-12 id))) + (set! (-> a2-22 runtime-node-id-2) (the-as int (-> a3-8 dest-node id))) + (set! (-> a2-22 directionality) (nav-directionality default)) + (let ((t0-12 a3-8)) + (set! (-> a2-22 speed_limit) (* 1024.0 (the float (-> t0-12 speed-limit)))) + ) + (let ((t0-15 a3-8)) + (set! (-> a2-22 density) (* 0.0078125 (the float (-> t0-15 density)))) + ) + (set! (-> a2-22 nav_clock_mask) (the-as nav-clock-mask (-> a3-8 clock-mask))) + (set! (-> a2-22 nav_clock_type) (the-as nav-clock-type (-> a3-8 clock-type))) + (set! (-> a2-22 width) (* 256.0 (the float (-> a3-8 width)))) + ) + (+! (-> arg0 edge-array length) 1) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs nav-graph. +(defmethod new nav-graph ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int) (arg2 int) (arg3 uint)) + (let ((s1-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as nav-graph s1-0)) + (set! s1-0 0) + (goto cfg-4) + ) + (set! (-> (the-as nav-graph s1-0) node-count) arg0) + (set! (-> (the-as nav-graph s1-0) branch-count) arg1) + (set! (-> (the-as nav-graph s1-0) link-count) arg2) + (set! (-> (the-as nav-graph s1-0) node-array) + (the-as (inline-array nav-node) (malloc allocation (* arg0 32))) + ) + (set! (-> (the-as nav-graph s1-0) branch-array) + (the-as (inline-array nav-branch) (malloc allocation (* arg1 16))) + ) + (set! (-> (the-as nav-graph s1-0) link-array) + (the-as (inline-array nav-graph-link) (malloc allocation (* 48 arg2))) + ) + (set! (-> (the-as nav-graph s1-0) first-node) 0) + (set! (-> (the-as nav-graph s1-0) patched) #f) + (set! (-> (the-as nav-graph s1-0) id) arg3) + (label cfg-4) + (the-as nav-graph s1-0) + ) + ) + +(defmethod from-editor ((this nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) + (local-vars + (sv-16 int) + (sv-32 int) + (sv-48 mysql-nav-node) + (sv-64 nav-branch) + (sv-80 nav-graph-link) + (sv-96 nav-node) + (sv-112 int) + ) + (set! (-> this node-count) 0) + (set! (-> this branch-count) 0) + (set! (-> this link-count) 0) + (mysql-nav-graph-method-20 arg0) + (let ((s5-0 0)) + (let ((s2-0 0)) + (b! #t cfg-34 :delay (nop!)) + (label cfg-1) + (let ((s0-0 (-> arg0 node-array data s2-0))) + (b! + (not (and (or (= arg1 #f) (= arg1 (-> s0-0 level_name))) + (not (logtest? (-> s0-0 mysql-save-flag) (mysql-save-flag delete))) + ) + ) + cfg-27 + :delay (nop!) + ) + (set! sv-16 (temp-edge-size s0-0)) + (let ((s1-0 (add-node this sv-16))) + (b! (not s1-0) cfg-36 :delay (nop!)) + (set! (-> s1-0 id) (the-as uint (if arg1 + (-> s0-0 level-node-index) + s2-0 + ) + ) + ) + (set! (-> s1-0 flags) (the-as nav-node-flag-byte (-> s0-0 nav_node_flag))) + (set-pos-xyz s1-0 (-> s0-0 position)) + (set-angle s1-0 (-> s0-0 angle)) + (set-radius s1-0 (-> s0-0 radius)) + (set! (-> s1-0 level) (-> s0-0 level_name)) + (set! (-> s1-0 nav-mesh-id) (-> s0-0 nav_mesh_id)) + (when (!= (-> this branch-array s5-0) (-> s1-0 branch-array 0)) + (format 0 "nav-graph::from-editor: ERROR something went awry in allocate-branches~%") + (break!) + 0 + ) + (let ((s0-1 (the-as object (-> s0-0 temp-edge-list)))) + (set! sv-32 sv-16) + (while (nonzero? sv-32) + (set! sv-32 (+ sv-32 -1)) + (set! sv-64 (-> this branch-array s5-0)) + (set-src-node sv-64 s1-0) + (set-speed-limit sv-64 (-> (the-as mysql-nav-edge s0-1) speed_limit)) + (set-density sv-64 (-> (the-as mysql-nav-edge s0-1) density)) + (set-width sv-64 (-> (the-as mysql-nav-edge s0-1) width)) + (set! (-> sv-64 clock-type) (the-as nav-branch-clock-type (-> (the-as mysql-nav-edge s0-1) nav_clock_type))) + (set! (-> sv-64 clock-mask) (the-as nav-branch-clock-mask (-> (the-as mysql-nav-edge s0-1) nav_clock_mask))) + (set! sv-48 (-> arg0 node-array data (-> (the-as mysql-nav-edge s0-1) runtime-node-id-2))) + (cond + ((or (= arg1 #f) (= arg1 (-> sv-48 level_name))) + (let ((t9-11 (method-of-type nav-branch set-dst-node)) + (a1-11 (-> this node-array (if arg1 + (-> sv-48 level-node-index) + (-> (the-as mysql-nav-edge s0-1) runtime-node-id-2) + ) + ) + ) + ) + (t9-11 sv-64 a1-11) + ) + ) + (else + (set-dst-node sv-64 (the-as nav-node #f)) + (set! sv-112 (-> this link-count)) + (set! sv-80 (-> this link-array sv-112)) + (set! (-> sv-80 dest-graph-id) (-> (lookup-level-info2 arg0 sv-48 #f) level-id)) + (set! (-> sv-80 src-branch-id) (the-as uint s5-0)) + (set! (-> sv-80 dest-node-id) (the-as uint (-> sv-48 level-node-index))) + (set! (-> sv-80 dest-graph) #f) + (set! sv-96 (-> sv-80 dummy-node)) + (set! (-> sv-96 id) (the-as uint #xffff)) + (set! (-> sv-96 flags) (the-as nav-node-flag-byte (-> sv-48 nav_node_flag))) + (set-pos-xyz sv-96 (-> sv-48 position)) + (set-angle sv-96 (-> sv-48 angle)) + (set-radius sv-96 (-> sv-48 radius)) + (set! (-> sv-96 level) (-> sv-48 level_name)) + (set! (-> sv-96 nav-mesh-id) (-> sv-48 nav_mesh_id)) + (set-dst-node sv-64 (-> sv-80 dummy-node)) + (format #t "outputting link ~d~%" sv-112) + (+! (-> this link-count) 1) + ) + ) + (+! s5-0 1) + (set! s0-1 (-> (the-as mysql-nav-edge s0-1) temp-next-edge)) + ) + ) + ) + (b! #t cfg-33 :delay (nop!)) + (label cfg-27) + (let ((v1-78 (the-as object (-> s0-0 temp-edge-list)))) + (while v1-78 + (when (= arg1 (-> arg0 node-array data (-> (the-as mysql-nav-edge v1-78) runtime-node-id-2) level_name)) + ) + (set! v1-78 (-> (the-as mysql-nav-edge v1-78) temp-next-edge)) + ) + ) + ) + (label cfg-33) + (+! s2-0 1) + (label cfg-34) + (b! (< s2-0 (-> arg0 node-array length)) cfg-1) + ) + (format #t "branch-count ~d~%" s5-0) + ) + (set! (-> this patched) #t) + (label cfg-36) + 0 + (none) + ) + +(defun make-nav-graph ((arg0 mysql-nav-graph) (arg1 symbol)) + (mysql-nav-graph-method-20 arg0) + (let ((s4-0 (the-as nav-graph #f))) + (let ((v1-2 (the-as mysql-nav-graph-level-info #f))) + (dotimes (a0-2 (-> arg0 level-info-array-length)) + (let ((a1-3 (-> arg0 level-info-array a0-2))) + (if (= (-> a1-3 level) arg1) + (set! v1-2 a1-3) + ) + ) + ) + (when v1-2 + (set! s4-0 + (new 'debug 'nav-graph (-> v1-2 node-count) (-> v1-2 branch-count) (-> v1-2 to-link-count) (-> v1-2 level-id)) + ) + (if s4-0 + (from-editor s4-0 arg0 arg1) + ) + ) + ) + s4-0 + ) + ) + +(defmethod dest-node-id-at-max? ((this nav-branch)) + (with-pp + (and (!= (-> this dest-node id) #xffff) + (or (not *cty-faction-manager*) + (logtest? (cty-faction-manager-method-9 *cty-faction-manager* (the-as int (-> this clock-type)) (-> pp level name)) + 1 + ) + ) + ) + ) + ) diff --git a/goal_src/jak3/levels/city/common/searchlight.gc b/goal_src/jak3/levels/city/common/searchlight.gc index dcdfd4294d..3807453be5 100644 --- a/goal_src/jak3/levels/city/common/searchlight.gc +++ b/goal_src/jak3/levels/city/common/searchlight.gc @@ -7,3 +7,93 @@ ;; DECOMP BEGINS +(deftype searchlight (process-drawable) + ((sync sync-eased :inline) + ) + (:state-methods + idle + ) + ) + + +(defskelgroup skel-searchlight searchlight searchlight-lod0-jg searchlight-idle-ja + ((searchlight-lod0-mg (meters 999999))) + :bounds (static-spherem 0 60 0 120) + :origin-joint-index 3 + ) + +(defstate idle (searchlight) + :virtual #t + :code (behavior () + (until #f + (let ((gp-1 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (new 'static 'vector :z 1.0 :w 1.0) + (+ -4004.9778 (* 8192.0 (get-norm! (-> self sync) 0))) + ) + ) + (s5-2 (quaternion-axis-angle! + (new 'stack-no-clear 'quaternion) + 0.0 + 1.0 + 0.0 + (vector-y-angle (-> (math-camera-matrix) fvec)) + ) + ) + ) + (let ((f0-3 (calc-fade-from-fog (-> self root trans)))) + (set-vector! (-> self draw color-emissive) f0-3 f0-3 f0-3 1.0) + ) + (quaternion-normalize! (quaternion*! (-> self root quat) s5-2 gp-1)) + ) + (when (rand-vu-percent? 0.05) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'hour) + (let ((v1-13 (send-event-function (ppointer->process *time-of-day*) a1-4))) + (if (and v1-13 (>= (the-as int v1-13) 7) (>= 18 (the-as int v1-13))) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + ) + ) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this searchlight) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-searchlight" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set! (-> this root scale y) (rand-vu-float-range 1.8 2.0)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) + (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-12 0)) + (if #t + (set! v1-12 (logior v1-12 1)) + ) + (set! (-> s4-1 sync-type) 'sync-eased) + (set! (-> s4-1 sync-flags) (the-as sync-flags v1-12)) + ) + (set! (-> s4-1 period) (the-as uint (rand-vu-int-range 3000 6000))) + (set! (-> s4-1 entity) arg0) + (set! (-> s4-1 percent) 0.0) + (set! (-> s4-1 ease-in) 0.15) + (set! (-> s4-1 ease-out) 0.15) + (set! (-> s4-1 pause-in) 0.0) + (set! (-> s4-1 pause-out) 0.0) + (initialize! (-> this sync) s4-1) + ) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/city/ctyport-obs.gc b/goal_src/jak3/levels/city/ctyport-obs.gc index 9057cfb1cc..f7230eee59 100644 --- a/goal_src/jak3/levels/city/ctyport-obs.gc +++ b/goal_src/jak3/levels/city/ctyport-obs.gc @@ -7,3 +7,873 @@ ;; DECOMP BEGINS +(deftype boat-manager (process) + ((mesh nav-mesh) + (paths path-control 4) + (boats-stop? symbol) + ) + (:state-methods + idle + ) + (:methods + (boat-manager-method-15 (_type_) none) + (boat-manager-method-16 (_type_) symbol) + ) + ) + + +(define *barge-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 100.0 + :inv-mass 0.01 + :linear-damping 0.9 + :angular-damping 0.9 + :bounce-factor 0.1 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 8192.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 16) (meters 6) (meters 20)) + ) + :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 '*barge-constants* + :flags #x8 + :object-type (traffic-type vehicle-task) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 1.0 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 1274.3112 + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 1.0 + :tire-static-friction 0.5 + :tire-static-friction-speed (meters 1) + :tire-dynamic-friction 0.25 + :tire-dynamic-friction-speed (meters 3) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 0.5 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 182.04445 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.05 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :thruster-flame-width (meters 0.25) + :thruster-flame-length (meters 4) + :thruster-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :exhaust-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :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 :w 1.0) (new 'static 'vector :w 1.0)) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 2000.0 + :inv-hit-points 0.0005 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :z 22118.4 :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :rider-stance #x1 + :grab-rail-array #f + :rider-hand-offset (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(deftype boat-base (vehicle) + ((manager handle) + (angle float) + (y-rot float) + (path-num uint32) + (path-index float) + ) + ) + + +(defmethod apply-damage ((this boat-base) (arg0 float) (arg1 rigid-body-impact)) + 0 + (none) + ) + +(defmethod attack-handler ((this boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + #f + ) + +(defmethod vehicle-method-103 ((this boat-base)) + (local-vars (v1-8 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (time-elapsed? (-> this disturbed-time) (seconds 2)) + (let* ((f0-0 (-> this camera-dist2)) + (f1-0 0.000024414063) + (f0-1 (* f0-0 (* f1-0 f1-0))) + ) + (.lvf vf1 (&-> (-> this rbody ang-velocity) 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-8 vf1) + (when (< v1-8 f0-1) + (logclear! (-> this v-flags) (vehicle-flag disturbed)) + (vehicle-method-142 this) + ) + ) + ) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod rigid-body-object-method-30 ((this boat-base)) + (local-vars (v1-42 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (rider-trans) + (let ((t9-1 (method-of-type vehicle rigid-body-object-method-30))) + (t9-1 this) + ) + (let ((s5-0 (-> this root))) + (pull-riders! s5-0) + (cond + ((logtest? (do-push-aways s5-0) (collide-spec jak)) + (+! (-> this overlap-player-counter) 1) + (when (< (the-as uint 60) (-> this overlap-player-counter)) + (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1000.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'smush)) + ) + ) + (set! (-> this overlap-player-counter) (the-as uint 0)) + 0 + ) + ) + (else + (set! (-> this overlap-player-counter) (the-as uint 0)) + 0 + ) + ) + ) + (when (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 6))) + (let ((a1-1 (-> this nav state))) + (set! (-> s5-1 0 quad) (-> a1-1 velocity quad)) + ) + (let ((s4-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info))) + (let ((s3-0 (-> this nav state current-poly))) + (vector-xz-normalize-copy! (-> s5-1 3) (-> s5-1 0) 163840.0) + (set! (-> s5-1 4 quad) (-> s5-1 3 quad)) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s3-0 (-> s5-1 4) s4-0) + ) + (when (-> s4-0 found-boundary) + (let ((f30-0 (vector-length (-> s5-1 0)))) + (vector-flatten! (-> s5-1 0) (-> s5-1 0) (-> s4-0 boundary-normal)) + (vector-rotate90-around-y! (-> s5-1 0) (-> s4-0 boundary-normal)) + (vector-normalize! (-> s5-1 0) f30-0) + ) + (when (= this *debug-actor*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this root trans) (-> s5-1 0) (meters 10) *color-blue*) + (format *stdebug* "avoid border~%") + ) + ) + ) + (let* ((f0-3 4.096) + (f0-5 (* f0-3 f0-3)) + ) + (.lvf vf1 (&-> (-> s5-1 0) 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-42 vf1) + (when (< f0-5 v1-42) + (set! (-> s5-1 5 quad) (-> s5-1 0 quad)) + (vector-normalize! (-> s5-1 5) 1.0) + (let ((s4-1 (-> this root quat))) + (quaternion-set! (the-as quaternion (-> s5-1 2)) 0.0 (-> s5-1 5 x) 0.0 (+ 1.0 (-> s5-1 5 z))) + (quaternion-normalize! (the-as quaternion (-> s5-1 2))) + (quaternion-smooth-seek! s4-1 s4-1 (the-as quaternion (-> s5-1 2)) (* 1.2 (seconds-per-frame))) + ) + (vector-z-quaternion! (-> s5-1 1) (-> this root quat)) + (vector-v*float+! (-> this root trans) (-> this root trans) (-> s5-1 1) 8954.266) + (seek! (-> this root trans y) 4096.0 (* 4096.0 (seconds-per-frame))) + ) + ) + ) + (when (= this *debug-actor*) + (format *stdebug* "no physics~%") + (format *stdebug* "~M~%" (-> this root trans y)) + ) + ) + (if (= this *debug-actor*) + (format *stdebug* "speed ~M~%" (vector-length (-> this root transv))) + ) + (let ((s4-2 (handle->process (-> this manager))) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (when s4-2 + (let ((a1-22 (-> this nav state))) + (set! (-> s5-2 quad) (-> a1-22 target-pos quad)) + ) + (if (or (= (-> this path-num) 2) (-> *setting-control* user-current stop-boats?)) + (get-point-at-percent-along-path! + (-> (the-as boat-manager (+ (* (-> this path-num) 4) (the-as uint s4-2))) paths 0) + (-> this root trans) + (-> this path-index) + 'interp + ) + ) + (when (and (not (or (= (-> this path-num) 2) (-> *setting-control* user-current stop-boats?))) + (< (vector-vector-xz-distance (-> this root trans) s5-2) 163840.0) + ) + (+! (-> this path-index) 0.01) + (let ((f0-20 (-> this path-index))) + (set! (-> this path-index) (- f0-20 (* (the float (the int (/ f0-20 1.0))) 1.0))) + ) + ) + (get-point-at-percent-along-path! + (-> (the-as boat-manager (+ (* (-> this path-num) 4) (the-as uint s4-2))) paths 0) + s5-2 + (-> this path-index) + 'interp + ) + (let ((v1-102 (-> this nav state))) + (logclear! (-> v1-102 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-102 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-102 target-pos quad) (-> s5-2 quad)) + ) + 0 + ) + ) + (vehicle-method-78 this) + ) + ) + +(defmethod clear-impulse-force-flag! ((this boat-base)) + ((method-of-type vehicle clear-impulse-force-flag!) this) + (none) + ) + +(defmethod apply-gravity! ((this boat-base) (arg0 float)) + (let ((s3-0 (-> this rbody)) + (s2-0 (-> this info)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (let ((a1-1 (-> this nav state))) + (set! (-> s4-0 uvec quad) (-> a1-1 velocity quad)) + ) + (vector-! (-> s4-0 rvec) (-> s4-0 uvec) (-> s3-0 lin-velocity)) + (vector-float*! (-> s4-0 rvec) (-> s4-0 rvec) (* 4.0 (-> s2-0 info mass))) + (set-vector! (-> s4-0 trans) 0.0 -122880.0 40960.0 1.0) + (vector-matrix*! (-> s4-0 fvec) (-> s4-0 trans) (-> s3-0 matrix)) + (apply-impact! s3-0 (-> s4-0 fvec) (-> s4-0 rvec)) + (vector-reset! (-> s4-0 rvec)) + (set! (-> s4-0 rvec y) (* -4.0 (-> s2-0 extra gravity) (-> s2-0 info mass))) + (add-force! s3-0 (-> s4-0 rvec)) + ) + (rigid-body-object-method-53 this arg0) + (vehicle-method-96 this arg0) + (none) + ) + +(defmethod vehicle-method-93 ((this boat-base)) + 0 + (none) + ) + +(defmethod rigid-body-object-method-38 ((this boat-base)) + 0 + (none) + ) + +(defmethod vehicle-method-131 ((this boat-base) (arg0 traffic-object-spawn-params)) + (get-nav-control this (-> arg0 nav-mesh)) + (set! (-> this manager) (-> arg0 handle)) + (set! (-> this nav callback-info) *physics-nav-callback-info*) + (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 target-speed) 40960.0) + ) + 0 + (let ((v1-7 (-> this nav))) + (set! (-> v1-7 acceleration) 8192.0) + ) + 0 + (let ((v1-9 (-> this nav))) + (set! (-> v1-9 turning-acceleration) 8192.0) + ) + 0 + (let ((v1-11 (-> this nav))) + (set! (-> v1-11 max-rotation-rate) 9102.223) + ) + 0 + (let ((v1-13 (-> this nav))) + (set! (-> v1-13 nav-cull-radius) 122880.0) + ) + 0 + (let ((v1-15 (-> this nav))) + (set! (-> v1-15 sphere-mask) (the-as uint 64)) + ) + 0 + (set! (-> this path-num) (-> arg0 user-data)) + (set! (-> this path-index) (+ 0.05 (-> arg0 position w))) + (when (-> *setting-control* user-current stop-boats?) + ) + (logior! (-> this root root-prim prim-core collide-as) (collide-spec pusher)) + (let ((v1-26 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + 0 + (none) + ) + +(defmethod alloc-rbody-control! ((this boat-base) (arg0 rigid-body-object-constants)) + ((method-of-type vehicle alloc-rbody-control!) this arg0) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-method-109 ((this boat-base)) + (go (method-of-object this idle)) + (none) + ) + +(defmethod vehicle-method-102 ((this boat-base)) + #f + ) + +(defstate waiting (boat-base) + :virtual #t + :enter (behavior () + (go-virtual idle) + ) + :exit (behavior () + '() + ) + ) + +(defstate inactive (boat-base) + :virtual #t + :enter (behavior () + (go-virtual idle) + ) + :exit (behavior () + '() + ) + ) + +(defstate idle (boat-base) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (logior! (-> self v-flags) (vehicle-flag riding)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + '() + ) + :post (behavior () + (rbody-post self) + (update-transforms (-> self root)) + ) + ) + +(defskelgroup skel-barge barge barge-lod0-jg barge-idle-ja + ((barge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 21) + ) + +(deftype barge (boat-base) + ((engine sound-id) + (bow-wash sound-id) + ) + ) + + +(defmethod init-collision! ((this barge)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 19) 0))) + (set! (-> s5-0 total-prims) (the-as uint 20)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core action) (collide-action solid rideable)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 81920.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) 0.0 0.0 -32768.0 16384.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 0.0 -8192.0 16384.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 0.0 16384.0 16384.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 40960.0 16384.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 0) + (set-vector! (-> v1-23 local-sphere) 24576.0 0.0 -32768.0 16384.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 0) + (set-vector! (-> v1-25 local-sphere) 24576.0 0.0 -8192.0 16384.0) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 0) + (set-vector! (-> v1-27 local-sphere) 24576.0 0.0 16384.0 16384.0) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-29 prim-core action) (collide-action solid)) + (set! (-> v1-29 transform-index) 0) + (set-vector! (-> v1-29 local-sphere) 24576.0 0.0 40960.0 16384.0) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-31 prim-core action) (collide-action solid)) + (set! (-> v1-31 transform-index) 0) + (set-vector! (-> v1-31 local-sphere) -24576.0 0.0 -32768.0 16384.0) + ) + (let ((v1-33 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-33 prim-core action) (collide-action solid)) + (set! (-> v1-33 transform-index) 0) + (set-vector! (-> v1-33 local-sphere) -24576.0 0.0 -8192.0 16384.0) + ) + (let ((v1-35 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-35 prim-core action) (collide-action solid)) + (set! (-> v1-35 transform-index) 0) + (set-vector! (-> v1-35 local-sphere) -24576.0 0.0 16384.0 16384.0) + ) + (let ((v1-37 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-37 prim-core action) (collide-action solid)) + (set! (-> v1-37 transform-index) 0) + (set-vector! (-> v1-37 local-sphere) -24576.0 0.0 40960.0 16384.0) + ) + (let ((v1-39 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-39 prim-core action) (collide-action solid)) + (set! (-> v1-39 transform-index) 0) + (set-vector! (-> v1-39 local-sphere) 16384.0 0.0 -57344.0 16384.0) + ) + (let ((v1-41 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-41 prim-core action) (collide-action solid)) + (set! (-> v1-41 transform-index) 0) + (set-vector! (-> v1-41 local-sphere) -16384.0 0.0 -57344.0 16384.0) + ) + (let ((v1-43 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-43 prim-core action) (collide-action solid)) + (set! (-> v1-43 transform-index) 0) + (set-vector! (-> v1-43 local-sphere) 0.0 8192.0 -61440.0 16384.0) + ) + (let ((v1-45 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-45 prim-core action) (collide-action solid)) + (set! (-> v1-45 transform-index) 0) + (set-vector! (-> v1-45 local-sphere) -40960.0 0.0 -53248.0 16384.0) + ) + (let ((v1-47 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-47 prim-core action) (collide-action solid)) + (set! (-> v1-47 transform-index) 0) + (set-vector! (-> v1-47 local-sphere) 40960.0 0.0 -53248.0 16384.0) + ) + (set! (-> s5-0 nav-radius) 81920.0) + (let ((v1-49 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-49 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-49 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this barge)) + (with-pp + (set! (-> pp level) (level-get *level* 'ctyport)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-barge" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *barge-constants*) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this engine) (new-sound-id)) + (set! (-> this bow-wash) (new-sound-id)) + (set-vector! (-> this draw color-emissive) 0.3 0.3 0.0 0.0) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((= v1-0 -1) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ((= v1-0 1) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec camera-blocker vehicle-mesh vehicle-mesh-probeable)) + ) + ((zero? v1-0) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) + (collide-spec vehicle-sphere camera-blocker vehicle-mesh vehicle-mesh-probeable) + ) + ) + ) + ) + (none) + ) + ) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch process vs boat-manager. +(defmethod relocate ((this boat-manager) (offset int)) + (dotimes (v1-0 4) + (if (-> this paths v1-0) + (&+! (-> this paths v1-0) offset) + ) + ) + (the-as boat-manager ((method-of-type process relocate) this offset)) + ) + +(defstate idle (boat-manager) + :virtual #t + :trans (behavior () + (when (and (not (-> self boats-stop?)) (-> *setting-control* user-current stop-boats?)) + (kill-by-type barge *active-pool*) + (boat-manager-method-16 self) + (set! (-> self boats-stop?) #t) + ) + (dotimes (gp-0 4) + (let ((a0-2 (-> self paths gp-0))) + (if a0-2 + (debug-draw a0-2) + ) + ) + ) + ) + :code sleep-code + ) + +(defmethod boat-manager-method-16 ((this boat-manager)) + (when (-> this mesh) + (dotimes (s5-0 4) + (when (-> this paths s5-0) + (when #t + (logior! (-> this paths s5-0 flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s4-0 (-> this paths s5-0)) + (f30-0 0.0) + ) + 1 + (let ((s3-0 (new 'stack-no-clear 'matrix))) + (vector-reset! (-> s3-0 fvec)) + (set! (-> s3-0 fvec y) 1.0) + (the int (* 0.0000016276042 (total-distance s4-0))) + (while (< f30-0 0.8) + (displacement-between-points-at-percent-normalized! s4-0 (-> s3-0 uvec) f30-0) + (get-point-at-percent-along-path! s4-0 (-> s3-0 rvec) f30-0 'interp) + (vector-normalize! (-> s3-0 uvec) 1.0) + (quaternion-look-at! (the-as quaternion (-> s3-0 trans)) (-> s3-0 uvec) (-> s3-0 fvec)) + (let ((s2-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s2-0 object-type) (traffic-type guard-a)) + (set! (-> s2-0 behavior) (the-as uint 1)) + (set! (-> s2-0 id) (the-as uint 0)) + (set! (-> s2-0 nav-mesh) (-> this mesh)) + (set! (-> s2-0 nav-branch) #f) + (set! (-> s2-0 proc) #f) + (set! (-> s2-0 handle) (process->handle this)) + (set! (-> s2-0 user-data) (the-as uint s5-0)) + (set! (-> s2-0 flags) (traffic-spawn-flags tsf0)) + (set! (-> s2-0 guard-type) (the-as uint 11)) + (set! (-> s2-0 entity) #f) + (set! (-> s2-0 velocity quad) (-> s3-0 uvec quad)) + (set! (-> s2-0 position quad) (-> s3-0 rvec quad)) + (quaternion-copy! (-> s2-0 rotation) (the-as quaternion (-> s3-0 trans))) + (set! (-> s2-0 position w) f30-0) + (when (vehicle-spawn-hack barge s2-0 this) + ) + ) + (let ((f0-4 0.25)) + (if (and (!= s5-0 2) (not (-> *setting-control* user-current stop-boats?))) + (set! f0-4 (rand-vu)) + ) + (+! f30-0 (/ (* 4096.0 (+ 150.0 (* 150.0 f0-4))) (total-distance s4-0))) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +(defmethod init-from-entity! ((this boat-manager) (arg0 entity-actor)) + (set! (-> this mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) + (set! (-> this entity) arg0) + (set! (-> this boats-stop?) (-> *setting-control* user-current stop-boats?)) + (when (-> this mesh) + (dotimes (s5-1 4) + (set! (-> this paths s5-1) (new 'process 'curve-control this 'path (the float s5-1))) + ) + (boat-manager-method-16 this) + ) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/city/ctywide-obs-h.gc b/goal_src/jak3/levels/city/ctywide-obs-h.gc index 30b2f2dfbd..c7caa46c4f 100644 --- a/goal_src/jak3/levels/city/ctywide-obs-h.gc +++ b/goal_src/jak3/levels/city/ctywide-obs-h.gc @@ -7,3 +7,30 @@ ;; DECOMP BEGINS +(deftype city-race-ring-info (structure) + ((pos vector :inline) + (angle float :overlay-at (-> pos data 3)) + (boost float) + (dist float) + ) + (:methods + (gen-static-macro (_type_ object) none) + ) + ) + + +(deftype city-ambush-spot (structure) + ((pos vector :inline) + (obj-type traffic-type) + ) + ) + + +(deftype city-ambush-info (structure) + ((count int16) + (array (inline-array city-ambush-spot)) + ) + (:methods + (init (_type_ traffic-object-spawn-params) none) + ) + ) diff --git a/goal_src/jak3/levels/city/ctywide-obs.gc b/goal_src/jak3/levels/city/ctywide-obs.gc index 24792d01fe..d6fdfcb64e 100644 --- a/goal_src/jak3/levels/city/ctywide-obs.gc +++ b/goal_src/jak3/levels/city/ctywide-obs.gc @@ -7,3 +7,3459 @@ ;; DECOMP BEGINS +(deftype security-wall (process-drawable) + ((root collide-shape :override) + (pass pickup-type) + (incoming-attack-id uint32) + (next-message-time time-frame) + (message int32) + (plane plane :inline) + (color vector :inline) + (target-pos vector :inline) + (flash float) + (touch-count int32) + (breach symbol) + ) + (:state-methods + idle-open + idle-close + ) + (:methods + (init-wall (_type_ vector vector float) vector) + (play-speech (_type_) none) + (security-wall-method-24 (_type_) none) + ) + ) + + +(defskelgroup skel-security-wall security-wall security-wall-lod0-jg security-wall-idle-ja + ((security-wall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100.1) + ) + +(defmethod play-speech ((this security-wall)) + (when (< (-> this next-message-time) (current-time)) + (set! (-> this next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) + (let ((v1-6 (rand-vu-int-count 15))) + (cond + ((zero? v1-6) + (case (-> this pass) + (((pickup-type pass-red)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + ) + (((pickup-type pass-green)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + ) + (((pickup-type pass-yellow)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + ) + (((pickup-type pass-blue)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + ) + ) + ) + ((= v1-6 1) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + ) + ((= v1-6 2) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + ) + ((= v1-6 3) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + ) + ((= v1-6 4) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + ) + ((= v1-6 5) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + ) + ((= v1-6 6) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + ) + ((= v1-6 7) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + ) + ((= v1-6 8) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + ) + ((= v1-6 9) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + ) + ((= v1-6 10) + (let ((v1-45 (rand-vu-int-count 3))) + (cond + ((zero? v1-45) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv035" -99.0 0) + ) + ((= v1-45 1) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv038" -99.0 0) + ) + ((= v1-45 2) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv058" -99.0 0) + ) + ) + ) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + ) + ((= v1-6 11) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (let ((v1-57 (rand-vu-int-count 3))) + (cond + ((zero? v1-57) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv035" -99.0 0) + ) + ((= v1-57 1) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv038" -99.0 0) + ) + ((= v1-57 2) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv058" -99.0 0) + ) + ) + ) + ) + ((= v1-6 12) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (case (-> this pass) + (((pickup-type pass-red)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + ) + (((pickup-type pass-green)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + ) + (((pickup-type pass-yellow)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + ) + (((pickup-type pass-blue)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + ) + ) + ) + ((= v1-6 13) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (case (-> this pass) + (((pickup-type pass-red)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + ) + (((pickup-type pass-green)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + ) + (((pickup-type pass-yellow)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + ) + (((pickup-type pass-blue)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + ) + ) + ) + ((= v1-6 14) + (case (-> this pass) + (((pickup-type pass-red)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + ) + (((pickup-type pass-green)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + ) + (((pickup-type pass-yellow)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + ) + (((pickup-type pass-blue)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + ) + ) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + ) + ) + ) + (+! (-> this message) 1) + (when (>= (-> this message) 5) + (set! (-> this message) 0) + 0 + ) + ) + 0 + (none) + ) + +(defmethod security-wall-method-24 ((this security-wall)) + (let ((s4-0 *target*)) + (when s4-0 + (let* ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> s4-0 control trans))) + (f30-0 (+ 40960.0 (-> this root root-prim local-sphere w))) + (f1-1 f30-0) + ) + (when (< f0-0 (* f1-1 f1-1)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) + (set! (-> s5-0 0 quad) (-> s4-0 control trans quad)) + (when (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) (* f30-0 f30-0)) + (let ((f0-3 (vector4-dot (-> this target-pos) (the-as vector (-> this plane)))) + (f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> this plane)))) + ) + (if (and (< (fabs f1-7) 16384.0) + (< (fabs f0-3) 16384.0) + (or (and (< f0-3 0.0) (>= f1-7 0.0)) (and (< f1-7 0.0) (>= f0-3 0.0))) + ) + (set! (-> this breach) #t) + ) + ) + ) + (set! (-> this target-pos quad) (-> s5-0 0 quad)) + ) + (when (-> this breach) + (if (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'grenade)) + ) + ) + (set! (-> this breach) #f) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate idle-close (security-wall) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as object (-> self root backup-collide-with)))) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 + ) + ) + ) + (('off) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (('attack) + (let ((v1-5 (the-as attack-info (-> block param 1)))) + (when (!= (-> v1-5 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> v1-5 id)) + (let* ((s5-0 proc) + (s3-0 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (when s3-0 + (let ((s5-1 (process-spawn + manipy + :init manipy-init + (-> (the-as process-drawable s3-0) root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when s5-1 + (send-event (ppointer->process s5-1) 'anim-mode 'play1) + (send-event (ppointer->process s5-1) 'speed 1.5) + (send-event (ppointer->process s5-1) 'art-joint-anim "generic-ripples-idle" 0) + (set-vector! (-> (the-as process-drawable (-> s5-1 0)) root scale) 1.0 1.0 1.0 1.0) + (quaternion-rotate-local-x! (-> (the-as process-drawable (-> s5-1 0)) root quat) (-> self root quat) -16384.0) + (let ((v1-43 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-29 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-11 *up-vector*)) + (let ((a2-7 8192.0)) + (.mov vf7 a2-7) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-29 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 (&-> v1-43 quad) vf6) + ) + (let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> s5-1 0)) root trans) (the-as vector (-> self plane))))) + (let ((v1-50 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-33 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-12 (-> self plane))) + (let ((a2-8 (- f0-6))) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-12 quad)) + ) + (.lvf vf4 (&-> a0-33 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 (&-> v1-50 quad) vf6) + ) + (let ((v1-53 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-36 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-13 (-> self plane))) + (let ((a2-10 (the-as float (if (< 0.0 f0-6) + -2048.0 + 2048.0 + ) + ) + ) + ) + (.mov vf7 a2-10) + ) + (.lvf vf5 (&-> a1-13 quad)) + ) + (.lvf vf4 (&-> a0-36 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 (&-> v1-53 quad) vf6) + ) + ) + (send-event (ppointer->process s5-1) 'trans-hook (lambda () #f)) + ) + ) + ) + ) + (when (zero? (-> self touch-count)) + (+! (-> self touch-count) 1) + (set! (-> self flash) 0.375) + ) + (+! (-> self touch-count) 1) + (if (and (logtest? (-> proc mask) (process-mask target)) + (not (logtest? (process-mask projectile) (-> proc mask))) + ) + (play-speech self) + ) + ) + ) + ) + (('touched) + (when (zero? (-> self touch-count)) + (+! (-> self touch-count) 1) + (set! (-> self flash) 0.375) + ) + (+! (-> self touch-count) 1) + (let ((v1-81 (if (type? proc process-focusable) + proc + ) + ) + ) + (when v1-81 + (let* ((gp-1 (-> (the-as process-drawable v1-81) root)) + (a0-45 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (if (and a0-45 (logtest? (-> (the-as collide-shape a0-45) root-prim prim-core collide-as) (collide-spec jak))) + (play-speech self) + ) + ) + ) + ) + ) + ) + ) + ) + :trans (behavior () + (security-wall-method-24 self) + ) + :code (behavior () + (until #f + (when (and (logtest? (game-feature feature35) (-> *game-info* features)) + (= (pickup-type pass-slumb-genb) (-> self pass)) + ) + (go-virtual idle-open) + #t + (b! #t cfg-9 :delay (nop!)) + (the-as none 0) + ) + (let ((f30-0 (calc-fade-from-fog (-> self root trans))) + (a0-4 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-4 (-> self color) f30-0) + (set-security-color! a0-4) + (vector-float*! gp-0 (-> self color) (* f30-0 (-> self flash))) + (seek! (-> self flash) 0.0 (seconds-per-frame)) + (if (nonzero? (-> self touch-count)) + (+! (-> self touch-count) -1) + ) + (set-security-flash! gp-0) + ) + (suspend) + ) + #f + (label cfg-9) + ) + ) + +(defstate idle-open (security-wall) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as int (-> self root backup-collide-with)))) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 + ) + ) + ) + (('off) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :trans (behavior () + (let* ((f28-0 (vector4-dot (the-as vector (-> self plane)) (target-pos 0))) + (f30-0 (calc-fade-from-fog (-> self root trans))) + (f28-1 (lerp-scale 0.0 1.0 (fabs f28-0) 163840.0 327680.0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (when (= f28-1 0.0) + (cleanup-for-death self) + (deactivate self) + ) + (let ((f0-3 (* f30-0 f28-1))) + (vector-float*! gp-1 (-> self color) f0-3) + ) + (set! (-> gp-1 w) 1.0) + (set-security-color! gp-1) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + ) + +(defmethod init-wall ((this security-wall) (arg0 vector) (arg1 vector) (arg2 float)) + 0.0 + (* 0.5 (vector-vector-distance arg0 arg1)) + (let ((s2-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-3 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle blocking-plane camera-blocker)) + (set! (-> v1-3 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-3 prim-core action) (collide-action solid)) + (set! (-> v1-3 transform-index) 3) + (set! (-> s2-0 total-prims) (the-as uint 1)) + (set! (-> s2-0 root-prim) v1-3) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-6 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-6 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-6 prim-core collide-with)) + ) + (set! (-> this root) s2-0) + ) + (let ((s2-1 (new 'stack-no-clear 'matrix)) + (s1-0 (-> this root)) + ) + (vector+! (-> s1-0 trans) arg0 arg1) + (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) + (+! (-> s1-0 trans y) (* 0.5 arg2)) + (vector-! (-> s2-1 rvec) arg1 arg0) + (let ((f30-1 (vector-normalize-ret-len! (-> s2-1 rvec) 1.0))) + (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) + (set! (-> s1-0 scale y) (* 0.00024414062 arg2)) + (set! (-> s1-0 scale z) 1.0) + (set! (-> s2-1 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-cross! (-> s2-1 fvec) (-> s2-1 rvec) (-> s2-1 uvec)) + (vector-normalize! (-> s2-1 fvec) 1.0) + (matrix->quaternion (-> s1-0 quat) s2-1) + (set! (-> this plane quad) (-> s2-1 fvec quad)) + (set! (-> this plane w) (- (vector-dot (-> s2-1 fvec) (-> this root trans)))) + (let ((v0-6 (-> this root root-prim local-sphere))) + (set! (-> v0-6 x) 0.0) + (set! (-> v0-6 y) (* 0.00024414062 (* 0.5 arg2))) + (set! (-> v0-6 z) 0.0) + (let ((f0-20 0.5) + (f1-7 (* f30-1 f30-1)) + (f2-2 arg2) + ) + (set! (-> v0-6 w) (* f0-20 (sqrtf (+ f1-7 (* f2-2 f2-2))))) + ) + v0-6 + ) + ) + ) + ) + +(defmethod init-from-entity! ((this security-wall) (arg0 entity-actor)) + (ctywide-entity-hack) + (set! (-> this breach) #f) + (set! (-> this pass) (res-lump-value arg0 'pickup-type pickup-type :time -1000000000.0)) + (let ((v1-3 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))) + (set! (-> this path) v1-3) + (if (or (not v1-3) (!= (-> v1-3 curve num-cverts) 2)) + (go process-drawable-art-error "bad path") + ) + ) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (get-point-in-path! (-> this path) s5-1 0.0 'exact) + (get-point-in-path! (-> this path) s4-0 1.0 'exact) + (init-wall this s5-1 s4-0 122880.0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-security-wall" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this root event-self) 'touched) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set-security-texture-masks! (the-as vector (-> this draw mgeo header texture-usage-group data 4))) + (set-vector! (-> this color) 1.0 1.0 1.0 1.0) + (cond + ((= (-> this pass) (pickup-type pass-red)) + (set-vector! (-> this color) 1.0 0.0 0.0 1.0) + ) + ((= (-> this pass) (pickup-type pass-yellow)) + (set-vector! (-> this color) 1.0 1.0 0.0 1.0) + ) + ((= (-> this pass) (pickup-type pass-green)) + (set-vector! (-> this color) 0.0 1.0 0.0 1.0) + ) + ((= (-> this pass) (pickup-type pass-blue)) + (set-vector! (-> this color) 0.0 0.0 1.0 1.0) + ) + ) + (set-security-color! (-> this color)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> this draw color-emissive) 1.0 1.0 1.0 1.0) + (transform-post) + (cond + ((logtest? (game-feature feature35) (-> *game-info* features)) + (= (pickup-type pass-slumb-genb) (-> this pass)) + (go (method-of-object this idle-open)) + ) + (else + (go (method-of-object this idle-close)) + ) + ) + ) + +(deftype security-wall-child (security-wall) + ((hidden? symbol) + ) + (:state-methods + hide-wall + ) + ) + + +(defstate idle-close (security-wall-child) + :virtual #t + :code (behavior () + (until #f + (let ((f30-0 (calc-fade-from-fog (-> self root trans))) + (a0-1 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-1 (-> self color) f30-0) + (set-security-color! a0-1) + (vector-float*! gp-0 (-> self color) (* f30-0 (-> self flash))) + (seek! (-> self flash) 0.0 (seconds-per-frame)) + (if (nonzero? (-> self touch-count)) + (+! (-> self touch-count) -1) + ) + (set-security-flash! gp-0) + ) + (suspend) + ) + #f + ) + ) + +(defstate hide-wall (security-wall-child) + :virtual #t + :parent (security-wall-child idle-close) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + #f + ) + (else + ((-> (method-of-type security-wall-child idle-close) event) proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (ja-post) + ) + :code sleep-code + ) + +(defbehavior security-wall-child-init-by-other security-wall-child ((arg0 vector) (arg1 vector) (arg2 float) (arg3 symbol)) + (ctywide-entity-hack) + (set! (-> self breach) #f) + (set! (-> self hidden?) arg3) + (init-wall self arg0 arg1 arg2) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-security-wall" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root event-self) 'touched) + (logior! (-> self draw status) (draw-control-status disable-fog)) + (set-security-texture-masks! (the-as vector (-> self draw mgeo header texture-usage-group data 4))) + (set-vector! (-> self color) 1.0 1.0 1.0 1.0) + (set-vector! (-> self color) 1.0 0.0 0.0 1.0) + (set-security-color! (-> self color)) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) + (transform-post) + (if (-> self hidden?) + (go-virtual hide-wall) + (go-virtual idle-close) + ) + ) + +;; WARN: Return type mismatch int vs handle. +(defun spawn-security-wall ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float) (arg4 symbol)) + (the-as handle (ppointer->handle + (process-spawn security-wall-child arg1 arg2 arg3 arg4 :name "security-wall-child" :to arg0) + ) + ) + ) + +(deftype parking-spot (process-drawable) + ((vehicle handle) + (spawned symbol) + (minimap connection-minimap) + (test-sphere sphere :inline) + (expire-time time-frame) + (last-update-time time-frame) + ) + (:state-methods + idle + ) + (:methods + (parking-spot-method-21 (_type_) none) + (parking-spot-method-22 (_type_) none) + (parking-spot-method-23 (_type_ traffic-type) none) + (parking-spot-method-24 (_type_) none) + (parking-spot-method-25 (_type_ symbol) symbol) + (parking-spot-method-26 (_type_) symbol) + ) + ) + + +;; WARN: disable def twice: 36. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod parking-spot-method-25 ((this parking-spot) (arg0 symbol)) + (local-vars (f30-0 float)) + (and (not (-> *setting-control* user-current disable-parking-spots?)) + (begin + (set! f30-0 (vector-vector-distance (-> this root trans) (math-camera-pos))) + (or (< 163840.0 f30-0) arg0) + ) + (if (sphere-in-view-frustum? (-> this test-sphere)) + (and (or arg0 (< 614400.0 f30-0)) (< f30-0 1024000.0)) + (< f30-0 614400.0) + ) + ) + ) + +(defmethod parking-spot-method-26 ((this parking-spot)) + (let ((f30-0 (vector-vector-distance (-> this root trans) (math-camera-pos)))) + (or (< f30-0 163840.0) (and (sphere-in-view-frustum? (-> this test-sphere)) (< f30-0 614400.0))) + ) + ) + +(defmethod parking-spot-method-24 ((this parking-spot)) + (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) + (set! (-> gp-0 vec0 quad) (-> this root trans quad)) + (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-reset! (-> gp-0 vec1)) + (set! (-> gp-0 vec1 y) 1.0) + (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-5 (-> gp-0 cquery))) + (set! (-> v1-5 radius) 1024.0) + (set! (-> v1-5 collide-with) (collide-spec backgnd)) + (set! (-> v1-5 ignore-process0) #f) + (set! (-> v1-5 ignore-process1) #f) + (set! (-> v1-5 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-5 action-mask) (collide-action solid)) + ) + (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) + (when (>= f30-0 0.0) + (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) + (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (format #t "parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) + ) + (if (< f30-0 0.0) + (format #t "parking-spot::find-ground: could not find ground~%") + ) + ) + (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) + ) + 0 + (none) + ) + +(defmethod parking-spot-method-21 ((this parking-spot)) + (with-pp + (let ((s5-0 (the-as vehicle (handle->process (-> this vehicle))))) + (cond + (s5-0 + (cond + ((or (-> *setting-control* user-current disable-parking-spots?) + (focus-test? s5-0 dead inactive) + (not (logtest? (vehicle-flag waiting-for-player) (-> s5-0 v-flags))) + (let ((f0-0 (-> this test-sphere r))) + (< (* f0-0 f0-0) (vector-vector-distance-squared (-> s5-0 root trans) (-> this test-sphere))) + ) + ) + (logclear! (-> s5-0 v-flags) (vehicle-flag persistent)) + (cond + ((-> *setting-control* user-current disable-parking-spots?) + (when (or (< (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) + (>= (-> *setting-control* user-current bg-a) 1.0) + (>= (-> *setting-control* user-current bg-a-force) 1.0) + (let ((f0-5 (-> this test-sphere r))) + (and (>= (* f0-5 f0-5) (vector-vector-distance-squared (-> s5-0 root trans) (-> this test-sphere))) + (not (sphere-in-view-frustum? (-> this test-sphere))) + ) + ) + ) + (send-event (handle->process (-> this vehicle)) 'traffic-off-force) + (set! (-> this vehicle) (the-as handle #f)) + ) + ) + (else + (set! (-> this vehicle) (the-as handle #f)) + ) + ) + ) + (else + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 11) (the-as int #f) (the-as vector #t) 0)) + ) + (cond + ((parking-spot-method-26 this) + (logior! (-> s5-0 v-flags) (vehicle-flag persistent)) + (+! (-> this expire-time) (- (current-time) (-> pp clock old-frame-counter))) + ) + (else + ) + ) + (when (< (-> this expire-time) (current-time)) + (logclear! (-> s5-0 v-flags) (vehicle-flag persistent)) + (set! (-> this vehicle) (the-as handle #f)) + ) + ) + ) + ) + (else + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this spawned) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch object vs vehicle. +(defun parking-spot-spawn ((arg0 traffic-object-spawn-params)) + (set! (-> arg0 proc) #f) + (the-as vehicle (cond + ((= (-> arg0 object-type) (traffic-type bike-d)) + (let ((v0-0 (the-as object (vehicle-spawn (vehicle-type h-bike-d) arg0)))) + (if (the-as process-drawable v0-0) + (logior! (-> (the-as vehicle v0-0) v-flags) (vehicle-flag traffic-managed)) + ) + (set! (-> arg0 proc) (the-as vehicle v0-0)) + v0-0 + ) + ) + (else + (send-event *traffic-manager* 'activate-object arg0) + ) + ) + ) + ) + +(defmethod parking-spot-method-23 ((this parking-spot) (arg0 traffic-type)) + (let ((v1-0 (new 'stack-no-clear 'cquery-with-vec))) + (let* ((a0-1 (new 'stack-no-clear 'inline-array 'vector 1)) + (a1-2 (the-as uint #xa01013fd)) + (a2-1 (logand -2 a1-2)) + ) + (set! (-> a0-1 0 quad) (-> this test-sphere quad)) + (let ((a1-4 (-> v1-0 cquery))) + (set! (-> a1-4 best-dist) (the-as float a0-1)) + (set! (-> a1-4 best-other-prim) (the-as collide-shape-prim 1)) + (set! (-> a1-4 collide-with) (the-as collide-spec a2-1)) + (set! (-> a1-4 ignore-process0) #f) + (set! (-> a1-4 ignore-process1) #f) + (set! (-> a1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a1-4 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> a1-4 action-mask) (collide-action solid)) + ) + ) + 0 + (when (not (fill-and-probe-using-spheres *collide-cache* (-> v1-0 cquery))) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 position quad) (-> this root trans quad)) + (mem-copy! (the-as pointer (-> s4-0 rotation)) (the-as pointer (-> this root quat)) 16) + (+! (-> s4-0 position y) 14336.0) + (set! (-> s4-0 behavior) (the-as uint 0)) + (set! (-> s4-0 object-type) arg0) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 proc) #f) + (parking-spot-spawn s4-0) + (when (-> s4-0 proc) + (let ((v1-9 (-> s4-0 proc))) + (if v1-9 + (logior! (-> (the-as vehicle v1-9) v-flags) (vehicle-flag persistent)) + ) + ) + (set! (-> this expire-time) (+ (current-time) (seconds 10))) + (set! (-> this vehicle) (process->handle (-> s4-0 proc))) + (set! (-> this spawned) #t) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this parking-spot) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this minimap) #f) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this spawned) #f) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) + (if (!= f0-0 0.0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) + ) + ) + (parking-spot-method-24 this) + (set! (-> this test-sphere quad) (-> this root trans quad)) + (set! (-> this test-sphere r) 24576.0) + (set-time! (-> this state-time)) + (when (parking-spot-method-25 this #t) + (let ((s4-0 29)) + (if (nonzero? (res-lump-value arg0 'use-special-bike uint128 :time -1000000000.0)) + (set! s4-0 28) + ) + (if (= s4-0 29) + (set! s4-0 (the-as int (get-random-parking-spot-type *traffic-engine*))) + ) + (if (!= s4-0 29) + (parking-spot-method-23 this (the-as traffic-type s4-0)) + ) + ) + ) + (go (method-of-object this idle)) + ) + +(defstate idle (parking-spot) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (parking-spot-method-21 self) + (send-event (handle->process (-> self vehicle)) 'traffic-off-force) + ) + :code sleep-code + :post (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.25)) + (parking-spot-method-21 self) + (when (time-elapsed? (-> self last-update-time) (seconds 0.2)) + (set-time! (-> self last-update-time)) + (when (and (not (-> self spawned)) (parking-spot-method-25 self #f)) + (let ((a1-1 (get-random-parking-spot-type *traffic-engine*))) + (if (!= a1-1 (traffic-type max)) + (parking-spot-method-23 self a1-1) + ) + ) + ) + ) + 0 + ) + ) + ) + +(deftype propa (process-focusable) + ((sound-id sound-id) + (sound-index uint32) + (handle handle) + (y-rot float) + (hit-points int32) + (incoming-attack-id uint32) + ) + (:state-methods + idle + broken + ) + (:methods + (propa-method-30 (_type_) none) + (propa-method-31 (_type_) none) + (propa-method-32 (_type_ vector) none) + ) + ) + + +(defskelgroup skel-propa propa 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 3)) + +(define *propa-sounds* (new 'static 'boxed-array :type string + "prop009" + "prop010" + "prop011" + "prop012" + "prop013" + "prop014" + "prop015" + "prop016" + "prop017" + "prop018" + "prop019" + "prop020" + "prop021" + "prop022" + "prop023" + "prop024" + "prop025" + "prop026" + "prop028" + "prop027" + "prop029" + "prop030" + "prop031" + "prop032" + "prop033" + "prop034" + "prop035" + "prop036" + "prop037" + "prop038" + "prop039" + "prop040" + "prop041" + "prop042" + "prop043" + "prop008" + "prop006" + "prop005" + "prop004" + "prop002" + "prop003" + "bar001" + "prop044" + "prop045" + "prop046" + "prop047" + "prop048" + "prop049" + "prop051" + "prop052" + "prop053" + "prop054" + "prop055" + "prop056" + ) + ) + +(define *propa-sounds-class-3* (new 'static 'boxed-array :type string "cityv177")) + +(define *propa-sounds-class-2* (new 'static 'boxed-array :type string "cityv176")) + +(define *propa-sounds-class-1* (new 'static 'boxed-array :type string "prop050" "spot004" "cityv175")) + +(define *propa-sounds-metalheads* (new 'static 'boxed-array :type string + "prop007" + "prop057" + "cityv096" + "cityv097" + "cityv098" + "cityv099" + "cityv142" + "cityv143" + ) + ) + +(define *propa-sounds-baron-construction* (new 'static 'boxed-array :type string "prop058")) + +;; WARN: Return type mismatch int vs knocked-type. +(defun propa-pu->knocked-type ((arg0 penetrate)) + (the-as knocked-type (cond + ((logtest? arg0 (penetrate vehicle)) + 7 + ) + ((logtest? (penetrate jak-blue-shot) arg0) + 6 + ) + ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) + 4 + ) + ((logtest? (penetrate jak-red-shot) arg0) + 5 + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + 2 + ) + ((logtest? (penetrate dark-bomb dark-smack) arg0) + 3 + ) + ((logtest? arg0 (penetrate mech-punch)) + 1 + ) + (else + 0 + ) + ) + ) + ) + +(defstate broken (propa) + :virtual #t + :code sleep-code + ) + +(defstate idle (propa) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case message + (('attack) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (let ((v1-2 (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info v1-2) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-2) id)) + (let ((s5-1 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) + (if (and (not (logtest? (penetrate dark-skin) s5-1)) (zero? (propa-pu->knocked-type s5-1))) + (set! (-> self hit-points) (- (-> self hit-points) (the int (penetrate-using->damage s5-1)))) + (+! (-> self hit-points) -10) + ) + ) + (cond + ((< (-> self hit-points) 3) + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 1 0) + (let* ((a0-9 (the-as collide-shape-prim-group (-> self root root-prim))) + (v1-18 (-> a0-9 child 0)) + ) + (let ((a0-11 (-> a0-9 child 1))) + (set! (-> a0-11 prim-core collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> a0-11 prim-core collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) + ) + 0 + (cond + ((logtest? (-> *part-group-id-table* 224 flags) (sp-group-flag sp13)) + (let ((v1-25 (-> *launch-matrix* trans)) + (a0-12 (new 'stack-no-clear 'vector)) + ) + (let ((a1-9 (-> self root trans))) + (let ((a2-3 *up-vector*)) + (let ((a3-2 8192.0)) + (.mov vf7 a3-2) + ) + (.lvf vf5 (&-> a2-3 quad)) + ) + (.lvf vf4 (&-> a1-9 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 (&-> a0-12 quad) vf6) + (set! (-> v1-25 quad) (-> a0-12 quad)) + ) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 224)) + ) + (else + (let ((v1-40 (-> *launch-matrix* trans)) + (a0-17 (new 'stack-no-clear 'vector)) + ) + (let ((a1-14 (-> self root trans))) + (let ((a2-9 *up-vector*)) + (let ((a3-6 8192.0)) + (.mov vf7 a3-6) + ) + (.lvf vf5 (&-> a2-9 quad)) + ) + (.lvf vf4 (&-> a1-14 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 (&-> a0-17 quad) vf6) + (set! (-> v1-40 quad) (-> a0-17 quad)) + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 224)) + ) + ) + (go-virtual broken) + ) + ((< (-> self hit-points) 6) + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 2 0) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (behavior () + (when (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + ) + :code sleep-code + :post (behavior () + (cond + ((or (not (-> *setting-control* user-current speech-control)) + (< 245760.0 (vector-vector-distance (camera-pos) (-> self root trans))) + ) + (when (nonzero? (-> self sound-id)) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + (+! (-> self sound-index) 1) + (when (>= (-> self sound-index) (the-as uint (-> *propa-sounds* length))) + (set! (-> self sound-index) (the-as uint 0)) + 0 + ) + ) + ) + ((< (vector-vector-distance (camera-pos) (-> self root trans)) 225280.0) + (cond + ((zero? (-> self sound-id)) + (set! (-> self sound-id) (add-process + *gui-control* + self + (gui-channel alert) + (gui-action play) + (-> *propa-sounds* (-> self sound-index)) + -99.0 + 0 + ) + ) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> self root trans quad)) + (set! (-> a1-4 w) 40960.0) + (propa-method-32 self a1-4) + ) + ) + (else + (when *sound-player-enable* + (let ((gp-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-2 command) (sound-command set-param)) + (set! (-> gp-2 id) (-> self sound-id)) + (set! (-> gp-2 params fo-min) 40) + (set! (-> gp-2 params fo-max) 55) + (set! (-> gp-2 params fo-curve) 2) + (let ((a1-5 (-> self root trans))) + (let ((s5-0 self)) + (when (= a1-5 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 root))) + (set! a1-5 (-> s5-0 root trans)) + (set! a1-5 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> gp-2 params trans) a1-5) + ) + (set! (-> gp-2 params mask) (the-as uint 480)) + (-> gp-2 id) + ) + ) + (when (= (get-status *gui-control* (-> self sound-id)) (gui-status unknown)) + (set! (-> self sound-id) (new 'static 'sound-id)) + (+! (-> self sound-index) 1) + (when (>= (-> self sound-index) (the-as uint (-> *propa-sounds* length))) + (set! (-> self sound-index) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + ) + (let ((s5-1 (matrix->trans (-> self node-list data 3 bone transform) (new 'stack-no-clear 'vector))) + (s4-0 (new 'stack-no-clear 'vector)) + (gp-3 (new 'stack-no-clear 'matrix)) + ) + (when (and (nonzero? (-> self handle)) (handle->process (-> self handle))) + (let* ((s3-0 (handle->process (-> self handle))) + (a0-25 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when a0-25 + (vector-! s4-0 (-> (the-as process-focusable a0-25) root trans) (-> self root trans)) + (set! (-> self y-rot) (deg-seek + (-> self y-rot) + (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> self root quat))) + (* 36408.89 (seconds-per-frame)) + ) + ) + ) + ) + ) + (matrix-rotate-y! gp-3 (-> self y-rot)) + (matrix<-trans gp-3 s5-1) + (spawn-from-mat (-> self part) gp-3) + ) + ) + ) + +(defmethod propa-method-32 ((this propa) (arg0 vector)) + (let ((s5-0 (the-as process-drawable #f))) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (countdown (s2-0 (fill-actor-list-for-box *actor-hash* arg0 s3-0 64)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-3 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-3 + (let* ((s0-0 (-> a0-3 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (!= this s1-1) + (not (focus-test? (the-as process-focusable s1-1) inactive)) + (not (focus-test? (the-as process-focusable s1-1) disable)) + (not (focus-test? (the-as process-focusable s1-1) dead)) + (not (logtest? (process-mask guard) (-> s1-1 mask))) + (not (logtest? (process-mask crate) (-> s1-1 mask))) + (not (logtest? (process-mask vehicle) (-> s1-1 mask))) + ) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) + (when (or (not s5-0) (< f0-0 f30-0)) + (set! s5-0 s1-1) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + ) + ) + (if (and *target* (< (vector-vector-distance (target-pos 0) arg0) (-> arg0 w))) + (set! s5-0 *target*) + ) + (if s5-0 + (set! (-> this handle) (process->handle s5-0)) + (set! (-> this handle) (the-as handle #f)) + ) + ) + 0 + (none) + ) + +(defmethod propa-method-30 ((this propa)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-12 prim-core action) (collide-action solid rideable)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-14 prim-core action) (collide-action solid rideable)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod propa-method-31 ((this propa)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 259) this)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this propa) (arg0 entity-actor)) + (propa-method-30 this) + (process-drawable-from-entity! this arg0) + (ctywide-entity-hack) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-propa" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (propa-method-31 this) + (set! (-> this sound-index) (the-as uint (rand-vu-int-count (-> *propa-sounds* length)))) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 4 0) + (set! (-> this hit-points) 10) + (transform-post) + (go (method-of-object this idle)) + ) + +(deftype burning-bush (process-focusable) + ((task game-task-control) + (part-off sparticle-launch-control) + (part-alert sparticle-launch-control) + (angle float) + (time float) + (rotmin float) + (rotmax float) + (bb-perm entity-perm) + ) + (:state-methods + idle + talking + menu + collect-gems + ) + (:methods + (burning-bush-method-32 (_type_) none) + (burning-bush-method-33 (_type_) none) + (burning-bush-method-34 (_type_) object) + ) + ) + + +(defstate collect-gems (burning-bush) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (process-release? *target*) + ) + :code (behavior () + (until (process-grab? *target* #f) + (suspend) + ) + (suspend) + (let ((gp-0 (-> (get-current-task-event (-> self task)) tex))) + (format 0 "skull-cost: ~d~%" gp-0) + (set! (-> *target* game gem) (- (-> *target* game gem) (the float gp-0))) + (until (time-elapsed? (-> self state-time) (* 45 (the-as int gp-0))) + (suspend) + ) + ) + (go-virtual talking) + ) + ) + +(defskelgroup skel-burning-bush burning-bush burning-bush-lod0-jg burning-bush-idle-ja + ((burning-bush-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 3.5) + ) + +(defstate idle (burning-bush) + :virtual #t + :exit (behavior () + '() + ) + :trans (behavior () + (let ((gp-0 (get-current-task-event (-> self task)))) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> self node-list data 3 bone transform)) + (v1-4 (-> a2-0 rvec quad)) + (a0-1 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 rvec quad) v1-4) + (set! (-> s5-0 uvec quad) a0-1) + (set! (-> s5-0 fvec quad) a1-0) + (set! (-> s5-0 trans quad) a2-1) + ) + (when (< (vector-dot + (-> s5-0 fvec) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans s5-0 (new 'stack-no-clear 'vector))) + ) + 0.0 + ) + ) + (let ((v1-11 (-> self entity extra perm))) + (logior! (-> v1-11 status) (entity-perm-status bit-5)) + (set! (-> self bb-perm) v1-11) + (logior! (-> v1-11 status) (entity-perm-status bit-14)) + ) + (cond + ((= (-> self bb-perm user-object 0) 1) + (if (nonzero? (-> gp-0 action)) + (spawn-from-mat (-> self part) s5-0) + ) + ) + ((= (-> gp-0 action) (game-task-action show)) + (spawn-from-mat (-> self part-off) s5-0) + ) + ((= (-> gp-0 action) (game-task-action play)) + (spawn-from-mat (-> self part-off) s5-0) + ) + ((= (-> gp-0 action) (game-task-action menu)) + (spawn-from-mat (-> self part) s5-0) + ) + (else + ) + ) + ) + (cond + ((and (or (= (-> gp-0 action) (game-task-action show)) (= (-> gp-0 action) (game-task-action menu))) + (and (burning-bush-method-34 self) (can-display-query? self (the-as string #f) -99.0)) + ) + (let ((s4-2 + (new 'stack 'font-context *font-default-matrix* 32 300 0.0 (font-color default) (font-flags shadow kerning)) + ) + (s5-1 (-> gp-0 tex)) + ) + (set! (-> s4-2 flags) (font-flags shadow kerning large)) + (let ((v1-36 s4-2)) + (set! (-> v1-36 width) (the float 340)) + ) + (let ((v1-37 s4-2)) + (set! (-> v1-37 height) (the float 80)) + ) + (let ((v1-38 s4-2)) + (set! (-> v1-38 scale) 0.6) + ) + (let ((v1-41 (-> self entity extra perm))) + (logior! (-> v1-41 status) (entity-perm-status bit-5)) + (set! (-> self bb-perm) v1-41) + (logior! (-> v1-41 status) (entity-perm-status bit-14)) + ) + (cond + ((zero? (-> self bb-perm user-object 0)) + (let ((s3-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-061d) #f) s5-1) + (s3-1 *temp-string* s4-2 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (logior! (-> *hud-skullgem* 0 flags) (hud-flags show)) + ) + (else + (let ((s3-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id press-triangle-to-talk) #f)) + (s3-2 *temp-string* s4-2 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (cond + ((= (-> gp-0 action) (game-task-action menu)) + (go-virtual menu) + ) + ((and (zero? (-> self bb-perm user-object 0)) + (or (= s5-1 (the int (-> *target* game gem))) + (< (the-as uint s5-1) (the-as uint (the int (-> *target* game gem)))) + ) + ) + (set! (-> self bb-perm user-object 0) 1) + (go-virtual collect-gems) + ) + ((= (-> self bb-perm user-object 0) 1) + (go-virtual talking) + ) + (else + (sound-play "skull-negative") + ) + ) + ) + ) + ) + (else + (if *hud-skullgem* + (logclear! (-> *hud-skullgem* 0 flags) (hud-flags show)) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-4 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 20480.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + ) + ) + ) + +(defstate talking (burning-bush) + :virtual #t + :enter (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self time) -1.0) + (process-entity-status! self (entity-perm-status no-kill) #t) + ) + :exit (behavior () + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (remove-setting! 'minimap) + (set! (-> *part-id-table* 1180 init-specs 4 initial-valuef) 14336.0) + (set! (-> *part-id-table* 1181 init-specs 4 initial-valuef) 16384.0) + (send-event *camera* 'change-target *target*) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (local-vars + (sv-272 vector) + (sv-288 quaternion) + (sv-304 (function float float float float float float)) + (sv-320 float) + (sv-336 float) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (!= (-> self time) -1.0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s5-0 gp-0) + (s4-0 (-> self root trans)) + (s3-0 vector-orient-by-quat!) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'static 'vector :y 16384.0 :z 40960.0 :w 1.0)) + (s0-0 quaternion-rotate-local-y!) + ) + (set! sv-272 (new 'stack-no-clear 'vector)) + (set! sv-288 (-> self root quat)) + (set! sv-304 lerp-scale) + (set! sv-320 (-> self rotmin)) + (set! sv-336 (-> self rotmax)) + (let* ((a2-0 (sin (* 7281.778 (-> self time)))) + (a3-0 -1.0) + (t0-0 1.0) + (a2-1 (sv-304 sv-320 sv-336 a2-0 a3-0 t0-0)) + ) + (vector+! s5-0 s4-0 (s3-0 s2-0 s1-0 (s0-0 (the-as quaternion sv-272) sv-288 a2-1))) + ) + ) + (set! (-> *camera* slave 0 trans quad) (-> gp-0 quad)) + (let ((t9-4 forward-down->inv-matrix) + (a0-6 (-> *camera* slave 0 tracking)) + (a1-3 (new 'stack-no-clear 'vector)) + (v1-18 (new 'stack-no-clear 'vector)) + ) + (let ((a2-4 (-> self root trans))) + (let ((a3-1 *up-vector*)) + (let ((t0-2 20480.0)) + (.mov vf7 t0-2) + ) + (.lvf vf5 (&-> a3-1 quad)) + ) + (.lvf vf4 (&-> a2-4 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 (&-> v1-18 quad) vf6) + (t9-4 (the-as matrix a0-6) (vector-! a1-3 v1-18 gp-0) (-> *camera* local-down)) + ) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'matrix))) + (let* ((a2-6 (-> self node-list data 3 bone transform)) + (v1-23 (-> a2-6 rvec quad)) + (a0-7 (-> a2-6 uvec quad)) + (a1-5 (-> a2-6 fvec quad)) + (a2-7 (-> a2-6 trans quad)) + ) + (set! (-> gp-1 rvec quad) v1-23) + (set! (-> gp-1 uvec quad) a0-7) + (set! (-> gp-1 fvec quad) a1-5) + (set! (-> gp-1 trans quad) a2-7) + ) + (if (< (vector-dot + (-> gp-1 fvec) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-1 (new 'stack-no-clear 'vector))) + ) + 0.0 + ) + (matrix*! gp-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 32768.0) gp-1) + ) + (+! (-> self angle) (* 100.0 (rand-vu))) + (set! (-> *part-id-table* 1180 init-specs 4 initial-valuef) + (+ 14336.0 (* 1228.8 (cos (* 182.04445 (-> self angle))))) + ) + (set! (-> *part-id-table* 1181 init-specs 4 initial-valuef) + (+ 2048.0 (-> *part-id-table* 1180 init-specs 4 initial-valuef)) + ) + (spawn-from-mat (-> self part) gp-1) + ) + ) + ) + :code (behavior () + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (suspend) + (until (process-grab? *target* #f) + (suspend) + ) + (suspend) + (if *target* + (set! (-> *target* neck flex-blend) 1.0) + ) + (add-setting! 'music-volume 'rel (-> *setting-control* user-current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* user-current sfx-volume-movie) 0) + (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-talker) 0) + (set-time! (-> self state-time)) + (let* ((v1-21 (get-current-task-event (-> self task))) + (gp-0 (add-process *gui-control* self (gui-channel bbush) (gui-action play) (-> v1-21 scene) -99.0 0)) + ) + (let ((s5-0 (current-time))) + (while (and (nonzero? (get-status *gui-control* gp-0)) (not (time-elapsed? s5-0 (seconds 60)))) + (set! (-> self time) (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (suspend) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "inter-burn-bush") + (goto cfg-13) + ) + ) + ) + (label cfg-13) + (set-action! + *gui-control* + (gui-action stop) + gp-0 + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (until (process-release? *target*) + (suspend) + ) + (task-node-close! (-> self task current-node) 'event) + (go-virtual idle) + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-4 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 20480.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + ) + ) + ) + +(defstate menu (burning-bush) + :virtual #t + :enter (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self time) -1.0) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (remove-setting! 'minimap) + (send-event *camera* 'change-target *target*) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (time-elapsed? (-> self state-time) (seconds 1.5)) + (let ((gp-0 0) + (s5-0 0) + ) + (when (cpad-pressed? 0 down l-analog-down) + (+! s5-0 1) + (if (< (+ gp-0 -1) s5-0) + (set! s5-0 (+ gp-0 -1)) + (sound-play "menu-up-down") + ) + ) + (when (cpad-pressed? 0 up l-analog-up) + (+! s5-0 -1) + (if (< s5-0 0) + (set! s5-0 0) + (sound-play "menu-up-down") + ) + ) + (let* ((s4-2 40) + (s3-2 36) + (s2-0 (- 228 (* gp-0 (/ s4-2 2)))) + (v1-19 (new + 'stack + 'font-context + *font-default-matrix* + s3-2 + s2-0 + 0.0 + (font-color default) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> v1-19 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((a0-17 v1-19)) + (set! (-> a0-17 width) (the float 440)) + ) + (let ((a0-18 v1-19)) + (set! (-> a0-18 height) (the float 50)) + ) + (let ((a0-19 v1-19)) + (set! (-> a0-19 scale) 1.0) + ) + (let ((a0-20 v1-19) + (a2-3 s3-2) + (a1-6 40) + ) + (set! (-> a0-20 origin x) (the float a2-3)) + (set! (-> a0-20 origin y) (the float a1-6)) + ) + (let ((a1-7 v1-19)) + (set! (-> a1-7 color) (font-color progress-old-yellow)) + ) + (let ((a0-22 v1-19)) + (set! (-> a0-22 height) (the float s4-2)) + ) + (dotimes (a0-23 gp-0) + (let ((a1-9 v1-19) + (a3-3 s3-2) + (a2-4 s2-0) + ) + (set! (-> a1-9 origin x) (the float a3-3)) + (set! (-> a1-9 origin y) (the float a2-4)) + ) + (let ((a1-10 v1-19)) + (set! (-> a1-10 scale) (if (= a0-23 s5-0) + 0.8 + 0.6 + ) + ) + ) + (let ((a2-6 v1-19)) + (set! (-> a2-6 color) (if (= a0-23 s5-0) + (font-color progress-old-selected) + (font-color default) + ) + ) + ) + (+! s2-0 s4-2) + ) + ) + ) + ) + (when (!= (-> self time) -1.0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (vector+! gp-1 (-> self root trans) (vector-orient-by-quat! + (new 'stack-no-clear 'vector) + (new 'static 'vector :y 24166.4 :z 32768.0 :w 1.0) + (-> self root quat) + ) + ) + (set! (-> *camera* slave 0 trans quad) (-> gp-1 quad)) + (let ((t9-6 forward-down->inv-matrix) + (a0-27 (-> *camera* slave 0 tracking)) + (a1-13 (new 'stack-no-clear 'vector)) + (v1-35 (new 'stack-no-clear 'vector)) + ) + (let ((a2-9 (-> self root trans))) + (let ((a3-4 *up-vector*)) + (let ((t0-4 24166.4)) + (.mov vf7 t0-4) + ) + (.lvf vf5 (&-> a3-4 quad)) + ) + (.lvf vf4 (&-> a2-9 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 (&-> v1-35 quad) vf6) + (t9-6 (the-as matrix a0-27) (vector-! a1-13 v1-35 gp-1) (-> *camera* local-down)) + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'matrix))) + (let* ((a2-11 (-> self node-list data 3 bone transform)) + (v1-40 (-> a2-11 rvec quad)) + (a0-28 (-> a2-11 uvec quad)) + (a1-15 (-> a2-11 fvec quad)) + (a2-12 (-> a2-11 trans quad)) + ) + (set! (-> gp-2 rvec quad) v1-40) + (set! (-> gp-2 uvec quad) a0-28) + (set! (-> gp-2 fvec quad) a1-15) + (set! (-> gp-2 trans quad) a2-12) + ) + (if (< (vector-dot + (-> gp-2 fvec) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-2 (new 'stack-no-clear 'vector))) + ) + 0.0 + ) + (matrix*! gp-2 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 32768.0) gp-2) + ) + (spawn-from-mat (-> self part-off) gp-2) + ) + ) + ) + :code (behavior () + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (suspend) + (until (process-grab? *target* #f) + (suspend) + ) + (set! (-> self time) 0.0) + (let ((s4-0 #f)) + (let ((gp-0 (add-process *gui-control* self (gui-channel bbush) (gui-action play) "cityv174" -99.0 0))) + (let ((s5-0 (current-time))) + (while (and (nonzero? (get-status *gui-control* gp-0)) (not (time-elapsed? s5-0 (seconds 60))) (not s4-0)) + (suspend) + (when (or (cpad-pressed? 0 triangle) (cpad-pressed? 0 confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (sound-play "inter-burn-bush") + (set! s4-0 #t) + ) + ) + ) + (set-action! + *gui-control* + (gui-action stop) + gp-0 + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (when (not s4-0) + (until #f + (when (or (cpad-pressed? 0 confirm) (cpad-pressed? 0 triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (sound-play "menu-pick") + #t + (goto cfg-23) + ) + (suspend) + ) + #f + ) + ) + (until (process-release? *target*) + (label cfg-23) + (suspend) + ) + (go-virtual idle) + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-4 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 20480.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + ) + ) + ) + +(defmethod burning-bush-method-34 ((this burning-bush)) + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + ) + (and *target* + (not (focus-test? *target* pilot)) + (< (fabs f30-0) 10240.0) + (< 0.0 f0-2) + (< (fabs f0-2) 20480.0) + ) + ) + ) + +(defmethod burning-bush-method-32 ((this burning-bush)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((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 tobot)) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod burning-bush-method-33 ((this burning-bush)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 260) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 261) this)) + (set! (-> this part-alert) (create-launch-control (-> *part-group-id-table* 262) this)) + 0 + (none) + ) + +;; WARN: Return type mismatch process-focusable vs burning-bush. +(defmethod relocate ((this burning-bush) (offset int)) + (if (nonzero? (-> this task)) + (&+! (-> this task) offset) + ) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) offset) + ) + (if (nonzero? (-> this part-alert)) + (&+! (-> this part-alert) offset) + ) + (the-as burning-bush ((method-of-type process-focusable relocate) this offset)) + ) + +(defmethod deactivate ((this burning-bush)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part-off)) + (kill-particles (-> this part-off)) + ) + (if (nonzero? (-> this part-alert)) + (kill-particles (-> this part-alert)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +(defmethod run-logic? ((this burning-bush)) + "Should this process be run? Checked by execute-process-tree." + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) + ) + ) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) + ) + ) + ) + +(defmethod init-from-entity! ((this burning-bush) (arg0 entity-actor)) + (burning-bush-method-32 this) + (process-drawable-from-entity! this arg0) + (ctywide-entity-hack) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-burning-bush" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (burning-bush-method-33 this) + (set! (-> this rotmin) (res-lump-float arg0 'rotmin :default -5461.3335)) + (set! (-> this rotmax) (res-lump-float arg0 'rotmax :default 5461.3335)) + (let ((f0-2 (res-lump-float (-> this entity) 'rotoffset))) + (if (!= f0-2 0.0) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-2) + ) + ) + (set! (-> this task) + (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) + ) + (set! (-> this angle) 0.0) + (set! (-> this root pause-adjust-distance) 819200.0) + (transform-post) + (go (method-of-object this idle)) + ) + +(deftype city-burning-bush-get-on-info (structure) + ((trans vector :inline) + (quat quaternion :inline) + (camera-trans vector :inline) + (camera-rot float 9) + (time float) + (fov float) + ) + ) + + +(define *city-burning-bush-get-on-info* + (new 'static 'boxed-array :type city-burning-bush-get-on-info + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1442120.5 :y 32765.543 :z -412846.9 :w 1.0) + :quat (new 'static 'quaternion :x 0.0006 :y 0.8826 :z -0.0012 :w -0.4699) + :camera-trans (new 'static 'vector :x 1458548.4 :y 46188.543 :z -449677.72 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8889 0.0 0.458 -0.0229 0.9987 0.0444 -0.4574 -0.05 0.8878) + :time 7500.0 + :fov 12743.111 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 2247272.5 :y 67314.484 :z -1134648.9 :w 1.0) + :quat (new 'static 'quaternion :x -0.1469 :y 0.0545 :z 0.0068 :w 0.9876) + :camera-trans (new 'static 'vector :x 2279621.8 :y 74105.24 :z -1128908.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6307 0.0 0.776 -0.2236 0.9575 -0.1817 -0.743 -0.2881 -0.6039) + :time 5400.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1438305.1 :y 71998.26 :z -1084914.5 :w 1.0) + :quat (new 'static 'quaternion :x 0.001 :y -0.9202 :z 0.0002 :w -0.3912) + :camera-trans (new 'static 'vector :x 1479435.0 :y 85435.59 :z -1095610.4 :w 1.0) + :camera-rot (new 'static 'array float 9 0.151 0.0 0.9885 0.0056 0.9999 -0.0008 -0.9885 0.0057 0.151) + :time 5400.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1466428.2 :y 125903.26 :z -1495985.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.2215 :w 0.9751) + :camera-trans (new 'static 'vector :x 1465902.8 :y 102859.57 :z -1401041.8 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9864 0.0 0.1639 0.0493 0.9536 0.2967 -0.1563 0.3008 -0.9407) + :time 6600.0 + :fov 10922.667 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 634022.3 :y 122880.0 :z -697692.56 :w 1.0) + :quat (new 'static 'quaternion :x -0.0012 :y 0.6246 :z 0.0009 :w -0.7808) + :camera-trans (new 'static 'vector :x 684180.7 :y 160337.52 :z -642709.1 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6785 0.0 0.7345 -0.3495 0.8795 -0.3229 -0.646 -0.4758 -0.5967) + :time 5100.0 + :fov 10922.667 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1966872.6 :y 47686.86 :z -206054.19 :w 1.0) + :quat (new 'static 'quaternion :y 0.9988 :w 0.0482) + :camera-trans (new 'static 'vector :x 1971155.4 :y 38171.44 :z -273855.7 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9641 0.0 -0.2652 0.0043 0.9998 0.0158 0.2652 -0.0164 0.964) + :time 6900.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 2645027.2 :y 7752.499 :z -2422284.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.9993 :w -0.0352) + :camera-trans (new 'static 'vector :x 2643901.8 :y 20940.8 :z -2451367.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.818 0.0 0.5751 -0.061 0.9943 0.0869 -0.5718 -0.1062 0.8134) + :time 5400.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 2339761.0 :y 92694.12 :z -3021732.8 :w 1.0) + :quat (new 'static 'quaternion :y 0.3606 :w -0.9326) + :camera-trans (new 'static 'vector :x 2329062.2 :y 105224.6 :z -2983756.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.7717 0.0 -0.6359 0.3292 0.8555 -0.3995 0.544 -0.5177 -0.6602) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 3210766.0 :y 32764.314 :z 787847.2 :w 1.0) + :quat (new 'static 'quaternion :x 0.0008 :y 0.5021 :z 0.0011 :w -0.8647) + :camera-trans (new 'static 'vector :x 3185149.2 :y 40500.84 :z 778470.6 :w 1.0) + :camera-rot (new 'static 'array float 9 0.1119 0.0 -0.9937 0.0693 0.9975 0.0078 0.9912 -0.0697 0.1116) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 4139099.2 :y 37910.527 :z 1484301.5 :w 1.0) + :quat (new 'static 'quaternion :x -0.0002 :y -0.1337 :z 0.0015 :w 0.991) + :camera-trans (new 'static 'vector :x 4120032.5 :y 53998.387 :z 1506306.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6088 0.0 -0.7932 0.1409 0.984 -0.1082 0.7806 -0.1777 -0.5991) + :time 3300.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 3936017.2 :y 94799.46 :z 2196627.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0015 :y -0.483 :z -0.0002 :w -0.8755) + :camera-trans (new 'static 'vector :x 3910655.2 :y 104816.23 :z 2183312.2 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6539 0.0 -0.7564 0.0916 0.9926 0.0792 0.7509 -0.1211 0.6491) + :time 4200.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 4434624.0 :y 100512.56 :z 2489095.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0005 :y 0.1411 :w 0.9899) + :camera-trans (new 'static 'vector :x 4484939.5 :y 121671.27 :z 2430261.2 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6538 0.0 0.7566 -0.4974 0.7535 0.4298 -0.5701 -0.6573 0.4926) + :time 3000.0 + :fov 18204.445 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 3858326.8 :y 99340.695 :z 3912547.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.0271 :w 0.9996) + :camera-trans (new 'static 'vector :x 3848977.5 :y 111943.68 :z 3934181.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8843 0.0 -0.4667 0.1047 0.9744 -0.1984 0.4548 -0.2243 -0.8618) + :time 3900.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 3764324.2 :y 98499.79 :z 4562610.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0012 :y 0.0062 :w 0.9999) + :camera-trans (new 'static 'vector :x 3691300.0 :y 123541.914 :z 4541654.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.2135 0.0 -0.9769 0.2535 0.9657 0.0554 0.9434 -0.2594 0.2062) + :time 3900.0 + :fov 7281.778 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 4427024.5 :y 74095.414 :z 3948627.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.972 :w 0.2349) + :camera-trans (new 'static 'vector :x 4436096.0 :y 88536.266 :z 3978709.8 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9909 0.0 0.1338 -0.0287 0.9767 -0.2124 -0.1307 -0.2143 -0.9679) + :time 3900.0 + :fov 18204.445 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1377852.2 :y 76197.89 :z 7083083.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0004 :y 0.3829 :z -0.001 :w 0.9237) + :camera-trans (new 'static 'vector :x 1263103.6 :y 188428.28 :z 6971105.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.5705 0.0 -0.8212 0.5598 0.7316 0.3889 0.6008 -0.6817 0.4174) + :time 1800.0 + :fov 5461.3335 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x -942875.9 :y 96113.46 :z 6424137.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0002 :y 0.9944 :w 0.1048) + :camera-trans (new 'static 'vector :x -755284.4 :y 180505.81 :z 6304042.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6079 0.0 0.7939 -0.329 0.9101 0.2519 -0.7225 -0.4143 0.5533) + :time 2100.0 + :fov 3640.889 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x -1205959.5 :y 114149.375 :z 5692970.5 :w 1.0) + :quat (new 'static 'quaternion :x -0.0005 :y 0.8807 :z -0.001 :w -0.4736) + :camera-trans (new 'static 'vector :x -1230954.9 :y 126642.586 :z 5698481.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.1203 0.0 -0.9927 0.4576 0.8874 -0.0554 0.8809 -0.4609 -0.1068) + :time 6900.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1641758.8 :y 97295.98 :z 5436796.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0001 :y 0.4706 :z 0.0001 :w 0.8823) + :camera-trans (new 'static 'vector :x 1620224.0 :y 105643.625 :z 5418739.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8069 0.0 -0.5906 0.1079 0.9831 0.1474 0.5807 -0.1826 0.7933) + :time 4500.0 + :fov 14563.556 + ) + ) + ) + +(deftype task-manager-ctywide-bbush-get-to (task-manager) + ((skill handle) + ) + (:methods + (task-manager-ctywide-bbush-get-to-method-32 (_type_) none) + ) + ) + + +(defmethod task-manager-ctywide-bbush-get-to-method-32 ((this task-manager-ctywide-bbush-get-to)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + 0 + (none) + ) + +(defmethod set-time-limit ((this task-manager-ctywide-bbush-get-to)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (task-manager-ctywide-bbush-get-to-method-32 this) + (when (nonzero? (-> this skill)) + (let ((a0-5 (handle->process (-> this skill)))) + (if a0-5 + (deactivate a0-5) + ) + ) + ) + (none) + ) + +(defstate active (task-manager-ctywide-bbush-get-to) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (send-event self 'complete) + ) + (('die) + (send-event self 'fail) + ) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (while (not (process-grab? *target* #f)) + (suspend) + ) + (let ((t1-1 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) + (a0-3 (new 'stack-no-clear 'vector)) + ) + (logior! (-> t1-1 options) (actor-option fade-out)) + (set! (-> t1-1 fade-time) + (the-as time-frame (the int (-> *city-burning-bush-get-on-info* (-> self info index) time))) + ) + (set! (-> a0-3 quad) (-> *city-burning-bush-get-on-info* (-> self info index) trans quad)) + (+! (-> a0-3 y) 4096.0) + (set! (-> self skill) + (ppointer->handle + (birth-pickup-at-point a0-3 (pickup-type skill) (-> *FACT-bank* super-skill-inc) #t self t1-1) + ) + ) + ) + (set-time! (-> self start-time)) + (set! (-> self time-limit) + (the-as time-frame (the int (+ 300.0 (-> *city-burning-bush-get-on-info* (-> self info index) time)))) + ) + (suspend) + (send-event (handle->process (-> self skill)) 'get-notify self) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set! (-> *ACTOR-bank* birth-max) 1000) + (suspend) + (let ((f30-0 (-> *camera* settings fov))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *camera-combiner* trans quad)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-7 (-> *camera-combiner* inv-camera-rot)) + (v1-46 (-> a2-7 rvec quad)) + (a0-15 (-> a2-7 uvec quad)) + (a1-15 (-> a2-7 fvec quad)) + (a2-8 (-> a2-7 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-46) + (set! (-> gp-0 uvec quad) a0-15) + (set! (-> gp-0 fvec quad) a1-15) + (set! (-> gp-0 trans quad) a2-8) + ) + (let ((s4-0 (new 'stack 'transformq))) + (let ((v1-52 (-> *city-burning-bush-get-on-info* (-> self info index))) + (a1-17 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s4-0 trans quad) (-> v1-52 camera-trans quad)) + (set-vector! (-> s4-0 scale) 1.0 1.0 1.0 1.0) + (set! (-> a1-17 rvec x) (-> v1-52 camera-rot 0)) + (set! (-> a1-17 rvec y) (-> v1-52 camera-rot 1)) + (set! (-> a1-17 rvec z) (-> v1-52 camera-rot 2)) + (set! (-> a1-17 rvec w) 0.0) + (set! (-> a1-17 uvec x) (-> v1-52 camera-rot 3)) + (set! (-> a1-17 uvec y) (-> v1-52 camera-rot 4)) + (set! (-> a1-17 uvec z) (-> v1-52 camera-rot 5)) + (set! (-> a1-17 uvec w) 0.0) + (set! (-> a1-17 fvec x) (-> v1-52 camera-rot 6)) + (set! (-> a1-17 fvec y) (-> v1-52 camera-rot 7)) + (set! (-> a1-17 fvec z) (-> v1-52 camera-rot 8)) + (set! (-> a1-17 fvec w) 0.0) + (set! (-> a1-17 trans x) 0.0) + (set! (-> a1-17 trans y) 0.0) + (set! (-> a1-17 trans z) 0.0) + (set! (-> a1-17 trans w) 1.0) + (matrix->quaternion (-> s4-0 quat) a1-17) + ) + (send-event *camera* 'teleport-to-transformq s4-0) + ) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 (seconds 3)) + (set! (-> *camera* slave 0 fov) (-> *city-burning-bush-get-on-info* (-> self info index) fov)) + (suspend) + ) + ) + (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) + (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) + (v1-74 (-> gp-0 rvec quad)) + (a0-24 (-> gp-0 uvec quad)) + (a1-19 (-> gp-0 fvec quad)) + (a3-5 (-> gp-0 trans quad)) + ) + (set! (-> a2-15 rvec quad) v1-74) + (set! (-> a2-15 uvec quad) a0-24) + (set! (-> a2-15 fvec quad) a1-19) + (set! (-> a2-15 trans quad) a3-5) + ) + ) + ) + (set! (-> *camera* settings fov) f30-0) + ) + (remove-setting! 'minimap) + (set! (-> *ACTOR-bank* birth-max) 1000) + (let ((a0-28 (get-continue-by-name *game-info* (-> self node-info reset fail-info retry continue))) + (gp-1 (new 'static 'vector :z 1.0)) + ) + (when a0-28 + (move-camera! a0-28) + (set-vector! + gp-1 + (-> *camera-combiner* inv-camera-rot uvec x) + (-> *camera-combiner* inv-camera-rot uvec y) + (-> *camera-combiner* inv-camera-rot uvec z) + 1.0 + ) + (vector-negate-in-place! gp-1) + (set-setting! 'string-startup-vector 'abs gp-1 0) + ) + ) + (persist-with-delay *setting-control* 'interp-time (seconds 0.5) 'interp-time 'abs 0.0 0) + (remove-setting! 'fov) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + (while (not (process-release? *target*)) + (suspend) + ) + (until #f + (hud-timer-handler self) + (suspend) + ) + #f + ) + ) + +(defmethod gen-static-macro ((this city-race-ring-info) (arg0 object)) + (format arg0 "(static-race-ring-info~%") + (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%" (-> this pos x) (-> this pos y) (-> this pos z)) + (let ((f0-3 (-> this pos w))) + (format arg0 " :angle (deg ~f)~%" (* 0.005493164 f0-3)) + ) + (if (!= (-> this boost) 1.0) + (format arg0 " :boost ~4,,2f~%" (-> this boost)) + ) + (format arg0 " :dist (meters ~4,,2M)~%" (-> this dist)) + (format arg0 " ~%)~%") + 0 + (none) + ) + +(defmethod init ((this city-ambush-info) (arg0 traffic-object-spawn-params)) + (set! (-> arg0 position quad) (-> this array 0 pos quad)) + (set! (-> arg0 nav-mesh) (find-nearest-nav-mesh (-> arg0 position) (the-as float #x7f800000))) + (vector-reset! (-> arg0 velocity)) + (dotimes (s4-0 (-> this count)) + (let ((v1-3 (-> this array s4-0))) + (set! (-> arg0 position quad) (-> v1-3 pos quad)) + (set! (-> arg0 object-type) (-> v1-3 obj-type)) + ) + (send-event *traffic-manager* 'activate-object arg0) + 0 + ) + 0 + (none) + ) + +(deftype ctyn-lamp (process-focusable) + () + (:state-methods + idle + die + ) + (:methods + (ctyn-lamp-method-30 (_type_) none) + (ctyn-lamp-method-31 (_type_) none) + ) + ) + + +(defskelgroup skel-ctyn-lamp ctyn-lamp 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 5)) + +(defskelgroup skel-ctyn-lamp-explode ctyn-lamp 3 5 ((4 (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 (collide-spec backgnd) + ) + ) + +(defstate idle (ctyn-lamp) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (-> block param 1) + (let ((s5-0 proc) + (gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1))) + ) + (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (the-as joint-exploder 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 level) #f)) + 5 + gp-0 + *ctyn-lamp-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (go-virtual die) + ) + ) + ) + :code sleep-code + ) + +(defstate die (ctyn-lamp) + :virtual #t + :enter #f + :exit #f + :trans #f + :code (behavior () + (sound-play "lamp-hit") + (let ((v1-3 (-> self root 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) + ) + :post #f + ) + +(defmethod ctyn-lamp-method-30 ((this ctyn-lamp)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod ctyn-lamp-method-31 ((this ctyn-lamp)) + (logior! (-> this mask) (process-mask crate)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this ctyn-lamp) (arg0 entity-actor)) + (ctyn-lamp-method-30 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyn-lamp" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ctyn-lamp-method-31 this) + (transform-post) + (go (method-of-object this idle)) + ) + +(deftype fac-lowrez-move (structure) + ((light light-state :inline) + (roty float) + (rotz float) + (rot-bob float) + (wobble float) + (bob float) + ) + :pack-me + ) + + +(deftype fac-lorez (process-drawable) + ((move-info fac-lowrez-move :inline) + ) + (:state-methods + idle + ) + ) + + +(defskelgroup skel-fac-lorez fac-lorez fac-lorez-lod0-jg fac-lorez-idle-ja + ((fac-lorez-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 400) + ) + +(defmethod init-from-entity! ((this fac-lorez) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-lorez" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) + ) + +(defmethod run-logic? ((this fac-lorez)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defstate idle (fac-lorez) + :virtual #t + :trans (behavior () + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-vector-angle! s5-0 *y-vector* (- (-> self move-info roty))) + (quaternion-vector-angle! gp-0 *z-vector* (-> self move-info wobble)) + (quaternion*! (-> self root quat) gp-0 s5-0) + ) + (quaternion-normalize! (-> self root quat)) + (let ((f0-4 (+ (-> self move-info roty) (* 910.2222 (seconds-per-frame))))) + (set! (-> self move-info roty) (- f0-4 (* (the float (the int (/ f0-4 65536.0))) 65536.0))) + ) + (let ((f0-7 (+ (-> self move-info rotz) (* 8192.0 (seconds-per-frame))))) + (set! (-> self move-info rotz) (- f0-7 (* (the float (the int (/ f0-7 65536.0))) 65536.0))) + ) + (set! (-> self move-info wobble) (* 910.2222 (sin (-> self move-info rotz)))) + (let ((f0-13 (+ (-> self move-info rot-bob) (* 16384.0 (seconds-per-frame))))) + (set! (-> self move-info rot-bob) (- f0-13 (* (the float (the int (/ f0-13 65536.0))) 65536.0))) + ) + (set! (-> self move-info bob) (+ -40960.0 (* 40960.0 (sin (-> self move-info rot-bob))))) + ) + :code sleep-code + :post ja-post + ) + +(deftype flitter-spawner (process-drawable) + ((actor-group (pointer actor-group) :offset 204) + (actor-group-count int32) + (spawner proc-focusable-spawner) + (desired-spawn-count int32) + (spawn-times (array time-frame)) + (last-seen-times (array time-frame)) + ) + (:state-methods + active + ) + (:methods + (spawn-flitter (_type_ entity-actor) object) + ) + ) + + +(defmethod relocate ((this flitter-spawner) (offset int)) + (if (nonzero? (-> this spawner)) + (&+! (-> this spawner) offset) + ) + (if (nonzero? (-> this spawn-times)) + (&+! (-> this spawn-times) offset) + ) + (if (nonzero? (-> this last-seen-times)) + (&+! (-> this last-seen-times) offset) + ) + (call-parent-method this offset) + ) + +(defmethod run-logic? ((this flitter-spawner)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod init-from-entity! ((this flitter-spawner) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this entity) arg0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (cond + ((and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) v1-2) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-scenecamera" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this desired-spawn-count) 8) + (when (> (-> this actor-group-count) 0) + (set! (-> this spawner) (new 'process 'proc-focusable-spawner)) + (set! (-> this spawn-times) (new 'process 'boxed-array time-frame (-> this actor-group-count))) + (alloc-records! (-> this spawner) (+ (-> this desired-spawn-count) 2) 'process) + (set! (-> this last-seen-times) (new 'process 'boxed-array time-frame (+ (-> this desired-spawn-count) 2))) + (dotimes (s5-2 (-> this spawner records length)) + (let ((s4-1 (new 'stack-no-clear 'traffic-object-spawn-params))) + (set! (-> s4-1 velocity quad) (the-as uint128 0)) + (set! (-> s4-1 behavior) (the-as uint 1)) + (set! (-> s4-1 object-type) (traffic-type metalhead-flitter)) + (set! (-> s4-1 flags) (traffic-spawn-flags tsf0)) + (set! (-> s4-1 nav-branch) #f) + (set! (-> this spawner records data s5-2 proc) + (ppointer->handle + (process-spawn metalhead-flitter :init citizen-init-by-other s4-1 :name "metalhead-flitter" :to this) + ) + ) + ) + ) + ) + (go (method-of-object this active)) + ) + +(defmethod spawn-flitter ((this flitter-spawner) (arg0 entity-actor)) + (let ((gp-0 (new 'stack-no-clear 'traffic-object-spawn-params))) + (set! (-> gp-0 velocity quad) (the-as uint128 0)) + (set! (-> gp-0 position quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> gp-0 rotation) (-> arg0 quat)) + (set! (-> gp-0 behavior) (the-as uint 2)) + (set! (-> gp-0 object-type) (traffic-type metalhead-flitter)) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (set! (-> gp-0 user-data) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 nav-branch) #f) + (let ((s4-0 (-> gp-0 position))) + (let ((s3-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> s3-0 start-pos) s4-0 *up-vector* 24576.0) + (set! (-> s3-0 move-dist quad) (the-as uint128 0)) + (set! (-> s3-0 move-dist y) -81920.0) + (let ((v1-8 s3-0)) + (set! (-> v1-8 radius) 40.96) + (set! (-> v1-8 collide-with) (collide-spec backgnd)) + (set! (-> v1-8 ignore-process0) #f) + (set! (-> v1-8 ignore-process1) #f) + (set! (-> v1-8 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-8 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) + (set! (-> s4-0 quad) (-> s3-0 best-other-tri intersect quad)) + ) + ) + (set! (-> gp-0 nav-mesh) (find-nearest-nav-mesh s4-0 (the-as float #x7f800000))) + ) + (let ((a0-15 (get-last-unused-val! (-> this spawner)))) + (when (>= a0-15 0) + (let ((v1-18 (-> this spawner records data a0-15 proc))) + (set-time! (-> this last-seen-times a0-15)) + (send-event (handle->process v1-18) 'traffic-activate gp-0 *traffic-engine*) + ) + ) + ) + ) + ) + +(defstate active (flitter-spawner) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 1)) + (set-time! (-> self state-time)) + (let ((gp-0 0)) + (dotimes (s5-0 (-> self spawner records length)) + (let* ((s4-0 (handle->process (-> self spawner records data s5-0 proc))) + (v1-11 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when v1-11 + (if (not (focus-test? (the-as process-focusable v1-11) disable dead inactive)) + (+! gp-0 1) + ) + ) + ) + ) + (when (< gp-0 (-> self desired-spawn-count)) + (let ((gp-1 0)) + (dotimes (s5-1 (length (-> self actor-group 0))) + (let ((s4-1 (-> self actor-group 0 data s5-1 actor))) + (when s4-1 + (if (and (is-object-visible? (-> s4-1 extra level) (-> s4-1 vis-id)) + (let ((s3-0 sphere-in-view-frustum?) + (a0-13 (new 'stack 'sphere)) + ) + (set! (-> a0-13 quad) (-> s4-1 extra trans quad)) + (set! (-> a0-13 r) 8192.0) + (or (not (s3-0 a0-13)) (< 409600.0 (vector-vector-distance (-> s4-1 extra trans) (camera-pos)))) + ) + (time-elapsed? (-> self spawn-times s5-1) (seconds 3)) + (< 61440.0 (vector-vector-distance (-> s4-1 extra trans) (target-pos 0))) + ) + (set! gp-1 (logior gp-1 (ash 1 s5-1))) + ) + ) + ) + ) + (when (nonzero? gp-1) + (let* ((a1-10 (lognot gp-1)) + (v1-52 (rand-vu-int-count-excluding (-> self actor-group 0 length) a1-10)) + ) + (set-time! (-> self spawn-times v1-52)) + (spawn-flitter self (-> self actor-group 0 data v1-52 actor)) + ) + ) + ) + ) + ) + (check-inactive (-> self spawner)) + (dotimes (gp-2 (-> self last-seen-times length)) + (let* ((s4-3 (handle->process (-> self spawner records data gp-2 proc))) + (s5-2 (if (type? s4-3 process-focusable) + s4-3 + ) + ) + (s4-4 (new 'stack 'sphere)) + ) + 0.0 + (when (the-as process-focusable s5-2) + (let ((f30-2 (vector-vector-distance (-> (the-as process-focusable s5-2) root trans) (target-pos 0)))) + (set! (-> s4-4 quad) (-> (the-as process-focusable s5-2) root trans quad)) + (set! (-> s4-4 r) 8192.0) + (if (or (and (sphere-in-view-frustum? s4-4) (< f30-2 307200.0)) (< f30-2 61440.0)) + (set-time! (-> self last-seen-times gp-2)) + ) + (if (and (time-elapsed? (-> self last-seen-times gp-2) (seconds 10)) + (or (not (sphere-in-view-frustum? s4-4)) (< 409600.0 f30-2)) + ) + (send-event s5-2 'traffic-off-force) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + ) + +(deftype flitter-point (process-hidden) + () + ) + + +(deftype board-score-hud (hud-goal) + () + ) + + +(defmethod draw ((this board-score-hud)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 447 70) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this board-score-hud)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this board-score-hud)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) + (let ((s5-0 format) + (gp-1 (clear (-> this strings 1 text))) + (s4-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0866) #f)) + (s5-0 gp-1 s4-0 *temp-string*) + ) + 0 + (none) + ) + +(deftype task-manager-bbush-board (task-manager) + ((score float) + (challenge-done symbol) + (hud-score handle) + (hud-goal handle) + (game-score uint8) + (new-high-score symbol) + (goal-cup uint8) + (last-cup uint8) + (roll-back-task? symbol) + ) + (:methods + (task-manager-bbush-board-method-32 (_type_) none) + (task-manager-bbush-board-method-33 (_type_) none) + (task-manager-bbush-board-method-34 (_type_ float) none) + ) + ) + + +(defmethod task-manager-bbush-board-method-32 ((this task-manager-bbush-board)) + (set-setting! 'music 'cityjetb 0.0 0) + (set-setting! 'city-sound '(citybb1) 0.0 2) + 0 + (none) + ) + +(defmethod set-time-limit ((this task-manager-bbush-board)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this game-score) (the-as uint 10)) + (set! (-> this hud-score) (the-as handle #f)) + (set! (-> this hud-goal) (the-as handle #f)) + (if (= (-> this hud-score) #f) + (set! (-> this hud-score) + (ppointer->handle (process-spawn board-score-hud :init hud-init-by-other :name "board-score-hud" :to this)) + ) + ) + (if (= (-> this hud-goal) #f) + (set! (-> this hud-goal) + (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :name "hud-goal" :to this)) + ) + ) + (set! (-> this roll-back-task?) #f) + (task-manager-bbush-board-method-32 this) + (none) + ) + +(defmethod task-manager-bbush-board-method-33 ((this task-manager-bbush-board)) + (when (< (-> *game-info* goal) (-> this score)) + (set! (-> this new-high-score) #t) + (when (>= (the-as uint 3) (-> this goal-cup)) + (sound-play "special-pickup") + (+! (-> this goal-cup) 1) + ) + ) + (set! (-> *game-info* goal) + (game-info-method-31 *game-info* (the-as int (-> this game-score)) (the-as int (-> this goal-cup))) + ) + (let ((v1-14 (handle->process (-> this hud-goal)))) + (when v1-14 + (let ((s5-1 format) + (s4-1 (clear (-> (the-as hud v1-14) strings 1 text))) + (s3-0 "~S") + ) + (let* ((s2-0 format) + (s1-0 (clear *temp-string*)) + (a0-13 *common-text*) + (t9-5 (method-of-object a0-13 lookup-text!)) + (v1-17 (-> this goal-cup)) + ) + (s2-0 s1-0 (t9-5 + a0-13 + (cond + ((= v1-17 1) + (text-id text-0139) + ) + ((= v1-17 2) + (text-id text-0138) + ) + ((= v1-17 3) + (text-id text-0137) + ) + (else + (text-id text-0136) + ) + ) + #f + ) + ) + ) + (s5-1 s4-1 s3-0 *temp-string*) + ) + ) + ) + 0 + (none) + ) + +(defmethod task-manager-bbush-board-method-34 ((this task-manager-bbush-board) (arg0 float)) + (set! (-> this roll-back-task?) #t) + (let* ((s2-0 (-> this game-score)) + (s4-0 (game-info-method-29 *game-info* (the-as int s2-0))) + (t0-0 (get-highscore-rank *game-info* (the-as int s2-0) arg0)) + (s3-1 (max 0 (- t0-0 s4-0))) + ) + (let ((t9-2 format) + (a0-3 #t) + (a1-3 "report-score ~s ~f my-cup ~d prev-cup ~d eggs ~d~%") + (v1-4 s2-0) + ) + (t9-2 + a0-3 + a1-3 + (cond + ((= v1-4 7) + "snake-total-jump-distance" + ) + ((= v1-4 5) + "snake-total-air-time" + ) + ((= v1-4 10) + "hoverboard" + ) + ((= v1-4 12) + "gungame-2" + ) + ((= v1-4 17) + "arena-training" + ) + ((= v1-4 8) + "snake-roll-count" + ) + ((= v1-4 14) + "gungame-4" + ) + ((= v1-4 6) + "snake-jump-distance" + ) + ((= v1-4 13) + "gungame-3" + ) + ((= v1-4 4) + "snake-air-time" + ) + ((= v1-4 9) + "wascity-gungame-1" + ) + ((zero? v1-4) + "none" + ) + ((= v1-4 15) + "power-game" + ) + ((= v1-4 3) + "snake-race" + ) + ((= v1-4 1) + "neo-sat-game" + ) + ((= v1-4 16) + "destroy-interceptors" + ) + ((= v1-4 11) + "gungame-1" + ) + ((= v1-4 2) + "turtle-race" + ) + (else + "*unknown*" + ) + ) + arg0 + t0-0 + s4-0 + s3-1 + ) + ) + (game-info-method-27 *game-info* (the-as game-score s2-0) arg0) + (let ((v1-7 (new 'static 'fact-info)) + (f30-0 (* (the float s3-1) (the float (-> this info user-count)))) + ) + (set! (-> v1-7 options) (actor-option)) + (logior! (-> v1-7 options) (actor-option suck-in)) + (cond + ((< (the-as uint s4-0) (the-as uint 3)) + (cond + ((zero? s3-1) + (send-event this 'fail) + ) + (else + (give *game-info* 'skill f30-0 (the-as handle #f)) + (until (time-elapsed? (-> this state-time) (the int (* 45.0 f30-0))) + (suspend) + ) + ) + ) + ) + (else + (let ((f0-5 (game-info-method-31 *game-info* (the-as int (-> this game-score)) (the-as int (-> this goal-cup))))) + (if (< arg0 f0-5) + (send-event this 'fail) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate active (task-manager-bbush-board) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trick-judge) + (set! (-> self score) (the-as float (-> block param 1))) + (let ((v0-0 (the-as object #t))) + (set! (-> self challenge-done) (the-as symbol v0-0)) + v0-0 + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (until #f + (set! (-> self score) 0.0) + (set! (-> self challenge-done) #f) + (send-event *target* 'get-notify self) + (let ((gp-1 (ppointer->handle (judge-spawn self (target-pos 0) (the-as uint 0) #t)))) + (suspend) + (while (send-event (handle->process (the-as handle gp-1)) 'waiting) + (suspend) + ) + (set! (-> self last-cup) (the-as uint (game-info-method-29 *game-info* (the-as int (-> self game-score))))) + (format #t "last-cup: ~d~%" (-> self last-cup)) + (set! (-> self goal-cup) (+ (-> self last-cup) 1)) + (suspend) + (while (send-event (handle->process (the-as handle gp-1)) 'judging) + (set! (-> self score) (-> *game-info* score)) + (task-manager-bbush-board-method-33 self) + (suspend) + ) + ) + (send-event (handle->process (-> self hud-score)) 'hide-and-die) + (send-event (handle->process (-> self hud-goal)) 'hide-and-die) + (task-manager-bbush-board-method-34 self (-> self score)) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (let ((v1-41 (process->ppointer self))) + (set! (-> a1-9 from) v1-41) + ) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'complete) + (send-event-function self a1-9) + ) + ) + #f + ) + ) + +(defstate resolution (task-manager-bbush-board) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-31 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (cond + ((-> self roll-back-task?) + (let ((a0-13 (-> self node-info parent-node 0))) + (task-node-open! a0-13 'event) + ) + ) + (else + (task-node-close! (-> self info final-node) 'event) + ) + ) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-31 (or (handle->process (-> self arrow)) (begin + (countdown (v1-32 4) + (when (handle->process (-> self hud v1-32)) + (set! v1-31 #t) + (goto cfg-42) + ) + ) + #f + ) + ) + ) + (label cfg-42) + v1-31 + ) + (suspend) + ) + ) + ) + +(defpartgroup group-mh-tower-smoke-cty + :id 297 + :flags (sp0 sp4 sp11) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1286 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7))) + ) + +(defpart 1286 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.001 0.05) + (:x (meters -10) (meters 20)) + (:y (meters -30)) + (:z (meters -10) (meters 20)) + (:scale-x (meters 40) (meters 10)) + (:rot-z (degrees 160) (degrees 40)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 10.0) + (:a 0.0) + (:vel-y (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.033333335)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.13333334 0.26666668) + (:accel-x (meters 0.00016666666)) + (:friction 0.997) + (:timer (seconds 166.67)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 1287) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1287 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 1288) + ) + ) + +(defpart 1288 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14222223) + (:fade-g 0.031111112) + (:fade-b 0.13111112) + (:next-time (seconds 2)) + (:next-launcher 1289) + ) + ) + +(defpart 1289 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.006 -0.0024)) + ) + +(deftype mh-tower-smoke-cty (process-drawable) + () + (:state-methods + idle + die + ) + ) + + +(defmethod deactivate ((this mh-tower-smoke-cty)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +(defstate idle (mh-tower-smoke-cty) + :virtual #t + :code sleep-code + :post (behavior () + (spawn (-> self part) (-> self root trans)) + ) + ) + +(defstate die (mh-tower-smoke-cty) + :virtual #t + :code (behavior () + '() + ) + ) + +(defmethod run-logic? ((this mh-tower-smoke-cty)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod init-from-entity! ((this mh-tower-smoke-cty) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 297) this)) + (cond + ((not (task-node-closed? (game-task-node tower-destroy-resolution))) + (cleanup-for-death this) + (go (method-of-object this die)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) diff --git a/goal_src/jak3/levels/city/ctywide-part.gc b/goal_src/jak3/levels/city/ctywide-part.gc index bcfcc1b484..2cb62280eb 100644 --- a/goal_src/jak3/levels/city/ctywide-part.gc +++ b/goal_src/jak3/levels/city/ctywide-part.gc @@ -5,5 +5,2897 @@ ;; name in dgo: ctywide-part ;; dgos: CWI +(define-extern *range-color-gas-flame* curve-color-fast) +(define-extern *range-alpha-gas-flame* curve2d-fast) +(define-extern *range-scale-gas-flame-x* curve2d-fast) +(define-extern *range-scale-gas-flame-y* curve2d-fast) +(define-extern *r-curve-gas-flame* curve2d-fast) +(define-extern *g-curve-gas-flame* curve2d-fast) +(define-extern *b-curve-gas-flame* curve2d-fast) +(define-extern *curve-alpha-gas-flame* curve2d-fast) +(define-extern *curve-gas-flame-x* curve2d-fast) +(define-extern *curve-gas-flame-y* curve2d-fast) +(define-extern *range-kgpickup-dust-color* curve-color-fast) +(define-extern *range-kgpickup-dust-alpha* curve2d-fast) +(define-extern *range-kgpickup-dust-scale-x* curve2d-fast) +(define-extern *range-kgpickup-dust-scale-y* curve2d-fast) +(define-extern *curve-kgpickup-dust-alpha* curve2d-fast) +(define-extern *curve-kgpickup-dust-scale-x* curve2d-fast) +(define-extern *curve-kgpickup-dust-scale-y* curve2d-fast) +(define-extern *range-kgpickup-color* curve-color-fast) +(define-extern *range-kgpickup-alpha* curve2d-fast) +(define-extern *range-kgpickup-scale-x* curve2d-fast) +(define-extern *range-kgpickup-scale-y* curve2d-fast) +(define-extern *curve-kgpickup-alpha* curve2d-fast) +(define-extern *curve-kgpickup-scale-x* curve2d-fast) +(define-extern *curve-kgpickup-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-ctywide-stadium-light + :id 258 + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1165 :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 1166 :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 1165 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 48.5) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +(defpart 1166 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 96) (meters 0.1)) + (:rot-x (degrees 78.75)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +(defpartgroup group-ctywide-baron-propoganda-holo + :id 259 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1173 :flags (is-3d sp6 sp7)) + (sp-item 1174 :fade-after (meters 150) :flags (sp6 sp7)) + (sp-item 1175 :binding 1167) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1168) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1169) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1170) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1171) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1172) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1168) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1169) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1170) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1171) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1172) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1168) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1169) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1170) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1171) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1172) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1168) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1169) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1170) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1171) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1172) + (sp-item 1168 :flags (is-3d sp1 sp2)) + (sp-item 1169 :flags (is-3d sp1 sp2)) + (sp-item 1170 :flags (is-3d sp1 sp2)) + (sp-item 1171 :flags (is-3d sp1 sp2)) + (sp-item 1172 :flags (is-3d sp1 sp2)) + (sp-item 1168 :flags (is-3d sp1 sp2)) + (sp-item 1169 :flags (is-3d sp1 sp2)) + (sp-item 1170 :flags (is-3d sp1 sp2)) + (sp-item 1171 :flags (is-3d sp1 sp2)) + (sp-item 1172 :flags (is-3d sp1 sp2)) + (sp-item 1168 :flags (is-3d sp1 sp2)) + (sp-item 1169 :flags (is-3d sp1 sp2)) + (sp-item 1170 :flags (is-3d sp1 sp2)) + (sp-item 1171 :flags (is-3d sp1 sp2)) + (sp-item 1172 :flags (is-3d sp1 sp2)) + (sp-item 1168 :flags (is-3d sp1 sp2)) + (sp-item 1169 :flags (is-3d sp1 sp2)) + (sp-item 1170 :flags (is-3d sp1 sp2)) + (sp-item 1171 :flags (is-3d sp1 sp2)) + (sp-item 1172 :flags (is-3d sp1 sp2)) + (sp-item 1176 :flags (is-3d sp6 sp7)) + (sp-item 1177 :fade-after (meters 150) :flags (sp6)) + ) + ) + +(defpart 1177 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.9 0.1) + (:y (meters 3.1)) + (:scale-x (meters 2) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 17) (degrees 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 1 128.0) + (:b 0.0 128.0) + (:a 16.0 16.0) + (:omega (degrees 3386.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 2048.0) + ) + ) + +(defun birth-func-ctywide-baron-propoganda-ticker-rotate ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-6 float) (v1-7 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg4 sprite))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 arg2) + (f0-0 (-> v1-0 qx-qy-qz-sy x)) + (f1-0 (-> v1-0 qx-qy-qz-sy y)) + (f2-0 (-> v1-0 qx-qy-qz-sy z)) + ) + (set! (-> s4-0 x) f0-0) + (set! (-> s4-0 y) f1-0) + (set! (-> s4-0 z) f2-0) + (set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion-rotate-y! s4-0 s4-0 (+ 8192.0 (-> s5-0 sprite flag-rot-sy z))) + (let ((v1-5 arg2)) + (cond + ((< (-> s4-0 w) 0.0) + (.lvf vf1 (&-> v1-5 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-5 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + (else + (.lvf vf1 (&-> v1-5 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-5 qx-qy-qz-sy quad) vf1) + (.mov v1-7 vf1) + ) + ) + ) + ) + (set! (-> arg2 r-g-b-a w) (-> s5-0 sprite r-g-b-a w)) + ) + 0 + (none) + ) + ) + +(defpart 1175 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.1) + (:y (meters 5)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 1167 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 2)) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 96.0) + (:a 0.0) + (:omega (degrees 45)) + (:vel-x (meters 0.02)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees 0.45)) + (:fade-a 0.8) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:next-time (seconds 0.267)) + (:next-launcher 1178) + ) + ) + +(defpart 1178 + :init-specs ((:a 64.0) (:fade-a 0.0) (:next-time (seconds 1.467)) (:next-launcher 1179)) + ) + +(defpart 1179 + :init-specs ((:fade-a -0.8)) + ) + +(defpart 1168 + :init-specs ((:texture (ticker-a ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 1169 + :init-specs ((:texture (ticker-b ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 1170 + :init-specs ((:texture (ticker-c ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 1171 + :init-specs ((:texture (ticker-d ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 1172 + :init-specs ((:texture (ticker-e ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 1174 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0 96.0) + (:b :copy g) + (:a 20.0 4.0) + (:omega (degrees 3386.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 10240.0) + ) + ) + +(defpart 1173 + :init-specs ((:texture (baron-propoganda-logo ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 192.0) + (:g 0.0 64.0) + (:b :copy g) + (:a 96.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1176 + :init-specs ((:texture (baron-propoganda-logo ctywide-sprite)) + (:num 1.0) + (:y (meters 5.75)) + (:z (meters 0.05)) + (:scale-x (meters 6.5) (meters 0.5)) + (:rot-x (degrees 80) (degrees 4)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 16.0) + (:a 32.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-14 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctywide-burning-bush-holo-on + :id 260 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1180 :flags (is-3d sp6 sp7)) + (sp-item 1181 :flags (is-3d sp6 sp7)) + (sp-item 1182 :flags (is-3d sp6 sp7)) + (sp-item 1183 :fade-after (meters 150) :flags (sp6 sp7)) + ) + ) + +(defpart 1183 + :init-specs ((:texture (green-lightning level-default-sprite)) + (:num 2.0 4.0) + (:x (meters -2.25) (meters 4.5)) + (:y (meters 6.1)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 6)) + (:r 128.0 1 128.0) + (:g 255.0) + (:b 128.0) + (:a 0.0) + (:fade-a 1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.067)) + (:next-launcher 1184) + (:rotate-y (degrees 0) 1 (degrees 180)) + ) + ) + +(defpart 1184 + :init-specs ((:fade-a -1.6)) + ) + +(defpart 1180 + :init-specs ((:texture (baron-propoganda-logo ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.02)) + (:scale-x (meters 3.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 120.0) + (:b 0.0) + (:a 160.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1182 + :init-specs ((:texture (rod-of-god level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 6)) + (:r 32.0) + (:g 0.0) + (:b 255.0) + (:a 32.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1181 + :init-specs ((:texture (baron-propoganda-logo ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.02)) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctywide-burning-bush-holo-off + :id 261 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1185 :flags (is-3d sp6 sp7)) + (sp-item 1186 :flags (is-3d sp6 sp7)) + (sp-item 1187 :flags (is-3d sp6 sp7)) + (sp-item 1188 :flags (is-3d sp6 sp7)) + ) + ) + +(defpart 1185 + :init-specs ((:texture (burning-bush-off ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.02)) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1187 + :init-specs ((:texture (rod-of-god level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 6)) + (:r 64.0 64.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 32.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1188 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees -90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 6)) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 0.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1186 + :init-specs ((:texture (burning-bush-off ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.02)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctywide-burning-bush-holo-red + :id 262 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1189 :flags (is-3d sp6 sp7)) (sp-item 1190 :fade-after (meters 150) :flags (sp6 sp7))) + ) + +(defpart 1189 + :init-specs ((:texture (rod-of-god level-default-sprite)) + (:num 1.0) + (:y (meters 5)) + (:z (meters 0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1190 + :init-specs ((:texture (lightning-darkjak level-default-sprite)) + (:num 2.0 4.0) + (:x (meters -2.25) (meters 4.5)) + (:y (meters 4.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 3) (meters 1.5)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.067)) + (:next-launcher 1191) + (:rotate-y (degrees 0) 1 (degrees 180)) + ) + ) + +(defpartgroup group-ctywide-palace-high-fire + :id 263 + :flags (sp8) + :bounds (static-bspherem 0 2 0 5) + :parts ((sp-item 1192 :fade-after (meters 500) :falloff-to (meters 600)) + (sp-item 1193 :fade-after (meters 500) :flags (sp6)) + ) + ) + +(defpart 1192 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 4) (meters 2)) + (:scale-y (meters 4) (meters 2)) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 32.0 32.0) + (:vel-x (meters 0) (meters -0.0033333334)) + (:scalevel-x (meters -0.009375)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -0.1 -0.1) + (:accel-y (meters 0.00083333335) (meters 0.00066666666)) + (:timer (seconds 0.535) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +(defpart 1193 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.5) + (:y (meters 4)) + (:scale-x (meters 16) (meters 0.5)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +(defpartgroup group-ctywide-misc-citylights-red-1 + :id 264 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1194 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +(defpartgroup group-ctywide-misc-citylights-red-2 + :id 265 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1194 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +(defpartgroup group-ctywide-misc-citylights-red-3 + :id 266 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1194 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 800 :hour-mask #b111111111110000000) + ) + ) + +(defpartgroup group-ctywide-misc-citylights-red-4 + :id 267 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1194 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 1200 :hour-mask #b111111111110000000) + ) + ) + +(defpart 1194 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 3)) + (:r 255.0) + (:g 40.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.035)) + (:scalevel-y (meters 0.03)) + (:fade-a 0.08) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 1195) + ) + ) + +(defpart 1195 + :init-specs ((:scale-y (meters 6)) + (:a 16.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 1196) + ) + ) + +(defpart 1196 + :init-specs ((:scalevel-x (meters -0.035)) + (:scalevel-y (meters -0.03)) + (:fade-a -0.08) + (:next-time (seconds 0.335)) + (:next-launcher 1197) + ) + ) + +(defpart 1197 + :init-specs ((:scale-y (meters 3)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +(defpartgroup group-ctywide-misc-citylights-blue-1 + :id 268 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1198 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +(defpartgroup group-ctywide-misc-citylights-blue-2 + :id 269 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1198 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +(defpartgroup group-ctywide-misc-citylights-blue-3 + :id 270 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1198 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800 :hour-mask #b111111111110000000) + ) + ) + +(defpart 1198 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 8)) + (:r 0.0) + (:g 128.0 32.0) + (:b 255.0) + (:a 4.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.0005)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 1199) + ) + ) + +(defpartgroup group-ctywide-cable-lights + :id 271 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1200 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +(defpart 1200 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 12) (meters 4)) + (:rot-x (degrees 56.25)) + (:rot-z (degrees 17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 64.0) + (:b 64.0) + (:a 20.0 8.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-slums-seal-of-mar-glow + :id 272 + :flags (sp6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 90) (degrees 0) (degrees 90)) + :parts ((sp-item 1201) (sp-item 1202) (sp-item 1203 :flags (sp7))) + ) + +(defpart 1201 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.5) + (:z (meters -0.05)) + (:scale-x (meters 0.9) (meters 0.25)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0 16.0) + (:b 12.0 4.0) + (:a 16.0 16.0) + (:fade-a -1.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 1202 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.5) + (:z (meters 0.05)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0 16.0) + (:b 12.0 4.0) + (:a 12.0 12.0) + (:fade-a -0.48) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 1203 + :init-specs ((:texture (glow level-default-sprite)) + (:num 4.0 2.0) + (:x (meters 0.2)) + (:scale-x (meters 0.01) (meters 0.0025)) + (:scale-y :copy scale-x) + (:r 196.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 128.0 128.0) + (:vel-x (meters 0.02) (meters 0.02)) + (:fade-a -0.42666668 -0.42666668) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-ctywide-chimney + :id 273 + :flags (sp8) + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 1204 :fade-after (meters 600) :falloff-to (meters 600)) + (sp-item 1205 :fade-after (meters 600) :flags (sp6)) + ) + ) + +(defpart 1205 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 13513.499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpart 1204 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.3) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 1206) + ) + ) + +(defpart 1206 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 1207)) + ) + +(defpart 1207 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 1208) + ) + ) + +(defpart 1208 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 1209) + ) + ) + +(defpart 1209 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +(defpartgroup group-ctywide-chimney-smoke + :id 274 + :flags (sp8) + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 1210 :fade-after (meters 950) :falloff-to (meters 1200))) + ) + +(defpart 1210 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 1211) + ) + ) + +(defpart 1211 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 1212) + ) + ) + +(defpart 1212 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-ctyind-sparks + :id 275 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1213 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 1214 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + (sp-item 1214 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +(defpart 1213 + :init-specs ((:texture (gun-blue-hit-spek level-default-sprite)) + (:num 10.0) + (:scale-x (meters 0.05) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0 128.0) + (:a 128.0 128.0) + (:omega (degrees 0.0675)) + (:vel-z (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters -0.0016666667)) + (:friction 0.96 0.02) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 1)) + (:next-launcher 1215) + (:conerot-y (degrees -30) (degrees 60)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1215 + :init-specs ((:fade-a -0.85333335 -0.85333335)) + ) + +(defpart 1214 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.1) + (:x (meters -0.5) (meters 1)) + (:y (meters -0.5) (meters 1)) + (:z (meters 1)) + (:scale-x (meters 1) (meters 3)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a -512.0 5 128.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-ctyind-hot-gas + :id 276 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1216 :falloff-to (meters 60) :flags (sp7)) + (sp-item 1217 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +(defpart 1216 + :init-specs ((:num 1.0) + (:rot-x 5) + (:rot-z (degrees 0) (degrees 360)) + (:r 8192.0) + (:g 3276.8 1638.4) + (:b 4096.0) + (:vel-z (meters 0.1)) + (:timer (seconds 0.417)) + (:flags (distort)) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1217 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:z (meters 1)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-z (meters 0.1)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-color-gas-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-alpha-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-gas-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-gas-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *r-curve-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.45 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :w 0.2) + :one-over-x-deltas (new 'static 'vector :y -20.000008 :z 0.36363637 :w 1.0) + ) + ) + ) + +(if #t + (set! *g-curve-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.45 :z -0.5 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 0.1) + :one-over-x-deltas (new 'static 'vector :y -17.999996 :z -0.2 :w 1.0) + ) + ) + ) + +(if #t + (set! *b-curve-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-alpha-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :y 10.000001 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-gas-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 0.8 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :y 0.39999998 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-gas-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 0.8 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :y 0.39999998 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-ctyind-hot-gas-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.1) + :flags (particle-curve-flags pcf0 pcf1) + ) + ) + +(set! (-> *part-id-table* 1217 init-specs 14 initial-valuef) + (the-as float *part-ctyind-hot-gas-curve-settings*) + ) + +(set! (-> *part-ctyind-hot-gas-curve-settings* color-start) *range-color-gas-flame*) + +(set! (-> *part-ctyind-hot-gas-curve-settings* alpha-start) *range-alpha-gas-flame*) + +(set! (-> *part-ctyind-hot-gas-curve-settings* scale-x-start) *range-scale-gas-flame-x*) + +(set! (-> *part-ctyind-hot-gas-curve-settings* scale-y-start) *range-scale-gas-flame-y*) + +(set! (-> *part-ctyind-hot-gas-curve-settings* r-scalar) *r-curve-gas-flame*) + +(set! (-> *part-ctyind-hot-gas-curve-settings* g-scalar) *g-curve-gas-flame*) + +(set! (-> *part-ctyind-hot-gas-curve-settings* b-scalar) *b-curve-gas-flame*) + +(set! (-> *part-ctyind-hot-gas-curve-settings* a-scalar) *curve-alpha-gas-flame*) + +(set! (-> *part-ctyind-hot-gas-curve-settings* scale-x-scalar) *curve-gas-flame-x*) + +(set! (-> *part-ctyind-hot-gas-curve-settings* scale-y-scalar) *curve-gas-flame-y*) + +(defpartgroup group-ctyind-rubble-smoke + :id 277 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1218 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 1218 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 1219) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1219 + :init-specs ((:fade-a -0.11636364)) + ) + +(defpartgroup group-ctyind-electric-arc + :id 278 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1220 :fade-after (meters 100) :falloff-to (meters 200) :flags (is-3d sp7))) + ) + +(defpart 1220 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.01 0.05) + (:scale-x (meters 5.8)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-z (degrees -90) 1 (degrees 180)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:vel-z (meters 0.033333335)) + (:scalevel-x (meters 0.01)) + (:rotvel-x (degrees 0.6)) + (:rotvel-y (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.415)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 30)) + ) + ) + +(defpartgroup group-ctyslum-red-wall-light + :id 279 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1221 :fade-after (meters 80) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +(defpart 1221 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0) + (:b 0.0) + (:a 20.0 2.0) + (:omega (degrees 2261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyslum-blue-wall-light + :id 280 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1222 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +(defpart 1222 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5.5) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 20.0) + (:b 255.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyslum-long-blue-light + :id 281 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1223 :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +(defpart 1223 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 90)) + (:scale-y (meters 5)) + (:r 20.0) + (:g 20.0) + (:b 255.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyslum-long-blue-lightb + :id 282 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1224 :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +(defpart 1224 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0)) + (:scale-y (meters 5)) + (:r 20.0) + (:g 20.0) + (:b 255.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyslum-streetlight + :id 283 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 1225 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111111000000) + (sp-item 1226 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111111000000) + (sp-item 1227 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111111000000) + ) + ) + +(defpart 1225 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:y (meters 0.1)) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 1226 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 30.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 1227 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 10.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpartgroup group-ctyslum-lamp-glow + :id 284 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1228 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +(defpart 1228 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 60.0) + (:b 20.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyslum-yellow-light + :id 285 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1229 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +(defpart 1229 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 100.0) + (:b 20.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyslum-steam-vent + :id 286 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 1230 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7))) + ) + +(defpart 1230 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.1) + (:x (meters -0.5) (meters 1)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.53333336) + (:accel-y (meters 0.00006666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x405c00 #x400000)) + (:next-time (seconds 0.5)) + (:next-launcher 1231) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1231 + :init-specs ((:fade-a -0.07619048 -0.07619048)) + ) + +(defpartgroup group-ctyport-bulb-orange-glow + :id 287 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 1232 :fade-after (meters 2400) :flags (sp6))) + ) + +(defpart 1232 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 5)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 90.0) + (:b 20.0) + (:a 8.0 4.0) + (:omega (degrees 20270.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpartgroup group-ctywide-green-chimney-smoke + :id 288 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 48) + :parts ((sp-item 1233 :fade-after (meters 1800) :falloff-to (meters 2000))) + ) + +(defpart 1233 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1 0.1) + (:scale-x (meters 8) (meters 1)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 20.0 10.0) + (:g 80.0 20.0) + (:b 20.0 10.0) + (:a 0.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.00033333333) (meters 0.00033333333)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 2.56) + (:accel-x (meters -0.0005) (meters 0.000033333334)) + (:accel-y (meters 0.00006666667) (meters 0.000016666667)) + (:accel-z (meters -0.00006666667) (meters 0.000033333334)) + (:friction 0.99) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.167)) + (:next-launcher 1234) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-z (degrees -10) (degrees 20)) + (:rotate-y (degrees 20)) + ) + ) + +(defpart 1234 + :init-specs ((:scalevel-x (meters 0.001)) + (:fade-r -0.06666667) + (:fade-g -0.06666667) + (:fade-b -0.04) + (:fade-a -0.042666666 -0.042666666) + ) + ) + +(defpartgroup group-ctyslum-heater-haze + :id 289 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 1235 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7))) + ) + +(defpart 1235 + :init-specs ((:num 1.0) + (:x (meters -3) (meters 6)) + (:z (meters -4) (meters 8)) + (:rot-x 8) + (:r 12288.0) + (:g 4096.0) + (:b 4096.0) + (:fade-g 1.3653333) + (:accel-y (meters 0.00066666666) (meters 0.00033333333)) + (:friction 0.97) + (:timer (seconds 1)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1236) + ) + ) + +(defpart 1236 + :init-specs ((:fade-g -1.3653333)) + ) + +(defpartgroup group-ctyslum-fan-haze + :id 290 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 1237 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7)) + (sp-item 1238 :flags (is-3d sp6 sp7)) + ) + ) + +(defpart 1237 + :init-specs ((:num 1.0) + (:x (meters 0) (meters 8)) + (:rot-x 8) + (:r 12288.0) + (:g 4096.0) + (:b 4096.0) + (:vel-z (meters 0.16666667)) + (:fade-g 1.3653333) + (:accel-y (meters 0.00066666666) (meters 0.00033333333)) + (:friction 0.97) + (:timer (seconds 1)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1239) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1239 + :init-specs ((:fade-g -1.3653333)) + ) + +(defpart 1238 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:z (meters -4)) + (:scale-x (meters 15)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 20.0) + (:b 255.0) + (:a 40.0 20.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyslum-small-fountain + :id 291 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1240 :fade-after (meters 80) :falloff-to (meters 140) :flags (is-3d sp7)) + (sp-item 1241 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7)) + (sp-item 1242 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 1243 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 1244 :fade-after (meters 40) :falloff-to (meters 120) :flags (is-3d sp7)) + ) + ) + +(defpart 1240 + :init-specs ((:texture (wave-foam ctywide-sprite)) + (:num 1.5) + (:scale-x (meters 0.2) (meters 1)) + (:scale-y (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.011333333)) + (:accel-z (meters 0)) + (:friction 0.98) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:func 'spt-func-turn-to-vel-radial) + (:next-time (seconds 0.5)) + (:next-launcher 1245) + (:conerot-x (degrees -90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1245 + :init-specs ((:scalevel-x (meters -0.0033333334) (meters 0.006666667)) + (:scalevel-y (meters 0.006666667) (meters 0.02)) + (:accel-z (meters -0.0016666667)) + (:friction 0.9) + ) + ) + +(defpart 1241 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:scale-y (meters 1) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.011666667)) + (:accel-z (meters 0)) + (:friction 0.98) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.5)) + (:next-launcher 1246) + (:conerot-x (degrees -90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1246 + :init-specs ((:scalevel-y (meters 0.006666667)) + (:accel-z (meters -0.0016666667)) + (:friction 0.9 0.05) + (:next-time (seconds 0.085) (seconds 0.665)) + (:next-launcher 1247) + ) + ) + +(defpart 1247 + :init-specs ((:r 50.0 100.0) + (:g 50.0 100.0) + (:b 50.0 100.0) + (:a 128.0 128.0) + (:next-time (seconds 0.017) (seconds 0.015)) + (:next-launcher 1248) + ) + ) + +(defpart 1248 + :init-specs ((:a 32.0 32.0) (:next-time (seconds 0.167) (seconds 0.665)) (:next-launcher 1247)) + ) + +(defpart 1242 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 5.0) + (:x (meters 1.6) (meters 0.1)) + (:y (meters -4.3)) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 160.0) + (:b 160.0) + (:a 128.0) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:scalevel-y (meters 0.0033333334) (meters 0.006666667)) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1243 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 10.0) + (:x (meters 1.6) (meters 0.1)) + (:y (meters -4.3)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 220.0) + (:b 255.0) + (:a 64.0 64.0) + (:vel-y (meters 0.006666667) (meters 0.02)) + (:rotvel-z (degrees -4) (degrees 8)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13 left-multiply-quat)) + (:conerot-x (degrees -20) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1244 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:y (meters -4.3)) + (:scale-x (meters 5) (meters 0.3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 160.0) + (:b 160.0) + (:a 40.0) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406400 #x408200)) + (:next-time (seconds 0.167)) + (:next-launcher 1249) + ) + ) + +(defpart 1249 + :init-specs ((:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56 -2.56) + (:next-time (seconds 0.085)) + (:next-launcher 1250) + ) + ) + +(defpart 1250 + :init-specs ((:scalevel-x (meters 0.006666667)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-ctyslum-big-fountain + :id 292 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1251 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7))) + ) + +(defpart 1251 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.5) (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.05) (meters 0.016666668)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 1.335)) + (:flags (launch-along-z left-multiply-quat)) + (:conerot-x (degrees 0) (degrees 3.0000002)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-ctyslum-big-fountain-top + :id 293 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1252 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7) :hour-mask #b111111000000000000111111) + (sp-item 1253 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7) :hour-mask #b111111111111000000) + (sp-item 1254 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7) :hour-mask #b111111111111000000) + (sp-item 1255 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7)) + ) + ) + +(defpart 1252 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 8)) + (:r 180.0) + (:g 180.0) + (:b 180.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y (meters -0.026666667)) + (:fade-a -0.19692308 -0.19692308) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.835) (seconds 0.08)) + (:next-launcher 1256) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1256 + :init-specs ((:scalevel-y (meters 0.026666667)) (:fade-a -0.09846154)) + ) + +(defpart 1257 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:scale-x (meters 8)) + (:rot-z (degrees 90) 1 (degrees 180)) + (:scale-y (meters 0.2) (meters 0.5)) + (:r 180.0) + (:g 180.0) + (:b 180.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters -0.026666667)) + (:scalevel-y (meters 0.006666667)) + (:fade-a -0.19692308 -0.19692308) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.835) (seconds 0.08)) + (:next-launcher 1258) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1258 + :init-specs ((:scalevel-x (meters 0.026666667)) (:fade-a -0.09846154)) + ) + +(defpart 1253 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 8)) + (:r 0.0 40.0) + (:g 100.0 20.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y (meters -0.026666667)) + (:fade-r 0.12923077) + (:fade-g 0.03076923) + (:fade-a -0.19692308 -0.19692308) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.835) (seconds 0.08)) + (:next-launcher 1259) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1259 + :init-specs ((:scalevel-y (meters 0.026666667)) (:fade-a -0.09846154)) + ) + +(defpart 1254 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:scale-x (meters 8)) + (:rot-z (degrees 90) 1 (degrees 180)) + (:scale-y (meters 0.2) (meters 0.5)) + (:r 0.0 40.0) + (:g 100.0 20.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters -0.026666667)) + (:scalevel-y (meters 0.006666667)) + (:fade-r 0.12923077) + (:fade-g 0.03076923) + (:fade-a -0.19692308 -0.19692308) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.835) (seconds 0.08)) + (:next-launcher 1260) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1260 + :init-specs ((:scalevel-x (meters 0.026666667)) (:fade-a -0.09846154)) + ) + +(defpart 1255 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 2.0) + (:y (meters -1)) + (:scale-x (meters 1) (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 220.0) + (:g 220.0) + (:b 220.0) + (:a 64.0 64.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668 -0.42666668) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:conerot-x (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-ctyslum-big-fountain-top-light + :id 294 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1261 :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000)) + ) + +(defpart 1261 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 1.0) + (:y (meters -2)) + (:scale-x (meters 200)) + (:rot-z (degrees 90)) + (:scale-y (meters 5)) + (:r 0.0 40.0) + (:g 100.0 20.0) + (:b 128.0) + (:a 60.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyslum-barrel-fire + :id 295 + :bounds (static-bspherem 0 3 0 4) + :parts ((sp-item 1263 :fade-after (meters 50) :falloff-to (meters 80)) + (sp-item 1264 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 0.335) :length (seconds 0.167)) + (sp-item 1265 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.4) :length (seconds 0.185) :offset 20) + (sp-item 1266 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 0.535) :length (seconds 0.1) :offset 35) + (sp-item 1264 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.85) :length (seconds 0.2) :offset 65) + (sp-item 1265 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 1.25) :length (seconds 0.135) :offset 15) + (sp-item 1266 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 1.435) :length (seconds 0.167) :offset 85) + (sp-item 1264 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 2) :length (seconds 0.235) :offset 100) + (sp-item 1265 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 4.167) :length (seconds 0.15) :offset 450) + (sp-item 1266 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 5) :length (seconds 0.085) :offset 115) + (sp-item 1264 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 7) :length (seconds 0.185) :offset 80) + (sp-item 1267 :fade-after (meters 20) :falloff-to (meters 10) :binding 1262) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1268 :fade-after (meters 50) :falloff-to (meters 50)) + (sp-item 1269 :fade-after (meters 30) :falloff-to (meters 30)) + (sp-item 1270 :fade-after (meters 70) :flags (sp6)) + ) + ) + +(defpart 1270 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 12.0) + (:fade-a -0.4) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 10240.0) + ) + ) + +(defpart 1267 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 0.8) + (:sound (static-sound-spec "fire-pop" :group 0 :volume 10000.0)) + (:x (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:accel-y (meters -0.000033333334) (meters -0.00006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 1262 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.1) (meters 0.3)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 128.0) + (:b 128.0) + (:a 96.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.026666667) (meters 0.053333335)) + (:vel-y (meters 0)) + (:vel-z (meters -0.0013333333) (meters 0.0026666666)) + (:fade-r 0.0) + (:fade-g -0.7111111) + (:fade-b -0.7111111) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.6)) + (:next-launcher 1271) + ) + ) + +(defpart 1271 + :init-specs ((:fade-r -1.0666667) (:fade-g 1.0666667) (:fade-b 1.0666667)) + ) + +(defpart 1264 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 1272) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 87)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 1265 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 1272) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 120) (degrees 90)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 1266 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 1272) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 240) (degrees 110)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 1272 + :init-specs ((:b 0.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.4 -0.2) + (:next-time (seconds 0.135) (seconds 0.03)) + (:next-launcher 1273) + ) + ) + +(defpart 1273 + :init-specs ((:fade-r -0.125) (:fade-g 0.4) (:fade-b 0.4)) + ) + +(defpart 1263 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 4.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 1268 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.4) + (:x (meters -0.25) (meters 0.5)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.64) + (:fade-g -0.32) + (:fade-b -0.32) + (:fade-a -0.017777778 -0.026666667) + (:accel-y (meters -0.000006666667)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.5) (seconds 0.165)) + (:next-launcher 1274) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 1274 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpart 1269 + :init-specs ((:num 0.4) + (:x (meters 0) (meters 0.2)) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-x (meters 0) (meters 0.006666667)) + (:vel-y (meters 0.02) (meters 0.013333334)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 1275) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 1275 + :init-specs ((:fade-b -0.68266666)) + ) + +(defpartgroup group-hijack-kgpickup-explode + :id 296 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 1277 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1278 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1279 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1280 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1281 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1282 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1283 :period (seconds 30) :length (seconds 0.167)) + (sp-item 1284 :period (seconds 30) :length (seconds 0.5)) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +(defpart 1277 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 1278 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1279 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1280 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1281 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-kgpickup-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-kgpickup-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-kgpickup-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-kgpickup-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-kgpickup-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-kgpickup-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-kgpickup-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-hijack-kgpickup-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 1281 init-specs 14 initial-valuef) + (the-as float *part-hijack-kgpickup-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* color-start) *range-kgpickup-dust-color*) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* alpha-start) *range-kgpickup-dust-alpha*) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* scale-x-start) + *range-kgpickup-dust-scale-x* + ) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* scale-y-start) + *range-kgpickup-dust-scale-y* + ) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* a-scalar) *curve-kgpickup-dust-alpha*) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* scale-x-scalar) + *curve-kgpickup-dust-scale-x* + ) + +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* scale-y-scalar) + *curve-kgpickup-dust-scale-y* + ) + +(defpart 1283 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1284 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-kgpickup-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-kgpickup-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-kgpickup-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-kgpickup-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-kgpickup-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-kgpickup-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-kgpickup-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-hijack-kgpickup-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 1284 init-specs 16 initial-valuef) + (the-as float *part-hijack-kgpickup-explosion-texture-curve-settings*) + ) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* color-start) *range-kgpickup-color*) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* alpha-start) *range-kgpickup-alpha*) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* scale-x-start) *range-kgpickup-scale-x*) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* scale-y-start) *range-kgpickup-scale-y*) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* a-scalar) *curve-kgpickup-alpha*) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* scale-x-scalar) *curve-kgpickup-scale-x*) + +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* scale-y-scalar) *curve-kgpickup-scale-y*) + +(defpart 1282 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 1285 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.033333335) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1276 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) diff --git a/goal_src/jak3/levels/city/ctywide-scenes.gc b/goal_src/jak3/levels/city/ctywide-scenes.gc index 33474d9e20..179cec0526 100644 --- a/goal_src/jak3/levels/city/ctywide-scenes.gc +++ b/goal_src/jak3/levels/city/ctywide-scenes.gc @@ -5,5 +5,2215 @@ ;; name in dgo: ctywide-scenes ;; dgos: CWI +(define-extern set-darkjak-highres-texture-morph! (function float symbol)) +(define-extern *range-fma-city-barrier-explo-big-color* curve-color-fast) +(define-extern *range-fma-city-barrier-explo-big-alpha* curve2d-fast) +(define-extern *range-fma-city-barrier-explo-big-scale-x* curve2d-fast) +(define-extern *range-fma-city-barrier-explo-big-scale-y* curve2d-fast) +(define-extern *curve-fma-city-barrier-explo-big-alpha* curve2d-fast) +(define-extern *curve-fma-city-barrier-explo-big-scale-x* curve2d-fast) +(define-extern *curve-fma-city-barrier-explo-big-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(defskelgroup skel-cara-movie cara cara-lod0-jg cara-idle-ja + ((cara-lod0-mg (meters 20)) (cara-lod0-mg (meters 40)) (cara-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :shadow cara-shadow-mg + :origin-joint-index 3 + ) + +(load-scene (new 'static 'scene + :name "sewer-met-hum-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-192" + :art-group "scenecamera" + :anim "sewer-met-hum-intro" + :parts 17 + :command-list '((572 (part-tracker + "group-barrier-hand-shock" + entity + "jakc-highres" + joint + "rringA" + track + #t + duration + (frame-range 572 608) + ) + ) + (1930 (fadeout (frame-time-30 10))) + (10000 (task-close! "sewer-met-hum-introduction")) + ) + :cut-list '(1 61 149 198 227 398 533 616 758 903 1001 1033 1103 1285 1412 1508 1547 1728 1794) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'slumbset + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'slumbset + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(227 1103) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'lsamos + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'slumbset + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctygenb-samos" + :end-point "ctygenb-samos" + :borrow '((ctywide 4 lsamos special)) + :sfx-volume -1.0 + :ambient-volume 0.5 + :music-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "genb-mov-amb") ("barrier-mov-amb")) + :on-complete #f + ) + ) + +(set! (-> *lightning-spec-id-table* 21) (new 'static 'lightning-spec + :name "darkjak-punch-lightning" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.42 + :num-points 32 + :box-size 3686.4 + :merge-factor 0.5 + :merge-count 2 + :radius 409.6 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +(load-scene + (new 'static 'scene + :name "city-get-dark-punch" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-189" + :art-group "scenecamera" + :anim "city-get-dark-punch" + :parts 5 + :command-list '((0 + (fma-sphere (nav kill-once) sphere (new 'static 'sphere :x -1554249.8 :y 40071.58 :z 4844934.5 :r 81920.0)) + (fadein (frame-time-30 2)) + (send-event + "darkjak-highres" + 'trans-hook + ,(lambda :behavior scene-player + () + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((< f0-0 230.0) + (set-darkjak-highres-texture-morph! 0.0) + ) + ((and (>= f0-0 230.0) (>= 330.0 f0-0)) + (set-darkjak-highres-texture-morph! (* 0.01 (+ -230.0 f0-0))) + ) + (else + (set-darkjak-highres-texture-morph! 1.0) + ) + ) + ) + (none) + ) + ) + ) + (4 (part-tracker + "group-metal-head-egg-explosion" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 4 23) + ) + ) + (10 (part-tracker + "group-fma-dark-eco-steam" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 10 600) + ) + ) + (15 (part-tracker + "group-fma-hand-steam" + entity + "darkjak-highres" + joint + "sk_lhand" + track + #t + duration + (frame-range 15 388) + ) + ) + (17 (part-tracker + "group-fma-hand-steam" + entity + "darkjak-highres" + joint + "sk_rhand" + track + #t + duration + (frame-range 17 450) + ) + ) + (40 (part-tracker + "group-fma-dark-eco-fire" + entity + "darkjak-highres" + joint + "sk_lhand" + track + #t + duration + (frame-range 40 340) + ) + ) + (100 (part-tracker + "group-fma-dark-eco-fire" + entity + "darkjak-highres" + joint + "sk_rhand" + track + #t + duration + (frame-range 100 400) + ) + ) + (358 (part-tracker + "group-fma-dark-eco-fire-flash" + entity + "darkjak-highres" + joint + "sk_lhand" + track + #t + duration + (frame-range 358 359) + ) + ) + (359 + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "particleman" + from-joint + "sk_lhand" + to-joint + "particleA" + duration + (frame-range 359 600) + ) + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "mhcity-de-tower-egg" + from-joint + "sk_lhand" + to-joint + "main" + duration + (frame-range 359 600) + ) + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "particleman" + from-joint + "sk_lhand" + to-joint + "particleA" + duration + (frame-range 359 600) + ) + ) + (400 (part-tracker + "group-fma-dark-eco-fire-flash" + entity + "darkjak-highres" + joint + "sk_rhand" + track + #t + duration + (frame-range 400 401) + ) + ) + (405 + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "mhcity-de-tower-egg" + from-joint + "sk_rhand" + to-joint + "main" + duration + (frame-range 405 600) + ) + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "particleman" + from-joint + "sk_rhand" + to-joint + "particleA" + duration + (frame-range 405 600) + ) + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "mhcity-de-tower-egg" + from-joint + "sk_rhand" + to-joint + "main" + duration + (frame-range 405 600) + ) + ) + (590 (fadeout (frame-time-30 10))) + (10000 (task-close! "city-destroy-darkeco-dark-punch")) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'mhctycst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "darkjak-highres" + :level 'mhctycst + :art-group "skel-darkjak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #xe0 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'mhctycst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "mhcity-de-tower-egg" + :level 'mhctycst + :art-group "skel-mhcity-de-tower-egg" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "mhcitya-fma" + :end-point "mhcitya-end-darkeco" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :music-delay 1500.0 + :scene-task #x8f + :on-running #f + :on-complete #f + ) + ) + +(defskelgroup skel-blue-gun-mod-three blue-gun-mod-three blue-gun-mod-three-lod0-jg blue-gun-mod-three-idle-ja + ((blue-gun-mod-three-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :origin-joint-index 3 + ) + +(load-scene + (new 'static 'scene + :name "city-destroy-grid-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-212" + :art-group "scenecamera" + :anim "city-destroy-grid-res" + :parts 9 + :command-list '((-30 (kill "krimson-wall-4") (kill "krimson-wall-5") (kill "krimson-wall-7") (fadein (frame-time-30 10))) + (1 (part-tracker + "group-fma-city-barrier-explosion-big" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 1 30) + ) + ) + (121 (part-tracker + "group-fma-cigar-smoke" + entity + "jinx-highres" + joint + "cigsmoke" + track + #t + duration + (frame-range 121 500) + subsample-num + (new 'static 'bfloat :data 5.0) + ) + ) + (412 + (part-tracker + "group-cara-thrusters" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 412 500) + ) + (part-tracker + "group-cara-thrusters" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 412 500) + ) + ) + (500 (fadeout (frame-time-30 10))) + (10000 (send-event self 'user-data-set! (task-closed? "city-destroy-grid-resolution"))) + ) + :cut-list '(106 249 311) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'gridcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'gridcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'gridcst + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "jinx-highres" + :level 'gridcst + :art-group "skel-jinx-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "talk-box" + :level #f + :art-group "skel-talk-box" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "cara-movie" + :level 'gridcst + :art-group "skel-cara-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x1fe + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'gridcst + :art-group "skel-krimson-wall-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'gridcst + :art-group "skel-krimson-wall-break" + :prefix "a-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'gridcst + :art-group "skel-krimson-wall-break" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "blue-gun-mod-three" + :level 'gridcst + :art-group "skel-blue-gun-mod-three" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctyinda-grid-res-a" + :end-point "ctyinda-grid-res-b" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete '(unless (send-event self 'user-data) (talker-spawn "powup010")) + ) + ) + +(defskelgroup skel-h-kg-pickup-fma kg-pickup kg-pickup-lod0-jg kg-pickup-idle-ja + ((kg-pickup-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.2) + :shadow kg-pickup-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-eco-canister-fma eco-canister eco-canister-dark-lod0-jg eco-canister-dark-idle-ja + ((eco-canister-dark-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.3) + :origin-joint-index 3 + ) + +(defskelgroup skel-mhcity-tower-door-break-fma mhcity-tower-door-break mhcity-tower-door-break-lod0-jg mhcity-tower-door-break-idle-ja + ((mhcity-tower-door-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1000) + :origin-joint-index 3 + ) + +(defskelgroup skel-purple-three-fma purple-three purple-three-lod0-jg purple-three-idle-ja + ((purple-three-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1000) + :origin-joint-index 3 + ) + +(load-scene (new 'static 'scene + :name "tower-destroy-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-193" + :art-group "scenecamera" + :anim "tower-destroy-intro" + :parts 8 + :command-list '((0 + (fadein (frame-time-30 10)) + (kill "mhcity-tower-door-1") + (kill "mhcity-tower-door-2") + (apply ,(lambda :behavior scene-player + () + (if *target* + (process-drawable-show-all-cloth *target* #f) + ) + (none) + ) + ) + ) + (1 (kill "mhcity-tower-door-1")) + (182 + (part-tracker + "group-pickup-sparks" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-range 182 183) + ) + ) + (190 + (part-tracker + "group-pickup-sparks" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-range 190 191) + ) + ) + (196 + (part-tracker + "group-truck-explosion" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 196 226) + ) + (part-tracker + "group-mhcity-door-explode" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 196 226) + ) + ) + (680 (fadeout (frame-time-30 10))) + (10000 + (apply ,(lambda :behavior scene-player + () + (if *target* + (process-drawable-show-all-cloth *target* #t) + ) + (none) + ) + ) + (kill "mhcity-tower-door-2") + (send-event self 'user-data-set! (task-closed? "tower-destroy-introduction")) + (task-close! "tower-destroy-introduction") + ) + ) + :cut-list '(25 52 91 116 139 170 250 315 396 502 628) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'towercst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'towercst + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "jinx-highres" + :level 'towercst + :art-group "skel-jinx-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sig-highres" + :level 'towercst + :art-group "skel-sig-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'towercst + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-kg-pickup-fma" + :level 'towercst + :art-group "skel-h-kg-pickup-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min 25)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hellcat-movie" + :level 'towercst + :art-group "skel-hellcat-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "eco-canister-fma" + :level 'ctywide + :art-group "skel-eco-canister-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "mhcity-tower-door-break-fma" + :level 'towercst + :art-group "skel-mhcity-tower-door-break-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "purple-three-fma" + :level 'towercst + :art-group "skel-purple-three-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'towercst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "mhcityb-tower-fma" + :end-point "mhcityb-tower-fma-end" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :music-delay 1500.0 + :scene-task #xfd + :on-running '(begin (sound-play-loop "eco-amb-mov") (sound-play-loop "eco-bubbles-mov")) + :on-complete '(unless + (send-event self 'user-data) + (send-event *target* 'get-pickup (int 18) (float (new 'static 'bfloat :data 15.0))) + (talker-spawn "powup016") + ) + ) + ) + +(defpartgroup group-pickup-sparks + :id 298 + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1290)) + ) + +(defpart 1290 + :init-specs ((:texture (middot level-default-sprite)) + (:num 20.0 20.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 100.0 100.0) + (:omega (degrees 0.0225)) + (:vel-z (meters -0.06666667) (meters -0.16666667)) + (:fade-g -3.2) + (:fade-b -10.2) + (:accel-y (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 0.085) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 30) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + ) + ) + +(defpartgroup group-mhcity-door-explode + :id 299 + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1291 :flags (sp3)) + (sp-item 1292 :period (seconds 20) :length (seconds 0.335)) + (sp-item 1293 :period (seconds 20) :length (seconds 0.085)) + ) + ) + +(defpart 1291 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 1292 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 20.0) + (:scale-x (meters 1) (meters 2)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 128.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.13333334) + (:fade-b -0.05) + (:fade-a -0.425 -0.425) + (:friction 0.9 0.05) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1293 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 128.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.06666667)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.13333334) + (:fade-b -0.05) + (:fade-a -0.425 -0.425) + (:friction 0.95 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 80) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-barrier-hand-shock + :id 300 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1294 :flags (is-3d sp6))) + ) + +(defpart 1294 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 50.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-metal-head-egg-explosion + :id 301 + :flags (sp0) + :bounds (static-bspherem 0 -2 0 24) + :parts ((sp-item 1295 :period (seconds 4) :length (seconds 0.035)) + (sp-item 1296 :period (seconds 4) :length (seconds 0.25)) + (sp-item 1297 :period (seconds 4) :length (seconds 0.335)) + (sp-item 1298 :period (seconds 4) :length (seconds 0.017)) + (sp-item 1299 :flags (sp3)) + (sp-item 1300 :flags (sp3)) + (sp-item 1301 :flags (sp3)) + ) + ) + +(defpart 1295 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 1296 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 6.0) + (:scale-x (meters 0.1) (meters 0.9)) + (:scale-y :copy scale-x) + (:r 40.0 40.0) + (:g 10.0) + (:b 128.0) + (:a 100.0 100.0) + (:vel-y (meters 0.1) (meters 0.33333334)) + (:scalevel-x (meters 0.033333335) (meters 0.06666667)) + (:scalevel-y (meters 0.1) (meters 0.033333335)) + (:fade-a -2.0) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.167)) + (:next-launcher 1302) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 1302 + :init-specs ((:scalevel-x (meters 0.006666667)) + (:scalevel-y (meters 0.016666668)) + (:fade-r -0.2) + (:fade-g -0.2) + (:fade-a -1.0 -1.0) + (:friction 0.95) + ) + ) + +(defpart 1297 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 4.0) + (:scale-x (meters 0.3) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 40.0 40.0) + (:g 0.0) + (:b 128.0) + (:a 128.0 128.0) + (:vel-y (meters 0.05) (meters 0.06666667)) + (:scalevel-x (meters 0.01) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-b -0.64) + (:fade-a -0.85 -0.85) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 1298 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:z (meters 2) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 40.0 40.0) + (:g 0.0) + (:b 128.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:rotate-x (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1299 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 10.0) + (:b 128.0) + (:a 255.0) + (:scalevel-x (meters 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.375) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 1300 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 80.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 40.0 40.0) + (:g 10.0) + (:b 128.0) + (:a 100.0 100.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.001) (meters -0.0013333333)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.0026666666)) + (:friction 0.9) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 1303 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 80)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 10.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6761.25)) + (:fade-a -2.55) + (:timer (seconds 0.335)) + (:flags (glow)) + (:userdata 4096.0) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-part-fma-dark-eco-steam ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 151) 50)) + (s3-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 61) 30)) + (s4-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 200)) + (v1-6 (mod (the-as int (rand-uint31-gen *random-generator*)) 61)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 s3-0))) + (set! (-> arg2 rotate-y) (the float (- s5-0 (the-as int s4-0)))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +(defpartgroup group-fma-dark-eco-steam + :id 302 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1304 :flags (sp7))) + ) + +(defpart 1304 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-part-fma-dark-eco-steam) + (:num 0.1) + (:z (meters 0) (meters 1)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.005925926)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.000033333334) (meters 0.00006666667)) + (:accel-y (meters 0.00033333333) (meters 0.000033333334)) + (:accel-z (meters -0.000033333334) (meters 0.00006666667)) + (:friction 0.94) + (:timer (seconds 10.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 1305) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1305 + :init-specs ((:fade-a -0.024615385 -0.024615385)) + ) + +(defpartgroup group-fma-hand-steam + :id 303 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1306 :flags (sp7))) + ) + +(defpart 1306 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-part-fma-dark-eco-steam) + (:num 0.1) + (:scale-x (meters 3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters -0.01) (meters -0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-fma-dark-eco-fire + :id 304 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1309 :flags (sp3) :binding 1307) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1308 :flags (sp2)) + (sp-item 1308 :flags (sp2)) + (sp-item 1308 :flags (sp2)) + (sp-item 1308 :flags (sp2)) + (sp-item 1308 :flags (sp2)) + ) + ) + +(defpart 1309 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.42666668) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'part-tracker-track-root) + (:next-time (seconds 1)) + (:next-launcher 1310) + ) + ) + +(defpart 1310 + :init-specs ((:fade-a 0.0) (:next-time (seconds 8)) (:next-launcher 1311)) + ) + +(defpart 1311 + :init-specs ((:fade-a -0.42666668)) + ) + +(defpart 1307 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.05 0.5) + (:y (meters 0) (meters 16)) + (:z (meters 0.04) (meters 0.04)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.006666667)) + (:accel-z (meters -0.00033333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +(defpart 1308 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.3) + (:y (meters -0.05)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters -0.00083333335) (meters -0.00083333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.0) + (:fade-g -0.42666668) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-fma-dark-eco-fire-flash + :id 305 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1312 :flags (sp3))) + ) + +(defpart 1312 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 0.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -3.4) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-fma-cigar-smoke + :id 306 + :flags (sp0 sp4 sp13) + :bounds (static-bspherem 0 0 0 24) + :parts ((sp-item 1313 :flags (sp7))) + ) + +(defpart 1313 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0) (meters 0.01)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 80.0) + (:g :copy r) + (:b :copy r) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00016666666) (meters 0.00016666666)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.010666667 -0.010666667) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.9) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 3.335)) + (:next-launcher 1314) + ) + ) + +(defpart 1314 + :init-specs ((:scalevel-x (meters 0.00066666666) (meters 0.00066666666)) + (:scalevel-y (meters 0.00066666666) (meters 0.00066666666)) + (:friction 0.85) + ) + ) + +(defpartgroup group-fma-city-barrier-explosion-big + :id 307 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 1316 :flags (sp3 sp7) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1317 :flags (sp7) :period (seconds 30) :length (seconds 0.035)) + (sp-item 1318 :flags (sp3 sp7) :period (seconds 30)) + (sp-item 1319 :flags (sp3 sp7) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1320 :flags (sp7) :period (seconds 30) :length (seconds 0.335)) + (sp-item 1321 :period (seconds 30) :length (seconds 0.5)) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +(defpart 1316 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 1317 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1318 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.12307692) + (:fade-b -0.046153847) + (:fade-a -0.19692308 -0.19692308) + (:accel-z (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.93) + (:timer (seconds 2.167)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:next-time (seconds 0.335)) + (:next-launcher 1323) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1323 + :init-specs ((:friction 0.7)) + ) + +(defpart 1320 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.5) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.10666667) + (:fade-b -0.04) + (:fade-a -0.17066666 -0.17066666) + (:accel-z (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.7) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.335)) + (:next-launcher 1324) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1324 + :init-specs ((:friction 0.7)) + ) + +(defpart 1321 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.13333334)) + (:accel-z (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:next-time (seconds 0.335)) + (:next-launcher 1325) + (:conerot-z (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1325 + :init-specs ((:friction 0.7)) + ) + +(if #t + (set! *range-fma-city-barrier-explo-big-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fma-city-barrier-explo-big-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fma-city-barrier-explo-big-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fma-city-barrier-explo-big-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fma-city-barrier-explo-big-alpha* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fma-city-barrier-explo-big-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fma-city-barrier-explo-big-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-fma-city-barrier-explosion-big-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.7) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 1321 init-specs 17 initial-valuef) + (the-as float *part-fma-city-barrier-explosion-big-texture-curve-settings*) + ) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* color-start) + *range-fma-city-barrier-explo-big-color* + ) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* alpha-start) + *range-fma-city-barrier-explo-big-alpha* + ) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* scale-x-start) + *range-fma-city-barrier-explo-big-scale-x* + ) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* scale-y-start) + *range-fma-city-barrier-explo-big-scale-y* + ) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* a-scalar) + *curve-fma-city-barrier-explo-big-alpha* + ) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* scale-x-scalar) + *curve-fma-city-barrier-explo-big-scale-x* + ) + +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* scale-y-scalar) + *curve-fma-city-barrier-explo-big-scale-y* + ) + +(defpart 1319 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 1322 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.1)) + (:scalevel-x (meters -0.05) (meters -0.05)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1315 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 0.5) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0) + (:g 50.0 30.0) + (:b 0.0) + (:a 32.0 32.0) + (:fade-a -0.08533333 -0.08533333) + (:accel-y (meters 0) (meters -0.000033333334)) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-cara-thrusters + :id 308 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1326 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 1327 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +(defpart 1326 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 20.0) + (:z (meters 1.5)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 3 (degrees 45)) + (:scale-y (meters 2) (meters 1)) + (:r 10.0 20.0) + (:g 200.0) + (:b 255.0) + (:a 10.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1327 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters 1.5)) + (:scale-x (meters 3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 12.0 1.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-truck-explosion + :id 309 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6) + :bounds (static-bspherem 0 0 0 60) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1328 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 1329 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 1330 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 1331 :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 1332 :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 1333 :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 1334 :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpart 1329 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow set-conerot)) + (:next-time (seconds 0.25)) + (:next-launcher 1335) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1335 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1334 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:next-time (seconds 0.085)) + (:next-launcher 1336) + (:conerot-x '*sp-temp*) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1333 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 3.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 1336) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1336 + :init-specs ((:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 1337) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1337 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 1338) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1338 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 1339) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1339 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125) (:rotate-y (degrees 0))) + ) + +(defpart 1328 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:next-time (seconds 0.1)) + (:next-launcher 1340) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1340 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1332 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 1341) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1341 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 1342) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1342 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043) (:rotate-y (degrees 0))) + ) + +(defpart 1330 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 1343) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1343 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 1344) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1344 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1331 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/city/ctywide-speech.gc b/goal_src/jak3/levels/city/ctywide-speech.gc index 5601ea706d..622c1c27ee 100644 --- a/goal_src/jak3/levels/city/ctywide-speech.gc +++ b/goal_src/jak3/levels/city/ctywide-speech.gc @@ -7,3 +7,323 @@ ;; DECOMP BEGINS +(defun restore-city-speeches () + (speech-table-set! + *speech-control* + (speech-type guard-generic-battle) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 3 + :delay-pre-time (seconds 1) + :request-timeout (seconds 2) + :min-delay (seconds 15) + :max-delay (seconds 25) + :list (new 'static 'boxed-array :type string + "grds109a" + "grds111a" + "grds112a" + "grds113a" + "grds114a" + "grds115a" + "grds116a" + "grds121a" + "grds124a" + "grds133a" + "grds144a" + "grds126a" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-battle-victory) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 6 + :request-timeout (seconds 0.5) + :min-delay (seconds 3) + :max-delay (seconds 5) + :list (new 'static 'boxed-array :type string + "grds127a" + "grds129a" + "grds128a" + "grds151a" + "grds152a" + "grds153a" + "grds157a" + "grds155a" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-change-targets) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next skip-first-time) + :priority 4 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1.5) + :min-delay (seconds 10) + :max-delay (seconds 20) + :list (new 'static 'boxed-array :type string "grds141a" "grds146a" "grds142a" "grds143a" "grds147a" "grds120a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-go-hostile) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 5 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1.5) + :min-delay (seconds 20) + :max-delay (seconds 40) + :list (new 'static 'boxed-array :type string + "grds144a" + "grds122a" + "grds104a" + "grds145a" + "grds126a" + "grds130a" + "grds164a" + "grds163a" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-hit) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 6 + :request-timeout (seconds 0.1) + :min-delay (seconds 10) + :max-delay (seconds 15) + :list (new 'static 'boxed-array :type string "grds134a" "grds135a" "grds136a" "grds137a" "grds138a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-witness-death) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next skip-first-time) + :priority 6 + :delay-pre-time (seconds 1) + :request-timeout (seconds 2) + :min-delay (seconds 10) + :max-delay (seconds 15) + :list (new 'static 'boxed-array :type string "grds148a" "grds149a" "grds187a" "grds117a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-chatter) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 1 + :delay-pre-time (seconds 1) + :request-timeout (seconds 3) + :min-delay (seconds 30) + :max-delay (seconds 60) + :list (new 'static 'boxed-array :type string + "grds181a" + "grds171a" + "grds172a" + "grds173a" + "grds174a" + "grds165a" + "grds158a" + "grds162a" + "grds183a" + "grds161a" + "grds182a" + "grds160a" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-chatter-jak) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 2 + :request-timeout (seconds 0.3) + :min-delay (seconds 30) + :max-delay (seconds 60) + :list (new 'static 'boxed-array :type string "grds180a" "grds186a" "grds176a" "grds175a" "grds177a" "grds184a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-bumped-by-jak) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next skip-first-time) + :priority 5 + :request-timeout (seconds 1) + :min-delay (seconds 3) + :max-delay (seconds 6) + :list (new 'static 'boxed-array :type string "grds167a" "grds168a" "grds169a" "grds170a" "grds179a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-generic-battle-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 3 + :delay-pre-time (seconds 1) + :request-timeout (seconds 2) + :min-delay (seconds 15) + :max-delay (seconds 25) + :list (new 'static 'boxed-array :type string + "grds109b" + "grds111b" + "grds112b" + "grds113b" + "grds114b" + "grds115b" + "grds116b" + "grds121b" + "grds124b" + "grds133b" + "grds144b" + "grds126b" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-battle-victory-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 6 + :request-timeout (seconds 0.5) + :min-delay (seconds 3) + :max-delay (seconds 5) + :list (new 'static 'boxed-array :type string + "grds127b" + "grds129b" + "grds128b" + "grds151b" + "grds152b" + "grds153b" + "grds157b" + "grds155b" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-change-targets-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order skip-first-time) + :priority 4 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1.5) + :min-delay (seconds 10) + :max-delay (seconds 20) + :list (new 'static 'boxed-array :type string "grds141b" "grds146b" "grds142b" "grds143b" "grds147b" "grds120b") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-go-hostile-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 5 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1.5) + :min-delay (seconds 20) + :max-delay (seconds 40) + :list (new 'static 'boxed-array :type string + "grds144b" + "grds122b" + "grds104b" + "grds145b" + "grds126b" + "grds130b" + "grds164b" + "grds163b" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-hit-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 6 + :request-timeout (seconds 0.1) + :min-delay (seconds 10) + :max-delay (seconds 15) + :list (new 'static 'boxed-array :type string "grds134b" "grds135b" "grds136b" "grds137b" "grds138b") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-witness-death-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 6 + :delay-pre-time (seconds 1) + :request-timeout (seconds 2) + :min-delay (seconds 10) + :max-delay (seconds 15) + :list (new 'static 'boxed-array :type string "grds148b" "grds149b" "grds187b" "grds117b") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-chatter-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 1 + :delay-pre-time (seconds 1) + :request-timeout (seconds 3) + :min-delay (seconds 30) + :max-delay (seconds 60) + :list (new 'static 'boxed-array :type string + "grds181b" + "grds171b" + "grds172b" + "grds173b" + "grds174b" + "grds165b" + "grds158b" + "grds162b" + "grds183b" + "grds161b" + "grds182b" + "grds160b" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-chatter-jak-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 2 + :request-timeout (seconds 0.3) + :min-delay (seconds 30) + :max-delay (seconds 60) + :list (new 'static 'boxed-array :type string "grds180b" "grds186b" "grds176b" "grds175b" "grds177b" "grds184b") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-bumped-by-jak-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 5 + :request-timeout (seconds 1) + :min-delay (seconds 3) + :max-delay (seconds 6) + :list (new 'static 'boxed-array :type string "grds167b" "grds168b" "grds169b" "grds170b" "grds179b") + ) + ) + (speech-control-method-17 *speech-control* (speech-type guard-chatter) 0.5) + (speech-control-method-17 *speech-control* (speech-type guard-witness-death) 1.0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/ctywide-tasks.gc b/goal_src/jak3/levels/city/ctywide-tasks.gc index 6052e11c70..135da9d8b3 100644 --- a/goal_src/jak3/levels/city/ctywide-tasks.gc +++ b/goal_src/jak3/levels/city/ctywide-tasks.gc @@ -7,3 +7,294 @@ ;; DECOMP BEGINS +(defun wait-for-speech-end ((arg0 sound-id)) + (while (nonzero? (get-status *gui-control* arg0)) + (suspend) + ) + #f + ) + +(deftype task-manager-city-vehicle-training-hover-zone-1 (task-manager) + ((speech-id sound-id) + ) + ) + + +(defmethod task-manager-method-26 ((this task-manager-city-vehicle-training-hover-zone-1)) + (when (and (!= (-> this player-vehicle) #f) (not (and *target* (focus-test? *target* pilot)))) + (set! (-> this speech-id) + (talker-spawn-func (-> *talker-speech* 30) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (send-event this 'fail) + ) + (call-parent-method this) + (none) + ) + +(defstate active (task-manager-city-vehicle-training-hover-zone-1) + :virtual #t + :code (behavior () + (until #f + (if (and *target* (focus-test? *target* pilot)) + (goto cfg-7) + ) + (suspend) + ) + #f + (label cfg-7) + (set! (-> self player-vehicle) (-> *target* pilot vehicle)) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 26) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 28) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (while (let ((v1-36 (handle->process (-> self player-vehicle)))) + (not (logtest? (vehicle-flag flight-level-transition) (-> (the-as vehicle v1-36) v-flags))) + ) + (suspend) + ) + (wait-for-speech-end (-> self speech-id)) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 29) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (set! (-> self player-vehicle) (the-as handle #f)) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 1)) + (suspend) + ) + ) + (send-event self 'complete) + (let ((t9-14 (-> (find-parent-state) code))) + (if t9-14 + ((the-as (function none) t9-14)) + ) + ) + ) + ) + +(defstate fail (task-manager-city-vehicle-training-hover-zone-1) + :virtual #t + :code (behavior ((arg0 resetter-params)) + (task-node-close! (game-task-node city-vehicle-training-hover-zone-1) 'event) + (sleep-code) + (let ((t9-3 (-> (find-parent-state) code))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + ) + ) + +(defstate complete (task-manager-city-vehicle-training-hover-zone-1) + :virtual #t + :code (behavior () + (task-node-close! (game-task-node city-vehicle-training-hover-zone-2) 'event) + (let ((t9-2 (-> (find-parent-state) code))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +(deftype task-manager-city-vehicle-training-hover-zone-2 (task-manager) + ((speech-id sound-id) + ) + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-city-vehicle-training-hover-zone-2)) + (if (not (and *target* (focus-test? *target* pilot))) + (send-event this 'fail) + ) + (none) + ) + +(defstate active (task-manager-city-vehicle-training-hover-zone-2) + :virtual #t + :code (behavior () + (set-time! (-> self state-time)) + (until #f + (cond + ((and *target* (focus-test? *target* pilot)) + (let ((v1-8 (the-as vehicle (handle->process (-> *target* pilot vehicle))))) + (if (logtest? (vehicle-flag flight-level-transition) (-> v1-8 v-flags)) + (go-virtual complete) + ) + ) + ) + (else + (set-time! (-> self state-time)) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 60)) + (goto cfg-18) + ) + (suspend) + ) + #f + (label cfg-18) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 28) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (until #f + (let ((v1-35 (handle->process (-> *target* pilot vehicle)))) + (if (logtest? (vehicle-flag flight-level-transition) (-> (the-as vehicle v1-35) v-flags)) + (goto cfg-30) + ) + ) + (suspend) + ) + #f + (label cfg-30) + (wait-for-speech-end (-> self speech-id)) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 29) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 3)) + (suspend) + ) + ) + (go-virtual complete) + ) + ) + +(deftype cty-hijack-intro (task-manager) + () + ) + + +(defstate active (cty-hijack-intro) + :virtual #t + :trans (behavior () + ((-> (method-of-object self wait) trans)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 5)) + (suspend) + ) + ) + (until (< 327680.0 + (vector-vector-xz-distance (target-pos 0) (new 'static 'vector :x -285696.0 :y 36044.8 :z 5443625.0 :w 1.0)) + ) + (suspend) + ) + (set-setting! 'airlock-command '(("hip-door-a-6" close)) 0.0 0) + (talker-spawn-func (-> *talker-speech* 162) *entity-pool* (target-pos 0) (the-as region #f)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 5)) + (suspend) + ) + ) + (until (handle-command-list *gui-control* (gui-channel voicebox) (the-as gui-connection #f)) + (suspend) + ) + (send-event self 'complete) + ) + ) + +(defmethod task-manager-method-25 ((this cty-hijack-intro)) + (nop!) + (call-parent-method this) + (none) + ) + +(deftype task-manager-force-load-borrows (task-manager) + () + ) + + +(defstate active (task-manager-force-load-borrows) + :virtual #t + :exit (behavior () + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + ) + :trans (behavior () + '() + ) + :code (behavior () + (local-vars (v1-22 symbol)) + (send-event (ppointer->process *time-of-day*) 'change 'hour 8) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (when (> (-> (task-perm-by-index *game-info* 46) user-uint64) 0) + (set-blackout-frames (seconds 100)) + (until (process-grab? *target* #f) + (suspend) + ) + ) + (until v1-22 + (suspend) + (set! v1-22 (and (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) + (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) + (= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) + ) + ) + ) + (send-event self 'complete) + ) + ) + +(deftype task-manager-blackout (task-manager) + () + ) + + +(defstate active (task-manager-blackout) + :virtual #t + :code (behavior () + (persist-with-delay *setting-control* 'task-manager-blackout (seconds 10) 'music 'portattk 0.0 0) + (persist-with-delay + *setting-control* + 'task-manager-blackout2 + (seconds 10) + 'city-sound + (the-as symbol '(portatk1)) + 0.0 + 2 + ) + (set-blackout-frames (seconds 100)) + (send-event self 'complete) + ) + ) diff --git a/goal_src/jak3/levels/city/ctywide-texture.gc b/goal_src/jak3/levels/city/ctywide-texture.gc index 2a3e5dd88f..4b056d4f22 100644 --- a/goal_src/jak3/levels/city/ctywide-texture.gc +++ b/goal_src/jak3/levels/city/ctywide-texture.gc @@ -7,3 +7,196 @@ ;; DECOMP BEGINS +;; og:preserve-this not-yet-implemented texture anim stuff +; (define *security-texture-anim-array* +; (the-as (texture-anim-array texture-anim) +; (new 'static 'texture-anim-array :type texture-anim +; (new 'static 'texture-anim +; :num-layers #x2 +; :func #f +; :init-func #f +; :tex #f +; :tex-name "security-env-dest" +; :color (new 'static 'rgba :a #x80) +; :frame-delta 300.0 +; :frame-mod 4800.0 +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x1 :d #x1) +; :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) +; :data (new 'static 'array texture-anim-layer 2 +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 4800.0 +; :tex-name "security-env-uscroll" +; :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0 0.5)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 4.0 0.5)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 4800.0 +; :tex-name "security-env-uscroll" +; :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 2.0 3.0)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; ) +; ) +; (new 'static 'texture-anim +; :num-layers #x3 +; :func #f +; :init-func #f +; :tex #f +; :tex-name "security-dot-dest" +; :color (new 'static 'rgba :a #x80) +; :frame-delta 300.0 +; :frame-mod 600.0 +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x1 :d #x1) +; :data (new 'static 'array texture-anim-layer 6 +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 4800.0 +; :tex-name "common-white" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "security-dot-src" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0078125 0.015625)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.0078125 0.015625)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "security-dot-src" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0078125 0.140625)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 2.0078125 0.140625)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; ) +; ) +; ) +; ) +; ) + +(defun set-security-color! ((arg0 vector)) + ; (let ((v1-1 (-> *security-texture-anim-array* array-data 0))) + ; (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + ; (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) + ; (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) + ; (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) + ; ) + ; (let ((v1-5 (-> *security-texture-anim-array* array-data 1))) + ; (set! (-> v1-5 data 1 start-color quad) (-> arg0 quad)) + ; (set! (-> v1-5 data 1 end-color quad) (-> arg0 quad)) + ; (set! (-> v1-5 data 2 start-color quad) (-> arg0 quad)) + ; (let ((v0-0 (-> v1-5 data 2 end-color))) + ; (set! (-> v0-0 quad) (-> arg0 quad)) + ; v0-0 + ; ) + ; ) + (the vector #f) + ) + +(defun set-security-flash! ((arg0 vector)) + ; (let ((v1-1 (-> *security-texture-anim-array* array-data 1))) + ; (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + ; (let ((v0-0 (-> v1-1 data 0 end-color))) + ; (set! (-> v0-0 quad) (-> arg0 quad)) + ; v0-0 + ; ) + ; ) + (the vector #f) + ) + +(defun set-security-texture-masks! ((arg0 vector)) + ; (local-vars (a3-3 uint128) (a3-4 uint128)) + ; (let ((v1-3 (-> *security-texture-anim-array* array-data 0 data 0 tex)) + ; (a1-3 (-> *security-texture-anim-array* array-data 1 data 1 tex)) + ; ) + ; (when (and v1-3 a1-3) + ; (dotimes (a2-1 3) + ; (let ((a3-2 (-> (the-as (pointer uint128) (+ (the-as uint arg0) (* a2-1 16))))) + ; (t0-2 (-> v1-3 masks data a2-1 mask quad)) + ; ) + ; (.por a3-3 a3-2 t0-2) + ; ) + ; (let ((t0-5 (-> a1-3 masks data a2-1 mask quad))) + ; (.por a3-4 a3-3 t0-5) + ; ) + ; (set! (-> (the-as (pointer uint128) (+ (the-as uint arg0) (* a2-1 16)))) a3-4) + ; ) + ; #f + ; ) + ; ) + #f + ) diff --git a/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc b/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc index 3627029bca..6fbfb41c86 100644 --- a/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc +++ b/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc @@ -5,5 +5,2301 @@ ;; name in dgo: cty-destroy-grid ;; dgos: LJINX +;; +++jinx-flag +(defenum jinx-flag + :type uint32 + :bitfield #t + (j0 0) + (j1 1) + (j2 2) + ) +;; ---jinx-flag + + ;; DECOMP BEGINS +(deftype jinx-hud (hud) + () + ) + + +(defmethod draw ((this jinx-hud)) + (set-hud-piece-position! + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) + ) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 6 2) + (set! (-> this sprites 3 scale-x) 1.2) + (set! (-> this sprites 3 scale-y) 1.25) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this jinx-hud)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this jinx-hud)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-transparent-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-npcring-bar-01 level-default-minimap))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tid) (the-as texture-id (get-texture hud-npcring-01 level-default-minimap))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #x9f8))) + ) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 pos z) #xffffff) + 0 + (none) + ) + +(defskelgroup skel-jinx jinx jinx-lod0-jg jinx-idle0-ja + ((jinx-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow jinx-shadow-mg + :origin-joint-index 14 + :shadow-joint-index 14 + ) + +(define *jinx-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (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 8 + :die-falling-anim 8 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 7 + :bullseye-joint 5 + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 20.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.7 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 45056.0 + :knocked-soft-vxz-hi 54067.2 + :knocked-soft-vy-lo 38092.8 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 65536.0 + :knocked-medium-vxz-hi 74547.2 + :knocked-medium-vy-lo 65536.0 + :knocked-medium-vy-hi 73728.0 + :knocked-hard-vxz-lo 66355.2 + :knocked-hard-vxz-hi 85196.8 + :knocked-hard-vy-lo 60620.8 + :knocked-hard-vy-hi 101580.8 + :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 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 73728.0 + :knocked-red-vy-lo 65536.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 40960.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -2) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #f + :use-pacing #f + :walk-anim 9 + :turn-anim -1 + :run-anim 10 + :taunt-anim -1 + :run-travel-speed (meters 10) + :run-acceleration (meters 14) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 8) + :walk-turning-acceleration (meters 6) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 10) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *jinx-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(set! (-> *jinx-nav-enemy-info* nav-mesh) *default-nav-mesh*) + +(define *citizen-jinx-global-info* (new 'static 'civilian-global-info :seat-flag #x2)) + +(deftype jinx (civilian) + ((min-speed float) + (max-speed float) + (follow-offset float) + (travel-anim-interp float) + (travel-prev-ry float) + (travel-prev-ry1 float) + (player-blocking float) + (follow-dir vector :inline) + (destination vector :inline) + (nav-mesh-aid actor-id) + (health-handle handle) + (box-time float) + (jinx-flags jinx-flag :offset 1212) + ) + (:state-methods + traveling-blocked + traveling + waiting-idle + undefined0 + go-power-box + do-power-box + ) + (:methods + (adjust-target-speed (_type_) none) + (player-blocking-travel? (_type_) symbol) + (travel-anim (_type_) int) + (update-nav-mesh (_type_) none) + (move-cam-to-jinx (_type_) object) + (set-cam-height (_type_ vector) float) + ) + ) + + +(defmethod update-nav-mesh ((this jinx)) + (when (= (-> this nav state mesh) *default-nav-mesh*) + (let ((a0-4 (find-nearest-nav-mesh (-> this root trans) 0.0))) + (when a0-4 + (change-to a0-4 this) + (let ((v1-7 (-> this nav state))) + (set! (-> v1-7 current-poly) (the-as nav-poly #f)) + ) + 0 + ) + ) + ) + 0 + (none) + ) + +(defmethod go-die ((this jinx)) + ((method-of-type nav-enemy go-die) this) + ) + +(defmethod move-above-ground! ((this jinx) (arg0 vector) (arg1 move-above-ground-params)) + ((method-of-type nav-enemy move-above-ground!) this arg0 arg1) + (none) + ) + +(defmethod normalize-heading! ((this jinx) (arg0 nav-control)) + ((method-of-type nav-enemy normalize-heading!) this arg0) + (none) + ) + +(defmethod nav-enemy-method-187 ((this jinx)) + ((method-of-type nav-enemy nav-enemy-method-187) this) + (none) + ) + +(defmethod enemy-common-post ((this jinx)) + (logior! (-> this flags) (citizen-flag persistent)) + (update-nav-mesh this) + (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) + (set! (-> this travel-prev-ry1) (quaternion-y-angle (-> this root quat))) + (set! (-> *game-info* bot-health 0) (/ (-> this hit-points) (-> this enemy-info default-hit-points))) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +(defmethod player-blocking-travel? ((this jinx)) + (let ((s5-0 #f)) + (when *target* + (let ((a1-0 (-> *target* control trans)) + (v1-4 (-> this root)) + (f0-0 14336.0) + ) + (when (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> v1-4 trans) a1-0)) + (let ((v1-8 (-> *target* control transv))) + (when (>= (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) 2048.0) + (if (logtest? (-> this nav state flags) (nav-state-flag avoiding-sphere)) + (set! s5-0 #t) + ) + ) + ) + ) + ) + ) + (let* ((f0-8 (-> this player-blocking)) + (f0-10 (if s5-0 + (seek f0-8 1.0 (seconds-per-frame)) + (seek f0-8 0.0 (seconds-per-frame)) + ) + ) + ) + (set! (-> this player-blocking) f0-10) + (= f0-10 1.0) + ) + ) + ) + +(defstate wait-for-ride (jinx) + :virtual #t + :enter (behavior () + (when (and (nonzero? (-> self vehicle)) (-> self vehicle)) + (let ((a0-1 (the-as vehicle (handle->process (-> self vehicle))))) + (when a0-1 + (remove-riders a0-1 (the-as handle self)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + ) + ) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :exit #f + :trans (behavior () + (when (and (nonzero? (-> self vehicle)) (-> self vehicle)) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info object-type) + (((traffic-type civilian-car-a) (traffic-type civilian-car-b) (traffic-type civilian-car-c)) + (go-virtual move-to-vehicle) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 jinx-idle0-ja) (= v1-2 jinx-idle1-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (let ((gp-0 (rnd-int self 5))) + (while (>= gp-0 0) + (let ((v1-18 (ja-group))) + (if (not (and v1-18 (= v1-18 jinx-idle0-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! jinx-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (+! gp-0 -1) + ) + ) + (let ((v1-50 (ja-group))) + (if (not (and v1-50 (= v1-50 jinx-idle1-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (stop-look-at! self) + (ja-no-eval :group! jinx-idle1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-look-at-mode! self 1) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defstate move-to-vehicle (jinx) + :virtual #t + :enter (behavior () + (let ((gp-0 (the-as vehicle (handle->process (-> self vehicle))))) + (set! (-> self seat) + (get-best-seat gp-0 (-> self root trans) (the-as vehicle-seat-flag (-> self info seat-flag)) 1) + ) + (if (!= (-> self seat) -1) + (put-rider-in-seat gp-0 (-> self seat) self) + ) + ) + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s0-0 (the-as vehicle (handle->process (-> self vehicle))))) + (cond + ((and (-> self vehicle) s0-0) + (cond + ((!= (-> self seat) -1) + (vehicle-method-66 s0-0 gp-0 (-> self seat)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (set! (-> s2-0 quad) (-> self root trans quad)) + (set! (-> s1-0 quad) (-> gp-0 quad)) + (vector-! s5-0 gp-0 (-> s0-0 root trans)) + (vector-z-quaternion! s4-0 (-> self root quat)) + (let ((f30-1 (* 0.5 (vector-vector-xz-distance s2-0 s1-0)))) + (vector-normalize! s4-0 (* 2.0 f30-1)) + (vector-normalize! s5-0 (* 4.0 f30-1)) + ) + (do-spline2 s3-0 s2-0 s4-0 s1-0 s5-0 0.8) + (set! (-> s3-0 y) (-> self root trans y)) + (let ((v1-20 (-> self nav state))) + (logclear! (-> v1-20 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-20 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-20 target-pos quad) (-> s3-0 quad)) + ) + ) + 0 + (if (and (< (vector-dot (vector-normalize! s4-0 1.0) (vector-normalize! s5-0 1.0)) -0.5) + (< (vector-vector-xz-distance gp-0 (-> self root trans)) 18432.0) + (< (fabs (- (-> gp-0 y) (-> self root trans y))) 20480.0) + ) + (go-virtual board-vehicle) + ) + ) + ) + (else + (go-virtual wait-for-ride) + ) + ) + ) + (else + (go-virtual wait-for-ride) + ) + ) + ) + (if (< 204800.0 (vector-vector-xz-distance gp-0 (-> self root trans))) + (go-virtual wait-for-ride) + ) + ) + ) + :code (behavior () + (until #f + (travel-anim self) + (suspend) + ) + #f + ) + ) + +(defbehavior board-vehicle-get-in-car-jump jinx ((arg0 vector) (arg1 quaternion) (arg2 symbol)) + (let ((s0-0 (the-as vehicle (handle->process (-> self vehicle)))) + (s1-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s0-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! s3-0 (-> s0-0 root quat)) + (vehicle-method-66 s0-0 s1-0 (-> self seat)) + (vector-! s4-0 s1-0 arg0) + (let ((f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (cond + (arg2 + (set! f30-1 (- 1.0 f30-1)) + (quaternion-rotate-local-y! s3-0 s3-0 (* f30-1 (if (zero? (-> self seat)) + 16384.0 + -16384.0 + ) + ) + ) + ) + (else + (quaternion-rotate-local-y! s3-0 s3-0 (* f30-1 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + (quaternion-slerp! (-> self root quat) arg1 s3-0 f30-1) + (vector+float*! (-> self root trans) arg0 s4-0 f30-1) + ) + ) + ) + +(defbehavior board-vehicle-get-in-car-land jinx ((arg0 symbol)) + (let ((s4-0 (the-as vehicle (handle->process (-> self vehicle)))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s4-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! gp-0 (-> s4-0 root quat)) + (vehicle-method-66 s4-0 (-> self root trans) (-> self seat)) + (let ((f0-0 1.0)) + (if arg0 + (quaternion-rotate-local-y! gp-0 gp-0 (* f0-0 (if (zero? (-> self seat)) + 16384.0 + -16384.0 + ) + ) + ) + (quaternion-rotate-local-y! gp-0 gp-0 (* f0-0 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + (quaternion-copy! (-> self root quat) gp-0) + ) + ) + +(defbehavior board-vehicle-get-in-car-sit jinx ((arg0 symbol)) + (let ((s4-0 (the-as vehicle (handle->process (-> self vehicle)))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s4-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! gp-0 (-> s4-0 root quat)) + (vehicle-method-66 s4-0 (-> self root trans) (-> self seat)) + (let ((f0-2 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (if arg0 + (set! f0-2 (- 1.0 f0-2)) + ) + (if arg0 + (quaternion-rotate-local-y! (-> self root quat) gp-0 (* (- 1.0 f0-2) (if (zero? (-> self seat)) + 16384.0 + -16384.0 + ) + ) + ) + (quaternion-rotate-local-y! (-> self root quat) gp-0 (* (- 1.0 f0-2) (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + ) + ) + +(defbehavior board-vehicle-get-in-car-end jinx () + (let ((gp-0 (the-as vehicle (handle->process (-> self vehicle))))) + (if (not gp-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! (-> self root quat) (-> gp-0 root quat)) + (vehicle-method-66 gp-0 (-> self root trans) (-> self seat)) + ) + (none) + ) + +(defstate board-vehicle (jinx) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jinx-get-in-car-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) + (ja-no-eval :group! jinx-get-in-car-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-jump gp-0 s5-0 #f) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-no-eval :group! jinx-get-in-car-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-land #f) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-get-in-car-sit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-sit #f) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-get-in-car-sit-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-end) + (suspend) + (ja :num! (seek!)) + ) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride) + ) + ) + +(defstate knocked-recover (jinx) + :virtual #t + :code (behavior () + (cond + ((enemy-method-109 self) + (go-die self) + ) + ((>= 0.0 (-> self box-time)) + (go-virtual wait-for-ride) + ) + (else + (go-virtual go-power-box) + ) + ) + ) + ) + +(defmethod civilian-method-232 ((this jinx) (arg0 vector)) + (let ((s3-0 (the-as vehicle (handle->process (-> this vehicle)))) + (s4-0 (new 'stack 'collide-query)) + ) + (vehicle-method-66 s3-0 arg0 (-> this seat)) + (vector-! arg0 arg0 (-> s3-0 root trans)) + (vector-normalize! arg0 (+ 18432.0 (vector-length arg0))) + (vector+! arg0 arg0 (-> s3-0 root trans)) + (when (enemy-above-ground? this s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> arg0 y) (-> s4-0 best-other-tri intersect y)) + (let ((v1-14 (-> this nav)) + (a1-10 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-10 vertex)) arg0 (the-as vector (-> v1-14 state mesh bounds))) + (set! (-> a1-10 vertex1 x) (-> v1-14 nearest-y-threshold)) + (set! (-> a1-10 data 20) (the-as uint 2)) + (if (nav-mesh-method-45 (-> v1-14 state mesh) a1-10) + (return #t) + ) + ) + ) + ) + #f + ) + +(defstate exit-vehicle (jinx) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((a0-1 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) + (if a0-1 + (set! (-> self nav-mesh-aid) (the-as actor-id (-> a0-1 entity aid))) + ) + (change-to a0-1 self) + ) + (when (not (-> self nav)) + (format #t "nav mesh not found~%") + (go-inactive self) + ) + (let ((v1-11 (-> self nav state))) + (set! (-> v1-11 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a0-5 (-> self nav state)) + (v1-14 (-> self dest-point)) + ) + (logclear! (-> a0-5 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-5 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-5 target-pos quad) (-> v1-14 quad)) + ) + 0 + (citizen-method-195 self) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (logior! (-> self flags) (citizen-flag persistent)) + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + (set-time! (-> self state-time)) + (let ((v1-28 (-> self root root-prim))) + (set! (-> v1-28 prim-core collide-as) (collide-spec)) + (set! (-> v1-28 prim-core collide-with) (collide-spec)) + ) + 0 + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + ) + :exit (behavior () + (set! (-> self box-time) 15.0) + (let ((t9-0 (-> (method-of-type civilian exit-vehicle) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (remove-riders (the-as vehicle (handle->process (-> self vehicle))) (the-as handle self)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (set-time! (-> self state-time)) + (while (not (civilian-method-232 self gp-0)) + (let ((s5-0 (the-as vehicle (handle->process (-> self vehicle)))) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s4-0 (-> s5-0 root quat)) + (vehicle-method-66 s5-0 (-> self root trans) (-> self seat)) + (quaternion-copy! (-> self root quat) s4-0) + ) + (when (time-elapsed? (-> self state-time) (seconds 2)) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride) + ) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jinx-get-out-car-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-end) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-get-out-car-getup-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-sit #t) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-get-out-car-start-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-land #t) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> gp-0 quad)) + (let ((gp-1 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) + (ja-no-eval :group! jinx-get-out-car-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-jump s5-1 gp-1 #t) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (let ((v1-133 (-> self root root-prim))) + (set! (-> v1-133 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-133 prim-core collide-with) (-> self root backup-collide-with)) + ) + (send-event (ppointer->process (-> self parent)) 'go-power-box) + (go-virtual go-power-box) + ) + ) + +(defstate waiting-idle (jinx) + :virtual #t + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> self destination))) + (let ((v1-0 (target-pos 0))) + (let ((a0-1 (-> self follow-dir))) + (let ((a1-0 (-> self follow-offset))) + (.mov vf7 a1-0) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-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 (&-> gp-0 quad) vf6) + ) + (if (< 12288.0 (vector-vector-distance (-> self destination) (-> self root trans))) + (go-virtual traveling) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 jinx-idle0-ja) (= v1-2 jinx-idle1-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (let ((gp-0 (rnd-int self 5))) + (while (>= gp-0 0) + (let ((v1-18 (ja-group))) + (if (not (and v1-18 (= v1-18 jinx-idle0-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! jinx-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (+! gp-0 -1) + ) + ) + (let ((v1-50 (ja-group))) + (if (not (and v1-50 (= v1-50 jinx-idle1-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (stop-look-at! self) + (ja-no-eval :group! jinx-idle1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-look-at-mode! self 1) + ) + #f + ) + :post (behavior () + (transform-post) + ) + ) + +(defstate traveling (jinx) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (stop-look-at! self) + (nav-enemy-method-177 self) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> self destination))) + (let ((v1-0 (target-pos 0))) + (let ((a0-1 (-> self follow-dir))) + (let ((a1-0 (-> self follow-offset))) + (.mov vf7 a1-0) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-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 (&-> gp-0 quad) vf6) + ) + (cond + ((< (vector-vector-distance (-> self destination) (-> self root trans)) 8192.0) + (go-virtual waiting-idle) + ) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (player-blocking-travel? self)) + (go-virtual traveling-blocked) + ) + ) + ) + ) + :code (behavior () + (until #f + (travel-anim self) + (suspend) + ) + #f + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self destination)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate go-power-box (jinx) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (stop-look-at! self) + (nav-enemy-method-177 self) + ) + :trans (behavior () + (set! (-> self destination quad) (-> self event-param-point quad)) + (if (< (vector-vector-distance (-> self destination) (-> self root trans)) 10240.0) + (go-virtual do-power-box) + ) + ) + :code (behavior () + (until #f + (travel-anim self) + (suspend) + ) + #f + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self destination)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate do-power-box (jinx) + :virtual #t + :event enemy-event-handler + :trans (behavior () + (set! (-> self box-time) (- (-> self box-time) (seconds-per-frame))) + ) + :code (behavior () + (stop-look-at! self) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jinx-kneel-down-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-3 (vector-! (new 'stack-no-clear 'vector) (-> self destination) (-> self root trans)))) + (seek-toward-heading-vec! (-> self root) a1-3 65536.0 0) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-kneel-fix-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! jinx-kneel-loop0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (< (-> self box-time) 0.0) + #t + (goto cfg-16) + ) + (ja-no-eval :group! jinx-kneel-loop1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (< (-> self box-time) 0.0) + #t + (goto cfg-16) + ) + ) + #f + (label cfg-16) + (ja-no-eval :group! jinx-kneel-up-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-look-at-mode! self 1) + (go-virtual wait-for-ride) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defstate traveling-blocked (jinx) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-182 self) + (nav-enemy-method-178 self) + (nav-enemy-method-184 self) + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (not (player-blocking-travel? self))) + (go-virtual traveling) + ) + ) + :code (-> (method-of-type jinx waiting-idle) code) + :post nav-enemy-simple-post + ) + +(defmethod adjust-target-speed ((this jinx)) + (-> this root) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> this destination) (-> this root trans)) + (vector-normalize-copy! (-> this follow-dir) s5-0 1.0) + (let* ((f0-1 (vector-dot (-> this follow-dir) s5-0)) + (f0-2 (- (- (-> this follow-offset)) f0-1)) + ) + 0.0 + (let ((f0-5 (if (>= f0-2 0.0) + (- 1.0 (* 0.000048828126 (fmin 20480.0 f0-2))) + (* -0.000048828126 (fmax -20480.0 f0-2)) + ) + ) + (s5-1 (-> this nav)) + ) + (set! (-> s5-1 target-speed) (lerp (-> this min-speed) (-> this max-speed) f0-5)) + ) + ) + ) + 0 + (none) + ) + +(defmethod travel-anim ((this jinx)) + (with-pp + (adjust-target-speed this) + (let ((f30-0 (-> this nav state speed))) + (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 12288.0 40960.0))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + ) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-9 (= v1-9 (-> this draw art-group data 9))) + (let ((v1-14 (-> this skel root-channel 1))) + (set! (-> v1-14 frame-interp 1) f28-0) + (set! (-> v1-14 frame-interp 0) f28-0) + ) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) + (f0-8 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) + (f0-11 (/ (* 16.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) + (a0-11 (-> this skel root-channel 0)) + ) + (set! (-> a0-11 param 0) f0-11) + (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-12 (-> this skel root-channel 1))) + (set! (-> a0-12 param 0) 0.0) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (else + (ja-channel-push! 2 (seconds 0.15)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 dist) 13107.2) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 9))) + (set! (-> a0-14 param 0) 1.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 9)) num-func-loop!) + ) + (let ((a0-15 (-> this skel root-channel 1))) + (set! (-> a0-15 frame-interp 1) f28-0) + (set! (-> a0-15 frame-interp 0) f28-0) + (set! (-> a0-15 dist) 21843.969) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) + (set! (-> a0-15 param 0) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-chan) + ) + ) + ) + ) + ) + ) + ) + +(defmethod event-handler ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('nav-mesh-kill) + (set! (-> this nav-mesh-aid) (the-as actor-id (-> this nav state mesh entity aid))) + (change-to *default-nav-mesh* this) + #t + ) + (else + ((method-of-type civilian event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod send-attack-on-jump-or-knocked ((this jinx) (arg0 process) (arg1 event-message-block)) + (cond + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) + ) + ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-6 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask enemy) (-> arg0 mask)) + (and v1-6 + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +(defmethod run-logic? ((this jinx)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; WARN: Return type mismatch citizen-flag vs none. +(defmethod citizen-method-194 ((this jinx)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (logior! (-> this flags) (citizen-flag persistent)) + (none) + ) + +(defmethod citizen-method-210 ((this jinx) (arg0 int) (arg1 process)) + 0 + (none) + ) + +(defmethod init-enemy-collision! ((this jinx)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 5734.4 0.0 7372.8) + (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 bot bot-targetable)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> v1-13 local-sphere) 0.0 3686.4 0.0 3686.4) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 5939.2 0.0 3686.4) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-17 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-17 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-17 local-sphere) 0.0 8192.0 0.0 3686.4) + ) + (set! (-> s5-0 nav-radius) 5734.4) + (let ((v1-19 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 6)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy-defaults! ((this jinx) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) + (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (t9-0 this arg0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + 0 + (none) + ) + +(defmethod init-enemy! ((this jinx)) + (set-vector! (-> this follow-dir) 0.0 0.0 1.0 1.0) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask bot)) + (set! (-> this min-speed) 24576.0) + (set! (-> this max-speed) 49152.0) + (set! (-> this follow-offset) 24576.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this info) *citizen-jinx-global-info*) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-jinx" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *jinx-nav-enemy-info*) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this shield-handle) (the-as handle #f)) + (set! (-> this health-handle) + (ppointer->handle (process-spawn jinx-hud :init hud-init-by-other :name "jinx-hud" :to this)) + ) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (-> this mission-squad) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 13) + (set! (-> this attacker-info max-num-attackers) (the-as uint 2)) + (logior! (-> this attacker-info flags) (city-attacker-info-flag cai1)) + ) + (go (method-of-object this wait-for-ride)) + 0 + (none) + ) + +(deftype task-manager-city-destroy-grid (task-manager) + ((jinx handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (next-box uint32) + (arrow-h handle) + (goal-pos vector :inline) + (goal-pos-front vector :inline) + (sub-state uint32) + (vehicle handle) + (wall-h handle) + (sound-name string) + (id sound-id) + (delay time-frame) + (delay-start time-frame) + (end-time time-frame :offset 360) + (intro-play? symbol) + ) + (:methods + (update-jinx-speech (_type_) none) + (set-speech-name (_type_ string int int) none) + ) + ) + + +(define *cty-destroy-grid-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 2 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +(define *cty-destroy-grid-mh-squad-member-settings* (new 'static 'inline-array mh-squad-member-settings 3 + (new 'static 'mh-squad-member-settings + :object-type (traffic-type metalhead-grunt) + :max-target-count #x7f + :target-count 5 + ) + (new 'static 'mh-squad-member-settings + :object-type (traffic-type metalhead-flitter) + :max-target-count #x7f + :target-count 6 + ) + (new 'static 'mh-squad-member-settings + :object-type (traffic-type metalhead-predator) + :max-target-count #x7f + :target-count 2 + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this task-manager-city-destroy-grid)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this wall-h) (the-as handle #f)) + (set-setting! 'kg-enemy-settings #f 0.0 *cty-destroy-grid-kg-squad-member-settings*) + (set-setting! 'mh-enemy-settings #f 0.0 *cty-destroy-grid-mh-squad-member-settings*) + (set-setting! 'city-sound '(citygrid) 0.0 2) + (set! (-> this sub-state) (the-as uint 0)) + (set! (-> this next-box) (the-as uint 0)) + (set! (-> this arrow-h) (the-as handle #f)) + (logior! (-> *cty-attack-controller* target-attacker flags) (city-attacker-info-flag cai3)) + (when *cty-attack-controller* + (let ((s5-0 (push-back-hatred *cty-attack-controller*))) + (set! (-> s5-0 hatred) 0.6) + (set! (-> s5-0 hatred-dist) 245760.0) + (set! (-> s5-0 dist-scale) 0.5) + (set! (-> s5-0 attacker-scale) 0.01) + (set! (-> s5-0 max-consider-dist) 614400.0) + (set-hatred-indices-for-all *cty-attack-controller* 0 (get-hatred-at-idx *cty-attack-controller* 9 0) s5-0 13) + ) + ) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this intro-play?) #f) + (set! (-> this sound-name) #f) + (none) + ) + +(defmethod set-speech-name ((this task-manager-city-destroy-grid) (arg0 string) (arg1 int) (arg2 int)) + (set! (-> this delay-start) + (+ (current-time) (the int (rand-vu-float-range (the float arg1) (the float arg2)))) + ) + (set! (-> this sound-name) arg0) + 0 + (none) + ) + +(defmethod update-jinx-speech ((this task-manager-city-destroy-grid)) + (with-pp + (case (get-status *gui-control* (-> this id)) + (((gui-status pending)) + (when (time-elapsed? (-> this start-time) (seconds 1)) + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + (set-time! (-> this end-time)) + ) + ) + (((gui-status unknown)) + (set! (-> this id) (new 'static 'sound-id)) + (set-time! (-> this end-time)) + ) + ) + (when (nonzero? (-> this jinx)) + (let ((s5-0 (handle->process (-> this jinx)))) + (when s5-0 + (when (and (zero? (-> this id)) (-> this sound-name) (>= (current-time) (-> this delay-start))) + (set! (-> this id) + (add-process *gui-control* this (gui-channel hal) (gui-action play) (-> this sound-name) -99.0 0) + ) + (sound-params-set! *gui-control* (-> this id) #f -1 -1 -1 (-> *setting-control* user-current talker-volume)) + (set-time! (-> this start-time)) + (set! (-> this sound-name) #f) + ) + (when (nonzero? (-> this id)) + (cond + ((-> *setting-control* user-current speech-control) + (when *sound-player-enable* + (let ((s4-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> s4-0 command) (sound-command set-param)) + (set! (-> s4-0 id) (-> this id)) + (set! (-> s4-0 params volume) (the int (* 1024.0 (-> *setting-control* user-current talker-volume)))) + (set! (-> s4-0 params fo-min) 15) + (set! (-> s4-0 params fo-max) 90) + (set! (-> s4-0 params fo-curve) 9) + (let ((a1-5 (-> (the-as process-focusable s5-0) root trans))) + (let ((gp-1 pp)) + (when (= a1-5 #t) + (if (and gp-1 (type? gp-1 process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) + (set! a1-5 (-> (the-as process-drawable gp-1) root trans)) + (set! a1-5 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> s4-0 params trans) a1-5) + ) + (set! (-> s4-0 params mask) (the-as uint 481)) + (-> s4-0 id) + ) + ) + ) + (else + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod move-cam-to-jinx ((this jinx)) + (cond + ((logtest? (-> this jinx-flags) (jinx-flag j0)) + (logclear! (-> this jinx-flags) (jinx-flag j0)) + (logior! (-> this jinx-flags) (jinx-flag j1)) + (let ((s4-0 (-> this move-dest))) + (set-cam-height this s4-0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 s4-0 (-> this root trans)) + (set-setting! 'string-max-height 'abs (-> s5-0 y) 0) + (set-setting! 'string-min-height 'abs (-> s5-0 y) 0) + (let ((f30-0 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))) + (set-setting! 'string-max-length 'abs f30-0 0) + (set-setting! 'string-min-length 'abs f30-0 0) + ) + ) + ) + (set-setting! 'immediate-string-min-max #f 0.0 0) + (let ((v0-6 (the-as object 1000))) + (set! (-> *ACTOR-bank* birth-max) (the-as int v0-6)) + v0-6 + ) + ) + ((logtest? (-> this jinx-flags) (jinx-flag j1)) + (logclear! (-> this jinx-flags) (jinx-flag j1)) + (send-event *camera* 'change-target this) + (send-event *camera* 'teleport-to-vector-start-string (-> this move-dest)) + ) + ) + ) + +(defmethod set-cam-height ((this jinx) (arg0 vector)) + (set-vector! arg0 0.0 12288.0 28672.0 1.0) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) + ) + ) + +(defstate die-fast (jinx) + :virtual #t + :enter (behavior () + (go-virtual die) + ) + ) + +(defstate die (jinx) + :virtual #t + :enter (behavior () + (logior! (-> self jinx-flags) (jinx-flag j0)) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (until (process-grab? *target* #f) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info die-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (send-event (ppointer->process (-> self parent)) 'fail) + (until #f + (suspend) + ) + #f + (let ((gp-0 (-> self child))) + (while gp-0 + (send-event (ppointer->process gp-0) 'notice 'die) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post (behavior () + (move-cam-to-jinx self) + (let ((t9-2 (-> (find-parent-state) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +(define *jinx-exit-vehicle-speech-index* 0) + +(define *jinx-board-vehicle-speech-index* 0) + +(define *jinx-exit-vehicle-speech* + (new 'static 'boxed-array :type string "jinx105" "jinx106" "jinx107" "jinx108") + ) + +(define *jinx-board-vehicle-speech* + (new 'static 'boxed-array :type string "jinx112" "jinx113" "jinx114" "jinx115" "jinx116" "jinx117") + ) + +(defmethod task-manager-method-26 ((this task-manager-city-destroy-grid)) + (local-vars (v1-180 float) (v1-201 float)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (update-jinx-speech this) + (when (nonzero? (-> this jinx)) + (let ((s5-0 (the-as jinx (handle->process (-> this jinx))))) + (when s5-0 + (when (nonzero? (-> this actor-group)) + (dotimes (s4-0 (length (-> this actor-group 0))) + (let ((s3-0 (-> this actor-group 0 data s4-0))) + (when (= (-> this next-box) s4-0) + (set! (-> this goal-pos quad) (-> s3-0 actor trans quad)) + (let ((s2-0 (-> this goal-pos-front))) + (let ((s1-0 (-> s3-0 actor trans))) + (let ((v1-17 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 actor quat)))) + (let ((a0-12 8192.0)) + (.mov vf7 a0-12) + ) + (.lvf vf5 (&-> v1-17 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) + ) + (when (< (vector-vector-distance (-> s3-0 actor trans) (-> s5-0 root trans)) 40960.0) + ) + ) + ) + ) + ) + (let ((s4-1 (entity-nav-mesh-by-aid (-> s5-0 nav-mesh-aid)))) + (cond + ((if (type? s4-1 entity-nav-mesh) + s4-1 + ) + ) + (else + ) + ) + ) + (when (= (+ (length (-> this actor-group 0)) 1) (-> this next-box)) + (+! (-> this next-box) 1) + (deactivate s5-0) + (let ((a0-20 (handle->process (-> this vehicle)))) + (if a0-20 + (deactivate a0-20) + ) + ) + (let ((a0-23 (-> this arrow-h process 0))) + (if a0-23 + (deactivate a0-23) + ) + ) + (send-event this 'complete) + ) + (let ((a1-6 *target*)) + (when (and a1-6 (focus-test? a1-6 pilot)) + (set-setting! 'music 'cityfi 0.0 0) + (when (not (-> this intro-play?)) + (set-setting! 'airlock #f 0.0 0) + (set-speech-name this "jinx102" 300 600) + (set! (-> this intro-play?) #t) + ) + ) + ) + (let ((v1-67 (the-as vehicle (handle->process (-> this vehicle))))) + (cond + (v1-67 + (logior! (-> v1-67 v-flags) (vehicle-flag persistent)) + (if (or (and (-> v1-67 next-state) (= (-> v1-67 next-state name) 'inactive)) (focus-test? v1-67 dead)) + (send-event this 'fail) + ) + ) + (else + (send-event this 'fail) + ) + ) + ) + (when (-> this arrow-h) + (let ((a0-47 (-> this arrow-h process 0)) + (v1-82 *target*) + (a2-4 (handle->process (-> this vehicle))) + ) + (cond + ((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'wait-for-ride)) + (logclear! (-> (the-as vehicle a2-4) v-flags) (vehicle-flag persistent)) + (if (and (the-as vehicle a2-4) v1-82 (not (logtest? (focus-status pilot) (-> v1-82 focus-status)))) + (send-event a0-47 'set-position (-> (the-as vehicle a2-4) root trans)) + (send-event a0-47 'set-position (-> s5-0 root trans)) + ) + (send-event (handle->process (-> this arrow-h)) 'show) + ) + ((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'ride)) + (cond + ((and a2-4 v1-82 (not (logtest? (focus-status pilot) (-> v1-82 focus-status)))) + (send-event a0-47 'set-position (-> s5-0 root trans)) + (send-event (handle->process (-> this arrow-h)) 'show) + ) + (else + (send-event (handle->process (-> this arrow-h)) 'set-position (-> this goal-pos)) + (send-event (handle->process (-> this arrow-h)) 'show) + ) + ) + ) + (else + (send-event (handle->process (-> this arrow-h)) 'hide) + ) + ) + ) + ) + (when *target* + (if (< 819200.0 (vector-vector-distance (-> s5-0 root trans) (target-pos 0))) + (send-event this 'fail) + ) + (let ((s4-4 (the-as vehicle (handle->process (-> this vehicle))))) + (when s4-4 + (cond + ((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'ride)) + (when (= (-> this next-box) (length (-> this actor-group 0))) + (deactivate s5-0) + (let ((a0-85 (handle->process (-> this vehicle)))) + (if a0-85 + (deactivate a0-85) + ) + ) + (let ((a0-88 (-> this arrow-h process 0))) + (if a0-88 + (deactivate a0-88) + ) + ) + (send-event this 'complete) + ) + (if (and (< (vector-vector-distance (-> this goal-pos) (-> s5-0 root trans)) 163840.0) + (begin + (.lvf vf1 (&-> (-> s4-4 root transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-180 vf1) + (let ((f0-4 v1-180) + (f1-2 12288.0) + ) + (< f0-4 (* f1-2 f1-2)) + ) + ) + ) + (send-event s5-0 'exit-vehicle (-> this goal-pos-front)) + ) + ) + ((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'wait-for-ride)) + (let ((v1-197 (get-best-seat s4-4 (-> s4-4 root trans) (the-as vehicle-seat-flag (-> s5-0 info seat-flag)) 1))) + (when (!= v1-197 -1) + (.lvf vf1 (&-> (-> s4-4 root transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-201 vf1) + (let ((f0-5 v1-201) + (f1-5 32768.0) + ) + (when (and (< f0-5 (* f1-5 f1-5)) + (let ((f0-6 (vector-vector-distance-squared (-> s4-4 root trans) (-> s5-0 root trans))) + (f1-8 204800.0) + ) + (< f0-6 (* f1-8 f1-8)) + ) + ) + (send-event s5-0 'board-vehicle s4-4) + (when (and (nonzero? (-> this next-box)) (!= (-> this next-box) (length (-> this actor-group 0)))) + (let ((a1-50 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-50 from) (process->ppointer pp)) + (set! (-> a1-50 num-params) 0) + (set! (-> a1-50 message) 'explode) + (let ((t9-38 send-event-function) + (v1-228 (-> this actor-group 0 data (+ (-> this next-box) -1) actor)) + ) + (t9-38 + (if v1-228 + (-> v1-228 extra process) + ) + a1-50 + ) + ) + ) + (set-speech-name this (-> *jinx-board-vehicle-speech* *jinx-board-vehicle-speech-index*) 300 600) + (set! *jinx-board-vehicle-speech-index* + (mod (+ *jinx-board-vehicle-speech-index* 1) (-> *jinx-board-vehicle-speech* length)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + ) + +(defstate wait (task-manager-city-destroy-grid) + :virtual #t + :code (behavior () + (set-setting! 'borrow-hold-perm '(ctycara) 0.0 0) + (while (or (!= (status-of-level-and-borrows *level* 'ctycara #f) 'active) + (!= (status-of-level-and-borrows *level* 'mhcitya #f) 'active) + ) + (suspend) + ) + (let ((t9-4 (-> (find-parent-state) code))) + (if t9-4 + ((the-as (function none) t9-4)) + ) + ) + ) + ) + +(defmethod taskman-event-handler ((this task-manager-city-destroy-grid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('go-power-box) + (set-speech-name this (-> *jinx-exit-vehicle-speech* *jinx-exit-vehicle-speech-index*) 300 600) + (set! *jinx-exit-vehicle-speech-index* + (mod (+ *jinx-exit-vehicle-speech-index* 1) (-> *jinx-exit-vehicle-speech* length)) + ) + (let ((v0-1 (the-as object (+ (-> this next-box) 1)))) + (set! (-> this next-box) (the-as uint v0-1)) + v0-1 + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate active (task-manager-city-destroy-grid) + :virtual #t + :enter (behavior () + (local-vars (sv-272 res-tag)) + (set-time! (-> self state-time)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> gp-0 position quad) (-> (new 'static 'vector :x -1781217.8 :y 49152.0 :z 3740217.0 :w 1.0) quad)) + (quaternion-copy! (-> gp-0 rotation) (new 'static 'quaternion :x 0.0013 :y 0.744 :z -0.0068 :w 0.6681)) + (set! (-> gp-0 object-type) (traffic-type civilian-car-a)) + (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~%") + ) + (when (-> gp-0 proc) + (set! (-> self vehicle) (process->handle (-> gp-0 proc))) + (send-event (handle->process (-> self vehicle)) 'scale-max-hit-points #x42c80000) + ) + ) + (let ((gp-1 (entity-by-name "tmanager-1"))) + (when gp-1 + (let ((s5-1 (new 'stack-no-clear 'enemy-init-by-other-params))) + (set! (-> s5-1 trans quad) (-> (new 'static 'vector :x -1785244.0 :y 35316.53 :z 3693337.5 :w 1.0) quad)) + (quaternion-copy! (-> s5-1 quat) (new 'static 'quaternion :y 0.5494 :w 0.8355)) + (set! (-> s5-1 entity) gp-1) + (set! (-> s5-1 directed?) #f) + (set! (-> s5-1 no-initial-move-to-ground?) #t) + (set! (-> s5-1 art-level) #f) + (set! (-> self jinx) + (process->handle + (ppointer->process (process-spawn jinx :init enemy-init-by-other self s5-1 :name "jinx" :to self)) + ) + ) + ) + (let ((v1-36 (-> self jinx process))) + (set-setting! 'kg-primary-target v1-36 1.0 (-> v1-36 0 pid)) + ) + (let ((v1-40 (-> self jinx process))) + (set-setting! 'mh-primary-target v1-40 1.0 (-> v1-40 0 pid)) + ) + (set! (-> self entity) (the-as entity-actor gp-1)) + (set! sv-272 (new 'static 'res-tag)) + (let ((v1-44 (res-lump-data gp-1 'actor-groups pointer :tag-ptr (& sv-272)))) + (cond + ((and v1-44 (nonzero? (-> sv-272 elt-count))) + (set! (-> self actor-group-count) (the-as int (-> sv-272 elt-count))) + (set! (-> self actor-group) (the-as (pointer actor-group) v1-44)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> self node-info task))) + ) + ) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'task-arrow-params))) + (let ((a0-38 (new 'static 'vector :w 1.0))) + (set! (-> gp-3 pos quad) (-> a0-38 quad)) + ) + (quaternion-identity! (-> gp-3 quat)) + (set! (-> gp-3 flags) (task-arrow-flags taf3 taf8)) + (set! (-> gp-3 map-icon) (the-as uint 12)) + (set! (-> self arrow-h) (process->handle (task-arrow-spawn gp-3 self))) + ) + ) + ) + +(deftype com-power-box (process-drawable) + ((root collide-shape :override) + (sound-id sound-id) + ) + (:state-methods + idle + explode + ) + ) + + +(defskelgroup skel-com-power-box com-power-box com-power-box-lod0-jg com-power-box-idle-ja + ((com-power-box-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defskelgroup skel-combox-debris-piece com-power-box com-power-box-debris-piece-lod0-jg -1 + ((com-power-box-debris-piece-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defskelgroup skel-combox-debris-panelwires com-power-box com-power-box-debris-panelwires-lod0-jg -1 + ((com-power-box-debris-panelwires-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defskelgroup skel-combox-debris-paneltop com-power-box com-power-box-debris-paneltop-lod0-jg -1 + ((com-power-box-debris-paneltop-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defskelgroup skel-combox-debris-tubes com-power-box com-power-box-debris-tubes-lod0-jg -1 + ((com-power-box-debris-tubes-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(define *combox-debris-params* (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-piece" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-panelwires" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-paneltop" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-tubes" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-piece" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-panelwires" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-paneltop" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-tubes" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-piece" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-panelwires" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-paneltop" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-tubes" + :offset (new 'static 'vector :w 1.0) + ) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(defstate idle (com-power-box) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('explode) + (go-virtual explode) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defstate explode (com-power-box) + :virtual #t + :exit (behavior () + (sound-stop (-> self sound-id)) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + (sound-play "bomb-set") + (set! (-> self sound-id) (sound-play "time-tick-loop")) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 5)) + (suspend) + ) + ) + (sound-stop (-> self sound-id)) + (sound-play "bomb-explode") + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 1 0) + (let ((v1-15 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 0))) + (set! (-> v1-15 prim-core collide-as) (collide-spec)) + (set! (-> v1-15 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-4 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-4 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-4 spawn-quat)) + (set! (-> gp-4 radius) 32768.0) + (set! (-> gp-4 scale) 1.0) + (set! (-> gp-4 group) (-> *part-group-id-table* 217)) + (set! (-> gp-4 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-4 damage) 2.0) + (set! (-> gp-4 damage-scale) 1.0) + (set! (-> gp-4 vehicle-damage-factor) 1.0) + (set! (-> gp-4 vehicle-impulse-factor) 1.0) + (set! (-> gp-4 ignore-proc) (process->handle #f)) + (explosion-spawn gp-4 (the-as process-drawable *default-pool*)) + ) + (dotimes (gp-5 (-> *combox-debris-params* joints length)) + (set-vector! + (-> *combox-debris-params* joints gp-5 offset) + (rand-vu-float-range -16384.0 16384.0) + (rand-vu-float-range 0.0 8192.0) + (rand-vu-float-range -4096.0 4096.0) + 1.0 + ) + ) + (let ((a1-11 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-11 hit-xz-reaction) 0.95) + (set! (-> a1-11 hit-y-reaction) 0.6) + (set! (-> a1-11 scale-rand-lo) 0.4) + (set! (-> a1-11 scale-rand-hi) 0.7) + (set! (-> a1-11 fountain-rand-transv-lo quad) (-> self root trans quad)) + (+! (-> a1-11 fountain-rand-transv-lo y) -40960.0) + (debris-spawn self a1-11 *combox-debris-params* (the-as process-drawable #f)) + ) + (sleep-code) + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this com-power-box) (arg0 entity-actor)) + (local-vars (sv-80 vector) (sv-96 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v0-3 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v0-3 prim-core collide-as) (collide-spec crate)) + (set! (-> v0-3 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v0-3 prim-core action) (collide-action solid rideable)) + (set! (-> v0-3 transform-index) 3) + (set-vector! (-> v0-3 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v0-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v0-4 prim-core collide-as) (collide-spec crate)) + (set! (-> v0-4 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v0-4 prim-core action) (collide-action solid rideable)) + (set! (-> v0-4 transform-index) 3) + (set-vector! (-> v0-4 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-24 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-com-power-box" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw light-index) (the-as uint 10)) + (let ((s5-2 (get-process *default-dead-pool* simple-nav-sphere #x4000 1))) + (when s5-2 + (let ((t9-9 (method-of-type simple-nav-sphere activate))) + (t9-9 (the-as simple-nav-sphere s5-2) this "simple-nav-sphere" (the-as pointer #x70004000)) + ) + (let ((s4-2 run-function-in-process) + (s3-1 s5-2) + (s2-0 simple-nav-sphere-init-by-other) + (s1-0 #x46333333) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-80 (-> this root trans)) + (let ((v0-10 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (let ((v1-36 8192.0)) + (.mov vf7 v1-36) + ) + (.lvf vf5 (&-> v0-10 quad)) + ) + (.lvf vf4 (&-> sv-80 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 (&-> s0-0 quad) vf6) + ((the-as (function object object object object object object none) s4-2) s3-1 s2-0 s1-0 s0-0 #f -1) + ) + (-> s5-2 ppointer) + ) + ) + (let ((s5-3 (get-process *default-dead-pool* simple-nav-sphere #x4000 1))) + (when s5-3 + (let ((t9-13 (method-of-type simple-nav-sphere activate))) + (t9-13 (the-as simple-nav-sphere s5-3) this "simple-nav-sphere" (the-as pointer #x70004000)) + ) + (let ((s4-3 run-function-in-process) + (s3-2 s5-3) + (s2-1 simple-nav-sphere-init-by-other) + (s1-1 #x46333333) + (s0-1 (new 'stack-no-clear 'vector)) + ) + (set! sv-96 (-> this root trans)) + (let ((v0-14 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (let ((v1-46 -8192.0)) + (.mov vf7 v1-46) + ) + (.lvf vf5 (&-> v0-14 quad)) + ) + (.lvf vf4 (&-> sv-96 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 (&-> s0-1 quad) vf6) + ((the-as (function object object object object object object none) s4-3) s3-2 s2-1 s1-1 s0-1 #f -1) + ) + (-> s5-3 ppointer) + ) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 2 0) + (go (method-of-object this idle)) + ) + ) diff --git a/goal_src/jak3/levels/city/farm/ctyfarm-obs.gc b/goal_src/jak3/levels/city/farm/ctyfarm-obs.gc index bd30a31602..472a88984f 100644 --- a/goal_src/jak3/levels/city/farm/ctyfarm-obs.gc +++ b/goal_src/jak3/levels/city/farm/ctyfarm-obs.gc @@ -7,3 +7,1599 @@ ;; DECOMP BEGINS +(defpartgroup group-farm-marrow-explode + :id 1134 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4001 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 4002 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4003 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4004 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 4005 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4006 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +(defpart 4004 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4003 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 32.0) + (:y (meters 0) (meters 5)) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 128.0 32.0) + (:a 128.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.033333335) (meters 0.083333336)) + (:accel-y (meters -0.003) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata 36864.0) + (:func 'check-water-level-drop-motion) + (:conerot-x (degrees 0) (degrees 85)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +(defpart 4005 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 12.0 2.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 32.0 32.0) + (:g 64.0 128.0) + (:b 255.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4006 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 3)) + (:scale-x (meters 7)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 5)) + (:r 32.0) + (:g 128.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 4002 + :init-specs ((:texture (ctyfarm-eggplant-body ctyfarma-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xf100500 #xf100400 #xf100300)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4001 + :init-specs ((:texture (ctyfarm-eggplant-body ctyfarma-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 3.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.13333334)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xf100500 #xf100400 #xf100300)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; WARN: Return type mismatch number vs none. +(defun check-farm-piece-ground ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (if (and (>= 35225.6 (-> arg2 rvec y)) (>= 0.0 (-> arg1 vel-sxvel y))) + (set! (-> arg2 rvec y) 35225.6) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + (none) + ) + +(defpart 4007 + :init-specs ((:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0)) + (:vel-y (meters 0)) + (:rotvel-x (degrees 0)) + (:rotvel-y (degrees 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:friction 0.8 0.1) + (:timer (seconds 4)) + (:next-time (seconds 0.5) (seconds 0.997)) + (:next-launcher 4008) + ) + ) + +(defpart 4008 + :init-specs ((:fade-a -0.21333334 -0.21333334) (:flags (sp-cpuinfo-flag-2 left-multiply-quat))) + ) + +(defpartgroup group-farm-beetree-explode + :id 1135 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4009 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4010 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 4011 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4012 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + (sp-item 4013 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 4014 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + ) + ) + +(defpart 4014 + :init-specs ((:texture (ctyfarm-chili-stem ctyfarma-sprite)) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 9)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.4) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4013 + :init-specs ((:texture (ctyfarm-chili-stem ctyfarma-sprite)) + (:num 12.0 3.0) + (:y (meters 0.5) (meters 9)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.4) (meters 0.4)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.13333334)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-farm-cabbage-explode + :id 1136 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4015 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 4016 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4017 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4018 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 4019 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4020 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +(defpart 4018 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0.5) (meters 3)) + (:z (meters -4) (meters 8)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 255.0) + (:b 0.0 64.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4017 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 32.0) + (:y (meters 0) (meters 2)) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 255.0) + (:b 0.0 128.0) + (:a 128.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.06666667) (meters 0.083333336)) + (:accel-y (meters -0.003) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata 36864.0) + (:func 'check-water-level-drop-motion) + (:conerot-x (degrees 0) (degrees 85)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +(defpart 4019 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 12.0 2.0) + (:y (meters 0.5) (meters 3)) + (:z (meters -4) (meters 8)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 196.0 64.0) + (:g 255.0) + (:b 0.0 64.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4020 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1.5)) + (:scale-x (meters 3)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 5)) + (:r 128.0) + (:g 255.0) + (:b 0.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 4016 + :init-specs ((:texture (ctyfarm-cab-body ctyfarma-sprite)) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 2)) + (:z (meters -1.5) 2.0 (meters 3)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4015 + :init-specs ((:texture (ctyfarm-cab-body ctyfarma-sprite)) + (:num 12.0 3.0) + (:y (meters 0.5) (meters 2)) + (:z (meters -1.5) 2.0 (meters 3)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.13333334)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-farm-small-cabbage-explode + :id 1137 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4009 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4010 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 4011 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4012 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +(defpart 4010 + :init-specs ((:texture (specs level-default-sprite)) + (:num 20.0) + (:y (meters 0.5) (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 255.0) + (:b 0.0 64.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4011 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 2.0) + (:y (meters 0.5) (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 1)) + (:r 196.0 64.0) + (:g 255.0) + (:b 0.0 64.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4012 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1.5)) + (:scale-x (meters 2)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 3.5)) + (:r 128.0) + (:g 255.0) + (:b 0.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 4009 + :init-specs ((:texture (ctyfarm-cab-body ctyfarma-sprite)) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 1)) + (:z (meters -1.5) 2.0 (meters 3)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-farm-chilirots-explode + :id 1138 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4021 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 4022 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4023 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4024 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + (sp-item 4025 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + ) + ) + +(defpart 4025 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4023 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 12.0 2.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 64.0) + (:g 0.0 16.0) + (:b 0.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4024 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 3)) + (:scale-x (meters 7)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 5)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 4022 + :init-specs ((:texture (ctyfarm-chili-stem ctyfarma-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xf100100 #xf100200)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4021 + :init-specs ((:texture (ctyfarm-chili-stem ctyfarma-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 3.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.13333334)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xf100100 #xf100200)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-farm-sprinkler-barrels-water + :id 1139 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 128) + :parts ((sp-item 4026 :fade-after (meters 300) :falloff-to (meters 300) :flags (sp7) :period (seconds 2) :length (seconds 0.167) :offset 80) + (sp-item 4027 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7) :period (seconds 2) :length (seconds 0.167) :offset 80) + (sp-item 4028 :fade-after (meters 180) :falloff-to (meters 180) :flags (sp7) :period (seconds 2) :length (seconds 0.335) :offset 30) + (sp-item 4028 :fade-after (meters 180) :falloff-to (meters 180) :flags (sp7) :period (seconds 2) :length (seconds 0.25) :offset 55) + (sp-item 4028 :fade-after (meters 180) :falloff-to (meters 180) :flags (sp7) :period (seconds 2) :length (seconds 0.335) :offset 80) + (sp-item 4029 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7) :period (seconds 2) :length (seconds 0.167) :offset 80) + ) + ) + +(defpart 4027 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 1.0) + (:z (meters -0.5)) + (:scale-x (meters 1) (meters 0.1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 64.0) + (:vel-z (meters 0.2) (meters 0.06666667)) + (:scalevel-x (meters 0.026666667) (meters 0.01)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.8 0.08) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:launchrot-x (degrees -15) (degrees 30)) + (:launchrot-z (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4026 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 10.0 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.2) (meters 0.06666667)) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyfarma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4028 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 2.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.13333334) (meters 0.13333334)) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyfarma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + (:launchrot-x (degrees -16) (degrees 32)) + (:launchrot-z (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4029 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 2.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.06666667)) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyfarma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + (:launchrot-x (degrees -70) (degrees 140)) + (:launchrot-z (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defskelgroup skel-farm-marrow farm-marrow farm-marrow-lod0-jg farm-marrow-idle-ja + ((farm-marrow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2.4 0 4) + ) + +(deftype farm-marrow (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defstate idle (farm-marrow) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +(defmethod init-from-entity! ((this farm-marrow) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-marrow" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +(defskelgroup skel-farm-beetree farm-beetree farm-beetree-lod0-jg farm-beetree-idle-ja + ((farm-beetree-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 7) + ) + +(deftype farm-beetree (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defstate idle (farm-beetree) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +(defmethod init-from-entity! ((this farm-beetree) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-beetree" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +(defskelgroup skel-farm-cabbage farm-cabbage farm-cabbage-lod0-jg farm-cabbage-idle-ja + ((farm-cabbage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(deftype farm-cabbage (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defstate idle (farm-cabbage) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +(defmethod init-from-entity! ((this farm-cabbage) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-cabbage" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +(defskelgroup skel-farm-small-cabbage farm-small-cabbage farm-small-cabbage-lod0-jg farm-small-cabbage-idle-ja + ((farm-small-cabbage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) + +(deftype farm-small-cabbage (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defstate idle (farm-small-cabbage) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +(defmethod init-from-entity! ((this farm-small-cabbage) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-small-cabbage" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +(defskelgroup skel-farm-chilirots farm-chilirots farm-chilirots-lod0-jg farm-chilirots-idle-ja + ((farm-chilirots-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 4.5) + ) + +(deftype farm-chilirots (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defstate idle (farm-chilirots) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +(defmethod init-from-entity! ((this farm-chilirots) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-chilirots" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +(defskelgroup skel-farm-sprinkler-barrels farm-sprinkler-barrels farm-sprinkler-barrels-lod0-jg farm-sprinkler-barrels-idle-ja + ((farm-sprinkler-barrels-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 3 4) + ) + +(deftype farm-sprinkler-barrels (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defstate idle (farm-sprinkler-barrels) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! farm-sprinkler-barrels-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + ) + ) + +(defmethod init-from-entity! ((this farm-sprinkler-barrels) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-farm-sprinkler-barrels" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +(defun farm-activate ((arg0 level)) + (let* ((v1-0 (-> arg0 name)) + (s5-0 (cond + ((= v1-0 'ctyfarma) + (new 'static 'boxed-array :type int32 5 0 0 #xf100500 #xf100400 #xf100300) + ) + ((= v1-0 'ctyfarmb) + (new 'static 'boxed-array :type int32 5 0 0 #xfd00500 #xfd00400 #xfd00300) + ) + ) + ) + (v1-1 (-> arg0 name)) + (gp-0 (cond + ((= v1-1 'ctyfarma) + (new 'static 'boxed-array :type int32 5 0 0 #xf100100 #xf100200) + ) + ((= v1-1 'ctyfarmb) + (new 'static 'boxed-array :type int32 5 0 0 #xfd00100 #xfd00200) + ) + ) + ) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4002) (sp-field-id spt-userdata)) initial-valuef) + (the-as float s5-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4001) (sp-field-id spt-userdata)) initial-valuef) + (the-as float s5-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4022) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4021) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + ) + (setup-special-textures (-> *part-id-table* 4002) "ctyfarm-eggplant-body") + (setup-special-textures (-> *part-id-table* 4001) "ctyfarm-eggplant-body") + (setup-special-textures (-> *part-id-table* 4014) "ctyfarm-chili-stem") + (setup-special-textures (-> *part-id-table* 4013) "ctyfarm-chili-stem") + (setup-special-textures (-> *part-id-table* 4016) "ctyfarm-cab-body") + (setup-special-textures (-> *part-id-table* 4015) "ctyfarm-cab-body") + (setup-special-textures (-> *part-id-table* 4009) "ctyfarm-cab-body") + (setup-special-textures (-> *part-id-table* 4022) "ctyfarm-chili-stem") + (setup-special-textures (-> *part-id-table* 4021) "ctyfarm-chili-stem") + 0 + (none) + ) + +(defpartgroup group-ctyfarma-light + :id 1140 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4031 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 4032 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 4031 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 4032 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 12.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyfarma-drip-1 + :id 1141 + :flags (sp8) + :bounds (static-bspherem 0 -4 0 16) + :parts ((sp-item 4033 :fade-after (meters 140) :falloff-to (meters 140))) + ) + +(defun birth-func-ctyfarma-drip ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) + (let ((v1-2 s4-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd)) + (set! (-> v1-2 ignore-process0) #f) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* s4-0) + (cond + ((>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (set! (-> arg1 user-float) (-> s4-0 best-other-tri intersect y)) + (set! (-> arg1 datab 0) (the int (* 127.0 (-> s4-0 best-other-tri normal x)))) + (set! (-> arg1 datab 1) (the int (* 127.0 (-> s4-0 best-other-tri normal y)))) + (set! (-> arg1 datab 2) (the int (* 127.0 (-> s4-0 best-other-tri normal z)))) + (set! (-> arg1 datab 3) (the-as int (-> s4-0 best-other-tri pat event))) + ) + (else + (set! (-> arg1 omega) 65280.0) + (set! (-> arg1 user-float) (+ -204800.0 (-> arg2 launchrot y))) + ) + ) + ) + (let ((f0-19 (get-height *ocean* (-> arg2 launchrot) #f))) + (when (!= f0-19 4095996000.0) + (when (< (-> arg1 user-float) f0-19) + (set! (-> arg1 user-float) f0-19) + (set! (-> arg1 datab 0) 0) + (set! (-> arg1 datab 1) 127) + (set! (-> arg1 datab 2) 0) + (set! (-> arg1 datab 3) 0) + 0 + ) + ) + ) + 0 + (none) + ) + +(defun check-drop-level-ctyfarma-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (when (< (-> arg2 rvec y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 rvec x) (-> arg1 user-float) (-> arg2 rvec z) 1.0) + (if (< (vector-vector-distance (camera-pos) s3-0) 204800.0) + (sound-play "dirt-drips" :position s3-0) + ) + (launch-particles (-> *part-id-table* 4034) s3-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 4035) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +(defpart 4034 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.016666668) (meters 0.03)) + (:fade-a -0.16) + (:accel-y (meters -0.001) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 180)) + ) + ) + +(defpart 4030 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 4036)) + ) + +(defpart 4036 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 4030)) + ) + +(defpart 4035 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:omega (degrees 0)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 10 0 0 #x401800 #x403d00 #x400700 #x408200)) + (:func 'sparticle-texture-animate) + ) + ) + +(defpart 4033 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:birth-func 'birth-func-ctyfarma-drip) + (:num 0.05) + (:scale-x (meters 0)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 0.0) + (:vel-z (meters 0)) + (:scalevel-x (meters 0.00044444445)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.28444445) + (:friction 0.93 0.02) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-rain2) + (:next-time (seconds 0.75) (seconds 0.747)) + (:next-launcher 4037) + ) + ) + +(defpart 4037 + :init-specs ((:a 128.0) + (:fade-a 0.0) + (:accel-y (meters -0.006666667) (meters 0.00066666666)) + (:friction 0.93 0.02) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + ) + ) + +(defpartgroup group-ctyfarma-wall-bubbles + :id 1142 + :flags (sp4) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4038 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7))) + ) + +(defpart 4038 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.5) + (:x (meters -0.75) (meters 1.5)) + (:z (meters -4)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 16.0 16.0) + (:g 64.0 16.0) + (:b 32.0 32.0) + (:a 32.0 64.0) + (:vel-z (meters 0.013333334) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-ctyfarmb-light + :id 1143 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4039 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 4040 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 4039 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 4040 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 12.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyfarmb-drip-1 + :id 1144 + :flags (sp8) + :bounds (static-bspherem 0 -4 0 16) + :parts ((sp-item 4041 :fade-after (meters 140) :falloff-to (meters 140))) + ) + +(defun birth-func-ctyfarmb-drip ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) + (let ((v1-2 s4-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd)) + (set! (-> v1-2 ignore-process0) #f) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* s4-0) + (cond + ((>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (set! (-> arg1 user-float) (-> s4-0 best-other-tri intersect y)) + (set! (-> arg1 datab 0) (the int (* 127.0 (-> s4-0 best-other-tri normal x)))) + (set! (-> arg1 datab 1) (the int (* 127.0 (-> s4-0 best-other-tri normal y)))) + (set! (-> arg1 datab 2) (the int (* 127.0 (-> s4-0 best-other-tri normal z)))) + (set! (-> arg1 datab 3) (the-as int (-> s4-0 best-other-tri pat event))) + ) + (else + (set! (-> arg1 omega) 65280.0) + (set! (-> arg1 user-float) (+ -204800.0 (-> arg2 launchrot y))) + ) + ) + ) + (let ((f0-19 (get-height *ocean* (-> arg2 launchrot) #f))) + (when (!= f0-19 4095996000.0) + (when (< (-> arg1 user-float) f0-19) + (set! (-> arg1 user-float) f0-19) + (set! (-> arg1 datab 0) 0) + (set! (-> arg1 datab 1) 127) + (set! (-> arg1 datab 2) 0) + (set! (-> arg1 datab 3) 0) + 0 + ) + ) + ) + 0 + (none) + ) + +(defun check-drop-level-ctyfarmb-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (when (< (-> arg2 rvec y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 rvec x) (-> arg1 user-float) (-> arg2 rvec z) 1.0) + (if (< (vector-vector-distance (camera-pos) s3-0) 204800.0) + (sound-play "dirt-drips" :position s3-0) + ) + (launch-particles (-> *part-id-table* 4042) s3-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 4043) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +(defpart 4042 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.016666668) (meters 0.03)) + (:fade-a -0.16) + (:accel-y (meters -0.001) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4044) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 180)) + ) + ) + +(defpart 4044 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 4045)) + ) + +(defpart 4045 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 4044)) + ) + +(defpart 4043 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:omega (degrees 0)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 10 0 0 #x401800 #x403d00 #x400700 #x408200)) + (:func 'sparticle-texture-animate) + ) + ) + +(defpart 4041 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:birth-func 'birth-func-ctyfarmb-drip) + (:num 0.05) + (:scale-x (meters 0)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 0.0) + (:vel-z (meters 0)) + (:scalevel-x (meters 0.00044444445)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.28444445) + (:friction 0.93 0.02) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-rain2) + (:next-time (seconds 0.75) (seconds 0.747)) + (:next-launcher 4046) + ) + ) + +(defpart 4046 + :init-specs ((:a 128.0) + (:fade-a 0.0) + (:accel-y (meters -0.006666667) (meters 0.00066666666)) + (:friction 0.93 0.02) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4044) + ) + ) + +(defpartgroup group-ctyfarmb-wall-bubbles + :id 1145 + :flags (sp4) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4047 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7))) + ) + +(defpart 4047 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.5) + (:x (meters -0.75) (meters 1.5)) + (:z (meters -4)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 16.0 16.0) + (:g 64.0 16.0) + (:b 32.0 32.0) + (:a 32.0 64.0) + (:vel-z (meters 0.013333334) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) diff --git a/goal_src/jak3/levels/city/farm/ctyfarma-part.gc b/goal_src/jak3/levels/city/farm/ctyfarma-part.gc index 7f97a8dc11..395c119ec9 100644 --- a/goal_src/jak3/levels/city/farm/ctyfarma-part.gc +++ b/goal_src/jak3/levels/city/farm/ctyfarma-part.gc @@ -6,4 +6,3 @@ ;; dgos: CFB, CFA ;; DECOMP BEGINS - diff --git a/goal_src/jak3/levels/city/farm/ctyfarmb-part.gc b/goal_src/jak3/levels/city/farm/ctyfarmb-part.gc index 4036200af1..724a504707 100644 --- a/goal_src/jak3/levels/city/farm/ctyfarmb-part.gc +++ b/goal_src/jak3/levels/city/farm/ctyfarmb-part.gc @@ -6,4 +6,3 @@ ;; dgos: CFB, CFA ;; DECOMP BEGINS - diff --git a/goal_src/jak3/levels/city/freehq/freehq-part.gc b/goal_src/jak3/levels/city/freehq/freehq-part.gc index 3c55c6a302..f54e0ab04b 100644 --- a/goal_src/jak3/levels/city/freehq/freehq-part.gc +++ b/goal_src/jak3/levels/city/freehq/freehq-part.gc @@ -5,5 +5,2672 @@ ;; name in dgo: freehq-part ;; dgos: FREEHQ +(define-extern *range-landscape-scale-x* curve2d-fast) +(define-extern *range-landscape-scale-y* curve2d-fast) +(define-extern *curve-landscape-scale-x-temp* curve2d-fast) +(define-extern *curve-landscape-scale-x* curve2d-fast) +(define-extern *curve-landscape-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-freehq-center-sphere + :id 808 + :flags (sp0 sp6) + :bounds (static-bspherem 0 3 0 64) + :rotate ((degrees 90) (degrees 0) (degrees 0)) + :parts ((sp-item 2962 :flags (sp6)) + (sp-item 2963 :binding 2961) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2964 :flags (sp6)) + (sp-item 2965 :flags (sp6)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + ) + ) + +(defpart 2962 + :init-specs ((:texture (vinroom-tv-circle freehq-sprite)) + (:num 1.0) + (:y (meters 1.25)) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 30.0 30.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + ) + ) + +(defpart 2964 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1.25)) + (:scale-x (meters 6)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 24.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-4 glow)) + (:userdata 0.0) + ) + ) + +(defpart 2965 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 5.0) + (:y (meters 2.2)) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x (degrees 45)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.5)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0 15.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +(defpart 2966 + :init-specs ((:texture (holo-line freehq-sprite)) + (:num 1.0) + (:y (meters 1.25)) + (:scale-x (meters 1.8)) + (:rot-z (degrees 0) (degrees 36000)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 60.0) + (:b 10.0) + (:a 100.0) + (:rotvel-y (degrees -0.2) 1 (degrees 0.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'part-freehq-sphere-vert-line-flicker) + ) + ) + +(defun part-freehq-sphere-vert-line-flicker ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (if (zero? (mod (-> arg1 timer) 5)) + (set! (-> arg2 coneradius) (rand-vu-float-range 10.0 100.0)) + ) + 0 + (none) + ) + +(defpart 2963 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5) + (:y (meters 0.55) (meters 1.5)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defun birth-func-freehq-sphere ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((v1-1 (-> arg4 sprite key))) + (when (nonzero? v1-1) + (let ((f0-2 (+ (- 5120.0 (-> arg2 launchrot y)) (-> v1-1 origin trans y)))) + (set! (-> arg1 radius) (sqrtf (- (* (-> arg1 radius) (-> arg1 radius)) (* f0-2 f0-2)))) + ) + ) + ) + 0 + (none) + ) + +(defpart 2961 + :init-specs ((:texture (glow level-default-sprite)) + (:birth-func 'birth-func-freehq-sphere) + (:num 1.0) + (:x (meters 0) (meters 160)) + (:y (meters 0)) + (:z (meters 0.9)) + (:scale-x (meters 0.02) (meters 0.06)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 40.0) + (:a 0.0) + (:omega (degrees 0) (degrees 3600)) + (:vel-x (meters -0.005925926) (meters -0.005925926)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:fade-a 1.59375) + (:timer (seconds 4.4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.535)) + (:next-launcher 2967) + ) + ) + +(defpart 2967 + :init-specs ((:a 255.0) (:fade-a 0.0) (:next-time (seconds 1.667)) (:next-launcher 2968)) + ) + +(defpart 2968 + :init-specs ((:fade-a -1.59375)) + ) + +(defpartgroup group-freehq-smalla + :id 809 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2969 :flags (is-3d sp7)) + (sp-item 2970 :flags (is-3d sp7) :period (seconds 0.135) :length (seconds 0.017)) + (sp-item 2971 :flags (sp6 sp7)) + ) + ) + +(defpart 2969 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 0.2) + (:z (meters 0.015)) + (:scale-x (meters 0)) + (:rot-x (degrees 90)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0 8.0) + (:scalevel-x (meters 0.018437501)) + (:scalevel-y (meters 0.0103124995)) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 2972) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2972 + :init-specs ((:fade-a -2.1333334)) + ) + +(defpart 2970 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:z (meters 0.015)) + (:scale-x (meters 1.4) (meters 0.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.65) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:fade-a -1.0666667) + (:timer (seconds 0.135) (seconds 0.065)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 80 0 0 #x40b01300 #x40b01400 #x40b01500 #x40b01600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-smallb + :id 810 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2973 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2974 :flags (is-3d sp7) :period (seconds 1.067) :length (seconds 0.017) :offset 10) + (sp-item 2971 :flags (sp6 sp7)) + ) + ) + +(defpart 2973 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 1.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2974 + :init-specs ((:texture (vinroom-small-monitor-08 freehq-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 1.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:fade-a -0.7111111) + (:timer (seconds 1.067)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 80 0 0 #x40b01700 #x40b01800 #x40b01900 #x40b01a00)) + (:func 'sparticle-texture-animate) + (:next-time (seconds 0.267)) + (:next-launcher 2975) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2975 + :init-specs ((:a 64.0) (:fade-a -0.7111111) (:next-time (seconds 0.267)) (:next-launcher 2975)) + ) + +(defpart 2971 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 3)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 5)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 12.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-smallc + :id 811 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.5 0.65 0.0) + :parts ((sp-item 2976 :flags (sp7)) (sp-item 2977 :flags (sp7)) (sp-item 2978 :flags (sp6 sp7))) + ) + +(defpart 2978 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 7)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 5)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2977 + :init-specs ((:texture (vinroom-tv-text-m freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 1.0) + (:x (meters 0) 4 (meters 0.22)) + (:y (meters 1.6)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 2 64.0) + (:vel-y (meters -0.02)) + (:timer (seconds 0.767)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x40b02900 #x40b02b00 #x40b02c00 #x40b02800 #x40b02700 #x40b02a00) + ) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2976 + :init-specs ((:texture (vinroom-tv-text-m freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 4.0) + (:x (meters -0.66) 2 (meters 0.22)) + (:y (meters 1.5)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 3 64.0) + (:vel-y (meters -0.031666666)) + (:timer (seconds 0.435)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x40b02900 #x40b02b00 #x40b02c00 #x40b02800 #x40b02700 #x40b02a00) + ) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-smalld + :id 812 + :flags (sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.8 0.83 1.0) + :parts ((sp-item 2979 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2980 :flags (is-3d sp7) :period (seconds 0.8) :length (seconds 0.017)) + (sp-item 2981 :flags (sp6 sp7)) + ) + ) + +(defpart 2981 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 12.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2980 + :init-specs ((:texture (vinroom-tv-text-m freehq-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.625)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0016666667)) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 + 40 + 0 + 0 + #x40b02900 + #x40b02b00 + #x40b02c00 + #x40b02800 + #x40b02700 + #x40b02a00 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2979 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.05)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-x (degrees 90)) + (:scale-y (meters 1.25)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-rtablea + :id 813 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.25 0.25 1.0) + :parts ((sp-item 2982 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2983 :flags (is-3d sp7) :period (seconds 0.8) :length (seconds 0.017)) + (sp-item 2984 :flags (sp6 sp7)) + ) + ) + +(defpart 2984 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + ) + ) + +(defpart 2983 + :init-specs ((:texture (vinroom-tv-text-m freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees -90)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.625)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.001)) + (:scalevel-y (meters 0.00033333333)) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 + 40 + 0 + 0 + #x40b02900 + #x40b02b00 + #x40b02c00 + #x40b02800 + #x40b02700 + #x40b02a00 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2982 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1.8)) + (:rot-x (degrees 0)) + (:rot-y (degrees -90)) + (:rot-z (degrees 90)) + (:scale-y (meters 1.25)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 90)) + ) + ) + +(defpartgroup group-freehq-rtableb + :id 814 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.06 0.06 1.0) + :parts ((sp-item 2985 :flags (is-3d sp7)) + (sp-item 2986 :flags (is-3d sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 2987 :flags (sp7) :period (seconds 2) :length (seconds 0.017) :offset 125) + (sp-item 2988 :flags (sp7) :period (seconds 2) :length (seconds 0.017) :offset 300) + (sp-item 2989 :flags (sp7) :period (seconds 2) :length (seconds 0.017) :offset 375) + (sp-item 2990 :flags (sp6 sp7)) + ) + ) + +(defpart 2990 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 16)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2985 + :init-specs ((:texture (vinroom-tv-circle freehq-sprite)) + (:num 0.0 0.2) + (:x (meters 0.4)) + (:y (meters -0.2)) + (:z (meters -0.02)) + (:scale-x (meters 0)) + (:rot-x (degrees -90)) + (:rot-y (degrees 0)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y (meters 0.0016666667)) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:next-time (seconds 0.335)) + (:next-launcher 2991) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2991 + :init-specs ((:fade-a -0.53333336)) + ) + +(defpart 2986 + :init-specs ((:texture (vinroom-tv-radar freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 5)) + (:rot-x (degrees 0)) + (:rot-y (degrees -100.00001)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 80.0) + (:rotvel-y (degrees -0.6)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2987 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:x (meters 1.5)) + (:y (meters 1.5)) + (:z (meters 0)) + (:scale-x (meters 0.2)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.28444445) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2988 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:x (meters 1)) + (:y (meters -1.5)) + (:z (meters 0)) + (:scale-x (meters 0.2)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.28444445) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2989 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:x (meters -0.5)) + (:y (meters -2)) + (:z (meters 0)) + (:scale-x (meters 0.2)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.28444445) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-rtablec + :id 815 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2992 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2993 :flags (is-3d sp7) :period (seconds 1.067) :length (seconds 0.017) :offset 10) + (sp-item 2994 :flags (sp6 sp7)) + ) + ) + +(defpart 2992 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.46)) + (:rot-x (degrees 0)) + (:rot-y (degrees -90)) + (:rot-z (degrees -90)) + (:scale-y (meters 0.3)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2993 + :init-specs ((:texture (vinroom-small-monitor-08 freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.46)) + (:rot-x (degrees 0)) + (:rot-y (degrees -90)) + (:rot-z (degrees -90)) + (:scale-y (meters 0.3)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.7111111) + (:timer (seconds 1.067)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 80 0 0 #x40b01700 #x40b01800 #x40b01900 #x40b01a00)) + (:func 'sparticle-texture-animate) + (:next-time (seconds 0.267)) + (:next-launcher 2995) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2995 + :init-specs ((:a 64.0) (:fade-a -0.7111111) (:next-time (seconds 0.267)) (:next-launcher 2995)) + ) + +(defpart 2994 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 2)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-rtabled + :id 816 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2996 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2997 :flags (is-3d sp3 sp7)) + (sp-item 2998 :flags (is-3d sp3 sp7)) + (sp-item 2999 :flags (is-3d sp3 sp7)) + (sp-item 3000 :flags (is-3d sp3 sp7)) + (sp-item 3001 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3002 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3003 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3004 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3005 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3006 :flags (sp6 sp7)) + ) + ) + +(defpart 2996 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0.025)) + (:y (meters 0.05)) + (:z (meters -0.015)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2997 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 1.0) + (:x (meters -0.22)) + (:y (meters 0)) + (:z (meters -0.015)) + (:scale-x (meters 0.35)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 64.0) + (:rotvel-y (degrees -1.2) (degrees 2.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 3007) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3007 + :init-specs ((:rotvel-y (degrees -1.2) (degrees 2.4)) (:next-time (seconds 0.167) (seconds 0.33)) (:next-launcher 3007)) + ) + +(defpart 2998 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 1.0) + (:x (meters -0.22)) + (:y (meters 0)) + (:z (meters -0.015)) + (:scale-x (meters 0.15)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 255.0) + (:b 100.0) + (:a 64.0) + (:rotvel-y (degrees -1.2) (degrees 2.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 3007) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2999 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 1.0) + (:x (meters 0.22)) + (:y (meters 0.08)) + (:z (meters -0.015)) + (:scale-x (meters 0.25)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 64.0) + (:rotvel-y (degrees -1.2) (degrees 2.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 3008) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3008 + :init-specs ((:rotvel-y (degrees -0.6) (degrees 1.2)) (:next-time (seconds 0.5) (seconds 0.497)) (:next-launcher 3008)) + ) + +(defpart 3000 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 1.0) + (:x (meters 0.22)) + (:y (meters 0.08)) + (:z (meters -0.015)) + (:scale-x (meters 0.1)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 255.0) + (:b 100.0) + (:a 64.0) + (:rotvel-y (degrees -1.2) (degrees 2.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 3008) + (:rotate-y (degrees 0)) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun sparticle-kill-at-scale-eqline ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when (or (>= (-> arg2 launchrot w) 4096.0) (>= (-> arg2 conerot w) 1228.8)) + (set! (-> arg2 launchrot w) 0.0) + (set! (-> arg2 conerot w) 0.0) + ) + (none) + ) + +(defpart 3001 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3009 + :init-specs ((:scalevel-y (meters -0.0033333334) (meters 0.006666667)) + (:next-time (seconds 0.05) (seconds 0.047)) + (:next-launcher 3009) + ) + ) + +(defpart 3002 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3003 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0.1)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3004 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0.15)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3005 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3006 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 2)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-mediuma + :id 817 + :flags (sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3010 :flags (sp6 sp7)) + (sp-item 3011 :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3012 :flags (is-3d sp3 sp7)) + (sp-item 3013 :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + ) + ) + +(defpart 3012 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:y (meters 0)) + (:z (meters -0.02)) + (:scale-x (meters 4)) + (:rot-x (degrees 90)) + (:scale-y (meters 2)) + (:r 15.0) + (:g 15.0) + (:b 30.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (aux-list sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3013 + :init-specs ((:texture (vinroom-tv-linetext-01 freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:y (meters -0.8)) + (:z (meters 0.06)) + (:scale-x (meters 3.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 64.0 32.0) + (:vel-y (meters 0)) + (:timer (seconds 7.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 aux-list left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x40b01d00 + #x40b01e00 + #x40b01f00 + #x40b02000 + #x40b02100 + #x40b02200 + #x40b02300 + #x40b02400 + ) + ) + (:next-time (seconds 0.485)) + (:next-launcher 3014) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3014 + :init-specs ((:vel-y (meters 0.0016666667)) (:next-time (seconds 0.485)) (:next-launcher 3015)) + ) + +(defpart 3015 + :init-specs ((:vel-y (meters 0)) (:next-time (seconds 0.485)) (:next-launcher 3014)) + ) + +(defpart 3011 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 1.0) + (:x (meters 1.85)) + (:y (meters -0.8)) + (:z (meters 0.13)) + (:scale-x (meters 7.8)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.2)) + (:r 15.0) + (:g 15.0) + (:b 30.0) + (:a 128.0) + (:scalevel-x (meters -0.04)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 aux-list sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3010 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 6)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-mediumb + :id 818 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3016 :flags (sp6 sp7)) + (sp-item 3017 :flags (is-3d sp3 sp7)) + (sp-item 3018 :flags (is-3d sp3 sp7)) + (sp-item 3019 :flags (is-3d sp3 sp7)) + (sp-item 3020 :flags (is-3d sp3 sp7)) + (sp-item 3021 :flags (is-3d sp3 sp7)) + ) + ) + +(defpart 3016 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 6)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun sparticle-kill-at-scale-mediumb ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (if (>= (-> arg2 launchrot w) 18432.0) + (set! (-> arg2 launchrot w) 8192.0) + ) + (if (>= 0.0 (-> arg2 launchrot w)) + (set! (-> arg2 launchrot w) 2048.0) + ) + (none) + ) + +(defpart 3017 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 1.5)) + (:y (meters 0.8)) + (:z (meters -0.015)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +(defpart 3022 + :init-specs ((:scalevel-x (meters -0.006666667) (meters 0.013333334)) + (:next-time (seconds 0.085) (seconds 0.165)) + (:next-launcher 3022) + ) + ) + +(defpart 3018 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 1.3)) + (:y (meters 0.4)) + (:z (meters -0.015)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 20.0) + (:g 255.0) + (:b 100.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +(defpart 3019 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 1.1)) + (:y (meters 0)) + (:z (meters -0.015)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +(defpart 3020 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 0.9)) + (:y (meters -0.4)) + (:z (meters -0.01)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 20.0) + (:g 255.0) + (:b 100.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +(defpart 3021 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 0.7)) + (:y (meters -0.8)) + (:z (meters -0.015)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +(defpartgroup group-freehq-mediumc + :id 819 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3023 :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3024 :flags (sp6 sp7)) + (sp-item 3025 :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + ) + ) + +(defpart 3024 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 6)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3025 + :init-specs ((:texture (vinroom-small-monitor-01 freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0.025)) + (:y (meters -0.05)) + (:z (meters 0.02)) + (:scale-x (meters 3.8)) + (:rot-x (degrees 90)) + (:scale-y (meters 1.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.16666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + #x12c + 0 + 0 + #x40b01300 + #x40b01400 + #x40b01500 + #x40b01600 + #x40b01700 + #x40b01800 + #x40b01900 + #x40b01a00 + ) + ) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3023 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters -0.06)) + (:y (meters -0.8)) + (:z (meters 0.03)) + (:scale-x (meters 3.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 3)) + (:r 15.0) + (:g 15.0) + (:b 30.0) + (:a 128.0) + (:scalevel-y (meters -0.053333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 aux-list sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3026 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:x (meters 0.025)) + (:y (meters -0.8)) + (:z (meters 0.1)) + (:scale-x (meters 3.8)) + (:rot-x (degrees 90)) + (:scale-y (meters 3)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:scalevel-y (meters -0.053333335)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-mediumd + :id 820 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.5 0.5 0.5) + :parts ((sp-item 3027 :flags (is-3d sp7)) + (sp-item 3028 :flags (is-3d sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 3029 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 3030 :flags (sp6 sp7)) + ) + ) + +(defpart 3030 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 16)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 20.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3027 + :init-specs ((:texture (vinroom-tv-circle freehq-sprite)) + (:num 0.0 0.2) + (:scale-x (meters 0)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.026666667)) + (:scalevel-y (meters 0.013333334)) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:next-time (seconds 0.335)) + (:next-launcher 3031) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3031 + :init-specs ((:fade-a -0.53333336)) + ) + +(defpart 3028 + :init-specs ((:texture (vinroom-tv-radar freehq-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 80.0) + (:rotvel-y (degrees -0.6)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3029 + :init-specs ((:texture (vinroom-tv-radar-dots freehq-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 1.5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:rotvel-y (degrees 0.33333334) (degrees 0.26666668)) + (:timer (seconds 0.135) (seconds 0.53)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-biga + :id 821 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3032 :flags (sp6 sp7)) (sp-item 3033 :flags (is-3d sp7))) + ) + +(defpart 3033 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 0.0 0.2) + (:y (meters -0.2)) + (:scale-x (meters 2.3) 4 (meters 2.3)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 55.0 200.0) + (:g 55.0 200.0) + (:b 255.0) + (:a 8.0 8.0) + (:rotvel-y (degrees -0.26666668) (degrees 0.53333336)) + (:timer (seconds 0.5) (seconds 4.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3032 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 30)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-bigb + :id 822 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 3034 :flags (sp6 sp7)) + (sp-item 3035 :flags (is-3d sp7)) + (sp-item 3036 :flags (is-3d sp7)) + (sp-item 3037 :flags (is-3d sp7) :period (seconds 0.5) :length (seconds 0.017)) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun sparticle-kill-at-scale ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when (or (>= (-> arg2 launchrot w) 114688.0) (>= (-> arg2 conerot w) 65536.0)) + (set! (-> arg2 launchrot w) 0.0) + (set! (-> arg2 conerot w) 0.0) + ) + (none) + ) + +(defpart 3035 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 0.0 0.3) + (:x (meters 7.5)) + (:y (meters -4) 9 (meters 1)) + (:z (meters 0)) + (:scale-x (meters 0.15)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.15)) + (:r 200.0) + (:g 200.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.1) (meters 0.1)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3038 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a -0.016 -0.016)) + ) + +(defpart 3036 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 0.0 0.3) + (:x (meters -7) 13 (meters 1)) + (:y (meters -4.5)) + (:z (meters 0)) + (:scale-x (meters 0.15)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.15)) + (:r 200.0) + (:g 200.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-y (meters 0.1) (meters 0.1)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale) + (:rotate-y (degrees 0)) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun sparticle-kill-at-scale-squares ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when (or (>= (-> arg2 launchrot w) 40960.0) (>= (-> arg2 conerot w) 20480.0)) + (set! (-> arg2 launchrot w) 0.0) + (set! (-> arg2 conerot w) 0.0) + ) + (none) + ) + +(defpart 3037 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:x (meters -3) (meters 6)) + (:y (meters -3) (meters 6)) + (:z (meters 0.06)) + (:scale-x (meters 2) (meters 4)) + (:rot-x (degrees 90)) + (:scale-y (meters 1) (meters 2)) + (:r 55.0 200.0) + (:g 55.0 200.0) + (:b 255.0) + (:a 8.0 8.0) + (:vel-y (meters 0)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-squares) + (:next-time (seconds 0.485)) + (:next-launcher 3039) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3039 + :init-specs ((:scalevel-x (meters -0.06666667) 4 (meters 0.033333335)) + (:scalevel-y (meters -0.06666667) 4 (meters 0.033333335)) + (:next-time (seconds 0.167)) + (:next-launcher 3040) + ) + ) + +(defpart 3040 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:next-time (seconds 0.485)) (:next-launcher 3039)) + ) + +(defpart 3034 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 30)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-bigc + :id 823 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3043 :flags (sp6 sp7)) + (sp-item 3044 :flags (sp3 sp7) :binding 3041) + (sp-item 3041 :flags (sp2 sp3 sp7) :binding 3042) + (sp-item 3042 :flags (is-3d sp2)) + ) + ) + +(defpart 3043 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 30)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3044 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 3041 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:z (meters 1)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 255.0) + (:b 0.0) + (:a 0.0) + (:omega (degrees 90)) + (:vel-y (meters 0.053333335)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +(defpart 3042 + :init-specs ((:texture (circle freehq-sprite)) + (:num 0.08) + (:scale-x (meters 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 76)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 50.0) + (:scalevel-x (meters 0.006666667)) + (:rotvel-y (degrees 0.4)) + (:scalevel-y (meters 0.0139999995)) + (:fade-a -0.053333335) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 90)) + ) + ) + +(defpartgroup group-freehq-giant + :id 824 + :flags (sp0 sp1 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3045 :flags (sp6 sp7)) + (sp-item 3046 :flags (sp7)) + (sp-item 3047 :flags (sp7)) + (sp-item 3048 :flags (sp7)) + (sp-item 3049 :flags (sp7)) + (sp-item 3050 :flags (sp7)) + (sp-item 3051 :flags (is-3d sp6 sp7)) + ) + ) + +(defpart 3045 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 40)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 50)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3051 + :init-specs ((:texture (landscape freehq-sprite)) + (:birth-func 'birth-func-curve) + (:num 0.04) + (:x (meters 0)) + (:y (meters 2)) + (:z (meters 0.1)) + (:scale-x (meters 1)) + (:rot-x (degrees 90) 1 (degrees 180)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 255.0) + (:b 50.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:fade-a 0.026666667) + (:friction 1.01) + (:timer (seconds 4.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0)) + ) + ) + +(if #t + (set! *range-landscape-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 16.0 :z 17.0 :w 18.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-landscape-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.3 :z 0.6 :w 1.6) + :one-over-x-deltas (new 'static 'vector :x 0.12500001 :y 1.5000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-landscape-scale-x-temp* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.9 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.5 :y 1.5 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :y -2.9999988 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-landscape-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.85 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.8 :z 2.8 :w 3.7) + :one-over-x-deltas (new 'static 'vector :x 1.5999999 :y 2.8571427 :z 6.0000014 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-landscape-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-freehq-giant-landscape-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 4.085)) + ) + +(set! (-> *part-id-table* 3051 init-specs 19 initial-valuef) + (the-as float *part-freehq-giant-landscape-curve-settings*) + ) + +(set! (-> *part-freehq-giant-landscape-curve-settings* color-start) #f) + +(set! (-> *part-freehq-giant-landscape-curve-settings* alpha-start) #f) + +(set! (-> *part-freehq-giant-landscape-curve-settings* scale-x-start) *range-landscape-scale-x*) + +(set! (-> *part-freehq-giant-landscape-curve-settings* scale-y-start) *range-landscape-scale-y*) + +(set! (-> *part-freehq-giant-landscape-curve-settings* r-scalar) #f) + +(set! (-> *part-freehq-giant-landscape-curve-settings* g-scalar) #f) + +(set! (-> *part-freehq-giant-landscape-curve-settings* b-scalar) #f) + +(set! (-> *part-freehq-giant-landscape-curve-settings* a-scalar) #f) + +(set! (-> *part-freehq-giant-landscape-curve-settings* scale-x-scalar) *curve-landscape-scale-x*) + +(set! (-> *part-freehq-giant-landscape-curve-settings* scale-y-scalar) *curve-landscape-scale-y*) + +(defpart 3046 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.007) + (:x (meters -3.7)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.012) + (:timer (seconds 3.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees -45)) + ) + ) + +(defpart 3047 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.009) + (:x (meters -2)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.011) + (:timer (seconds 4.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees -25.000002)) + ) + ) + +(defpart 3048 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.008) + (:x (meters 0)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.01) + (:timer (seconds 4.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees 0)) + ) + ) + +(defpart 3049 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.007) + (:x (meters 2)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.011) + (:timer (seconds 4.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees 25.000002)) + ) + ) + +(defpart 3050 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.009) + (:x (meters 3.7)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.012) + (:timer (seconds 4.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees 45)) + ) + ) + +(defpart 3052 + :init-specs ((:texture (common-white common)) + (:birth-func 'birth-func-simple-prim) + (:num 1.0) + (:x (meters -27)) + (:y (meters -3)) + (:z (meters 1)) + (:scale-x (meters 30)) + (:rot-x (degrees 90)) + (:scale-y (meters 15)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3053 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:x (meters -10.5)) + (:y (meters -7)) + (:z (meters 1)) + (:scale-x (meters 3.3)) + (:rot-x (degrees 90)) + (:scale-y (meters 3.3)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3054 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:x (meters 19)) + (:y (meters -3)) + (:z (meters 1)) + (:scale-x (meters 15)) + (:rot-x (degrees 90)) + (:scale-y (meters 15)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-bigtable + :id 825 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3055 :flags (is-3d sp3 sp7)) (sp-item 3056 :flags (is-3d sp3 sp7))) + ) + +(defpart 3055 + :init-specs ((:texture (yavin freehq-sprite)) + (:num 1.0) + (:z (meters -0.15)) + (:scale-x (meters 3.7)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3056 + :init-specs ((:texture (twirl freehq-sprite)) + (:num 1.0) + (:z (meters -0.14)) + (:scale-x (meters 3.7)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 140.0) + (:rotvel-y (degrees 1.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-console-green-light-1 + :id 826 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.335) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-green-light-2 + :id 827 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.535) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-green-light-3 + :id 828 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.7) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-green-light-4 + :id 829 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.185) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-green-light-5 + :id 830 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 0.935) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-green-light-6 + :id 831 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.385) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-green-light-7 + :id 832 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.567) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-green-light-8 + :id 833 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 2) :length (seconds 0.167))) + ) + +(defpart 3057 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -0.025)) + (:z (meters 0)) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 255.0) + (:b 64.0 64.0) + (:a 32.0 4.0) + (:omega (degrees 1359)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-console-blue-light-1 + :id 834 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.335) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-blue-light-2 + :id 835 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.535) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-blue-light-3 + :id 836 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.7) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-blue-light-4 + :id 837 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.185) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-blue-light-5 + :id 838 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 0.935) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-blue-light-6 + :id 839 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.385) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-blue-light-7 + :id 840 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.567) :length (seconds 0.167))) + ) + +(defpartgroup group-freehq-console-blue-light-8 + :id 841 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 2) :length (seconds 0.167))) + ) + +(defpart 3058 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 20.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1359)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-red-wall-light + :id 842 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 3059 :fade-after (meters 80) :flags (sp6 sp7))) + ) + +(defpart 3059 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 20.0) + (:b 20.0) + (:a 40.0 2.0) + (:omega (degrees 1359)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-white-wall-light-top + :id 843 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 3060 :flags (sp6 sp7) :period (seconds 0.5) :length (seconds 0.017))) + ) + +(defpart 3060 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -0.2)) + (:scale-x (meters 0.6)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 0.8)) + (:r 40.0) + (:g 40.0) + (:b 200.0) + (:a -512.0 5 128.0) + (:omega (degrees 2268)) + (:timer (seconds 0.335) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-white-wall-light-bottom + :id 844 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 3061 :fade-after (meters 150) :flags (sp6 sp7) :period (seconds 0.5) :length (seconds 0.017))) + ) + +(defpart 3061 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -0.2)) + (:scale-x (meters 1)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 0.8)) + (:r 40.0) + (:g 128.0) + (:b 110.0) + (:a -256.0 5 64.0) + (:omega (degrees 2268)) + (:timer (seconds 0.335) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-freehq-red-wall-lights + :id 845 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 3062 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3063 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3064 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3065 :fade-after (meters 100) :flags (sp6 sp7)) + ) + ) + +(defpart 3062 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters 0.2)) + (:scale-x (meters 4.2) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 20.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 13107.2) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3063 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1.5)) + (:z (meters 0.2)) + (:scale-x (meters 4.2) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 20.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 13107.2) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3064 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters -1.5)) + (:z (meters 0.2)) + (:scale-x (meters 4.2) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 20.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 13107.2) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3065 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 8) (meters 0.1)) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 20.0 4.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 13107.2) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/city/freehq/freehq-scenes.gc b/goal_src/jak3/levels/city/freehq/freehq-scenes.gc index 99331cc144..02b4fe18f3 100644 --- a/goal_src/jak3/levels/city/freehq/freehq-scenes.gc +++ b/goal_src/jak3/levels/city/freehq/freehq-scenes.gc @@ -7,3 +7,1013 @@ ;; DECOMP BEGINS +(defskelgroup skel-purple-two purple-two purple-two-lod0-jg purple-two-idle-ja + ((purple-two-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :origin-joint-index 3 + ) + +(load-scene (new 'static 'scene + :name "factory-sky-battle-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "factory-sky-battle-intro" + :parts 8 + :command-list '((fadein (frame-time 30 20)) + (945 (fadeout (frame-time-30 15))) + (10000 (task-close! "factory-sky-battle-introduction")) + ) + :cut-list '(160 188 285 333 413 516 596 656 785 868) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(160 656) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'freehq + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'ltornsam + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "freehq-start" + :borrow '((freehq 0 ltornsam special)) + :sfx-volume -1.0 + :ambient-volume 0.5 + :music-delay 1500.0 + :scene-task #xd1 + :on-running #f + :on-complete #f + ) + ) + +(defskelgroup skel-freehq-sml-door freehq-sml-door freehq-sml-door-lod0-jg freehq-sml-door-idle-ja + ((freehq-sml-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 7) + ) + +(deftype freehq-sml-door (com-airlock) + () + ) + + +(defmethod init-from-entity! ((this freehq-sml-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 14336.0 0.0 28672.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 12288.0 14336.0 0.0 28672.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -12288.0 14336.0 0.0 28672.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-freehq-sml-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this sound-open) (static-sound-spec "hqdoor-open" :group 0)) + (set! (-> this sound-close) (static-sound-spec "hqdoor-close" :group 0)) + (go (method-of-object this close) #t) + ) + +(load-scene (new 'static 'scene + :name "city-protect-hq-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "city-protect-hq-intro" + :parts 25 + :command-list '((0) + (101 (kill "freehq-part-1")) + (216 (restore "freehq-part-1")) + (391 (kill "freehq-part-1")) + (667 (restore "freehq-part-1")) + (1170 (kill "freehq-part-1")) + (1256 (restore "freehq-part-1")) + (1500 (kill "freehq-part-1")) + (1636 (restore "freehq-part-1")) + (1731 (kill "freehq-part-1")) + (1790 (restore "freehq-part-1")) + (1907 (kill "freehq-part-1")) + (1938 (restore "freehq-part-1")) + (2185 (fadeout (frame-time-30 15))) + (10000 (task-close! "city-protect-hq-introduction")) + ) + :cut-list '(0 + 34 + 101 + 217 + 280 + 345 + 391 + 445 + 668 + 752 + 911 + 1057 + 1170 + 1257 + 1280 + 1342 + 1411 + 1500 + 1637 + 1731 + 1791 + 1889 + 1907 + 1938 + 2023 + 2046 + 2094 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min 1938) (2046 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(34 217 (667 671) 752 1500 1889 1938 2023 (2044 2050) (2092 2096)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min 2023) (2094 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'freehq + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'freecast + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'freecast + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'freecast + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'freecast + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'freecast + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "ctyslumc-freehq-exit" + :borrow '((freehq 0 ltornsam special)) + :sfx-volume -1.0 + :music-delay 1500.0 + :scene-task #xa8 + :on-running '(begin (sound-play-loop "hq-amb-mov") (sound-play-loop "hq-amb-loop-mov")) + :on-complete #f + ) + ) + +(load-scene + (new 'static 'scene + :name "city-protect-hq-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "city-protect-hq-res" + :parts 34 + :command-list '((2970 (fadeout (frame-time-30 30))) + (10000 (task-close! "sewer-hum-kg-introduction") (apply ,(lambda :behavior scene-player + () + (if (kiosk?) + (set! (-> self end-point) "sewb-elevator") + ) + (none) + ) + ) + ) + ) + :cut-list '(1 + 36 + 80 + 139 + 207 + 243 + 264 + 355 + 410 + 466 + 503 + 602 + 685 + 753 + 861 + 946 + 1001 + 1146 + 1178 + 1216 + 1278 + 1317 + 1436 + 1493 + 1557 + 1638 + 1723 + 1810 + 1869 + 1910 + 1967 + 2165 + 2198 + 2272 + 2391 + 2466 + 2544 + 2643 + 2772 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(80 139 207 355 (667 671) 753 1178 1638 1869 1910 1967 2165 2272 2391 2466) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'freecast + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'freecast + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min 503) (602 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'freecast + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'freecast + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min 685) (753 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'freecast + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "veger-highres" + :level 'freecast + :art-group "skel-veger-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(1 204 260 355 602 685 (751 755) 787 860 946 1178 1278 1317 1493 1638 1723 1802 1810 1820 1856 (1866 1879)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "freehq-movie" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "hq-amb-mov") (sound-play-loop "hq-amb-loop-mov")) + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "city-blow-tower-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "city-blow-tower-intro" + :parts 15 + :command-list '((1720 (fadeout (frame-time-30 15))) (10000 (task-close! "city-blow-tower-introduction"))) + :cut-list '(134 208 269 475 579 712 733 829 1019 1077 1201 1285 1328 1481 1536 1599) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'freecast + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "cty-blow-tower-mission" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "hq-amb-mov") (sound-play-loop "hq-amb-loop-mov")) + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "temple-defend-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "temple-defend-intro" + :parts 13 + :command-list '((0 (kill "freehq-part-1")) + (530 + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LindexC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LpinkyC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LthumbC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LringC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LmiddleC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RpinkyC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RthumbC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RringC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RmiddleC" + track + #t + duration + (frame-range 530 711) + ) + ) + (1111 (fadeout (frame-time-30 10))) + (10000 + (send-event self 'user-data-set! (task-closed? "temple-defend-introduction")) + (task-close! "temple-defend-introduction") + ) + ) + :cut-list '(28 151 530 712 825 1007 1067) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(712) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'freecast + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'freecast + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'freecast + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "purple-two" + :level 'freecast + :art-group "skel-purple-two" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'freecast + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "freehq-movie" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "hq-amb-mov") (sound-play-loop "hq-amb-loop-mov")) + :on-complete '(unless (send-event self 'user-data) (talker-spawn "powup015")) + ) + ) + +(defpartgroup groupfreehq-onin-finger-effect + :id 846 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3066 :falloff-to (meters 20)) (sp-item 3067 :falloff-to (meters 20))) + ) + +(defpart 3066 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.000016666667)) + (:timer (seconds 1) (seconds 2.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3068) + ) + ) + +(defpart 3068 + :init-specs ((:scale-x (meters 0.01) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.0) + (:next-time (seconds 0.017)) + (:next-launcher 3069) + ) + ) + +(defpart 3069 + :init-specs ((:r 0.0) (:g 64.0 64.0) (:b 255.0) (:a 64.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 3068)) + ) + +(defpart 3067 + :init-specs ((:texture (onin-magic-bigpuff freehq-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:timer (seconds 0.5) (seconds 1.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup groupfreehq-onin-small-finger-effect + :id 847 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3070 :falloff-to (meters 15)) (sp-item 3071 :falloff-to (meters 15))) + ) + +(defpart 3070 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.000016666667)) + (:timer (seconds 0.5) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3068) + ) + ) + +(defpart 3071 + :init-specs ((:texture (onin-magic-bigpuff freehq-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:timer (seconds 0.5) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) diff --git a/goal_src/jak3/levels/city/hijack/billiards.gc b/goal_src/jak3/levels/city/hijack/billiards.gc index ba47d0f105..28e9ebeef2 100644 --- a/goal_src/jak3/levels/city/hijack/billiards.gc +++ b/goal_src/jak3/levels/city/hijack/billiards.gc @@ -5,5 +5,268 @@ ;; name in dgo: billiards ;; dgos: LCTYHIJK +;; +++billiard-ball-flag +(defenum billiard-ball-flag + :type uint32 + :bitfield #t + (bb0 0) + (bb1 1) + ) +;; ---billiard-ball-flag + + ;; DECOMP BEGINS +(deftype billiard-ball (structure) + ((pos vector :inline) + (prev-pos vector :inline) + (size float) + (flags billiard-ball-flag) + ) + ) + + +(deftype billiard-ball-array (inline-array-class) + ((data billiard-ball :inline :dynamic) + ) + ) + + +(set! (-> billiard-ball-array heap-base) (the-as uint 48)) + +(deftype billiard-table (basic) + ((billiards billiard-ball-array) + (accum-force vector :inline) + (drag float) + (bounds vector 2 :inline) + (min-xyz vector :inline :overlay-at (-> bounds 0)) + (max-xyz vector :inline :overlay-at (-> bounds 1)) + (bounce-wall-friction float) + (ball-friction float) + ) + (:methods + (init! (_type_ int vector vector) none) + (billiard-table-method-10 (_type_) none) + (debug-draw (_type_) none) + (reset-accum-force (_type_) none) + (billiard-table-method-13 (_type_) symbol) + (billiard-table-method-14 (_type_) symbol) + (billiard-table-method-15 (_type_ float) none) + ) + ) + + +(defmethod reset-accum-force ((this billiard-table)) + (set! (-> this accum-force quad) (the-as uint128 0)) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this billiard-table) (arg0 int) (arg1 vector) (arg2 vector)) + (set! (-> this billiards) (new 'process 'billiard-ball-array arg0)) + (set! (-> this billiards length) arg0) + (set! (-> this min-xyz quad) (-> arg1 quad)) + (set! (-> this max-xyz quad) (-> arg2 quad)) + (dotimes (v1-4 (-> this billiards length)) + (set! (-> this billiards data v1-4 size) 4096.0) + ) + (billiard-table-method-13 this) + (none) + ) + +(defmethod billiard-table-method-13 ((this billiard-table)) + (dotimes (s5-0 (-> this billiards length)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this max-xyz) (-> this min-xyz))) + (s3-0 s4-0) + ) + (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + ) + (set! (-> s3-0 x) (* (+ -1.0 (the-as float v1-3)) (-> s2-1 x))) + ) + (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-7 (the-as number (logior #x3f800000 v1-6))) + ) + (set! (-> s3-0 y) (* (+ -1.0 (the-as float v1-7)) (-> s2-1 y))) + ) + (let* ((v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-11 (the-as number (logior #x3f800000 v1-10))) + ) + (set! (-> s3-0 z) (* (+ -1.0 (the-as float v1-11)) (-> s2-1 z))) + ) + (set! (-> s3-0 w) 1.0) + ) + (vector+! (the-as vector (-> this billiards data s5-0)) (-> this min-xyz) s4-0) + ) + ) + (billiard-table-method-14 this) + (dotimes (v1-23 (-> this billiards length)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> this billiards data 0 prev-pos)) (* 48 v1-23)))) + (-> this billiards data v1-23 pos quad) + ) + ) + #f + ) + +(defmethod billiard-table-method-10 ((this billiard-table)) + (with-pp + (dotimes (v1-0 (-> this billiards length)) + (set! (-> this billiards data v1-0 flags) (billiard-ball-flag)) + ) + (reset-accum-force this) + (billiard-table-method-15 + this + (* 0.0033333334 (the float (- (current-time) (-> pp clock old-frame-counter)))) + ) + (billiard-table-method-14 this) + (debug-draw this) + (none) + ) + ) + +(defmethod billiard-table-method-15 ((this billiard-table) (arg0 float)) + (let ((f0-1 (* arg0 arg0)) + (f1-1 (-> this drag)) + ) + (dotimes (v1-0 (-> this billiards length)) + (let ((a2-1 (-> this billiards data v1-0)) + (a1-4 (new 'stack-no-clear 'vector)) + ) + (let ((a3-0 (new 'stack-no-clear 'vector))) + (set! (-> a3-0 quad) (-> this accum-force quad)) + (vector-float*! a1-4 (-> a2-1 pos) (- 2.0 f1-1)) + (vector-! a1-4 a1-4 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) + (vector+float*! a1-4 a1-4 a3-0 f0-1) + ) + (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) + (set! (-> a2-1 pos quad) (-> a1-4 quad)) + ) + ) + ) + 0 + (none) + ) + +(defmethod relocate ((this billiard-table) (offset int)) + (if (nonzero? (-> this billiards)) + (&+! (-> this billiards) offset) + ) + (call-parent-method this offset) + ) + +(defmethod billiard-table-method-14 ((this billiard-table)) + (dotimes (s5-0 (-> this billiards length)) + (let ((s4-0 (+ s5-0 1)) + (s3-0 (+ (-> this billiards length) -1)) + ) + (while (>= s3-0 s4-0) + (let* ((s1-0 (-> this billiards data s5-0)) + (s2-0 (-> this billiards data s4-0)) + (s0-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 pos) (-> s1-0 pos))) + ) + 0.0 + (let ((f0-2 (+ (-> s1-0 size) (-> s2-0 size))) + (f1-1 (vector-length s0-1)) + ) + (when (< f1-1 f0-2) + (let ((f28-0 (/ (-> s2-0 size) f0-2)) + (f30-0 (/ (-> s1-0 size) f0-2)) + ) + (logior! (-> s1-0 flags) (billiard-ball-flag bb1)) + (logior! (-> s2-0 flags) (billiard-ball-flag bb1)) + (vector-normalize! s0-1 (- f0-2 f1-1)) + (vector+float*! (-> s1-0 pos) (-> s1-0 pos) s0-1 (- f28-0)) + (vector+float*! (-> s2-0 pos) (-> s2-0 pos) s0-1 f30-0) + ) + (let ((a0-9 (vector-! (new 'stack-no-clear 'vector) (-> s1-0 prev-pos) (-> s1-0 pos))) + (v1-21 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 prev-pos) (-> s2-0 pos))) + ) + (vector+float*! (-> s1-0 prev-pos) (-> s1-0 pos) a0-9 (- 1.0 (-> this ball-friction))) + (vector+float*! (-> s2-0 prev-pos) (-> s2-0 pos) v1-21 (- 1.0 (-> this ball-friction))) + ) + ) + ) + ) + (+! s4-0 1) + ) + ) + ) + (dotimes (s5-1 1) + (dotimes (s4-1 (-> this billiards length)) + (let ((s3-1 (-> this billiards data s4-1)) + (s1-1 #f) + (f30-1 2.0) + (s2-1 -1) + ) + -1 + (add-debug-line #t (bucket-id debug) (-> s3-1 prev-pos) (-> s3-1 pos) *color-blue* #f *color-green*) + (dotimes (v1-33 3) + (when (!= v1-33 1) + (let ((f0-10 (- (-> s3-1 prev-pos data v1-33) (-> s3-1 pos data v1-33)))) + 0.0 + (dotimes (a0-20 2) + (let ((f1-8 (/ (- (-> s3-1 prev-pos data v1-33) + (-> (the-as billiard-table (+ (+ (* v1-33 4) (* a0-20 16)) (the-as int this))) min-xyz x) + ) + f0-10 + ) + ) + ) + (when (and (< f1-8 f30-1) (>= f1-8 0.0) (< f1-8 1.0)) + (set! s1-1 #t) + (set! f30-1 f1-8) + (set! s2-1 v1-33) + ) + ) + ) + ) + ) + ) + (when s1-1 + (let ((a0-24 (vector-! (new 'stack-no-clear 'vector) (-> s3-1 pos) (-> s3-1 prev-pos))) + (v1-38 (new 'stack-no-clear 'vector)) + (s1-2 (new 'stack-no-clear 'vector)) + ) + (logior! (-> s3-1 flags) (billiard-ball-flag bb0)) + (vector+float*! v1-38 (-> s3-1 prev-pos) a0-24 f30-1) + (set! (-> s1-2 quad) (-> a0-24 quad)) + (set! (-> s1-2 data s2-1) (* -1.0 (-> s1-2 data s2-1))) + (vector+float*! (-> s3-1 pos) v1-38 s1-2 (- 1.0 f30-1)) + (let ((v1-39 (vector-normalize-copy! (new 'stack-no-clear 'vector) s1-2 1.0))) + 0.0 + (let* ((f0-18 (fabs (-> v1-39 data s2-1))) + (f1-10 (* f0-18 f0-18)) + ) + (vector-float*! s1-2 s1-2 (* -1.0 (- 1.0 (* f1-10 (-> this bounce-wall-friction))))) + ) + ) + (vector+! (-> s3-1 prev-pos) (-> s3-1 pos) s1-2) + ) + ) + ) + ) + ) + (dotimes (v1-51 (-> this billiards length)) + (let ((a0-40 (-> this billiards data v1-51))) + (dotimes (a1-30 3) + (set! (-> a0-40 pos data a1-30) + (fmax (fmin (-> a0-40 pos data a1-30) (-> this max-xyz data a1-30)) (-> this min-xyz data a1-30)) + ) + ) + ) + ) + #f + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod debug-draw ((this billiard-table)) + (dotimes (s5-0 (-> this billiards length)) + (let ((v1-3 (-> this billiards data s5-0))) + (add-debug-sphere #t (bucket-id debug) (-> v1-3 pos) (-> v1-3 size) *color-red*) + ) + ) + (add-debug-box #t (bucket-id debug) (-> this min-xyz) (-> this max-xyz) *color-red*) + (none) + ) diff --git a/goal_src/jak3/levels/city/hijack/cty-hijack-missile.gc b/goal_src/jak3/levels/city/hijack/cty-hijack-missile.gc index e5e685598e..2a3c39db22 100644 --- a/goal_src/jak3/levels/city/hijack/cty-hijack-missile.gc +++ b/goal_src/jak3/levels/city/hijack/cty-hijack-missile.gc @@ -7,3 +7,1440 @@ ;; DECOMP BEGINS +(defpart 4710 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 150.0) + (:b 150.0) + (:a 30.0 30.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.2 -0.2) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x400000 #x405c00)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4711 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 250.0) + (:g 80.0) + (:b 0.0) + (:a 30.0 30.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.0) + (:fade-g 1.4) + (:fade-b 3.0) + (:fade-a -0.2 -0.2) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 50 1 0 #x400000 #x405c00)) + (:next-time (seconds 0.167)) + (:next-launcher 4712) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4712 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpartgroup group-missile-thruster-fire + :id 1432 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4713 :flags (is-3d sp7)) (sp-item 4714 :flags (sp6 sp7))) + ) + +(defpart 4713 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -0.4) 1 (meters -0.5)) + (:scale-x (meters 0.1) 1 (meters 2)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 2) 1 (meters 2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 40.0) + (:fade-a -0.6) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4714 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.25)) + (:scale-x (meters 1.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 40.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defskelgroup skel-cty-hijack-missile cty-homing-missile cty-homing-missile-lod0-jg cty-homing-missile-idle-ja + ((cty-homing-missile-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :origin-joint-index 3 + ) + +(deftype cty-hijack-missile-init-params (structure) + ((pos vector :inline) + (quat quaternion :inline) + (track-obj handle) + (is-leader? symbol) + ) + ) + + +(deftype evasive-compare-params (structure) + ((data float 3) + (y-val float :overlay-at (-> data 0)) + (angular-velocity float :overlay-at (-> data 1)) + (speed float :overlay-at (-> data 2)) + ) + :pack-me + ) + + +(deftype evasive-action-info (structure) + ((start-values evasive-compare-params :inline) + (max-values evasive-compare-params :inline) + (difficulty float) + (evaded? symbol) + ) + (:methods + (init! (_type_ evasive-compare-params evasive-compare-params float) none) + (evaded? (_type_ evasive-compare-params) symbol) + ) + ) + + +(deftype hijack-missile-bobber (structure) + ((start-val float) + (current-val float) + (total-time time-frame) + (current-time time-frame) + (current-size-scalar float) + (dir float) + (num-iterations float) + (time-scalar float) + (start-time-scalar float) + (desired-time-scalar float) + (scale-min float) + (scale-max float) + (time-min float) + (time-max float) + (base-time float) + (current-speed float) + (output-scale float) + (output-val float) + (charge-time time-frame) + (wait-time time-frame) + (turning? symbol) + ) + :pack-me + (:methods + (init! (_type_) none) + (hijack-missile-bobber-method-10 (_type_) time-frame) + (hijack-missile-bobber-method-11 (_type_) time-frame) + ) + ) + + +;; WARN: Return type mismatch pointer vs none. +(defmethod init! ((this evasive-action-info) (arg0 evasive-compare-params) (arg1 evasive-compare-params) (arg2 float)) + (set! (-> this evaded?) #f) + (set! (-> this difficulty) arg2) + (mem-copy! (the-as pointer (-> this start-values)) (the-as pointer arg1) 12) + (mem-copy! (the-as pointer (-> this max-values)) (the-as pointer arg0) 12) + (none) + ) + +(defmethod evaded? ((this evasive-action-info) (arg0 evasive-compare-params)) + (local-vars (v0-0 symbol)) + 0.0 + (dotimes (v1-0 3) + (let ((f0-4 (/ (fabs (- (-> arg0 data v1-0) (-> this start-values data v1-0))) (-> this max-values data v1-0)))) + (when (< (-> this difficulty) f0-4) + (set! (-> this evaded?) #t) + (return (-> this evaded?)) + ) + ) + ) + (return (-> this evaded?)) + v0-0 + ) + +(deftype cty-hijack-missile (process-focusable) + ((root collide-shape-moving :override) + (tracked-player-positions vector-array) + (current-track-index uint32) + (last-record-time time-frame) + (track-obj handle) + (current-speed float) + (target-speed float) + (lunge-speed float) + (temp-vec vector :inline) + (evasive-info evasive-action-info :inline) + (target-pos vector :inline) + (flee-vec vector :inline) + (is-leader? symbol) + (offset-dist float) + (vel-factor float) + (original-quat quaternion :inline) + (rotate-deg float) + (basetrans vector :inline) + (lisa lissajous-interp :inline) + (next-lisa-time time-frame) + (lisa-pt vector :inline) + (circle-mag float) + (last-trans vector :inline) + (min-chase-speed float) + (min-targ-chase-speed float) + (max-chase-speed float) + (targ-scale-factor float) + (scale-factor float) + (missile-dist float) + (stage int8) + (particle-trail sparticle-subsampler) + (particle-trail-thrust sparticle-subsampler) + (peel-off-sound sound-id) + (bobber hijack-missile-bobber :inline) + ) + (:state-methods + idle + undefined0 + chasing + explode + undefined1 + undefined2 + undefined3 + lunge-prepare + lure + lure-die + chasing-2 + die + explode-tiny + initial-launch + fake-chase + ) + (:methods + (go-idle (_type_) object) + (cty-hijack-missile-method-44 (_type_) none) + (probe-ground (_type_ vector vector) symbol) + (get-tracked-obj-pos (_type_ vector) vector) + (cty-hijack-missile-method-47 (_type_ vector int) vector) + (cty-hijack-missile-method-48 (_type_ vector) vector) + (cty-hijack-missile-method-49 (_type_) none) + (event-handler (_type_ process int symbol event-message-block) object) + (cty-hijack-missile-method-51 (_type_) none) + (cty-hijack-missile-method-52 (_type_ symbol) float) + (cty-hijack-missile-method-53 (_type_) none) + ) + ) + + +(define *missile-dist-near* 31129.6) + +(define *missile-dist-far* 86016.0) + +(defbehavior cty-hijack-missile-init-by-other cty-hijack-missile ((arg0 cty-hijack-missile-init-params)) + (set! (-> self level) (level-get *level* 'lctyhijk)) + (stack-size-set! (-> self main-thread) 256) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((s5-0 (new 'process 'collide-shape-moving self (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-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) (collide-spec hit-by-others-list)) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-12) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-hijack-missile" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + self + (set! (-> self particle-trail) + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 4710) 8.0) + ) + self + (set! (-> self particle-trail-thrust) + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 4711) 8.0) + ) + (set! (-> self tracked-player-positions) (new 'process 'vector-array 250)) + (set! (-> self tracked-player-positions length) 0) + (set! (-> self last-record-time) 0) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1432) self)) + (set! (-> self is-leader?) (-> arg0 is-leader?)) + (set! (-> self track-obj) (-> arg0 track-obj)) + (set-vector! (-> self root scale) 0.8 0.8 0.9 1.0) + (go-idle self) + ) + +(defmethod go-idle ((this cty-hijack-missile)) + (set! (-> this peel-off-sound) (new-sound-id)) + (set! (-> this current-track-index) (the-as uint -1)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (set! (-> this stage) 0) + (init! (-> this bobber)) + (ja-post) + (go (method-of-object this idle)) + ) + +(defmethod get-tracked-obj-pos ((this cty-hijack-missile) (arg0 vector)) + (let* ((s5-0 (handle->process (-> this track-obj))) + (a0-5 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (if a0-5 + (set! (-> arg0 quad) (-> (get-trans a0-5 3) quad)) + ) + ) + arg0 + ) + +(defmethod probe-ground ((this cty-hijack-missile) (arg0 vector) (arg1 vector)) + (let ((v1-0 (new 'stack-no-clear 'collide-query))) + (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> v1-0 move-dist) arg1 (-> v1-0 start-pos)) + (let ((a0-4 v1-0)) + (set! (-> a0-4 radius) 8192.0) + (set! (-> a0-4 collide-with) (collide-spec backgnd)) + (set! (-> a0-4 ignore-process0) #f) + (set! (-> a0-4 ignore-process1) #f) + (set! (-> a0-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a0-4 action-mask) (collide-action solid)) + ) + (< (fill-and-probe-using-line-sphere *collide-cache* v1-0) 0.0) + ) + ) + +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 44 cty-hijack-missile) has a return type of none, but the expression builder found a return statement. +(defmethod cty-hijack-missile-method-44 ((this cty-hijack-missile)) + (let ((v1-1 (-> this tracked-player-positions length))) + (-> this tracked-player-positions) + (when (>= v1-1 (-> this tracked-player-positions allocated-length)) + (break!) + 0 + ) + ) + (let ((s5-0 (get-tracked-obj-pos this (new 'stack-no-clear 'vector)))) + (if (>= 40.96 (vector-vector-distance + (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -1)) + s5-0 + ) + ) + (return 0) + ) + (if (probe-ground + this + (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -2)) + s5-0 + ) + (set! (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -1) quad) + (-> s5-0 quad) + ) + (push-back (-> this tracked-player-positions) s5-0) + ) + ) + (none) + ) + +(defmethod relocate ((this cty-hijack-missile) (offset int)) + (if (nonzero? (-> this tracked-player-positions)) + (&+! (-> this tracked-player-positions) offset) + ) + (if (nonzero? (-> this particle-trail)) + (&+! (-> this particle-trail) offset) + ) + (if (nonzero? (-> this particle-trail-thrust)) + (&+! (-> this particle-trail-thrust) offset) + ) + (call-parent-method this offset) + ) + +(defmethod cty-hijack-missile-method-52 ((this cty-hijack-missile) (arg0 symbol)) + (set! (-> this min-chase-speed) 221184.0) + (set! (-> this min-targ-chase-speed) 221184.0) + (set! (-> this max-chase-speed) 253952.0) + (set! (-> this missile-dist) *missile-dist-near*) + (set! (-> this offset-dist) *missile-dist-near*) + (set! (-> this stage) 2) + (set! (-> this targ-scale-factor) 1.0) + (if arg0 + (set! (-> this scale-factor) (-> this targ-scale-factor)) + ) + ) + +(defstate idle (cty-hijack-missile) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('chase-2) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (cty-hijack-missile-method-52 self #t) + (go-virtual chasing-2) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self missile-dist) *missile-dist-far*) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (not (task-node-closed? (game-task-node city-hijack-vehicle-escape))) + (set! (-> self targ-scale-factor) 0.6) + (set! (-> self scale-factor) (-> self targ-scale-factor)) + (set! (-> self min-chase-speed) 114688.0) + (set! (-> self min-targ-chase-speed) 221184.0) + (set! (-> self max-chase-speed) 0.0) + (go-virtual initial-launch) + ) + ) + :code sleep-code + ) + +(defstate initial-launch (cty-hijack-missile) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('begin-moving) + (go-virtual fake-chase) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :trans (behavior () + (cty-hijack-missile-method-49 self) + (if (and (time-elapsed? (-> self state-time) (seconds 0.6)) + (or (time-elapsed? (-> self state-time) (seconds 1.5)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + ) + (go-virtual fake-chase) + ) + (let ((v1-15 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (* 0.0022222223 (the float (- (current-time) (-> self state-time)))) + (let ((f0-2 163840.0)) + (if (time-elapsed? (-> self state-time) (seconds 0.6)) + (set! f0-2 4096.0) + ) + (vector+float*! (-> self root trans) (-> self root trans) v1-15 (* f0-2 (seconds-per-frame))) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defstate die (cty-hijack-missile) + :virtual #t + :code nothing + ) + +(defstate explode-tiny (cty-hijack-missile) + :virtual #t + :enter (behavior () + (cond + ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 217)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 217)) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + '() + ) + ) + +(defstate explode (cty-hijack-missile) + :virtual #t + :enter (behavior () + (sound-play "hj-explode") + (logior! (-> self draw status) (draw-control-status no-draw)) + (cond + ((logtest? (-> *part-group-id-table* 296 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 296)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 296)) + ) + ) + (send-event + (handle->process (-> self track-obj)) + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 32.0) + (vehicle-damage-factor 2.0) + (vehicle-impulse-factor 0.0) + (mode 'eco-dark) + (penetrate-using (penetrate explode)) + ) + ) + ) + ) + :code (behavior () + '() + ) + ) + +(defmethod cty-hijack-missile-method-47 ((this cty-hijack-missile) (arg0 vector) (arg1 int)) + (let* ((s3-0 (handle->process (-> this track-obj))) + (s2-0 (if (type? s3-0 process-focusable) + (the-as h-kg-pickup s3-0) + ) + ) + (s3-1 (get-tracked-obj-pos this (new 'stack-no-clear 'vector))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! (-> s0-0 quad) (-> s2-0 root transv quad)) + (let ((v1-8 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s2-0 root quat))) + (s1-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (set! (-> v1-8 y) 0.0) + (set! (-> s0-0 y) 0.0) + (cond + (#f + (let ((f30-0 (* 0.41380316 (vector-length s0-0) (/ 32768.0 (fabs (-> s2-0 turn-rate))))) + (s0-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) s0-0 1.0)) + ) + (let ((f0-5 16384.0)) + (if (< (-> s2-0 turn-rate) 0.0) + (set! f0-5 (* -1.0 f0-5)) + ) + (vector-rotate-y! s0-1 s0-1 f0-5) + ) + (vector+float*! s1-0 s3-1 s0-1 f30-0) + ) + (let ((f0-8 (* 0.0033333334 (the float arg1) (-> s2-0 turn-rate))) + (s4-2 (vector-! (new 'stack-no-clear 'vector) s3-1 s1-0)) + ) + (vector-rotate-around-y! s4-2 s4-2 f0-8) + (vector+! s5-1 s1-0 s4-2) + ) + ) + (else + (vector+float*! s5-1 s3-1 s0-0 (* 0.0033333334 (the float arg1))) + ) + ) + ) + ) + (set! (-> arg0 quad) (-> s5-1 quad)) + ) + (add-debug-sphere #t (bucket-id debug) arg0 (meters 2) *color-yellow*) + arg0 + ) + +(defstate lunge-prepare (cty-hijack-missile) + :virtual #t + :code sleep-code + ) + +(defmethod cty-hijack-missile-method-48 ((this cty-hijack-missile) (arg0 vector)) + (let* ((s5-0 (handle->process (-> this track-obj))) + (v1-3 (if (type? s5-0 process-focusable) + (the-as h-kg-pickup s5-0) + ) + ) + ) + (when v1-3 + (set! (-> arg0 x) (-> v1-3 root trans y)) + (set! (-> arg0 y) (-> v1-3 turn-rate)) + (set! (-> arg0 z) (vector-length (-> v1-3 root transv))) + ) + ) + arg0 + ) + +(defstate lure-die (cty-hijack-missile) + :virtual #t + :enter (behavior () + (sound-stop (-> self peel-off-sound)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (cond + ((logtest? (-> *part-group-id-table* 88 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 88)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 88)) + ) + ) + (send-event (handle->process (-> self track-obj)) 'missile-hit) + (send-event (ppointer->process (-> self parent)) 'missile-die) + ) + :code nothing + ) + +(defstate lure (cty-hijack-missile) + :virtual #t + :enter (behavior () + (set! (-> self current-speed) 389120.0) + (set-time! (-> self state-time)) + (sound-play "missil-peel-off" :id (-> self peel-off-sound)) + ) + :trans (behavior () + (cty-hijack-missile-method-49 self) + (get-tracked-obj-pos self (-> self target-pos)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self target-pos) (-> self root trans)))) + 0.0 + (if (< (vector-normalize-ret-len! s5-1 1.0) 20480.0) + (go-virtual lure-die) + ) + (cond + ((not (time-elapsed? (-> self state-time) (seconds 0.2))) + (* 0.016666668 (the float (- (current-time) (-> self state-time)))) + (quaternion-slerp! + (-> self root quat) + (-> self root quat) + (-> self original-quat) + (* 3.0 (seconds-per-frame)) + ) + ) + (else + (let* ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (f0-7 (vector-dot s5-1 gp-0)) + ) + (when (< f0-7 0.999) + (let ((s4-1 (vector-cross! (new 'stack-no-clear 'vector) gp-0 s5-1)) + (f30-0 (acos f0-7)) + (f28-0 32768.0) + ) + (if (time-elapsed? (-> self state-time) (seconds 1.5)) + (set! f28-0 (* 0.0033333334 (the float (- (current-time) (-> self state-time))) f28-0)) + ) + (vector-normalize! s4-1 1.0) + (let ((f0-12 (fmin f30-0 (* f28-0 (seconds-per-frame))))) + (vector-rotate-around-axis! gp-0 (the-as quaternion gp-0) f0-12 s4-1) + ) + ) + (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) + ) + ) + ) + ) + ) + (let ((v1-42 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (vector+float*! + (-> self root trans) + (-> self root trans) + v1-42 + (* (-> self current-speed) (seconds-per-frame)) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +(defmethod cty-hijack-missile-method-49 ((this cty-hijack-missile)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (matrix-f-u-compose gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) + (set! (-> gp-0 trans quad) (-> this root trans quad)) + (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -3686.4) + (spawn-from-mat (-> this part) gp-0) + (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -4096.0) + (if (and (-> this next-state) (= (-> this next-state name) 'lure)) + (init-with-mat! (-> this particle-trail-thrust) gp-0) + (init-with-mat! (-> this particle-trail) gp-0) + ) + ) + 0 + (none) + ) + +(defun compute-target-speed () + (* 204800.0 (compute-suck-speed-scalar)) + ) + +;; WARN: Return type mismatch symbol vs object. +(defmethod event-handler ((this cty-hijack-missile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die) + (go (method-of-object this die)) + ) + (('explode) + (if (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + (go (method-of-object this explode)) + ) + ) + (('get-closer) + (set! (-> this missile-dist) 31129.6) + (set! (-> this target-speed) (compute-target-speed)) + ) + (('chase-2) + (cty-hijack-missile-method-52 this #f) + (if (and (-> this next-state) (= (-> this next-state name) 'chasing)) + (go (method-of-object this chasing-2)) + ) + ) + (('lure) + (when (-> this is-leader?) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 arg0)) + (set! (-> s4-0 quad) (-> (get-trans + (the-as process-focusable (if (type? s3-0 process-focusable) + (the-as process-focusable s3-0) + ) + ) + 3 + ) + quad + ) + ) + ) + (let ((s3-1 (get-tracked-obj-pos this (new 'stack-no-clear 'vector)))) + 0.0 + (let ((a0-17 (new 'stack-no-clear 'vector))) + (vector-! a0-17 s4-0 s3-1) + (let ((f0-3 (vector-normalize-ret-len! a0-17 1.0))) + (when (and (< 192512.0 f0-3) (< f0-3 286720.0)) + (format 0 "Player dist ~m~%" f0-3) + (let ((s2-0 (handle->process (-> this track-obj)))) + (when (if (type? s2-0 process-focusable) + s2-0 + ) + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> this root trans)))) + 0.0 + (let ((s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (vector-normalize-ret-len! s2-2 1.0) + (when (< 0.707 (vector-dot s1-0 s2-2)) + (let* ((s2-4 (vector-! (new 'stack-no-clear 'vector) s4-0 s3-1)) + (s4-1 vector-z-quaternion!) + (s3-2 (new 'stack-no-clear 'vector)) + (s1-1 (handle->process (-> this track-obj))) + (s4-2 (s4-1 s3-2 (-> (the-as process-focusable (if (type? s1-1 process-focusable) + (the-as process-focusable s1-1) + ) + ) + root + quat + ) + ) + ) + ) + (set! (-> s4-2 y) 0.0) + (vector-normalize! s4-2 1.0) + (set! (-> s2-4 y) 0.0) + (vector-normalize! s2-4 1.0) + (vector-cross! s2-4 s2-4 *up-vector*) + (let ((f0-10 (vector-dot s4-2 s2-4)) + (f30-0 9102.223) + ) + (if (< f0-10 0.0) + (set! f30-0 (* -1.0 f30-0)) + ) + (let ((s4-3 quaternion-rotate-y!) + (s3-3 (-> this original-quat)) + (s2-5 (handle->process (-> this track-obj))) + ) + (s4-3 + s3-3 + (-> (the-as process-focusable (if (type? s2-5 process-focusable) + (the-as process-focusable s2-5) + ) + ) + root + quat + ) + f30-0 + ) + ) + (set! (-> this rotate-deg) f30-0) + ) + ) + (set! (-> this track-obj) (process->handle arg0)) + (send-event arg0 'missile-attract) + (go (method-of-object this lure)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (('set-leader) + (set! (-> this is-leader?) #t) + ) + ) + #t + ) + +(defbehavior cty-hijack-missile-chase-event-handler cty-hijack-missile ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (event-handler self arg0 arg1 arg2 arg3) + ) + +(define *k0* 12.0) + +(define *k1* 1.0) + +(define *missile-dist-start* 81920.0) + +(define *accel-scalar* 0.5) + +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 51 cty-hijack-missile) has a return type of none, but the expression builder found a return statement. +(defmethod cty-hijack-missile-method-51 ((this cty-hijack-missile)) + (local-vars (sv-64 float) (sv-68 float) (sv-72 float) (sv-76 vector) (sv-80 float)) + (let* ((s4-0 (handle->process (-> this track-obj))) + (s5-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + (s4-1 (new 'stack-no-clear 'vector)) + (a0-5 (new 'stack-no-clear 'vector)) + ) + 0.0 + (if (not s5-0) + (return 0) + ) + (set! (-> a0-5 quad) (-> s5-0 root transv quad)) + (let ((f30-0 (vector-normalize-ret-len! a0-5 1.0))) + (set! (-> s4-1 quad) (-> this target-pos quad)) + (when #t + (seek! (-> this offset-dist) (-> this missile-dist) (* 20480.0 (seconds-per-frame))) + (seek! (-> this vel-factor) *k1* (* 2.0 (seconds-per-frame))) + (if (< (vector-vector-xz-distance (-> this basetrans) (get-trans s5-0 0)) 61440.0) + (set! (-> this vel-factor) *k1*) + ) + ) + (set! sv-64 (-> this offset-dist)) + (set! sv-68 (-> this current-speed)) + (set! sv-72 (the-as float 0.0)) + (set! sv-76 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this basetrans))) + (set! sv-80 (the-as float 0.0)) + (set! sv-72 (vector-normalize-ret-len! sv-76 1.0)) + (if (and (-> this is-leader?) (< (vector-vector-xz-distance (-> this basetrans) s4-1) 18432.0)) + (go (method-of-object this explode)) + ) + (cond + ((< 409.6 sv-72) + (set! sv-80 (+ (* (- sv-72 sv-64) *k0*) (* (- f30-0 sv-68) (-> this vel-factor)))) + (set! sv-80 (* sv-80 *accel-scalar*)) + (+! (-> this current-speed) (* sv-80 (seconds-per-frame))) + (when (-> this is-leader?) + ) + (seek! (-> this min-chase-speed) (-> this min-targ-chase-speed) (* 6144.0 (seconds-per-frame))) + (set! (-> this current-speed) (fmax (-> this current-speed) (-> this target-speed))) + (cond + ((>= 0.0 (-> this max-chase-speed)) + (when (< (vector-vector-xz-distance (-> this basetrans) (get-trans s5-0 0)) 32768.0) + ) + ) + ((< (vector-vector-xz-distance (-> this basetrans) (get-trans s5-0 0)) 81920.0) + (set! (-> this current-speed) + (fmax (fmin (-> this current-speed) (-> this max-chase-speed)) (-> this min-chase-speed)) + ) + ) + ) + (when (-> this is-leader?) + ) + (quaternion-look-at! (-> this root quat) sv-76 *up-vector*) + (vector+float*! (-> this basetrans) (-> this basetrans) sv-76 (* (-> this current-speed) (seconds-per-frame))) + ) + (else + (vector+float*! + (-> this basetrans) + (-> this basetrans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (* (-> this current-speed) (seconds-per-frame)) + ) + ) + ) + ) + ) + (when (< (-> this next-lisa-time) (current-time)) + (let* ((f30-1 30720.0) + (f28-0 6144.0) + (v1-57 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-58 (the-as number (logior #x3f800000 v1-57))) + ) + (set! (-> this circle-mag) (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-58))))) + ) + (cond + ((!= (-> this stage) 1) + (let* ((f30-2 43690.668) + (f28-1 10922.664) + (v1-64 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-65 (the-as number (logior #x3f800000 v1-64))) + ) + (set! (-> this lisa rate theta) (* (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-65)))) (seconds-per-frame))) + ) + (let* ((f30-3 9216.0) + (f28-2 7987.199) + (v1-71 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-72 (the-as number (logior #x3f800000 v1-71))) + ) + (set! (-> this lisa dest x-mag) (+ f30-3 (* f28-2 (+ -1.0 (the-as float v1-72))))) + ) + (let* ((f30-4 9216.0) + (f28-3 7987.199) + (v1-77 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-78 (the-as number (logior #x3f800000 v1-77))) + ) + (set! (-> this lisa dest y-mag) (+ f30-4 (* f28-3 (+ -1.0 (the-as float v1-78))))) + ) + (let* ((f30-5 0.5) + (f28-4 0.75) + (v1-83 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-84 (the-as number (logior #x3f800000 v1-83))) + ) + (set! (-> this lisa dest theta-rate) (+ f30-5 (* f28-4 (+ -1.0 (the-as float v1-84))))) + ) + ) + (else + (let* ((f30-6 32768.0) + (f28-5 10922.668) + (v1-90 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-91 (the-as number (logior #x3f800000 v1-90))) + ) + (set! (-> this lisa rate theta) (* (+ f30-6 (* f28-5 (+ -1.0 (the-as float v1-91)))) (seconds-per-frame))) + ) + (let* ((f30-7 5120.0) + (f28-6 5120.0) + (v1-97 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-98 (the-as number (logior #x3f800000 v1-97))) + ) + (set! (-> this lisa dest x-mag) (+ f30-7 (* f28-6 (+ -1.0 (the-as float v1-98))))) + ) + (let* ((f30-8 9216.0) + (f28-7 1024.0) + (v1-103 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-104 (the-as number (logior #x3f800000 v1-103))) + ) + (set! (-> this lisa dest y-mag) (+ f30-8 (* f28-7 (+ -1.0 (the-as float v1-104))))) + ) + (let* ((f30-9 0.5) + (f28-8 0.75) + (v1-109 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-110 (the-as number (logior #x3f800000 v1-109))) + ) + (set! (-> this lisa dest theta-rate) (+ f30-9 (* f28-8 (+ -1.0 (the-as float v1-110))))) + ) + ) + ) + (set! (-> this next-lisa-time) + (the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 601) 150 (current-time))) + ) + ) + (let ((v1-118 (the-as vehicle (handle->process (-> this track-obj))))) + (when v1-118 + (when (and (< 0.75 (fabs (-> v1-118 controls steering))) (!= (-> this stage) 1)) + (seek! (-> this lisa dest x-mag) (-> this circle-mag) (* 18432.0 (seconds-per-frame))) + (seek! (-> this lisa dest y-mag) (-> this circle-mag) (* 18432.0 (seconds-per-frame))) + ) + ) + ) + (set! (-> this lisa dest wx) 1.0) + (set! (-> this lisa dest wy) 1.2) + (set! (-> this lisa rate wx) 10.0) + (set! (-> this lisa rate wy) 10.0) + (set! (-> this lisa rate x-mag) (* 10240.0 (seconds-per-frame))) + (set! (-> this lisa rate y-mag) (* 10240.0 (seconds-per-frame))) + (set! (-> this lisa rate period-shift) (* 16384.0 (seconds-per-frame))) + (set! (-> this lisa dest period-shift) 16384.0) + (lissajous-interp-method-10 (-> this lisa)) + (let ((s5-3 (lissajous-interp-method-9 (-> this lisa) (new 'stack-no-clear 'vector)))) + (vector-float*! s5-3 s5-3 0.5) + (vector-lerp! (-> this lisa-pt) (-> this lisa-pt) s5-3 1.0) + (let ((a2-9 (matrix-f-u-compose (matrix-identity! (new 'stack-no-clear 'matrix)) sv-76 *up-vector*))) + (vector-matrix*! s5-3 (-> this lisa-pt) a2-9) + ) + (vector+! (-> this root trans) (-> this basetrans) s5-3) + ) + (let ((v1-147 (the-as vehicle (handle->process (-> this track-obj))))) + (when v1-147 + (if (< 0.75 (fabs (-> v1-147 controls steering))) + (set! (-> this bobber turning?) #t) + (set! (-> this bobber turning?) #f) + ) + ) + ) + (if (= (-> this stage) 1) + (set! (-> this bobber output-scale) 4096.0) + (set! (-> this bobber output-scale) 16384.0) + ) + (hijack-missile-bobber-method-10 (-> this bobber)) + (let ((f0-118 (- (-> this bobber output-val) (* 0.8 (-> this bobber output-scale))))) + (vector+float*! (-> this root trans) (-> this root trans) sv-76 f0-118) + ) + (let ((s5-5 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this last-trans)))) + (vector-normalize! s5-5 1.0) + (quaternion-look-at! (-> this root quat) s5-5 *up-vector*) + ) + (set! (-> this last-trans quad) (-> this root trans quad)) + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod cty-hijack-missile-method-53 ((this cty-hijack-missile)) + (set! (-> this next-lisa-time) 0) + (let* ((f30-0 72817.78) + (v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + ) + (set! (-> this lisa current theta) (* f30-0 (+ -1.0 (the-as float v1-3)))) + ) + (set! (-> this lisa current theta-rate) 1.0) + (set! (-> this lisa rate theta-rate) (seconds-per-frame)) + (set! (-> this lisa current x-mag) 20480.0) + (set! (-> this lisa current y-mag) 20480.0) + (set! (-> this lisa dest theta) (if (not (logtest? (rand-uint31-gen *random-generator*) 1)) + 1820444400.0 + -1820444400.0 + ) + ) + (set! (-> this lisa dest x-mag) 20480.0) + (set! (-> this lisa dest y-mag) 20480.0) + (set! (-> this next-lisa-time) 0) + (set! (-> this lisa dest wx) 1.0) + (set! (-> this lisa dest wy) 1.2) + (set! (-> this lisa dest period-shift) 16384.0) + (set! (-> this basetrans quad) (-> this root trans quad)) + (none) + ) + +(defstate fake-chase (cty-hijack-missile) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('begin-moving) + (set! (-> self target-speed) 143360.0) + ) + (('full-chase) + (set! (-> self missile-dist) *missile-dist-far*) + (set! (-> self offset-dist) *missile-dist-far*) + (set! (-> self stage) 1) + (set! (-> self targ-scale-factor) 0.6) + (set! (-> self scale-factor) (-> self targ-scale-factor)) + (set! (-> self min-chase-speed) 114688.0) + (set! (-> self min-targ-chase-speed) 221184.0) + (set! (-> self max-chase-speed) 0.0) + (set! (-> self current-speed) (-> self min-chase-speed)) + (set! (-> self target-speed) (-> self min-chase-speed)) + (go-virtual chasing-2) + ) + (else + (cty-hijack-missile-chase-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self target-speed) 0.0) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (cty-hijack-missile-method-53 self) + ) + :trans (behavior () + (local-vars (gp-4 symbol)) + (if (< 40960.0 (-> self min-chase-speed)) + (seek! (-> self min-chase-speed) 40960.0 (* 40960.0 (seconds-per-frame))) + ) + (seek! (-> self scale-factor) (-> self targ-scale-factor) (seconds-per-frame)) + (let ((v1-7 (-> self root scale)) + (a0-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-2 x) 0.8) + (set! (-> a0-2 y) 0.8) + (set! (-> a0-2 z) 0.9) + (set! (-> a0-2 w) 1.0) + (vector-float*! v1-7 a0-2 (-> self scale-factor)) + ) + (cty-hijack-missile-method-49 self) + (get-tracked-obj-pos self (-> self target-pos)) + (when (< (-> self next-lisa-time) (current-time)) + (let* ((f30-0 30720.0) + (f28-0 6144.0) + (v1-18 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-19 (the-as number (logior #x3f800000 v1-18))) + ) + (set! (-> self circle-mag) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-19))))) + ) + (let* ((f30-1 43690.668) + (f28-1 10922.664) + (v1-24 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-25 (the-as number (logior #x3f800000 v1-24))) + ) + (set! (-> self lisa rate theta) (* (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-25)))) (seconds-per-frame))) + ) + (let* ((f30-2 9216.0) + (f28-2 7987.199) + (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-32 (the-as number (logior #x3f800000 v1-31))) + ) + (set! (-> self lisa dest x-mag) (+ f30-2 (* f28-2 (+ -1.0 (the-as float v1-32))))) + ) + (let* ((f30-3 9216.0) + (f28-3 7987.199) + (v1-37 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-38 (the-as number (logior #x3f800000 v1-37))) + ) + (set! (-> self lisa dest y-mag) (+ f30-3 (* f28-3 (+ -1.0 (the-as float v1-38))))) + ) + (let* ((f30-4 0.5) + (f28-4 0.75) + (v1-43 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-44 (the-as number (logior #x3f800000 v1-43))) + ) + (set! (-> self lisa dest theta-rate) (+ f30-4 (* f28-4 (+ -1.0 (the-as float v1-44))))) + ) + (set! (-> self next-lisa-time) + (the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 601) 150 (current-time))) + ) + ) + (set! (-> self lisa dest wx) 1.0) + (set! (-> self lisa dest wy) 1.2) + (set! (-> self lisa rate wx) 10.0) + (set! (-> self lisa rate wy) 10.0) + (set! (-> self lisa rate x-mag) (* 10240.0 (seconds-per-frame))) + (set! (-> self lisa rate y-mag) (* 10240.0 (seconds-per-frame))) + (set! (-> self lisa rate period-shift) (* 16384.0 (seconds-per-frame))) + (set! (-> self lisa dest period-shift) 16384.0) + (lissajous-interp-method-10 (-> self lisa)) + (let ((gp-0 (lissajous-interp-method-9 (-> self lisa) (new 'stack-no-clear 'vector)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self target-pos) (-> self basetrans)))) + (vector-normalize! s5-1 1.0) + (vector-float*! gp-0 gp-0 0.5) + (vector-lerp! (-> self lisa-pt) (-> self lisa-pt) gp-0 1.0) + (let ((a2-4 (matrix-f-u-compose (matrix-identity! (new 'stack-no-clear 'matrix)) s5-1 *up-vector*))) + (vector-matrix*! gp-0 (-> self lisa-pt) a2-4) + ) + (vector+float*! (-> self basetrans) (-> self basetrans) s5-1 (* (-> self target-speed) (seconds-per-frame))) + ) + (vector+! (-> self root trans) (-> self basetrans) gp-0) + ) + (let ((gp-2 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self last-trans)))) + (vector-normalize! gp-2 1.0) + (quaternion-look-at! (-> self root quat) gp-2 *up-vector*) + ) + (set! (-> self last-trans quad) (-> self root trans quad)) + (if (and (< (vector-vector-distance (-> self root trans) (get-tracked-obj-pos self (new 'stack-no-clear 'vector))) + 20480.0 + ) + (-> self is-leader?) + ) + (go-virtual explode) + ) + (if (or (not (handle->process (-> self track-obj))) + (begin + (let* ((gp-5 #t) + (s5-3 (handle->process (-> self track-obj))) + (v1-94 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-3 process-focusable) + (the-as process-focusable s5-3) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-4 v1-94 gp-5) + ) + gp-4 + ) + ) + (go-virtual explode-tiny) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defstate chasing-2 (cty-hijack-missile) + :virtual #t + :event cty-hijack-missile-chase-event-handler + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self target-speed) 122880.0) + (set! (-> self current-speed) 122880.0) + (set! (-> self vel-factor) 10.0) + (cty-hijack-missile-method-53 self) + ) + :trans (behavior () + (local-vars (gp-0 symbol)) + (seek! (-> self scale-factor) (-> self targ-scale-factor) (seconds-per-frame)) + (let ((v1-2 (-> self root scale)) + (a0-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-1 x) 0.8) + (set! (-> a0-1 y) 0.8) + (set! (-> a0-1 z) 0.9) + (set! (-> a0-1 w) 1.0) + (vector-float*! v1-2 a0-1 (-> self scale-factor)) + ) + (cty-hijack-missile-method-49 self) + (get-tracked-obj-pos self (-> self target-pos)) + (cty-hijack-missile-method-51 self) + (if (or (not (handle->process (-> self track-obj))) + (begin + (let* ((gp-1 #t) + (s5-0 (handle->process (-> self track-obj))) + (v1-18 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-0 v1-18 gp-1) + ) + gp-0 + ) + ) + (go-virtual explode-tiny) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(define *use-lunging* #f) + +(defstate chasing (cty-hijack-missile) + :virtual #t + :event cty-hijack-missile-chase-event-handler + :enter (behavior () + (set! (-> self current-track-index) (the-as uint 1)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self current-speed) 122880.0) + (set! (-> self target-speed) (compute-target-speed)) + ) + :trans (behavior () + (cond + ((-> self is-leader?) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (cty-hijack-missile-method-49 self) + ) + (else + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + ) + (cty-hijack-missile-method-44 self) + (seek! (-> self current-speed) (-> self target-speed) (* 16384.0 (seconds-per-frame))) + (if (and (< (vector-vector-distance (-> self root trans) (get-tracked-obj-pos self (new 'stack-no-clear 'vector))) + 20480.0 + ) + (-> self is-leader?) + ) + (go-virtual explode) + ) + (let* ((a1-3 (-> self tracked-player-positions data (-> self current-track-index))) + (f0-6 (vector-vector-distance-squared (-> self root trans) a1-3)) + (f1-2 819.2) + ) + (when (< f0-6 (* f1-2 f1-2)) + (if (< (-> self current-track-index) (the-as uint (+ (-> self tracked-player-positions length) -1))) + (+! (-> self current-track-index) 1) + ) + ) + ) + (let ((gp-1 (+ (-> self tracked-player-positions length) -2))) + (until #f + (when (< gp-1 (the-as int (+ (-> self current-track-index) 1))) + 0 + (goto cfg-21) + ) + (when (probe-ground self (-> self root trans) (-> self tracked-player-positions data gp-1)) + (set! (-> self current-track-index) (the-as uint gp-1)) + 0 + (goto cfg-21) + ) + (+! gp-1 -1) + ) + ) + #f + (label cfg-21) + (let ((v1-52 (-> self tracked-player-positions data (+ (-> self current-track-index) -1))) + (s5-1 (-> self tracked-player-positions data (-> self current-track-index))) + (a0-19 (new 'stack-no-clear 'vector)) + (gp-2 (new 'stack-no-clear 'vector)) + ) + 0.0 + (vector-! a0-19 s5-1 v1-52) + (vector-normalize! a0-19 1.0) + (vector-! gp-2 s5-1 (-> self root trans)) + (let* ((f0-8 (vector-normalize-ret-len! gp-2 1.0)) + (f0-9 (fmin (* (-> self current-speed) (seconds-per-frame)) f0-8)) + ) + (vector+float*! (-> self root trans) (-> self root trans) gp-2 f0-9) + ) + (quaternion-look-at! (-> self root quat) gp-2 *up-vector*) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defmethod hijack-missile-bobber-method-10 ((this hijack-missile-bobber)) + (with-pp + (let* ((f1-2 (/ (the float (-> this current-time)) (the float (-> this total-time)))) + (f30-0 (fmax 0.0 (fmin 1.0 f1-2))) + ) + (set! (-> this time-scalar) (lerp (-> this start-time-scalar) (-> this desired-time-scalar) f30-0)) + (set! (-> this current-speed) (* (-> this dir) (cos (* 32768.0 f30-0)))) + (let ((f1-4 (sin (* 32768.0 f30-0)))) + (set! (-> this current-val) (+ (-> this start-val) (* (-> this current-size-scalar) f1-4 (-> this dir)))) + ) + ) + (set! (-> this output-val) (* (-> this output-scale) (-> this current-val))) + (when (< (-> this total-time) (-> this current-time)) + (set! (-> this start-val) (-> this current-val)) + (set! (-> this start-time-scalar) (-> this time-scalar)) + (set! (-> this current-time) 0) + (hijack-missile-bobber-method-11 this) + ) + (let ((v0-4 + (+ (-> this current-time) + (max 1 (the int (* (the float (- (current-time) (-> pp clock old-frame-counter))) (-> this time-scalar)))) + ) + ) + ) + (set! (-> this current-time) v0-4) + v0-4 + ) + ) + ) + +;; WARN: Return type mismatch time-frame vs none. +(defmethod init! ((this hijack-missile-bobber)) + (set! (-> this start-val) 0.0) + (set! (-> this current-val) 0.0) + (set! (-> this dir) 1.0) + (set! (-> this scale-min) 0.65) + (set! (-> this scale-max) 1.35) + (set! (-> this current-size-scalar) 1.0) + (set! (-> this num-iterations) 1.0) + (set! (-> this time-scalar) 1.0) + (set! (-> this start-time-scalar) 1.0) + (set! (-> this desired-time-scalar) 1.0) + (set! (-> this output-scale) 6144.0) + (set! (-> this time-min) 0.7) + (set! (-> this time-max) 0.8) + (set! (-> this base-time) 1.0) + (set! (-> this desired-time-scalar) 0.75) + (set! (-> this turning?) #f) + (hijack-missile-bobber-method-11 this) + (none) + ) + +;; WARN: Return type mismatch int vs time-frame. +(defmethod hijack-missile-bobber-method-11 ((this hijack-missile-bobber)) + (cond + (#f + (set! (-> this base-time) 0.25) + ) + (else + (let* ((f30-0 0.4) + (f28-0 0.20000002) + (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-6 (the-as number (logior #x3f800000 v1-5))) + ) + (set! (-> this base-time) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-6))))) + ) + ) + ) + (set! (-> this dir) (* -1.0 (-> this dir))) + (let* ((f28-1 (if (< (-> this dir) 0.0) + (+ 1.0 (-> this current-val)) + (- 1.0 (-> this current-val)) + ) + ) + (f30-1 (fmin (-> this scale-min) f28-1)) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> this current-size-scalar) + (+ f30-1 + (* (+ -1.0 (the-as float v1-15)) (- (fmin (-> this scale-max) f28-1) (fmin (-> this scale-min) f28-1))) + ) + ) + ) + (let* ((f0-19 (-> this current-size-scalar)) + (v0-2 (the int (* 300.0 (-> this base-time) (-> this num-iterations) f0-19))) + ) + (set! (-> this total-time) (the-as time-frame v0-2)) + (the-as time-frame v0-2) + ) + ) diff --git a/goal_src/jak3/levels/city/hijack/cty-hijack.gc b/goal_src/jak3/levels/city/hijack/cty-hijack.gc index 153019c833..0829b26b14 100644 --- a/goal_src/jak3/levels/city/hijack/cty-hijack.gc +++ b/goal_src/jak3/levels/city/hijack/cty-hijack.gc @@ -5,5 +5,2169 @@ ;; name in dgo: cty-hijack ;; dgos: LCTYHIJK +;; +++hijack-speech-info-flag +(defenum hijack-speech-info-flag + :type uint64 + :bitfield #t + (hsi0 0) + (hsi1 1) + (hsi2 2) + (hsi3 3) + (hsi4 4) + (hsi5 5) + ) +;; ---hijack-speech-info-flag + + ;; DECOMP BEGINS +(define *cty-hijack-speech-list* (new 'static 'inline-array talker-speech-class 52 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "dax372" + :channel (gui-channel daxter) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax373" + :channel (gui-channel daxter) + :flags (talker-flags tf0) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax374" + :channel (gui-channel daxter) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax375" + :channel (gui-channel daxter) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax376" + :channel (gui-channel daxter) + :speech #x5 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax377" + :channel (gui-channel daxter) + :speech #x6 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax378" + :channel (gui-channel daxter) + :speech #x7 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax379" + :channel (gui-channel daxter) + :speech #x8 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax380" + :channel (gui-channel daxter) + :speech #x9 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax381" + :channel (gui-channel daxter) + :flags (talker-flags tf0) + :speech #xa + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax382" + :channel (gui-channel daxter) + :speech #xb + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax383" + :channel (gui-channel daxter) + :speech #xc + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax384" + :channel (gui-channel daxter) + :speech #xd + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax385" + :channel (gui-channel daxter) + :speech #xe + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax386" + :channel (gui-channel daxter) + :speech #xf + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax387" + :channel (gui-channel daxter) + :speech #x10 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax388" + :channel (gui-channel daxter) + :speech #x11 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax389" + :channel (gui-channel daxter) + :speech #x12 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax390" + :channel (gui-channel daxter) + :speech #x13 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax391" + :channel (gui-channel daxter) + :speech #x14 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax392" + :channel (gui-channel daxter) + :speech #x15 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax393" + :channel (gui-channel daxter) + :speech #x16 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax394" + :channel (gui-channel daxter) + :speech #x17 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax395" + :channel (gui-channel daxter) + :speech #x18 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak101" + :channel (gui-channel jak) + :speech #x19 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak102" + :channel (gui-channel jak) + :speech #x1a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak103" + :channel (gui-channel jak) + :flags (talker-flags tf0) + :speech #x1b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak104" + :channel (gui-channel jak) + :speech #x1c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak105" + :channel (gui-channel jak) + :speech #x1d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak106" + :channel (gui-channel jak) + :speech #x1e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak107" + :channel (gui-channel jak) + :flags (talker-flags tf0) + :speech #x1f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak108" + :channel (gui-channel jak) + :speech #x20 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak109" + :channel (gui-channel jak) + :speech #x21 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak110" + :channel (gui-channel jak) + :flags (talker-flags tf0) + :speech #x22 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak111" + :channel (gui-channel jak) + :speech #x23 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak112" + :channel (gui-channel jak) + :flags (talker-flags tf0) + :speech #x24 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn149" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x25 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn150" + :channel (gui-channel voicebox) + :speech #x26 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn151" + :channel (gui-channel voicebox) + :speech #x27 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn152" + :channel (gui-channel voicebox) + :speech #x28 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn153" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x29 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn154" + :channel (gui-channel voicebox) + :speech #x2a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn155" + :channel (gui-channel voicebox) + :speech #x2b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn156" + :channel (gui-channel voicebox) + :speech #x2c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn157" + :channel (gui-channel voicebox) + :speech #x2d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn158" + :channel (gui-channel voicebox) + :speech #x2e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn159" + :channel (gui-channel voicebox) + :speech #x2f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn160" + :channel (gui-channel voicebox) + :speech #x30 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn161" + :channel (gui-channel voicebox) + :speech #x31 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn162" + :channel (gui-channel voicebox) + :speech #x32 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn163" + :channel (gui-channel voicebox) + :speech #x33 + :neg #x1 + :on-close #f + :camera #f + ) + ) + ) + +(deftype cty-hijack-manager (task-manager) + ((hpickup handle) + (missiles (array handle)) + (current-leader-missile int8) + (task-arrow handle) + (alert-expire-time time-frame) + (lure-hit-time time-frame :offset 280) + (naughty-ottsel-lure handle) + (missile-sound sound-id) + (vehicle-is-visible? symbol) + (last-check-vehicle-vis-time time-frame) + ) + (:state-methods + player-riding + decoy-stage + show-missile-launch + ) + (:methods + (cty-hijack-manager-method-35 (_type_) none) + (spawn-missile (_type_ vector quaternion int) handle) + (spawn-missiles-from-launcher (_type_ int) none) + (guide-arrow-spawn (_type_) symbol) + (cty-hijack-manager-method-39 (_type_ int) none) + (reset-hijack-speech (_type_) symbol) + ) + ) + + +(defstate fail (cty-hijack-manager) + :virtual #t + :enter (behavior ((arg0 resetter-params)) + (sound-stop (-> self missile-sound)) + (let* ((t9-1 find-parent-method) + (a0-2 cty-hijack-manager) + (t9-2 (-> (the-as (state resetter-params cty-hijack-manager) (t9-1 a0-2 18)) enter)) + ) + (if t9-2 + (t9-2 (the-as resetter-params a0-2)) + ) + ) + ) + ) + +(define *pickup-start-pos* (new 'static 'vector :x 3964271.5 :y 43008.0 :z 2372759.5 :w 1.0)) + +(define *pickup-start-angle* 16384.0) + +(deftype hijack-speech-instance (speech-instance) + () + ) + + +(deftype hijack-speech-info (structure) + ((speeches (array hijack-speech-instance)) + (flags hijack-speech-info-flag) + (play-time time-frame) + ) + ) + + +(defpartgroup group-lure-sirens + :id 1433 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4715 :flags (sp6 sp7))) + ) + +(defpartgroup group-lure-sirens-dim + :id 1434 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4716 :flags (sp6 sp7))) + ) + +(defpart 4716 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + ) + ) + +(defpart 4715 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + ) + ) + +(define *hijack-speech* (new 'static 'boxed-array :type hijack-speech-info + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x1f :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x3 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0 hsi3) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x2 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x23 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0 hsi3) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x1b :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x20 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x1a :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x1 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x6 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x7 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x4 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0 hsi3) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x25 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x5 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x27 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0 hsi3) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x22 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x8 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x9 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #xa :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x29 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #xb :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2d :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #xc :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2e :probability 1.0) + (new 'static 'hijack-speech-instance :speech #xe :probability 1.0) + (new 'static 'hijack-speech-instance :speech #xf :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2a :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #xd :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2b :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x28 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2f :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x31 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x13 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x14 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x15 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x16 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x17 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x18 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x1e :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x1c :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x2c :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x10 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x11 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x32 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x7 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x12 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x33 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + ) + ) + +(defmethod reset-hijack-speech ((this cty-hijack-manager)) + (dotimes (v1-0 (-> *hijack-speech* length)) + (logclear! (-> *hijack-speech* v1-0 flags) (hijack-speech-info-flag hsi4)) + (set! (-> *hijack-speech* v1-0 play-time) 0) + ) + #f + ) + +(defun debug-reset-hijack-speech () + (dotimes (v1-0 (-> *hijack-speech* length)) + (logclear! (-> *hijack-speech* v1-0 flags) (hijack-speech-info-flag hsi4 hsi5)) + (set! (-> *hijack-speech* 0 play-time) 0) + ) + #f + ) + +;; WARN: Function (method 39 cty-hijack-manager) has a return type of none, but the expression builder found a return statement. +(defmethod cty-hijack-manager-method-39 ((this cty-hijack-manager) (arg0 int)) + (let ((s4-0 (-> *hijack-speech* arg0)) + (v1-2 #xf4240) + (a1-1 0) + (s5-0 #f) + ) + (if (and (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi0)) + (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi4)) + ) + (return 0) + ) + (when (and (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi3)) + (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi5)) + ) + (set! s5-0 #t) + (set! s4-0 (-> *hijack-speech* (+ arg0 1))) + ) + (if (and (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi0)) + (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi4)) + ) + (return 0) + ) + (dotimes (a0-21 (-> s4-0 speeches length)) + (set! v1-2 (min (-> s4-0 speeches a0-21 num-play-times) v1-2)) + ) + (dotimes (a0-24 (-> s4-0 speeches length)) + (if (< v1-2 (-> s4-0 speeches a0-24 num-play-times)) + (set! a1-1 (logior a1-1 (ash 1 a0-24))) + ) + ) + (let ((s3-0 (rand-vu-int-count-excluding (-> s4-0 speeches length) a1-1))) + (logior! (-> s4-0 flags) (hijack-speech-info-flag hsi4 hsi5)) + (talker-spawn-func + (-> *cty-hijack-speech-list* (-> s4-0 speeches s3-0 speech)) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + (+! (-> s4-0 speeches s3-0 num-play-times) 1) + ) + (set-time! (-> s4-0 play-time)) + (if s5-0 + (set-time! (-> *hijack-speech* arg0 play-time)) + ) + ) + (none) + ) + +(deftype cty-missile-lure-init-params (structure) + ((pos vector :inline) + (orient quaternion :inline) + (is-naughty-ottsel? symbol) + ) + ) + + +(deftype cty-missile-lure (process-focusable) + ((minimap connection-minimap :offset 216) + (is-naughty-ottsel? symbol) + (lock-open? symbol) + (hum-sound sound-id) + (sirens2 sparticle-launch-control) + (raise-sound sound-id) + ) + (:state-methods + idle + active + complete + closing + opening + naughty-ottsel-wait + naughty-ottsel-lure + ) + (:methods + (go-idle (_type_) object) + (find-and-lure-missiles (_type_) symbol) + ) + ) + + +(defskelgroup skel-cty-missile-lure cty-decoy cty-decoy-lod0-jg cty-decoy-idle-ja + ((cty-decoy-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12.5) + ) + +(defmethod get-trans ((this cty-missile-lure) (arg0 int)) + "Get the `trans` for this process." + (cond + ((= arg0 3) + (let ((gp-1 (new 'static 'vector))) + (if (-> this is-naughty-ottsel?) + (set! (-> gp-1 quad) (-> this root trans quad)) + (vector<-cspace! gp-1 (-> this node-list data 16)) + ) + gp-1 + ) + ) + (else + (call-parent-method this arg0) + ) + ) + ) + +(defbehavior cty-missile-lure-init-by-other cty-missile-lure ((arg0 cty-missile-lure-init-params)) + (stack-size-set! (-> self main-thread) 256) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self mask) (process-mask enemy)) + (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-19 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 4) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-21 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 5) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-23 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 6) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-25 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 7) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-27 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-27 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 8) + (set-vector! (-> v1-27 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-29 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-29 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-29 prim-core action) (collide-action solid)) + (set! (-> v1-29 transform-index) 9) + (set-vector! (-> v1-29 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-31 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-31 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list tobot) + ) + (set! (-> v1-31 prim-core action) (collide-action solid)) + (set! (-> v1-31 transform-index) 3) + (set-vector! (-> v1-31 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-34 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-34 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-34 prim-core collide-with)) + ) + (set! (-> s5-0 event-self) 'touched) + (set! (-> self root) s5-0) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-missile-lure" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 orient)) + (set-vector! (-> self root scale) 3.0 3.0 3.0 1.0) + (set! (-> self is-naughty-ottsel?) (-> arg0 is-naughty-ottsel?)) + (set! (-> self lock-open?) #f) + (go-idle self) + ) + +(defstate naughty-ottsel-lure (cty-missile-lure) + :virtual #t + :enter (behavior () + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) + ) + :trans (behavior () + (when (< (vector-vector-xz-distance (-> self root trans) (target-pos 0)) 491520.0) + (send-event (ppointer->process (-> self parent)) 'complete) + (go-virtual complete) + ) + ) + :code sleep-code + ) + +(defstate naughty-ottsel-wait (cty-missile-lure) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('wake-up) + (go-virtual naughty-ottsel-lure) + ) + ) + ) + :code sleep-code + ) + +(defstate idle (cty-missile-lure) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (send-event (ppointer->process (-> self parent)) 'lure-hit) + (go-virtual opening) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) + ) + :trans (behavior () + (spawn-from-cspace (-> self sirens2) (-> self node-list data 17)) + (spawn-from-cspace (-> self sirens2) (-> self node-list data 18)) + (spawn-from-cspace (-> self sirens2) (-> self node-list data 19)) + ) + :code transform-and-sleep-code + :post transform-post + ) + +(defmethod deactivate ((this cty-missile-lure)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sirens2)) + (kill-particles (-> this sirens2)) + ) + (call-parent-method this) + (none) + ) + +(defmethod relocate ((this cty-missile-lure) (offset int)) + (if (nonzero? (-> this sirens2)) + (&+! (-> this sirens2) offset) + ) + (call-parent-method this offset) + ) + +(defmethod go-idle ((this cty-missile-lure)) + (set! (-> this hum-sound) (new-sound-id)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1433) this)) + (set! (-> this sirens2) (create-launch-control (-> *part-group-id-table* 1434) this)) + (set! (-> this raise-sound) (new-sound-id)) + (cond + ((-> this is-naughty-ottsel?) + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this naughty-ottsel-wait)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) + +(defmethod find-and-lure-missiles ((this cty-missile-lure)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> this root trans quad)) + (set! (-> v1-0 w) 327680.0) + ) + (when #f + (let ((v1-3 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((gp-0 (-> v1-3 next0))) + (while (!= v1-3 (-> *collide-player-list* alive-list-end)) + (let ((v1-4 (the-as collide-shape (-> (the-as connection v1-3) param1)))) + (when (logtest? (-> v1-4 root-prim prim-core collide-as) (collide-spec enemy hit-by-others-list)) + (let* ((s5-0 (-> v1-4 process)) + (a0-12 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if (= (-> a0-12 type) cty-hijack-missile) + (send-event a0-12 'lure) + ) + ) + ) + ) + (set! v1-3 gp-0) + *collide-player-list* + (set! gp-0 (-> gp-0 next0)) + ) + ) + ) + ) + (when #t + (when #f + (let ((v1-15 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((gp-1 (-> v1-15 next0))) + (while (!= v1-15 (-> *collide-hit-by-player-list* alive-list-end)) + (let ((v1-16 (the-as collide-shape (-> (the-as connection v1-15) param1)))) + (when (logtest? (-> v1-16 root-prim prim-core collide-as) (collide-spec enemy hit-by-others-list)) + (let* ((s5-1 (-> v1-16 process)) + (a0-24 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + ) + (if (= (-> a0-24 type) cty-hijack-missile) + (send-event a0-24 'lure) + ) + ) + ) + ) + (set! v1-15 gp-1) + *collide-hit-by-player-list* + (set! gp-1 (-> gp-1 next0)) + ) + ) + ) + ) + (when #t + (let ((v1-26 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((gp-2 (-> v1-26 next0))) + (while (!= v1-26 (-> *collide-hit-by-others-list* alive-list-end)) + (let ((v1-27 (the-as collide-shape (-> (the-as connection v1-26) param1)))) + (when (logtest? (-> v1-27 root-prim prim-core collide-as) (collide-spec enemy hit-by-others-list)) + (let* ((s5-2 (-> v1-27 process)) + (a0-36 (if (type? s5-2 process-focusable) + s5-2 + ) + ) + ) + (if (= (-> a0-36 type) cty-hijack-missile) + (send-event a0-36 'lure) + ) + ) + ) + ) + (set! v1-26 gp-2) + *collide-hit-by-others-list* + (set! gp-2 (-> gp-2 next0)) + ) + ) + ) + #f + ) + ) + ) + +(defstate complete (cty-missile-lure) + :virtual #t + :enter (behavior () + (sound-stop (-> self hum-sound)) + (if (not (-> self is-naughty-ottsel?)) + (sound-play "decoy-explode" :position (-> self root trans)) + ) + (sound-stop (-> self raise-sound)) + (kill-callback (-> *minimap* engine) (-> self minimap)) + ) + :code nothing + ) + +(defstate opening (cty-missile-lure) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('missile-hit) + (go-virtual complete) + ) + (('missile-attract) + (set! (-> self lock-open?) #t) + (send-event (ppointer->process (-> self parent)) 'missile-attract) + ) + ) + ) + :enter (behavior () + (sound-play "decoy-activate" :id (-> self raise-sound) :position (-> self root trans)) + ) + :exit (behavior () + (sound-stop (-> self raise-sound)) + ) + :trans (behavior () + (spawn-from-cspace (-> self part) (-> self node-list data 17)) + (spawn-from-cspace (-> self part) (-> self node-list data 18)) + (spawn-from-cspace (-> self part) (-> self node-list data 19)) + (find-and-lure-missiles self) + ) + :code (behavior () + (sound-play "hj-decoy-lights" :id (-> self hum-sound)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 2.0) :frame-num 0.0) + (until (ja-done? 0) + (let ((f0-6 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :w 1.0) + (new 'static 'vector :x 0.5 :w 1.0) + f0-6 + ) + ) + (set! (-> self draw color-emissive w) 0.0) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (go-virtual active) + ) + :post transform-post + ) + +(defstate closing (cty-missile-lure) + :virtual #t + :enter (behavior () + (send-event (ppointer->process (-> self parent)) 'lure-lower) + (sound-stop (-> self hum-sound)) + ) + :trans (behavior () + (spawn-from-cspace (-> self sirens2) (-> self node-list data 17)) + (spawn-from-cspace (-> self sirens2) (-> self node-list data 18)) + (spawn-from-cspace (-> self sirens2) (-> self node-list data 19)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! 0.0 2.0) :frame-num max) + (until (ja-done? 0) + (let ((f0-6 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :w 1.0) + (new 'static 'vector :x 0.5 :w 1.0) + f0-6 + ) + ) + (set! (-> self draw color-emissive w) 0.0) + (ja :num! (seek! 0.0)) + (suspend) + ) + (go-virtual idle) + ) + :post transform-post + ) + +(defstate active (cty-missile-lure) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('missile-hit) + (go-virtual complete) + ) + (('missile-attract) + (send-event (ppointer->process (-> self parent)) 'missile-attract) + (let ((v0-0 (the-as object #t))) + (set! (-> self lock-open?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (sound-play "hj-decoy-lights" :id (-> self hum-sound)) + (let* ((f0-0 0.5) + (f1-1 (+ 0.5 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))) + (f0-1 (* f0-0 (- f1-1 (* (the float (the int (/ f1-1 2.0))) 2.0)))) + ) + 0.0 + (let* ((f0-3 (sin (* 65536.0 f0-1))) + (f0-4 (* 0.125 f0-3)) + ) + (set! (-> self draw color-emissive x) (+ 0.375 f0-4)) + ) + ) + (spawn-from-cspace (-> self part) (-> self node-list data 17)) + (spawn-from-cspace (-> self part) (-> self node-list data 18)) + (spawn-from-cspace (-> self part) (-> self node-list data 19)) + (find-and-lure-missiles self) + (if (and (not (-> self lock-open?)) + (not (-> self is-naughty-ottsel?)) + (time-elapsed? (-> self state-time) (seconds 6)) + (>= (the-as uint 3) + (-> *game-info* sub-task-list (game-task-node city-hijack-vehicle-resolution) death-count) + ) + ) + (go-virtual closing) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post transform-post + ) + +(deftype cty-lure-info (structure) + ((pos vector :inline) + ) + ) + + +(define *cty-hijack-lure-positions* + (new 'static 'boxed-array :type cty-lure-info + (new 'static 'cty-lure-info :pos (new 'static 'vector :x 1963376.6 :y 6144.0 :z 6455214.0 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x 668016.6 :y 6144.0 :z 7583047.5 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x -318054.4 :y 6144.0 :z 7174676.5 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x -174694.4 :y 6144.0 :z 6374564.0 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x 764354.56 :y 6144.0 :z 5801574.5 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x 1914757.1 :y 6144.0 :z 5914255.5 :w 1.0)) + ) + ) + +(define *naughty-ottsel-pos* (new 'static 'vector :x -271073.28 :y 121978.88 :z 5468487.5 :w 1.0)) + +(define *ctyport-hijack-fail* + (new 'static 'resetter-params + :flags (resetter-flag auto-reset text-message) + :fail (new 'static 'resetter-spec :continue "ctyindb-hijack-vehicle" :reset-mode 'life :execute #f) + :retry (new 'static 'resetter-spec :continue #f :reset-mode 'try :execute #f) + :reset-delay (seconds 3) + ) + ) + +(defmethod relocate ((this cty-hijack-manager) (offset int)) + (if (nonzero? (-> this missiles)) + (&+! (-> this missiles) offset) + ) + (call-parent-method this offset) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this cty-hijack-manager)) + (call-parent-method this) + (set! (-> this missile-sound) (new-sound-id)) + (set-setting! 'city-sound '(hijack1) 0.0 2) + (set! (-> this hud-timer) (the-as handle #f)) + (set! (-> this missiles) (new 'process 'boxed-array handle (+ (-> *cty-hijack-lure-positions* length) 1))) + (set! (-> this missiles length) 0) + (set! (-> this current-leader-missile) 0) + (set! (-> this task-arrow) (the-as handle #f)) + (reset-hijack-speech this) + (dotimes (v1-8 (-> this missiles allocated-length)) + (set! (-> this missiles v1-8) (the-as handle #f)) + ) + (none) + ) + +(defstate wait (cty-hijack-manager) + :virtual #t + :code (behavior () + (while (or (not *target*) + (not *spawn-actors*) + (and (task-node-closed? (game-task-node city-hijack-vehicle-escape)) (zero? (-> *target* pilot))) + ) + (suspend) + ) + (set-time-limit self) + (cond + ((task-node-closed? (game-task-node city-hijack-vehicle-escape)) + (if (nonzero? (-> *target* pilot)) + (set! (-> self hpickup) (-> *target* pilot vehicle)) + ) + (adjust-player-ammo 200.0 (pickup-type ammo-yellow)) + (dotimes (gp-0 (-> self missiles allocated-length)) + (spawn-missile self (target-pos 0) (quaternion-identity! (new 'stack-no-clear 'quaternion)) gp-0) + ) + (set! (-> self missiles length) (-> self missiles allocated-length)) + (go-virtual player-riding) + ) + (else + (go-virtual active) + ) + ) + ) + ) + +(defmethod task-manager-method-25 ((this cty-hijack-manager)) + (when (nonzero? (-> this hpickup)) + (send-event (handle->process (-> this hpickup)) 'override-camera #f) + (let ((a0-7 (handle->process (-> this hpickup)))) + (if a0-7 + (deactivate a0-7) + ) + ) + ) + (let ((a0-11 (handle->process (-> this hud-timer)))) + (if a0-11 + (deactivate a0-11) + ) + ) + (call-parent-method this) + (none) + ) + +(define *pre-hijack-kg-squad-member-settings* (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-a) + ) + ) + +(defstate active (cty-hijack-manager) + :virtual #t + :enter (behavior () + (set! (-> self vehicle-is-visible?) #f) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (task-node-close! (game-task-node city-vehicle-training-hover-zone-1) 'event) + (set-setting! 'kg-difficulty #f 1.5 0) + (set-setting! 'exclusive-load '((ignore lctyhijk)) 0.0 0) + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (set! (-> gp-0 position quad) (-> *pickup-start-pos* quad)) + (quaternion-identity! (-> gp-0 rotation)) + (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *pickup-start-angle*) + (set! (-> gp-0 velocity quad) (the-as uint128 0)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (let ((s5-0 (get-process *default-dead-pool* h-kg-pickup #x4000 1))) + (set! (-> self hpickup) + (process->handle + (-> (when s5-0 + (let ((t9-9 (method-of-type h-kg-pickup activate))) + (t9-9 (the-as h-kg-pickup s5-0) *vehicle-manager* "pickup" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 vehicle-init-by-other 11 gp-0) + (-> s5-0 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-1 pos quad) (-> *pickup-start-pos* quad)) + (quaternion-identity! (-> gp-1 quat)) + (set! (-> gp-1 flags) (task-arrow-flags taf8)) + (set! (-> gp-1 map-icon) (the-as uint 12)) + (logior! (-> gp-1 flags) (task-arrow-flags taf3)) + (set! (-> self task-arrow) (process->handle (task-arrow-spawn gp-1 self))) + ) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + (when (not (-> self vehicle-is-visible?)) + (let* ((s5-0 (handle->process (-> self hpickup))) + (gp-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when gp-0 + (when (logtest? (-> gp-0 draw status) (draw-control-status on-screen)) + (when (time-elapsed? (-> self last-check-vehicle-vis-time) (seconds 0.5)) + (set-time! (-> self last-check-vehicle-vis-time)) + (let ((s5-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s5-1 start-pos quad) (-> (target-pos 0) quad)) + (vector-! (-> s5-1 move-dist) (get-trans gp-0 0) (-> s5-1 start-pos)) + (let ((v1-20 s5-1)) + (set! (-> v1-20 radius) 40.96) + (set! (-> v1-20 collide-with) (collide-spec backgnd)) + (set! (-> v1-20 ignore-process0) #f) + (set! (-> v1-20 ignore-process1) #f) + (set! (-> v1-20 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-20 action-mask) (collide-action solid)) + ) + (if (= (fill-and-probe-using-line-sphere *collide-cache* s5-1) -100000000.0) + (set! (-> self vehicle-is-visible?) #t) + ) + ) + ) + ) + ) + ) + ) + (if (or (not (handle->process (-> self hpickup))) + (begin + (let* ((gp-2 #t) + (s5-2 (handle->process (-> self hpickup))) + (v1-34 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-2 process-focusable) + (the-as process-focusable s5-2) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-34 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + (let* ((s5-3 (handle->process (-> self hpickup))) + (gp-3 (if (type? s5-3 process-focusable) + (the-as process-focusable s5-3) + ) + ) + ) + (cond + ((and gp-3 (and (< 184320.0 (vector-vector-xz-distance (target-pos 0) (get-trans gp-3 0))) + (> (get-alert-level1 *kg-squad-control*) 0) + ) + ) + ) + (else + (when (and (logtest? (-> gp-3 draw status) (draw-control-status on-screen)) (-> self vehicle-is-visible?)) + (cty-hijack-manager-method-39 self 0) + (task-node-close! (game-task-node city-hijack-vehicle-infiltrate) 'event) + ) + (set-time! (-> self alert-expire-time)) + ) + ) + ) + (when (and *target* (focus-test? *target* pilot-riding) (let ((gp-4 type?)) + (gp-4 (send-event *target* 'get-vehicle) h-kg-pickup) + ) + ) + (task-node-close! (game-task-node city-hijack-vehicle-infiltrate) 'event) + (go-virtual show-missile-launch) + ) + (let ((t9-18 (-> (find-parent-state) trans))) + (if t9-18 + (t9-18) + ) + ) + ) + ) + +(define *post-hijack-kg-squad-member-settings* (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 7 + :enemy-type (traffic-type guard-a) + ) + ) + +(defstate decoy-stage (cty-hijack-manager) + :virtual #t + :parent (cty-hijack-manager active) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-4 object)) + (case message + (('complete) + (send-event (handle->process (-> self missiles (-> self current-leader-missile))) 'die) + (deactivate (handle->process (-> self missiles (-> self current-leader-missile)))) + (set-blackout-frames (seconds 0.3)) + (send-event (handle->process (-> self hpickup)) 'die) + (task-manager-event-handler proc argc message block) + ) + (('missile-attract) + (cond + ((< (-> self current-leader-missile) 1) + (cty-hijack-manager-method-39 self 13) + ) + (else + (set! v0-4 (+ (current-time) (seconds -2))) + (set! (-> *hijack-speech* 13 play-time) (the-as time-frame v0-4)) + v0-4 + ) + ) + ) + (('lure-hit) + (set! v0-4 (current-time)) + (set! (-> self lure-hit-time) (the-as time-frame v0-4)) + v0-4 + ) + (('lure-lower) + (cty-hijack-manager-method-39 self 12) + ) + (('wrong-way) + (send-event self 'fail) + ) + (('missile-die) + (+! (-> self current-leader-missile) 1) + (send-event (handle->process (-> self missiles (-> self current-leader-missile))) 'set-leader) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-setting! 'disable-guard-chatter? #t 0.0 0) + (set-time! (-> self state-time)) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + (set-alert-level1 *kg-squad-control* 1) + (cty-hijack-manager-method-39 self 9) + (set-setting! 'music 'hijack 0.0 0) + (send-event *target* 'change-mode 'gun #f (pickup-type gun-yellow-1)) + (auto-save-user) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + ((-> (method-of-type task-manager active) trans)) + (let ((v1-6 (handle->process (-> self missiles (-> self current-leader-missile))))) + (if v1-6 + (sound-play + "hj-missile" + :id (-> self missile-sound) + :position (-> (the-as process-focusable v1-6) root trans) + ) + ) + ) + (dotimes (gp-0 (-> self missiles length)) + (send-event (handle->process (-> self missiles gp-0)) 'chase-2) + ) + (if (not (time-elapsed? (-> self state-time) (seconds 0.1))) + (send-event (handle->process (-> self hpickup)) 'boost) + ) + (send-event (handle->process (-> self hpickup)) 'override-camera #t) + (set-setting! 'string-min-length 'abs (meters 18) 0) + (set-setting! 'string-max-length 'abs (meters 19) 0) + (set-setting! 'string-min-height 'abs (meters 6) 0) + (set-setting! 'string-max-height 'abs (meters 6) 0) + (if (time-elapsed? (-> self state-time) (seconds 6)) + (cty-hijack-manager-method-39 self 11) + ) + (when (and (> (-> *hijack-speech* 13 play-time) 0) (time-elapsed? (-> *hijack-speech* 13 play-time) (seconds 3))) + (set! (-> *hijack-speech* 13 play-time) 0) + (cond + ((>= 1 (-> self current-leader-missile)) + (cty-hijack-manager-method-39 self 14) + ) + ((= (-> self current-leader-missile) (+ (-> self missiles length) -1)) + (cty-hijack-manager-method-39 self 19) + ) + (else + (cty-hijack-manager-method-39 self 15) + ) + ) + ) + (when (and (> (-> *hijack-speech* 19 play-time) 0) (time-elapsed? (-> *hijack-speech* 19 play-time) (seconds 3))) + (send-event (handle->process (-> self naughty-ottsel-lure)) 'wake-up) + (cty-hijack-manager-method-39 self 20) + ) + (when (and (and (> (-> *hijack-speech* 14 play-time) 0) (time-elapsed? (-> *hijack-speech* 14 play-time) (seconds 10))) + (and (not (logtest? (-> *hijack-speech* 19 flags) (hijack-speech-info-flag hsi4))) + (and (or (and (> (-> *hijack-speech* 15 play-time) 0) (time-elapsed? (-> *hijack-speech* 15 play-time) (seconds 10))) + (not (logtest? (-> *hijack-speech* 15 flags) (hijack-speech-info-flag hsi4))) + ) + (time-elapsed? (-> self lure-hit-time) (seconds 8)) + ) + ) + ) + (set! (-> *hijack-speech* 14 play-time) 0) + (set! (-> *hijack-speech* 15 play-time) 0) + (cty-hijack-manager-method-39 self 16) + ) + (if (and *target* + (time-elapsed? (-> self state-time) (seconds 5)) + (and (< (vector-length (get-transv *target*)) 221184.0) + (or (and (> (-> *hijack-speech* 17 play-time) 0) (time-elapsed? (-> *hijack-speech* 17 play-time) (seconds 4))) + (not (logtest? (-> *hijack-speech* 17 flags) (hijack-speech-info-flag hsi4))) + ) + ) + ) + (cty-hijack-manager-method-39 self 17) + ) + (let ((v1-141 #x6978)) + (let ((a0-80 (-> *game-info* sub-task-list (game-task-node city-hijack-vehicle-resolution) death-count))) + (when (< (the-as uint 2) a0-80) + (let ((a0-83 (+ v1-141 (* 4500 (the-as int (+ a0-80 -1)))))) + (set! v1-141 (min #x1a5e0 a0-83)) + ) + ) + ) + (set! (-> *game-info* timer) + (the-as time-frame (- (the-as time-frame v1-141) (- (current-time) (-> self state-time)))) + ) + ) + (if (< (-> *game-info* timer) 0) + (send-event (handle->process (-> self missiles (-> self current-leader-missile))) 'explode) + ) + (if (or (not (handle->process (-> self hpickup))) + (begin + (let* ((gp-2 #t) + (s5-0 (handle->process (-> self hpickup))) + (v1-164 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-164 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + ) + ) + +(define *missile-fire-order* (new 'static 'boxed-array :type int32 0 1 2 0 2 0 2)) + +(define *missile-fire-frames* (new 'static 'boxed-array :type float 12.0 14.0 16.0 21.0 23.0 25.0 31.0 31.0)) + +(defstate show-missile-launch (cty-hijack-manager) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-setting! 'allow-look-around #f 0.0 0) + (set-time! (-> self state-time)) + (set-setting! 'entity-name "camera-320" 0.0 0) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code (behavior () + (local-vars (v1-2 object)) + (until v1-2 + (suspend) + (set! v1-2 (and (-> *target* next-state) (= (-> *target* next-state name) 'target-pilot-stance))) + ) + (until (process-grab? *target* #f) + (suspend) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1.5)) + (suspend) + ) + ) + (send-event (handle->process (-> self hpickup)) 'flight-up) + (let ((gp-1 (-> self missiles allocated-length)) + (s5-0 0) + ) + (let ((s4-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-0 from) (process->ppointer self)) + (set! (-> s4-0 num-params) 0) + (set! (-> s4-0 message) 'recoil) + (let ((s3-0 send-event-function) + (v1-22 (entity-by-name "cty-missile-launcher-1")) + ) + (s3-0 + (if v1-22 + (-> v1-22 extra process) + ) + s4-0 + ) + ) + ) + (while (> gp-1 0) + (let* ((v1-25 (entity-by-name "cty-missile-launcher-1")) + (f30-0 (-> (the-as process-focusable (if v1-25 + (the-as process-focusable (-> v1-25 extra process)) + ) + ) + skel + root-channel + 0 + frame-num + ) + ) + (s4-1 s5-0) + (s3-1 (+ (-> *missile-fire-frames* length) -2)) + ) + (while (>= s3-1 s4-1) + (when (< (-> *missile-fire-frames* s4-1) f30-0) + (spawn-missiles-from-launcher self (-> *missile-fire-order* s4-1)) + (+! s5-0 1) + (+! gp-1 -1) + ) + (+! s4-1 1) + ) + ) + (suspend) + ) + ) + (sound-play "hj-missile" :id (-> self missile-sound)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.5)) + (suspend) + ) + ) + (dotimes (gp-3 (-> self missiles length)) + (send-event (handle->process (-> self missiles gp-3)) 'begin-moving) + ) + (suspend) + (dotimes (gp-4 (-> self missiles length)) + (send-event (handle->process (-> self missiles gp-4)) 'begin-moving) + ) + (cty-hijack-manager-method-39 self 1) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 0.2)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 1)) + (suspend) + ) + ) + (until (process-release? *target*) + (suspend) + ) + (go-virtual player-riding) + ) + ) + +;; WARN: Return type mismatch int vs handle. +(defmethod spawn-missile ((this cty-hijack-manager) (arg0 vector) (arg1 quaternion) (arg2 int)) + (let ((s4-0 (new 'stack-no-clear 'cty-hijack-missile-init-params))) + (if (zero? arg2) + (set! (-> s4-0 is-leader?) #t) + (set! (-> s4-0 is-leader?) #f) + ) + (set! (-> s4-0 pos quad) (-> arg0 quad)) + (quaternion-copy! (-> s4-0 quat) arg1) + (set! (-> s4-0 track-obj) (-> this hpickup)) + (let* ((s3-0 (get-process *default-dead-pool* cty-hijack-missile #x4000 1)) + (v0-4 (process->handle + (-> (when s3-0 + (let ((t9-2 (method-of-type cty-hijack-missile activate))) + (t9-2 (the-as cty-hijack-missile s3-0) this "cty-hijack-missile" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 cty-hijack-missile-init-by-other s4-0) + (-> s3-0 ppointer) + ) + 0 + ) + ) + ) + ) + (set! (-> this missiles arg2) (the-as handle v0-4)) + (the-as handle v0-4) + ) + ) + ) + +(defstate player-riding (cty-hijack-manager) + :virtual #t + :parent (cty-hijack-manager active) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('vehicle-bump) + (if (and (time-elapsed? (-> self state-time) (seconds 5)) + (or (and (> (-> *hijack-speech* 17 play-time) 0) (time-elapsed? (-> *hijack-speech* 17 play-time) (seconds 4))) + (not (logtest? (-> *hijack-speech* 17 flags) (hijack-speech-info-flag hsi4))) + ) + ) + (cty-hijack-manager-method-39 self 17) + ) + ) + (('wrong-way) + (send-event self 'fail) + ) + (('stage-2) + (task-node-close! (game-task-node city-hijack-vehicle-escape) 'event) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-setting! 'disable-parking-spots? #t 0.0 0) + (set-setting! 'music 'hijack 0.0 0) + (set-setting! 'stop-boats? #t 0.0 0) + (kill-by-type barge *active-pool*) + (let* ((v1-6 (entity-by-name "boat-manager-1")) + (a0-5 (if v1-6 + (-> v1-6 extra process) + ) + ) + ) + (if a0-5 + (boat-manager-method-16 (the-as boat-manager a0-5)) + ) + ) + (when *target* + (hide-hud 'hud-health) + (hide-hud 'hud-gun) + (set! (-> *target* fact health) (-> *target* fact health-max)) + (set! (-> *game-info* gun-ammo 0) (fmax (-> *game-info* gun-ammo 0) (-> *FACT-bank* ammo-yellow-start))) + ) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (send-event (handle->process (-> self hpickup)) 'set-taskman (process->handle self)) + (guide-arrow-spawn self) + (set-setting! 'exclusive-load '((ignore all) (allow lctyhijk)) 0.0 0) + (let ((gp-0 (new 'stack-no-clear 'cty-missile-lure-init-params))) + (dotimes (s5-0 (-> *cty-hijack-lure-positions* length)) + (let ((a0-21 (-> *cty-hijack-lure-positions* s5-0))) + (set! (-> gp-0 pos quad) (-> a0-21 pos quad)) + ) + (quaternion-identity! (-> gp-0 orient)) + (set! (-> gp-0 is-naughty-ottsel?) #f) + (process-spawn cty-missile-lure gp-0 :name "cty-missile-lure" :to self) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'cty-missile-lure-init-params))) + (set! (-> gp-1 pos quad) (-> *naughty-ottsel-pos* quad)) + (quaternion-identity! (-> gp-1 orient)) + (set! (-> gp-1 is-naughty-ottsel?) #t) + (let ((s5-1 (get-process *default-dead-pool* cty-missile-lure #x4000 1))) + (set! (-> self naughty-ottsel-lure) + (process->handle + (-> (when s5-1 + (let ((t9-18 (method-of-type cty-missile-lure activate))) + (t9-18 (the-as cty-missile-lure s5-1) self "cty-missile-lure" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 cty-missile-lure-init-by-other gp-1) + (-> s5-1 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (send-event (handle->process (-> self task-arrow)) 'leave) + (set-alert-level1 *kg-squad-control* 1) + (let ((v1-66 (-> self hpickup process))) + (set-setting! 'kg-primary-target v1-66 1.0 (-> v1-66 0 pid)) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + (let ((v1-4 (handle->process (-> self missiles (-> self current-leader-missile))))) + (if v1-4 + (sound-play + "hj-missile" + :id (-> self missile-sound) + :position (-> (the-as process-focusable v1-4) root trans) + ) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 3.5)) + (dotimes (gp-0 (-> self missiles length)) + (send-event (handle->process (-> self missiles gp-0)) 'full-chase) + ) + ) + (if (and (> (-> *hijack-speech* 1 play-time) 0) (time-elapsed? (-> *hijack-speech* 1 play-time) (seconds 3))) + (cty-hijack-manager-method-39 self 3) + ) + (if (and (> (-> *hijack-speech* 5 play-time) 0) (time-elapsed? (-> *hijack-speech* 5 play-time) (seconds 7))) + (cty-hijack-manager-method-39 self 6) + ) + (if (and (> (-> *hijack-speech* 6 play-time) 0) (time-elapsed? (-> *hijack-speech* 6 play-time) (seconds 6))) + (cty-hijack-manager-method-39 self 8) + ) + (cty-hijack-manager-method-35 self) + (when (task-node-closed? (game-task-node city-hijack-vehicle-escape)) + (set-setting! 'exclusive-load '((ignore all) (allow lctyhijk)) 0.0 0) + (go-virtual decoy-stage) + ) + (if (or (not (handle->process (-> self hpickup))) + (begin + (let* ((gp-2 #t) + (s5-0 (handle->process (-> self hpickup))) + (v1-69 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-69 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + ) + ) + +(deftype cty-missile-launcher (process-drawable) + () + (:state-methods + idle + recoil + ) + ) + + +(defskelgroup skel-cty-missile-launcher cty-missile-launcher cty-missile-launcher-lod0-jg cty-missile-launcher-idle-ja + ((cty-missile-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + :origin-joint-index 3 + ) + +(defmethod init-from-entity! ((this cty-missile-launcher) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle impenetrable-obj)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 5) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 6) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-18 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cty-missile-launcher" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (let ((a0-28 (-> this skel root-channel 0))) + (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (joint-control-channel-group-eval! + a0-28 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-identity + ) + ) + (go (method-of-object this idle)) + ) + +(defstate recoil (cty-missile-launcher) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! cty-missile-launcher-recoil-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + :post transform-post + ) + +(defstate idle (cty-missile-launcher) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('recoil) + (go-virtual recoil) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! cty-missile-launcher-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post transform-post + ) + +(define *missile-closer-chase-normal* (new 'static 'vector :x -0.9951 :z 0.0976 :w 1.0)) + +(define *missile-closer-chase-pos* (new 'static 'vector :x 4090870.2 :y 32741.785 :z 2592906.5 :w 1.0)) + +;; WARN: Return type mismatch symbol vs none. +(defmethod cty-hijack-manager-method-35 ((this cty-hijack-manager)) + (when (< (vector-vector-xz-distance (target-pos 0) *missile-closer-chase-pos*) 81920.0) + (let ((f0-2 (vector-dot + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) *missile-closer-chase-pos*) + *missile-closer-chase-normal* + ) + ) + ) + (when (< 0.0 f0-2) + (dotimes (s5-3 (-> this missiles length)) + (cty-hijack-manager-method-39 this 5) + (send-event (handle->process (-> this missiles s5-3)) 'get-closer) + ) + ) + ) + ) + (none) + ) + +(defmethod spawn-missiles-from-launcher ((this cty-hijack-manager) (arg0 int)) + (sound-play "missile-launch") + (let* ((v1-1 (entity-by-name "cty-missile-launcher-1")) + (s4-1 (if v1-1 + (-> v1-1 extra process) + ) + ) + ) + (when s4-1 + (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as process-focusable s4-1) node-list data 6))) + (s4-2 (matrix->quaternion + (new 'stack-no-clear 'quaternion) + (-> (the-as process-focusable s4-1) node-list data 6 bone transform) + ) + ) + ) + (vector+float*! s5-1 s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-2) 5120.0) + (cond + ((= arg0 2) + (vector+float*! s5-1 s5-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-2) 6553.6) + ) + ((zero? arg0) + (vector+float*! s5-1 s5-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-2) -6553.6) + ) + ) + (spawn-missile this s5-1 s4-2 (-> this missiles length)) + ) + (+! (-> this missiles length) 1) + ) + ) + (none) + ) + +(deftype guide-arrow-info (structure) + ((pos vector :inline) + (facing vector :inline) + ) + ) + + +(define *guide-arrow-list* (new 'static 'boxed-array :type guide-arrow-info + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 4629187.0 :y 55781.785 :z 2322673.2 :w 1.0) + :facing (new 'static 'vector :x 0.1975 :z 0.9803 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 4619754.5 :y 71141.79 :z 2787199.8 :w 1.0) + :facing (new 'static 'vector :x -0.9725 :z -0.2328 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3561828.0 :y 61127.477 :z 2600695.0 :w 1.0) + :facing (new 'static 'vector :x 0.2231 :z 0.9747 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3558417.5 :y 64115.508 :z 3482799.0 :w 1.0) + :facing (new 'static 'vector :x 0.9886 :z -0.15 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3895419.0 :y 60577.793 :z 3534492.5 :w 1.0) + :facing (new 'static 'vector :x 0.1378 :z 0.9904 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3924504.5 :y 63866.47 :z 4484548.0 :w 1.0) + :facing (new 'static 'vector :x -0.9991 :z -0.0421 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3363461.5 :y 57093.734 :z 4522630.5 :w 1.0) + :facing (new 'static 'vector :x -0.1454 :z 0.9893 :w 1.0) + ) + ) + ) + +(defmethod guide-arrow-spawn ((this cty-hijack-manager)) + (dotimes (s5-0 (-> *guide-arrow-list* length)) + (let ((a0-1 (new 'stack-no-clear 'guide-arrow-init-params))) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> *guide-arrow-list* s5-0 pos quad)) + (let ((a1-5 (new 'stack-no-clear 'vector))) + (set! (-> a1-5 quad) (-> *guide-arrow-list* s5-0 facing quad)) + (set! (-> a0-1 pos quad) (-> v1-0 quad)) + (set! (-> a0-1 facing quad) (-> a1-5 quad)) + ) + ) + (set! (-> a0-1 xz?) #t) + (set! (-> a0-1 twist) 0.0) + (spawn-guide-arrow a0-1 this) + ) + ) + #f + ) diff --git a/goal_src/jak3/levels/city/hijack/guide-arrow.gc b/goal_src/jak3/levels/city/hijack/guide-arrow.gc index ba5a926165..285470ef8f 100644 --- a/goal_src/jak3/levels/city/hijack/guide-arrow.gc +++ b/goal_src/jak3/levels/city/hijack/guide-arrow.gc @@ -7,3 +7,117 @@ ;; DECOMP BEGINS +(defskelgroup skel-guide-arrow ctywide-arrow ctywide-arrow-lod0-jg ctywide-arrow-idle-ja + ((ctywide-arrow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(deftype guide-arrow (process-drawable) + ((bob-dir vector :inline) + (base-pos vector :inline) + (pad uint8 8) + ) + (:state-methods + idle + die + ) + (:methods + (guide-arrow-method-22 (_type_) vector) + ) + ) + + +(deftype guide-arrow-init-params (structure) + ((pos vector :inline) + (facing vector :inline) + (twist float) + (xz? symbol) + ) + ) + + +(defbehavior guide-arrow-init-by-other guide-arrow ((arg0 guide-arrow-init-params)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-guide-arrow" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (cond + ((-> arg0 xz?) + (let ((a1-5 (matrix-u-r-compose + (new 'stack-no-clear 'matrix) + (vector-float*! (new 'stack-no-clear 'vector) (-> arg0 facing) -1.0) + *up-vector* + ) + ) + ) + (matrix->quaternion (-> self root quat) a1-5) + ) + ) + (else + (quaternion-identity! (-> self root quat)) + ) + ) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (-> arg0 twist)) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (process-entity-status! self (entity-perm-status no-kill) #t) + (go-virtual idle) + ) + +(defmethod guide-arrow-method-22 ((this guide-arrow)) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set-vector! (-> this draw color-mult) 1.0 0.0 0.0 1.0) + (logior! (-> this draw status) (draw-control-status force-fade)) + (let ((f0-8 (vector-vector-distance (-> this root trans) (math-camera-pos)))) + 0.0 + (let* ((f1-2 (* 0.0000027126737 f0-8)) + (f1-4 (fmax 0.0 (fmin 1.0 f1-2))) + (f0-11 (- 1.0 (* (- 1.0 f1-4) (- 1.0 f1-4)))) + ) + (set! (-> this draw force-fade) (the-as uint (the int (lerp 0.0 96.0 f0-11)))) + ) + ) + (let* ((f0-14 1.5) + (f1-8 (* 0.0033333334 (the float (- (current-time) (-> this state-time))))) + (f30-0 (/ (- f1-8 (* (the float (the int (/ f1-8 f0-14))) f0-14)) f0-14)) + ) + 0.0 + (let ((s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (f0-19 (* 4096.0 (cos (* 65536.0 f30-0)))) + ) + (vector+float*! (-> this root trans) (-> this base-pos) s5-1 f0-19) + ) + ) + ) + +(defstate idle (guide-arrow) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (deactivate self) + ) + ) + ) + :enter (behavior () + (set! (-> self base-pos quad) (-> self root trans quad)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (guide-arrow-method-22 self) + ) + :code sleep-code + :post ja-post + ) + +(defstate die (guide-arrow) + :virtual #t + :code nothing + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer guide-arrow). +(defun spawn-guide-arrow ((arg0 guide-arrow-init-params) (arg1 process)) + (process-spawn guide-arrow arg0 :name "guide-arrow" :to arg1) + ) diff --git a/goal_src/jak3/levels/city/hijack/kg-vehicles.gc b/goal_src/jak3/levels/city/hijack/kg-vehicles.gc index 50c855ccd7..0f12b40205 100644 --- a/goal_src/jak3/levels/city/hijack/kg-vehicles.gc +++ b/goal_src/jak3/levels/city/hijack/kg-vehicles.gc @@ -5,5 +5,921 @@ ;; name in dgo: kg-vehicles ;; dgos: LCTYHIJK +(declare-type dark-barrel process-focusable) +(define-extern *hijack-suck-curve* curve2d-piecewise) + ;; DECOMP BEGINS +(defskelgroup skel-h-kg-pickup kg-pickup kg-pickup-lod0-jg kg-pickup-idle-ja + ((kg-pickup-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.2) + :shadow kg-pickup-shadow-mg + :origin-joint-index 3 + ) + +(when (or (zero? *hijack-suck-curve*) (!= loading-level global)) + (set! *hijack-suck-curve* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *hijack-suck-curve* 4 'loading-level (the-as int #t)) + ) + +(set! (-> *hijack-suck-curve* pts data 0 first) 0.0) + +(set! (-> *hijack-suck-curve* pts data 0 second) 0.85) + +(set! (-> *hijack-suck-curve* pts data 1 first) 3.0) + +(set! (-> *hijack-suck-curve* pts data 1 second) 0.85) + +(set! (-> *hijack-suck-curve* pts data 2 first) 10.0) + +(set! (-> *hijack-suck-curve* pts data 2 second) 0.7) + +(set! (-> *hijack-suck-curve* pts data 3 first) 15.0) + +(set! (-> *hijack-suck-curve* pts data 3 second) 0.6) + +(defun compute-suck-speed-scalar () + (let ((f30-0 1.0)) + (when (not (task-node-closed? (game-task-node city-hijack-vehicle-escape))) + (let* ((f1-0 (the float (-> *game-info* sub-task-list (game-task-node city-hijack-vehicle-escape) death-count))) + (f0-2 (fmax 0.0 (fmin 15.0 f1-0))) + ) + (set! f30-0 (curve2d-method-9 *hijack-suck-curve* f0-2 2)) + ) + ) + f30-0 + ) + ) + +(define *h-kg-pickup-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 8) (meters 3) (meters 14)) + ) + :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 '*h-kg-pickup-constants* + :flags #x468 + :object-type (traffic-type kg-pickup) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 59) + :inv-max-engine-thrust 0.0000041379767 + :engine-response-rate 20.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 60) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.4 + :air-drag-factor 1.0 + :steering-thruster-factor 2.0 + :steering-thruster-max-gain 2.5 + :steering-thruster-half-gain-speed (meters 1200) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.6 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 3) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 182.04445 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.09 + :engine-pitch-mod-amp 0.01 + :engine-sound-select 5 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-5") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :z -14336.0 :w 1.0) + (new 'static 'vector :x -3072.0 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6963.2 :y -1024.0 :z -7372.8 :w 1.0) + (new 'static 'vector :x -6963.2 :y -1024.0 :z -7372.8 :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 3072.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -3072.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 4915.2 :z 15564.8 :w 1.0) + (new 'static 'vector :x -4915.2 :z 15564.8 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 24.0 + :inv-hit-points 0.041666668 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x2 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x4 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x80 #x8 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x100 #x10 #x0) + :damage-seg-count 2 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 6 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 6 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4505.6 :y -2662.4 :z 15360.0 :w 1.0) + (new 'static 'vector :x -4505.6 :y -2662.4 :z 15360.0 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 7372.8 :y -819.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x 7372.8 :y -819.2 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -7372.8 :y -819.2 :z 4096.0 :w 1.0) + (new 'static 'vector :x -7372.8 :y -819.2 :z -4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3686.4 :y -409.6 :z -14950.4 :w 1.0) + (new 'static 'vector :x 3686.4 :y -409.6 :z -14950.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3837.952 :y -409.6 :z -14950.4 :w 1.0) + (new 'static 'vector :x 6041.6 :y -614.4 :z -9011.2 :w 1.0) + ) + :normal (new 'static 'vector :x 0.707 :z -0.707 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -6041.6 :y -614.4 :z -9011.2 :w 1.0) + (new 'static 'vector :x -3837.952 :y -409.6 :z -14950.4 :w 1.0) + ) + :normal (new 'static 'vector :x -0.707 :z -0.707 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 819.2 :z 8503.296 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 409.6 :y 819.2 :z -10563.584 :w (the-as float #x40000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2252.8 :y 1638.4 :z 11264.0 :w 1.0) + (new 'static 'vector :x -2252.8 :y 1638.4 :z 11264.0 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(deftype pickup-sled-sim (billiard-table) + ((mat matrix :inline) + (external-force vector :inline) + ) + ) + + +(defmethod debug-draw ((this pickup-sled-sim)) + 0 + (none) + ) + +(defmethod reset-accum-force ((this pickup-sled-sim)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this mat uvec quad)) + (set! (-> s5-0 y) 0.0) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> this mat fvec quad)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this mat rvec quad)) + (let ((s2-0 (new 'stack-no-clear 'matrix))) + (set! (-> s4-0 y) 0.0) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector-normalize! s3-0 1.0) + (matrix-fr-compose s2-0 s4-0 s3-0) + (matrix-transpose! s2-0 s2-0) + (set! (-> s5-0 w) 0.0) + (vector-matrix*! s5-0 s5-0 s2-0) + ) + ) + ) + (vector-float*! (-> this accum-force) s5-0 81920.0) + ) + (let ((a2-2 (matrix-transpose! (new 'stack-no-clear 'matrix) (-> this mat))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! s5-1 (-> this external-force) a2-2) + (vector+float*! (-> this accum-force) (-> this accum-force) s5-1 0.3) + ) + 0 + (none) + ) + +(deftype h-kg-pickup (h-car-base) + ((fin-fr joint-mod-rotate-local :inline) + (fin-fl joint-mod-rotate-local :inline) + (fin-r joint-mod-rotate-local :inline) + (fin-l joint-mod-rotate-local :inline) + (rudder-l joint-mod-rotate-local :inline) + (rudder-r joint-mod-rotate-local :inline) + (turn-rate float) + (target-turn-rate float) + (camera-override? symbol) + (initial-creation-time time-frame) + (auto-boost? symbol) + (steering-val float) + (sled pickup-sled-sim) + (barrels handle-array) + (taskman handle) + (last-jitter-time time-frame) + (last-slide-time time-frame) + ) + ) + + +;; WARN: Return type mismatch symbol vs object. +(defmethod rigid-body-object-method-30 ((this h-kg-pickup)) + (let ((t9-0 (method-of-type hvehicle rigid-body-object-method-30))) + (t9-0 this) + ) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (dotimes (s5-0 (-> this sled billiards length)) + (let ((f30-0 (vector-vector-xz-distance + (the-as vector (-> this sled billiards data s5-0)) + (the-as vector (+ (the-as uint (-> this sled billiards data 0 prev-pos)) (* 48 s5-0))) + ) + ) + ) + (when (and (< 204.8 f30-0) (time-elapsed? (-> this last-slide-time) (seconds 0.25))) + (set-time! (-> this last-slide-time)) + (sound-play "hj-cans-slide") + ) + (when (logtest? (-> this sled billiards data s5-0 flags) (billiard-ball-flag bb0 bb1)) + (let* ((f1-0 (* 0.0022194602 f30-0)) + (f30-1 (fmax 0.0 (fmin 1.0 f1-0))) + ) + (set-time! (-> this last-jitter-time)) + (sound-play-by-name + (static-sound-name "hj-cans-bump") + (new-sound-id) + (the int (* 1024.0 f30-1)) + 0 + 0 + (sound-group) + #t + ) + ) + ) + ) + ) + (set! (-> this sled drag) 0.05) + (set! (-> this sled bounce-wall-friction) 0.3) + (set! (-> this sled ball-friction) 0.05) + (let* ((v1-45 (-> this sled mat)) + (a3-2 (-> this rbody matrix)) + (a0-13 (-> a3-2 rvec quad)) + (a1-5 (-> a3-2 uvec quad)) + (a2-2 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> v1-45 rvec quad) a0-13) + (set! (-> v1-45 uvec quad) a1-5) + (set! (-> v1-45 fvec quad) a2-2) + (set! (-> v1-45 trans quad) a3-3) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (get-linear-accel! this s5-1) + (let ((f0-10 (vector-normalize-ret-len! s5-1 1.0))) + (vector-float*! (-> this sled external-force) s5-1 (* -1.0 f0-10)) + (if (< 40960.0 f0-10) + (vector-z-quaternion! s5-1 (-> this root quat)) + ) + ) + ) + (billiard-table-method-10 (-> this sled)) + (dotimes (s5-2 (-> this barrels length)) + (let* ((s3-2 (handle->process (-> this barrels data0 s5-2))) + (s4-2 (if (type? s3-2 process-focusable) + (the-as dark-barrel s3-2) + ) + ) + ) + (quaternion-copy! (-> s4-2 root quat) (-> this root quat)) + (-> this sled billiards data s5-2) + (let ((s3-3 (new 'stack-no-clear 'vector))) + (vector-matrix*! s3-3 (the-as vector (-> this sled billiards data s5-2)) (-> this sled mat)) + (set! (-> s4-2 root trans quad) (-> s3-3 quad)) + ) + ) + ) + #f + ) + +(defskelgroup skel-dark-barrel eco-canister eco-canister-dark-lod0-jg eco-canister-dark-idle-ja + ((eco-canister-dark-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.3) + ) + +(deftype dark-barrel (process-focusable) + () + (:state-methods + idle + ) + ) + + +(defbehavior dark-barrel-init-by-other dark-barrel () + (set! (-> self level) (level-get *level* 'ctywide)) + (let ((gp-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (set! (-> gp-0 penetrate-using) (penetrate)) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 2048.0) + (set! (-> gp-0 total-prims) (the-as uint 1)) + (set! (-> gp-0 root-prim) v1-4) + ) + (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) + (let ((v1-7 (-> gp-0 root-prim))) + (set! (-> gp-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> gp-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> self root) gp-0) + ) + (set-vector! (-> self root scale) 2.0 2.0 2.0 1.0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-barrel" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> self focus-status) (focus-status pilot-riding)) + (go-virtual idle) + ) + +(defstate idle (dark-barrel) + :virtual #t + :code transform-and-sleep-code + :post ja-post + ) + +(defmethod relocate ((this h-kg-pickup) (offset int)) + (if (nonzero? (-> this sled)) + (&+! (-> this sled) offset) + ) + (if (nonzero? (-> this barrels)) + (&+! (-> this barrels) offset) + ) + (call-parent-method this offset) + ) + +(defmethod init-rbody-control! ((this h-kg-pickup)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-kg-pickup" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-kg-pickup-constants*) + (set! (-> this taskman) (the-as handle #f)) + (init (-> this fin-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this fin-l) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-r) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this rudder-l) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this rudder-r) this (the-as uint 8) (joint-mod-base-flags attached)) + (set! (-> this target-turn-rate) 0.0) + (set! (-> this turn-rate) 0.0) + (set! (-> this camera-override?) #f) + (vector-float*! + (-> this rbody lin-momentum) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + 1843200.0 + ) + (set-time! (-> this initial-creation-time)) + (set! (-> this auto-boost?) #f) + (set! (-> this sled) (new 'process 'pickup-sled-sim)) + (init! + (-> this sled) + 5 + (new 'static 'vector :x -4096.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x 4096.0 :z 2048.0 :w 1.0) + ) + (set! (-> this barrels) (the-as handle-array (new 'process 'boxed-array handle 5))) + (dotimes (s5-3 5) + (set! (-> this barrels data0 s5-3) + (ppointer->handle (process-spawn dark-barrel :name "dark-barrel" :to this)) + ) + ) + (set! (-> this barrels length) (-> this barrels allocated-length)) + (dotimes (v1-35 5) + (set! (-> this sled billiards data v1-35 size) 1638.4) + ) + (billiard-table-method-13 (-> this sled)) + 0 + (none) + ) + +(defmethod init-collision! ((this h-kg-pickup)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 3686.4 0.0 12288.0 4096.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -3686.4 0.0 12288.0 4096.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 819.2 5734.4 4915.2) + (set! (-> v1-15 nav-radius) 14336.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 144)))) + (set! (-> v1-17 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 2048.0 -4096.0 5734.4) + (set! (-> v1-17 nav-radius) 14336.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 4915.2 0.0 -11468.8 4096.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) -4915.2 0.0 -11468.8 4096.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch quaternion vs none. +(defmethod vehicle-method-79 ((this h-kg-pickup)) + (let ((f30-0 (* 3640.889 (-> this controls steering)))) + (* 9102.223 (-> this controls steering)) + (let* ((f0-4 (* -3640.889 (-> this controls lean-z))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + (f28-0 (* -1.0 f0-4)) + ) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-l rotation) s5-0 f28-0) + ) + (quaternion-vector-angle! (-> this rudder-l rotation) *up-vector* (- f30-0)) + (quaternion-vector-angle! (-> this rudder-r rotation) *up-vector* (- f30-0)) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun spawn-pickup () + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 position quad) (-> (target-pos 0) quad)) + (quaternion-identity! (-> gp-0 rotation)) + (set! (-> gp-0 velocity quad) (the-as uint128 0)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (process-spawn h-kg-pickup :init vehicle-init-by-other 11 gp-0 :name "torpedo") + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 31 h-kg-pickup) has a return type of none, but the expression builder found a return statement. +(defmethod apply-gravity! ((this h-kg-pickup) (arg0 float)) + (when (and (-> this next-state) (= (-> this next-state name) 'waiting)) + ((method-of-type hvehicle apply-gravity!) this arg0) + (return 0) + ) + (if (-> this auto-boost?) + (vector-float*! + (-> this rbody lin-momentum) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + 1843200.0 + ) + ) + (if (time-elapsed? (-> this initial-creation-time) (seconds 0.2)) + (set! (-> this auto-boost?) #f) + ) + (when #f + (set! (-> this info handling steering-thruster-factor) 2.0) + (call-parent-method this arg0) + (return 0) + ) + (set! (-> this info handling steering-thruster-factor) 0.0) + (let* ((f1-0 (fabs (-> this controls steering))) + (f0-5 (- 1.0 (* (- 1.0 f1-0) (- 1.0 f1-0)))) + ) + (if (< (-> this controls steering) 0.0) + (set! f0-5 (* -1.0 f0-5)) + ) + (set! (-> this steering-val) f0-5) + ) + (set! (-> this target-turn-rate) (* 21845.334 (-> this steering-val))) + (let ((f0-9 (* 2.0 arg0))) + (if (< (fabs (-> this target-turn-rate)) (fabs (-> this turn-rate))) + (set! f0-9 (* 4.0 f0-9)) + ) + (let ((f0-11 (fmax 0.0 (fmin 1.0 f0-9)))) + (set! (-> this turn-rate) (lerp (-> this turn-rate) (-> this target-turn-rate) f0-11)) + ) + ) + (quaternion-rotate-y! + (the-as quaternion (-> this rbody rot)) + (the-as quaternion (-> this rbody rot)) + (* arg0 (-> this turn-rate)) + ) + (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (the-as quaternion (-> this rbody rot)))) + (s4-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-2 quad) (-> this rbody lin-momentum quad)) + 0.0 + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s4-2 y) 0.0) + (let ((f30-0 (vector-normalize-ret-len! s4-2 1.0))) + 0.0 + (let ((f0-20 (vector-dot s4-2 s3-0))) + (cond + (#f + (set! (-> s4-2 quad) (-> s3-0 quad)) + ) + (else + (let ((s2-1 (vector-cross! (new 'stack-no-clear 'vector) s4-2 s3-0)) + (f28-0 (acos f0-20)) + ) + (vector-normalize! s2-1 1.0) + (let ((f0-23 (fmin f28-0 (* 16384.0 arg0)))) + (vector-rotate-around-axis! s4-2 (the-as quaternion s4-2) f0-23 s2-1) + ) + ) + ) + ) + ) + (if (not (-> this auto-boost?)) + (set! f30-0 (fmin f30-0 (* 1843200.0 (compute-suck-speed-scalar)))) + ) + (vector-normalize! s4-2 f30-0) + ) + (set! (-> this rbody lin-momentum x) (-> s4-2 x)) + (set! (-> this rbody lin-momentum z) (-> s4-2 z)) + ) + (call-parent-method this arg0) + (none) + ) + +(defmethod vehicle-method-94 ((this h-kg-pickup)) + (call-parent-method this) + (when (-> this camera-override?) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (remove-setting! 'string-min-height) + (remove-setting! 'string-max-height) + ) + 0 + (none) + ) + +(defmethod rbody-event-handler ((this h-kg-pickup) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('set-taskman) + (let ((v0-0 (the-as object (-> arg3 param 0)))) + (set! (-> this taskman) (the-as handle v0-0)) + v0-0 + ) + ) + (('impact-impulse) + (send-event (handle->process (-> this taskman)) 'vehicle-bump) + (call-parent-method this arg0 arg1 arg2 arg3) + ) + (('override-camera) + (set! (-> this camera-override?) (the-as symbol (-> arg3 param 0))) + #t + ) + (('die) + (deactivate this) + ) + (('flight-up) + (hvehicle-method-154 this) + ) + (('boost) + (set-time! (-> this initial-creation-time)) + (set! (-> this auto-boost?) #t) + (hvehicle-method-154 this) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod vehicle-method-88 ((this h-kg-pickup) (arg0 vehicle-controls)) + (call-parent-method this arg0) + (set! (-> arg0 throttle) (- 1.0 (* (- 1.0 (-> arg0 throttle)) (- 1.0 (-> arg0 throttle))))) + 0 + (none) + ) + +(defmethod attack-handler ((this h-kg-pickup) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + (local-vars (v0-0 symbol)) + (cond + ((logtest? (penetrate jak-dark-nuke) arg3) + (return #f) + v0-0 + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) diff --git a/goal_src/jak3/levels/city/industrial/ctyinda-obs.gc b/goal_src/jak3/levels/city/industrial/ctyinda-obs.gc index fceef69b1e..fdd350c54c 100644 --- a/goal_src/jak3/levels/city/industrial/ctyinda-obs.gc +++ b/goal_src/jak3/levels/city/industrial/ctyinda-obs.gc @@ -7,3 +7,130 @@ ;; DECOMP BEGINS +(deftype ctyinda-vingate (elec-gate) + () + ) + + +(define *vingate-elec-gate-params* (new 'static 'elec-gate-params + :bolt-spec (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8601.6 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + :ring-spec #f + :ring-radius-min 1638.4 + :ring-radius-max 2867.2 + :speed-mult 1.0 + :min-dist 163840.0 + :max-dist 491520.0 + :plane-expand-xz 8192.0 + :plane-expand-y 81920.0 + ) + ) + +(defmethod get-params ((this ctyinda-vingate)) + *vingate-elec-gate-params* + ) + +(defmethod elec-gate-method-26 ((this ctyinda-vingate)) + (call-parent-method this) + (set! (-> this quality-enabled?) #f) + 0 + (none) + ) + +(defmethod init-from-entity! ((this ctyinda-vingate) (arg0 entity-actor)) + (when (task-node-closed? (game-task-node sewer-hum-kg-resolution)) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + ) + (call-parent-method this arg0) + ) + +(deftype industrial-board-vent (bouncer) + () + ) + + +(defmethod init-collision! ((this industrial-board-vent)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action)) + (set-vector! (-> v1-2 local-sphere) 0.0 4096.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-skel! ((this industrial-board-vent)) + 0 + (none) + ) + +(deftype ctyinda-evil-streetlamp (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defskelgroup skel-ctyinda-evil-streetlamp ctyinda-evil-streetlamp ctyinda-evil-streetlamp-lod0-jg ctyinda-evil-streetlamp-idle-ja + ((ctyinda-evil-streetlamp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 8 15) + ) + +(defstate idle (ctyinda-evil-streetlamp) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this ctyinda-evil-streetlamp) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ctyinda-evil-streetlamp" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> this root pause-adjust-distance) 327680.0) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/city/industrial/ctyinda-part.gc b/goal_src/jak3/levels/city/industrial/ctyinda-part.gc index 79eaa4769f..6c8d54e854 100644 --- a/goal_src/jak3/levels/city/industrial/ctyinda-part.gc +++ b/goal_src/jak3/levels/city/industrial/ctyinda-part.gc @@ -7,3 +7,1059 @@ ;; DECOMP BEGINS +(defpartgroup group-ctyinda-tri-red-light + :id 1078 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3889 :fade-after (meters 80) :flags (sp6)) + (sp-item 3890 :fade-after (meters 80) :flags (sp6)) + (sp-item 3891 :fade-after (meters 80) :flags (sp6)) + ) + ) + +(defpart 3889 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 3.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 3890 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 120.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 3891 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpartgroup group-ctyinda-tri-yellow-light + :id 1079 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3892 :fade-after (meters 80) :flags (sp6)) (sp-item 3893 :fade-after (meters 80) :flags (sp6))) + ) + +(defpart 3892 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 100.0) + (:a 100.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 3893 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 24.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpartgroup group-ctyinda-red-lights + :id 1080 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3894 :fade-after (meters 80) :flags (sp6)) (sp-item 3895 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3894 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 24.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 3895 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpartgroup group-ctyinda-blue-lights + :id 1081 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3896 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3897 :fade-after (meters 120) :flags (sp6 sp7)) + ) + ) + +(defpart 3896 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.3)) + (:y (meters 0.2)) + (:scale-x (meters 1.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 1.4) (meters 0.1)) + (:r 0.0) + (:g 192.0 64.0) + (:b 255.0) + (:a 12.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3897 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.3)) + (:y (meters 0.2)) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 5) (meters 0.1)) + (:r 0.0) + (:g 192.0 32.0) + (:b 255.0) + (:a 12.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyinda-wide-glows-yellow + :id 1082 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3898 :fade-after (meters 80) :flags (sp6)) (sp-item 3899 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3898 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 12) (meters 0.1)) + (:r 255.0) + (:g 192.0 64.0) + (:b 0.0) + (:a 10.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 15155.2) + ) + ) + +(defpart 3899 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 20) (meters 0.1)) + (:r 255.0) + (:g 192.0 32.0) + (:b 0.0) + (:a 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 15155.2) + ) + ) + +(defpartgroup group-ctyinda-sign-fashion-8x4 + :id 1083 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3900 :flags (is-3d sp3 sp7)) + (sp-item 3901 :flags (is-3d sp3 sp7)) + (sp-item 3902 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3902 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 48) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3900 + :init-specs ((:texture (sign-fashion2 ctyinda-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100000 -2139062144 0 1 0 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3901 + :init-specs ((:texture (sign-fashion2 ctyinda-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100000 -2139062144 0 1 0 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyinda-sign-praxis-banner-4x8 + :id 1084 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3903 :flags (is-3d sp3 sp7)) + (sp-item 3904 :flags (is-3d sp3 sp7)) + (sp-item 3905 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3905 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 48) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 3903 + :init-specs ((:texture (sign-praxis-banner ctyinda-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100200 -2139062144 0 1 #xb100200 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3904 + :init-specs ((:texture (sign-praxis-banner ctyinda-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100200 -2139062144 0 1 #xb100200 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyinda-sign-onin-knows-4x4 + :id 1085 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3906 :flags (is-3d sp3 sp7)) + (sp-item 3907 :flags (is-3d sp3 sp7)) + (sp-item 3908 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3908 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 3906 + :init-specs ((:texture (sign-onin-knows ctyinda-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100100 -2139062144 0 1 #xb100100 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3907 + :init-specs ((:texture (sign-onin-knows ctyinda-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100100 -2139062144 0 1 #xb100100 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyinda-chimney + :id 1086 + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 3909 :fade-after (meters 600) :falloff-to (meters 700)) + (sp-item 3910 :fade-after (meters 300) :flags (sp6)) + ) + ) + +(defpart 3910 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 20263.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpart 3909 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3911) + ) + ) + +(defpart 3911 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3912)) + ) + +(defpart 3912 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3913) + ) + ) + +(defpart 3913 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3914) + ) + ) + +(defpart 3914 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +(defpartgroup group-ctyinda-chimney-smoke + :id 1087 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3915 :fade-after (meters 600) :falloff-to (meters 700))) + ) + +(defpart 3915 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3916) + ) + ) + +(defpart 3916 + :init-specs ((:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3917) + ) + ) + +(defpart 3917 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-ctyinda-chimney-small + :id 1088 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3918 :fade-after (meters 300) :falloff-to (meters 350))) + ) + +(defpart 3918 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.0002)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3919) + ) + ) + +(defpart 3919 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3920) + ) + ) + +(defpart 3920 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-ctyinda-red-big-lights-1 + :id 1089 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +(defpartgroup group-ctyinda-red-big-lights-2 + :id 1090 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200) + ) + ) + +(defpartgroup group-ctyinda-red-big-lights-3 + :id 1091 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400) + ) + ) + +(defpartgroup group-ctyinda-red-big-lights-4 + :id 1092 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600) + ) + ) + +(defpartgroup group-ctyinda-red-big-lights-5 + :id 1093 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800) + ) + ) + +(defpartgroup group-ctyinda-red-big-lights-6 + :id 1094 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000) + ) + ) + +(defpart 3921 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 27015.748)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3922) + ) + ) + +(defpart 3922 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 3923) + ) + ) + +(defpart 3923 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 3924) + ) + ) + +(defpart 3924 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +(defpartgroup group-ctyinda-smokestack + :id 1095 + :bounds (static-bspherem 0 8 0 16) + :parts ((sp-item 3925 :fade-after (meters 400) :falloff-to (meters 400))) + ) + +(defpart 3925 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1) + (:y (meters 0)) + (:scale-x (meters 20) (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 192.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.04) (meters 0.026666667)) + (:rotvel-z (degrees -0.05) (degrees 0.1)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.026666667 0.026666667) + (:accel-y (meters 0) (meters -0.0001)) + (:friction 0.995) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1) (seconds -0.005)) + (:next-launcher 3926) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3926 + :init-specs ((:fade-a -0.013333334 -0.013333334)) + ) + +(defpartgroup group-ctyinda-squarevent + :id 1096 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3927 :fade-after (meters 200) :falloff-to (meters 250) :flags (sp7))) + ) + +(defpart 3927 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -0.5) (meters 1)) + (:y (meters -0.5) (meters 2)) + (:z (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.033333335) (meters -0.006666667)) + (:vel-z (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.013333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.7) + (:fade-g 1.28) + (:fade-a 0.48) + (:accel-y (meters 0.00083333335) (meters 0.00083333335)) + (:friction 0.95 0.025) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3928) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3928 + :init-specs ((:fade-a -0.12 -0.16)) + ) + +(defpartgroup group-ctyinda-bulb-red-glow + :id 1097 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3929 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3929 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 4.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyinda-bulb-red-glow-pulse + :id 1098 + :flags (sp0) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3930 :fade-after (meters 120) :flags (sp6) :period (seconds 2) :length (seconds 0.017))) + ) + +(defpart 3930 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 1.0) + (:omega (degrees 2715.75)) + (:fade-a 0.13) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:next-time (seconds 1)) + (:next-launcher 3931) + ) + ) + +(defpart 3931 + :init-specs ((:fade-a -0.13333334)) + ) + +(defpartgroup group-ctyinda-glowlite-yellow-glow + :id 1099 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3932 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3932 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyinda-fast-steam + :id 1100 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3933 :flags (sp7))) + ) + +(define *ctyinda-steam-particle-list* (new 'static 'boxed-array :type int32 #x405c00 #x400000)) + +(defun birth-func-texture-group-steam-ctyinda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (particle-adgif-callback + (-> arg1 adgif) + (the-as + texture-id + (-> *ctyinda-steam-particle-list* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *ctyinda-steam-particle-list* length)) + ) + ) + ) + 0 + (none) + ) + +(defpart 3933 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group-steam-ctyinda) + (:num 2.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0.1575)) + (:vel-z (meters 0.2) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16) + (:friction 0.92) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335)) + (:next-launcher 3934) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3934 + :init-specs ((:fade-a -0.32)) + ) + +(defpartgroup group-ctyinda-rising-steam + :id 1101 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3935 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +(defpart 3935 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -1) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters -0.006666667) (meters -0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3936) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3936 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +(defpartgroup group-ctyinda-steam-drift + :id 1102 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3937 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +(defpart 3937 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -1) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3938) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3938 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +(defpartgroup group-ctyinda-red-floor-vent + :id 1103 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3939 :fade-after (meters 200) :flags (sp6)) + (sp-item 3940 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +(defpart 3939 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 12)) + (:rot-x (degrees 67.5)) + (:scale-y (meters 24)) + (:r 255.0) + (:g 64.0 16.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 3940 + :init-specs ((:num 0.5) + (:x (meters 1) (meters 2.5)) + (:rot-x 7) + (:r 4096.0) + (:g 3072.0) + (:b 2867.2) + (:vel-y (meters 0.016666668) (meters 0.006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3941) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3941 + :init-specs ((:fade-b 1.3653333)) + ) diff --git a/goal_src/jak3/levels/city/industrial/ctyindb-obs.gc b/goal_src/jak3/levels/city/industrial/ctyindb-obs.gc index 001c76bbcd..41c8b3f3bd 100644 --- a/goal_src/jak3/levels/city/industrial/ctyindb-obs.gc +++ b/goal_src/jak3/levels/city/industrial/ctyindb-obs.gc @@ -7,3 +7,33 @@ ;; DECOMP BEGINS +(deftype industrialb-board-vent (bouncer) + () + ) + + +(defmethod init-collision! ((this industrialb-board-vent)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action)) + (set-vector! (-> v1-2 local-sphere) 0.0 4096.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-skel! ((this industrialb-board-vent)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/industrial/ctyindb-part.gc b/goal_src/jak3/levels/city/industrial/ctyindb-part.gc index ad5c48fbe8..1bb8b5017a 100644 --- a/goal_src/jak3/levels/city/industrial/ctyindb-part.gc +++ b/goal_src/jak3/levels/city/industrial/ctyindb-part.gc @@ -7,3 +7,1176 @@ ;; DECOMP BEGINS +(defpartgroup group-ctyindb-red-floor-vent + :id 1104 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3942 :fade-after (meters 200) :flags (sp6)) + (sp-item 3943 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +(defpart 3942 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 12)) + (:rot-x (degrees 67.5)) + (:scale-y (meters 24)) + (:r 0.0) + (:g 128.0 16.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 3943 + :init-specs ((:num 0.5) + (:x (meters 1) (meters 2.5)) + (:rot-x 7) + (:r 4096.0) + (:g 3072.0) + (:b 2867.2) + (:vel-y (meters 0.016666668) (meters 0.006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3944) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3944 + :init-specs ((:fade-b 1.3653333)) + ) + +(defpartgroup group-ctyindb-red-lights + :id 1105 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3945 :fade-after (meters 80) :flags (sp6)) (sp-item 3946 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3945 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 24.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 3946 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpartgroup group-ctyindb-tri-red-light + :id 1106 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3947 :fade-after (meters 80) :flags (sp6)) (sp-item 3948 :fade-after (meters 80) :flags (sp6))) + ) + +(defpart 3947 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 120.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 3948 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpartgroup group-ctyindb-tri-yellow-light + :id 1107 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3949 :fade-after (meters 80) :flags (sp6)) (sp-item 3950 :fade-after (meters 80) :flags (sp6))) + ) + +(defpart 3949 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 100.0) + (:a 100.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 3950 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 24.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpartgroup group-ctyindb-blue-lights + :id 1108 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3951 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3952 :fade-after (meters 120) :flags (sp6 sp7)) + ) + ) + +(defpart 3951 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.3)) + (:y (meters 0.2)) + (:scale-x (meters 1.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 1.4) (meters 0.1)) + (:r 0.0) + (:g 192.0 64.0) + (:b 255.0) + (:a 12.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3952 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.3)) + (:y (meters 0.2)) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 5) (meters 0.1)) + (:r 0.0) + (:g 192.0 32.0) + (:b 255.0) + (:a 12.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyindb-wide-glows-yellow + :id 1109 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3953 :fade-after (meters 80) :flags (sp6)) (sp-item 3954 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3953 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 12) (meters 0.1)) + (:r 255.0) + (:g 192.0 64.0) + (:b 0.0) + (:a 10.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 15155.2) + ) + ) + +(defpart 3954 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 20) (meters 0.1)) + (:r 255.0) + (:g 192.0 32.0) + (:b 0.0) + (:a 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 15155.2) + ) + ) + +(defpartgroup group-ctyindb-sign-fashion-8x4 + :id 1110 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3955 :flags (is-3d sp3 sp7)) + (sp-item 3956 :flags (is-3d sp3 sp7)) + (sp-item 3957 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3957 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 48) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3955 + :init-specs ((:texture (sign-fashion2 ctyindb-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800100 -2139062144 0 1 0 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3956 + :init-specs ((:texture (sign-fashion2 ctyindb-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800100 -2139062144 0 1 0 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyindb-sign-praxis-banner-4x8 + :id 1111 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3958 :flags (is-3d sp3 sp7)) + (sp-item 3959 :flags (is-3d sp3 sp7)) + (sp-item 3960 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3960 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 48) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 3958 + :init-specs ((:texture (sign-praxis-banner ctyindb-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800300 -2139062144 0 1 #xb800300 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3959 + :init-specs ((:texture (sign-praxis-banner ctyindb-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800300 -2139062144 0 1 #xb800300 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyindb-sign-onin-knows-4x4 + :id 1112 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3961 :flags (is-3d sp3 sp7)) + (sp-item 3962 :flags (is-3d sp3 sp7)) + (sp-item 3963 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3963 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 3961 + :init-specs ((:texture (sign-onin-knows ctyindb-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800200 -2139062144 0 1 #xb800200 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3962 + :init-specs ((:texture (sign-onin-knows ctyindb-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800200 -2139062144 0 1 #xb800200 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyindb-chimney + :id 1113 + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 3964 :fade-after (meters 600) :falloff-to (meters 700)) + (sp-item 3965 :fade-after (meters 300) :flags (sp6)) + ) + ) + +(defpart 3965 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 20263.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpart 3964 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3966) + ) + ) + +(defpart 3966 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3967)) + ) + +(defpart 3967 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3968) + ) + ) + +(defpart 3968 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3969) + ) + ) + +(defpart 3969 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +(defpartgroup group-ctyindb-chimney-smoke + :id 1114 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3970 :fade-after (meters 600) :falloff-to (meters 700))) + ) + +(defpart 3970 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3971) + ) + ) + +(defpart 3971 + :init-specs ((:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3972) + ) + ) + +(defpart 3972 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-ctyindb-chimney-small + :id 1115 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3973 :fade-after (meters 300) :falloff-to (meters 350))) + ) + +(defpart 3973 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.0002)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3974) + ) + ) + +(defpart 3974 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3975) + ) + ) + +(defpart 3975 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-ctyindb-red-big-lights-1 + :id 1116 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +(defpartgroup group-ctyindb-red-big-lights-2 + :id 1117 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200) + ) + ) + +(defpartgroup group-ctyindb-red-big-lights-3 + :id 1118 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400) + ) + ) + +(defpartgroup group-ctyindb-red-big-lights-4 + :id 1119 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600) + ) + ) + +(defpartgroup group-ctyindb-red-big-lights-5 + :id 1120 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800) + ) + ) + +(defpartgroup group-ctyindb-red-big-lights-6 + :id 1121 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000) + ) + ) + +(defpart 3976 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 27015.748)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3977) + ) + ) + +(defpart 3977 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 3978) + ) + ) + +(defpart 3978 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 3979) + ) + ) + +(defpart 3979 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +(defpartgroup group-ctyindb-smokestack + :id 1122 + :bounds (static-bspherem 0 8 0 16) + :parts ((sp-item 3980 :fade-after (meters 400) :falloff-to (meters 400))) + ) + +(defpart 3980 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1) + (:y (meters 0)) + (:scale-x (meters 20) (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 192.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.04) (meters 0.026666667)) + (:rotvel-z (degrees -0.05) (degrees 0.1)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.026666667 0.026666667) + (:accel-y (meters 0) (meters -0.0001)) + (:friction 0.995) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1) (seconds -0.005)) + (:next-launcher 3981) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3981 + :init-specs ((:fade-a -0.013333334 -0.013333334)) + ) + +(defpartgroup group-ctyindb-squarevent + :id 1123 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3982 :fade-after (meters 200) :falloff-to (meters 250) :flags (sp7))) + ) + +(defpart 3982 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -0.5) (meters 1)) + (:y (meters -0.5) (meters 2)) + (:z (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.033333335) (meters -0.006666667)) + (:vel-z (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.013333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.7) + (:fade-g 1.28) + (:fade-a 0.48) + (:accel-y (meters 0.00083333335) (meters 0.00083333335)) + (:friction 0.95 0.025) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3983) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3983 + :init-specs ((:fade-a -0.12 -0.16)) + ) + +(defpartgroup group-ctyind-rubble-crater-smoke + :id 1124 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3984 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 3984 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 1)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.005925926)) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.000033333334) (meters 0.00006666667)) + (:accel-y (meters 0.00033333333) (meters 0.000033333334)) + (:accel-z (meters -0.000033333334) (meters 0.00006666667)) + (:friction 0.94) + (:timer (seconds 10.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3985) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3985 + :init-specs ((:fade-a -0.024615385 -0.024615385)) + ) + +(defpartgroup group-ctyindb-rubble-smoke + :id 1125 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3986 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 3986 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3987) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3987 + :init-specs ((:fade-a -0.11636364)) + ) + +(defpartgroup group-ctyindb-glowlite-yellow-glow-b + :id 1126 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3988 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3988 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyindb-bulb-red-glow-b + :id 1127 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3989 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3989 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyindb-bulb-yellow-glow-b + :id 1128 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3990 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3990 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyindb-bulb-red-glow-pulse + :id 1129 + :flags (sp0) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3991 :fade-after (meters 120) :flags (sp6) :period (seconds 2) :length (seconds 0.017))) + ) + +(defpart 3991 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 1.0) + (:omega (degrees 2715.75)) + (:fade-a 0.13) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:next-time (seconds 1)) + (:next-launcher 3992) + ) + ) + +(defpart 3992 + :init-specs ((:fade-a -0.13333334)) + ) + +(defpartgroup group-ctyindb-fast-steam + :id 1130 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3993 :flags (sp7))) + ) + +(define *ctyindb-steam-b-particle-list* (new 'static 'boxed-array :type int32 #x405c00 #x400000)) + +(defun birth-func-texture-group-steam-b-ctyindb ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (particle-adgif-callback + (-> arg1 adgif) + (the-as + texture-id + (-> *ctyindb-steam-b-particle-list* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *ctyindb-steam-b-particle-list* length)) + ) + ) + ) + 0 + (none) + ) + +(defpart 3993 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group-steam-b-ctyindb) + (:num 2.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0.1575)) + (:vel-z (meters 0.2) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16) + (:friction 0.92) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335)) + (:next-launcher 3994) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3994 + :init-specs ((:fade-a -0.32)) + ) + +(defpartgroup group-ctyindb-steam-drift + :id 1131 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3995 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +(defpart 3995 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -1) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3996) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3996 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +(defpartgroup group-ctyindb-rising-steam + :id 1132 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3997 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +(defpart 3997 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -1) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters -0.006666667) (meters -0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3998) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3998 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +(defpartgroup group-ctyindb-tubes-smoke + :id 1133 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3999 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 3999 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 4000) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4000 + :init-specs ((:fade-a -0.11636364)) + ) diff --git a/goal_src/jak3/levels/city/onintent/onintent-part.gc b/goal_src/jak3/levels/city/onintent/onintent-part.gc index 8d9ee6bac2..54436ad092 100644 --- a/goal_src/jak3/levels/city/onintent/onintent-part.gc +++ b/goal_src/jak3/levels/city/onintent/onintent-part.gc @@ -7,3 +7,1461 @@ ;; DECOMP BEGINS +(defpartgroup group-onin-candle + :id 913 + :bounds (static-bspherem 0 0.1 0 0.7) + :parts ((sp-item 3248 :fade-after (meters 60) :falloff-to (meters 60)) + (sp-item 3249 :fade-after (meters 60) :falloff-to (meters 60)) + ) + ) + +(defpart 3248 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 0.02)) + (:scale-x (meters 0.2) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 32.0 32.0) + (:vel-x (meters 0) (meters 0.00016666666)) + (:vel-z (meters 0) (meters 0.00016666666)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:accel-y (meters 0.00026666667) (meters 0.00006666667)) + (:timer (seconds 0.2) (seconds 0.097)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +(defpart 3249 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.05)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +(defpartgroup group-onin-octopus-tank-bubbles + :id 914 + :bounds (static-bspherem 0 3 0 6) + :parts ((sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 1.167) :length (seconds 0.017) :binding 3250) + (sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 1.617) :length (seconds 0.017) :binding 3250) + (sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.5) :length (seconds 0.017) :binding 3250) + (sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 4.05) :length (seconds 0.017) :binding 3250) + (sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.367) :length (seconds 0.017) :binding 3250) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3253 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +(defpart 3252 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters -1.6) (meters 3.2)) + (:y (meters -0.2)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.005)) + (:timer (seconds 1.417)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 100.00001)) + ) + ) + +(defpart 3250 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.05)) + (:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.00083333335)) + (:scalevel-y (meters 0.00041666668)) + (:fade-a 1.6) + (:timer (seconds 1.417)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +(defpart 3251 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:rot-x 9) + (:r 819.2) + (:g 614.4) + (:b 512.0) + (:omega (degrees 0)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 1.417)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch distort)) + ) + ) + +(defpart 3253 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 1.5) + (:x (meters -1.8) (meters 3.6)) + (:y (meters -0.2)) + (:z (meters -0.6) (meters 1.2)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00008333333)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 13926.4) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 100.00001)) + ) + ) + +(defpartgroup group-onin-big-tank-bubbles + :id 915 + :bounds (static-bspherem 0 3 0 6) + :parts ((sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 3255) + (sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.7) :length (seconds 0.017) :binding 3255) + (sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.417) :length (seconds 0.017) :binding 3255) + (sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 8.5) :length (seconds 0.017) :binding 3255) + (sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.45) :length (seconds 0.017) :binding 3255) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3258 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +(defpart 3257 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 0.6)) + (:y (meters -0.2)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.005)) + (:timer (seconds 2.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3255 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.05)) + (:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.00083333335)) + (:scalevel-y (meters 0.00041666668)) + (:fade-a 1.6) + (:timer (seconds 2.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +(defpart 3256 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:rot-x 9) + (:r 819.2) + (:g 614.4) + (:b 512.0) + (:omega (degrees 0)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 2.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch distort)) + ) + ) + +(defpart 3258 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.8) + (:x (meters 0) (meters 0.9)) + (:y (meters -0.2)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00008333333)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 25395.2) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-onin-medium-tank-bubbles + :id 916 + :bounds (static-bspherem 0 3 0 6) + :parts ((sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 3259) + (sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.7) :length (seconds 0.017) :binding 3259) + (sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.417) :length (seconds 0.017) :binding 3259) + (sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 8.5) :length (seconds 0.017) :binding 3259) + (sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.45) :length (seconds 0.017) :binding 3259) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3262 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +(defpart 3261 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 0.4)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.005)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3259 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.05)) + (:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.00083333335)) + (:fade-a 1.6) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +(defpart 3254 + :init-specs ((:scale-x (meters 0.35)) + (:scale-y (meters 0.325)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters -0.00083333335)) + (:fade-a 0.0) + (:next-time (seconds 0.1)) + (:next-launcher 3263) + ) + ) + +(defpart 3263 + :init-specs ((:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y (meters 0.00083333335)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +(defpart 3260 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:rot-x 9) + (:r 819.2) + (:g 614.4) + (:b 512.0) + (:omega (degrees 0)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 1.917)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch distort)) + ) + ) + +(defun check-bubble-surface-onintent ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (if (< (-> arg1 user-float) (-> arg2 rvec y)) + (sp-kill-particle arg0 arg1) + ) + ) + +(defpart 3262 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.6) + (:x (meters 0) (meters 0.6)) + (:y (meters 0.4)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00016666666)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 18022.4) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-onin-short-tank-bubbles + :id 917 + :bounds (static-bspherem 0 3 0 6) + :parts ((sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 3264) + (sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.7) :length (seconds 0.017) :binding 3264) + (sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.417) :length (seconds 0.017) :binding 3264) + (sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 8.5) :length (seconds 0.017) :binding 3264) + (sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.45) :length (seconds 0.017) :binding 3264) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3268 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +(defpart 3266 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 0.4)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.005)) + (:timer (seconds 1.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3264 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.05)) + (:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.00083333335)) + (:scalevel-y (meters 0.00041666668)) + (:fade-a 1.6) + (:timer (seconds 1.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +(defpart 3267 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:rot-x 9) + (:r 819.2) + (:g 614.4) + (:b 512.0) + (:omega (degrees 0)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 1.917)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch distort)) + ) + ) + +(defpart 3268 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.4) + (:x (meters 0) (meters 0.65)) + (:y (meters 0.25)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00016666666)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 12697.6) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-onin-mini-tank-bubbles + :id 918 + :bounds (static-bspherem 0 1 0 1) + :parts ((sp-item 3269 :fade-after (meters 100) :falloff-to (meters 100))) + ) + +(defpart 3269 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.4) + (:x (meters 0) (meters 0.5)) + (:y (meters 0)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00016666666)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 13107.2) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-onin-flashpot + :id 919 + :bounds (static-bspherem 0 2 0 2.2) + :parts ((sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 1.617) :length (seconds 0.017) :binding 3270) + (sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.267) :length (seconds 0.017) :binding 3270) + (sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.4) :length (seconds 0.017) :binding 3270) + (sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 4.635) :length (seconds 0.017) :binding 3270) + (sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.335) :length (seconds 0.017) :binding 3270) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3273) + (sp-item 3274) + (sp-item 3275) + (sp-item 3276) + ) + ) + +(defpart 3275 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.5) + (:y (meters 0.4)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-x (degrees 0.225)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 64.0 128.0) + (:b 64.0 64.0) + (:a 48.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.1333334) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +(defpart 3276 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.8)) + (:scale-x (meters 4.5) (meters 0.2)) + (:rot-x (degrees 0.45)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 64.0 128.0) + (:b 64.0 64.0) + (:a 12.0 4.0) + (:omega (degrees 22.5)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +(defpart 3274 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.6) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0.25) (meters 0.25)) + (:z (meters -0.2) (meters 0.4)) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3277) + ) + ) + +(defpart 3277 + :init-specs ((:fade-b -0.68266666)) + ) + +(defpart 3273 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0.25) (meters 0.25)) + (:z (meters -0.2) (meters 0.4)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g 64.0 128.0) + (:b 0.0 64.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.6) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.047)) + (:next-launcher 3278) + ) + ) + +(defpart 3278 + :init-specs ((:fade-a -0.043636363 -0.05818182)) + ) + +(defpart 3272 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters -0.25) (meters 0.5)) + (:y (meters 0)) + (:z (meters -0.25) (meters 0.5)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.025) (meters 0.015)) + (:friction 0.9 0.025) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 15)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3270 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0) (meters 0.05)) + (:scale-x (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 255.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0) (meters 0.0022222223)) + (:vel-z (meters 0.0016666667) (meters 0.00033333333)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:accel-x (meters -0.000008888889)) + (:accel-z (meters -0.000006666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 ready-to-launch)) + (:next-time (seconds 1.5)) + (:next-launcher 3279) + ) + ) + +(defpart 3279 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpart 3271 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0 2.0) + (:scale-x (meters 0.1) (meters 0.075)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g 64.0 128.0) + (:b 0.0 64.0) + (:a 8.0 16.0) + (:vel-y (meters 0.0016666667) (meters 0.0016666667)) + (:scalevel-x (meters 0) (meters 0.0016666667)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.04 -0.053333335) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:friction 0.85) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-onin-heatpot + :id 920 + :bounds (static-bspherem 0 1 0 1) + :parts ((sp-item 3281 :fade-after (meters 40) :falloff-to (meters 40) :binding 3280) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3282) + (sp-item 3283) + (sp-item 3284) + ) + ) + +(defpart 3283 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.4) (meters 0.1)) + (:rot-x (degrees 0.225)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b :copy g) + (:a 64.0 8.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.1333334) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +(defpart 3284 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.2)) + (:rot-x (degrees 0.45)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b :copy g) + (:a 12.0 4.0) + (:omega (degrees 22.5)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +(defpart 3281 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 1.0) + (:sound (static-sound-spec "fire-pop" :group 0 :volume 10000.0)) + (:x (meters -0.1) (meters 0.2)) + (:y (meters 0)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.0033333334)) + (:accel-y (meters -0.000016666667) (meters -0.000033333334)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3280 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0) (meters 0.1)) + (:scale-x (meters 0.05) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 128.0) + (:b 128.0) + (:a 96.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.026666667) (meters 0.053333335)) + (:vel-y (meters 0)) + (:vel-z (meters 0.00033333333) (meters 0.0026666666)) + (:fade-r 0.0) + (:fade-g -0.7111111) + (:fade-b -0.7111111) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.6)) + (:next-launcher 3285) + ) + ) + +(defpart 3285 + :init-specs ((:fade-r -1.0666667) (:fade-g 1.0666667) (:fade-b 1.0666667)) + ) + +(defpart 3282 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.3) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0.25) (meters 0.25)) + (:z (meters -0.2) (meters 0.4)) + (:rot-x 5) + (:r 1638.4) + (:g 1392.64) + (:b 1433.6) + (:vel-y (meters 0.0016666667) (meters 0.0033333334)) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:timer (seconds 0.5)) + (:flags (distort)) + (:next-time (seconds 0.25)) + (:next-launcher 3286) + ) + ) + +(defpart 3286 + :init-specs ((:fade-b -0.54613334)) + ) + +(defpartgroup group-onin-tiki + :id 921 + :bounds (static-bspherem 0 2 0 4) + :parts ((sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 1.617) :length (seconds 0.017) :binding 3287) + (sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.267) :length (seconds 0.017) :binding 3287) + (sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.4) :length (seconds 0.017) :binding 3287) + (sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 4.635) :length (seconds 0.017) :binding 3287) + (sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.335) :length (seconds 0.017) :binding 3287) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3290) + (sp-item 3291) + (sp-item 3292) + ) + ) + +(defpart 3291 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.3) (meters 0.2)) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-x (degrees 0.45)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 128.0 64.0) + (:b 128.0 128.0) + (:a 16.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +(defpart 3292 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.8)) + (:scale-x (meters 6.5) (meters 0.5)) + (:rot-x (degrees 0.45)) + (:scale-y (meters 8.5) (meters 0.5)) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 128.0 128.0) + (:a 12.0 4.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +(defpart 3290 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0) + (:x (meters 0) (meters 0.3)) + (:y (meters -0.25) (meters 0.25)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 128.0 64.0) + (:b 128.0 128.0) + (:a 0.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0016666667) (meters 0.0026666666)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.9142857) + (:fade-g -1.8285714) + (:fade-b -0.9142857) + (:fade-a 0.6) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.047)) + (:next-launcher 3293) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3293 + :init-specs ((:fade-a -0.032 -0.042666666) (:next-time (seconds 0.135)) (:next-launcher 3294)) + ) + +(defpart 3294 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.135)) (:next-launcher 3294)) + ) + +(defpart 3289 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters -0.25) (meters 0.5)) + (:y (meters 0)) + (:z (meters -0.25) (meters 0.5)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.041666668) (meters 0.015)) + (:friction 0.9 0.025) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 60) (degrees 15)) + (:conerot-y (degrees -45) (degrees 90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3287 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0) (meters 0.05)) + (:scale-x (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0) (meters 0.0022222223)) + (:vel-z (meters 0.0016666667) (meters 0.00033333333)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:accel-x (meters -0.000008888889)) + (:accel-z (meters -0.000006666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 ready-to-launch)) + (:next-time (seconds 1.5)) + (:next-launcher 3295) + ) + ) + +(defpart 3295 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpart 3288 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0 2.0) + (:scale-x (meters 0.15) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 0.0 64.0) + (:b 64.0 128.0) + (:a 8.0 16.0) + (:vel-y (meters 0.0016666667) (meters 0.0016666667)) + (:scalevel-x (meters 0) (meters 0.0016666667)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.04 -0.053333335) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:friction 0.85) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-onin-bird-top + :id 922 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3296 :fade-after (meters 40) :flags (is-3d sp1) :period (seconds 2) :length (seconds 0.017)) + (sp-item 3297 :fade-after (meters 40) :flags (is-3d sp1) :period (seconds 2) :length (seconds 0.017)) + (sp-item 3298 :fade-after (meters 40) :flags (is-3d sp1) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpartgroup group-onin-bird-cage + :id 923 + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 3306 :fade-after (meters 40) :period (seconds 3) :length (seconds 0.017) :binding 3299) + (sp-item 3299 :flags (sp1 sp2 sp3) :binding 3300) + (sp-item 3300 :flags (is-3d sp1 sp2) :binding 3301) + (sp-item 3301 :flags (is-3d sp1 sp2) :binding 3302) + (sp-item 3302 :flags (is-3d sp1 sp2)) + (sp-item 3299 :flags (sp1 sp2 sp3) :binding 3300) + (sp-item 3300 :flags (is-3d sp1 sp2) :binding 3301) + (sp-item 3301 :flags (is-3d sp1 sp2) :binding 3302) + (sp-item 3302 :flags (is-3d sp1 sp2)) + (sp-item 3307 :fade-after (meters 40) :period (seconds 3) :length (seconds 0.017) :binding 3303) + (sp-item 3303 :flags (is-3d sp1 sp2) :binding 3304) + (sp-item 3304 :flags (is-3d sp1 sp2) :binding 3305) + (sp-item 3305 :flags (is-3d sp1 sp2)) + (sp-item 3303 :flags (is-3d sp1 sp2) :binding 3304) + (sp-item 3304 :flags (is-3d sp1 sp2) :binding 3305) + (sp-item 3305 :flags (is-3d sp1 sp2)) + ) + ) + +(defpart 3296 + :init-specs ((:texture (hummingbird-body onintent-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0.2)) + (:z (meters 0)) + (:scale-x (meters 0.6)) + (:rot-x (degrees 90)) + (:rot-y (degrees 180)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.6)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 aux-list left-multiply-quat)) + ) + ) + +(defpart 3297 + :init-specs ((:texture (hummingbird-wing2 onintent-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0.2)) + (:z (meters 0)) + (:scale-x (meters 0.4)) + (:rot-x (degrees -60)) + (:rot-y (degrees 60)) + (:rot-z (degrees -60)) + (:scale-y (meters 1)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:rotvel-x (degrees 0.33333334)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 aux-list left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 3308) + ) + ) + +(defpart 3298 + :init-specs ((:texture (hummingbird-wing2 onintent-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0.2)) + (:z (meters 0)) + (:scale-x (meters 0.4)) + (:rot-x (degrees 240)) + (:rot-y (degrees -60)) + (:rot-z (degrees 60)) + (:scale-y (meters 1)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:rotvel-x (degrees -0.33333334)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 aux-list left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 3309) + ) + ) + +(defpart 3308 + :init-specs ((:rotvel-x (degrees -0.31666666))) + ) + +(defpart 3309 + :init-specs ((:rotvel-x (degrees 0.31666666))) + ) + +(defpart 3306 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 1.5)) + (:z (meters 0)) + (:scale-x (meters 0.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 3299 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 1.4222223)) + (:z (meters 0.5)) + (:scale-x (meters 0.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:omega (degrees 25.000002)) + (:vel-x (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +(defpart 3300 + :init-specs ((:texture (hummingbird-body onintent-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.5) (meters 0.1)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +(defpart 3301 + :init-specs ((:texture (hummingbird-wing onintent-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 135)) + (:rot-y (degrees 90)) + (:rot-z (degrees -60) (degrees 120)) + (:scale-y (meters 0.5)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 64.0 1 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +(defpart 3302 + :init-specs ((:texture (hummingbird-wing onintent-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 135)) + (:rot-y (degrees 90)) + (:rot-z (degrees 120) (degrees 120)) + (:scale-y (meters 0.5)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 64.0 1 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +(defpart 3307 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 1)) + (:z (meters 0)) + (:scale-x (meters 0.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.006666667)) + (:accel-y (meters -0.000144)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1.5)) + (:next-launcher 3310) + ) + ) + +(defpart 3310 + :init-specs ((:accel-y (meters 0.00013))) + ) + +(defpart 3303 + :init-specs ((:texture (hummingbird-body onintent-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.5) (meters 0.1)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +(defpart 3304 + :init-specs ((:texture (hummingbird-wing onintent-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 135)) + (:rot-y (degrees 90)) + (:rot-z (degrees -60) (degrees 120)) + (:scale-y (meters 0.5)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 64.0 1 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +(defpart 3305 + :init-specs ((:texture (hummingbird-wing onintent-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 135)) + (:rot-y (degrees 90)) + (:rot-z (degrees 120) (degrees 120)) + (:scale-y (meters 0.5)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 64.0 1 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +(defpartgroup group-onin-bugs + :id 924 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3311 :flags (is-3d)) (sp-item 3312 :flags (is-3d))) + ) + +(defpart 3311 + :init-specs ((:texture (onin-spider-02 onintent-sprite)) + (:num 0.04) + (:x (meters 1)) + (:y (meters 0)) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0 16.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-x (meters 0.006666667)) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x48500d00 #x48500e00 #x48500f00 #x48500e00)) + (:func 'check-onintent-bugs) + (:next-time (seconds 1) (seconds 0.997)) + (:next-launcher 3313) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3312 + :init-specs ((:texture (onin-spider-02 onintent-sprite)) + (:num 0.04) + (:x (meters 8)) + (:y (meters 0)) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0 16.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-x (meters -0.006666667)) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x48500d00 #x48500e00 #x48500f00 #x48500e00)) + (:func 'check-onintent-bugs) + (:next-time (seconds 2) (seconds 0.497)) + (:next-launcher 3313) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3313 + :init-specs ((:vel-x (meters -0.006666667) (meters 0.013333334)) + (:vel-z (meters -0.006666667) (meters 0.013333334)) + (:timer (seconds 2.5)) + (:next-time (seconds 0.835) (seconds 1.497)) + (:next-launcher 3313) + ) + ) + +;; WARN: Function check-onintent-bugs has a return type of none, but the expression builder found a return statement. +(defun check-onintent-bugs ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (let ((a2-1 (-> arg1 key)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (vector-! v1-0 (-> arg2 rvec) (-> a2-1 origin trans)) + (when (or (< 30720.0 (fabs (-> v1-0 x))) (< 45056.0 (fabs (-> v1-0 z)))) + (sp-kill-particle arg0 arg1) + (return #f) + ) + ) + (let ((s3-0 (the-as sprite-vec-data-2d (-> arg1 user-float)))) + (if (nonzero? s3-0) + (set! (-> s3-0 x-y-z-sx w) + (the-as float (the int (lerp-scale 150.0 10.0 (* 300.0 (vector-length (-> arg1 vel-sxvel))) 0.0 4096.0))) + ) + ) + ) + (sparticle-turn-to-vel arg0 arg1 (the-as sprite-vec-data-3d arg2)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (none) + ) diff --git a/goal_src/jak3/levels/city/onintent/onintent-scenes.gc b/goal_src/jak3/levels/city/onintent/onintent-scenes.gc index 9474206a89..7a6f09febe 100644 --- a/goal_src/jak3/levels/city/onintent/onintent-scenes.gc +++ b/goal_src/jak3/levels/city/onintent/onintent-scenes.gc @@ -7,3 +7,671 @@ ;; DECOMP BEGINS +(defpartgroup group-onin-clap-effect + :id 925 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3314 :period (seconds 4) :length (seconds 0.267)) + (sp-item 3314 :period (seconds 4) :length (seconds 0.135)) + (sp-item 3314 :period (seconds 4) :length (seconds 0.067)) + (sp-item 3314 :period (seconds 4) :length (seconds 0.035)) + (sp-item 3314 :period (seconds 4) :length (seconds 0.017)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.267)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.135)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.067)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.035)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.017)) + ) + ) + +(defpart 3314 + :init-specs ((:texture (glow level-default-sprite)) + (:num 6.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:vel-y (meters 0.0033333334) (meters 0.033333335)) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.00008333333)) + (:friction 0.9 0.02) + (:timer (seconds 1) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3316) + (:conerot-x (degrees 30) (degrees 90)) + (:conerot-y (degrees -32) (degrees 64)) + ) + ) + +(defpart 3315 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 15.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 4.0) + (:vel-y (meters 0.0033333334) (meters 0.033333335)) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.008888889 -0.008888889) + (:accel-y (meters 0) (meters -0.000016666667)) + (:friction 0.9 0.02) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 30) (degrees 90)) + (:conerot-y (degrees -32) (degrees 64)) + ) + ) + +(defpartgroup group-onin-big-clap-effect + :id 926 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3317 :period (seconds 4) :length (seconds 0.267)) + (sp-item 3317 :period (seconds 4) :length (seconds 0.135)) + (sp-item 3317 :period (seconds 4) :length (seconds 0.067)) + (sp-item 3317 :period (seconds 4) :length (seconds 0.035)) + (sp-item 3317 :period (seconds 4) :length (seconds 0.017)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.267)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.135)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.067)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.035)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.017)) + (sp-item 3319 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 15) + ) + ) + +(defpart 3319 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 100.0) + (:omega (degrees 1361.25)) + (:fade-a -1.25) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 3317 + :init-specs ((:texture (glow level-default-sprite)) + (:num 6.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:vel-y (meters 0.1) (meters 0.016666668)) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.00008333333)) + (:friction 0.9 0.01) + (:timer (seconds 1) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3316) + (:conerot-x (degrees 82) (degrees 10)) + (:conerot-y (degrees -10) (degrees 10)) + ) + ) + +(defpart 3318 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 10.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 4.0) + (:vel-y (meters 0.1) (meters 0.016666668)) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.008888889 -0.008888889) + (:accel-y (meters 0) (meters -0.000016666667)) + (:friction 0.9 0.01) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 82) (degrees 10)) + (:conerot-y (degrees -10) (degrees 10)) + ) + ) + +(defpartgroup group-onin-finger-effect + :id 927 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3320 :falloff-to (meters 20)) (sp-item 3321 :falloff-to (meters 20))) + ) + +(defpart 3320 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.000016666667)) + (:timer (seconds 1) (seconds 2.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3316) + ) + ) + +(defpart 3316 + :init-specs ((:scale-x (meters 0.01) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.0) + (:next-time (seconds 0.017)) + (:next-launcher 3322) + ) + ) + +(defpart 3322 + :init-specs ((:r 0.0) (:g 64.0 64.0) (:b 255.0) (:a 64.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 3316)) + ) + +(defpart 3321 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:timer (seconds 0.5) (seconds 1.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-onin-small-finger-effect + :id 928 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3323 :falloff-to (meters 15)) (sp-item 3324 :falloff-to (meters 15))) + ) + +(defpart 3323 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.000016666667)) + (:timer (seconds 0.5) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3316) + ) + ) + +(defpart 3324 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:timer (seconds 0.5) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(load-scene (new 'static 'scene + :name "city-find-catacomb-ent-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-32" + :art-group "scenecamera" + :anim "city-find-catacomb-ent-intro" + :parts 15 + :command-list '((100 + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LindexC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LpinkyC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LthumbC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LringC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LmiddleC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RpinkyC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RthumbC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RringC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RmiddleC" + track + #t + duration + (frame-range 100 351) + ) + ) + (640 + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LindexC" + track + #t + duration + (frame-range 640 730) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LpinkyC" + track + #t + duration + (frame-range 640 730) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LthumbC" + track + #t + duration + (frame-range 640 730) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LringC" + track + #t + duration + (frame-range 640 730) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LmiddleC" + track + #t + duration + (frame-range 640 730) + ) + ) + (857 + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LindexC" + track + #t + duration + (frame-range 857 997) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LpinkyC" + track + #t + duration + (frame-range 857 997) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LthumbC" + track + #t + duration + (frame-range 857 997) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LringC" + track + #t + duration + (frame-range 857 997) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LmiddleC" + track + #t + duration + (frame-range 857 997) + ) + ) + (998 + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 998 1171) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RpinkyC" + track + #t + duration + (frame-range 998 1171) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RthumbC" + track + #t + duration + (frame-range 998 1171) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RringC" + track + #t + duration + (frame-range 998 1171) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RmiddleC" + track + #t + duration + (frame-range 998 1171) + ) + ) + (1750 (fadeout (frame-time-30 30))) + (10000 (task-close! "palace-ruins-patrol-introduction")) + ) + :cut-list '(44 352 456 509 550 612 640 768 857 998 1241 1342 1485 1660) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'onintent + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min 1241) (1342 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'onintent + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'onintent + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'onintent + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'onintent + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min 768) (857 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "onintent-start" + :end-point "onintent-end" + :borrow '() + :sfx-volume -1.0 + :ambient-volume 0.5 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) diff --git a/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc b/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc index a463b65d7f..55ebec0b10 100644 --- a/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc +++ b/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc @@ -7,3 +7,599 @@ ;; DECOMP BEGINS +(define *ctyport-attack-bbush-positions* (new 'loading-level 'boxed-array ctyport-attack-package-info 64)) + +(dotimes (gp-0 (-> *ctyport-attack-bbush-positions* allocated-length)) + (set! (-> *ctyport-attack-bbush-positions* gp-0) (new 'loading-level 'ctyport-attack-package-info)) + ) + +(set! (-> *ctyport-attack-bbush-positions* length) 0) + +(define *ctyport-bbush-mine-positions* + (new 'static 'boxed-array :type ctyport-mine-layout + (new 'static 'ctyport-mine-layout + :num-mines 7 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1984389.1 :z 6423224.5) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 7 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1924341.8 :z 7077519.5) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1087733.8 :z 7747666.0) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 4 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -262144.0 :z 5992448.0) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 7 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 205496.31 :z 5999370.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 8 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 7 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 965550.06 :z 6243574.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 8 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 507904.0 :z 6541312.0) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 958177.25 :z 7158210.5) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 623411.2 :z 7167959.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -81920.0 :z 5771264.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 81920.0 :z 5578752.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 156999.69 :z 5603287.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 4 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 639508.5 :z 5754306.5) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 3 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1331200.0 :z 5947392.0) + :initial-angle 8192.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 2 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1544192.0 :z 5701632.0) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -593920.0 :z 6385664.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1454080.0 :z 6524928.0) + :initial-angle 8192.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 442368.0 :z 7557120.0) + :initial-angle 10922.667 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + ) + ) + +(deftype ctyport-attack-manager-bbush (ctyport-attack-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (clock-speed float) + (countdown-timer handle :offset 336) + ) + (:state-methods + wait-award + ) + ) + + +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this ctyport-attack-manager-bbush)) + (local-vars (sv-96 res-tag)) + (let ((t9-0 (method-of-type task-manager init!))) + (t9-0 this) + ) + (set-setting! 'stop-boats? #t 0.0 0) + (set-setting! 'extra-bank '((ctywide2 cityff) (ctywide3 portatk1)) 0.0 0) + (set-setting! 'lock-sound-camera-to-target #t 0.0 0) + (set! (-> this hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to this)) + ) + (send-event (ppointer->process *time-of-day*) 'change 'hour 16) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (set! (-> this inactive-mine-list) (new 'process 'handle-array 80)) + (set! (-> this inactive-mine-list length) 0) + (set! (-> this clock-speed) 1.0) + (dotimes (s5-1 80) + (let ((v1-31 (process-spawn + ctyport-mine + :name "ctyport-mine" + :from (if (>= s5-1 40) + *port-attack-dead-pool* + *default-dead-pool* + ) + :to this + :stack-size 2048 + ) + ) + ) + (push-back (-> this inactive-mine-list) (process->handle (-> v1-31 0))) + ) + ) + (set! (-> this mine-layout) *ctyport-bbush-mine-positions*) + (set! sv-96 (new 'static 'res-tag)) + (let ((v1-40 (res-lump-data (entity-by-name "port-attack-bbush-1") 'actor-groups pointer :tag-ptr (& sv-96)))) + (cond + ((and v1-40 (nonzero? (-> sv-96 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-40)) + (set! (-> this actor-group-count) (the-as int (-> sv-96 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (dotimes (v1-46 (-> *ctyport-package-positions* length)) + (set! (-> *ctyport-attack-bbush-positions* v1-46 pos quad) (-> *ctyport-package-positions* v1-46 pos quad)) + (set! (-> *ctyport-attack-bbush-positions* v1-46 on-water?) (-> *ctyport-package-positions* v1-46 on-water?)) + ) + (set! (-> *ctyport-attack-bbush-positions* length) (-> *ctyport-package-positions* length)) + (when (-> this actor-group) + (let ((v1-53 0)) + (dotimes (a0-35 (-> this actor-group 0 length)) + (let ((a1-36 (-> this actor-group 0 data a0-35 actor))) + (when a1-36 + (set! (-> *ctyport-attack-bbush-positions* v1-53 pos quad) (-> a1-36 extra trans quad)) + (set! (-> *ctyport-attack-bbush-positions* v1-53 on-water?) #f) + (set! (-> *ctyport-attack-bbush-positions* v1-53 probe?) #t) + (+! v1-53 1) + ) + ) + ) + (set! (-> *ctyport-attack-bbush-positions* length) v1-53) + ) + ) + (set! (-> this package-positions) *ctyport-attack-bbush-positions*) + (dotimes (v1-55 (-> this mine-layout length)) + (set! (-> this mine-layout v1-55 active?) #f) + (dotimes (a0-42 (-> this mine-layout v1-55 num-mines)) + (set! (-> this mine-layout v1-55 stored-handles a0-42) (the-as handle #f)) + ) + ) + (none) + ) + +(defmethod play-speech ((this ctyport-attack-manager-bbush) (arg0 int)) + (let ((v1-0 arg0)) + (if (or (zero? v1-0) + (= v1-0 1) + (= v1-0 2) + (= v1-0 3) + (= v1-0 4) + (= v1-0 5) + (= v1-0 6) + (= v1-0 7) + (= v1-0 8) + (= v1-0 13) + ) + (the-as int #f) + (call-parent-method this arg0) + ) + ) + ) + +(defstate wait (ctyport-attack-manager-bbush) + :virtual #t + :code (behavior () + (set-setting! 'board #f 0.0 0) + (send-event *target* 'end-mode 'board) + (suspend) + (while (or (not *target*) + (not *spawn-actors*) + (!= (status-of-level-and-borrows *level* 'lpatkcs #f) 'active) + (focus-test? *target* board) + ) + (if *target* + (process-grab? *target* #f) + ) + (suspend) + ) + (process-release? *target*) + (set-time-limit self) + (ctyport-attack-setup) + (set-setting! 'exclusive-load '((ignore all)) 0.0 0) + (let ((a1-7 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-7 9) #f) + (set! (-> a1-7 8) #f) + (set! (-> a1-7 7) #f) + (set! (-> a1-7 6) #f) + (set! (-> a1-7 5) #f) + (set! (-> a1-7 4) #f) + (set! (-> a1-7 3) #f) + (set! (-> a1-7 2) 'ctyinda) + (set! (-> a1-7 1) 'ctyport) + (set! (-> a1-7 0) 'ctywide-ff) + (want-levels *load-state* a1-7) + ) + (want-display-level *load-state* 'ctyport 'display) + (want-display-level *load-state* 'ctyinda 'display) + (set! (-> self current-package-index) 0) + (let* ((a0-15 *setting-control*) + (t9-11 (method-of-object a0-15 set-setting)) + (a2-5 'stop-boats?) + (a3-2 #t) + ) + (t9-11 a0-15 self a2-5 a3-2 0 0) + (let ((t9-12 kill-by-type) + (a0-16 barge) + (a1-11 *active-pool*) + ) + (t9-12 a0-16 a1-11) + (apply-settings *setting-control*) + (let* ((v1-34 (the-as entity-actor (entity-by-name "boat-manager-1"))) + (a0-19 (if v1-34 + (-> v1-34 extra process) + ) + ) + ) + (if a0-19 + (apply-alignment + (the-as process-focusable a0-19) + (the-as align-opts a1-11) + (the-as transformq a2-5) + (the-as vector a3-2) + ) + ) + ) + ) + ) + (ctyport-attack-manager-method-45 self) + (send-event *target* 'change-mode 'pilot-daxter (handle->process (-> self active-torpedo))) + (go-virtual pickup-nukes) + ) + ) + +(define *port-attack-bbush-fail-sphere* (new 'static 'sphere :x 2651996.2 :y 31539.2 :z 5880709.0 :r 1.0)) + +(define *port-attack-bbush-fail-radius* 163840.0) + +(defstate pickup-nukes (ctyport-attack-manager-bbush) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self countdown-timer) (the-as handle (current-time))) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (if (< (vector-vector-xz-distance (target-pos 0) *port-attack-bbush-fail-sphere*) *port-attack-bbush-fail-radius*) + (send-event self 'fail) + ) + (set! (-> *game-info* timer) (- (seconds 140) (- (current-time) (the-as int (-> self countdown-timer))))) + (if (<= (-> *game-info* timer) 0) + (send-event self 'fail) + ) + ) + ) + +(defstate head-to-wall (ctyport-attack-manager-bbush) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + (set! (-> self state-time) (-> *display* game-clock frame-counter)) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (let ((f30-0 + (fmax + 0.0 + (fmin 1.0 (* 0.0022222223 (the float (- (-> *display* game-clock frame-counter) (-> self state-time))))) + ) + ) + ) + (set! (-> self clock-speed) (lerp 1.0 0.0 f30-0)) + (update-rates! (-> *display* entity-clock) (-> self clock-speed)) + (update-rates! (-> *display* target-clock) (-> self clock-speed)) + (set-setting! 'bg-r 'abs 1.0 0) + (set-setting! 'bg-g 'abs 1.0 0) + (set-setting! 'bg-b 'abs 1.0 0) + (set-setting! 'bg-a 'abs f30-0 0) + (when (= f30-0 1.0) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (let ((a1-10 (get-continue-by-name *game-info* "ctyport-bbush-port-4"))) + (when a1-10 + (start 'play a1-10) + (go-virtual wait-award) + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch quaternion vs object. +(defmethod ctyport-attack-manager-method-51 ((this ctyport-attack-manager-bbush) (arg0 traffic-object-spawn-params)) + (set! (-> arg0 position quad) (-> (new 'static 'vector :x 2492384.8 :y 34605.055 :z 6578958.5 :w 1.0) quad)) + (quaternion-copy! (-> arg0 rotation) (new 'static 'quaternion :x 0.0002 :y 0.6305 :z 0.0011 :w -0.7761)) + (let ((v1-1 (the-as entity-actor (entity-by-name "port-attack-bbush-1")))) + (when v1-1 + (set! (-> arg0 position quad) (-> v1-1 extra trans quad)) + (quaternion-copy! (-> arg0 rotation) (-> v1-1 quat)) + ) + ) + ) + +(defmethod task-manager-method-25 ((this ctyport-attack-manager-bbush)) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (call-parent-method this) + (none) + ) + +(defstate wait-award (ctyport-attack-manager-bbush) + :virtual #t + :event task-manager-event-handler + :code (behavior () + (while (or (not *target*) (not *spawn-actors*) (not (entity-by-name "burning-bush-36"))) + (if *target* + (process-grab? *target* #f) + ) + (suspend) + ) + (remove-setting! 'bg-r) + (remove-setting! 'bg-g) + (remove-setting! 'bg-b) + (remove-setting! 'bg-a) + (remove-setting! 'music) + (until (process-grab? *target* #f) + (suspend) + ) + (until (= (-> *setting-control* user-current bg-a) 0.0) + (suspend) + ) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (process-release? *target*) + (suspend) + ) + (send-event self 'complete) + (sleep-code) + ) + ) diff --git a/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc b/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc index 84ba62f91c..e75eda4944 100644 --- a/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc +++ b/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc @@ -5,5 +5,3077 @@ ;; name in dgo: ctyport-attack ;; dgos: LCTYPATK +;; +++mine-type +(defenum mine-type + :type uint64 + ) +;; ---mine-type + + +(define-extern *hud-boost-curve* curve2d-fast) + ;; DECOMP BEGINS +(define *ctyport-attack-speech-list* (new 'static 'inline-array talker-speech-class 49 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "torn208" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn209" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn210" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn211" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn212" + :channel (gui-channel voicebox) + :speech #x5 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn213" + :channel (gui-channel voicebox) + :speech #x6 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn214" + :channel (gui-channel voicebox) + :speech #x7 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn215" + :channel (gui-channel voicebox) + :speech #x8 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn216" + :channel (gui-channel voicebox) + :speech #x9 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn217" + :channel (gui-channel voicebox) + :speech #xa + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn218" + :channel (gui-channel voicebox) + :speech #xb + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn219" + :channel (gui-channel voicebox) + :speech #xc + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn220" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #xd + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn221" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #xe + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn222" + :channel (gui-channel voicebox) + :speech #xf + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn223" + :channel (gui-channel voicebox) + :speech #x10 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn224" + :channel (gui-channel voicebox) + :speech #x11 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn225" + :channel (gui-channel voicebox) + :speech #x12 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn226" + :channel (gui-channel voicebox) + :speech #x13 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax552" + :channel (gui-channel daxter) + :speech #x14 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax553" + :channel (gui-channel daxter) + :speech #x15 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax554" + :channel (gui-channel daxter) + :speech #x16 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax555" + :channel (gui-channel daxter) + :speech #x17 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax556" + :channel (gui-channel daxter) + :speech #x18 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax557" + :channel (gui-channel daxter) + :speech #x19 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax558" + :channel (gui-channel daxter) + :speech #x1a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax559" + :channel (gui-channel daxter) + :speech #x1b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax560" + :channel (gui-channel daxter) + :speech #x1c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax561" + :channel (gui-channel daxter) + :speech #x1d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax562" + :channel (gui-channel daxter) + :speech #x1e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax563" + :channel (gui-channel daxter) + :speech #x1f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax564" + :channel (gui-channel daxter) + :speech #x20 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax565" + :channel (gui-channel daxter) + :speech #x21 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax566" + :channel (gui-channel daxter) + :speech #x22 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax567" + :channel (gui-channel daxter) + :speech #x23 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax568" + :channel (gui-channel daxter) + :speech #x24 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax569" + :channel (gui-channel daxter) + :speech #x25 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax570" + :channel (gui-channel daxter) + :speech #x26 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax571" + :channel (gui-channel daxter) + :speech #x27 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax572" + :channel (gui-channel daxter) + :speech #x28 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax573" + :channel (gui-channel daxter) + :speech #x29 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax574" + :channel (gui-channel daxter) + :speech #x2a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax575" + :channel (gui-channel daxter) + :speech #x2b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax576" + :channel (gui-channel daxter) + :speech #x2c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax577" + :channel (gui-channel daxter) + :speech #x2d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax578" + :channel (gui-channel daxter) + :speech #x2e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax579" + :channel (gui-channel daxter) + :speech #x2f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "port-attack-jump-hint" + :channel (gui-channel message) + :flags (talker-flags tf0) + :speech #x30 + :text-duration (seconds 3) + :neg #x1 + :text-message (text-id text-0408) + :on-close #f + :camera #f + ) + ) + ) + +(deftype port-attack-speech-instance (speech-instance) + () + ) + + +(define *port-attack-speech* + (new 'static 'boxed-array :type speech-info + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x1 :probability 1.0)) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x2 :probability 1.0)) + :flags (speech-info-flag si0 si3) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #xe :probability 1.0) + (new 'static 'speech-instance :speech #xd :probability 1.0) + ) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x3 :probability 1.0) + (new 'static 'speech-instance :speech #x16 :probability 1.0) + ) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x4 :probability 1.0) + (new 'static 'speech-instance :speech #x18 :probability 1.0) + ) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x5 :probability 1.0) + (new 'static 'speech-instance :speech #xf :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x7 :probability 1.0)) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x6 :probability 1.0) + (new 'static 'speech-instance :speech #x17 :probability 1.0) + ) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x11 :probability 1.0)) + :flags (speech-info-flag si0 si4) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x9 :probability 1.0) + (new 'static 'speech-instance :speech #xa :probability 1.0) + (new 'static 'speech-instance :speech #x10 :probability 1.0) + (new 'static 'speech-instance :speech #x13 :probability 1.0) + (new 'static 'speech-instance :speech #x15 :probability 1.0) + (new 'static 'speech-instance :speech #x2d :probability 1.0) + ) + :flags (speech-info-flag si4) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x1b :probability 1.0) + (new 'static 'speech-instance :speech #x1c :probability 1.0) + (new 'static 'speech-instance :speech #x1e :probability 1.0) + (new 'static 'speech-instance :speech #x24 :probability 1.0) + (new 'static 'speech-instance :speech #x25 :probability 1.0) + (new 'static 'speech-instance :speech #x26 :probability 1.0) + (new 'static 'speech-instance :speech #x2a :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x1f :probability 1.0) + (new 'static 'speech-instance :speech #x20 :probability 1.0) + (new 'static 'speech-instance :speech #x22 :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x27 :probability 1.0) + (new 'static 'speech-instance :speech #x2b :probability 1.0) + (new 'static 'speech-instance :speech #x28 :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x30 :probability 1.0)) + ) + ) + ) + +(defpartgroup group-nuke-fuel + :id 530 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 2082 :flags (sp7)) + (sp-item 2083 :flags (sp7)) + (sp-item 2084 :flags (sp7)) + (sp-item 2085 :flags (sp7)) + (sp-item 2086 :flags (sp3) :binding 2078) + (sp-item 2078 :flags (sp2) :binding 2079) + (sp-item 2086 :flags (sp3) :binding 2080) + (sp-item 2080 :flags (sp2) :binding 2079) + (sp-item 2086 :flags (sp3) :binding 2081) + (sp-item 2081 :flags (sp2) :binding 2079) + (sp-item 2079 :flags (sp2)) + (sp-item 2079 :flags (sp2)) + (sp-item 2079 :flags (sp2)) + ) + ) + +(defpart 2082 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 40.0 20.0) + (:b 0.0) + (:a 60.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2083 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 30.0) + (:b 0.0) + (:a 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2084 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 9)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 30.0) + (:b 0.0) + (:a 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2086 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 80.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2078 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.016) + (:y (meters 2)) + (:z (meters 4)) + (:scale-x (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds 1)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2080 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.016) + (:y (meters -2)) + (:z (meters 4)) + (:scale-x (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 128.0) + (:omega (degrees 45)) + (:vel-x (meters -0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds 1)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2081 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.016) + (:z (meters 4)) + (:scale-x (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 128.0) + (:omega (degrees 90)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds 1)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2079 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.0) + (:fade-a -1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 2085 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.06 0.06) + (:scale-x (meters 4) (meters 6.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.3)) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.0033333334) (meters 0.0033333334)) + (:scalevel-y (meters 0) (meters 0.00033333333)) + (:fade-a 0.42666668) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 2087) + ) + ) + +(defpart 2087 + :init-specs ((:scalevel-y (meters -0.0013333333) (meters 0.002)) (:fade-a -0.42666668)) + ) + +(defpartgroup group-fuel-pickup-pop + :id 531 + :duration (seconds 2) + :linger-duration (seconds 2) + :flags (sp0 sp4 sp12) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 2090 :period (seconds 2) :length (seconds 0.017)) + (sp-item 2091 :period (seconds 2) :length (seconds 0.017) :binding 2088) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + ) + ) + +(defpart 2090 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 64.0) + (:a 128.0) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.05)) + (:next-launcher 2092) + ) + ) + +(defpart 2092 + :init-specs ((:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.6571429) + (:fade-g -1.8285714) + (:fade-b -1.8285714) + ) + ) + +(defpart 2091 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.001)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:func 'spt-func-relative-pos) + ) + ) + +(defpart 2088 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 16.0) + (:y (meters -4) (meters 16)) + (:scale-x (meters 1.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 1 (meters 0.035555556)) + (:vel-z (meters 0.08)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.467)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 ready-to-launch)) + (:func 'spt-func-relative-pos) + ) + ) + +(defpart 2089 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters -0.002)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334 -0.13333334) + (:accel-y (meters -0.00066666666)) + (:friction 0.6 0.3) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'spt-func-relative-pos) + ) + ) + +(define-perm *port-attack-dead-pool* dead-pool #f) + +(deftype ctyport-mine-layout (structure) + ((mine-type mine-type) + (num-mines int8) + (inout? symbol) + (spin? symbol) + (active? symbol) + (checked-this-frame? symbol) + (origin vector :inline) + (secondary-pos vector :inline) + (initial-angle float) + (spacing float) + (spinrate float) + (period float) + (offset float) + (stored-handles (pointer handle)) + ) + ) + + +(deftype ctyport-attack-package-info (structure) + ((pos vector :inline) + (locked? symbol) + (on-water? symbol) + (probe? symbol) + ) + ) + + +(deftype ctyport-attack-hud (hud) + ((pos-tt float) + (tt-current float) + (tt-prev float) + (tt-next float) + (spike-time time-frame) + ) + ) + + +(deftype ctyport-attack-manager (task-manager) + ((active-torpedo handle) + (inactive-mine-list handle-array) + (mine-clock time-frame) + (current-package-index int16) + (rod-of-god handle) + (wall-h handle) + (passed-cutscene-trigger? symbol) + (finish-type (array type)) + (mine-layout (array ctyport-mine-layout)) + (package-positions (array ctyport-attack-package-info)) + (h-hud handle) + ) + (:state-methods + pickup-nukes + head-to-wall + undefined0 + watch-approach + nuke-wall + wait-for-cleanup + start-mission + get-on-nuke + exit-naughty-ottsel + play-get-on-movie + ) + (:methods + (ctyport-attack-manager-method-42 (_type_ ctyport-mine-layout) symbol) + (ctyport-attack-manager-method-43 (_type_ ctyport-mine-layout) symbol) + (ctyport-attack-manager-method-44 (_type_ ctyport-mine-layout) symbol) + (ctyport-attack-manager-method-45 (_type_) handle) + (ctyport-attack-manager-method-46 (_type_) float) + (hit-cutscene-trigger? (_type_) symbol) + (ctyport-attack-manager-method-48 (_type_ int) object) + (ctyport-attack-manager-method-49 (_type_) int) + (play-speech (_type_ int) int) + (ctyport-attack-manager-method-51 (_type_ traffic-object-spawn-params) object) + ) + ) + + +(defbehavior ctyport-attack-manager-event-handler ctyport-attack-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (taskman-event-handler self arg0 arg1 arg2 arg3) + ) + +(deftype ctyport-mine (process-drawable) + ((root collide-shape :override) + (bob-scalar float) + (last-play-time time-frame) + ) + (:state-methods + hidden + idle + menacing + ) + (:methods + (update (_type_ float) float) + ) + ) + + +(defun classify-mine-layout () + (math-camera-matrix) + 1 + ) + +(define *recorded-pos* (new 'static 'inline-array vector 100 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + +(define *recorded-length* 0) + +(defun record-pos () + (when (cpad-pressed? 0 r1) + (set! (-> *recorded-pos* *recorded-length* quad) (-> (target-pos 0) quad)) + (set! *recorded-length* (+ *recorded-length* 1)) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun print-record-pos () + (dotimes (gp-0 *recorded-length*) + (format 0 "~m ~m ~m~%" (-> *recorded-pos* gp-0 x) (-> *recorded-pos* gp-0 y) (-> *recorded-pos* gp-0 z)) + ) + (none) + ) + +(define *ctyport-mine-positions* + (new 'static 'boxed-array :type ctyport-mine-layout + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -466699.88 :z 7545836.5) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 5 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -384163.84 :z 7424286.5) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -229376.0 :z 7364608.0) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -98304.0 :z 6156288.0) + :initial-angle 8192.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1515520.0 :z 6443008.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1515520.0 :z 6299648.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1024000.0 :z 6410240.0) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -184320.0 :z 6348800.0) + :initial-angle 30037.334 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 3 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 348160.0 :z 5816320.0) + :initial-angle 18204.445 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 688128.0 :z 5763072.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 7 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1560576.0 :z 5939200.0) + :initial-angle 57344.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 8 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 4 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1478656.0 :z 5840896.0) + :initial-angle 8192.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 4 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1372160.0 :z 6758400.0) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 2060288.0 :z 6434816.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1937408.0 :z 6361088.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1880064.0 :z 6512640.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1085440.0 :z 7430144.0) + :initial-angle 49152.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1355776.0 :z 7655424.0) + :initial-angle 49152.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + ) + ) + +(define *ctyport-package-positions* (new 'static 'boxed-array :type ctyport-attack-package-info + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 176601.5 :y 9759.949 :z 5997813.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 794268.06 :y 11748.967 :z 6622295.0 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1978120.6 :y 45374.258 :z 6765555.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 2511750.0 :y 43253.76 :z 6474803.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 2282202.8 :y 51744.77 :z 5972653.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1543227.0 :y 43601.92 :z 5386458.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1016602.6 :y 3454.5664 :z 5883377.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 394521.0 :y 43427.02 :z 7135567.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 535983.3 :y 12885.606 :z 7634002.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1529036.0 :y 11782.144 :z 7476193.0 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1898319.9 :y 44371.56 :z 6786346.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1798895.6 :y 43897.242 :z 5534053.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 680631.94 :y 11468.8 :z 5853921.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -29300.326 :y 11419.238 :z 5714965.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -724783.1 :y 66355.2 :z 5979098.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -660525.06 :y 11522.867 :z 6854534.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 397337.4 :y 43441.355 :z 7084683.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 911933.44 :y 82042.88 :z 7137771.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1371545.6 :y 43990.63 :z 6956851.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1733304.4 :y 17202.791 :z 6412861.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1415546.9 :y 11537.613 :z 5855169.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 836484.3 :y 43537.613 :z 5581822.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -100679.27 :y 10898.228 :z 5999107.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -220959.55 :y 7761.1006 :z 7171646.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 766397.25 :y 11571.2 :z 7237588.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1560256.9 :y 11873.895 :z 6397272.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 2526945.2 :y 43130.88 :z 5991219.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + ) + ) + +(define *ctyport-barrier-pos* (new 'static 'vector :x 3039846.5 :y 17735.68 :z 5309112.5 :w 1.0)) + +(defun get-ctyport-attack-death-count () + (let* ((gp-0 #t) + (v1-0 (cond + ((task-node-closed? (game-task-node city-port-attack-mission)) + 129 + ) + ((not (task-node-closed? (game-task-node city-port-attack-mission))) + 128 + ) + (else + (set! gp-0 #f) + 128 + ) + ) + ) + (v0-2 0) + ) + (if gp-0 + (set! v0-2 (the-as int (-> *game-info* sub-task-list v1-0 death-count))) + ) + v0-2 + ) + ) + +(defskelgroup skel-ctyport-mine cty-port-mine cty-port-mine-lod0-jg cty-port-mine-idle-ja + ((cty-port-mine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12.5) + ) + +(defbehavior ctyport-mine-init-by-other ctyport-mine () + (stack-size-set! (-> self main-thread) 32) + (let ((gp-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> gp-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> gp-0 reaction) cshape-reaction-default) + (set! (-> gp-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid deadly)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 14745.601) + (set! (-> gp-0 total-prims) (the-as uint 1)) + (set! (-> gp-0 root-prim) v1-8) + ) + (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) + (let ((v1-11 (-> gp-0 root-prim))) + (set! (-> gp-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> gp-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> gp-0 event-self) 'touched) + (set! (-> self root) gp-0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self mask) (process-mask crate)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyport-mine" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> self root scale) 2.0 2.0 2.0 1.0) + (let* ((f30-0 819.2) + (f28-0 819.2) + (v1-26 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-27 (the-as number (logior #x3f800000 v1-26))) + ) + (set! (-> self bob-scalar) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-27))))) + ) + (let* ((gp-2 quaternion-rotate-x!) + (s5-1 (-> self root quat)) + (s4-0 (-> self root quat)) + (f30-1 2730.6667) + (v1-33 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-34 (the-as number (logior #x3f800000 v1-33))) + ) + (gp-2 s5-1 s4-0 (* f30-1 (+ -1.0 (the-as float v1-34)))) + ) + (let* ((gp-3 quaternion-rotate-z!) + (s5-2 (-> self root quat)) + (s4-1 (-> self root quat)) + (f30-2 2730.6667) + (v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + ) + (gp-3 s5-2 s4-1 (* f30-2 (+ -1.0 (the-as float v1-41)))) + ) + (let* ((gp-4 quaternion-rotate-y!) + (s5-3 (-> self root quat)) + (s4-2 (-> self root quat)) + (f30-3 65536.0) + (v1-47 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-48 (the-as number (logior #x3f800000 v1-47))) + ) + (gp-4 s5-3 s4-2 (* f30-3 (+ -1.0 (the-as float v1-48)))) + ) + (set! (-> self draw lod-set lod 0 dist) 1638400.0) + (set! (-> self draw lod-set lod 1 dist) 1638400.0) + (go-virtual hidden) + ) + +(defstate hidden (ctyport-mine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('activate) + (let ((v1-1 (the-as object (-> block param 0)))) + (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual idle) + #t + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + (send-event (ppointer->process (-> self parent)) 'hidden (process->handle self)) + (logior! (-> self mask) (process-mask actor-pause)) + ) + :code sleep-code + ) + +(defmethod update ((this ctyport-mine) (arg0 float)) + (when (>= (+ (current-time) (seconds -0.5)) (-> this last-play-time)) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (target-pos 0))) + (f1-0 491520.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (sound-play "port-mine-flash" :position (-> this root trans)) + ) + ) + (set-time! (-> this last-play-time)) + ) + (let* ((f0-1 (vector-length (-> this root trans))) + (f1-3 122880.0) + (f0-3 (/ (- f0-1 (* (the float (the int (/ f0-1 f1-3))) f1-3)) f1-3)) + (f1-4 600.0) + ) + 0.0 + (let* ((f2-6 (the float (current-time))) + (f0-4 (+ f0-3 (/ (- f2-6 (* (the float (the int (/ f2-6 f1-4))) f1-4)) f1-4))) + ) + (set! (-> this root trans y) (* (cos (* 65536.0 f0-4)) (-> this bob-scalar) arg0)) + ) + ) + ) + +(defstate idle (ctyport-mine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hide) + (go-virtual hidden) + ) + (('menace) + (go-virtual menacing) + ) + (('activate) + (let ((v1-5 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-5) quad)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (update self 1.0) + ) + :code transform-and-sleep-code + :post (behavior () + (transform-post) + ) + ) + +(defstate menacing (ctyport-mine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hide) + (go-virtual hidden) + ) + (('activate) + (let ((v1-3 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-3) quad)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (update self 2.0) + ) + :code transform-and-sleep-code + :post (behavior () + (transform-post) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this ctyport-attack-manager)) + (call-parent-method this) + (speeches-reset *port-attack-speech*) + (send-event (ppointer->process *time-of-day*) 'change 'hour 17) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.1) + (set! (-> this passed-cutscene-trigger?) #f) + (set! (-> this inactive-mine-list) (new 'process 'handle-array 80)) + (set! (-> this inactive-mine-list length) 0) + (set-setting! 'extra-bank '((ctywide2 cityff) (ctywide3 portatk1)) 0.0 0) + (set-setting! 'lock-sound-camera-to-target #t 0.0 0) + (set-setting! 'disable-parking-spots? #t 0.0 0) + (dotimes (s5-0 80) + (let ((v1-25 (process-spawn + ctyport-mine + :name "ctyport-mine" + :from (if (>= s5-0 40) + *port-attack-dead-pool* + *default-dead-pool* + ) + :to this + :stack-size 2048 + ) + ) + ) + (push-back (-> this inactive-mine-list) (process->handle (-> v1-25 0))) + ) + ) + (set! (-> this mine-layout) *ctyport-mine-positions*) + (set! (-> this package-positions) *ctyport-package-positions*) + (dotimes (v1-34 (-> this mine-layout length)) + (set! (-> this mine-layout v1-34 active?) #f) + (dotimes (a0-19 (-> this mine-layout v1-34 num-mines)) + (set! (-> this mine-layout v1-34 stored-handles a0-19) (the-as handle #f)) + ) + ) + (none) + ) + +(defmethod set-time-limit ((this ctyport-attack-manager)) + (set-setting! 'rain 'abs 0.0 0) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.0 0.0 0.0) + (set-time-for-random-weather! *mood-control* 100000000.0 100000000.0) + (set-setting! 'city-sound '(portatk1) 0.0 2) + (set-setting! 'exclusive-task #f 0.0 (-> this node-info task)) + 0 + (none) + ) + +(defmethod relocate ((this ctyport-attack-manager) (offset int)) + (if (nonzero? (-> this inactive-mine-list)) + (&+! (-> this inactive-mine-list) offset) + ) + (call-parent-method this offset) + ) + +(defmethod taskman-event-handler ((this ctyport-attack-manager) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('pickup) + (+! (-> this current-package-index) 1) + (cond + ((= (-> this current-package-index) 1) + (play-speech this 4) + ) + ((= (-> this current-package-index) 2) + (process-spawn-function + process + (lambda :behavior process + () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.75)) + (suspend) + ) + ) + (let ((a0-0 (ppointer->process (-> self parent)))) + (if a0-0 + (play-speech (the-as ctyport-attack-manager a0-0) 13) + ) + ) + ) + :to this + ) + ) + ((= (-> this current-package-index) (+ (-> this package-positions length) -9)) + (play-speech this 6) + ) + ((= (-> this current-package-index) (+ (-> this package-positions length) -1)) + (play-speech this 7) + ) + ((= (-> this current-package-index) (-> this package-positions length)) + ) + ((and (or (not (logtest? (-> *port-attack-speech* 9 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 9 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 9 play-time) (seconds 10)) + ) + ) + (or (not (logtest? (-> *port-attack-speech* 10 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 10 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 10 play-time) (seconds 4)) + ) + ) + (and (zero? (mod (the-as int (rand-uint31-gen *random-generator*)) 3)) + (< (-> this current-package-index) (+ (-> this package-positions length) -3)) + (< 3 (-> this current-package-index)) + ) + ) + (play-speech this 9) + ) + ) + (set-time! (-> *port-attack-speech* 4 play-time)) + (send-event (handle->process (-> this active-torpedo)) 'boost #x45800000) + (if (< 13 (-> this current-package-index)) + (task-node-close! (game-task-node city-port-attack-mission) 'event) + ) + (cond + ((< (-> this current-package-index) (-> this package-positions length)) + (ctyport-attack-manager-method-45 this) + ) + (else + (let ((a0-42 *ctyport-barrier-pos*) + (s5-1 (new 'stack-no-clear 'task-arrow-params)) + ) + (set! (-> s5-1 pos quad) (-> a0-42 quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags)) + (set! (-> s5-1 map-icon) (the-as uint 12)) + (logior! (-> s5-1 flags) (task-arrow-flags taf3)) + (let ((v0-0 (the-as object (process->handle (task-arrow-spawn s5-1 this))))) + (set! (-> this rod-of-god) (the-as handle v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(deftype ctyport-attack-package (process-drawable) + ((hum-sound sound-id) + ) + (:state-methods + idle + die + ) + ) + + +(defbehavior ctyport-attack-package-init-by-other ctyport-attack-package ((arg0 vector)) + (stack-size-set! (-> self main-thread) 128) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self hum-sound) (new-sound-id)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 530) self)) + (go-virtual idle) + ) + +(defstate idle (ctyport-attack-package) + :virtual #t + :trans (behavior () + (let ((f30-0 (vector-vector-xz-distance (-> self root trans) (target-pos 0)))) + (if (< f30-0 245760.0) + (sound-play "rocket-pill" :id (-> self hum-sound) :position (-> self root trans)) + ) + (let* ((f1-0 (lerp-scale-clamp 0.0 1.0 f30-0 204800.0 819200.0)) + (f28-0 (fmax 0.0 (fmin 1.0 f1-0))) + (gp-1 (-> self child)) + ) + (while gp-1 + (send-event (ppointer->process gp-1) 'set-alpha f28-0) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (spawn (-> self part) (-> self root trans)) + (when *target* + (let* ((f26-0 (the float (get-ctyport-attack-death-count))) + (f28-1 (lerp-scale-clamp 61440.0 90112.0 f26-0 5.0 15.0)) + ) + (when (and (>= (lerp-scale-clamp 28672.0 40960.0 f26-0 5.0 15.0) f30-0) + (>= f28-1 (- (-> (target-pos 0) y) (-> self root trans y))) + (>= 16384.0 (- (-> self root trans y) (-> (target-pos 0) y))) + ) + (sound-play "rocket-pickup" :position (target-pos 0)) + (send-event (ppointer->process (-> self parent)) 'notify 'pickup) + (let* ((a0-19 *screen-filter*) + (t9-15 (method-of-object a0-19 setup)) + (a1-9 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-9 x) 128.0) + (set! (-> a1-9 y) 128.0) + (set! (-> a1-9 z) 128.0) + (set! (-> a1-9 w) 128.0) + (let ((a2-5 (new 'stack-no-clear 'vector))) + (set! (-> a2-5 x) 128.0) + (set! (-> a2-5 y) 128.0) + (set! (-> a2-5 z) 128.0) + (set! (-> a2-5 w) 0.0) + (t9-15 a0-19 a1-9 a2-5 (* 2.0 (seconds-per-frame)) (bucket-id tex-hud-pris2) #x3fffff #x33001 #f) + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defstate die (ctyport-attack-package) + :virtual #t + :code (behavior () + (sound-stop (-> self hum-sound)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (disable *screen-filter*) + (deactivate self) + ) + ) + +;; WARN: Return type mismatch int vs handle. +(defmethod ctyport-attack-manager-method-45 ((this ctyport-attack-manager)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this package-positions (-> this current-package-index) pos quad)) + (let ((s4-0 (process-spawn ctyport-attack-package s5-0 :name "ctyport-attack-package" :to this)) + (s3-1 (new 'stack-no-clear 'task-arrow-params)) + ) + (if (-> this package-positions (-> this current-package-index) on-water?) + (set! (-> s5-0 y) 0.0) + ) + (when (-> this package-positions (-> this current-package-index) probe?) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-21 (new 'stack-no-clear 'vector))) + (set! (-> v1-21 quad) (-> s5-0 quad)) + (vector+float*! (-> s2-0 start-pos) v1-21 *up-vector* 24576.0) + ) + (set! (-> s2-0 move-dist quad) (the-as uint128 0)) + (set! (-> s2-0 move-dist y) -163840.0) + (let ((v1-24 s2-0)) + (set! (-> v1-24 radius) 40.96) + (set! (-> v1-24 collide-with) (collide-spec backgnd)) + (set! (-> v1-24 ignore-process0) #f) + (set! (-> v1-24 ignore-process1) #f) + (set! (-> v1-24 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-24 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) + (set! (-> s5-0 y) (-> s2-0 best-other-tri intersect y)) + (set! (-> s5-0 y) 0.0) + ) + ) + ) + (set! (-> s3-1 pos quad) (-> s5-0 quad)) + (quaternion-identity! (-> s3-1 quat)) + (set! (-> s3-1 flags) (task-arrow-flags)) + (set! (-> s3-1 map-icon) (the-as uint 13)) + (logior! (-> s3-1 flags) (task-arrow-flags taf3)) + (let ((v0-6 (process->handle (task-arrow-spawn s3-1 (-> s4-0 0))))) + (set! (-> this rod-of-god) (the-as handle v0-6)) + (the-as handle v0-6) + ) + ) + ) + ) + +(defmethod ctyport-attack-manager-method-51 ((this ctyport-attack-manager) (arg0 traffic-object-spawn-params)) + (cond + ((task-node-closed? (game-task-node city-port-attack-mission)) + (set! (-> arg0 position quad) (-> (new 'static 'vector :x -197263.36 :y 52101.12 :z 5516165.0 :w 1.0) quad)) + (quaternion-identity! (-> arg0 rotation)) + (quaternion-rotate-y! (-> arg0 rotation) (-> arg0 rotation) -9102.223) + ) + (else + (set! (-> arg0 position quad) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans quad)) + (quaternion-copy! + (-> arg0 rotation) + (-> (the-as entity-actor (entity-by-name "cty-dax-missile-launcher-1")) quat) + ) + (set! (-> arg0 position y) (+ 8192.0 (-> arg0 position y))) + ) + ) + ) + +(defbehavior ctyport-attack-setup ctyport-attack-manager () + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (ctyport-attack-manager-method-51 self gp-0) + (set! (-> gp-0 velocity quad) (the-as uint128 0)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (let ((s5-0 (get-process *default-dead-pool* htorpedo #x4000 1))) + (set! (-> self active-torpedo) + (process->handle + (-> (when s5-0 + (let ((t9-3 (method-of-type htorpedo activate))) + (t9-3 (the-as htorpedo s5-0) *vehicle-manager* "torpedo" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 vehicle-init-by-other 2 gp-0) + (-> s5-0 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (set! (-> self rod-of-god) (the-as handle #f)) + (set-time! (-> self state-time)) + (set-time! (-> self mine-clock)) + (dotimes (v1-15 (-> self mine-layout length)) + (set! (-> self mine-layout v1-15 active?) #f) + ) + (suspend) + (dotimes (gp-1 (-> self mine-layout length)) + (let ((s5-1 (-> self mine-layout gp-1))) + (cond + ((-> s5-1 active?) + (cond + ((zero? (classify-mine-layout)) + (ctyport-attack-manager-method-42 self s5-1) + ) + (else + (if (or (-> s5-1 spin?) (-> s5-1 inout?)) + (ctyport-attack-manager-method-44 self s5-1) + ) + ) + ) + ) + (else + (set! (-> s5-1 checked-this-frame?) #f) + ) + ) + ) + ) + (when (> (-> self inactive-mine-list length) 0) + (dotimes (gp-2 (-> self mine-layout length)) + (let ((s5-2 (-> self mine-layout gp-2))) + (when (and (not (-> s5-2 active?)) + (not (-> s5-2 checked-this-frame?)) + (>= (-> self inactive-mine-list length) (-> s5-2 num-mines)) + ) + (case (classify-mine-layout) + ((1) + (ctyport-attack-manager-method-43 self s5-2) + (ctyport-attack-manager-method-44 self s5-2) + ) + ) + ) + ) + ) + ) + (until *target* + (suspend) + ) + (suspend) + 0 + (none) + ) + +(defstate wait (ctyport-attack-manager) + :virtual #t + :code (behavior () + (while (or (not *target*) (not *spawn-actors*) (!= (status-of-level-and-borrows *level* 'lpatkcs #f) 'active)) + (if *target* + (process-grab? *target* #f) + ) + (suspend) + ) + (process-release? *target*) + (set-time-limit self) + (ctyport-attack-setup) + (while (or (not (level-get-target-inside *level*)) (= (-> (level-get-target-inside *level*) name) 'hiphog)) + (suspend) + ) + (set-setting! 'airlock #f 0.0 0) + (cond + ((or (task-node-closed? (game-task-node city-port-attack-mission)) + (or (task-node-closed? (game-task-node city-port-attack-get-on)) (kiosk?)) + ) + (kill-by-type barge *active-pool*) + (go-virtual start-mission) + ) + (else + (go-virtual exit-naughty-ottsel) + ) + ) + ) + ) + +(defstate wait-for-cleanup (ctyport-attack-manager) + :virtual #t + :event task-manager-event-handler + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (if (not (handle->process (-> self active-torpedo))) + (send-event self (the-as symbol (-> self finish-type))) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer self)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'kill) + (let ((s5-0 send-event-function) + (v1-7 (entity-by-name "krimson-wall-8")) + ) + (s5-0 + (if v1-7 + (-> v1-7 extra process) + ) + gp-1 + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-2 from) (process->ppointer self)) + (set! (-> gp-2 num-params) 0) + (set! (-> gp-2 message) 'kill) + (let ((s5-1 send-event-function) + (v1-12 (entity-by-name "krimson-wall-9")) + ) + (s5-1 + (if v1-12 + (-> v1-12 extra process) + ) + gp-2 + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-3 from) (process->ppointer self)) + (set! (-> gp-3 num-params) 0) + (set! (-> gp-3 message) 'kill) + (let ((s5-2 send-event-function) + (v1-17 (entity-by-name "krimson-wall-10")) + ) + (s5-2 + (if v1-17 + (-> v1-17 extra process) + ) + gp-3 + ) + ) + ) + (suspend) + (until #f + (suspend) + ) + #f + ) + ) + +(defstate nuke-wall (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code (behavior () + (let ((gp-0 (entity-by-name "krimson-wall-10"))) + (when gp-0 + (send-event (-> gp-0 extra process) 'break) + (set! (-> self wall-h) + (ppointer->handle + (process-spawn krimson-wall-break gp-0 'lctypatk :name "krimson-wall-break" :to *entity-pool*) + ) + ) + ) + ) + (suspend) + (send-event (handle->process (-> self wall-h)) 'break) + (while (not (send-event (handle->process (-> self wall-h)) 'done)) + (suspend) + ) + (send-event self 'complete) + ) + ) + +(defmethod ctyport-attack-manager-method-46 ((this ctyport-attack-manager)) + (when (can-display-query? this (the-as string #f) -99.0) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-1 gp-0)) + (set! (-> v1-1 width) (the float 340)) + ) + (let ((v1-2 gp-0)) + (set! (-> v1-2 height) (the float 80)) + ) + (let ((v1-3 gp-0)) + (set! (-> v1-3 scale) 0.9) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text + (lookup-text! *common-text* (text-id text-0086) #f) + gp-0 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + ) + ) + ) + +(define *cutscene-trigger-plane-normal* (new 'static 'vector :x -0.0799 :z -0.9967 :w 1.0)) + +(define *cutscene-trigger-plane-pt* (new 'static 'vector :x 3025019.0 :z 5512233.0 :w 1.0)) + +(defmethod hit-cutscene-trigger? ((this ctyport-attack-manager)) + (when (not (-> this passed-cutscene-trigger?)) + (let ((f30-0 (vector-dot *cutscene-trigger-plane-normal* *cutscene-trigger-plane-pt*))) + (when (handle->process (-> this active-torpedo)) + (let* ((s5-0 (handle->process (-> this active-torpedo))) + (a1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (a0-10 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-10 quad) (-> (the-as process-focusable a1-3) rbody position quad)) + (if (and (< f30-0 (vector-dot *cutscene-trigger-plane-normal* a0-10)) + (< (vector-vector-xz-distance a0-10 *cutscene-trigger-plane-pt*) 225280.0) + ) + (set! (-> this passed-cutscene-trigger?) #t) + ) + ) + ) + ) + ) + (-> this passed-cutscene-trigger?) + ) + +(define *approach-camera-pt* (new 'static 'vector :x 3040789.8 :y 138802.38 :z 5532802.5 :w 1.0)) + +(define *approach-camera-matrix* (new 'static 'matrix + :rvec (new 'static 'vector :x 0.0436 :y -0.1756 :z -0.9834) + :uvec (new 'static 'vector :x 0.0077 :y 0.9844 :z -0.1754) + :fvec (new 'static 'vector :x -0.999 :z -0.0443) + ) + ) + +(defstate watch-approach (ctyport-attack-manager) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (format 0 "Msg is ~s, from ~s~%" message (-> proc name)) + (case message + (('nuke-hit) + (if (or (not (-> block param 0)) (not *target*) (focus-test? *target* pilot-riding)) + (send-event self 'fail) + (go-virtual nuke-wall) + ) + ) + (else + (ctyport-attack-manager-event-handler proc argc message block) + ) + ) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (send-event (handle->process (-> self active-torpedo)) 'override-camera #t) + (if (not (handle->process (-> self active-torpedo))) + (send-event self 'fail) + ) + (when *target* + (cond + ((focus-test? *target* pilot-riding) + ) + (else + ) + ) + ) + ) + :code sleep-code + ) + +(define *port-attack-fail-sphere* (new 'static 'sphere :x -1074094.1 :y 31539.2 :z 5908275.0 :r 1.0)) + +(define *port-attack-fail-radius* 163840.0) + +(defstate head-to-wall (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + '() + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (if (< (vector-vector-xz-distance (target-pos 0) *port-attack-fail-sphere*) *port-attack-fail-radius*) + (send-event self 'fail) + ) + (let ((gp-1 (handle->process (-> self active-torpedo)))) + (cond + ((focus-test? + (the-as process-focusable (if (type? gp-1 process-focusable) + (the-as process-focusable gp-1) + ) + ) + dead + ) + (send-event self 'fail) + ) + ((hit-cutscene-trigger? self) + (send-event (handle->process (-> self active-torpedo)) 'hide) + (send-event (handle->process (-> self rod-of-god)) 'leave) + (send-event self 'complete) + ) + ) + ) + ) + :code sleep-code + ) + +(defstate pickup-nukes (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + (set-setting! 'disable-guard-chatter? #t 0.0 0) + (set! (-> self h-hud) + (ppointer->handle + (process-spawn ctyport-attack-hud :init hud-init-by-other :name "ctyport-attack-hud" :to self) + ) + ) + (set-time! (-> self state-time)) + (if (zero? (-> self current-package-index)) + (play-speech self 1) + ) + (dotimes (gp-1 (-> self mine-layout length)) + (let ((s5-0 (-> self mine-layout gp-1))) + (when (-> s5-0 active?) + (dotimes (s4-0 (-> s5-0 num-mines)) + (let ((v1-19 (-> s5-0 stored-handles s4-0))) + (send-event (handle->process v1-19) 'menace) + ) + ) + ) + ) + ) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + ((-> (method-of-type task-manager active) trans)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.2)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + ) + (set-blackout-frames 0) + ) + (let ((v1-12 (-> self package-positions length))) + (set! (-> *game-info* goal) (/ (the float (-> self current-package-index)) (the float (+ v1-12 -1)))) + ) + (ctyport-attack-manager-method-49 self) + (if (and (zero? (-> self current-package-index)) + (> (-> *port-attack-speech* 1 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 1 play-time) (seconds 1)) + ) + (play-speech self 3) + ) + (if (< (vector-vector-xz-distance (target-pos 0) *port-attack-fail-sphere*) *port-attack-fail-radius*) + (send-event self 'fail) + ) + (if (and (> (-> self current-package-index) 0) + (< (-> self current-package-index) (+ (-> self package-positions length) -9)) + (and (> (-> *port-attack-speech* 4 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 4 play-time) (seconds 12)) + ) + (or (not (logtest? (-> *port-attack-speech* 5 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 5 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 5 play-time) (seconds 20)) + ) + ) + ) + (play-speech self 5) + ) + (cond + ((< (-> self current-package-index) (-> self package-positions length)) + (if (or (not *target*) + (not (handle->process (-> self active-torpedo))) + (begin + (let* ((gp-2 #t) + (s5-0 (handle->process (-> self active-torpedo))) + (v1-67 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-67 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + ) + (else + (go-virtual head-to-wall) + ) + ) + ) + :code (behavior () + (sleep-code) + ) + ) + +(defmethod ctyport-attack-manager-method-48 ((this ctyport-attack-manager) (arg0 int)) + 0.0 + (when (< 2 arg0) + (let ((f30-0 (* -6144.0 (the float (+ arg0 -2))))) + (if (task-node-closed? (game-task-node city-port-attack-mission)) + (set! f30-0 (* 2.0 f30-0)) + ) + (let ((f0-4 (fmax -81920.0 f30-0))) + (send-event (handle->process (-> this active-torpedo)) 'boost f0-4) + ) + ) + ) + ) + +(defstate start-mission (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + (set-setting! 'music 'portattk 0.0 0) + (set-setting! 'exclusive-load '((ignore all)) 0.0 0) + (let ((a1-2 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-2 9) #f) + (set! (-> a1-2 8) #f) + (set! (-> a1-2 7) #f) + (set! (-> a1-2 6) #f) + (set! (-> a1-2 5) #f) + (set! (-> a1-2 4) #f) + (set! (-> a1-2 3) #f) + (set! (-> a1-2 2) 'ctyinda) + (set! (-> a1-2 1) 'ctyport) + (set! (-> a1-2 0) 'ctywide-ff) + (want-levels *load-state* a1-2) + ) + (want-display-level *load-state* 'ctyport 'display) + (want-display-level *load-state* 'ctyinda 'display) + (ctyport-attack-manager-method-48 self (get-ctyport-attack-death-count)) + (if (task-node-closed? (game-task-node city-port-attack-mission)) + (send-event (handle->process (-> self active-torpedo)) 'boost 57344.0) + ) + (set! (-> self current-package-index) 0) + (if (task-node-closed? (game-task-node city-port-attack-mission)) + (set! (-> self current-package-index) 14) + ) + (ctyport-attack-manager-method-45 self) + (send-event *target* 'change-mode 'pilot-daxter (handle->process (-> self active-torpedo))) + (go-virtual pickup-nukes) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code sleep-code + ) + +(defstate exit-naughty-ottsel (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (if (!= (status-of-level-and-borrows *level* 'hiphog #f) 'active) + (go-virtual get-on-nuke) + ) + ) + :code sleep-code + ) + +(defstate get-on-nuke (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + (set-setting! 'airlock #f 0.0 0) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (if (and *target* (not (logtest? (focus-status teleporting) (-> *target* focus-status)))) + (play-speech self 0) + ) + (when (and (not (handle->process (-> self rod-of-god))) + (not (task-node-closed? (game-task-node city-port-attack-get-on))) + (handle-command-list *gui-control* (gui-channel voicebox) (the-as gui-connection #f)) + (> (-> *port-attack-speech* 0 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 0 play-time) (seconds 1)) + ) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3 taf8)) + (set! (-> self rod-of-god) (process->handle (task-arrow-spawn gp-0 self))) + ) + ) + (when (and *target* (and (handle-command-list *gui-control* (gui-channel voicebox) (the-as gui-connection #f)) + (not (focus-test? *target* pilot-riding)) + (let ((gp-1 vector-vector-xz-distance) + (s5-1 (target-pos 0)) + (s4-0 (handle->process (-> self active-torpedo))) + ) + (and (< (gp-1 s5-1 (get-trans + (the-as process-focusable (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + 0 + ) + ) + 32768.0 + ) + (> (-> *port-attack-speech* 0 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 0 play-time) (seconds 1)) + ) + ) + ) + ) + (send-event (handle->process (-> self rod-of-god)) 'leave) + (go-virtual play-get-on-movie) + ) + ) + :code sleep-code + ) + +(defstate play-get-on-movie (ctyport-attack-manager) + :virtual #t + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code (behavior () + (set-blackout-frames (seconds 0.05)) + (set-setting! 'stop-boats? #t 0.0 0) + (let ((gp-0 (get-process *default-dead-pool* scene-player #x4000 1))) + (process->handle + (-> (when gp-0 + (let ((t9-3 (method-of-type scene-player activate))) + (t9-3 (the-as scene-player gp-0) *default-pool* "scene-player" (the-as pointer #x70004000)) + ) + (run-now-in-process gp-0 scene-player-init "ctyport-attack-get-on-nuke" #t #f) + (-> gp-0 ppointer) + ) + 0 + ) + ) + ) + (while *scene-player* + (when (< 0.0 (-> *scene-player* 0 last-frame)) + (set-setting! 'stop-boats? #t 0.0 0) + (send-event (handle->process (-> self active-torpedo)) 'hide) + ) + (suspend) + ) + (task-node-close! (game-task-node city-port-attack-get-on) 'event) + (send-event (handle->process (-> self active-torpedo)) 'show) + (set-setting! 'stop-boats? #t 0.0 0) + (apply-settings *setting-control*) + (kill-by-type barge *active-pool*) + (suspend) + (go-virtual start-mission) + ) + ) + +(defmethod deactivate ((this ctyport-attack-package)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this hum-sound)) + (call-parent-method this) + (none) + ) + +(defmethod ctyport-attack-manager-method-42 ((this ctyport-attack-manager) (arg0 ctyport-mine-layout)) + (set! (-> arg0 active?) #f) + (set! (-> arg0 checked-this-frame?) #t) + (dotimes (s4-0 (-> arg0 num-mines)) + (push-back (-> this inactive-mine-list) (-> arg0 stored-handles s4-0)) + (send-event (handle->process (-> arg0 stored-handles s4-0)) 'hide) + ) + #f + ) + +(defmethod ctyport-attack-manager-method-44 ((this ctyport-attack-manager) (arg0 ctyport-mine-layout)) + (local-vars (sv-208 vector) (sv-224 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + 0.0 + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> *x-vector* quad)) + (let ((f30-0 (-> arg0 initial-angle))) + (cond + ((-> arg0 inout?) + (let* ((f0-2 (* 0.0033333334 (the float (- (current-time) (-> this mine-clock))))) + (f1-3 (* 0.0033333334 (-> arg0 period))) + (f0-5 (+ (/ (- f0-2 (* (the float (the int (/ f0-2 f1-3))) f1-3)) (* 0.0033333334 (-> arg0 period))) + (-> arg0 offset) + ) + ) + (f0-6 (- f0-5 (* (the float (the int (/ f0-5 1.0))) 1.0))) + ) + (if (< 0.5 f0-6) + (set! f0-6 (- 1.0 f0-6)) + ) + (let ((f0-7 (* 2.0 f0-6))) + (vector-lerp! s5-0 (-> arg0 origin) (-> arg0 secondary-pos) f0-7) + ) + ) + ) + (else + (set! (-> s5-0 quad) (-> arg0 origin quad)) + ) + ) + (if (-> arg0 spin?) + (+! f30-0 (* 0.0033333334 (-> arg0 spinrate) (the float (- (current-time) (-> this mine-clock))))) + ) + (vector-rotate-around-y! s4-0 s4-0 f30-0) + ) + (let ((s3-1 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s4-0 *up-vector*))) + (dotimes (s2-0 (-> arg0 num-mines)) + (let ((v1-28 (-> arg0 stored-handles s2-0))) + (send-event (handle->process v1-28) 'activate s5-0) + ) + (let ((s1-0 s5-0) + (s0-0 s5-0) + ) + (set! sv-208 s4-0) + (let* ((f30-1 1.0) + (f28-0 0.29999995) + (v1-33 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-34 (the-as number (logior #x3f800000 v1-33))) + (f0-16 (* (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-34)))) (-> arg0 spacing))) + ) + (vector+float*! s1-0 s0-0 sv-208 f0-16) + ) + ) + (let ((s1-2 s5-0) + (s0-1 s5-0) + ) + (set! sv-224 (-> s3-1 rvec)) + (let* ((f30-2 -10240.0) + (f28-1 20480.0) + (v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + (f0-21 (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-41))))) + ) + (vector+float*! s1-2 s0-1 sv-224 f0-21) + ) + ) + ) + ) + ) + ) + #f + ) + +(defmethod ctyport-attack-manager-method-43 ((this ctyport-attack-manager) (arg0 ctyport-mine-layout)) + (set! (-> arg0 active?) #t) + (dotimes (s4-0 (-> arg0 num-mines)) + (set! (-> arg0 stored-handles s4-0) (-> this inactive-mine-list data0 0)) + (pop-front (-> this inactive-mine-list) 0) + ) + #f + ) + +(defun copy-record-pos () + (dotimes (v1-0 *recorded-length*) + (set! (-> *ctyport-package-positions* v1-0 pos quad) (-> *recorded-pos* v1-0 quad)) + ) + #f + ) + +(defun print-record-pos-2 () + (dotimes (gp-0 (-> *ctyport-package-positions* length)) + (format + 0 + "(static-cty-package ~m ~m ~m :locked? #t)~%" + (-> *ctyport-package-positions* gp-0 pos x) + (-> *ctyport-package-positions* gp-0 pos y) + (-> *ctyport-package-positions* gp-0 pos z) + ) + ) + #f + ) + +(dotimes (v1-116 (-> *ctyport-package-positions* length)) + (when (not (-> *ctyport-package-positions* v1-116 locked?)) + 0 + (goto cfg-14) + ) + (set! *recorded-length* (+ v1-116 1)) + ) + +(label cfg-14) + +(defmethod task-manager-method-25 ((this ctyport-attack-manager)) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + (disable *screen-filter*) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch clock vs none. +(defun lctypatk-login ((arg0 level)) + (set! *port-attack-dead-pool* (new 'loading-level 'dead-pool 40 2048 "*port-attack-dead-pool*")) + (set! (-> *port-attack-dead-pool* clock) (-> *display* entity-clock)) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun lctypatk-logout ((arg0 level)) + (set! *port-attack-dead-pool* #f) + (none) + ) + +(defskelgroup skel-cty-dax-missile-launcher cty-dax-missile-launcher cty-dax-missile-launcher-lod0-jg cty-dax-missile-launcher-idle-ja + ((cty-dax-missile-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12.5) + ) + +(deftype cty-dax-missile-launcher (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defmethod init-from-entity! ((this cty-dax-missile-launcher) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-4) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-7 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cty-dax-missile-launcher" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (process-drawable-from-entity! this arg0) + (go (method-of-object this idle)) + ) + +(defstate idle (cty-dax-missile-launcher) + :virtual #t + :code transform-and-sleep-code + :post ja-post + ) + +(defmethod ctyport-attack-manager-method-49 ((this ctyport-attack-manager)) + (local-vars (v0-0 int)) + (if (or (< (-> this current-package-index) 2) + (< (+ (-> this package-positions length) -2) (-> this current-package-index)) + ) + (return 0) + ) + (when (or (not (logtest? (-> *port-attack-speech* 9 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 9 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 9 play-time) (seconds 4)) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let* ((s3-0 (handle->process (-> this active-torpedo))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (the-as process-focusable s4-0) + (let ((s3-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable s4-0) root quat)))) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (vector+float*! s5-0 (-> (the-as process-focusable s4-0) root trans) s3-1 122880.0) + ) + (set! (-> s5-0 w) 40960.0) + (when (and (or (not (logtest? (-> *port-attack-speech* 10 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 10 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 10 play-time) (seconds 5)) + ) + ) + (or (not (logtest? (-> *port-attack-speech* 12 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 12 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 12 play-time) (seconds 2)) + ) + ) + (not (logtest? (rand-uint31-gen *random-generator*) 1)) + ) + (let ((s3-4 0)) + (let ((s2-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s1-0 (fill-actor-list-for-box *actor-hash* s5-0 s2-0 384)) + (let* ((s0-0 (-> s2-0 s1-0)) + (v1-52 (if (type? s0-0 collide-shape) + s0-0 + ) + ) + ) + (when v1-52 + (let* ((s0-1 (-> v1-52 process)) + (v1-53 (if (type? s0-1 process-focusable) + s0-1 + ) + ) + ) + (when v1-53 + (if (and (!= v1-53 *target*) (!= v1-53 s4-0) (logtest? (process-mask guard civilian) (-> v1-53 mask))) + (+! s3-4 1) + ) + ) + ) + ) + ) + ) + ) + (let* ((s1-1 *target*) + (s2-1 (if (type? s1-1 process-focusable) + s1-1 + ) + ) + ) + (when (and s2-1 (< (vector-vector-distance (get-trans s2-1 0) s5-0) (-> s5-0 w))) + (if (and (!= s2-1 *target*) (!= s2-1 s4-0) (logtest? (process-mask guard civilian) (-> s2-1 mask))) + (+! s3-4 1) + ) + ) + ) + (when (< 2 s3-4) + (play-speech this 10) + (return 0) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod play-speech ((this ctyport-attack-manager) (arg0 int)) + (speech-play *port-attack-speech* arg0 *ctyport-attack-speech-list* (target-pos 0)) + ) + +(defmethod init-callback ((this ctyport-attack-hud)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-dax-missle-meter-01" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 0 pos z) #xfffff0) + (set! (-> this sprites 1 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-dax-missle-meter-03" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 1 pos z) #xfffff2) + (set! (-> this sprites 2 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-dax-missle-meter-03" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 2 pos z) #xfffff4) + (set! (-> this sprites 3 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-dax-missle-meter-02" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 3 pos z) #xffffff) + 0 + (none) + ) + +(if #t + (set! *hud-boost-curve* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 5.0 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -8.0 :z 1.0 :w 1.0) + ) + ) + ) + +(defmethod draw ((this ctyport-attack-hud)) + (set-hud-piece-position! + (-> this sprites 2) + (the int (+ 65.0 (* 18.0 (-> *video-params* relative-x-scale)) (* -130.0 (-> this offset)))) + (the int (+ 350.0 (* 130.0 (-> this offset)))) + ) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 5 -25) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 5 5) + (logior! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (logior! (-> this sprites 2 flags) (hud-sprite-flags hsf3 hsf4)) + (logior! (-> this sprites 3 flags) (hud-sprite-flags hsf3)) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1110 0) + (logior! (-> this sprites 1 flags) (hud-sprite-flags hsf3 hsf5)) + (set! (-> this sprites 2 scale-x) 1.4) + (set! (-> this sprites 1 scale-x) 1.4) + (set! (-> this sprites 1 scale-y) 1.1) + (set! (-> this sprites 0 color w) 128) + (set! (-> this sprites 2 color w) 128) + (set! (-> this sprites 3 color w) 128) + (set! (-> this sprites 2 color x) 128) + (set! (-> this sprites 2 color y) 128) + (set! (-> this sprites 2 color z) 128) + (set! (-> this sprites 1 color x) 128) + (set! (-> this sprites 1 color y) 128) + (set! (-> this sprites 1 color z) 128) + (set! (-> this sprites 1 color w) 0) + (let ((f0-11 (* 0.011111111 (the float (- (current-time) (-> this spike-time)))))) + 0.0 + (let ((f0-12 (curve2d-method-9 *hud-boost-curve* f0-11 3))) + (set! (-> this tt-current) (lerp (-> this tt-prev) (-> this tt-next) f0-12)) + ) + ) + (let ((f30-0 (-> this tt-current))) + (when (and (not (paused?)) (time-elapsed? (-> this spike-time) (seconds 0.3))) + (let* ((f28-0 -1.0) + (f26-0 2.0) + (v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + ) + (+! f30-0 (* (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-41)))) (lerp 0.01 0.06 (* f30-0 f30-0)))) + ) + ) + (let ((f30-1 (fmax 0.0 (fmin 1.15 f30-0)))) + (when (not (paused?)) + (let* ((f28-2 (* (-> this tt-current) (-> this tt-current))) + (f0-23 (lerp 1.0 0.3 f28-2)) + (f1-16 (* 0.0033333334 (the float (current-time)))) + (f0-24 (/ (- f1-16 (* (the float (the int (/ f1-16 f0-23))) f0-23)) f0-23)) + (f1-18 (* f28-2 (curve2d-method-9 *curve-linear-up-down* f0-24 3))) + (f28-3 (fmax 0.0 (fmin 1.0 f1-18))) + ) + (set! (-> this sprites 3 color x) (the int (lerp 128.0 192.0 f28-3))) + (set! (-> this sprites 3 color y) (the int (lerp 128.0 64.0 f28-3))) + (set! (-> this sprites 3 color z) (the int (lerp 128.0 0.0 f28-3))) + (set! (-> this sprites 0 color x) (the int (lerp 128.0 192.0 f28-3))) + (set! (-> this sprites 0 color y) (the int (lerp 128.0 64.0 f28-3))) + (set! (-> this sprites 0 color z) (the int (lerp 128.0 0.0 f28-3))) + ) + (when (not (time-elapsed? (-> this spike-time) (seconds 0.1))) + (set! (-> this sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 255) + (set! (-> this sprites 3 color z) 255) + (set! (-> this sprites 0 color x) 255) + (set! (-> this sprites 0 color y) 255) + (set! (-> this sprites 0 color z) 255) + ) + ) + (let ((f0-39 (lerp 32403.91 3185.7778 f30-1))) + (set! (-> this sprites 2 angle) f0-39) + (set! (-> this sprites 1 angle) f0-39) + ) + ) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this ctyport-attack-hud)) + (set! (-> this values 0 target) (the-as int (-> *game-info* goal))) + (when (and (< 0.0 (-> *game-info* goal)) (< (-> this tt-next) (-> *game-info* goal))) + (set! (-> this tt-prev) (-> this tt-current)) + (set-time! (-> this spike-time)) + (set! (-> this tt-next) (-> *game-info* goal)) + ) + (call-parent-method this) + (none) + ) diff --git a/goal_src/jak3/levels/city/port/attack/h-torpedo.gc b/goal_src/jak3/levels/city/port/attack/h-torpedo.gc index 5229327768..1c37ee6163 100644 --- a/goal_src/jak3/levels/city/port/attack/h-torpedo.gc +++ b/goal_src/jak3/levels/city/port/attack/h-torpedo.gc @@ -5,5 +5,1917 @@ ;; name in dgo: h-torpedo ;; dgos: LCTYPATK +(define-extern *growing-curve-torpedo* curve2d-piecewise) +(define-extern *water-simple-alpha-curve-fade-out-torpedo* curve2d-piecewise) +(define-extern *color-curve-tan-brown-torpedo* curve-color-piecewise) +(define-extern *water-simple-alpha-curve-in-torpedo* curve2d-piecewise) +(define-extern *torpedo-wake-trail* light-trail-composition) +(define-extern *range-torp-explo-color* curve-color-fast) +(define-extern *range-torp-explo-alpha* curve2d-fast) +(define-extern *range-torp-explo-scale-x* curve2d-fast) +(define-extern *range-torp-explo-scale-y* curve2d-fast) +(define-extern *curve-torp-explo-alpha* curve2d-fast) +(define-extern *curve-torp-explo-scale-x* curve2d-fast) +(define-extern *curve-torp-explo-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-daxter-missile-heathaze + :id 526 + :flags (sp0 sp4 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2065 :flags (sp7))) + ) + +(defpart 2065 + :init-specs ((:texture (glow level-default-sprite)) + (:num 20.0) + (:x (meters 0) (meters 0.3)) + (:z (meters -0.05)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0 64.0) + (:b 0.0 32.0) + (:a 64.0 64.0) + (:timer (seconds 0.017) (seconds 0.015)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'spt-func-relative-pos) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-nuke-water-wake + :id 527 + :flags (sp0 sp4 sp13) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 2066 :flags (sp7)) (sp-item 2067 :flags (sp7))) + ) + +(when (or (zero? *growing-curve-torpedo*) (!= loading-level global)) + (set! *growing-curve-torpedo* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *growing-curve-torpedo* 2 'loading-level (the-as int #f)) + ) + +(set! (-> *growing-curve-torpedo* pts data 0 first) 0.0) + +(set! (-> *growing-curve-torpedo* pts data 0 second) 1.0) + +(set! (-> *growing-curve-torpedo* pts data 1 first) 1.0) + +(set! (-> *growing-curve-torpedo* pts data 1 second) 10.0) + +(when (or (zero? *water-simple-alpha-curve-fade-out-torpedo*) (!= loading-level global)) + (set! *water-simple-alpha-curve-fade-out-torpedo* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *water-simple-alpha-curve-fade-out-torpedo* 2 'loading-level (the-as int #f)) + ) + +(set! (-> *water-simple-alpha-curve-fade-out-torpedo* pts data 0 first) 0.0) + +(set! (-> *water-simple-alpha-curve-fade-out-torpedo* pts data 0 second) 1.0) + +(set! (-> *water-simple-alpha-curve-fade-out-torpedo* pts data 1 first) 1.0) + +(set! (-> *water-simple-alpha-curve-fade-out-torpedo* pts data 1 second) 0.0) + +(when (or (zero? *color-curve-tan-brown-torpedo*) (!= loading-level global)) + (set! *color-curve-tan-brown-torpedo* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *color-curve-tan-brown-torpedo* 2 'loading-level (the-as uint #f)) + ) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 first) 0.0) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 second x) 1.0) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 second y) 1.171875) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 second z) 1.171875) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 second w) 0.5) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 first) 1.0) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 second x) 0.78125) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 second y) 1.015625) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 second z) 1.015625) + +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 second w) 0.5) + +(when (or (zero? *water-simple-alpha-curve-in-torpedo*) (!= loading-level global)) + (set! *water-simple-alpha-curve-in-torpedo* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *water-simple-alpha-curve-in-torpedo* 2 'loading-level (the-as int #f)) + ) + +(set! (-> *water-simple-alpha-curve-in-torpedo* pts data 0 first) 0.0) + +(set! (-> *water-simple-alpha-curve-in-torpedo* pts data 0 second) 0.0) + +(set! (-> *water-simple-alpha-curve-in-torpedo* pts data 1 first) 1.0) + +(set! (-> *water-simple-alpha-curve-in-torpedo* pts data 1 second) 1.0) + +(if (or (zero? *torpedo-wake-trail*) (!= loading-level global)) + (set! *torpedo-wake-trail* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *torpedo-wake-trail* color-mode) (the-as uint 0)) + +(set! (-> *torpedo-wake-trail* color-repeat-dist) 40960.0) + +(set! (-> *torpedo-wake-trail* alpha-1-mode) (the-as uint 1)) + +(set! (-> *torpedo-wake-trail* alpha-2-mode) (the-as uint 6)) + +(set! (-> *torpedo-wake-trail* base-alpha) 0.6) + +(set! (-> *torpedo-wake-trail* alpha-repeat-dist) 40960.0) + +(set! (-> *torpedo-wake-trail* width-mode) (the-as uint 1)) + +(set! (-> *torpedo-wake-trail* base-width) 10240.0) + +(set! (-> *torpedo-wake-trail* width-repeat-dist) 204800.0) + +(set! (-> *torpedo-wake-trail* uv-mode) (the-as uint 3)) + +(set! (-> *torpedo-wake-trail* uv-repeat-dist) 81920.0) + +(set! (-> *torpedo-wake-trail* lie-mode) (the-as uint 1)) + +(set! (-> *torpedo-wake-trail* max-age) (seconds 0.3)) + +(if #f + (set! (-> *torpedo-wake-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *torpedo-wake-trail* tex-id) (the-as uint #x500800)) + ) + +(set! (-> *torpedo-wake-trail* width-curve) *growing-curve-torpedo*) + +(set! (-> *torpedo-wake-trail* color-curve) *color-curve-tan-brown-torpedo*) + +(set! (-> *torpedo-wake-trail* alpha-curve-1) *water-simple-alpha-curve-in-torpedo*) + +(set! (-> *torpedo-wake-trail* alpha-curve-2) #f) + +(set! (-> *torpedo-wake-trail* zbuffer?) #f) + +(set! (-> *torpedo-wake-trail* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *torpedo-wake-trail* use-tape-mode?) #t) + +(set! (-> *torpedo-wake-trail* blend-mode) (the-as uint 0)) + +(set! (-> *torpedo-wake-trail* frame-stagger) (the-as uint 1)) + +(defpartgroup group-nuke-water-splash + :id 528 + :duration (seconds 5) + :flags (sp0 sp4 sp9) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 2068 :flags (sp7) :period (seconds 20) :length (seconds 0.1)) + (sp-item 2069 :flags (sp7) :period (seconds 20) :length (seconds 0.1)) + ) + ) + +(defpart 2068 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 60.0) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.01) (meters 0.033333335)) + (:vel-z (meters 0.23333333) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:accel-y (meters -0.0016666667)) + (:friction 0.97 0.02) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 2070) + (:conerot-x (degrees -10) (degrees -10)) + (:conerot-z (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2070 + :init-specs ((:friction 0.9)) + ) + +(defpart 2069 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 30.0) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:omega (degrees 0.09)) + (:vel-y (meters 0.01) (meters 0.033333335)) + (:vel-z (meters 0.2) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.97 0.02) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z)) + (:func 'spt-func-nuke-water-splash) + (:next-time (seconds 0.335)) + (:next-launcher 2071) + (:conerot-x (degrees -10) (degrees -10)) + (:conerot-z (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2071 + :init-specs ((:omega (degrees 0.1575)) (:friction 0.9)) + ) + +(defun spt-func-nuke-water-splash ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (sparticle-2d-spline-align-instant arg0 arg1 (the-as sprite-vec-data-2d arg2)) + (none) + ) + +(defpartgroup group-torpedo-explosion + :id 529 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2072 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2073 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2074 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2075 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2076 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2077 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +(defpart 2072 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2073 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2074 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2076 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2077 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-torp-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-torp-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 32.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 96.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-torp-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-torp-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-torp-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-torp-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 2.0 :z 2.5 :w 3.5) + :one-over-x-deltas (new 'static 'vector :x 2.5 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-torp-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 2.0 :z 2.5 :w 3.5) + :one-over-x-deltas (new 'static 'vector :x 2.5 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-torpedo-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2077 init-specs 16 initial-valuef) + (the-as float *part-torpedo-explosion-texture-curve-settings*) + ) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* color-start) *range-torp-explo-color*) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* alpha-start) *range-torp-explo-alpha*) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* scale-x-start) *range-torp-explo-scale-x*) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* scale-y-start) *range-torp-explo-scale-y*) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* a-scalar) *curve-torp-explo-alpha*) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* scale-x-scalar) *curve-torp-explo-scale-x*) + +(set! (-> *part-torpedo-explosion-texture-curve-settings* scale-y-scalar) *curve-torp-explo-scale-y*) + +(defpart 2075 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(deftype htorpedo (h-bike-c) + ((speed float) + (target-speed float) + (pitch float) + (target-pitch float) + (max-pitch float) + (roll float) + (target-roll float) + (turn-rate float) + (target-turn-rate float) + (ground-height float) + (ground-offset float) + (down-force float) + (want-jump? symbol) + (jump-state uint8 :offset 1360) + (on-water? symbol) + (cam-pitch float) + (cam-roll float) + (target-cam-roll float) + (based-cam-roll float) + (last-quat quaternion :inline) + (override-camera? symbol) + (under-water? symbol) + (next-bob-cam-time time-frame) + (thrust-sound sound-id) + (ground-sound sound-id) + (reverb-dest float) + (pitch-current float) + (ground-vol-current float) + (last-slice-val float) + (evasive-sound sound-id) + (evasive-volume float) + (stopping-evasive? symbol) + (spawn-splash? symbol) + (wake-sound sound-id) + (heat-haze sparticle-launch-control) + (last-land-speech-time time-frame) + (last-jump-speech-time time-frame) + ) + (:state-methods + undefined0 + hide + ) + (:methods + (htorpedo-method-164 () none) + (find-ground-height (_type_) float) + (htorpedo-method-166 (_type_ float) none) + (htorpedo-method-167 (_type_ float) float) + (htorpedo-method-168 (_type_ float) float) + (probe-ground (_type_ vector float) float) + (update-sound (_type_) none) + ) + ) + + +(defmethod find-ground-height ((this htorpedo)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((f1-0 225280.0) + (f2-0 8192.0) + (f0-0 1024.0) + ) + (set! (-> s5-0 start-pos quad) (-> this rbody position quad)) + (+! (-> s5-0 start-pos y) f2-0) + (vector-reset! (-> s5-0 move-dist)) + (set! (-> s5-0 move-dist y) (- (+ f2-0 f1-0))) + (let ((v1-6 s5-0)) + (set! (-> v1-6 radius) f0-0) + (set! (-> v1-6 collide-with) (collide-spec backgnd)) + (set! (-> v1-6 ignore-process0) this) + (set! (-> v1-6 ignore-process1) #f) + (set! (-> v1-6 ignore-pat) (-> this root pat-ignore-mask)) + (set! (-> v1-6 action-mask) (collide-action solid)) + ) + ) + (let ((v1-9 (>= (probe-using-line-sphere *collide-cache* s5-0) 0.0))) + (set! (-> this on-water?) #f) + (when (not v1-9) + (let ((s5-1 (new 'stack-no-clear 'water-info))) + (water-info-init! (-> this root) s5-1 (collide-action solid semi-solid)) + (cond + ((logtest? (water-flag over-water) (-> s5-1 flags)) + (set! (-> this ground-height) (-> s5-1 base-height)) + (set! (-> this on-water?) #t) + ) + (else + (set! (-> this ground-height) -40960000.0) + ) + ) + ) + (return 0.0) + ) + ) + (set! (-> this ground-height) (-> s5-0 best-other-tri intersect y)) + ) + ) + +(defmethod probe-ground ((this htorpedo) (arg0 vector) (arg1 float)) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> s4-0 start-pos) arg0 *up-vector* 24576.0) + (set! (-> s4-0 move-dist quad) (the-as uint128 0)) + (set! (-> s4-0 move-dist y) -49152.0) + (let ((v1-4 s4-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (if (>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (-> s4-0 best-other-tri intersect y) + (- (-> arg0 y) (-> this ground-offset)) + ) + ) + ) + +;; WARN: Function (method 166 htorpedo) has a return type of none, but the expression builder found a return statement. +(defmethod htorpedo-method-166 ((this htorpedo) (arg0 float)) + (set! (-> this target-pitch) 0.0) + (+ (-> this ground-height) (-> this ground-offset)) + (-> this rbody position y) + (when #t + (cond + ((< 0.0 (-> this down-force)) + (let* ((f1-3 (* 0.0000024414062 (-> this down-force))) + (f0-7 (fmax 0.0 (fmin 1.0 f1-3))) + ) + (set! (-> this target-pitch) (lerp 0.0 -7281.778 f0-7)) + ) + ) + (else + (let* ((f1-6 (* -0.0000024414062 (-> this down-force))) + (f0-11 (fmax 0.0 (fmin 1.0 f1-6))) + ) + (set! (-> this target-pitch) (lerp 0.0 7281.778 f0-11)) + ) + ) + ) + ) + (when (or (!= (-> this jump-state) 0) (-> this on-water?)) + (set! (-> this pitch) (lerp (-> this pitch) (-> this target-pitch) (* 2.0 arg0))) + (return 0) + ) + (let* ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (f30-0 32768.0) + (s3-0 (new 'stack-no-clear 'vector)) + (v1-16 s3-0) + (a0-7 (-> this rbody position)) + (a1-5 s4-0) + (a2-3 6144.0) + ) + (vector+float*! v1-16 a0-7 a1-5 a2-3) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (let* ((s2-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (* 0.5 f30-0))) + (s1-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (* -0.5 f30-0))) + (f28-0 (probe-ground this s2-1 a2-3)) + (f0-24 (probe-ground this s1-1 a2-3)) + ) + (set! (-> s2-1 y) f28-0) + (set! (-> s1-1 y) f0-24) + (let* ((f0-26 (- (+ f28-0 (-> this ground-offset)) (+ f0-24 (-> this ground-offset)))) + (f0-28 (asin (/ f0-26 f30-0))) + ) + (set! (-> this target-pitch) (- (fmax 0.0 f0-28))) + ) + ) + ) + (set! (-> this pitch) (lerp (-> this pitch) (-> this target-pitch) (* 30.0 arg0))) + (set! (-> this cam-pitch) (lerp (-> this cam-pitch) (-> this target-pitch) (* 3.0 arg0))) + 0 + (none) + ) + +(define PHYSICS_SCALAR 2.0) + +(defmethod htorpedo-method-167 ((this htorpedo) (arg0 float)) + (set! (-> this target-pitch) (* (-> this max-pitch) + (-> this controls lean-z) + (fabs (-> this controls lean-z)) + (fabs (-> this controls lean-z)) + ) + ) + (let ((f1-6 (+ 40960.0 (-> this flight-level))) + (f0-6 (+ -49152.0 (-> this flight-level))) + ) + 0.0 + (let* ((f2-2 (-> this rbody position y)) + (f3-1 (* 0.5 (+ f1-6 f0-6))) + (f1-8 (/ (- f1-6 f2-2) (- f1-6 f3-1))) + ) + 0.0 + 0.0 + (let* ((f0-8 (/ (- f2-2 f0-6) (- f3-1 f0-6))) + (f1-9 (fmin 1.0 f1-8)) + (f0-9 (fmin 1.0 f0-8)) + (f30-0 (- 1.0 (* (- 1.0 f1-9) (- 1.0 f1-9)))) + (f0-12 (- 1.0 (* (- 1.0 f0-9) (- 1.0 f0-9)))) + (f28-0 (lerp 0.0 (-> this max-pitch) f0-12)) + (f1-14 (lerp 0.0 (- (-> this max-pitch)) f30-0)) + ) + (set! (-> this target-pitch) (fmax (fmin (-> this target-pitch) f28-0) f1-14)) + (let ((f0-18 1.0)) + (if (or (< f28-0 0.0) (< 0.0 f1-14)) + (set! f0-18 2.0) + ) + (set! (-> this pitch) (lerp (-> this pitch) (-> this target-pitch) (* arg0 PHYSICS_SCALAR f0-18))) + ) + ) + ) + ) + ) + +(define *torpedo-speech-list* (new 'static 'inline-array talker-speech-class 5 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "dax563" + :channel (gui-channel daxter) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax564" + :channel (gui-channel daxter) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax566" + :channel (gui-channel daxter) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax578" + :channel (gui-channel daxter) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + ) + ) + +(define *torpedo-jump-speech* (new 'static 'boxed-array :type uint16 #x1 #x2 #x3)) + +(define *torpedo-land-speech* (new 'static 'boxed-array :type uint16 #x4)) + +(defmethod htorpedo-method-168 ((this htorpedo) (arg0 float)) + (set! (-> this spawn-splash?) #f) + (find-ground-height this) + (when (logtest? (-> this root status) (collide-status touch-wall)) + ) + (let ((f30-0 (+ (-> this ground-height) (-> this ground-offset))) + (f28-0 (-> this rbody position y)) + ) + (when (and (-> this next-state) (= (-> this next-state name) 'player-control)) + (when (and (-> this want-jump?) + (= (-> this jump-state) 0) + (time-elapsed? (the-as time-frame (the int (-> this jump-time))) (seconds 0.2)) + ) + (set! (-> this down-force) 368640.0) + (set! (-> this jump-state) (the-as uint 1)) + (set! (-> this jump-time) (the float (current-time))) + (set! (-> *target* pilot jumping?) #t) + ) + (when (= (-> this jump-state) 1) + (if (and (cpad-hold? 0 x) (not (time-elapsed? (the-as time-frame (the int (-> this jump-time))) (seconds 0.3)))) + (+! (-> this down-force) (* 245760.0 arg0)) + ) + (when (time-elapsed? (the-as time-frame (the int (-> this jump-time))) (seconds 0.3)) + (when (and (time-elapsed? (-> this last-jump-speech-time) (seconds 10)) + (time-elapsed? (-> this last-land-speech-time) (seconds 4)) + (not (logtest? (rand-uint31-gen *random-generator*) 1)) + (>= (fabs (-> this controls steering)) 1.0) + ) + (talker-spawn-func + (-> *torpedo-speech-list* + (-> *torpedo-jump-speech* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *torpedo-jump-speech* length)) + ) + ) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + (set-time! (-> this last-jump-speech-time)) + ) + (set! (-> *target* pilot jumping?) #f) + (set! (-> this jump-state) (the-as uint 2)) + ) + ) + (when (and (= (-> this jump-state) 2) (< (+ -12288.0 f28-0) f30-0)) + (set! (-> this jump-state) (the-as uint 0)) + (set! (-> this jump-time) (the float (current-time))) + ) + ) + (cond + ((< f30-0 f28-0) + (set! (-> this down-force) (- (-> this down-force) (* 737280.0 arg0))) + (set! (-> this under-water?) #f) + (when (< -8192.0 (-> this down-force)) + (if (< (+ f28-0 (* (-> this down-force) arg0)) f30-0) + (set! (-> this down-force) 0.0) + ) + ) + ) + (else + (if (not (-> this under-water?)) + (set! (-> this down-force) (* 0.6 (-> this down-force))) + ) + (set! (-> this under-water?) #t) + (when (zero? (-> this jump-state)) + (let ((f26-0 5.0)) + (when (not (-> this on-water?)) + (set! f26-0 10.0) + (when (< (-> this down-force) -204800.0) + (let* ((f1-11 (* -0.0000012207031 (-> this down-force))) + (f24-0 (fmax 0.0 (fmin 1.0 f1-11))) + ) + (cpad-set-buzz! + (-> *cpad-list* cpads 0) + 1 + (the int (* 255.0 (lerp 0.6 1.0 f24-0))) + (the-as time-frame (the int (* 120.0 f24-0))) + ) + (let ((f22-2 (fmin 1.0 (lerp 0.6 1.4 f24-0)))) + (sound-play-by-name + (static-sound-name "rocket-bounce") + (new-sound-id) + (the int (* 1024.0 f22-2)) + 0 + 0 + (sound-group) + #t + ) + ) + (when (and (time-elapsed? (-> this last-land-speech-time) (seconds 10)) + (time-elapsed? (-> this last-jump-speech-time) (seconds 4)) + (not (logtest? (rand-uint31-gen *random-generator*) 3)) + ) + (talker-spawn-func + (-> *torpedo-speech-list* + (-> *torpedo-land-speech* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *torpedo-land-speech* length)) + ) + ) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + (set-time! (-> this last-land-speech-time)) + ) + (if (< 0.2 f24-0) + (activate! *camera-smush-control* 819.2 45 75 1.0 0.9 (-> *display* camera-clock)) + ) + ) + ) + ) + (when (-> this on-water?) + (let ((f0-42 (* -0.0000012207031 (-> this down-force)))) + (if (< 0.1 f0-42) + (set! (-> this spawn-splash?) #t) + ) + ) + ) + (when (and (-> this on-water?) (>= (current-time) (-> this next-bob-cam-time))) + (let ((f0-44 (* -0.0000012207031 (-> this down-force)))) + (cond + ((< 0.2 f0-44) + (let ((f24-1 (fmax 0.0 (fmin 1.0 f0-44))) + (s4-6 (+ (logand 0 (rand-uint31-gen *random-generator*)) 450)) + ) + (set! (-> this next-bob-cam-time) (+ (current-time) (the-as time-frame s4-6))) + (activate! + *camera-smush-control* + (* 6553.6 (lerp 0.2 1.0 f24-1)) + (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 61) 180) + (the-as int s4-6) + 1.0 + 0.95 + (-> *display* camera-clock) + ) + ) + ) + (else + 300 + ) + ) + ) + ) + (let ((f1-22 (+ (* 80.0 (- f30-0 f28-0) f26-0) (* -5.0 (-> this down-force) f26-0)))) + (set! (-> this down-force) (+ (-> this down-force) (* arg0 f1-22))) + ) + ) + ) + ) + ) + ) + ) + +;; WARN: Function (method 31 htorpedo) has a return type of none, but the expression builder found a return statement. +(defmethod apply-gravity! ((this htorpedo) (arg0 float)) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'hide)) + (set! (-> this rbody lin-momentum quad) (the-as uint128 0)) + ) + ((and (-> this next-state) (= (-> this next-state name) 'waiting)) + (set! (-> this rbody lin-momentum quad) (the-as uint128 0)) + (return 0) + ) + ((not (and (-> this next-state) (= (-> this next-state name) 'player-control))) + (call-parent-method this arg0) + ) + (else + (update-sound this) + (cond + (#t + (htorpedo-method-168 this arg0) + (htorpedo-method-166 this arg0) + ) + (else + (htorpedo-method-167 this arg0) + ) + ) + (set! (-> this target-turn-rate) + (* 10922.667 (fabs (-> this controls steering)) (-> this controls steering) PHYSICS_SCALAR) + ) + (seek! (-> this speed) (-> this target-speed) (* 163840.0 (seconds-per-frame) PHYSICS_SCALAR)) + (set! (-> this turn-rate) (lerp (-> this turn-rate) (-> this target-turn-rate) (* 1.5 PHYSICS_SCALAR arg0))) + (set! (-> this target-roll) (* -0.5625 (-> this turn-rate))) + (seek! (-> this roll) (-> this target-roll) (* 10012.444 arg0 PHYSICS_SCALAR)) + (set! (-> this based-cam-roll) + (lerp (-> this based-cam-roll) (-> this target-turn-rate) (* PHYSICS_SCALAR arg0)) + ) + (set! (-> this target-cam-roll) (* -0.75 (/ 1.0 PHYSICS_SCALAR) (-> this based-cam-roll))) + (seek! (-> this cam-roll) (-> this target-cam-roll) (* 10012.444 arg0 PHYSICS_SCALAR)) + (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this last-quat))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (quaternion-look-at! (the-as quaternion (-> this rbody rot)) s3-0 *up-vector*) + (quaternion-rotate-y! + (the-as quaternion (-> this rbody rot)) + (the-as quaternion (-> this rbody rot)) + (* arg0 (-> this turn-rate)) + ) + (quaternion-rotate-local-x! + (the-as quaternion (-> this rbody rot)) + (the-as quaternion (-> this rbody rot)) + (-> this pitch) + ) + (vector-z-quaternion! s4-0 (the-as quaternion (-> this rbody rot))) + (vector-float*! (-> this rbody lin-momentum) s4-0 (* (-> this speed) (-> this info info mass))) + ) + (+! (-> this rbody lin-momentum y) (* 0.5 (-> this down-force) (-> this info info mass))) + (if (< (-> this rbody position y) -6144.0) + (set! (-> this rbody lin-momentum y) (fmax 0.0 (-> this rbody lin-momentum y))) + ) + (quaternion-rotate-local-z! + (the-as quaternion (-> this rbody rot)) + (the-as quaternion (-> this rbody rot)) + (-> this roll) + ) + (quaternion-copy! (-> this last-quat) (the-as quaternion (-> this rbody rot))) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-method-132 ((this htorpedo) (arg0 traffic-object-spawn-params)) + (set! (-> this speed) 0.0) + (set! (-> this target-speed) 286720.0) + (set! (-> this max-pitch) 3640.889) + (set! (-> this roll) 0.0) + (set! (-> this target-roll) 0.0) + (set! (-> this target-pitch) 0.0) + (set! (-> this pitch) 0.0) + (set! (-> this cam-pitch) 0.0) + (set! (-> this down-force) 0.0) + (set! (-> this ground-offset) 12288.0) + (quaternion-copy! (the-as quaternion (-> this rbody rot)) (-> this root quat)) + (quaternion-copy! (-> this last-quat) (the-as quaternion (-> this rbody rot))) + (go (method-of-object this idle)) + (none) + ) + +(defstate waiting (htorpedo) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('boost) + (set! (-> self target-speed) (+ (-> self target-speed) (the-as float (-> block param 0)))) + ) + (else + (vehicle-event-handler proc argc message block) + ) + ) + ) + :trans (behavior () + '() + ) + ) + +(defstate hide (htorpedo) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 2)) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defstate player-control (htorpedo) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('boost) + (+! (-> self target-speed) (the-as float (-> block param 0))) + (set! (-> self target-speed) (fmin 335872.0 (-> self target-speed))) + (format 0 "Current speed is ~f~%" (-> self target-speed)) + ) + (('hide) + (go-virtual hide) + ) + (else + (vehicle-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self speed) 0.0) + (set! (-> self jump-state) (the-as uint 2)) + (set! (-> self jump-time) 0.0) + (set! (-> *target* pilot jumping?) #f) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + ) + :post (behavior () + (control-hook-player self) + (vehicle-method-117 self) + ) + ) + +(defstate explode (htorpedo) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (dotimes (gp-0 (-> self info rider seat-count)) + (send-event + (handle->process (-> self rider-array gp-0)) + 'attack-invinc + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'instant-death) + ) + ) + ) + (put-rider-in-seat self gp-0 (the-as process #f)) + ) + (logior! (-> *target* draw status) (draw-control-status no-draw)) + (logior! (-> self focus-status) (focus-status dead)) + (set! (-> self crash-level) 3) + (set! (-> self force-level) 3) + (logclear! (-> self v-flags) (vehicle-flag persistent player-driving net-player-driving)) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag lights-dead) (-> self v-flags)))) + (vehicle-method-126 self) + (sound-play "rocket-explode") + (vehicle-method-106 self) + (vehicle-method-100 self) + (sound-stop (-> self thrust-sound)) + (sound-stop (-> self ground-sound)) + (sound-stop (-> self evasive-sound)) + (sound-stop (-> self wake-sound)) + (let ((v1-45 + (cond + ((logtest? (-> *part-group-id-table* 529 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 529)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 529)) + ) + ) + ) + ) + (send-event (ppointer->process v1-45) 'clock self) + ) + (go-virtual die) + ) + ) + +(define *h-torpedo-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 50.0 + :inv-mass 0.02 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-torpedo-constants* + :flags #x400 + :object-type (traffic-type civilian-bike-c) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 17294.223 + :max-fov 18204.445 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 3640.889 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :thruster-flame-width (meters 0.25) + :thruster-flame-length (meters 4) + :thruster-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :exhaust-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :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 :w 1.0) (new 'static 'vector :w 1.0)) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 60.0 + :inv-hit-points 0.016666668 + :hit-threshold 122880.0 + :hit-small 122880.0 + :hit-big 122880.0 + :hit-deadly 122880.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 8192.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 8192.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y -327.68 :z 1318.912 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(set! (-> *h-torpedo-constants* explosion) *h-bike-explosion-info*) + +(defskelgroup skel-h-torpedo cty-dax-missile cty-dax-missile-lod0-jg cty-dax-missile-idle-ja + ((cty-dax-missile-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.4) + :origin-joint-index 3 + ) + +(deftype light-trail-tracker-torpedo (light-trail-tracker) + () + ) + + +(defmethod light-trail-tracker-method-17 ((this light-trail-tracker-torpedo) (arg0 process-focusable)) + (let ((v1-0 arg0)) + (and (-> (the-as htorpedo v1-0) on-water?) (< (-> v1-0 root trans y) 20480.0)) + ) + ) + +(defmethod light-trail-tracker-method-16 ((this light-trail-tracker-torpedo) (arg0 process-focusable) (arg1 vector)) + (let ((v1-0 arg0)) + (when v1-0 + (set! (-> arg1 quad) (-> v1-0 root trans quad)) + (set! (-> arg1 y) 4505.6) + (vector+float*! arg1 arg1 (-> v1-0 node-list data 0 bone transform fvec) 49152.0) + ) + ) + arg1 + ) + +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod init-rbody-control! ((this htorpedo)) + (with-pp + (set! (-> pp level) (level-get *level* 'lctypatk)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-torpedo" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this override-camera?) #f) + (logior! (-> *h-torpedo-constants* flags) 1024) + (alloc-rbody-control! this *h-torpedo-constants*) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this thrust-sound) (new-sound-id)) + (set! (-> this ground-sound) (new-sound-id)) + (set! (-> this evasive-sound) (new-sound-id)) + (set! (-> this wake-sound) (new-sound-id)) + (set! (-> this heat-haze) (create-launch-control (-> *part-group-id-table* 526) this)) + (let* ((s5-1 (-> this heat-haze)) + (s4-1 (method-of-object s5-1 set-local-space-info)) + (s3-0 (add-connection *part-local-space-engine* this local-space-proc-joint 0 0 0)) + ) + (let ((v1-19 (process->handle this))) + (if (= v1-19 #f) + (set! v1-19 (process->handle this)) + ) + (set! (-> (the-as particle-local-space-info s3-0) hand) (the-as handle v1-19)) + ) + (matrix-identity! (-> (the-as particle-local-space-info s3-0) mat-new)) + (matrix-identity! (-> (the-as particle-local-space-info s3-0) mat-prev)) + (set! (-> (the-as particle-local-space-info s3-0) flags) (part-local-space-flags)) + (s4-1 s5-1 (the-as particle-local-space-info s3-0)) + ) + (let ((s5-2 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> s5-2 tracked-obj) (process->handle this)) + (set! (-> s5-2 appearance) *torpedo-wake-trail*) + (set! (-> s5-2 max-num-crumbs) (the int (* 0.5 (the float (-> s5-2 appearance max-age))))) + (set! (-> s5-2 track-immediately?) #t) + (let* ((v1-34 (estimate-light-trail-mem-usage + (the-as uint (-> s5-2 max-num-crumbs)) + (the-as uint (= (-> s5-2 appearance lie-mode) 3)) + ) + ) + (s4-2 (get-process *default-dead-pool* light-trail-tracker-torpedo (+ v1-34 8192) 1)) + ) + (when s4-2 + (let ((t9-15 (method-of-type process activate))) + (t9-15 s4-2 this "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-2 light-trail-tracker-init-by-other s5-2) + (-> s4-2 ppointer) + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod vehicle-method-88 ((this htorpedo) (arg0 vehicle-controls)) + (call-parent-method this arg0) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag camera-look-mode) (-> this v-flags)))) + (if (cpad-pressed? 0 x) + (set! (-> this want-jump?) #t) + (set! (-> this want-jump?) #f) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 78 htorpedo) has a return type of none, but the expression builder found a return statement. +(defmethod vehicle-method-78 ((this htorpedo)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'player-control))) + (return 0) + ) + (when (and (-> this on-water?) (= (-> this jump-state) 0)) + ) + (when (-> this spawn-splash?) + (if (logtest? (-> *part-group-id-table* 528 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 528) + :target this + :mat-joint (the-as object 0) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 528) + :target this + :mat-joint (the-as object 0) + ) + ) + (sound-play "rocket-splash") + (set! (-> this spawn-splash?) #f) + ) + (if (and (-> this on-water?) (< (-> this root trans y) 20480.0)) + (sound-play "rocket-wake" :id (-> this wake-sound)) + (sound-stop (-> this wake-sound)) + ) + (spawn-from-mat (-> this heat-haze) (-> this node-list data 0 bone transform)) + (none) + ) + +;; WARN: Return type mismatch number vs none. +;; WARN: Function (method 94 htorpedo) has a return type of none, but the expression builder found a return statement. +(defmethod vehicle-method-94 ((this htorpedo)) + (if (-> this override-camera?) + (return 0) + ) + 0.0 + (let ((a0-1 *camera*)) + (when a0-1 + (let ((a0-2 (-> a0-1 slave))) + (if a0-2 + (-> a0-2 0 saved-pt y) + ) + ) + ) + ) + (call-parent-method this) + (when (logtest? (vehicle-flag camera-look-mode) (-> this v-flags)) + (let ((gp-0 *camera*)) + (when gp-0 + (let ((s3-0 (-> gp-0 slave))) + (when s3-0 + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let ((s1-0 (new 'stack-no-clear 'quaternion)) + (s2-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (the-as quaternion (-> this rbody rot)))) + ) + (set! (-> s2-0 y) 0.0) + (vector-normalize! s2-0 1.0) + (quaternion-look-at! s1-0 s2-0 *up-vector*) + (quaternion-rotate-local-x! s1-0 s1-0 (-> this cam-pitch)) + (quaternion-rotate-local-z! s1-0 s1-0 (-> this cam-roll)) + (quaternion-normalize! s1-0) + (quaternion->matrix s5-0 s1-0) + (set! (-> s5-0 trans quad) (-> this rbody matrix trans quad)) + (vector-matrix*! (-> s3-0 0 saved-pt) (the-as vector (-> this info camera look-pos-array)) s5-0) + (vector+float*! (-> s3-0 0 saved-pt) (-> s3-0 0 saved-pt) s2-0 0.0) + ) + (let ((v1-18 (-> s3-0 0 tracking))) + (set! (-> v1-18 inv-mat rvec quad) (-> s5-0 rvec quad)) + (set! (-> v1-18 inv-mat uvec quad) (-> s5-0 uvec quad)) + (set! (-> v1-18 inv-mat fvec quad) (-> s5-0 fvec quad)) + ) + ) + (set! (-> gp-0 slave 0 saved-pt y) (fmax 6144.0 (-> gp-0 slave 0 saved-pt y))) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod rbody-event-handler ((this htorpedo) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (with-pp + (when (= arg2 'pilot-on) + (nop!) + 0 + ) + (case arg2 + (('attack) + (if (not (and (-> this next-state) (= (-> this next-state name) 'player-control))) + (return #f) + ) + (call-parent-method this arg0 arg1 arg2 arg3) + ) + (('hide) + (set! v0-0 (logior (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('show) + (set! v0-0 (logclear (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('touch 'touched) + (cond + ((or (type? arg0 krimson-wall) (type? arg0 blocking-plane)) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer pp)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'nuke-hit) + (set! (-> a1-6 param 0) (the-as uint #t)) + (let ((t9-4 send-event-function) + (v1-23 (-> *game-info* sub-task-list (game-task-node city-port-attack-resolution))) + ) + (t9-4 + (handle->process (if (-> v1-23 manager) + (-> v1-23 manager manager) + (the-as handle #f) + ) + ) + a1-6 + ) + ) + ) + ) + ((type? arg0 crimson-guard) + (sound-play "crims-nuke-hit") + ) + ) + (call-parent-method this arg0 arg1 arg2 arg3) + ) + (('allow-dismount) + (set! v0-0 (logand -1025 (-> *h-torpedo-constants* flags))) + (set! (-> *h-torpedo-constants* flags) (the-as uint v0-0)) + v0-0 + ) + (('override-camera) + (set! v0-0 (-> arg3 param 0)) + (set! (-> this override-camera?) (the-as symbol v0-0)) + v0-0 + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +(defmethod init-collision! ((this htorpedo)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (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 action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 13312.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 4505.6 4300.8) + (set! (-> v1-11 nav-radius) 7577.6) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 9011.2 3686.4) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod update-sound ((this htorpedo)) + (let ((f30-0 0.0)) + (set! f30-0 (cond + ((not (-> this on-water?)) + (let ((f30-1 (- (-> this root trans y) (-> this ground-height)))) + 0.0 + (let* ((f1-3 (* 0.000061035156 (+ -12288.0 f30-1))) + (f0-4 (fmax 0.0 (fmin 1.0 f1-3))) + (f0-5 (- 1.0 f0-4)) + (f0-6 (lerp 0.0 0.15 f0-5)) + ) + (seek! (-> this reverb-dest) f0-6 (* 2.0 (seconds-per-frame))) + ) + (let* ((f1-10 (* 0.000013563368 (+ -12288.0 f30-1))) + (f0-12 (fmax 0.0 (fmin 1.0 f1-10))) + ) + (- 1.0 f0-12) + ) + ) + ) + (else + (seek! (-> this reverb-dest) 0.0 (* 0.1 (seconds-per-frame))) + f30-0 + ) + ) + ) + (if (< f30-0 (-> this ground-vol-current)) + (seek! (-> this ground-vol-current) f30-0 (* 0.4 (seconds-per-frame))) + (seek! (-> this ground-vol-current) f30-0 (* 5.4 (seconds-per-frame))) + ) + ) + (let* ((f0-27 (* 0.00000012207032 (-> this rbody lin-momentum y))) + (f0-29 (fmax -1.0 (fmin 1.0 f0-27))) + (f0-30 (* 0.5 f0-29)) + ) + (if (< f0-30 (-> this pitch-current)) + (seek! (-> this pitch-current) f0-30 (* 0.25 (seconds-per-frame))) + (seek! (-> this pitch-current) f0-30 (* 4.0 (seconds-per-frame))) + ) + ) + (let* ((f1-25 (* 0.00000012207032 (-> this rbody lin-momentum y))) + (f30-2 (fmax 0.0 (fmin 1.0 f1-25))) + ) + (sound-play-by-name + (static-sound-name "rocket-ground") + (-> this ground-sound) + (the int (* 1024.0 (-> this ground-vol-current))) + 0 + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "rocket-thrust") + (-> this thrust-sound) + (the int (* 1024.0 (lerp 0.75 1.0 f30-2))) + (the int (* 1524.0 (-> this pitch-current))) + 0 + (sound-group) + #t + ) + ) + (let ((f0-49 (if (< 0.0 (-> this controls steering)) + 1.0 + -1.0 + ) + ) + (f30-3 0.0) + ) + (let ((f1-30 (-> this controls steering))) + (set! f30-3 (cond + ((!= (-> this last-slice-val) 0.0) + (let ((f1-32 (fabs (- (-> this last-slice-val) f1-30)))) + (cond + ((< 1.0 f1-32) + (set! (-> this last-slice-val) 0.0) + f30-3 + ) + (else + (set! (-> this last-slice-val) f0-49) + (lerp 1.0 0.0 f1-32) + ) + ) + ) + ) + (else + (when (< 0.15 (fabs f1-30)) + (set! (-> this last-slice-val) f0-49) + (set! f30-3 1.0) + ) + f30-3 + ) + ) + ) + ) + (cond + ((< 0.0 f30-3) + (let ((f28-1 (lerp 0.0 1.0 f30-3)) + (f30-4 (lerp 0.0 0.2 f30-3)) + ) + (let ((f0-53 (- 1.0 (* (- 1.0 f28-1) (- 1.0 f28-1))))) + (if (< (-> this evasive-volume) f0-53) + (set! (-> this evasive-volume) f0-53) + (seek! (-> this evasive-volume) f0-53 (seconds-per-frame)) + ) + ) + (sound-play-by-name + (static-sound-name "rocket-slice") + (-> this evasive-sound) + (the int (* 1024.0 (-> this evasive-volume))) + (the int (* 1524.0 f30-4)) + 0 + (sound-group) + #t + ) + ) + ) + (else + (seek! (-> this evasive-volume) 0.0 (seconds-per-frame)) + (sound-stop (-> this evasive-sound)) + ) + ) + ) + (set-setting! 'sound-reverb 'abs (-> this reverb-dest) 0) + (none) + ) + +(defmethod vehicle-method-129 ((this htorpedo)) + (when (and (logtest? (vehicle-flag player-driving) (-> this v-flags)) *target* (!= (-> this crash-level) 3)) + (if (focus-test? *target* pilot-riding) + (vehicle-method-134 this) + ) + ) + 0 + (none) + ) + +(defmethod deactivate ((this htorpedo)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this heat-haze)) + (kill-particles (-> this heat-haze)) + ) + (call-parent-method this) + (none) + ) + +(defmethod relocate ((this htorpedo) (offset int)) + (if (nonzero? (-> this heat-haze)) + (&+! (-> this heat-haze) offset) + ) + (call-parent-method this offset) + ) + +(defmethod rigid-body-object-method-38 ((this htorpedo)) + 0 + (none) + ) + +(defmethod attack-handler ((this htorpedo) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + (local-vars (v0-0 symbol)) + (cond + ((logtest? (penetrate jak-dark-nuke) arg3) + (return #f) + v0-0 + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) diff --git a/goal_src/jak3/levels/city/port/ctyport-part.gc b/goal_src/jak3/levels/city/port/ctyport-part.gc index f1c6c57088..07f9fd07cd 100644 --- a/goal_src/jak3/levels/city/port/ctyport-part.gc +++ b/goal_src/jak3/levels/city/port/ctyport-part.gc @@ -5,5 +5,2671 @@ ;; name in dgo: ctyport-part ;; dgos: CPO +(define-extern reset-marquee-color! (function none)) +(define-extern add-marquee-color! (function float float float none)) +(define-extern *range-color-rubble-flame* curve-color-fast) +(define-extern *range-alpha-rubble-flame* curve2d-fast) +(define-extern *range-scale-rubble-flame-x* curve2d-fast) +(define-extern *range-scale-rubble-flame-y* curve2d-fast) +(define-extern *r-curve-rubble-flame* curve2d-fast) +(define-extern *g-curve-rubble-flame* curve2d-fast) +(define-extern *b-curve-rubble-flame* curve2d-fast) +(define-extern *curve-alpha-rubble-flame* curve2d-fast) +(define-extern *curve-scale-rubble-flame-x* curve2d-fast) +(define-extern *curve-scale-rubble-flame-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-ctyport-roundvent + :id 1030 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3763 :fade-after (meters 250) :falloff-to (meters 180) :flags (sp7))) + ) + +(defpartgroup group-ctyport-roundvent-small + :id 1031 + :flags (sp4 sp7) + :bounds (static-bspherem 0 0 0 12) + :scale (0.625 0.625 0.625) + :parts ((sp-item 3763 :fade-after (meters 250) :falloff-to (meters 150) :flags (sp7))) + ) + +(defpart 3763 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -2) (meters 4)) + (:y (meters -1.5) 3 (meters 1.5)) + (:z (meters -2) (meters 1)) + (:scale-x (meters 4) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-y (meters -0.083333336) (meters -0.016666668)) + (:vel-z (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668) (meters 0.023333333)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00083333335) (meters 0.00083333335)) + (:friction 0.95 0.025) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3764) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3764 + :init-specs ((:fade-a -0.16 -0.16)) + ) + +(defpartgroup group-ctyport-low-vent + :id 1032 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3765 :fade-after (meters 200) :falloff-to (meters 140) :flags (sp7)) + (sp-item 3766 :fade-after (meters 200) :falloff-to (meters 140) :flags (sp7)) + (sp-item 3767 :fade-after (meters 200) :falloff-to (meters 140) :flags (sp7)) + ) + ) + +(defpart 3765 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0 1.0) + (:x (meters -0.1) 9829 (meters 0.00024414062)) + (:y (meters 0.6) (meters 0.7)) + (:z (meters 1.6)) + (:scale-x (meters 0.75) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.005)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3768) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 45)) + ) + ) + +(defpart 3766 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0 1.0) + (:x (meters -1.2) 9829 (meters 0.00024414062)) + (:y (meters 0.6) (meters 0.7)) + (:z (meters 1.1)) + (:scale-x (meters 0.75) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.005)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3768) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3767 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0 1.0) + (:x (meters -2.3) 9829 (meters 0.00024414062)) + (:y (meters 0.6) (meters 0.7)) + (:z (meters 1.6)) + (:scale-x (meters 0.75) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.005)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3768) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees -45)) + ) + ) + +(defpart 3768 + :init-specs ((:fade-a -0.032 -0.032)) + ) + +(defpartgroup group-ctyport-waterspout + :id 1033 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3769 :fade-after (meters 140) :falloff-to (meters 120) :flags (sp7)) + (sp-item 3770 :fade-after (meters 100) :falloff-to (meters 80) :flags (sp7)) + ) + ) + +(defpart 3771 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 3.0 1.0) + (:x (meters -0.05) (meters 0.1)) + (:y (meters -0.05) (meters 0.1)) + (:z (meters -0.5)) + (:scale-x (meters 0.35) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3772) + (:launchrot-x (degrees -7.0000005) (degrees 14.000001)) + (:launchrot-y (degrees -7.0000005) (degrees 14.000001)) + ) + ) + +(defpart 3772 + :init-specs ((:r 255.0) (:g 128.0) (:b 64.0) (:next-time (seconds 0.017)) (:next-launcher 3773)) + ) + +(defpart 3773 + :init-specs ((:r 128.0) (:g 64.0) (:b 32.0) (:next-time (seconds 0) (seconds 0.747)) (:next-launcher 3772)) + ) + +(defun check-drop-level-ctyport-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (< (-> arg2 y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 3774) s3-0) + (launch-particles (-> *part-id-table* 3775) s3-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 3776) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 arg2) + (none) + ) + +(defpart 3769 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 1.0) + (:x (meters -0.05) (meters 0.1)) + (:y (meters -0.05) (meters 0.1)) + (:z (meters -0.5)) + (:scale-x (meters 0.35) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-ctyport-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3772) + (:launchrot-x (degrees -7.0000005) (degrees 14.000001)) + (:launchrot-y (degrees -7.0000005) (degrees 14.000001)) + ) + ) + +(defpart 3770 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.35) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-ctyport-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3772) + (:launchrot-x (degrees -15) (degrees 30)) + (:launchrot-y (degrees -15) (degrees 30)) + ) + ) + +(defpart 3774 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.25) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.0675)) + (:vel-y (meters 0.026666667) (meters 0.026666667)) + (:fade-a -0.21333334) + (:accel-y (meters -0.002) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3772) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3775 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -2) (meters 4)) + (:y (meters 0.25) (meters 0.75)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 8) (meters 0.3)) + (:scale-y (meters 4) (meters 0.3)) + (:r 64.0 64.0) + (:g 32.0 32.0) + (:b 16.0) + (:a 0.0) + (:vel-y (meters 0)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-y (meters 0) (meters 0.00006666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.2) (seconds 0.047)) + (:next-launcher 3777) + ) + ) + +(defpart 3777 + :init-specs ((:fade-a -0.21333334)) + ) + +(defpart 3776 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 1.0) + (:y (meters -0.2)) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 32.0 32.0) + (:b 16.0 16.0) + (:a 96.0 32.0) + (:vel-y (meters 0) (meters -0.006666667)) + (:scalevel-x (meters 0.026666667) (meters 0.013333334)) + (:scalevel-y (meters 0.026666667) (meters 0.013333334)) + (:fade-a -0.96 -0.96) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-ctyport-chimney + :id 1034 + :flags (sp8) + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 3778 :fade-after (meters 950) :falloff-to (meters 950)) + (sp-item 3779 :fade-after (meters 900) :flags (sp6)) + ) + ) + +(defpart 3779 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 20263.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpart 3778 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3780) + ) + ) + +(defpart 3780 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3781)) + ) + +(defpart 3781 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3782) + ) + ) + +(defpart 3782 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3783) + ) + ) + +(defpart 3783 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +(defpartgroup group-ctyport-chimney-smoke + :id 1035 + :flags (sp8) + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3784 :fade-after (meters 950) :falloff-to (meters 950))) + ) + +(defpart 3784 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3785) + ) + ) + +(defpart 3785 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3786) + ) + ) + +(defpart 3786 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-ctyport-drip + :id 1036 + :duration (seconds 0.017) + :flags (sp0 sp4 sp6) + :bounds (static-bspherem 0 -12 0 24) + :rotate ((degrees 0) (degrees 180) (degrees 0)) + :parts ((sp-item 3787 :fade-after (meters 160) :falloff-to (meters 60) :flags (sp7))) + ) + +(defpart 3787 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 0.1) + (:y (meters 0.3)) + (:z (meters -0.45)) + (:scale-x (meters 0.3) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.03375)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-ctyport-drop-userdata) + (:next-time (seconds 0) (seconds 1.997)) + (:next-launcher 3788) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3788 + :init-specs ((:accel-y (meters -0.0013333333)) (:friction 0.0)) + ) + +(defpartgroup group-ctyport-blue-floor-vent + :id 1037 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3789 :fade-after (meters 200) :flags (sp6)) + (sp-item 3790 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +(defpart 3789 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 12)) + (:rot-x (degrees 67.5)) + (:scale-y (meters 24)) + (:r 32.0) + (:g 192.0 16.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 3790 + :init-specs ((:num 0.5) + (:x (meters 1) (meters 2.5)) + (:rot-x 7) + (:r 4096.0) + (:g 3072.0) + (:b 2867.2) + (:vel-y (meters 0.016666668) (meters 0.006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3791) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3791 + :init-specs ((:fade-b 1.3653333)) + ) + +(defpartgroup group-ctyport-blue-floor-vent-small + :id 1038 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3792 :fade-after (meters 200) :flags (sp6)) + (sp-item 3793 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +(defpart 3792 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 8)) + (:rot-x (degrees 67.5)) + (:scale-y (meters 16)) + (:r 32.0) + (:g 192.0 16.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 3793 + :init-specs ((:num 0.5) + (:x (meters -2) (meters 4)) + (:rot-x 7) + (:r 2457.6) + (:g 1843.2) + (:b 1720.32) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3791) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-ctyport-red-big-lights-1 + :id 1039 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +(defpartgroup group-ctyport-red-big-lights-2 + :id 1040 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200)) + ) + +(defpartgroup group-ctyport-red-big-lights-3 + :id 1041 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400)) + ) + +(defpartgroup group-ctyport-red-big-lights-4 + :id 1042 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600)) + ) + +(defpartgroup group-ctyport-red-big-lights-5 + :id 1043 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800)) + ) + +(defpartgroup group-ctyport-red-big-lights-6 + :id 1044 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000) + ) + ) + +(defpart 3794 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 27015.748)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3795) + ) + ) + +(defpart 3795 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 3796) + ) + ) + +(defpart 3796 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 3797) + ) + ) + +(defpart 3797 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +(defpartgroup group-ctyport-blue-big-lights-1 + :id 1045 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +(defpartgroup group-ctyport-blue-big-lights-2 + :id 1046 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200)) + ) + +(defpartgroup group-ctyport-blue-big-lights-3 + :id 1047 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400)) + ) + +(defpartgroup group-ctyport-blue-big-lights-4 + :id 1048 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600)) + ) + +(defpartgroup group-ctyport-blue-big-lights-5 + :id 1049 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800)) + ) + +(defpartgroup group-ctyport-blue-big-lights-6 + :id 1050 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000) + ) + ) + +(defpart 3798 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 0.0) + (:g 128.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 27015.748)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3795) + ) + ) + +(defpartgroup group-ctyport-red-lights + :id 1051 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3799 :fade-after (meters 80) :flags (sp6)) (sp-item 3800 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3799 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 32.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 3800 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-ctyport-blue-lights + :id 1052 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3801 :fade-after (meters 80) :flags (sp6)) (sp-item 3802 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3801 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.05)) + (:scale-x (meters 1.4) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 3802 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-ctyport-long-blue-lights + :id 1053 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3803 :fade-after (meters 60) :flags (sp6 sp7)) + (sp-item 3804 :fade-after (meters 100) :flags (sp6 sp7)) + (sp-item 3805 :fade-after (meters 60) :flags (sp6 sp7)) + (sp-item 3806 :fade-after (meters 100) :flags (sp6 sp7)) + (sp-item 3807 :fade-after (meters 60) :flags (sp6 sp7)) + (sp-item 3808 :fade-after (meters 100) :flags (sp6 sp7)) + ) + ) + +(defpart 3803 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters 1.5)) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3804 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters 1.5)) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3805 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3806 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3807 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters -1.5)) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3808 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters -1.5)) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctyport-green-lights + :id 1054 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3809 :fade-after (meters 100) :flags (sp6)) (sp-item 3810 :fade-after (meters 140) :flags (sp6))) + ) + +(defpart 3809 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.4)) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y (meters 3) (meters 0.1)) + (:r 0.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 24.0 4.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 3810 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.05)) + (:scale-x (meters 6.5) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y (meters 12) (meters 0.1)) + (:r 0.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 8.0) + (:omega (degrees 3165.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-ctyport-green-lights-2 + :id 1055 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3811 :fade-after (meters 100) :flags (sp6)) (sp-item 3812 :fade-after (meters 140) :flags (sp6))) + ) + +(defpart 3811 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.1)) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y (meters 2) (meters 0.1)) + (:r 0.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 24.0 4.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +(defpart 3812 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.01)) + (:scale-x (meters 4.3) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y (meters 8) (meters 0.1)) + (:r 0.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 6.0) + (:omega (degrees 3165.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +(defpartgroup group-ctyport-sign-arrows-8x4 + :id 1056 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3813 :flags (is-3d sp3 sp7)) + (sp-item 3814 :flags (is-3d sp3 sp7)) + (sp-item 3815 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3813 + :init-specs ((:texture (sign-arrows ctyport-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x10c00e00 -2139062144 0 1 #x10c00e00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3814 + :init-specs ((:texture (sign-arrows ctyport-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x10c00e00 -2139062144 0 1 #x10c00e00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(define *hiphog-exterior-marquee* + (the-as (array (array object)) + (new 'static 'boxed-array :type object + (the binteger 25) + (new 'static 'boxed-array :type object (the binteger 1) (new 'static 'vector4w :x #x1ffffff)) + (new 'static 'boxed-array :type object (the binteger 1) (new 'static 'vector4w)) + (new 'static 'boxed-array :type object + (the binteger 5) + (new 'static 'vector4w) + (new 'static 'vector4w :x #x1000001) + (new 'static 'vector4w :x #x1800003) + (new 'static 'vector4w :x #x1c00007) + (new 'static 'vector4w :x #x1e0000f) + (new 'static 'vector4w :x #x1f0001f) + (new 'static 'vector4w :x #x1f8003f) + (new 'static 'vector4w :x #x1fc007f) + (new 'static 'vector4w :x #x1fe00ff) + (new 'static 'vector4w :x #x1ff01ff) + (new 'static 'vector4w :x #x1ff83ff) + (new 'static 'vector4w :x #x1ffc7ff) + (new 'static 'vector4w :x #x1ffcfff) + (new 'static 'vector4w :x #x1ffffff) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'vector4w) + (new 'static 'vector4w :x #x3000) + (new 'static 'vector4w :x #x7800) + (new 'static 'vector4w :x #xcc00) + (new 'static 'vector4w :x #xc600) + (new 'static 'vector4w :x #x18300) + (new 'static 'vector4w :x #x30180) + (new 'static 'vector4w :x #x600c0) + (new 'static 'vector4w :x #xc0060) + (new 'static 'vector4w :x #x180030) + (new 'static 'vector4w :x #x300018) + (new 'static 'vector4w :x #x60000c) + (new 'static 'vector4w :x #xc00006) + (new 'static 'vector4w :x #x1800003) + (new 'static 'vector4w :x #x1000001) + (new 'static 'vector4w) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'vector4w :x #x8008) + (new 'static 'vector4w :x #x200100) + (new 'static 'vector4w :x #x4002) + (new 'static 'vector4w :x #x420400) + (new 'static 'vector4w :x #x80040) + (new 'static 'vector4w :x #x802004) + (new 'static 'vector4w :x #x100800) + (new 'static 'vector4w :x #x1010020) + (new 'static 'vector4w :x #x40081) + (new 'static 'vector4w :x #x1210) + ) + (new 'static 'boxed-array :type object + (the binteger 5) + (new 'static 'vector4w) + (new 'static 'vector4w :x 64) + (new 'static 'vector4w :x #xe0) + (new 'static 'vector4w :x #x1f0) + (new 'static 'vector4w :x #x3f8) + (new 'static 'vector4w :x #x7fc) + (new 'static 'vector4w :x #xffe) + (new 'static 'vector4w :x #x1fff) + (new 'static 'vector4w :x #x1fff) + ) + (new 'static 'boxed-array :type object + (the binteger 5) + (new 'static 'vector4w :x #x222000) + (new 'static 'vector4w :x #x444000) + (new 'static 'vector4w :x #x888000) + (new 'static 'vector4w :x #x1110000) + ) + (new 'static 'boxed-array :type object + (the binteger 15) + (new 'static 'vector4w :x #x1ffe000) + (new 'static 'vector4w :x #x1fff) + ) + ) + ) + ) + +(defun ctyport-sparticle-mode-animate ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let ((a0-1 (-> arg1 key)) + (v1-0 (the-as object (-> arg1 user-float))) + ) + (when (nonzero? (the-as float v1-0)) + (let ((a1-2 (-> (the-as (array symbol) v1-0) 0 value))) + (when (nonzero? a1-2) + (let* ((a1-4 + (the-as + object + (-> (the-as + (pointer uint32) + (+ (* (min (the-as int (+ (-> a0-1 state-mode 0) 1)) (+ (-> (the-as (array int32) a1-2) length) -1)) 4) + (the-as int a1-2) + ) + ) + 3 + ) + ) + ) + (a1-5 + (-> (the-as + (array int32) + (+ (* (+ (mod + (the-as int (/ (-> a0-1 state-counter) (the-as uint (/ (-> (the-as (array int32) a1-4) 0) 8)))) + (+ (-> (the-as (array int32) a1-4) length) -1) + ) + 1 + ) + 4 + ) + (the-as uint a1-4) + ) + ) + 0 + ) + ) + (a0-9 (/ (-> (the-as (array int32) v1-0) 1) 8)) + (a1-7 (-> (the-as (pointer uint64) (+ a1-5 (the-as int (* (/ a0-9 64) 8)))) 0)) + (s3-1 (logtest? a1-7 (ash 1 (logand a0-9 63)))) + (s4-0 (if s3-1 + (-> (the-as (pointer int32) v1-0) 6) + (-> (the-as (pointer int32) v1-0) 5) + ) + ) + ) + (if (= a0-9 24) + (reset-marquee-color!) + ) + (cond + (s3-1 + (set! (-> arg2 r-g-b-a x) (rand-vu-float-range 64.0 192.0)) + (add-marquee-color! 0.044375 0.03 0.0) + ) + (else + (set! (-> arg2 r-g-b-a x) (rand-vu-float-range 32.0 48.0)) + ) + ) + (set! (-> arg2 r-g-b-a y) (-> arg2 r-g-b-a x)) + (set! (-> arg2 r-g-b-a z) (-> arg2 r-g-b-a x)) + (if (nonzero? s4-0) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id s4-0)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpartgroup group-ctyport-hiphog-marquee-daxter + :id 1057 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 24) + :rotate ((degrees 0) (degrees -88.7) (degrees 0)) + :parts ((sp-item 3816 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3817 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3818 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3819 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3820 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3821 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3822 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3823 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3824 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3825 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3826 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3827 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3828 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3829 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3830 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3831 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3832 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3833 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3834 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3835 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3836 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3837 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3838 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3839 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3840 :flags (is-3d sp3 sp6 sp7)) + ) + ) + +(defpart 3816 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + 0 + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -54.000004)) + ) + ) + +(defpart 3817 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 1) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -45)) + ) + ) + +(defpart 3818 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 2) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -36)) + ) + ) + +(defpart 3819 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 3) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -27.000002)) + ) + ) + +(defpart 3820 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 4) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -18)) + ) + ) + +(defpart 3821 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 5) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -9)) + ) + ) + +(defpart 3822 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 6) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3823 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 7) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 9)) + ) + ) + +(defpart 3824 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 8) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 18)) + ) + ) + +(defpart 3825 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 9) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 27.000002)) + ) + ) + +(defpart 3826 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 10) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 36)) + ) + ) + +(defpart 3827 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 11) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 45)) + ) + ) + +(defpart 3828 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g 64.0 128.0) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 12) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 54.000004)) + ) + ) + +(defpart 3829 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 13) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -49.5)) + ) + ) + +(defpart 3830 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 14) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -40.5)) + ) + ) + +(defpart 3831 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 15) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -31.5)) + ) + ) + +(defpart 3832 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 16) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -22.5)) + ) + ) + +(defpart 3833 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 17) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -13.500001)) + ) + ) + +(defpart 3834 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 18) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -4.5)) + ) + ) + +(defpart 3835 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 19) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 4.5)) + ) + ) + +(defpart 3836 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 20) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 13.500001)) + ) + ) + +(defpart 3837 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 21) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 22.5)) + ) + ) + +(defpart 3838 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 22) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 31.5)) + ) + ) + +(defpart 3839 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 23) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 40.5)) + ) + ) + +(defpart 3840 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 24) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 49.5)) + ) + ) + +(defpartgroup group-ctyport-rubble-crater-smoke + :id 1058 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3841 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 3841 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 1)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.005925926)) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.000033333334) (meters 0.00006666667)) + (:accel-y (meters 0.00033333333) (meters 0.000033333334)) + (:accel-z (meters -0.000033333334) (meters 0.00006666667)) + (:friction 0.94) + (:timer (seconds 10.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3842) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3842 + :init-specs ((:fade-a -0.024615385 -0.024615385)) + ) + +(defpartgroup group-ctyport-wreckage-smoke + :id 1059 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3843 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 3843 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3844) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3844 + :init-specs ((:fade-a -0.11636364)) + ) + +(define *hiphog-exterior-marquee-group-ids* (new 'static 'boxed-array :type int32 #x424)) + +(define *hiphog-exterior-marquee-daxter-group-ids* (new 'static 'boxed-array :type int32 #x421)) + +(deftype hiphog-exterior-marquee (process-drawable) + ((rot vector :inline) + (master-enable uint32) + (mode uint32 :offset 240) + (counter int32) + (parts sparticle-launch-control 1) + ) + (:state-methods + idle + ) + (:methods + (hiphog-exterior-marquee-method-21 (_type_) none) + ) + ) + + +(defmethod deactivate ((this hiphog-exterior-marquee)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (dotimes (s5-0 1) + (let ((a0-1 (-> this parts s5-0))) + (if (nonzero? a0-1) + (kill-particles a0-1) + ) + ) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch process-drawable vs hiphog-exterior-marquee. +(defmethod relocate ((this hiphog-exterior-marquee) (offset int)) + (dotimes (v1-0 1) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) offset) + ) + ) + (the-as hiphog-exterior-marquee ((method-of-type process-drawable relocate) this offset)) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod hiphog-exterior-marquee-method-21 ((this hiphog-exterior-marquee)) + (+! (-> this parts 0 state-counter) 1) + (when (!= (-> this parts 0 state-mode 0) (-> this mode)) + (set! (-> this parts 0 state-mode 0) (-> this mode)) + (set! (-> this parts 0 state-counter) (the-as uint 0)) + 0 + ) + (let ((s5-0 (-> this master-enable))) + (dotimes (s4-0 1) + (if (logtest? s5-0 1) + (spawn (-> this parts s4-0) (-> this root trans)) + ) + (set! s5-0 (shr s5-0 1)) + ) + ) + (none) + ) + +(defstate idle (hiphog-exterior-marquee) + :virtual #t + :code (behavior () + (until #f + (when (<= (-> self counter) 0) + (set! (-> self mode) (the-as uint (rand-vu-int-count 8))) + (let ((v0-1 (rand-vu-int-range 3 6)) + (a0-3 (-> *hiphog-exterior-marquee* (+ (-> self mode) 1))) + ) + (set! (-> self counter) (* v0-1 (* (+ (-> a0-3 length) -1) (the-as int (/ (the-as int (-> a0-3 0)) 8))))) + ) + (while (< (-> self counter) 120) + (set! (-> self counter) (* (-> self counter) 2)) + ) + ) + (+! (-> self counter) -1) + (hiphog-exterior-marquee-method-21 self) + (suspend) + ) + #f + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this hiphog-exterior-marquee) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause enemy)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this master-enable) (the-as uint -1)) + (set! (-> this mode) (the-as uint (rand-vu-int-count 8))) + (let ((s5-1 *hiphog-exterior-marquee-daxter-group-ids*)) + (dotimes (s4-0 1) + (set! (-> this parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-0)) this)) + ) + ) + (go (method-of-object this idle)) + ) + +(deftype farthy (process-drawable) + ((new-trans-hook (function none)) + (cur-trans-hook (function none)) + ) + (:state-methods + idle + ) + ) + + +(defskelgroup skel-farthy farthy -1 -1 ((-1 (meters 999999))) :bounds (static-spherem 0 8 0 11)) + +(defskelgroup skel-mecha-daxter mecha-daxter mecha-daxter-lod0-jg mecha-daxter-idle-ja + ((mecha-daxter-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 0 11) + :origin-joint-index 3 + ) + +(defskelgroup skel-broken-mdaxter broken-mdaxter broken-mdaxter-lod0-jg broken-mdaxter-idle-ja + ((broken-mdaxter-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 0 11) + :origin-joint-index 3 + ) + +(defstate idle (farthy) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans-hook) + (let ((v0-0 (-> block param 0))) + (set! (-> self new-trans-hook) (the-as (function none) v0-0)) + v0-0 + ) + ) + ) + ) + :trans (behavior () + (if (!= (-> self cur-trans-hook) (-> self new-trans-hook)) + (set! (-> self cur-trans-hook) (-> self new-trans-hook)) + ) + ((-> self cur-trans-hook)) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + ) + ) + +(defmethod init-from-entity! ((this farthy) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this root pause-adjust-distance) 1228800.0) + (if (task-node-closed? (game-task-node city-hijack-vehicle-resolution)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-broken-mdaxter" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mecha-daxter" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (set! (-> this new-trans-hook) nothing) + (set! (-> this cur-trans-hook) nothing) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) + ) + +(defpartgroup group-ctyport-blinking-red-glow + :id 1061 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3845 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 3845 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyport-citylights-blue-1 + :id 1062 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3846 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +(defpartgroup group-ctyport-citylights-blue-2 + :id 1063 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3846 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +(defpartgroup group-ctyport-citylights-blue-3 + :id 1064 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3846 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 800 :hour-mask #b111111111110000000) + ) + ) + +(defpartgroup group-ctyport-citylights-blue-4 + :id 1065 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3846 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 1200 :hour-mask #b111111111110000000) + ) + ) + +(defpart 3846 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 3)) + (:r 0.0) + (:g 128.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.035)) + (:scalevel-y (meters 0.03)) + (:fade-a 0.08) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3847) + ) + ) + +(defpart 3847 + :init-specs ((:scale-y (meters 6)) + (:a 16.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 3848) + ) + ) + +(defpart 3848 + :init-specs ((:scalevel-x (meters -0.035)) + (:scalevel-y (meters -0.03)) + (:fade-a -0.08) + (:next-time (seconds 0.335)) + (:next-launcher 3849) + ) + ) + +(defpart 3849 + :init-specs ((:scale-y (meters 3)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +(defpartgroup group-ctyport-rubble-fire + :id 1066 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3850 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 3851 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7)) + (sp-item 3852 :falloff-to (meters 40) :flags (sp7)) + (sp-item 3843 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +(defpart 3851 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0 1.0) + (:x (meters -5) (meters 10)) + (:y (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 155.0) + (:g 164.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:accel-y (meters 0.0033333334) (meters 0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + ) + ) + +(if #t + (set! *range-color-rubble-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.6 :z -0.9 :w -1.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 30.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 120.0 :z 30.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.6666666 :y 3.333334 :z 9.999998 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-alpha-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 255.0 :z 256.0 :w 257.0) + :one-over-x-deltas (new 'static 'vector :x 127.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-rubble-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-rubble-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *r-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *g-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.7 :y 0.5 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x -0.19999999 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *b-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.6 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -1.6666666 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-alpha-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.5 :w -1.0) + :ys (new 'static 'vector :y 0.5 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6666666 :y 2.5000002 :z -2.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-scale-rubble-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 0.3 :w 1.3) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y -1.4 :z 0.99999994 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-scale-rubble-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 2.0 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-ctyport-rubble-fire-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.4) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf1) + ) + ) + +(set! (-> *part-id-table* 3851 init-specs 16 initial-valuef) + (the-as float *part-ctyport-rubble-fire-flame-curve-settings*) + ) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* color-start) *range-color-rubble-flame*) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* alpha-start) *range-alpha-rubble-flame*) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* scale-x-start) *range-scale-rubble-flame-x*) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* scale-y-start) *range-scale-rubble-flame-y*) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* r-scalar) *r-curve-rubble-flame*) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* g-scalar) *g-curve-rubble-flame*) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* b-scalar) *b-curve-rubble-flame*) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* a-scalar) *curve-alpha-rubble-flame*) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* scale-x-scalar) *curve-scale-rubble-flame-x*) + +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* scale-y-scalar) *curve-scale-rubble-flame-y*) + +(defpart 3853 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:y (meters -1)) + (:scale-x (meters 7) (meters 7)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-y (meters -0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters -0.016666668)) + (:fade-r 0.33333334) + (:fade-g -0.083333336) + (:fade-b -1.875) + (:fade-a 0.42666668) + (:accel-y (meters 0.00033333333) (meters 0.005)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 3854) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 1) (meters 10)) + ) + ) + +(defpart 3854 + :init-specs ((:scalevel-x (meters -0.016666668)) (:fade-a -0.425 -0.425)) + ) + +(defpart 3852 + :init-specs ((:num 1.0) + (:x (meters -6) (meters 12)) + (:y (meters -1) (meters 6)) + (:z (meters -3) (meters 6)) + (:rot-x 8) + (:r 12288.0) + (:g 2048.0) + (:b 2048.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:fade-g 6.826667) + (:accel-y (meters 0.0016666667) (meters 0.00033333333)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 3855) + ) + ) + +(defpart 3855 + :init-specs ((:fade-g -6.826667)) + ) + +(defpart 3850 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.2) + (:y (meters 2)) + (:scale-x (meters 20)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 10.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + ) + ) + +(defpartgroup group-ctyport-red-tits-glow + :id 1067 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3856 :fade-after (meters 500) :flags (sp6))) + ) + +(defpart 3856 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5.5) (meters 0.2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyport-yellow-glow-pulse + :id 1068 + :flags (sp0) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3857 :fade-after (meters 500) :flags (sp6) :period (seconds 2) :length (seconds 0.017))) + ) + +(defpart 3857 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.4)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 120.0) + (:b 0.0) + (:a 1.0) + (:omega (degrees 11261.25)) + (:fade-a 0.13) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:next-time (seconds 1)) + (:next-launcher 3858) + ) + ) + +(defpart 3858 + :init-specs ((:fade-a -0.13333334)) + ) + +(defpartgroup group-ctyport-blue-glow + :id 1069 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3859 :fade-after (meters 500) :flags (sp6))) + ) + +(defpart 3859 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 158.0) + (:a 40.0 10.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) diff --git a/goal_src/jak3/levels/city/port/ctyport-scenes.gc b/goal_src/jak3/levels/city/port/ctyport-scenes.gc index 5840e50490..9806e94f18 100644 --- a/goal_src/jak3/levels/city/port/ctyport-scenes.gc +++ b/goal_src/jak3/levels/city/port/ctyport-scenes.gc @@ -5,5 +5,1687 @@ ;; name in dgo: ctyport-scenes ;; dgos: CPO +(define-extern *range-dax-sign-explo-dust-color* curve-color-fast) +(define-extern *range-dax-sign-explo-dust-alpha* curve2d-fast) +(define-extern *range-dax-sign-explo-dust-scale-x* curve2d-fast) +(define-extern *range-dax-sign-explo-dust-scale-y* curve2d-fast) +(define-extern *curve-dax-sign-explo-dust-alpha* curve2d-fast) +(define-extern *curve-dax-sign-explo-dust-scale-x* curve2d-fast) +(define-extern *curve-dax-sign-explo-dust-scale-y* curve2d-fast) +(define-extern *range-dax-sign-explo-color* curve-color-fast) +(define-extern *range-dax-sign-explo-alpha* curve2d-fast) +(define-extern *range-dax-sign-explo-scale-x* curve2d-fast) +(define-extern *range-dax-sign-explo-scale-y* curve2d-fast) +(define-extern *curve-dax-sign-explo-alpha* curve2d-fast) +(define-extern *curve-dax-sign-explo-scale-x* curve2d-fast) +(define-extern *curve-dax-sign-explo-scale-y* curve2d-fast) +(define-extern *range-fma-barrier-explo-big-color* curve-color-fast) +(define-extern *range-fma-barrier-explo-big-alpha* curve2d-fast) +(define-extern *range-fma-barrier-explo-big-scale-x* curve2d-fast) +(define-extern *range-fma-barrier-explo-big-scale-y* curve2d-fast) +(define-extern *curve-fma-barrier-explo-big-alpha* curve2d-fast) +(define-extern *curve-fma-barrier-explo-big-scale-x* curve2d-fast) +(define-extern *curve-fma-barrier-explo-big-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(defskelgroup skel-broken-mdaxter-movie broken-mdaxter broken-mdaxter-lod0-jg broken-mdaxter-idle-ja + ((broken-mdaxter-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 300) + :origin-joint-index 3 + ) + +(defskelgroup skel-missile-launcher-movie cty-dax-missile-launcher cty-dax-missile-launcher-lod0-jg cty-dax-missile-launcher-idle-ja + ((cty-dax-missile-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + :origin-joint-index 3 + ) + +(load-scene (new 'static 'scene + :name "city-port-attack-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-125" + :art-group "scenecamera" + :anim "city-port-attack-res" + :parts 7 + :command-list '((0 + (kill "tpl-glider-broken-1") + (send-event "krimson-wall-8" 'kill) + (send-event "krimson-wall-9" 'kill) + (send-event "krimson-wall-10" 'kill) + (part-tracker + "group-fma-missile-thruster-fire" + entity + "h-torpedo" + joint + "main" + track + #t + duration + (frame-range 0 93) + ) + (part-tracker + "group-hijak-fma-missile-trail" + entity + "h-torpedo" + joint + "main" + track + #t + duration + (frame-range 0 93) + subsample-num + (new 'static 'bfloat :data 10.0) + ) + ) + (65 + (part-tracker + "group-krimson-wall-fma" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-range 65 66) + ) + ) + (93 + (part-tracker + "group-fma-barrier-explosion-big" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 93 123) + ) + ) + (384 + (part-tracker + "group-scenes-daxter-crush-dust" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 384 385) + ) + ) + (410 (fadeout (frame-time-30 10))) + (10000 + (task-close! "city-port-attack-resolution") + (apply + ,(lambda :behavior scene-player + () + (send-event *target* 'change-mode 'normal) + (logclear! (-> *target* draw status) (draw-control-status no-draw)) + (none) + ) + ) + ) + ) + :cut-list '(65 176 284) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'lpatkcs + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'lpatkcs + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-torpedo" + :level 'lctypatk + :art-group "skel-h-torpedo" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'lctypatk + :art-group "skel-krimson-wall-break" + :prefix "" + :draw-frames '((65 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'lctypatk + :art-group "skel-krimson-wall-break" + :prefix "a-" + :draw-frames '((65 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'lctypatk + :art-group "skel-krimson-wall-break" + :prefix "b-" + :draw-frames '((65 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctyport-attack-res" + :end-point "ctyport-attack-res" + :borrow '((ctywide 4 lctypatk special) + (ctywide-ff alias ctywide copy ctypesa special ctycarb special lpatkcs special) + ) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(load-scene + (new 'static 'scene + :name "city-hijack-vehicle-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-93" + :art-group "scenecamera" + :anim "city-hijack-vehicle-res" + :parts 4 + :command-list '((0 (apply ,(lambda :behavior scene-player () (kill-by-type h-kg-pickup *active-pool*) (none)))) + (10 + (part-tracker + "group-fma-missile-thruster-fire" + entity + "cty-hijack-missile" + joint + "main" + track + #t + duration + (frame-range 0 239) + ) + (part-tracker + "group-hijak-fma-missile-trail" + entity + "cty-hijack-missile" + joint + "main" + track + #t + duration + (frame-range 0 239) + subsample-num + (new 'static 'bfloat :data 10.0) + ) + (kill "farthy-1") + ) + (70 + (send-event + "mecha-daxter" + 'trans-hook + ,(lambda :behavior scene-player + () + (vector-seek! + (-> self draw color-emissive) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (* 4.0 (seconds-per-frame)) + ) + (none) + ) + ) + ) + (180 + (send-event + "mecha-daxter" + 'trans-hook + ,(lambda :behavior scene-player () (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) (none)) + ) + ) + (239 + (part-tracker + "group-daxter-sign-explosion" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 239 290) + ) + ) + (240) + (415 (fadeout (frame-time-30 10))) + (10000 (task-close! "city-hijack-vehicle-resolution")) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'citycast + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '((min max)) + :cloth-commands '(((min max) hide)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'citycast + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'citycast + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-kg-pickup" + :level 'lctyhijk + :art-group "skel-h-kg-pickup" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "cty-hijack-missile" + :level 'lctyhijk + :art-group "skel-cty-hijack-missile" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "palmpilot-b" + :level 'citycast + :art-group "skel-palmpilot-b" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "broken-mdaxter-movie" + :level 'ctyport + :art-group "skel-broken-mdaxter-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'citycast + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "mecha-daxter" + :level 'ctyport + :art-group "skel-mecha-daxter" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctyhijack-res" + :end-point "ctyport-hiphog" + :borrow '((ctywide 4 lctyhijk special) + (ctywide-kg alias ctywide copy ctypesc special) + (ctywide-ff-kg alias ctywide copy ctypesc special) + (ctywide-ff alias ctywide copy ctypepa special ctypesa special) + ) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #x9c + :on-running #f + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "ctyport-attack-get-on-nuke" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-93" + :art-group "scenecamera" + :anim "city-port-attack-intro-b" + :parts 1 + :command-list '((0 (kill "cty-dax-missile-launcher-1")) + (78 + (part-tracker + "group-fma-missile-launch-trail" + entity + "h-torpedo" + joint + "main" + track + #t + duration + (frame-range 78 100) + subsample-num + (new 'static 'bfloat :data 10.0) + ) + ) + (81 + (part-tracker + "group-fma-missile-launch-thruster" + entity + "h-torpedo" + joint + "main" + track + #t + duration + (frame-range 81 84) + ) + ) + ) + :cut-list '(46) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'hiphog + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x1e + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'hiphog + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x1e + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "missile-launcher-movie" + :level 'lpatkcs + :art-group "skel-missile-launcher-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-torpedo" + :level 'lctypatk + :art-group "skel-h-torpedo" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctyport-hiphog" + :end-point #f + :borrow '((ctywide 4 lctypatk display) + (ctywide-ff alias ctywide copy ctypesa auto ctycarb auto ctycara auto lpatkcs display) + ) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(defpartgroup group-fma-missile-launch-thruster + :id 1070 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 3860 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 3861 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +(defpart 3860 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -0.7)) + (:scale-x (meters 1)) + (:rot-x (degrees 190)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3861 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 3.0) + (:x (meters -1)) + (:scale-x (meters 5) (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 60.0 20.0) + (:b 0.0) + (:a 30.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-fma-missile-launch-trail + :id 1071 + :flags (sp0 sp13) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 3862)) + ) + +(defpart 3862 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:z (meters 0)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 30.0) + (:g :copy r) + (:b :copy r) + (:a 20.0 20.0) + (:vel-z (meters -0.06666667) (meters -0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.06666667 -0.06666667) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405c00 #x409b00)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-krimson-wall-fma + :id 1072 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 3863 :flags (is-3d sp3 sp7))) + ) + +(defpart 3863 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:x (meters 1)) + (:y (meters 0)) + (:z (meters 16)) + (:scale-x (meters 18)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-z (degrees 90)) + (:scale-y (meters 54)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.735)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 + 20 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 90)) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-daxter-crush-dust ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 140)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 30)) + (v1-3 (+ (logand 0 (rand-uint31-gen *random-generator*)) 75)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 s3-0))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-3))) + ) + (none) + ) + +(defpartgroup group-scenes-daxter-crush-dust + :id 1073 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3864 :flags (sp7))) + ) + +(defpart 3864 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-daxter-crush-dust) + (:num 30.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.064 -0.064) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.82) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 80) (degrees 10)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-fma-missile-thruster-fire + :id 1074 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 3865 :flags (is-3d sp7)) (sp-item 3866 :flags (sp6 sp7))) + ) + +(defpart 3865 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 6.0) + (:z (meters -0.9)) + (:scale-x (meters 0.8) (meters 0.5)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 2) (meters 1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 30.0 30.0) + (:fade-a -0.6) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3866 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 80.0 2.0) + (:fade-a -0.12) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hijak-fma-missile-trail + :id 1075 + :flags (sp0 sp13) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 3867)) + ) + +(defpart 3867 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 50.0 80.0) + (:g :copy r) + (:b :copy r) + (:a 10.0 40.0) + (:scalevel-x (meters 0.0033333334) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.083333336 -0.083333336) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x40a000 #x405c00 #x409b00)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-daxter-sign-explosion + :id 1076 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 3869 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3870 :period (seconds 30) :length (seconds 0.035)) + (sp-item 3871 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3872 :period (seconds 30) :length (seconds 0.035)) + (sp-item 3873 :period (seconds 30) :length (seconds 0.035)) + (sp-item 3874 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3875 :period (seconds 30) :length (seconds 0.167)) + (sp-item 3876 :period (seconds 30) :length (seconds 0.5)) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +(defpart 3869 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 3870 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3871 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3872 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3873 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-dax-sign-explo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-dax-sign-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-dax-sign-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-dax-sign-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-dax-sign-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-dax-sign-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-dax-sign-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-daxter-sign-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 3873 init-specs 14 initial-valuef) + (the-as float *part-daxter-sign-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* color-start) *range-dax-sign-explo-dust-color*) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* alpha-start) *range-dax-sign-explo-dust-alpha*) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* scale-x-start) + *range-dax-sign-explo-dust-scale-x* + ) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* scale-y-start) + *range-dax-sign-explo-dust-scale-y* + ) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* a-scalar) *curve-dax-sign-explo-dust-alpha*) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* scale-x-scalar) + *curve-dax-sign-explo-dust-scale-x* + ) + +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* scale-y-scalar) + *curve-dax-sign-explo-dust-scale-y* + ) + +(defpart 3875 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3876 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-dax-sign-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-dax-sign-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-dax-sign-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-dax-sign-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-dax-sign-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-dax-sign-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-dax-sign-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-daxter-sign-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 3876 init-specs 16 initial-valuef) + (the-as float *part-daxter-sign-explosion-texture-curve-settings*) + ) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* color-start) *range-dax-sign-explo-color*) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* alpha-start) *range-dax-sign-explo-alpha*) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* scale-x-start) *range-dax-sign-explo-scale-x*) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* scale-y-start) *range-dax-sign-explo-scale-y*) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* a-scalar) *curve-dax-sign-explo-alpha*) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* scale-x-scalar) *curve-dax-sign-explo-scale-x*) + +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* scale-y-scalar) *curve-dax-sign-explo-scale-y*) + +(defpart 3874 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 3877 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.033333335) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3868 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-fma-barrier-explosion-big + :id 1077 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 3879 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3880 :period (seconds 30) :length (seconds 0.035)) + (sp-item 3881 :flags (sp3) :period (seconds 30)) + (sp-item 3882 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3883 :period (seconds 30) :length (seconds 0.335)) + (sp-item 3884 :period (seconds 30) :length (seconds 0.5)) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +(defpart 3879 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 3880 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3881 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.12307692) + (:fade-b -0.046153847) + (:fade-a -0.19692308 -0.19692308) + (:accel-x (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.93) + (:timer (seconds 2.167)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:next-time (seconds 0.335)) + (:next-launcher 3886) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3886 + :init-specs ((:friction 0.7)) + ) + +(defpart 3883 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.5) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.10666667) + (:fade-b -0.04) + (:fade-a -0.17066666 -0.17066666) + (:accel-x (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.7) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.335)) + (:next-launcher 3887) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3887 + :init-specs ((:friction 0.7)) + ) + +(defpart 3884 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.13333334)) + (:accel-x (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:next-time (seconds 0.335)) + (:next-launcher 3888) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3888 + :init-specs ((:friction 0.7)) + ) + +(if #t + (set! *range-fma-barrier-explo-big-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fma-barrier-explo-big-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fma-barrier-explo-big-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fma-barrier-explo-big-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fma-barrier-explo-big-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fma-barrier-explo-big-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fma-barrier-explo-big-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-fma-barrier-explosion-big-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.7) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 3884 init-specs 17 initial-valuef) + (the-as float *part-fma-barrier-explosion-big-texture-curve-settings*) + ) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* color-start) + *range-fma-barrier-explo-big-color* + ) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* alpha-start) + *range-fma-barrier-explo-big-alpha* + ) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* scale-x-start) + *range-fma-barrier-explo-big-scale-x* + ) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* scale-y-start) + *range-fma-barrier-explo-big-scale-y* + ) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* a-scalar) + *curve-fma-barrier-explo-big-alpha* + ) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* scale-x-scalar) + *curve-fma-barrier-explo-big-scale-x* + ) + +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* scale-y-scalar) + *curve-fma-barrier-explo-big-scale-y* + ) + +(defpart 3882 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 3885 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.1)) + (:scalevel-x (meters -0.05) (meters -0.05)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3878 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.17066666 -0.17066666) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(deftype port-board-vent (bouncer) + () + ) + + +(defmethod init-collision! ((this port-board-vent)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action)) + (set-vector! (-> v1-2 local-sphere) 0.0 4096.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-skel! ((this port-board-vent)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/protect/flying-turret.gc b/goal_src/jak3/levels/city/protect/flying-turret.gc index f0a8bb4086..ca7bc7e83b 100644 --- a/goal_src/jak3/levels/city/protect/flying-turret.gc +++ b/goal_src/jak3/levels/city/protect/flying-turret.gc @@ -7,3 +7,1418 @@ ;; DECOMP BEGINS +(defskelgroup skel-flying-turret kg-flying-turret kg-flying-turret-lod0-jg kg-flying-turret-idle-ja + ((kg-flying-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defpart 4709 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.4)) + (:scale-y (meters 3)) + (:r 128.0 128.0) + (:g 32.0 96.0) + (:b :copy g) + (:a 128.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(define *flying-turret-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 2 + :hit-anim 2 + :knocked-anim 2 + :knocked-land-anim 2 + :die-anim 2 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :notice-distance (meters 30) + :notice-distance-delta (meters 10) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 2 + :turn-anim -1 + :run-anim 2 + :taunt-anim -1 + :run-travel-speed (meters 25) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 2) + :walk-travel-speed (meters 25) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 1) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 1) + :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! (-> *flying-turret-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(define *flying-turret-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 7 :group "skel-kg-debris-a") + ) + ) + ) + +(deftype ft-gun-info (structure) + ((gun-position float) + (fire? symbol) + ) + ) + + +(deftype flying-turret (kg-squad-member) + ((thrust-dir vector :inline) + (speed float) + (speed-target float) + (ground-height float) + (last-heading-quat quaternion :inline) + (last-roll-quat quaternion :inline) + (thrust-mode uint8) + (pursuit-start-time time-frame) + (chase-mode uint8) + (last-check-chase-pos-time time-frame) + (circle-angle float) + (last-fire-time time-frame) + (num-shots-fired int8) + (ground-point vector :inline) + (guns ft-gun-info 2 :inline) + (turret-aim-blend float) + (hit-player? symbol) + (desired-height-offset float) + (float-height float) + (bob-velocity float) + (bouncing? symbol) + (bounce-start-time time-frame) + (changed-targets? symbol) + (thruster-intensity float) + (up-bobbing? symbol) + (bob-scale-factor float) + (bob-scale-target float) + (bob-t float) + (thruster-intensity-scalar float) + (engine-sound sound-id) + (tilt-sound sound-id) + (roll-sound-amount float) + ) + (:state-methods + flying-turret-base-state + fire + exit-transport + ) + (:methods + (flying-turret-method-225 (_type_) float) + (flying-turret-method-226 (_type_) none) + (flying-turret-method-227 (_type_) quaternion) + (fire-shot-from-joint-idx (_type_ int) (pointer process)) + (flying-turret-method-229 (_type_) none) + (flying-turret-method-230 (_type_ uint) uint) + ) + ) + + +(defmethod init-enemy-collision! ((this flying-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + (set! (-> v1-7 prim-core action) (collide-action solid semi-solid no-standon)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) 40.96) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch vector vs process. +(defmethod update-focus ((this flying-turret)) + (the-as process (when (handle->process (-> this focus handle)) + (let* ((s5-1 (handle->process (-> this focus handle))) + (a0-9 (if (type? s5-1 process-focusable) + (the-as process-focusable s5-1) + ) + ) + (s5-0 (-> this focus-pos)) + ) + (set! (-> s5-0 quad) (-> (get-trans a0-9 3) quad)) + s5-0 + ) + ) + ) + ) + +(defmethod flying-turret-method-226 ((this flying-turret)) + (when (not (handle->process (-> this current-enemy))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + (let ((a0-6 (get-current-enemy this))) + (cond + (a0-6 + (let ((v1-8 (process->handle a0-6))) + (when (!= (-> this current-enemy) v1-8) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag persistent in-pursuit)) + (set! (-> this changed-targets?) #t) + ) + (set! (-> this current-enemy) (the-as handle v1-8)) + ) + ) + (else + (set! (-> this current-enemy) (the-as handle #f)) + ) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 3))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (if (time-elapsed? (-> this pursuit-start-time) (seconds 5)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit)) + ) + (let* ((s5-0 (handle->process (-> this current-enemy))) + (a0-27 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and a0-27 + (not (logtest? (-> (the-as process-focusable a0-27) focus-status) (focus-status disable dead inactive))) + ) + (let* ((s5-1 this) + (s4-0 (method-of-object s5-1 enemy-method-70)) + (s3-0 (handle->process (-> this current-enemy))) + ) + (s4-0 + s5-1 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus this) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (f1-0 204800.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag persistent in-pursuit)) + ) + ) + ) + (else + (set! (-> this current-enemy) (the-as handle #f)) + (set! (-> this focus handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (when (not (and (-> this next-state) (= (-> this next-state name) 'active))) + (citizen-method-208 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod kg-squad-member-method-219 ((this flying-turret) (arg0 process-focusable)) + (let* ((s4-0 (get-trans arg0 0)) + (f0-0 (vector-vector-xz-distance-squared (-> this root trans) s4-0)) + (f1-0 245760.0) + ) + (or (and (< f0-0 (* f1-0 f1-0)) + (< (fabs (- (-> s4-0 y) (-> this root trans y))) 61440.0) + (< (-> s4-0 y) (-> this root trans y)) + ) + (< 0.0 (get-hatred-val-for-target this (process->handle arg0))) + ) + ) + ) + +(defmethod flying-turret-method-227 ((this flying-turret)) + (set! (-> this roll-sound-amount) 0.0) + (if (zero? (-> this thrust-mode)) + (vector-float*! (-> this root transv) (-> this root transv) (- 1.0 (* 0.1 (seconds-per-frame)))) + (vector-float*! (-> this root transv) (-> this root transv) (- 1.0 (seconds-per-frame))) + ) + (let ((v1-8 (vector-float*! (new 'stack-no-clear 'vector) (-> this thrust-dir) (-> this speed-target))) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-6 quad) (-> this root transv quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) v1-8 a0-6)) + (f30-0 0.0) + ) + (cond + ((zero? (-> this thrust-mode)) + 1.0 + (vector-length (-> this root transv)) + (set! f30-0 (vector-length s5-1)) + (let* ((f1-3 (/ f30-0 (-> this enemy-info run-travel-speed))) + (f0-10 (fmax 0.0 (fmin 1.0 f1-3))) + (f0-11 (* f0-10 f0-10)) + (f0-12 (* f0-11 f0-11)) + ) + (when (!= (-> this chase-mode) 3) + (let ((f1-5 (vector-length (-> this root transv)))) + (set! f0-12 (* f0-12 (fmax 0.2 (fmin 1.0 (/ f1-5 (-> this enemy-info run-travel-speed)))))) + ) + ) + (let ((f28-0 (lerp 2.0 10.0 f0-12))) + (let* ((s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (closest-point-on-mesh (-> this nav) s4-0 (-> this ground-point) (the-as nav-poly #f))) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> this root transv quad)) + (when s1-0 + (set! (-> s3-0 y) 0.0) + (clamp-vector-to-mesh-no-gaps (-> this nav) s4-0 s1-0 s3-0 s2-0) + (if (and (-> s2-0 found-boundary) (< (vector-length s3-0) 20480.0)) + (set! f28-0 (* 4.0 f28-0)) + ) + ) + ) + (vector+float*! (-> this root transv) (-> this root transv) s5-1 (* f28-0 (seconds-per-frame))) + (let* ((f0-19 (fmax 61440.0 (* (vector-length s5-1) f28-0))) + (f28-1 (* 0.000008138021 f0-19)) + (f26-0 0.8) + (f24-0 0.40000004) + (v1-53 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-54 (the-as number (logior #x3f800000 v1-53))) + (f0-25 (* f28-1 (+ f26-0 (* f24-0 (+ -1.0 (the-as float v1-54)))))) + ) + (seek! (-> this thruster-intensity) f0-25 (* 2.0 (seconds-per-frame))) + ) + ) + ) + ) + (else + (let* ((f0-30 (fmax 61440.0 (* 3.0 (vector-length (-> this root transv))))) + (f28-2 (* 0.000008138021 f0-30)) + (f26-1 0.8) + (f24-1 0.40000004) + (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-69 (the-as number (logior #x3f800000 v1-68))) + (f0-36 (* f28-2 (+ f26-1 (* f24-1 (+ -1.0 (the-as float v1-69)))))) + ) + (seek! (-> this thruster-intensity) f0-36 (* 2.0 (seconds-per-frame))) + ) + ) + ) + (let ((s4-2 (vector-float*! (new 'stack-no-clear 'vector) (-> this root transv) (seconds-per-frame)))) + (let* ((s1-1 (new 'stack-no-clear 'vector)) + (s0-0 (closest-point-on-mesh (-> this nav) s1-1 (-> this ground-point) (the-as nav-poly #f))) + (s2-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> s4-2 quad)) + (when s0-0 + (set! (-> s3-1 y) 0.0) + (clamp-vector-to-mesh-no-gaps (-> this nav) s1-1 s0-0 s3-1 s2-1) + (when (-> s2-1 found-boundary) + (let ((s1-3 (vector-! (new 'stack-no-clear 'vector) s4-2 s3-1))) + 0.0 + (let ((f0-43 (vector-normalize-ret-len! s1-3 1.0))) + (let ((f1-23 (vector-dot s1-3 (-> s2-1 boundary-normal)))) + (vector-float*! (-> s2-1 boundary-normal) (-> s2-1 boundary-normal) f1-23) + ) + (vector-! s1-3 s1-3 (-> s2-1 boundary-normal)) + (vector-normalize! s1-3 f0-43) + ) + (vector+! s4-2 s3-1 s1-3) + ) + ) + ) + ) + (vector+! (-> this root trans) (-> this root trans) s4-2) + ) + (let ((s2-2 (new 'stack-no-clear 'vector)) + (s4-3 (quaternion-identity! (new 'stack-no-clear 'quaternion))) + ) + (set! (-> s2-2 quad) (-> this thrust-dir quad)) + (set! (-> s2-2 y) 0.0) + (vector-normalize! s2-2 1.0) + (let ((s3-2 (new 'stack-no-clear 'quaternion)) + (f28-3 0.75) + ) + (quaternion-set! s3-2 0.0 (-> s2-2 x) 0.0 (+ 1.0 (-> s2-2 z))) + (quaternion-normalize! s3-2) + (if (= (-> this thrust-mode) 2) + (set! f28-3 1.5) + ) + (quaternion-slerp! (-> this last-heading-quat) (-> this last-heading-quat) s3-2 (* f28-3 (seconds-per-frame))) + ) + (when (zero? (-> this thrust-mode)) + (let ((s3-3 (new 'stack-no-clear 'vector))) + (set! (-> s3-3 quad) (-> s5-1 quad)) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (let ((s2-3 *up-vector*)) + (set! (-> s3-3 y) 0.0) + (vector-normalize! s3-3 1.0) + (vector-cross! s5-2 s3-3 s2-3) + ) + (vector-normalize! s5-2 1.0) + 0.0 + 0.0 + (let* ((f1-25 (/ f30-0 (-> this enemy-info run-travel-speed))) + (f1-28 (- 1.0 (* (- 1.0 f1-25) (- 1.0 f1-25)))) + (f0-56 (- 1.0 (* (- 1.0 f1-28) (- 1.0 f1-28)))) + (f0-57 (lerp 0.0 11832.889 f0-56)) + ) + (set! (-> this roll-sound-amount) f0-57) + (let ((f0-58 (* -1.0 f0-57))) + (quaternion-vector-angle! s4-3 s5-2 f0-58) + ) + ) + ) + ) + ) + (quaternion-slerp! (-> this last-roll-quat) (-> this last-roll-quat) s4-3 (* 2.0 (seconds-per-frame))) + ) + ) + ) + (quaternion*! (-> this root quat) (-> this last-roll-quat) (-> this last-heading-quat)) + (quaternion-normalize! (-> this root quat)) + ) + +(defmethod flying-turret-method-229 ((this flying-turret)) + (let ((s4-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> this root trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector+float*! gp-0 gp-0 (-> s4-0 fvec) -3276.8) + (vector+float*! gp-0 gp-0 (-> s4-0 uvec) -409.6) + (vector+float*! gp-0 gp-0 (-> s4-0 rvec) -614.4) + (vector-float*! s5-0 (-> s4-0 uvec) -1.0) + 0.0 + 0.0 + (let ((f0-6 (-> this thruster-intensity))) + (if (< f0-6 1.0) + (set! f0-6 (* f0-6 f0-6)) + ) + (let ((f0-8 (* (lerp 3072.0 8601.6 f0-6) (-> this thruster-intensity-scalar)))) + (set! (-> *part-id-table* 4709 init-specs 4 initial-valuef) f0-8) + (set! (-> *part-id-table* 4709 init-specs 3 initial-valuef) (* 0.5 f0-8)) + ) + ) + (draw-beam (-> *part-id-table* 4709) gp-0 s5-0 #f) + (vector+float*! gp-0 gp-0 (-> s4-0 rvec) 1228.8) + (draw-beam (-> *part-id-table* 4709) gp-0 s5-0 #f) + ) + ) + (none) + ) + +(defmethod enemy-common-post ((this flying-turret)) + (with-pp + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'exit-transport))) + (flying-turret-method-226 this) + ) + (flying-turret-method-227 this) + (let* ((f0-0 (vector-length (-> this root transv))) + (f0-1 (* 0.000016276043 f0-0)) + ) + 0.0 + 0.0 + (let* ((f28-0 (fmax 0.0 (fmin 1.0 f0-1))) + (f30-0 (lerp 0.5 1.0 f28-0)) + (f0-3 (lerp 0.0 0.25 f28-0)) + ) + (sound-play-by-name + (static-sound-name "f-turret-engine") + (-> this engine-sound) + (the int (* 1024.0 f30-0)) + (the int (* 1524.0 f0-3)) + 0 + (sound-group) + #t + ) + ) + ) + (let* ((f1-9 (* 0.00008451022 (-> this roll-sound-amount))) + (f0-8 (* (-> this thruster-intensity) (-> this thruster-intensity-scalar))) + (f1-11 (fmax 0.0 (fmin 1.0 f1-9))) + (f28-1 (fmax 0.0 (fmin 1.0 f0-8))) + (f30-1 (lerp 0.0 0.2 f1-11)) + (f0-10 (lerp 0.5 1.0 f28-1)) + ) + (sound-play-by-name + (static-sound-name "fly-turret-jets") + (-> this tilt-sound) + (the int (* 1024.0 f0-10)) + (the int (* 1524.0 f30-1)) + 0 + (sound-group) + #t + ) + ) + (if (= (-> this thrust-mode) 2) + (seek! (-> this turret-aim-blend) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this turret-aim-blend) 0.0 (* 2.0 (seconds-per-frame))) + ) + (seek! (-> this bob-scale-factor) (-> this bob-scale-target) (* 3.0 (seconds-per-frame))) + (let ((f0-30 (* 0.0016666667 (the float (- (current-time) (-> pp clock old-frame-counter)))))) + (cond + ((-> this up-bobbing?) + (+! (-> this bob-t) f0-30) + (+! (-> this root trans y) (* 2048.0 (seconds-per-frame) (-> this bob-scale-factor))) + (seek! (-> this thruster-intensity-scalar) (lerp 1.0 1.1 (-> this bob-scale-factor)) (seconds-per-frame)) + (when (< 1.0 (-> this bob-t)) + (let ((f0-39 1.0) + (f1-23 (-> this bob-t)) + ) + (set! (-> this bob-t) (- f0-39 (- f1-23 (* (the float (the int (/ f1-23 1.0))) 1.0)))) + ) + (set! (-> this up-bobbing?) #f) + ) + ) + (else + (set! (-> this bob-t) (- (-> this bob-t) f0-30)) + (set! (-> this root trans y) + (- (-> this root trans y) (* 2048.0 (seconds-per-frame) (-> this bob-scale-factor))) + ) + (seek! (-> this thruster-intensity-scalar) (lerp 1.0 0.7 (-> this bob-scale-factor)) (seconds-per-frame)) + (when (< (-> this bob-t) 0.0) + (set! (-> this bob-t) (fabs (-> this bob-t))) + (set! (-> this up-bobbing?) #t) + ) + ) + ) + ) + (flying-turret-method-225 this) + (set-vector! (-> this ground-point) (-> this root trans x) (-> this ground-height) (-> this root trans z) 1.0) + (let ((a1-13 (new 'stack-no-clear 'vector))) + (set! (-> a1-13 quad) (-> this ground-point quad)) + (set-virtual-cur-pos! (-> this nav state) a1-13) + ) + (let ((f0-56 (+ (-> this desired-height-offset) (-> this ground-height)))) + (if (< 4096.0 (fabs (- (-> this root trans y) f0-56))) + (seek! (-> this root trans y) f0-56 (* 2867.2 (seconds-per-frame))) + ) + ) + (set! (-> this root trans y) + (fmax (fmin (-> this root trans y) (+ 73728.0 (-> this ground-height))) (+ 12288.0 (-> this ground-height))) + ) + (flying-turret-method-229 this) + (call-parent-method this) + (none) + ) + ) + +(defstate flying-turret-base-state (flying-turret) + :virtual #t + :code sleep-code + ) + +(defstate active (flying-turret) + :virtual #t + :enter (behavior () + (set! (-> self chase-mode) (the-as uint 3)) + (flying-turret-method-230 self (the-as uint 0)) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :trans (behavior () + (when (handle->process (-> self current-enemy)) + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (type? gp-0 process-focusable) + (empty) + ) + ) + (set! (-> self chase-mode) (the-as uint 0)) + (go-virtual hostile) + ) + ) + :code sleep-code + ) + +(defmethod nav-enemy-method-176 ((this flying-turret)) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 sphere-mask) (the-as uint 65)) + ) + 0 + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 acceleration) 409600000.0) + ) + 0 + (none) + ) + +(defmethod nav-enemy-method-177 ((this flying-turret)) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 sphere-mask) (the-as uint 65)) + ) + 0 + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 acceleration) 409600000.0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this flying-turret)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-flying-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *flying-turret-nav-enemy-info*) + (call-parent-method this) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this anim-shuffle) 2) + (set! (-> this anim-walk) 2) + (set! (-> this speed-walk) 102400.0) + (set! (-> this dist-walk-anim) 8192.0) + (set! (-> this dist-run-anim) 16384.0) + (set! (-> this anim-run) 2) + (set! (-> this speed-run) 102400.0) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) + (set! (-> this draw lod-set lod 0 dist) 409600.0) + (set! (-> this engine-sound) (new-sound-id)) + (set! (-> this tilt-sound) (new-sound-id)) + (citizen-method-194 this) + (none) + ) + +(defmethod normalize-heading! ((this flying-turret) (arg0 nav-control)) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod nav-enemy-method-161 ((this flying-turret) (arg0 nav-control)) + (cond + ((and (logtest? (enemy-flag ef37) (-> this enemy-flags)) + (not (logtest? (enemy-flag ef39) (-> this enemy-flags))) + (= (-> this thrust-mode) 0) + ) + (let ((a2-0 (-> arg0 state)) + (v1-8 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-8 quad) (-> a2-0 heading quad)) + (let ((f30-0 (-> arg0 state speed))) + (set! (-> this thrust-dir quad) (-> v1-8 quad)) + (let ((t9-0 vector-vector-xz-distance) + (a0-7 (-> this root trans)) + (a2-3 (-> this nav state)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-3 target-pos quad)) + (let ((f0-1 (t9-0 a0-7 a1-1))) + (set! (-> this speed-target) f30-0) + (if (!= (-> this chase-mode) 3) + (set! (-> this speed-target) (fmin f30-0 f0-1)) + ) + ) + ) + ) + ) + ) + ((= (-> this thrust-mode) 2) + (vector-! (-> this thrust-dir) (-> this focus-pos) (-> this root trans)) + (set! (-> this thrust-dir y) 0.0) + (vector-normalize! (-> this thrust-dir) 1.0) + (set! (-> this speed-target) 0.0) + ) + (else + (set! (-> this speed-target) 0.0) + ) + ) + (none) + ) + +;; WARN: Return type mismatch number vs float. +(defmethod flying-turret-method-225 ((this flying-turret)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (if (not (above-ground? (-> this root) s5-0 (-> this root trans) (collide-spec backgnd) 8192.0 102400.0 1024.0)) + (return 0.0) + ) + (set! (-> this ground-height) (-> s5-0 best-other-tri intersect y)) + ) + ) + +(defun flying-turret-gun-aim-func ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (the-as flying-turret (-> arg0 param1))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> s4-0 focus-pos quad)) + (cspace<-parented-transformq-joint! arg0 arg1) + (vector-! s2-0 s3-0 (-> arg0 bone transform trans)) + ) + (vector-normalize! s2-0 1.0) + (let ((s3-1 (new 'stack-no-clear 'quaternion))) + (let* ((f0-2 (- (asin (-> s2-0 y)))) + (f0-3 (+ -3640.889 f0-2)) + (f0-5 (fmax -4004.9778 (fmin 11286.756 f0-3))) + ) + (quaternion-vector-angle! s3-1 *x-vector* f0-5) + ) + (quaternion-slerp! s3-1 *unity-quaternion* s3-1 (-> s4-0 turret-aim-blend)) + (quaternion*! (-> arg1 quat) (-> arg1 quat) s3-1) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +(defun flying-turret-gun-recoil-jmod-func ((arg0 cspace) (arg1 transformq)) + (-> arg0 param1) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +(deftype flying-turret-shot (guard-shot) + () + ) + + +(defmethod play-impact-sound ((this flying-turret-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "fly-turret-shot") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "guard-shot-hit") + ) + ) + ) + 0 + (none) + ) + +(defun spawn-turret-projectile ((arg0 flying-turret) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 1.0) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-damage-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po15)) + (set! (-> gp-0 vehicle-impulse-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po16)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (spawn-projectile flying-turret-shot gp-0 arg0 *default-dead-pool*) + ) + ) + +(defmethod fire-shot-from-joint-idx ((this flying-turret) (arg0 int)) + (local-vars (a0-12 city-attacker-info)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this node-list data arg0 bone transform uvec quad)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0)))) + (set! (-> s5-0 y) 0.0) + (when (or (< (-> this num-shots-fired) 3) (not (logtest? (-> this draw status) (draw-control-status on-screen)))) + (when (handle->process (-> this focus handle)) + (when (and (-> this attacker-info) + (-> this mission-squad) + (begin (set! a0-12 (get-attacker-at-idx (-> this mission-squad) (-> this attacker-info enemy-index))) a0-12) + (logtest? (-> a0-12 flags) (city-attacker-info-flag cai4)) + ) + (let ((s2-2 (logand (rand-uint31-gen *random-generator*) 1)) + (s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (if (= s2-2 1) + (vector-float*! s3-0 s3-0 -1.0) + ) + (let* ((s2-3 s5-0) + (s1-0 s5-0) + (f30-0 0.1) + (f28-0 0.1) + (v1-28 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-29 (the-as number (logior #x3f800000 v1-28))) + ) + (vector+float*! s2-3 s1-0 s3-0 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-29))))) + ) + ) + ) + ) + ) + (vector-normalize! s5-0 (vector-vector-xz-distance s4-0 (-> this focus-pos))) + (set! (-> s5-0 y) (- (-> this focus-pos y) (-> s4-0 y))) + (vector-normalize! s5-0 40960.0) + (spawn-turret-projectile + this + s4-0 + (vector+! (new 'stack-no-clear 'vector) s4-0 s5-0) + 819200.0 + (the-as vector #f) + ) + ) + ) + ) + +(defun update-ft-gun ((arg0 ft-gun-info) (arg1 float) (arg2 float) (arg3 float)) + (local-vars (f0-5 float)) + (let ((f0-2 (/ (- arg3 arg1) arg2))) + (cond + ((< f0-2 0.0) + (set! (-> arg0 fire?) #f) + (set! (-> arg0 gun-position) 1.0) + ) + ((begin (set! (-> arg0 fire?) #t) (set! f0-5 (fmax 0.0 (fmin 1.0 f0-2))) 0.0 (< f0-5 0.1)) + (set! (-> arg0 gun-position) (- 1.0 (* 10.0 f0-5))) + ) + (else + (set! (-> arg0 gun-position) (* 1.1111112 (+ -0.1 f0-5))) + ) + ) + ) + ) + +(defstate fire (flying-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self guns 0 fire?) #f) + (set! (-> self guns 1 fire?) #f) + (if (< (vector-length (-> self root transv)) 4096.0) + (set! (-> self bob-scale-target) 0.3) + ) + ) + :exit (behavior () + (set! (-> self bob-scale-target) 1.0) + ) + :trans (behavior () + (let ((f30-0 (* 0.0044444446 (the float (- (current-time) (-> self state-time))))) + (f0-1 0.01) + (f28-0 0.26) + (f26-0 0.75) + (gp-0 (new 'stack-no-clear 'ft-gun-info)) + ) + (update-ft-gun gp-0 f0-1 f26-0 f30-0) + (if (and (not (-> self guns 0 fire?)) (-> gp-0 fire?)) + (fire-shot-from-joint-idx self 5) + ) + (mem-copy! (the-as pointer (-> self guns)) (the-as pointer gp-0) 8) + (update-ft-gun gp-0 f28-0 f26-0 f30-0) + (if (and (not (-> self guns 1 fire?)) (-> gp-0 fire?)) + (fire-shot-from-joint-idx self 6) + ) + (mem-copy! (the-as pointer (-> self guns 1)) (the-as pointer gp-0) 8) + ) + (when (or (time-elapsed? (-> self state-time) (seconds 1)) + (let ((v1-24 (ja-group))) + (and (and v1-24 (= v1-24 (-> self draw art-group data 4))) (ja-done? 0)) + ) + ) + (set-time! (-> self last-fire-time)) + (+! (-> self num-shots-fired) 1) + (go-virtual hostile) + ) + ) + :code (behavior () + (when (< (vector-length (-> self root transv)) 4096.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + ) + (set-time! (-> self last-fire-time)) + (+! (-> self num-shots-fired) 1) + (sleep-code) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defmethod event-handler ((this flying-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if #t + (set! (-> this hit-player?) #t) + ) + ) + ) + ) + ) + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + +(defmethod flying-turret-method-230 ((this flying-turret) (arg0 uint)) + (when (!= (-> this thrust-mode) arg0) + (let ((v1-2 arg0)) + (cond + ((= v1-2 2) + (set! (-> this bob-scale-target) 1.0) + ) + ((zero? v1-2) + (set! (-> this bob-scale-target) 0.0) + ) + ) + ) + ) + (set! (-> this thrust-mode) arg0) + arg0 + ) + +(defstate hostile (flying-turret) + :virtual #t + :enter (behavior () + (nav-enemy-method-181 self) + ) + :trans (behavior () + (local-vars (a0-34 city-attacker-info) (a0-39 city-attacker-info) (a0-48 city-attacker-info) (s4-1 object)) + (when (not (handle->process (-> self focus handle))) + (flying-turret-method-226 self) + (if (not (handle->process (-> self focus handle))) + (go-virtual active) + ) + ) + (let ((f0-0 (vector-vector-xz-distance-squared (-> self root trans) (-> self focus-pos))) + (f1-0 245760.0) + ) + (cond + ((< (* f1-0 f1-0) f0-0) + (set! (-> self move-dest quad) (-> self focus-pos quad)) + (set! (-> self chase-mode) (the-as uint 0)) + 0 + ) + ((and (= (-> self chase-mode) 0) (let ((f1-3 163840.0)) + (< f0-0 (* f1-3 f1-3)) + ) + ) + (set! (-> self chase-mode) (the-as uint 1)) + (set! (-> self move-dest quad) (-> self root trans quad)) + ) + ) + ) + (when (= (-> self chase-mode) 1) + (let ((f0-1 (vector-vector-xz-distance-squared (-> self root trans) (-> self move-dest))) + (f1-6 20480.0) + ) + (cond + ((or (< f0-1 (* f1-6 f1-6)) (= (-> self thrust-mode) 2)) + (set-time! (-> self last-check-chase-pos-time)) + (let ((a1-5 (get-handle-pos (-> self squad) (-> self focus handle) (new 'stack-no-clear 'vector))) + (f0-2 245760.0) + ) + (cond + ((or (< (* f0-2 f0-2) (vector-vector-xz-distance-squared (-> self move-dest) a1-5)) (-> self hit-player?)) + (set! (-> self hit-player?) #f) + (squad-control-method-31 (-> self squad) (-> self move-dest) self (-> self current-enemy) 81920.0 0.0) + (flying-turret-method-230 self (the-as uint 0)) + ) + (else + (when (!= (-> self thrust-mode) 2) + (flying-turret-method-230 self (the-as uint 2)) + (set! (-> self num-shots-fired) 0) + (set! (-> self hit-player?) #f) + ) + (set! (-> self move-dest quad) (-> self root trans quad)) + ) + ) + ) + ) + ((time-elapsed? (-> self last-check-chase-pos-time) (seconds 1)) + (set-time! (-> self last-check-chase-pos-time)) + (let ((a1-10 (get-handle-pos (-> self squad) (-> self focus handle) (new 'stack-no-clear 'vector))) + (f0-5 204800.0) + ) + (if (< (* f0-5 f0-5) (vector-vector-xz-distance-squared (-> self move-dest) a1-10)) + (squad-control-method-31 (-> self squad) (-> self move-dest) self (-> self current-enemy) 81920.0 0.0) + ) + ) + ) + ) + ) + ) + (when (and (= (-> self thrust-mode) 2) + (or (and (and (-> self attacker-info) + (-> self mission-squad) + (begin (set! a0-34 (get-attacker-at-idx (-> self mission-squad) (-> self attacker-info enemy-index))) a0-34) + (logtest? (-> a0-34 flags) (city-attacker-info-flag cai4)) + ) + (time-elapsed? (-> self last-fire-time) (seconds 1.2)) + ) + (and (not (and (-> self attacker-info) + (-> self mission-squad) + (begin (set! a0-39 (get-attacker-at-idx (-> self mission-squad) (-> self attacker-info enemy-index))) a0-39) + (logtest? (-> a0-39 flags) (city-attacker-info-flag cai4)) + ) + ) + (time-elapsed? (-> self last-fire-time) (seconds 0.75)) + ) + ) + ) + (let ((s5-0 #t) + (gp-0 #f) + ) + (when (and (handle->process (-> self focus handle)) + (-> self attacker-info) + (-> self mission-squad) + (begin (set! a0-48 (get-attacker-at-idx (-> self mission-squad) (-> self attacker-info enemy-index))) a0-48) + (logtest? (-> a0-48 flags) (city-attacker-info-flag cai4)) + ) + (let ((s4-0 (handle->process (-> self focus handle)))) + (cond + ((not (and (if (type? s4-0 process-focusable) + s4-0 + ) + (begin + (let* ((s4-2 #t) + (s3-0 (handle->process (-> self focus handle))) + (v1-106 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s3-0 process-focusable) + (the-as process-focusable s3-0) + ) + ) + focus-status + ) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + (cmove-#f-nonzero s4-1 v1-106 s4-2) + ) + s4-1 + ) + ) + ) + (set! s5-0 #f) + ) + ((>= (-> self num-shots-fired) 4) + (set! gp-0 #t) + ) + ((< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 40960.0) + (set! gp-0 #t) + ) + ((let ((a0-60 (new 'stack-no-clear 'sphere))) + (set! (-> a0-60 quad) (-> self root trans quad)) + (set! (-> a0-60 r) (-> self root root-prim local-sphere w)) + (or (not (sphere-in-view-frustum? a0-60)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + ) + (+! (-> self num-shots-fired) 1) + (set! s5-0 #f) + ) + ) + ) + ) + (cond + (gp-0 + (squad-control-method-31 (-> self squad) (-> self move-dest) self (-> self current-enemy) 81920.0 0.0) + (flying-turret-method-230 self (the-as uint 0)) + ) + ((not s5-0) + (set-time! (-> self last-fire-time)) + ) + (else + (let ((s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-2 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans))) + ) + (set! (-> s5-1 y) 0.0) + (set! (-> gp-2 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-normalize! gp-2 1.0) + (if (< 0.5 (vector-dot s5-1 gp-2)) + (go-virtual fire) + ) + ) + ) + ) + ) + ) + (let ((a0-71 (-> self nav state)) + (v1-142 (-> self move-dest)) + ) + (logclear! (-> a0-71 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-71 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-71 target-pos quad) (-> v1-142 quad)) + ) + 0 + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod citizen-method-194 ((this flying-turret)) + (call-parent-method this) + (set! (-> this turret-aim-blend) 0.0) + (set! (-> this hit-player?) #f) + (set! (-> this bob-velocity) 0.0) + (let* ((f30-0 14336.0) + (f28-0 10240.0) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (set! (-> this desired-height-offset) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-4))))) + ) + (set! (-> this changed-targets?) #f) + (set! (-> this bob-scale-target) 0.0) + (set! (-> this bob-scale-factor) 0.0) + (set! (-> this up-bobbing?) #t) + (set! (-> this bob-t) 0.0) + (set! (-> this thruster-intensity-scalar) 1.0) + (ja-channel-push! 1 0) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) + ) + (set! (-> this up-bobbing?) #t) + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 1.0) + (logior! (-> this fact options) (actor-option dont-override-fact)) + (set! (-> this fact pickup-spawn-amount) 5.0) + (set! (-> this enemy-flags) + (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag auto-death-phase-out))) + ) + (let ((a0-13 (-> this node-list data 5))) + (set! (-> a0-13 param0) flying-turret-gun-recoil-jmod-func) + (set! (-> a0-13 param1) this) + ) + (let ((a0-14 (-> this node-list data 6))) + (set! (-> a0-14 param0) flying-turret-gun-recoil-jmod-func) + (set! (-> a0-14 param1) this) + ) + (let ((a0-15 (-> this node-list data 4))) + (set! (-> a0-15 param0) flying-turret-gun-aim-func) + (set! (-> a0-15 param1) this) + ) + (set! (-> this last-fire-time) 0) + (set! (-> this pursuit-start-time) 0) + (logclear! (-> this focus-status) (focus-status dangerous)) + (set! (-> this speed) 0.0) + (set! (-> this speed-target) 0.0) + (set! (-> this thrust-dir quad) (the-as uint128 0)) + (quaternion-copy! (-> this last-heading-quat) (-> this root quat)) + (quaternion-identity! (-> this last-roll-quat)) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this thrust-mode) (the-as uint 0)) + (set! (-> this last-check-chase-pos-time) 0) + (let* ((f30-1 65536.0) + (v1-38 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-39 (the-as number (logior #x3f800000 v1-38))) + ) + (set! (-> this circle-angle) (* f30-1 (+ -1.0 (the-as float v1-39)))) + ) + (none) + ) + +(defstate knocked (flying-turret) + :virtual #t + :parent (flying-turret flying-turret-base-state) + :code (behavior () + (cond + ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 221)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 221)) + ) + ) + (when (kg-squad-member-method-220 self) + (let ((v1-36 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> v1-36 hit-xz-reaction) 0.5) + (set! (-> v1-36 hit-y-reaction) 0.6) + (set! (-> v1-36 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + ) + ) + (if (not (-> *setting-control* user-current gun-special-mode)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + ) + (sound-play "fly-turret-die") + (cleanup-for-death self) + ) + ) + +(defmethod deactivate ((this flying-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this engine-sound)) + (sound-stop (-> this tilt-sound)) + (call-parent-method this) + (none) + ) + +(defmethod go-inactive ((this flying-turret)) + (sound-stop (-> this engine-sound)) + (sound-stop (-> this tilt-sound)) + (call-parent-method this) + (none) + ) + +(defmethod citizen-method-215 ((this flying-turret)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 10) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-from-behavior ((this flying-turret) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((6) + (set! (-> this root trans quad) (-> arg0 position quad)) + (when (handle->process (-> arg0 handle)) + (let ((s5-1 (vector+float*! + (new 'stack-no-clear 'vector) + (-> this root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 rotation)) + 49152.0 + ) + ) + ) + (nav-mesh-method-10 (-> this nav state mesh) s5-1 s5-1 (the-as nav-poly #f)) + (let ((v1-13 (-> this nav state))) + (logclear! (-> v1-13 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-13 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-13 target-pos quad) (-> s5-1 quad)) + ) + ) + 0 + ) + (go (method-of-object this exit-transport)) + ) + (else + (call-parent-method this arg0) + ) + ) + (none) + ) + +(defstate exit-transport (flying-turret) + :virtual #t + :enter (behavior () + (set! (-> self chase-mode) (the-as uint 3)) + (flying-turret-method-230 self (the-as uint 0)) + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (nav-enemy-method-176 self) + (let ((v1-12 (-> self nav state))) + (set! (-> v1-12 speed) 0.0) + ) + 0 + (let ((a0-4 (-> self nav state)) + (v1-15 *null-vector*) + ) + (set! (-> a0-4 velocity quad) (-> v1-15 quad)) + ) + 0 + (let ((v1-18 (-> self nav))) + (set! (-> v1-18 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + ) + :trans (behavior () + (let ((t9-0 add-debug-sphere) + (a0-0 #t) + (a1-0 583) + (a3-0 (-> self nav state)) + (a2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-0 quad) (-> a3-0 target-pos quad)) + (t9-0 a0-0 (the-as bucket-id a1-0) a2-0 (meters 2) *color-red*) + ) + (let ((t9-1 vector-vector-xz-distance) + (a0-1 (-> self root trans)) + (a2-1 (-> self nav state)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-1 target-pos quad)) + (if (< (t9-1 a0-1 a1-1) 16384.0) + (go-virtual active) + ) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defmethod get-trans ((this flying-turret) (arg0 int)) + "Get the `trans` for this process." + (case arg0 + ((3) + (let ((s5-1 (new 'static 'vector))) + (set! (-> s5-1 quad) (-> this root trans quad)) + (vector<-cspace! s5-1 (-> this node-list data (-> this enemy-info bullseye-joint))) + (set! (-> s5-1 w) 10240.0) + s5-1 + ) + ) + (else + (call-parent-method this arg0) + ) + ) + ) diff --git a/goal_src/jak3/levels/city/protect/roboguard-city.gc b/goal_src/jak3/levels/city/protect/roboguard-city.gc index c3a7cdce16..18f049d485 100644 --- a/goal_src/jak3/levels/city/protect/roboguard-city.gc +++ b/goal_src/jak3/levels/city/protect/roboguard-city.gc @@ -5,5 +5,2410 @@ ;; name in dgo: roboguard-city ;; dgos: CTYPESC +;; +++robo-flag +(defenum robo-flag + :type uint16 + :bitfield #t + (r0 0) + (r1 1) + (r2 2) + (r3 3) + (r4 4) + (r5 5) + (r6 6) + (r7 7) + (r8 8) + (r9 9) + (r10 10) + (r11 11) + (r12 12) + (r13 13) + (r14 14) + (r15 15) + ) +;; ---robo-flag + + ;; DECOMP BEGINS +(defskelgroup skel-roboguard-city roboguard-city roboguard-city-lod0-jg roboguard-city-idle0-ja + ((roboguard-city-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow roboguard-city-shadow-mg + :origin-joint-index 3 + ) + +(define *roboguard-city-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 15 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 27 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 18 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 17 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-c") + ) + ) + ) + +(deftype roboguard-city (kg-squad-member) + ((los los-control :inline) + (rotation-matrix matrix :inline) + (me-to-focus-dir vector :inline) + (me-to-focus-angle float) + (robo-flags robo-flag) + (torso-aim-blend float) + (torso-angle float) + (torso-seek-speed float) + (torso-to-focus-angle float) + (last-torso-frame-num float) + (stand-angle-threshold float) + (attack-distance float) + (attack-dist-scalar float) + (fire-time time-frame) + (last-attack-time time-frame) + (fired-this-time? symbol) + (last-roll-time time-frame) + (cannot-reach-target? symbol) + (cannot-reach-target-start-time time-frame) + (frustrate-roll-time time-frame) + (target-status squad-target-status :inline) + (last-update-chase-pos-time time-frame) + (random-offset-search float) + (pursuit-start-time time-frame) + (dizzy-start-time time-frame) + (roll-sound sound-id) + ) + (:state-methods + hostile-stand + close-attack + shoot-attack + explode + roll-enter + roll-exit + roll-chase + reposition + dizzy + exit-transport + giant-hostile + ) + (:methods + (roboguard-city-method-233 (_type_ vector vector) symbol) + (fire-shot-from-joint-idx (_type_ int) none) + (roboguard-city-method-235 (_type_) int) + (roboguard-city-method-236 (_type_) int) + (roboguard-city-method-237 (_type_) object) + (roboguard-city-method-238 (_type_ symbol) robo-flag) + (roboguard-city-method-239 (_type_) robo-flag) + (init-draw-params (_type_) none) + ) + ) + + +(set! (-> *lightning-spec-id-table* 43) (new 'static 'lightning-spec + :name "lightning-shock-roboguard-city" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 15.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 819.2 + :duration 90.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +(define *roboguard-city-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 #f + :idle-anim 4 + :notice-anim -1 + :hostile-anim 11 + :hit-anim 4 + :knocked-anim 23 + :knocked-land-anim 24 + :die-anim -1 + :die-falling-anim 25 + :victory-anim 4 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint -1 + :look-at-joint 6 + :bullseye-joint 4 + :notice-distance (meters 50) + :notice-distance-delta (meters 20) + :proximity-notice-distance (meters 30) + :default-hit-points 10.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 20480.0 + :knocked-soft-vxz-hi 28672.0 + :knocked-soft-vy-lo 36864.0 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 49152.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 57344.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 28672.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 114688.0 + :knocked-red-vy-lo 53248.0 + :knocked-red-vy-hi 69632.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 20480.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 10 + :turn-anim 3 + :run-anim 11 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 360) + :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! (-> *roboguard-city-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defpart 4696 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 40)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 4697 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 4698 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defmethod init-enemy-collision! ((this roboguard-city)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy los-blocker)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid deadly 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-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list) + ) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set-vector! (-> v1-12 local-sphere) 0.0 6144.0 0.0 6144.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 4) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core action) (collide-action)) + (set! (-> v1-16 transform-index) 11) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 10240.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-18 prim-core action) (collide-action semi-solid)) + (set-vector! (-> v1-18 local-sphere) 0.0 8192.0 0.0 11468.8) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-20 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defbehavior roboguard-city-turn-torso-post roboguard-city () + (seek! (-> self torso-aim-blend) 1.0 (* 5.0 (seconds-per-frame))) + (let ((v1-3 (joint-node roboguard-city-lod0-jg chest)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) + (set! (-> gp-0 y) 0.0) + (set! (-> s5-1 y) 0.0) + (vector-xz-normalize! gp-0 1.0) + (vector-xz-normalize! s5-1 1.0) + (set! (-> self torso-to-focus-angle) (acos (vector-dot gp-0 s5-1))) + ) + ) + (if (>= 2730.6667 (-> self torso-to-focus-angle)) + (seek! (-> self torso-seek-speed) 0.0 (* 36408.89 (seconds-per-frame))) + (seek! (-> self torso-seek-speed) 21845.334 (* 36408.89 (seconds-per-frame))) + ) + (nav-enemy-simple-post) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior roboguard-city-turret-code roboguard-city () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! roboguard-city-idle-shoot0-loop-ja :num! zero) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.2)) + (suspend) + ) + ) + (let ((gp-1 + (lambda :behavior process + ((arg0 roboguard-city) (arg1 symbol)) + (quaternion-rotate-y! (-> arg0 root quat) (-> arg0 root quat) (* 20480.0 (seconds-per-frame) (if arg1 + 1.0 + -1.0 + ) + ) + ) + ) + ) + (f30-0 (-> self stand-angle-threshold)) + ) + (until #f + (when (< (fabs (-> self me-to-focus-angle)) f30-0) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.5)) + (suspend) + ) + ) + (while (< (fabs (-> self me-to-focus-angle)) f30-0) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-20 (if (< 0.0 (-> self me-to-focus-angle)) + 6 + 8 + ) + ) + (s5-1 (< 0.0 (-> self me-to-focus-angle))) + ) + (ja-no-eval :group! (-> self draw art-group data v1-20) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-1 self s5-1) + (suspend) + (ja :num! (seek!)) + ) + ) + (when (< (fabs (-> self me-to-focus-angle)) f30-0) + (let ((s5-2 (current-time))) + (until (time-elapsed? s5-2 (seconds 0.5)) + (suspend) + ) + ) + (while (< (fabs (-> self me-to-focus-angle)) f30-0) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-40 (if (< 0.0 (-> self me-to-focus-angle)) + 7 + 9 + ) + ) + (s5-3 (< 0.0 (-> self me-to-focus-angle))) + ) + (ja-no-eval :group! (-> self draw art-group data v1-40) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-1 self s5-3) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior roboguard-city-idle-code roboguard-city () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15)) :frame-num 2.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15)) :frame-num 3.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15)) :frame-num 4.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15)) :frame-num 5.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 7.0 0.07) :frame-num 6.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 7.0 0.07)) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 8.0 0.07) :frame-num 7.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 8.0 0.07)) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 9.0 0.07) :frame-num 8.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 9.0 0.07)) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05)) :frame-num 9.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05))) + ) + ) + #f + (none) + ) + +(defstate wait (roboguard-city) + :virtual #t + :code roboguard-city-idle-code + ) + +(defstate active (roboguard-city) + :virtual #t + :trans (behavior () + (nav-enemy-method-181 self) + (let ((t9-2 (-> (find-parent-state) trans))) + (if t9-2 + (t9-2) + ) + ) + (let ((gp-0 (get-current-enemy self))) + (when gp-0 + (let* ((s5-0 self) + (s4-0 (method-of-object s5-0 enemy-method-70)) + (s3-0 (handle->process (-> self target-status handle))) + ) + (s4-0 + s5-0 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus self) + (set! (-> self target-status handle) (process->handle gp-0)) + (go-hostile self) + ) + ) + ) + ) + +(defstate idle (roboguard-city) + :virtual #t + :code sleep-code + :post (behavior () + (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) + (set-time! (-> self last-draw-time)) + ) + (update-focus self) + (ja-post) + ) + ) + +(defstate stare (roboguard-city) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self stand-angle-threshold) 9102.223) + ) + :code roboguard-city-turret-code + :post roboguard-city-turn-torso-post + ) + +(defmethod roboguard-city-method-233 ((this roboguard-city) (arg0 vector) (arg1 vector)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> this root trans quad)) + (set! (-> a1-1 w) (-> this root nav-radius)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-1 255)) + (let* ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (closest-point-on-mesh (-> this nav) s3-0 arg0 (the-as nav-poly #f))) + (s4-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (when s2-0 + (clamp-vector-to-mesh-no-gaps (-> this nav) s3-0 s2-0 arg1 s4-1) + (not (-> s4-1 found-boundary)) + ) + ) + ) + ) + ) + +(defstate dizzy (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (break!) + (logclear! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (if (= (-> self hit-points) 0.0) + (go-virtual explode) + ) + ) + :trans (behavior () + (if (time-elapsed? (-> self dizzy-start-time) (seconds 3)) + (go-virtual hostile) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (let* ((s5-0 (-> *part-id-table* 160)) + (gp-0 (get-field-spec-by-id s5-0 (sp-field-id spt-scale-x))) + (v1-13 (get-field-spec-by-id s5-0 (sp-field-id spt-scale-y))) + ) + (when (and gp-0 v1-13) + (let ((f30-0 (-> gp-0 initial-valuef)) + (f28-0 (-> gp-0 random-rangef)) + ) + (set! (-> gp-0 initial-valuef) (* 0.4 f30-0)) + (set! (-> gp-0 random-rangef) (* 0.4 f28-0)) + (let* ((v1-18 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-19 (the-as number (logior #x3f800000 v1-18))) + ) + (if (< (+ -1.0 (the-as float v1-19)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 10 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-27 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-28 (the-as number (logior #x3f800000 v1-27))) + ) + (if (< (+ -1.0 (the-as float v1-28)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 14 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-36 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-37 (the-as number (logior #x3f800000 v1-36))) + ) + (if (< (+ -1.0 (the-as float v1-37)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 8 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-45 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-46 (the-as number (logior #x3f800000 v1-45))) + ) + (if (< (+ -1.0 (the-as float v1-46)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 12 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-54 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-55 (the-as number (logior #x3f800000 v1-54))) + ) + (if (< (+ -1.0 (the-as float v1-55)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 19 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-63 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-64 (the-as number (logior #x3f800000 v1-63))) + ) + (if (< (+ -1.0 (the-as float v1-64)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 22 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-72 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-73 (the-as number (logior #x3f800000 v1-72))) + ) + (if (< (+ -1.0 (the-as float v1-73)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 18 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-81 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-82 (the-as number (logior #x3f800000 v1-81))) + ) + (if (< (+ -1.0 (the-as float v1-82)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 21 + 0 + 40960.0 + ) + ) + ) + (set! (-> gp-0 initial-valuef) f30-0) + (set! (-> gp-0 random-rangef) f28-0) + ) + ) + ) + (set-time! (-> self state-time)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! roboguard-city-dizzy-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + (update-transforms (-> self root)) + ) + ) + +(defstate roll-enter (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-play "robo-roll" :id (-> self roll-sound)) + (logior! (-> self robo-flags) (robo-flag r2)) + (logclear! (-> self robo-flags) (robo-flag r3)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! roboguard-city-idle-to-ball-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual roll-chase) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f)) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (nav-enemy-simple-post) + ) + ) + +(defstate roll-exit (roboguard-city) + :virtual #t + :event enemy-event-handler + :exit (behavior () + (logclear! (-> self robo-flags) (robo-flag r2)) + (logior! (-> self robo-flags) (robo-flag r7)) + (set! (-> self attack-dist-scalar) 1.0) + (set-time! (-> self last-roll-time)) + ) + :trans (behavior () + (sound-stop (-> self roll-sound)) + ) + :code (behavior () + (ja-channel-push! 1 0) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans)))) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (ja-no-eval :group! roboguard-city-ball-to-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y-to-vector! + (-> self root quat) + (-> self root quat) + (the-as quaternion gp-1) + (* 32768.0 (seconds-per-frame)) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-virtual hostile-stand) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f)) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (nav-enemy-simple-post) + ) + ) + +(defstate roll-chase (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self flags) (citizen-flag in-pursuit)) + (if (not (logtest? (-> self squad alert-state flags) (squad-alert-flag war))) + (logior! (-> self flags) (citizen-flag persistent)) + ) + (set! (-> self attack-dist-scalar) 0.5) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 acceleration) 16384.0) + ) + 0 + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((gp-0 (-> self nav state)) + (v1-19 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-0 heading quad) (-> v1-19 quad)) + ) + 0 + (let ((gp-1 (-> self nav state)) + (v1-24 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-1 velocity quad) (-> v1-24 quad)) + ) + 0 + (set-time! (-> self state-time)) + (set! (-> self frustrate-roll-time) + (the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 451) 1050)) + ) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self frustrate-roll-time)) + (should-check-los? (-> self los) (seconds 0.6)) + ) + (go-virtual roll-exit) + ) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) 81920.0) + ) + 0 + (let ((v1-11 (-> self nav))) + (set! (-> v1-11 turning-acceleration) 20480.0) + ) + 0 + (when (time-elapsed? (-> self last-update-chase-pos-time) (seconds 1)) + (squad-control-method-31 + (-> self squad) + (-> self move-dest) + self + (-> self target-status handle) + (* 0.5 (-> self attack-distance)) + (-> self random-offset-search) + ) + (roboguard-city-method-239 self) + (set-time! (-> self last-update-chase-pos-time)) + ) + (let ((a0-9 (-> self nav state)) + (v1-25 (-> self move-dest)) + ) + (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-9 target-pos quad) (-> v1-25 quad)) + ) + 0 + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (case (roboguard-city-method-235 self) + ((2 3) + (go-virtual roll-exit) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja :group! roboguard-city-ball-ja) + (until #f + (let ((a0-4 (-> self skel root-channel 0))) + (let ((f0-0 0.000024414063) + (a2-0 (-> self nav state)) + (v1-7 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-7 quad) (-> a2-0 velocity quad)) + (set! (-> a0-4 param 0) (* f0-0 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z)))))) + ) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) + ) + (suspend) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defmethod roboguard-city-method-235 ((this roboguard-city)) + (let ((f30-0 (vector-vector-xz-distance (-> this root trans) (-> this move-dest)))) + (vector-vector-xz-distance (-> this root trans) (-> this focus-pos)) + (let ((v1-2 #f) + (s5-0 0) + ) + #t + (cond + ((< 143360.0 f30-0) + (set! s5-0 1) + ) + ((< f30-0 8192.0) + (set! v1-2 (should-check-los? (-> this los) (seconds 0.6))) + ) + ) + (cond + (v1-2 + 2 + ) + ((< 8192.0 f30-0) + (roboguard-city-method-238 this #f) + (if (and (= s5-0 1) + (logtest? (-> this robo-flags) (robo-flag r10)) + (time-elapsed? (-> this last-roll-time) (seconds 1)) + ) + 1 + 0 + ) + ) + (else + (roboguard-city-method-238 this #t) + 2 + ) + ) + ) + ) + ) + +(defmethod roboguard-city-method-236 ((this roboguard-city)) + (local-vars (a0-7 city-attacker-info)) + (vector-vector-xz-distance (-> this root trans) (-> this move-dest)) + (let ((f30-0 (vector-vector-xz-distance (-> this root trans) (-> this focus-pos))) + (s5-0 (get-focus! this)) + ) + (cond + ((and (or (< f30-0 (* (-> this attack-distance) (-> this attack-dist-scalar))) + (not (time-elapsed? (-> this last-roll-time) (seconds 1))) + ) + (and s5-0 + (should-check-los? (-> this los) (seconds 0.6)) + (or (logtest? (-> this draw status) (draw-control-status on-screen)) + (not (and (-> this attacker-info) + (-> this mission-squad) + (begin (set! a0-7 (get-attacker-at-idx (-> this mission-squad) (-> this attacker-info enemy-index))) a0-7) + (logtest? (-> a0-7 flags) (city-attacker-info-flag cai4)) + ) + ) + ) + ) + ) + (cond + ((< (fabs (-> this torso-to-focus-angle)) 3640.889) + (if (>= 24576.0 (vector-vector-xz-distance (-> this root trans) (-> this focus-pos))) + 4 + 5 + ) + ) + (else + 2 + ) + ) + ) + (s5-0 + (cond + ((< f30-0 (* (-> this attack-distance) (-> this attack-dist-scalar))) + (roboguard-city-method-238 this #t) + (when (logtest? (-> this robo-flags) (robo-flag r8)) + (squad-control-method-31 + (-> this squad) + (-> this move-dest) + this + (-> this target-status handle) + (* 0.5 (-> this attack-distance)) + (-> this random-offset-search) + ) + (roboguard-city-method-239 this) + (roboguard-city-method-235 this) + ) + ) + (else + (roboguard-city-method-239 this) + (let* ((f30-2 65536.0) + (v1-37 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-38 (the-as number (logior #x3f800000 v1-37))) + ) + (set! (-> this random-offset-search) (* f30-2 (+ -1.0 (the-as float v1-38)))) + ) + (squad-control-method-31 + (-> this squad) + (-> this move-dest) + this + (-> this target-status handle) + (* 0.5 (-> this attack-distance)) + (-> this random-offset-search) + ) + (roboguard-city-method-235 this) + ) + ) + ) + (else + 6 + ) + ) + ) + ) + +(defstate giant-hostile (roboguard-city) + :virtual #t + :enter (behavior () + (nav-enemy-method-176 self) + (when (-> self nav) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (* (-> self speed-scale) (-> self enemy-info run-travel-speed))) + ) + 0 + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 turning-acceleration) 32768.0) + ) + 0 + (let ((v1-8 (-> self nav))) + (set! (-> v1-8 acceleration) 4096.0) + ) + 0 + (let ((gp-0 (-> self nav state)) + (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-0 heading quad) (-> v1-12 quad)) + ) + 0 + (let ((gp-1 (-> self nav state)) + (v1-17 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-1 velocity quad) (-> v1-17 quad)) + ) + 0 + (let ((v1-20 (-> self nav))) + (set! (-> v1-20 max-rotation-rate) 10922.667) + ) + 0 + (logclear! (-> self nav state nav flags) (nav-control-flag limit-rotation-rate)) + ) + (nav-enemy-method-181 self) + (set! (-> self nav callback-info) *default-nav-callback-info*) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (logior! (-> self nav state nav flags) (nav-control-flag limit-rotation-rate)) + (let ((gp-0 (-> self nav state)) + (v1-5 (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-pos quad) (-> v1-5 quad)) + ) + 0 + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 60) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +(defstate hostile (roboguard-city) + :virtual #t + :enter (behavior () + (if (logtest? (-> self robo-flags) (robo-flag r9)) + (go-virtual giant-hostile) + ) + (nav-enemy-method-176 self) + (when (-> self nav) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 target-speed) (* (-> self speed-scale) (-> self enemy-info run-travel-speed))) + ) + 0 + (let ((v1-12 (-> self nav))) + (set! (-> v1-12 turning-acceleration) 8192.0) + ) + 0 + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 acceleration) 4096.0) + ) + 0 + (let ((gp-0 (-> self nav state)) + (v1-18 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-0 heading quad) (-> v1-18 quad)) + ) + 0 + (let ((gp-1 (-> self nav state)) + (v1-23 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-1 velocity quad) (-> v1-23 quad)) + ) + 0 + ) + (nav-enemy-method-181 self) + (set-time! (-> self state-time)) + (set! (-> self attack-dist-scalar) 0.75) + ) + :exit (behavior () + (set! (-> self attack-dist-scalar) 1.0) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (roboguard-city-method-235 self))) + (cond + ((= v1-5 1) + (cond + ((time-elapsed? (-> self last-roll-time) (seconds 1)) + (go-virtual roll-enter) + ) + ((should-check-los? (-> self los) (seconds 0.6)) + (go-virtual shoot-attack) + ) + ) + ) + ((= v1-5 2) + (if (time-elapsed? (-> self state-time) (-> self reaction-time)) + (go-virtual hostile-stand) + ) + ) + ((= v1-5 3) + (go-virtual reposition) + ) + ((zero? v1-5) + (if (time-elapsed? (-> self state-time) (seconds 2)) + (go-virtual hostile-stand) + ) + ) + ) + ) + (logior! (-> self enemy-flags) (enemy-flag vulnerable)) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 60) + ) + :post (behavior () + (seek! (-> self torso-aim-blend) 0.0 (seconds-per-frame)) + (let ((v1-1 (-> self move-dest)) + (a0-2 (-> self nav state)) + ) + (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-2 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +(defstate hostile-stand (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self stand-angle-threshold) 9102.223) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + (set! (-> self attack-dist-scalar) 2.0) + ) + :exit (behavior () + (nav-enemy-method-179 self) + (set! (-> self attack-dist-scalar) 1.0) + ) + :trans (behavior () + (let ((v1-1 (roboguard-city-method-236 self))) + (cond + ((= v1-1 4) + (go-virtual close-attack) + ) + ((= v1-1 5) + (go-virtual shoot-attack) + ) + ((= v1-1 1) + (go-virtual roll-enter) + ) + ((zero? v1-1) + (if (time-elapsed? (-> self state-time) (-> self reaction-time)) + (go-virtual hostile) + ) + ) + ) + ) + ) + :code roboguard-city-turret-code + :post roboguard-city-turn-torso-post + ) + +(defstate reposition (roboguard-city) + :virtual #t + :parent (roboguard-city hostile-stand) + ) + +(defstate close-attack (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-time! (-> self fire-time)) + (nav-enemy-method-180 self 12288.0 (the-as float #f)) + (let* ((v1-6 *game-info*) + (v0-1 (+ (-> v1-6 attack-id) 1)) + ) + (set! (-> v1-6 attack-id) v0-1) + (set! (-> self persistent-attack-id) v0-1) + ) + ) + :exit (behavior () + (nav-enemy-method-179 self) + (logclear! (-> self robo-flags) (robo-flag r7)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (when #t + (let ((s5-0 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 2))) + (when (logtest? (-> s5-0 prim-core action) (collide-action deadly)) + (let ((gp-0 (new 'stack 'sphere))) + (set! (-> gp-0 quad) (-> s5-0 prim-core world-sphere quad)) + (let ((s5-1 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-1 384)) + (let* ((s3-0 (-> s5-1 s4-0)) + (v1-12 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-12 + (let* ((s2-0 (-> v1-12 process)) + (s3-1 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when s3-1 + (if (and (!= *target* s3-1) + (!= self s3-1) + (not (focus-test? (the-as process-focusable s3-1) disable dead inactive)) + (logtest? (process-mask crate guard vehicle civilian metalhead) (-> s3-1 mask)) + (let ((f0-0 (vector-vector-xz-distance-squared gp-0 (get-trans (the-as process-focusable s3-1) 3))) + (f1-0 10240.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (send-attack self s3-1 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) + ) + ) + ) + ) + ) + ) + ) + (let* ((s4-1 *target*) + (s5-2 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (when (and s5-2 (< (vector-vector-distance (get-trans s5-2 0) gp-0) (-> gp-0 r))) + (if (and (!= *target* s5-2) + (!= self s5-2) + (not (focus-test? s5-2 disable dead inactive)) + (logtest? (process-mask crate guard vehicle civilian metalhead) (-> s5-2 mask)) + (let ((f0-2 (vector-vector-xz-distance-squared gp-0 (get-trans s5-2 3))) + (f1-4 10240.0) + ) + (< f0-2 (* f1-4 f1-4)) + ) + ) + (send-attack self s5-2 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) + ) + ) + ) + ) + ) + ) + ) + ) + :code (behavior () + (let ((f30-0 + (lerp-scale 0.0 1.0 (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 12288.0 20480.0) + ) + ) + (ja-channel-push! 2 (seconds 0.3)) + (ja-no-eval :group! roboguard-city-punch-close-rotate-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-city-punch-far-rotate-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (seek-to-point-toward-point! + (-> self root) + (-> self focus-pos) + (* 1.2 (-> self nav max-rotation-rate)) + (seconds 0.02) + ) + (seek! (-> self torso-aim-blend) 0.0 (* 3.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (let ((f28-0 8192.0)) + (let* ((a0-10 (-> self root root-prim)) + (v1-53 (-> (the-as collide-shape-prim-group a0-10) child 2)) + ) + (+! (-> a0-10 local-sphere w) f28-0) + (set! (-> v1-53 prim-core action) (collide-action solid deadly)) + (set! (-> v1-53 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-53 prim-core collide-with) + (collide-spec jak bot civilian enemy obstacle hit-by-others-list player-list) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! roboguard-city-punch-close-go-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-city-punch-far-go-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 2 prim-core action) + (collide-action) + ) + (logclear! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! roboguard-city-punch-close-hold-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-city-punch-far-hold-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (suspend) + (ja :num! (seek! max 0.75)) + ) + (let* ((v1-147 (the-as collide-shape-prim-group (-> self root root-prim))) + (a0-26 (-> v1-147 child 2)) + ) + (set! (-> v1-147 local-sphere w) (- (-> v1-147 local-sphere w) f28-0)) + (set! (-> a0-26 prim-core collide-as) (collide-spec)) + (set! (-> a0-26 prim-core collide-with) (collide-spec)) + ) + ) + ) + 0 + (go-virtual hostile-stand) + ) + :post nav-enemy-simple-post + ) + +(defstate shoot-attack (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self fired-this-time?) #f) + (set-time! (-> self state-time)) + (set-time! (-> self fire-time)) + (set! (-> self last-torso-frame-num) 0.0) + (set! (-> self stand-angle-threshold) 16384.0) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + (nav-enemy-method-181 self) + ) + :exit (behavior () + (when (> (-> self skel float-channels) 0) + (let ((a0-1 (joint-control-method-12 (-> self skel) 0))) + (joint-channel-float-delete! a0-1) + ) + ) + (logclear! (-> self robo-flags) (robo-flag r7)) + (set! (-> self fired-this-time?) #f) + (nav-enemy-method-179 self) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self fire-time) (seconds 0.6)) (zero? (-> self skel float-channels))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (-> self fired-this-time?)) + (let ((v1-12 (roboguard-city-method-236 self))) + (cond + ((= v1-12 4) + (go-virtual close-attack) + ) + ((= v1-12 1) + (go-virtual roll-enter) + ) + ((= v1-12 6) + (go-virtual hostile-stand) + ) + ((zero? v1-12) + (go-virtual hostile) + ) + ) + ) + ) + (let ((v1-28 (ja-channel-float! (the-as art-joint-anim roboguard-city-idle-shoot0-loop-ja) 0.0 0.0 0.0))) + (when v1-28 + (set! (-> self skel interp-select 0) #x13bb8) + (set! (-> self skel interp-select 1) 0) + (set! (-> v1-28 param 0) 1.0) + (set! (-> v1-28 param 1) 1.0) + (set! (-> v1-28 param 2) 2.0) + (set! (-> v1-28 num-func) num-func-interp1-play!) + ) + ) + (set-time! (-> self fire-time)) + ) + (let ((gp-0 (joint-control-method-12 (-> self skel) 0))) + (when gp-0 + (let ((f1-0 (-> gp-0 frame-num)) + (f0-3 (-> self last-torso-frame-num)) + ) + (cond + ((and (< 0.0 f1-0) (>= 0.0 f0-3)) + (fire-shot-from-joint-idx self 11) + ) + ((and (< 3.0 f1-0) (>= 3.0 f0-3)) + (fire-shot-from-joint-idx self 15) + ) + ) + ) + (set! (-> self last-torso-frame-num) (-> gp-0 frame-num)) + ) + ) + ) + :code roboguard-city-turret-code + :post roboguard-city-turn-torso-post + ) + +(defstate knocked (roboguard-city) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self robo-flags) (robo-flag r7)) + (logclear! (-> self robo-flags) (robo-flag r2)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) + ) + (when (and (< 0.0 (-> self hit-points)) (logtest? (-> self draw status) (draw-control-status on-screen)) #f) + (let* ((s5-0 (-> *part-id-table* 160)) + (gp-1 (get-field-spec-by-id s5-0 (sp-field-id spt-scale-x))) + (v1-19 (get-field-spec-by-id s5-0 (sp-field-id spt-scale-y))) + ) + (when (and gp-1 v1-19) + (let ((f30-0 (-> gp-1 initial-valuef)) + (f28-0 (-> gp-1 random-rangef)) + ) + (set! (-> gp-1 initial-valuef) (* 0.4 f30-0)) + (set! (-> gp-1 random-rangef) (* 0.4 f28-0)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 10 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 14 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 8 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 12 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 19 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 22 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 18 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 21 + 0 + 40960.0 + ) + (set! (-> gp-1 initial-valuef) f30-0) + (set! (-> gp-1 random-rangef) f28-0) + ) + ) + ) + ) + ) + ) + +(defmethod go-die ((this roboguard-city)) + (go (method-of-object this explode)) + ) + +(defstate knocked-recover (roboguard-city) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member knocked-recover) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +(defmethod go-hostile ((this roboguard-city)) + (local-vars (v1-3 enemy-flag) (v1-5 enemy-flag)) + (logior! (-> this enemy-flags) (enemy-flag vulnerable)) + (let ((v1-2 (-> this enemy-flags))) + (if (logtest? v1-2 (enemy-flag attackable-backup)) + (set! v1-3 (logior v1-2 (enemy-flag attackable))) + (set! v1-3 (logclear v1-2 (enemy-flag attackable))) + ) + ) + (set! (-> this enemy-flags) v1-3) + (let ((v1-4 (-> this enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-4) + (set! v1-5 (logior (enemy-flag trackable) v1-4)) + (set! v1-5 (logclear v1-4 (enemy-flag trackable))) + ) + ) + (set! (-> this enemy-flags) v1-5) + (cond + ((handle->process (-> this focus handle)) + (logior! (-> this flags) (citizen-flag hostile)) + (go (method-of-object this hostile)) + ) + (else + (go (method-of-object this active)) + ) + ) + ) + +(defstate die (roboguard-city) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (go-virtual explode) + ) + ) + +(defstate explode (roboguard-city) + :virtual #t + :enter (behavior () + (sound-play "robo-explode") + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + ) + :code (behavior () + (let ((v1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node roboguard-city-lod0-jg chest)))) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) + ) + ) + ) + (when (kg-squad-member-method-220 self) + (let ((v1-32 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> v1-32 hit-xz-reaction) 0.95) + (set! (-> v1-32 hit-y-reaction) 0.6) + (set! (-> v1-32 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + ) + ) + (cleanup-for-death self) + ) + ) + +(deftype roboguard-shot (guard-shot) + () + ) + + +(defmethod play-impact-sound ((this roboguard-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "robo-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "guard-shot-hit") + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer roboguard-shot). +(defun spawn-roboguard-projectile ((arg0 roboguard-city) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 1.0) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-damage-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po15)) + (set! (-> gp-0 vehicle-impulse-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po16)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as (pointer roboguard-shot) (spawn-projectile roboguard-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +(defmethod fire-shot-from-joint-idx ((this roboguard-city) (arg0 int)) + (let ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0))) + (s4-0 (-> this rotation-matrix fvec)) + ) + (set! (-> s4-0 y) 0.0) + (let ((f0-1 (vector-vector-xz-distance s5-0 (-> this focus-pos)))) + (vector-normalize! s4-0 f0-1) + ) + (set! (-> s4-0 y) (- (-> this focus-pos y) (-> s5-0 y))) + (vector-normalize! s4-0 40960.0) + (vector-rotate-around-y! s4-0 s4-0 (-> this torso-angle)) + (spawn-roboguard-projectile + this + s5-0 + (vector+! (new 'stack-no-clear 'vector) s5-0 s4-0) + 819200.0 + (the-as vector #f) + ) + ) + (set! (-> this fired-this-time?) #t) + 0 + (none) + ) + +(defmethod knocked-anim ((this roboguard-city) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 0) + (let ((v1-0 #t)) + (case (-> this incoming knocked-type) + (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) + (set! v1-0 #f) + ) + ) + (if (logtest? (-> this robo-flags) (robo-flag r2)) + (set! v1-0 #t) + ) + (cond + (v1-0 + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 25))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 25)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 25)) num-func-seek!) + ) + ) + (else + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-11 param 1) (-> arg0 anim-speed)) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) + ) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this roboguard-city) (arg0 enemy-knocked-info)) + (let ((v1-0 #t)) + (case (-> this incoming knocked-type) + (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) + (set! v1-0 #f) + ) + ) + (if (logtest? (-> this robo-flags) (robo-flag r2)) + (set! v1-0 #t) + ) + (cond + (v1-0 + (let ((v1-3 (-> this skel root-channel 0))) + (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 26))) + (set! (-> v1-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 26)) frames num-frames) -1)) + ) + (set! (-> v1-3 param 1) (-> arg0 anim-speed)) + (set! (-> v1-3 frame-num) 0.0) + (joint-control-channel-group! v1-3 (the-as art-joint-anim (-> this draw art-group data 26)) num-func-seek!) + ) + ) + (else + (let ((v1-7 (-> this skel root-channel 0))) + (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 24))) + (set! (-> v1-7 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1)) + ) + (set! (-> v1-7 param 1) (-> arg0 anim-speed)) + (set! (-> v1-7 frame-num) 0.0) + (joint-control-channel-group! v1-7 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!) + ) + ) + ) + ) + #t + ) + +(defmethod event-handler ((this roboguard-city) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((or (= (-> this hit-points) 0.0) + (and (>= 1.0 (-> this hit-points)) (= (-> this incoming knocked-type) (knocked-type blue-shot))) + ) + (on-dying this) + (go (method-of-object this explode)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (else + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; WARN: Return type mismatch int vs process. +(defmethod update-focus ((this roboguard-city)) + (the-as process 0) + ) + +(defmethod enemy-common-post ((this roboguard-city)) + (roboguard-city-method-237 this) + (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) + (when s5-0 + (set! (-> this focus-pos quad) (-> (get-trans s5-0 3) quad)) + (los-control-method-9 (-> this los) s5-0 (-> this focus-pos) 819.2 4096.0) + ) + ) + (vector-! (-> this me-to-focus-dir) (-> this focus-pos) (-> this root trans)) + (set! (-> this me-to-focus-dir y) 0.0) + (vector-xz-normalize! (-> this me-to-focus-dir) 1.0) + (let* ((a1-6 (-> this rotation-matrix fvec)) + (s5-1 (-> this rotation-matrix)) + (f0-1 (vector-vector-angle-safe (-> this me-to-focus-dir) a1-6)) + ) + (if (< (vector-dot (-> this me-to-focus-dir) (the-as vector s5-1)) 0.0) + (set! f0-1 (* -1.0 f0-1)) + ) + (set! (-> this me-to-focus-angle) f0-1) + ) + (if (= (-> this faction-mode) 1) + (logclear! (-> this flags) (citizen-flag persistent)) + ) + (when (logtest? (-> this robo-flags) (robo-flag r8)) + (squad-control-method-31 + (-> this squad) + (-> this move-dest) + this + (-> this target-status handle) + (* 0.5 (-> this attack-distance)) + (-> this random-offset-search) + ) + (roboguard-city-method-239 this) + ) + (cond + ((logtest? (-> this robo-flags) (robo-flag r2)) + (let ((s5-3 (vector-! (new 'stack-no-clear 'vector) (math-camera-pos) (-> this root trans)))) + (set! (-> s5-3 y) 0.0) + (vector-normalize! s5-3 1.0) + (let ((a1-9 (-> this nav state)) + (v1-35 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-35 quad) (-> a1-9 heading quad)) + 0.0 + (let* ((f0-8 (vector-dot s5-3 v1-35)) + (f0-9 (+ 1.0 f0-8)) + (f0-10 (* 0.5 f0-9)) + (f0-11 (lerp -0.2 0.0 f0-10)) + ) + (sound-play-by-name + (static-sound-name "robo-roll") + (-> this roll-sound) + 1024 + (the int (* 1524.0 f0-11)) + 0 + (sound-group) + #t + ) + ) + ) + ) + ) + (else + (sound-stop (-> this roll-sound)) + ) + ) + (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) + ((method-of-type kg-squad-member enemy-common-post) this) + (none) + ) + +(defmethod deactivate ((this roboguard-city)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this roll-sound)) + (call-parent-method this) + (none) + ) + +(defmethod coin-flip? ((this roboguard-city)) + #f + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod init-draw-params ((this roboguard-city)) + (logior! (-> this robo-flags) (robo-flag r9)) + (setup-masks (-> this draw) -1 0) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.1 1.0) + (set-vector! (-> this draw color-emissive) 0.1 0.5 0.5 1.5) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (none) + ) + +;; WARN: Return type mismatch focus-status vs none. +(defmethod citizen-method-194 ((this roboguard-city)) + (local-vars (a0-21 int)) + (set! (-> this kg-type) (the-as uint 6)) + (call-parent-method this) + (set! (-> this fired-this-time?) #f) + (set! (-> this dizzy-start-time) 0) + (set! (-> this target-status handle) (the-as handle #f)) + (set! (-> this robo-flags) (robo-flag)) + (set! (-> this cannot-reach-target?) #f) + (set! (-> this cannot-reach-target-start-time) 0) + (let* ((f30-0 65536.0) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (set! (-> this random-offset-search) (* f30-0 (+ -1.0 (the-as float v1-4)))) + ) + (logior! (-> this robo-flags) (robo-flag r10)) + (set! (-> this torso-aim-blend) 0.0) + (set! (-> this torso-angle) 0.0) + (set! (-> this torso-seek-speed) 0.0) + (set! (-> this torso-to-focus-angle) 0.0) + (let* ((v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + (f0-10 (+ -1.0 (the-as float v1-10))) + ) + (cond + ((< f0-10 0.1) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + ((< f0-10 0.26) + (set! (-> this fact pickup-type) (pickup-type health)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + (else + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 10.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + ) + ) + (set! (-> this attack-distance) (rnd-float-range this 49152.0 106496.0)) + (set! (-> this attack-dist-scalar) 1.0) + (set! (-> this last-attack-time) 0) + (let ((v1-37 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 3) 2)) + (s5-0 0) + ) + 0 + (let* ((a0-15 10) + (s3-0 0) + (s4-0 (+ a0-15 -3)) + ) + (dotimes (a0-16 v1-37) + (set! s3-0 (logior s3-0 (ash 1 a0-16))) + ) + (dotimes (s2-0 s4-0) + (let ((a0-18 (mod (the-as int (rand-uint31-gen *random-generator*)) s4-0)) + (a1-5 (logtest? s3-0 (ash 1 s2-0))) + ) + (let ((v1-45 (logtest? s3-0 (ash 1 a0-18)))) + (if a1-5 + (set! a0-21 (logior s3-0 (ash 1 a0-18))) + (set! a0-21 (logclear s3-0 (ash 1 a0-18))) + ) + (if v1-45 + (set! s3-0 (logior a0-21 (ash 1 s2-0))) + (set! s3-0 (logclear a0-21 (ash 1 s2-0))) + ) + ) + ) + ) + (let ((v1-55 0)) + (dotimes (a0-25 s4-0) + (while (or (= v1-55 0) (= v1-55 1) (= v1-55 4)) + (+! v1-55 1) + ) + (if (logtest? s3-0 (ash 1 a0-25)) + (set! s5-0 (logior s5-0 (ash 1 v1-55))) + ) + (+! v1-55 1) + ) + ) + ) + (let* ((f30-1 0.2) + (v1-60 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-61 (the-as number (logior #x3f800000 v1-60))) + (f0-21 (+ -1.0 (the-as float v1-61))) + ) + (cond + ((< f0-21 (* 0.5 f30-1)) + (set! s5-0 (logior s5-0 2)) + ) + ((< f0-21 f30-1) + (set! s5-0 (logior s5-0 16)) + ) + ) + ) + (setup-masks (-> this draw) -1 0) + (setup-masks (-> this draw) 0 s5-0) + ) + (logclear! (-> this focus-status) (focus-status dangerous)) + (none) + ) + +(defmethod init-enemy! ((this roboguard-city)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-city" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this roll-sound) (new-sound-id)) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) + ) + (init-enemy-defaults! this *roboguard-city-nav-enemy-info*) + (let ((t9-4 (method-of-type kg-squad-member init-enemy!))) + (t9-4 this) + ) + (set! (-> this last-update-chase-pos-time) 0) + (init-los! + (-> this los) + this + (seconds 0.1) + 327680.0 + (collide-spec backgnd obstacle hit-by-others-list los-blocker) + ) + (set! (-> this water-anim) 3) + (let ((v1-13 (-> this node-list data 4))) + (set! (-> v1-13 param0) + (lambda ((arg0 cspace) (arg1 transformq)) + (let ((s3-0 (the-as roboguard-city (-> arg0 param1))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s1-0 (-> s3-0 rotation-matrix)) + (s2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 focus-pos) (-> arg0 bone transform trans))) + ) + (set! (-> s2-1 y) 0.0) + (set! (-> s1-0 fvec y) 0.0) + (set! (-> s1-0 rvec y) 0.0) + (vector-xz-normalize! s2-1 1.0) + (vector-xz-normalize! (-> s1-0 fvec) 1.0) + (vector-xz-normalize! (-> s1-0 rvec) 1.0) + (let ((f0-6 (acos (fmax (vector-dot (-> s1-0 fvec) s2-1) (cos 18204.445))))) + (if (< (vector-dot (-> s1-0 rvec) s2-1) 0.0) + (set! f0-6 (* -1.0 f0-6)) + ) + (set! (-> s3-0 torso-angle) + (* (-> s3-0 torso-aim-blend) + (seek (-> s3-0 torso-angle) f0-6 (* (-> s3-0 torso-seek-speed) (seconds-per-frame))) + ) + ) + ) + ) + (quaternion-vector-angle! gp-0 *y-vector* (-> s3-0 torso-angle)) + (quaternion*! (-> arg1 quat) (-> arg1 quat) gp-0) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + (set! (-> v1-13 param1) this) + ) + (set! (-> this anim-shuffle) 10) + (set! (-> this anim-walk) 10) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this dist-run-anim) 26624.0) + (set! (-> this anim-run) 11) + (set! (-> this speed-run) 49152.0) + (set! (-> this draw lod-set lod 0 dist) 491520.0) + 0 + (none) + ) + +(defmethod go-stare ((this roboguard-city)) + (go (method-of-object this reposition)) + ) + +;; WARN: disable def twice: 6. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod get-current-enemy ((this roboguard-city)) + (if #t + (handle->process (-> this attacker-info enemy)) + (squad-control-city-method-35 (-> this squad) this (-> this target-status handle)) + ) + ) + +(defmethod roboguard-city-method-237 ((this roboguard-city)) + (when (not (handle->process (-> this target-status handle))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this target-status handle) (the-as handle #f)) + ) + (let ((a0-6 (get-current-enemy this))) + (cond + (a0-6 + (let ((v1-9 (process->handle a0-6))) + (when (!= v1-9 (-> this target-status handle)) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + ) + (logior! (-> this flags) (citizen-flag hostile)) + (set! (-> this target-status handle) (the-as handle v1-9)) + (set! (-> this current-enemy) (the-as handle v1-9)) + ) + ) + (else + (set! (-> this target-status handle) (the-as handle #f)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 3))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (if (time-elapsed? (-> this pursuit-start-time) (seconds 5)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit)) + ) + (let ((v1-26 (new 'stack-no-clear 'vector))) + (set! (-> v1-26 quad) (-> this root trans quad)) + (+! (-> v1-26 y) 8192.0) + ) + (let* ((s5-0 (handle->process (-> this target-status handle))) + (a0-36 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and a0-36 + (not (logtest? (-> (the-as process-focusable a0-36) focus-status) (focus-status disable dead inactive))) + ) + (let* ((s5-1 this) + (s4-0 (method-of-object s5-1 enemy-method-70)) + (s3-0 (handle->process (-> this target-status handle))) + ) + (s4-0 + s5-1 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus this) + (let ((f0-2 (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (f1-1 204800.0) + ) + (when (< f0-2 (* f1-1 f1-1)) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + (when (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (let ((v0-6 (the-as object (logior (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + ) + ) + ) + ((!= (-> this target-status handle) #f) + (set! (-> this target-status handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-208 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) + ) + ) + ) + ) + +(defmethod roboguard-city-method-238 ((this roboguard-city) (arg0 symbol)) + (cond + ((or arg0 (logtest? (-> this nav state flags) (nav-state-flag blocked avoiding-sphere))) + (when (not (-> this cannot-reach-target?)) + (set! (-> this cannot-reach-target?) #t) + (set-time! (-> this cannot-reach-target-start-time)) + ) + ) + (else + (set! (-> this cannot-reach-target?) #f) + (set! (-> this cannot-reach-target-start-time) 0) + 0 + ) + ) + (when (and (-> this cannot-reach-target?) (time-elapsed? (-> this cannot-reach-target-start-time) (seconds 0.5))) + (let* ((f30-0 65536.0) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> this random-offset-search) (* f30-0 (+ -1.0 (the-as float v1-16)))) + ) + (let ((v0-0 (logior (-> this robo-flags) (robo-flag r8)))) + (set! (-> this robo-flags) v0-0) + v0-0 + ) + ) + ) + +(defmethod roboguard-city-method-239 ((this roboguard-city)) + (set! (-> this cannot-reach-target?) #f) + (set! (-> this cannot-reach-target-start-time) 0) + (let ((v0-0 (logclear (-> this robo-flags) (robo-flag r8)))) + (set! (-> this robo-flags) v0-0) + v0-0 + ) + ) + +(defmethod penetrate->next-state ((this roboguard-city) (arg0 process) (arg1 event-message-block) (arg2 float)) + (cond + ((logtest? (penetrate emp-blast) (-> this incoming penetrate-using)) + (set-time! (-> this dizzy-start-time)) + (if #t + 'hit-knocked + 'nothing + ) + ) + (else + (call-parent-method this arg0 arg1 arg2) + ) + ) + ) + +(defmethod citizen-method-215 ((this roboguard-city)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 9) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-from-behavior ((this roboguard-city) (arg0 traffic-object-spawn-params)) + (if (= (-> arg0 guard-type) 7) + (init-draw-params this) + ) + (case (-> arg0 behavior) + ((6) + (set! (-> this root trans quad) (-> arg0 position quad)) + (go (method-of-object this exit-transport)) + ) + (else + (call-parent-method this arg0) + ) + ) + (none) + ) + +(defstate exit-transport (roboguard-city) + :virtual #t + :enter (behavior () + (nav-enemy-method-182 self) + (logclear! (-> self root status) (collide-status on-surface touch-surface impact-surface)) + ) + :trans (behavior () + (when (logtest? (-> self root status) (collide-status on-surface touch-surface impact-surface)) + (sound-play "robo-roll" :id (-> self roll-sound)) + (logior! (-> self robo-flags) (robo-flag r2)) + (go-virtual roll-chase) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja :group! roboguard-city-ball-ja :num! zero) + (sleep-code) + ) + :post (behavior () + (enemy-falling-post) + ) + ) diff --git a/goal_src/jak3/levels/city/slums/ctysluma-part.gc b/goal_src/jak3/levels/city/slums/ctysluma-part.gc index 3dc596604c..2ed51d3099 100644 --- a/goal_src/jak3/levels/city/slums/ctysluma-part.gc +++ b/goal_src/jak3/levels/city/slums/ctysluma-part.gc @@ -5,5 +5,1686 @@ ;; name in dgo: ctysluma-part ;; dgos: CTA +(define-extern *range-color-rubble-flame* curve-color-fast) +(define-extern *range-alpha-rubble-flame* curve2d-fast) +(define-extern *range-scale-rubble-flame-x* curve2d-fast) +(define-extern *range-scale-rubble-flame-y* curve2d-fast) +(define-extern *r-curve-rubble-flame* curve2d-fast) +(define-extern *g-curve-rubble-flame* curve2d-fast) +(define-extern *b-curve-rubble-flame* curve2d-fast) +(define-extern *curve-alpha-rubble-flame* curve2d-fast) +(define-extern *curve-scale-rubble-flame-x* curve2d-fast) +(define-extern *curve-scale-rubble-flame-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-ctysluma-barrel-fire + :id 951 + :bounds (static-bspherem 0 3 0 4) + :parts ((sp-item 3389 :fade-after (meters 50) :falloff-to (meters 80)) + (sp-item 3390 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 0.335) :length (seconds 0.167)) + (sp-item 3391 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.4) :length (seconds 0.185) :offset 20) + (sp-item 3392 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 0.535) :length (seconds 0.1) :offset 35) + (sp-item 3390 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.85) :length (seconds 0.2) :offset 65) + (sp-item 3391 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 1.25) :length (seconds 0.135) :offset 15) + (sp-item 3392 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 1.435) :length (seconds 0.167) :offset 85) + (sp-item 3390 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 2) :length (seconds 0.235) :offset 100) + (sp-item 3391 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 4.167) :length (seconds 0.15) :offset 450) + (sp-item 3392 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 5) :length (seconds 0.085) :offset 115) + (sp-item 3390 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 7) :length (seconds 0.185) :offset 80) + (sp-item 3393 :fade-after (meters 20) :falloff-to (meters 10) :binding 3388) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3394 :fade-after (meters 50) :falloff-to (meters 50)) + (sp-item 3395 :fade-after (meters 30) :falloff-to (meters 30)) + (sp-item 3396 :fade-after (meters 70) :flags (sp6)) + ) + ) + +(defpart 3396 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 12.0) + (:fade-a -0.4) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 10240.0) + ) + ) + +(defpart 3393 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 0.8) + (:sound (static-sound-spec "fire-pop" :group 0 :volume 10000.0)) + (:x (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:accel-y (meters -0.000033333334) (meters -0.00006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3388 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.1) (meters 0.3)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 128.0) + (:b 128.0) + (:a 96.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.026666667) (meters 0.053333335)) + (:vel-y (meters 0)) + (:vel-z (meters -0.0013333333) (meters 0.0026666666)) + (:fade-r 0.0) + (:fade-g -0.7111111) + (:fade-b -0.7111111) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.6)) + (:next-launcher 3397) + ) + ) + +(defpart 3397 + :init-specs ((:fade-r -1.0666667) (:fade-g 1.0666667) (:fade-b 1.0666667)) + ) + +(defpart 3390 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3398) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 87)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 3391 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3398) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 120) (degrees 90)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 3392 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3398) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 240) (degrees 110)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 3398 + :init-specs ((:b 0.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.4 -0.2) + (:next-time (seconds 0.135) (seconds 0.03)) + (:next-launcher 3399) + ) + ) + +(defpart 3399 + :init-specs ((:fade-r -0.125) (:fade-g 0.4) (:fade-b 0.4)) + ) + +(defpart 3389 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 4.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 3394 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.4) + (:x (meters -0.25) (meters 0.5)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.64) + (:fade-g -0.32) + (:fade-b -0.32) + (:fade-a -0.017777778 -0.026666667) + (:accel-y (meters -0.000006666667)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.5) (seconds 0.165)) + (:next-launcher 3400) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3400 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpart 3395 + :init-specs ((:num 0.4) + (:x (meters 0) (meters 0.2)) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-x (meters 0) (meters 0.006666667)) + (:vel-y (meters 0.02) (meters 0.013333334)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3401) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3401 + :init-specs ((:fade-b -0.68266666)) + ) + +(defpartgroup group-ctysluma-streetlight-glows + :id 952 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 3 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 3402 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 2 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 3 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 30.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 3402 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 10.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctysluma-steamescape + :id 953 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3403 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3404 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 3403 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 1.0) + (:x (meters -0.8) 4 (meters 0.4)) + (:y (meters -0.1) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3405) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3404 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -0.4) 1 (meters 0.4)) + (:y (meters 0) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3405) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3405 + :init-specs ((:fade-a -0.064 -0.064)) + ) + +(defpartgroup group-ctysluma-steam-drift + :id 954 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3406 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7))) + ) + +(defpart 3406 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.1) + (:z (meters 1)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.53333336) + (:accel-y (meters 0.00006666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x405c00 #x400000)) + (:next-time (seconds 0.5)) + (:next-launcher 3407) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3407 + :init-specs ((:fade-a -0.07619048 -0.07619048)) + ) + +(defpartgroup group-ctysluma-steamvent + :id 955 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3408 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + (sp-item 3409 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7)) + ) + ) + +(defpart 3408 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.0 5.0) + (:scale-x (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b :copy g) + (:a 64.0 32.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.083333336) (meters 0.033333335)) + (:fade-a -0.64 -0.64) + (:friction 0.93 0.025) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:launchrot-x (degrees -7.5) (degrees 15)) + (:launchrot-y (degrees -7.5) (degrees 15)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3409 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.083333336) (meters 0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.016666668)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.96) + (:friction 0.93 0.025) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3410) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3410 + :init-specs ((:fade-a -0.48 -0.48)) + ) + +(defpartgroup group-ctysluma-shootout-fire-blue + :id 956 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 3411 :flags (sp7))) + ) + +(defpart 3411 + :init-specs ((:texture (blue-tracer ctysluma-sprite)) + (:num 0.0 0.02) + (:scale-x (meters 10)) + (:rot-x 4) + (:scale-y (meters 1) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.0675)) + (:vel-z (meters 0.5)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -5) (degrees 10)) + (:conerot-y (degrees -30) (degrees 60)) + ) + ) + +(defpartgroup group-ctysluma-shootout-fire-red + :id 957 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 3412 :flags (sp7))) + ) + +(defpart 3412 + :init-specs ((:texture (red-tracer ctysluma-sprite)) + (:num 0.0 0.02) + (:scale-x (meters 10)) + (:rot-x 4) + (:scale-y (meters 1) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.0675)) + (:vel-z (meters 0.5)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -5) (degrees 10)) + (:conerot-y (degrees -30) (degrees 60)) + ) + ) + +(defpartgroup group-ctyslum-rubble-crater-smoke + :id 958 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3413 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 3413 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 1)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.005925926)) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.000033333334) (meters 0.00006666667)) + (:accel-y (meters 0.00033333333) (meters 0.000033333334)) + (:accel-z (meters -0.000033333334) (meters 0.00006666667)) + (:friction 0.94) + (:timer (seconds 10.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3414) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3414 + :init-specs ((:fade-a -0.024615385 -0.024615385)) + ) + +(defpartgroup group-ctyslum-rubble-smoke + :id 959 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3415 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 3415 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.0014814815)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3416) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3416 + :init-specs ((:fade-a -0.11636364)) + ) + +(defpartgroup group-ctyslum-rubble-smoke-lit + :id 960 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3417 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 3417 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 160) (degrees 40)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 10.0) + (:a 0.0) + (:vel-y (meters 0.0014814815)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.26666668 0.26666668) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3418) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3418 + :init-specs ((:fade-a -0.14545454)) + ) + +(defpartgroup group-ctyslum-rubble-fire + :id 961 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3419 :fade-after (meters 100) :flags (sp6 sp7)) + (sp-item 3420 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + (sp-item 3421 :falloff-to (meters 40) :flags (sp7)) + ) + ) + +(defpart 3420 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0 1.0) + (:x (meters -5) (meters 10)) + (:y (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 155.0) + (:g 164.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:accel-y (meters 0.0033333334) (meters 0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + ) + ) + +(if #t + (set! *range-color-rubble-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.6 :z -0.9 :w -1.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 30.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 120.0 :z 30.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.6666666 :y 3.333334 :z 9.999998 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-alpha-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 255.0 :z 256.0 :w 257.0) + :one-over-x-deltas (new 'static 'vector :x 127.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-rubble-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-rubble-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *r-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *g-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.7 :y 0.5 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x -0.19999999 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *b-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.6 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -1.6666666 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-alpha-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.5 :w -1.0) + :ys (new 'static 'vector :y 0.5 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6666666 :y 2.5000002 :z -2.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-scale-rubble-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 0.3 :w 1.3) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y -1.4 :z 0.99999994 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-scale-rubble-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 2.0 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-ctyslum-rubble-fire-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.4) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf1) + ) + ) + +(set! (-> *part-id-table* 3420 init-specs 16 initial-valuef) + (the-as float *part-ctyslum-rubble-fire-flame-curve-settings*) + ) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* color-start) *range-color-rubble-flame*) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* alpha-start) *range-alpha-rubble-flame*) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* scale-x-start) *range-scale-rubble-flame-x*) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* scale-y-start) *range-scale-rubble-flame-y*) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* r-scalar) *r-curve-rubble-flame*) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* g-scalar) *g-curve-rubble-flame*) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* b-scalar) *b-curve-rubble-flame*) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* a-scalar) *curve-alpha-rubble-flame*) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* scale-x-scalar) *curve-scale-rubble-flame-x*) + +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* scale-y-scalar) *curve-scale-rubble-flame-y*) + +(defpart 3422 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:y (meters -1)) + (:scale-x (meters 7) (meters 7)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-y (meters -0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters -0.016666668)) + (:fade-r 0.33333334) + (:fade-g -0.083333336) + (:fade-b -1.875) + (:fade-a 0.42666668) + (:accel-y (meters 0.00033333333) (meters 0.005)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 3423) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 1) (meters 10)) + ) + ) + +(defpart 3423 + :init-specs ((:scalevel-x (meters -0.016666668)) (:fade-a -0.425 -0.425)) + ) + +(defpart 3421 + :init-specs ((:num 1.0) + (:x (meters -6) (meters 12)) + (:y (meters -1) (meters 6)) + (:z (meters -3) (meters 6)) + (:rot-x 8) + (:r 12288.0) + (:g 2048.0) + (:b 2048.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:fade-g 6.826667) + (:accel-y (meters 0.0016666667) (meters 0.00033333333)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 3424) + ) + ) + +(defpart 3424 + :init-specs ((:fade-g -6.826667)) + ) + +(defpart 3419 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.2) + (:y (meters 2)) + (:scale-x (meters 30)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 60.0 20.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + ) + ) + +(defpartgroup group-ctysluma-spray + :id 962 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3425 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3426 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + ) + ) + +(defpart 3425 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 2.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + ) + ) + +(defpart 3427 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 3428)) + ) + +(defpart 3428 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 3427)) + ) + +(defpart 3426 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + ) + ) + +(defpartgroup group-ctysluma-spray-check-userdata-8 + :id 963 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3429 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3430 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defun check-drop-level-ctysluma-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (< (-> arg2 y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 3431) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 arg2) + (none) + ) + +(defpart 3429 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctysluma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + ) + ) + +(defpart 3430 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctysluma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + ) + ) + +(defpart 3431 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.05625)) + (:vel-y (meters 0.01) (meters 0.026666667)) + (:fade-a -0.21333334) + (:accel-y (meters -0.001) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-ctysluma-chimney + :id 964 + :bounds (static-bspherem 0 0 -10 24) + :parts ((sp-item 3432 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 3433 :fade-after (meters 200) :flags (sp6)) + ) + ) + +(defpart 3433 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 6144.0) + ) + ) + +(defpart 3432 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3434) + ) + ) + +(defpart 3434 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3435)) + ) + +(defpart 3435 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3436) + ) + ) + +(defpart 3436 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3437) + ) + ) + +(defpart 3437 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +(defpartgroup group-ctysluma-chimney-smoke + :id 965 + :bounds (static-bspherem 0 0 -12 24) + :parts ((sp-item 3438 :fade-after (meters 200) :falloff-to (meters 300))) + ) + +(defpart 3438 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.4) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3439) + ) + ) + +(defpart 3439 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3440) + ) + ) + +(defpart 3440 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-ctysluma-sign-m5-8x4 + :id 966 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3441 :flags (is-3d sp3 sp7)) + (sp-item 3442 :flags (is-3d sp3 sp7)) + (sp-item 3443 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3443 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 48) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3441 + :init-specs ((:texture (sign-m5 ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504c00 -2139062144 0 1 #x8504c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3442 + :init-specs ((:texture (sign-m5 ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504c00 -2139062144 0 1 #x8504c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctysluma-sign-metalhead-8x4 + :id 967 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3444 :flags (is-3d sp3 sp7)) + (sp-item 3445 :flags (is-3d sp3 sp7)) + (sp-item 3443 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3444 + :init-specs ((:texture (sign-metalhead ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504d00 -2139062144 0 1 #x8504d00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3445 + :init-specs ((:texture (sign-metalhead ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504d00 -2139062144 0 1 #x8504d00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctysluma-sign-crimson-4x8 + :id 968 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3446 :flags (is-3d sp3 sp7)) + (sp-item 3447 :flags (is-3d sp3 sp7)) + (sp-item 3448 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3448 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 48) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 3446 + :init-specs ((:texture (sign-crimson ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504900 -2139062144 0 1 #x8504900 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3447 + :init-specs ((:texture (sign-crimson ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504900 -2139062144 0 1 #x8504900 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctysluma-sign-doctors-4x4 + :id 969 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3449 :flags (is-3d sp3 sp7)) + (sp-item 3450 :flags (is-3d sp3 sp7)) + (sp-item 3451 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3451 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 3449 + :init-specs ((:texture (sign-doctors ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504a00 -2139062144 0 1 #x8504a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3450 + :init-specs ((:texture (sign-doctors ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504a00 -2139062144 0 1 #x8504a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctysluma-sign-hiphog-4x4 + :id 970 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3452 :flags (is-3d sp3 sp7)) + (sp-item 3453 :flags (is-3d sp3 sp7)) + (sp-item 3451 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3452 + :init-specs ((:texture (sign-hiphog ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504b00 -2139062144 0 1 #x8504b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3453 + :init-specs ((:texture (sign-hiphog ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504b00 -2139062144 0 1 #x8504b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ctysluma-sign-blank-4x4 + :id 971 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3454 :flags (is-3d sp3 sp7)) + (sp-item 3455 :flags (is-3d sp3 sp7)) + (sp-item 3451 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 3454 + :init-specs ((:texture (sign-blank ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504800 -2139062144 0 1 #x8504800 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3455 + :init-specs ((:texture (sign-blank ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504800 -2139062144 0 1 #x8504800 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/city/slums/ctyslumb-part.gc b/goal_src/jak3/levels/city/slums/ctyslumb-part.gc index 0a7a1fffd9..a0579b5e54 100644 --- a/goal_src/jak3/levels/city/slums/ctyslumb-part.gc +++ b/goal_src/jak3/levels/city/slums/ctyslumb-part.gc @@ -7,3 +7,1390 @@ ;; DECOMP BEGINS +(defpartgroup group-ctyslumb-barrel-fire + :id 973 + :bounds (static-bspherem 0 3 0 4) + :parts ((sp-item 3555 :fade-after (meters 50) :falloff-to (meters 80)) + (sp-item 3556 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 0.335) :length (seconds 0.167)) + (sp-item 3557 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.4) :length (seconds 0.185) :offset 20) + (sp-item 3558 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 0.535) :length (seconds 0.1) :offset 35) + (sp-item 3556 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.85) :length (seconds 0.2) :offset 65) + (sp-item 3557 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 1.25) :length (seconds 0.135) :offset 15) + (sp-item 3558 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 1.435) :length (seconds 0.167) :offset 85) + (sp-item 3556 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 2) :length (seconds 0.235) :offset 100) + (sp-item 3557 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 4.167) :length (seconds 0.15) :offset 450) + (sp-item 3558 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 5) :length (seconds 0.085) :offset 115) + (sp-item 3556 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 7) :length (seconds 0.185) :offset 80) + (sp-item 3559 :fade-after (meters 20) :falloff-to (meters 10) :binding 3554) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3560 :fade-after (meters 50) :falloff-to (meters 50)) + (sp-item 3561 :fade-after (meters 30) :falloff-to (meters 30)) + (sp-item 3562 :fade-after (meters 70) :flags (sp6)) + ) + ) + +(defpart 3562 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 12.0) + (:fade-a -0.4) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 10240.0) + ) + ) + +(defpart 3559 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 0.8) + (:sound (static-sound-spec "fire-pop" :group 0 :volume 10000.0)) + (:x (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:accel-y (meters -0.000033333334) (meters -0.00006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3554 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.1) (meters 0.3)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 128.0) + (:b 128.0) + (:a 96.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.026666667) (meters 0.053333335)) + (:vel-y (meters 0)) + (:vel-z (meters -0.0013333333) (meters 0.0026666666)) + (:fade-r 0.0) + (:fade-g -0.7111111) + (:fade-b -0.7111111) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.6)) + (:next-launcher 3563) + ) + ) + +(defpart 3563 + :init-specs ((:fade-r -1.0666667) (:fade-g 1.0666667) (:fade-b 1.0666667)) + ) + +(defpart 3556 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3564) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 87)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 3557 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3564) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 120) (degrees 90)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 3558 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3564) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 240) (degrees 110)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 3564 + :init-specs ((:b 0.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.4 -0.2) + (:next-time (seconds 0.135) (seconds 0.03)) + (:next-launcher 3565) + ) + ) + +(defpart 3565 + :init-specs ((:fade-r -0.125) (:fade-g 0.4) (:fade-b 0.4)) + ) + +(defpart 3555 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 4.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 3560 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.4) + (:x (meters -0.25) (meters 0.5)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.64) + (:fade-g -0.32) + (:fade-b -0.32) + (:fade-a -0.017777778 -0.026666667) + (:accel-y (meters -0.000006666667)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.5) (seconds 0.165)) + (:next-launcher 3566) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3566 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpart 3561 + :init-specs ((:num 0.4) + (:x (meters 0) (meters 0.2)) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-x (meters 0) (meters 0.006666667)) + (:vel-y (meters 0.02) (meters 0.013333334)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3567) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 3567 + :init-specs ((:fade-b -0.68266666)) + ) + +(defpartgroup group-ctyslumb-streetlight-glows + :id 974 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 5 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 4 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 5 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyslumb-chimney + :id 975 + :bounds (static-bspherem 0 0 -10 24) + :parts ((sp-item 3568 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 3569 :fade-after (meters 200) :flags (sp6)) + ) + ) + +(defpart 3569 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 6144.0) + ) + ) + +(defpart 3568 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3570) + ) + ) + +(defpart 3570 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3571)) + ) + +(defpart 3571 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3572) + ) + ) + +(defpart 3572 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3573) + ) + ) + +(defpart 3573 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +(defpartgroup group-ctyslumb-chimney-smoke + :id 976 + :bounds (static-bspherem 0 0 -12 24) + :parts ((sp-item 3574 :fade-after (meters 200) :falloff-to (meters 300))) + ) + +(defpart 3574 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.4) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3575) + ) + ) + +(defpart 3575 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3576) + ) + ) + +(defpart 3576 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-sign-ctyslumb-square-a + :id 977 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3577 :flags (is-3d sp3 sp7)) + (sp-item 3578 :flags (is-3d sp3 sp7)) + (sp-item 3579 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3577 + :init-specs ((:texture (sign-square-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 9)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200700 -2139062144 0 1 #xa200700 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3578 + :init-specs ((:texture (sign-square-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 9)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200700 -2139062144 0 1 #xa200700 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3579 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumb-square-b + :id 978 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3580 :flags (is-3d sp3 sp7)) + (sp-item 3581 :flags (is-3d sp3 sp7)) + (sp-item 3582 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3580 + :init-specs ((:texture (sign-square-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 9)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200800 -2139062144 0 1 #xa200800 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3581 + :init-specs ((:texture (sign-square-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 9)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200800 -2139062144 0 1 #xa200800 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3582 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumb-wide-a + :id 979 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3583 :flags (is-3d sp3 sp7)) + (sp-item 3584 :flags (is-3d sp3 sp7)) + (sp-item 3585 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3583 + :init-specs ((:texture (sign-wide-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 17)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200b00 -2139062144 0 1 #xa200b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3584 + :init-specs ((:texture (sign-wide-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 17)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200b00 -2139062144 0 1 #xa200b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3585 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumb-wide-b + :id 980 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3586 :flags (is-3d sp3 sp7)) + (sp-item 3587 :flags (is-3d sp3 sp7)) + (sp-item 3588 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3586 + :init-specs ((:texture (sign-wide-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 15)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200c00 -2139062144 0 1 #xa200c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3587 + :init-specs ((:texture (sign-wide-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 15)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200c00 -2139062144 0 1 #xa200c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3588 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumb-tall-a + :id 981 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3589 :flags (is-3d sp3 sp7)) + (sp-item 3590 :flags (is-3d sp3 sp7)) + (sp-item 3591 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3589 + :init-specs ((:texture (sign-tall-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200900 -2139062144 0 1 #xa200900 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3590 + :init-specs ((:texture (sign-tall-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200900 -2139062144 0 1 #xa200900 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3591 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumb-tall-b + :id 982 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3592 :flags (is-3d sp3 sp7)) + (sp-item 3593 :flags (is-3d sp3 sp7)) + (sp-item 3594 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3592 + :init-specs ((:texture (sign-tall-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.1)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200a00 -2139062144 0 1 #xa200a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3593 + :init-specs ((:texture (sign-tall-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.05)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200a00 -2139062144 0 1 #xa200a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3594 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-ctyslumb-steamescape + :id 983 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3595 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3596 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 3595 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 1.0) + (:x (meters -0.8) 4 (meters 0.4)) + (:y (meters -0.1) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3597) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3596 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -0.4) 1 (meters 0.4)) + (:y (meters 0) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3597) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3597 + :init-specs ((:fade-a -0.064 -0.064)) + ) + +(defpartgroup group-ctyslumb-spray + :id 984 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3598 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3599 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + ) + ) + +(defpart 3598 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 2.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + ) + ) + +(defpart 3600 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 3601)) + ) + +(defpart 3601 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 3600)) + ) + +(defpart 3599 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + ) + ) + +(defpartgroup group-ctyslumb-spray-check-userdata-8 + :id 985 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3602 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3603 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defun check-drop-level-ctyslumb-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (< (-> arg2 y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 3604) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 arg2) + (none) + ) + +(defpart 3602 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyslumb-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + ) + ) + +(defpart 3603 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyslumb-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + ) + ) + +(defpart 3604 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.05625)) + (:vel-y (meters 0.01) (meters 0.026666667)) + (:fade-a -0.21333334) + (:accel-y (meters -0.001) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; og:preserve-this not-yet-implemented texture anim +; (define *ctyslumb-water-texture-anim-array* +; (new 'static 'texture-anim-array :type texture-anim +; (new 'static 'texture-anim +; :num-layers #x3 +; :func #f +; :init-func-id 'texture-anim-overide-size-init +; :tex #f +; :tex-name "ctyslumb-water-dest" +; :extra (new 'static 'vector :x 128.0 :y 128.0 :z 4.0) +; :color (new 'static 'rgba :a #x80) +; :frame-delta 300.0 +; :frame-mod 2100.0 +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x1 :d #x1) +; :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) +; :data (new 'static 'array texture-anim-layer 6 +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 2100.0 +; :tex-name "ctyslumb-water" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.33 0.33)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-st-rot (degrees 180) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.33 1.33)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-st-rot (degrees 180) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 2100.0 +; :tex-name "ctyslumb-water" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.67 0.67)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-st-rot (degrees 90) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.67 1.67)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-st-rot (degrees 90) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 2100.0 +; :tex-name "ctyslumb-water" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.0)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 1.0)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; ) +; ) +; (new 'static 'texture-anim +; :num-layers #x3 +; :func #f +; :init-func-id 'texture-anim-overide-size-init +; :tex #f +; :tex-name "ctyslumb-fountain-fall-dest" +; :extra (new 'static 'vector :x 128.0 :y 128.0 :z 1.0) +; :color (new 'static 'rgba :a #x80) +; :frame-delta 300.0 +; :frame-mod 600.0 +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x1 :d #x1) +; :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) +; :data (new 'static 'array texture-anim-layer 6 +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "ctyslumb-fountain-fall" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -0.3 0.0)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -1.3 -1.0)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "ctyslumb-fountain-fall" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.3 -0.5)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.3 -2.5)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "ctyslumb-fountain-fall" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -0.25)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -3.25)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; ) +; ) +; ) +; ) diff --git a/goal_src/jak3/levels/city/slums/ctyslumc-obs.gc b/goal_src/jak3/levels/city/slums/ctyslumc-obs.gc index a35b354a9f..e72a2205f3 100644 --- a/goal_src/jak3/levels/city/slums/ctyslumc-obs.gc +++ b/goal_src/jak3/levels/city/slums/ctyslumc-obs.gc @@ -7,3 +7,278 @@ ;; DECOMP BEGINS +(deftype cty-elevator (elevator) + () + ) + + +(defskelgroup skel-cty-elevator cty-elevator cty-elevator-lod0-jg cty-elevator-idle-ja + ((cty-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +(defmethod get-art-group ((this cty-elevator)) + (art-group-get-by-name *level* "skel-cty-elevator" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this cty-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +(defmethod init-sound! ((this cty-elevator)) + (set! (-> this sound-running-loop) (static-sound-spec "hqlift-loop" :group 0)) + (set! (-> this sound-arrived) (static-sound-spec "hqlift-stop" :group 0)) + (set! (-> this sound-start) (static-sound-spec "hqlift-start" :group 0)) + (call-parent-method this) + (none) + ) + +;; og:preserve-this not-yet-implemented texture anim +; (define *ctyslumc-water-texture-anim-array* +; (new 'static 'texture-anim-array :type texture-anim +; (new 'static 'texture-anim +; :num-layers #x3 +; :func #f +; :init-func-id 'texture-anim-overide-size-init +; :tex #f +; :tex-name "ctyslumc-water-dest" +; :extra (new 'static 'vector :x 128.0 :y 128.0 :z 4.0) +; :color (new 'static 'rgba :a #x80) +; :frame-delta 300.0 +; :frame-mod 2100.0 +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x1 :d #x1) +; :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) +; :data (new 'static 'array texture-anim-layer 6 +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 2100.0 +; :tex-name "ctyslumc-water" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.33 0.33)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-st-rot (degrees 180) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.33 1.33)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-st-rot (degrees 180) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 2100.0 +; :tex-name "ctyslumc-water" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.67 0.67)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-st-rot (degrees 90) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.67 1.67)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-st-rot (degrees 90) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 2100.0 +; :tex-name "ctyslumc-water" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.0)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 1.0)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; ) +; ) +; (new 'static 'texture-anim +; :num-layers #x3 +; :func #f +; :init-func-id 'texture-anim-overide-size-init +; :tex #f +; :tex-name "ctyslumc-fountain-fall-dest" +; :extra (new 'static 'vector :x 128.0 :y 128.0 :z 1.0) +; :color (new 'static 'rgba :a #x80) +; :frame-delta 300.0 +; :frame-mod 600.0 +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x1 :d #x1) +; :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) +; :data (new 'static 'array texture-anim-layer 6 +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "ctyslumc-fountain-fall" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -0.3 0.0)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -1.3 -1.0)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "ctyslumc-fountain-fall" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.3 -0.5)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.3 -2.5)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "ctyslumc-fountain-fall" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -0.25)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -3.25)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; ) +; ) +; ) +; ) + +(deftype ctyslumc-flag (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defskelgroup skel-ctyslumc-flag ctyslumc-flag ctyslumc-flag-lod0-jg ctyslumc-flag-idle-ja + ((ctyslumc-flag-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -7 0 12) + ) + +(defstate idle (ctyslumc-flag) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this ctyslumc-flag) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyslumc-flag" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +(defbehavior ctyslumc-flag-init-by-other ctyslumc-flag ((arg0 vector) (arg1 entity-actor)) + (process-entity-set! self arg1) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyslumc-flag" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go-virtual idle) + ) diff --git a/goal_src/jak3/levels/city/slums/ctyslumc-part.gc b/goal_src/jak3/levels/city/slums/ctyslumc-part.gc index 3fd5cb9dc5..45856ef046 100644 --- a/goal_src/jak3/levels/city/slums/ctyslumc-part.gc +++ b/goal_src/jak3/levels/city/slums/ctyslumc-part.gc @@ -7,3 +7,844 @@ ;; DECOMP BEGINS +(defpartgroup group-ctyslumc-streetlight-glows + :id 986 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 6 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 7 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 6 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 7 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-ctyslumc-chimney + :id 987 + :bounds (static-bspherem 0 0 -10 24) + :parts ((sp-item 3605 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 3606 :fade-after (meters 200) :flags (sp6)) + ) + ) + +(defpart 3606 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 6144.0) + ) + ) + +(defpart 3605 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3607) + ) + ) + +(defpart 3607 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3608)) + ) + +(defpart 3608 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3609) + ) + ) + +(defpart 3609 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3610) + ) + ) + +(defpart 3610 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +(defpartgroup group-ctyslumc-chimney-smoke + :id 988 + :bounds (static-bspherem 0 0 -12 24) + :parts ((sp-item 3611 :fade-after (meters 200) :falloff-to (meters 300))) + ) + +(defpart 3611 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.4) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3612) + ) + ) + +(defpart 3612 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3613) + ) + ) + +(defpart 3613 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-sign-ctyslumc-big-a + :id 989 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 20) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3614 :flags (is-3d sp3 sp7)) + (sp-item 3615 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3614 + :init-specs ((:texture (sign-wide-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0)) + (:scale-x (meters 34)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 19)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00c00 -2139062144 0 1 #xaa00c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3615 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumc-big-b + :id 990 + :flags (sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 3616 :flags (is-3d sp7)) + (sp-item 3617 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3616 + :init-specs ((:texture (sign-wide-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:y (meters 0)) + (:z (meters -0.5)) + (:scale-x (meters 31.5)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 9.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00c00 -2139062144 0 1 #xaa00c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3617 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumc-square-a + :id 991 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3618 :flags (is-3d sp3 sp7)) + (sp-item 3619 :flags (is-3d sp3 sp7)) + (sp-item 3620 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3618 + :init-specs ((:texture (sign-square-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00100 -2139062144 0 1 #xaa00100 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3619 + :init-specs ((:texture (sign-square-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 180)) + (:rot-z (degrees 90)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00100 -2139062144 0 1 #xaa00100 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3620 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumc-square-b + :id 992 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3621 :flags (is-3d sp3 sp7)) + (sp-item 3622 :flags (is-3d sp3 sp7)) + (sp-item 3623 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3621 + :init-specs ((:texture (sign-square-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00300 -2139062144 0 1 #xaa00300 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3622 + :init-specs ((:texture (sign-square-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00300 -2139062144 0 1 #xaa00300 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3623 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumc-wide-a + :id 993 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3624 :flags (is-3d sp3 sp7)) + (sp-item 3625 :flags (is-3d sp3 sp7)) + (sp-item 3626 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3624 + :init-specs ((:texture (sign-wide-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 17)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00c00 -2139062144 0 1 #xaa00c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3625 + :init-specs ((:texture (sign-wide-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 17)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00c00 -2139062144 0 1 #xaa00c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3626 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumc-wide-b + :id 994 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3627 :flags (is-3d sp3 sp7)) + (sp-item 3628 :flags (is-3d sp3 sp7)) + (sp-item 3629 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3627 + :init-specs ((:texture (sign-wide-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 15)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00d00 -2139062144 0 1 #xaa00d00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3628 + :init-specs ((:texture (sign-wide-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 15)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00d00 -2139062144 0 1 #xaa00d00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3629 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumc-tall-a + :id 995 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3630 :flags (is-3d sp3 sp7)) + (sp-item 3631 :flags (is-3d sp3 sp7)) + (sp-item 3632 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3630 + :init-specs ((:texture (sign-tall-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00a00 -2139062144 0 1 #xaa00a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3631 + :init-specs ((:texture (sign-tall-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00a00 -2139062144 0 1 #xaa00a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3632 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sign-ctyslumc-tall-b + :id 996 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3633 :flags (is-3d sp3 sp7)) + (sp-item 3634 :flags (is-3d sp3 sp7)) + (sp-item 3635 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +(defpart 3633 + :init-specs ((:texture (sign-tall-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.1)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 14)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00b00 -2139062144 0 1 #xaa00b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3634 + :init-specs ((:texture (sign-tall-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.05)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 14)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00b00 -2139062144 0 1 #xaa00b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3635 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-gunship-target-explode + :id 997 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 3636 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3637 :flags (sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 3638 :flags (sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 3639 :flags (is-3d sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 3640 :period (seconds 30) :length (seconds 0.035)) + ) + ) + +(defpart 3640 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 50.0) + (:y (meters 2)) + (:scale-x (meters 0.4) (meters 0.6)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 30.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.00083333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.008333334)) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 3636 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 10)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 200.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 3637 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3638 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0) + (:b 128.0) + (:a 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 3639 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc b/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc index e649b6eae0..b59746e4d2 100644 --- a/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc +++ b/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc @@ -7,3 +7,960 @@ ;; DECOMP BEGINS +(defpartgroup group-cty-sniper-battery-glow + :id 1463 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4829 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +(defpart 4829 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 160.0) + (:b 240.0) + (:a 40.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(deftype cty-sniper-button-top (process-drawable) + ((is-up symbol) + (colormode handle) + ) + (:state-methods + idle + going-up + going-down + ) + ) + + +(defskelgroup skel-cty-sniper-button-top cty-sniper-button-top cty-sniper-button-top-lod0-jg cty-sniper-button-top-idle-ja + ((cty-sniper-button-top-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defbehavior cty-sniper-button-top-handler cty-sniper-button-top ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('get-colormode) + (-> self colormode) + ) + (('up) + (set! (-> self colormode) (new 'static 'handle)) + (set! (-> self is-up) #t) + (go-virtual going-up) + ) + (('down) + (set! (-> self colormode) (new 'static 'handle :process #x2 :u64 #x2)) + (set! (-> self is-up) #f) + (go-virtual going-down) + ) + (('vulnerable) + (set! v0-0 1) + (set! (-> self colormode) (the-as handle v0-0)) + v0-0 + ) + (('invulnerable) + (set! v0-0 (if (-> self is-up) + 0 + 2 + ) + ) + (set! (-> self colormode) (the-as handle v0-0)) + v0-0 + ) + ) + ) + +;; WARN: Return type mismatch none vs object. +(defbehavior cty-sniper-button-top-genpost cty-sniper-button-top () + (let ((v1-0 (-> self colormode))) + (cond + ((= v1-0 1) + (let ((v1-2 (-> (new 'static 'vector :y 1.0 :w 1.0) quad))) + (set! (-> self draw color-emissive quad) v1-2) + ) + (let ((v1-4 (-> (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0) quad))) + (set! (-> self draw color-mult quad) v1-4) + ) + ) + ((zero? v1-0) + (let ((v1-6 (-> (new 'static 'vector :x 1.0 :w 1.0) quad))) + (set! (-> self draw color-emissive quad) v1-6) + ) + (let ((v1-8 (-> (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0) quad))) + (set! (-> self draw color-mult quad) v1-8) + ) + ) + ((= v1-0 2) + (let ((v1-11 (-> (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0) quad))) + (set! (-> self draw color-mult quad) v1-11) + ) + (let ((v1-16 (-> (if (< (mod (current-time) 150) 75) + (new 'static 'vector :x 0.8 :w 1.0) + (new 'static 'vector :y 0.8 :w 1.0) + ) + quad + ) + ) + ) + (set! (-> self draw color-emissive quad) v1-16) + ) + ) + ) + ) + (ja-post) + ) + +(defstate idle (cty-sniper-button-top) + :virtual #t + :event cty-sniper-button-top-handler + :code sleep-code + :post cty-sniper-button-top-genpost + ) + +(defstate going-up (cty-sniper-button-top) + :virtual #t + :event cty-sniper-button-top-handler + :code (behavior () + (ja-no-eval :group! cty-sniper-button-top-popup-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (go-virtual idle) + ) + :post cty-sniper-button-top-genpost + ) + +(defstate going-down (cty-sniper-button-top) + :virtual #t + :event cty-sniper-button-top-handler + :code (behavior () + (ja-no-eval :group! cty-sniper-button-top-pushdown-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (go-virtual idle) + ) + :post cty-sniper-button-top-genpost + ) + +(defmethod init-from-entity! ((this cty-sniper-button-top) (arg0 entity-actor)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cty-sniper-button-top" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> this is-up) #t) + (go (method-of-object this idle)) + ) + +(defbehavior cty-sniper-button-top-init-by-other cty-sniper-button-top ((arg0 vector) (arg1 quaternion)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cty-sniper-button-top" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> self colormode) (new 'static 'handle)) + (go-virtual idle) + ) + +(deftype cty-sniper-button (process-drawable) + ((stay-down-time time-frame) + (lid handle) + ) + (:state-methods + idle-up + going-down + idle-down + bail-up + moribund + ) + (:methods + (cty-sniper-button-method-25 (_type_) object) + ) + ) + + +(defskelgroup skel-cty-sniper-button cty-sniper-button cty-sniper-button-lod0-jg cty-sniper-button-idle-ja + ((cty-sniper-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defmethod run-logic? ((this cty-sniper-button)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defstate idle-up (cty-sniper-button) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (logtest? (-> (the-as attack-info (-> block param 1)) penetrate-using) (penetrate flop)) + (go-virtual going-down) + #f + ) + ) + (('die) + (go-virtual moribund) + ) + (('vulnerable) + (send-event (handle->process (-> self lid)) 'vulnerable) + ) + (('invulnerable) + (send-event (handle->process (-> self lid)) 'invulnerable) + ) + ) + ) + :enter (behavior () + '() + ) + :exit (behavior () + '() + ) + :trans (behavior () + '() + ) + :code transform-and-sleep-code + :post ja-post + ) + +(defstate going-down (cty-sniper-button) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual moribund) + ) + (('vulnerable) + (send-event (handle->process (-> self lid)) 'vulnerable) + ) + (('invulnerable) + (send-event (handle->process (-> self lid)) 'invulnerable) + (go-virtual bail-up) + ) + ) + ) + :enter (behavior () + '() + ) + :code (behavior () + (sound-play "activate-button") + (send-event (handle->process (-> self lid)) 'down 0.25) + (ja-no-eval :group! cty-sniper-button-pushdown-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (go-virtual idle-down) + ) + :post ja-post + ) + +(defstate idle-down (cty-sniper-button) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual moribund) + ) + (('vulnerable) + (send-event (handle->process (-> self lid)) 'vulnerable) + ) + (('invulnerable) + (send-event (handle->process (-> self lid)) 'invulnerable) + (go-virtual bail-up) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (ja-channel-set! 1) + (ja :group! cty-sniper-button-pushdown-ja :num! (identity (the float (ja-num-frames 0)))) + (ja-post) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (-> self stay-down-time)) + (suspend) + ) + ) + (send-event (handle->process (-> self lid)) 'up #x3e800000) + (ja-no-eval :group! cty-sniper-button-popup-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (go-virtual idle-up) + (sleep-code) + ) + :post ja-post + ) + +(defstate bail-up (cty-sniper-button) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual moribund) + ) + (('vulnerable) + (send-event (handle->process (-> self lid)) 'vulnerable) + ) + (('invulnerable) + (send-event (handle->process (-> self lid)) 'invulnerable) + ) + ) + ) + :enter (behavior () + '() + ) + :code (behavior () + (send-event (handle->process (-> self lid)) 'up #x3e800000) + (ja-no-eval :group! cty-sniper-button-popup-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (go-virtual idle-up) + (sleep-code) + ) + :post ja-post + ) + +(defstate moribund (cty-sniper-button) + :virtual #t + :code sleep-code + :post (behavior () + (let ((a0-0 (new 'stack-no-clear 'vector))) + (vector+! a0-0 (-> self draw origin) (-> self draw bounds)) + (set! (-> a0-0 w) (-> self draw bounds w)) + (when (not (sphere-in-view-frustum? (the-as sphere a0-0))) + (cleanup-for-death self) + (go empty-state) + ) + ) + (ja-post) + ) + ) + +(defmethod cty-sniper-button-method-25 ((this cty-sniper-button)) + (and (-> this next-state) (let ((v1-2 (-> this next-state name))) + (or (= v1-2 'going-down) (= v1-2 'idle-down)) + ) + ) + ) + +(defmethod init-from-entity! ((this cty-sniper-button) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-button" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this stay-down-time) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'button-down-time :default 1.0)))) + ) + (set! (-> this lid) (process->handle (ppointer->process (process-spawn + cty-sniper-button-top + (-> this root trans) + (-> this root quat) + :name "cty-sniper-button-top" + :to this + ) + ) + ) + ) + (set! (-> this root pause-adjust-distance) 409600.0) + (if #f + (go (method-of-object this idle-down)) + (go (method-of-object this idle-up)) + ) + ) + +(defmethod deactivate ((this cty-sniper-button)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (while (-> this child) + (deactivate (ppointer->process (-> this child))) + ) + ((method-of-type process-focusable deactivate) (the-as process-focusable this)) + (none) + ) + +(deftype cty-sniper-battery (process-focusable) + ((incoming-attack-id uint32) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (known-vulnerable-this-frame symbol) + (during-movement-sound sound-id) + (run-once symbol) + (halted symbol) + ) + (:state-methods + idle + vulnerable + die + explode + ) + (:methods + (cty-sniper-battery-method-32 (_type_) symbol) + ) + ) + + +(defskelgroup skel-cty-sniper-battery cty-sniper-core cty-sniper-core-lod0-jg cty-sniper-core-idle-ja + ((cty-sniper-core-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +(defskelgroup skel-cty-sniper-battery-explode cty-sniper-core cty-sniper-core-explode-lod0-jg cty-sniper-core-explode-idle-ja + ((cty-sniper-core-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *cty-sniper-battery-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 4 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 3) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(defpartgroup group-sniper-battery-explosion + :id 1464 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4830 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4831 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4832 :period (seconds 30) :length (seconds 0.035)) + ) + ) + +(defpart 4830 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 10)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 220.0) + (:g 200.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4831 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 50.0) + (:y (meters 2)) + (:scale-x (meters 0.4) (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.16666667)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4832 + :init-specs ((:texture (specs level-default-sprite)) + (:num 10.0 10.0) + (:y (meters 2)) + (:scale-x (meters 2) (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.13333334)) + (:scalevel-x (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.512 -0.512) + (:accel-y (meters -0.0016666667)) + (:friction 0.75) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defbehavior cty-sniper-battery-handler cty-sniper-battery ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('get-buttons-actor-group) + (&-> (-> self actor-group) 0) + ) + (('move-trans) + (let ((v0-0 (the-as object (-> self root trans)))) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + ) + (('attack) + (cond + ((zero? (-> self actor-group-count)) + (let ((a1-7 (the-as object (-> arg3 param 1)))) + (when (!= (-> (the-as attack-info a1-7) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-7) id)) + (let ((f30-0 (-> (the-as attack-info a1-7) damage))) + (find-offending-process-focusable arg0 (the-as attack-info a1-7)) + (if (>= f30-0 2.0) + (go-virtual die) + ) + ) + ) + ) + ) + (else + (when (-> self known-vulnerable-this-frame) + (let ((a1-8 (the-as object (-> arg3 param 1)))) + (when (!= (-> (the-as attack-info a1-8) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-8) id)) + (let ((f30-1 (-> (the-as attack-info a1-8) damage))) + (find-offending-process-focusable arg0 (the-as attack-info a1-8)) + (if (>= f30-1 0.0) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + (('alive) + #t + ) + ) + ) + +(defstate idle (cty-sniper-battery) + :virtual #t + :event cty-sniper-battery-handler + :trans (behavior () + (set! (-> self known-vulnerable-this-frame) (cty-sniper-battery-method-32 self)) + (if (ja-done? 0) + (sound-stop (-> self during-movement-sound)) + (sound-play "bigbutton-move" :id (-> self during-movement-sound) :position #f) + ) + (if (-> self known-vulnerable-this-frame) + (go-virtual vulnerable) + ) + ) + :code (behavior () + (cond + ((-> self run-once) + (ja-no-eval :group! cty-sniper-battery-explode-lod0-mg :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (set! (-> self run-once) #t) + ) + ) + (suspend) + (setup-masks (-> self draw) 0 2) + (sleep-code) + ) + :post ja-post + ) + +(defstate vulnerable (cty-sniper-battery) + :virtual #t + :event cty-sniper-battery-handler + :enter (behavior () + (dotimes (gp-0 (length (-> self actor-group 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) 'vulnerable) + (let ((t9-0 send-event-function) + (v1-5 (-> self actor-group 0 data gp-0 actor)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + ) + (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) 'battery-extend) + (let ((t9-2 send-event-function) + (v1-17 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-2 + (handle->process (if (-> v1-17 manager) + (-> v1-17 manager manager) + (the-as handle #f) + ) + ) + a1-1 + ) + ) + ) + ) + :exit (behavior () + (dotimes (gp-0 (length (-> self actor-group 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) 'invulnerable) + (let ((t9-0 send-event-function) + (v1-5 (-> self actor-group 0 data gp-0 actor)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + :trans (behavior () + (set! (-> self known-vulnerable-this-frame) (cty-sniper-battery-method-32 self)) + (if (ja-done? 0) + (sound-stop (-> self during-movement-sound)) + (sound-play "bigbutton-move" :id (-> self during-movement-sound) :position #f) + ) + (spawn-from-cspace (-> self part) (-> self node-list data 6)) + (when (not (-> self known-vulnerable-this-frame)) + (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) 'battery-retract) + (let ((t9-5 send-event-function) + (v1-14 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-5 + (handle->process (if (-> v1-14 manager) + (-> v1-14 manager manager) + (the-as handle #f) + ) + ) + a1-2 + ) + ) + ) + (go-virtual idle) + ) + ) + :code (behavior () + (setup-masks (-> self draw) 2 0) + (ja-no-eval :group! cty-sniper-battery-explode-lod0-jg :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (suspend) + (sleep-code) + ) + :post ja-post + ) + +(defstate die (cty-sniper-battery) + :virtual #t + :event cty-sniper-battery-handler + :trans (behavior () + (spawn-from-cspace (-> self part) (-> self node-list data 6)) + ) + :code (behavior () + (sound-stop (-> self during-movement-sound)) + (when (> (-> self actor-group-count) 0) + (dotimes (gp-0 (length (-> self actor-group 0))) + (let ((v1-5 (-> self actor-group 0 data gp-0 actor))) + (send-event + (if v1-5 + (-> v1-5 extra process) + ) + 'die + ) + ) + ) + ) + (suspend) + (go-virtual explode) + ) + :post ja-post + ) + +(defstate explode (cty-sniper-battery) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('alive) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + #f + #t + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (sound-play "destroy-battery") + (cond + ((logtest? (-> *part-group-id-table* 1464 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1464)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1464)) + ) + ) + (let ((v1-35 (-> self root root-prim))) + (set! (-> v1-35 prim-core collide-as) (collide-spec)) + (set! (-> v1-35 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self root root-prim local-sphere w) 491520.0) + (let ((gp-3 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set-vector! (-> gp-3 fountain-rand-transv-lo) -40960.0 40960.0 -40960.0 1.0) + (set-vector! (-> gp-3 fountain-rand-transv-hi) 40960.0 122880.0 40960.0 1.0) + (let ((v1-47 (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cty-sniper-battery-explode" (the-as (pointer level) #f)) + 7 + gp-3 + *cty-sniper-battery-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + ) + (set! (-> (the-as process-drawable (-> v1-47 0)) root pause-adjust-distance) 409600.0) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +(defmethod cty-sniper-battery-method-32 ((this cty-sniper-battery)) + (local-vars (s5-0 symbol)) + (cond + ((< (-> this actor-group-count) 1) + (set! s5-0 #t) + ) + (else + (set! s5-0 #t) + (dotimes (s4-0 (length (-> this actor-group 0))) + (let ((a0-2 (-> this actor-group 0 data s4-0 actor))) + (if (and a0-2 (not (logtest? (-> a0-2 extra perm status) (entity-perm-status subtask-complete)))) + (set! s5-0 #f) + ) + ) + ) + ) + ) + s5-0 + ) + +(defmethod init-from-entity! ((this cty-sniper-battery) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 7) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 24576.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-17 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-battery" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-25 (res-lump-data arg0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-25 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-25)) + ) + (else + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this during-movement-sound) (new-sound-id)) + (set! (-> this run-once) #f) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data 4)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 4)) frames num-frames) -1)) + ) + ) + (set! (-> this halted) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1463) this)) + (logior! (-> this mask) (process-mask enemy)) + (go (method-of-object this idle)) + ) + +(defbehavior cty-sniper-battery-init-by-other cty-sniper-battery ((arg0 vector) (arg1 quaternion)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-battery" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self during-movement-sound) (new-sound-id)) + (go-virtual idle) + ) diff --git a/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc b/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc index e8f97074ff..12794ed25a 100644 --- a/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc +++ b/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc @@ -5,5 +5,3218 @@ ;; name in dgo: cty-sniper-turret ;; dgos: LCTYSNPR +;; +++cty-sniper-turret-flag +(defenum cty-sniper-turret-flag + :type uint16 + :bitfield #t + (cst0 0) + (cst1 1) + (cst2 2) + (cst3 3) + (cst4 4) + (cst5 5) + (cst6 6) + (cst7 7) + (cst8 8) + (cst9 9) + (cst10 10) + (cst11 11) + (cst12 12) + ) +;; ---cty-sniper-turret-flag + + +;; +++cty-sniper-turret-reticle-flag +(defenum cty-sniper-turret-reticle-flag + :type uint8 + :bitfield #t + (cstr0 0) + (cstr1 1) + ) +;; ---cty-sniper-turret-reticle-flag + + +(declare-type cty-sniper-turret process-focusable) + ;; DECOMP BEGINS +(define *cty-sniper-fight-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 7 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +(deftype task-manager-city-sniper-fight (task-manager) + ((sniper-turrets-marker-entity entity-actor) + (check-timer time-frame) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (cur-group int8) + (win-time time-frame) + (music-started symbol) + (torn-said-turret-rising symbol) + (torn-said-dodge symbol) + (torn-said-battery-retract symbol) + (torn-speech-one-down symbol) + (dax-said-bop-the-core symbol) + (last-torn-speech-time time-frame) + (battery-retractions-since-last-kaboom int32) + (minimap connection-minimap) + ) + (:methods + (task-manager-city-sniper-fight-method-32 (_type_) none) + ) + ) + + +(defstate active (task-manager-city-sniper-fight) + :virtual #t + :code (behavior () + (local-vars (v1-4 object) (v1-20 symbol)) + (until #f + (when *debug-segment* + ) + (set! v1-4 + (and (-> self actor-group) + (begin + (dotimes (v1-5 (-> self actor-group 0 length)) + (when (not (logtest? (-> self actor-group 0 data v1-5 actor extra perm status) (entity-perm-status subtask-complete)) + ) + (if (-> self minimap) + (set! (-> self minimap position quad) (-> self actor-group 0 data v1-5 actor trans quad)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (the-as vector #f) 0)) + ) + (set! v1-4 #f) + (goto cfg-14) + ) + ) + #t + ) + ) + ) + (label cfg-14) + (when v1-4 + (talker-spawn-func (-> *talker-speech* 94) *entity-pool* (target-pos 0) (the-as region #f)) + (until v1-20 + (suspend) + (let ((v1-19 (-> self level bsp actors))) + (when (nonzero? v1-19) + (dotimes (a0-18 (-> v1-19 length)) + (let* ((a2-2 (-> v1-19 data a0-18 actor)) + (a1-7 (if a2-2 + (-> a2-2 extra process) + ) + ) + ) + (when a1-7 + (when (logtest? (-> (the-as process-drawable a1-7) draw status) (draw-control-status on-screen)) + (set! v1-20 #f) + (goto cfg-28) + ) + ) + ) + ) + ) + ) + (set! v1-20 #t) + (label cfg-28) + ) + (send-event self 'complete) + ) + (suspend) + ) + #f + ) + ) + +;; WARN: disable def twice: 121. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 181. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 241. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 53. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod taskman-event-handler ((this task-manager-city-sniper-fight) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-2 object)) + (case arg2 + (('start-music) + (if (not (-> this music-started)) + (set-setting! 'music 'citysnpr 0.0 0) + ) + (set-setting! 'pilot #f 0.0 0) + (send-event *target* 'end-mode 'pilot) + ) + (('turret-awakens) + (when (and (< (+ (-> this last-torn-speech-time) (seconds 8)) (current-time)) + (not (-> this torn-said-turret-rising)) + ) + (set! (-> this torn-said-turret-rising) #t) + (let ((v1-16 (rand-vu-int-range 0 2))) + (cond + ((zero? v1-16) + (talker-spawn-func (-> *talker-speech* 143) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-16 1) + (talker-spawn-func (-> *talker-speech* 144) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-16 2) + (talker-spawn-func (-> *talker-speech* 145) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! v0-2 (current-time)) + (set! (-> this last-torn-speech-time) (the-as time-frame v0-2)) + v0-2 + ) + ) + (('battery-extend) + (when (and (not (-> this dax-said-bop-the-core)) (>= (-> this battery-retractions-since-last-kaboom) 2)) + (let ((v1-28 (rand-vu-int-range 0 1))) + (cond + ((zero? v1-28) + (talker-spawn-func (-> *talker-speech* 156) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-28 1) + (talker-spawn-func (-> *talker-speech* 157) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! v0-2 #t) + (set! (-> this dax-said-bop-the-core) (the-as symbol v0-2)) + v0-2 + ) + ) + (('battery-retract) + (+! (-> this battery-retractions-since-last-kaboom) 1) + (when (and (< (+ (-> this last-torn-speech-time) (seconds 8)) (current-time)) + (or (not (-> this torn-said-battery-retract)) (rand-vu-percent? 0.15)) + ) + (set! (-> this torn-said-battery-retract) #t) + (let ((v1-41 (rand-vu-int-range 0 1))) + (cond + ((zero? v1-41) + (talker-spawn-func (-> *talker-speech* 151) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-41 1) + (talker-spawn-func (-> *talker-speech* 152) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! v0-2 (current-time)) + (set! (-> this last-torn-speech-time) (the-as time-frame v0-2)) + v0-2 + ) + ) + (('turret-firing) + (when (and (< (+ (-> this last-torn-speech-time) (seconds 8)) (current-time)) + (or (not (-> this torn-said-dodge)) (rand-vu-percent? 0.05)) + ) + (set! (-> this torn-said-dodge) #t) + (talker-spawn-func (-> *talker-speech* 154) *entity-pool* (target-pos 0) (the-as region #f)) + (set! v0-2 (current-time)) + (set! (-> this last-torn-speech-time) (the-as time-frame v0-2)) + v0-2 + ) + ) + (('turret-killed) + (set! (-> this battery-retractions-since-last-kaboom) 0) + (when (not (-> this torn-speech-one-down)) + (set! (-> this torn-speech-one-down) #t) + (talker-spawn-func (-> *talker-speech* 147) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod task-manager-method-26 ((this task-manager-city-sniper-fight)) + (local-vars (v1-10 object) (sv-16 res-tag)) + (when (not (-> this sniper-turrets-marker-entity)) + (let ((s5-0 (entity-by-name "cty-sniper-fight-turret-manager-1"))) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data s5-0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-3 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! v1-10 (and (-> this actor-group) (begin + (dotimes (v1-11 (-> this actor-group 0 length)) + (when (not (-> this actor-group 0 data v1-11)) + (set! v1-10 #f) + (goto cfg-16) + ) + ) + #t + ) + ) + ) + (label cfg-16) + (if v1-10 + (set! (-> this sniper-turrets-marker-entity) (the-as entity-actor s5-0)) + ) + ) + ) + 0 + (none) + ) + +(defstate wait (task-manager-city-sniper-fight) + :virtual #t + :code (behavior () + (while (or (not *target*) (not *spawn-actors*)) + (suspend) + ) + (set-time-limit self) + (while (and (= (status-of-level-and-borrows *level* 'hiphog #t) 'active) + (or (not (level-get-target-inside *level*)) (!= (-> (level-get-target-inside *level*) name) 'ctyport)) + ) + (suspend) + ) + (set-setting! 'airlock #f 0.0 0) + (go-virtual active) + ) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-city-sniper-fight)) + (set! (-> this sniper-turrets-marker-entity) #f) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'city-sound '(ctysnip1) 0.0 2) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 15) (the-as int #f) (the-as vector #f) 0)) + (set! (-> this music-started) #f) + (set-time! (-> this last-torn-speech-time)) + (set! (-> this torn-said-turret-rising) #f) + (set! (-> this torn-said-dodge) #f) + (set! (-> this torn-speech-one-down) #f) + (set! (-> this torn-said-battery-retract) #f) + (set! (-> this dax-said-bop-the-core) #f) + (set! (-> this battery-retractions-since-last-kaboom) 0) + (set-setting! 'kg-enemy-settings #f 0.0 *cty-sniper-fight-kg-squad-member-settings*) + (none) + ) + +(defmethod task-manager-method-25 ((this task-manager-city-sniper-fight)) + '() + ((method-of-type task-manager task-manager-method-25) this) + (none) + ) + +(deftype hud-cty-sniper-fight (hud) + ((buttons (pointer actor-group)) + (num-buttons int8) + ) + (:methods + (draw-hud-buttons (_type_ (pointer actor-group)) symbol) + ) + ) + + +(defmethod draw-hud-buttons ((this hud-cty-sniper-fight) (arg0 (pointer actor-group))) + (let ((s5-0 (length (-> arg0 0)))) + (set! (-> this num-buttons) s5-0) + (set! (-> this buttons) arg0) + (dotimes (s4-1 s5-0) + (set! (-> this sprites s4-1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xc0f))) + ) + (set! (-> this sprites s4-1 scale-x) 1.0) + (set! (-> this sprites s4-1 scale-y) 1.0) + (set! (-> this sprites s4-1 flags) (hud-sprite-flags hsf3 hsf4)) + ) + ) + #f + ) + +(defmethod draw ((this hud-cty-sniper-fight)) + (with-pp + (if (odd? (-> this num-buttons)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (- 256 (* 48 (/ (+ (-> this num-buttons) -1) 2))) + (- 32 (the int (* 48.0 (-> this offset)))) + ) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (- 232 (* 48 (+ (/ (-> this num-buttons) 2) -1))) + (- 32 (the int (* 48.0 (-> this offset)))) + ) + ) + (let ((s5-0 1)) + (while (< s5-0 (-> this num-buttons)) + (set-as-offset-from! (-> this sprites s5-0) (the-as vector4w (-> this sprites)) (* 48 s5-0) 0) + (+! s5-0 1) + ) + ) + (let ((s2-0 0) + (s4-0 0) + (s5-1 0) + (s3-0 (mod (current-time) 150)) + ) + (dotimes (s1-0 (-> this num-buttons)) + (let* ((a0-8 (-> this buttons 0 data s1-0 actor)) + (v1-15 (if a0-8 + (-> a0-8 extra process) + ) + ) + ) + (when v1-15 + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer pp)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'get-colormode) + (case (send-event-function (handle->process (-> (the-as cty-sniper-button-top v1-15) colormode)) a1-7) + ((1) + (+! s2-0 1) + ) + ((2) + (+! s4-0 1) + ) + (else + (+! s5-1 1) + ) + ) + ) + ) + ) + ) + (let ((s1-1 0)) + (while (> s2-0 0) + (set! (-> this sprites s1-1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xc0f))) + ) + (+! s1-1 1) + (+! s2-0 -1) + ) + (while (> s4-0 0) + (set! (-> this sprites s1-1 tid) + (if (< s3-0 75) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xc0f))) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xc0f))) + ) + ) + (+! s1-1 1) + (+! s4-0 -1) + ) + (while (> s5-1 0) + (set! (-> this sprites s1-1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xc0f))) + ) + (+! s1-1 1) + (+! s5-1 -1) + ) + ) + ) + ((method-of-type hud draw) this) + (none) + ) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-callback ((this hud-cty-sniper-fight)) + (set! (-> this level) (level-get *level* 'lctysnpr)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) + ) + (none) + ) + +(defpartgroup group-sniper-turret-explosion + :id 1465 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4834 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4835 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4836 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4837 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4838 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4839 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4840 :period (seconds 30) :length (seconds 0.167)) + (sp-item 4841 :period (seconds 30) :length (seconds 0.5)) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +(defpart 4834 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 60.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4835 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0 20.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4836 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0 20.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4837 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4838 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-ftexplo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-sniper-turret-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4838 init-specs 14 initial-valuef) + (the-as float *part-sniper-turret-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* color-start) *range-ftexplo-dust-color*) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* alpha-start) *range-ftexplo-dust-alpha*) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* scale-x-start) *range-ftexplo-dust-scale-x*) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* scale-y-start) *range-ftexplo-dust-scale-y*) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* a-scalar) *curve-ftexplo-dust-alpha*) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* scale-x-scalar) *curve-ftexplo-dust-scale-x*) + +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* scale-y-scalar) *curve-ftexplo-dust-scale-y*) + +(defpart 4840 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4841 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-ftexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-sniper-turret-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4841 init-specs 16 initial-valuef) + (the-as float *part-sniper-turret-explosion-texture-curve-settings*) + ) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* color-start) *range-ftexplo-color*) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* alpha-start) *range-ftexplo-alpha*) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* scale-x-start) *range-ftexplo-scale-x*) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* scale-y-start) *range-ftexplo-scale-y*) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* a-scalar) *curve-ftexplo-alpha*) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* scale-x-scalar) *curve-ftexplo-scale-x*) + +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* scale-y-scalar) *curve-ftexplo-scale-y*) + +(defpart 4839 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4842 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.02) (meters -0.02)) + (:rotvel-z (degrees -300) (degrees 600)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.001)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 70)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4833 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 100.0) + (:a 128.0) + (:fade-r -1.7) + (:fade-g -1.3333334) + (:fade-b -1.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2)) + ) + ) + +(defpart 4843 + :init-specs ((:texture (common-white common)) + (:num 10.0 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 4844 + :init-specs ((:texture (gun-blue-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 16)) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 4845 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.15) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 4846 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 4847 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0 10.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b 1.6) + (:fade-a -0.375) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4848 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 2)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 255.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 4849 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.10666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-cty-sniper-turret-shot-hit-object + :id 1466 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4850 :flags (sp3)) (sp-item 4851 :flags (sp7) :period (seconds 4) :length (seconds 0.1))) + ) + +(defpart 4850 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.21333334) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpart 4851 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.15)) + (:r 0.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 128.0 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.33333334) (meters 0.16666667)) + (:fade-b -0.21333334 -0.21333334) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.8 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-x (degrees -45)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-cty-sniper-turret-shot-hit + :id 1467 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4852 :flags (sp3 sp7))) + ) + +(defpart 4852 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1.5) (meters 0.66)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 30.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters -0.033333335)) + (:scalevel-x (meters 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -4.25) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-cty-sniper-turret-shot-die + :id 1468 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +(deftype cty-sniper-turret-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + + +(defmethod deal-damage! ((this cty-sniper-turret-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +(defmethod projectile-method-24 ((this cty-sniper-turret-shot)) + (draw-beam (-> *part-id-table* 4848) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 4849)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this cty-sniper-turret-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 4844 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 4844 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 4844) a1-0 s5-1 #f) + (set! (-> *part-id-table* 4844 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 4845) s4-0) + (launch-particles (-> *part-id-table* 4846) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f28-1 (* 0.000015258789 f30-0)) + (f30-1 (-> *part-id-table* 4847 init-specs 3 initial-valuef)) + ) + (-> *part-id-table* 4847 init-specs 4 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) (* f28-1 f30-1)) + (launch-particles (-> *part-id-table* 4847) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) f30-1) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this cty-sniper-turret-shot)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 1466 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1466) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1466) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 1467 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1467) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1467) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod play-impact-sound ((this cty-sniper-turret-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "tank-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + ) + ) + ) + 0 + (none) + ) + +(defstate impact (cty-sniper-turret-shot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type projectile impact) enter))) + (if t9-0 + (t9-0) + ) + ) + (when *traffic-manager* + (let ((v1-5 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-5 sphere quad) (-> self root trans quad)) + (set! (-> v1-5 sphere r) 40960.0) + (set! (-> v1-5 velocity quad) (-> self root transv quad)) + (set! (-> v1-5 notify-radius) 122880.0) + (set! (-> v1-5 danger-level) 1.0) + (set! (-> v1-5 decay-rate) 0.0) + (set! (-> v1-5 flags) (the-as uint 1)) + (set! (-> v1-5 danger-type) (the-as uint 0)) + (set! (-> v1-5 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere v1-5) + ) + ) + ) + ) + +(defun cty-sniper-turret-shot-move ((arg0 cty-sniper-turret-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 65536.0 f0-0) + (vector-normalize! s4-0 65536.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +(defmethod made-impact? ((this cty-sniper-turret-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +(defmethod setup-collision! ((this cty-sniper-turret-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (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 projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (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 projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot crate hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this cty-sniper-turret-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'fac-robotank-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) cty-sniper-turret-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this damage) 2.0) + (set! (-> this vehicle-damage-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + 0 + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer cty-sniper-turret-shot). +(defun spawn-cty-sniper-turret-projectile ((arg0 cty-sniper-turret) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as + (pointer cty-sniper-turret-shot) + (spawn-projectile cty-sniper-turret-shot gp-0 arg0 *default-dead-pool*) + ) + ) + ) + +(set! (-> *lightning-spec-id-table* 49) (new 'static 'lightning-spec + :name "lightning-trail-cty-sniper-turret-cty-sniper-turret" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(set! (-> *lightning-spec-id-table* 50) (new 'static 'lightning-spec + :name "lightning-fractal-cty-sniper-turret-cty-sniper-turret" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(defpart 4853 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 4854 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup part-cty-sniper-turret-lightning-glow + :id 1469 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4854 :fade-after (meters 100) :flags (sp6)) (sp-item 4853 :fade-after (meters 100) :flags (sp6))) + ) + +(deftype cty-sniper-turret (process-focusable) + ((los los-control :inline) + (reticle handle) + (tank-quat quaternion :inline) + (rotate-quat quaternion :inline) + (rotate-rate float) + (rotate-mult float) + (shot-range float) + (fov-mult float) + (offset vector :inline) + (sight-pos vector :inline) + (firing-sight-pos vector :inline) + (gun-timer time-frame) + (gun-elev-jmod joint-mod-rotate-world :inline) + (gun-elev-joint-index int32) + (gun-elev-desired-rotation quaternion :inline) + (gun-azimuth-jmod joint-mod-rotate-world :inline) + (gun-azimuth-joint-index int32) + (gun-azimuth-desired-rotation quaternion :inline) + (gun-elev float) + (gun-elev-cam float) + (gun-aims-from-joint int32) + (gun-spread float) + (gun-current-aim-location vector :inline) + (gun-elbow-jmod joint-mod-rotate-local :inline) + (gun-shoulder-jmod joint-mod-rotate-local :inline) + (pos-cam-offset vector :inline) + (flags cty-sniper-turret-flag) + (turn-sound-id sound-id) + (h-reticle-strip handle) + (minimap connection-minimap) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (hud-buttons handle) + ) + (:state-methods + waiting-for-batteries + asleep + (ready symbol) + fire + locked-on + die + explode + ) + (:methods + (cty-sniper-turret-method-35 (_type_) none) + (fire-shot (_type_) (pointer process)) + (cty-sniper-turret-method-37 (_type_ vector float) symbol) + (cty-sniper-turret-method-38 (_type_ vector quaternion vector float) object) + (cty-sniper-turret-method-39 (_type_) symbol) + (cty-sniper-turret-method-40 (_type_) symbol) + (cty-sniper-turret-method-41 (_type_) symbol) + ) + ) + + +(deftype simple-prim-turret-reticle (simple-prim) + ((h-parent-turret handle) + ) + ) + + +(defstate active (simple-prim-turret-reticle) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go empty-state) + ) + ) + ) + ) + +(defmethod strip-setup ((this simple-prim-turret-reticle)) + (cond + ((logtest? (-> (the-as cty-sniper-turret (-> this h-parent-turret process 0)) flags) + (cty-sniper-turret-flag cst7) + ) + (set! (-> this strip num-verts) (the-as uint 4)) + (set! (-> this strip alpha) *simple-prim-additive*) + (set! (-> this strip data0) (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (set! (-> this strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip bucket) (bucket-id generic-sprite-1)) + (set! (-> this strip sink) (the-as uint 65)) + ) + (else + (set! (-> this strip num-verts) (the-as uint 0)) + 0 + ) + ) + (none) + ) + +;; WARN: Return type mismatch int vs rgba. +(defmethod get-color ((this simple-prim-turret-reticle)) + (the-as rgba #x20808070) + ) + +(defmethod get-alpha ((this simple-prim-turret-reticle)) + 32 + ) + +(deftype cty-sniper-turret-reticle (process) + ((ring-inner prim-strip) + (ring-middle prim-strip) + (ring-outer prim-strip) + (ring-inner-radius float) + (ring-middle-radius float) + (ring-outer-radius float) + (h-parent-turret handle) + (root collide-shape) + (wander-offset vector 2 :inline) + (wander-offset-reset-time time-frame) + (inner-ring-offset float) + (middle-ring-offset float) + (outer-ring-offset float) + (ring-scale-multiplier float) + (reticle-looping-sound sound-id) + (reticle-lockon-sound sound-id) + (current-color rgba) + (current-alpha uint8) + (lockon-start-time time-frame) + (flags cty-sniper-turret-reticle-flag) + ) + (:state-methods + idle + lock + ) + (:methods + (gen-prim-verts (_type_) none) + (init-strips (_type_) none) + (get-alpha (_type_) uint) + (cty-sniper-turret-reticle-method-19 (_type_) none) + (get-curr-color (_type_) rgba) + ) + ) + + +;; WARN: Return type mismatch quaternion vs none. +(defmethod cty-sniper-turret-reticle-method-19 ((this cty-sniper-turret-reticle)) + (set! (-> this root) (the-as collide-shape (new 'process 'trsq))) + (quaternion-identity! (-> this root quat)) + (none) + ) + +(defbehavior cty-sniper-turret-reticle-init-by-other cty-sniper-turret-reticle ((arg0 vector) (arg1 vector) (arg2 texture-id)) + (cty-sniper-turret-reticle-method-19 self) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root scale quad) (-> arg1 quad)) + (matrix->quaternion (-> self root quat) (math-camera-matrix)) + (set! (-> self wander-offset 0 quad) (the-as uint128 0)) + (set! (-> self wander-offset 1 quad) (the-as uint128 0)) + (set! (-> self ring-inner) (new 'process 'prim-strip 4 arg2 (the-as string #f))) + (set! (-> self ring-middle) (new 'process 'prim-strip 4 arg2 (the-as string #f))) + (set! (-> self ring-outer) (new 'process 'prim-strip 4 arg2 (the-as string #f))) + (set! (-> self ring-scale-multiplier) 1.0) + (set! (-> self flags) (cty-sniper-turret-reticle-flag)) + (set! (-> self inner-ring-offset) 0.0) + (set! (-> self middle-ring-offset) 0.0) + (set! (-> self outer-ring-offset) 0.0) + (set! (-> self reticle-looping-sound) (new-sound-id)) + (set! (-> self reticle-lockon-sound) (new-sound-id)) + (go-virtual idle) + ) + +(defmethod init-strips ((this cty-sniper-turret-reticle)) + (set! (-> this ring-inner alpha) *simple-prim-additive*) + (set! (-> this ring-inner data0) (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (set! (-> this ring-inner adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this ring-inner bucket) (bucket-id generic-sprite-1)) + (set! (-> this ring-inner sink) (the-as uint 65)) + (set! (-> this ring-middle alpha) *simple-prim-additive*) + (set! (-> this ring-middle data0) (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (set! (-> this ring-middle adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this ring-middle bucket) (bucket-id generic-sprite-1)) + (set! (-> this ring-middle sink) (the-as uint 65)) + (set! (-> this ring-outer alpha) *simple-prim-additive*) + (set! (-> this ring-outer data0) (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (set! (-> this ring-outer adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this ring-outer bucket) (bucket-id generic-sprite-1)) + (set! (-> this ring-outer sink) (the-as uint 65)) + (none) + ) + +(defmethod get-curr-color ((this cty-sniper-turret-reticle)) + (-> this current-color) + ) + +(defmethod get-alpha ((this cty-sniper-turret-reticle)) + (-> this current-alpha) + ) + +;; WARN: Return type mismatch rgba vs none. +(defmethod gen-prim-verts ((this cty-sniper-turret-reticle)) + (when (logtest? (-> this flags) (cty-sniper-turret-reticle-flag cstr0)) + (let ((gp-0 (new-stack-vector0))) + (let ((f30-0 + (- 1.0 + (* 0.0033333334 (the float (- (-> this wander-offset-reset-time) (-> *display* game-clock frame-counter)))) + ) + ) + ) + (set! (-> gp-0 x) (lerp-clamp (-> this wander-offset 0 x) (-> this wander-offset 1 x) f30-0)) + (set! (-> gp-0 y) (lerp-clamp (-> this wander-offset 0 y) (-> this wander-offset 1 y) f30-0)) + ) + (vector-orient-by-quat! gp-0 gp-0 (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let* ((s4-0 + (quaternion-rotate-local-z! (new 'stack-no-clear 'quaternion) (-> this root quat) (-> this inner-ring-offset)) + ) + (s0-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)) + (s1-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-0)) + (s4-1 (get-alpha this)) + (s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (get-curr-color this)) + ) + (vector-normalize! s0-0 (* 4096.0 (-> this ring-scale-multiplier))) + (vector-normalize! s1-0 (* 4096.0 (-> this ring-scale-multiplier))) + (let ((v1-14 (-> this ring-inner data))) + (vector+! s2-0 gp-0 s0-0) + (vector+! s2-0 s2-0 s1-0) + (set! (-> v1-14 0 pos quad) (-> s2-0 quad)) + (set! (-> v1-14 0 stq z) 0.0) + (set! (-> v1-14 0 stq x) 0.0) + (set! (-> v1-14 0 stq y) 0.0) + (set! (-> v1-14 0 col) s3-0) + (set! (-> v1-14 0 col a) s4-1) + (let ((v1-15 (-> v1-14 1))) + (vector+float*! s2-0 gp-0 s0-0 -1.0) + (vector+! s2-0 s2-0 s1-0) + (set! (-> v1-15 pos quad) (-> s2-0 quad)) + (set! (-> v1-15 stq z) 0.0) + (set! (-> v1-15 stq x) 1.0) + (set! (-> v1-15 stq y) 0.0) + (set! (-> v1-15 col) s3-0) + (set! (-> v1-15 col a) s4-1) + (let ((v1-16 (&+ v1-15 32))) + (vector+! s2-0 gp-0 s0-0) + (vector+float*! s2-0 s2-0 s1-0 -1.0) + (set! (-> v1-16 pos quad) (-> s2-0 quad)) + (set! (-> v1-16 stq z) 0.0) + (set! (-> v1-16 stq x) 0.0) + (set! (-> v1-16 stq y) 1.0) + (set! (-> v1-16 col) s3-0) + (set! (-> v1-16 col a) s4-1) + (let ((v1-17 (&+ v1-16 32))) + (vector+float*! s2-0 gp-0 s0-0 -1.0) + (vector+float*! s2-0 s2-0 s1-0 -1.0) + (set! (-> v1-17 pos quad) (-> s2-0 quad)) + (set! (-> v1-17 stq z) 0.0) + (set! (-> v1-17 stq x) 1.0) + (set! (-> v1-17 stq y) 1.0) + (set! (-> v1-17 col) s3-0) + (set! (-> v1-17 col a) s4-1) + ) + ) + ) + ) + ) + (let* ((s4-2 (quaternion-rotate-local-z! + (new 'stack-no-clear 'quaternion) + (-> this root quat) + (- (-> this middle-ring-offset)) + ) + ) + (s0-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-2)) + (s1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-2)) + (s4-3 (get-alpha this)) + (s2-1 (new 'stack-no-clear 'vector)) + (s3-1 (get-curr-color this)) + ) + (vector-normalize! s0-1 (* 6553.6 (-> this ring-scale-multiplier))) + (vector-normalize! s1-1 (* 6553.6 (-> this ring-scale-multiplier))) + (let ((v1-24 (-> this ring-middle data))) + (vector+! s2-1 gp-0 s0-1) + (vector+! s2-1 s2-1 s1-1) + (set! (-> v1-24 0 pos quad) (-> s2-1 quad)) + (set! (-> v1-24 0 stq z) 0.0) + (set! (-> v1-24 0 stq x) 0.0) + (set! (-> v1-24 0 stq y) 0.0) + (set! (-> v1-24 0 col) s3-1) + (set! (-> v1-24 0 col a) s4-3) + (let ((v1-25 (-> v1-24 1))) + (vector+float*! s2-1 gp-0 s0-1 -1.0) + (vector+! s2-1 s2-1 s1-1) + (set! (-> v1-25 pos quad) (-> s2-1 quad)) + (set! (-> v1-25 stq z) 0.0) + (set! (-> v1-25 stq x) 1.0) + (set! (-> v1-25 stq y) 0.0) + (set! (-> v1-25 col) s3-1) + (set! (-> v1-25 col a) s4-3) + (let ((v1-26 (&+ v1-25 32))) + (vector+! s2-1 gp-0 s0-1) + (vector+float*! s2-1 s2-1 s1-1 -1.0) + (set! (-> v1-26 pos quad) (-> s2-1 quad)) + (set! (-> v1-26 stq z) 0.0) + (set! (-> v1-26 stq x) 0.0) + (set! (-> v1-26 stq y) 1.0) + (set! (-> v1-26 col) s3-1) + (set! (-> v1-26 col a) s4-3) + (let ((v1-27 (&+ v1-26 32))) + (vector+float*! s2-1 gp-0 s0-1 -1.0) + (vector+float*! s2-1 s2-1 s1-1 -1.0) + (set! (-> v1-27 pos quad) (-> s2-1 quad)) + (set! (-> v1-27 stq z) 0.0) + (set! (-> v1-27 stq x) 1.0) + (set! (-> v1-27 stq y) 1.0) + (set! (-> v1-27 col) s3-1) + (set! (-> v1-27 col a) s4-3) + ) + ) + ) + ) + ) + (let* ((s4-4 + (quaternion-rotate-local-z! (new 'stack-no-clear 'quaternion) (-> this root quat) (-> this outer-ring-offset)) + ) + (s0-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-4)) + (s1-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-4)) + (s4-5 (get-alpha this)) + (s2-2 (new 'stack-no-clear 'vector)) + (s3-2 (get-curr-color this)) + ) + (vector-normalize! s0-2 (* 9420.8 (-> this ring-scale-multiplier))) + (vector-normalize! s1-2 (* 9420.8 (-> this ring-scale-multiplier))) + (let ((v1-34 (-> this ring-outer data))) + (vector+! s2-2 gp-0 s0-2) + (vector+! s2-2 s2-2 s1-2) + (set! (-> v1-34 0 pos quad) (-> s2-2 quad)) + (set! (-> v1-34 0 stq z) 0.0) + (set! (-> v1-34 0 stq x) 0.0) + (set! (-> v1-34 0 stq y) 0.0) + (set! (-> v1-34 0 col) s3-2) + (set! (-> v1-34 0 col a) s4-5) + (let ((v1-35 (-> v1-34 1))) + (vector+float*! s2-2 gp-0 s0-2 -1.0) + (vector+! s2-2 s2-2 s1-2) + (set! (-> v1-35 pos quad) (-> s2-2 quad)) + (set! (-> v1-35 stq z) 0.0) + (set! (-> v1-35 stq x) 1.0) + (set! (-> v1-35 stq y) 0.0) + (set! (-> v1-35 col) s3-2) + (set! (-> v1-35 col a) s4-5) + (let ((v1-36 (&+ v1-35 32))) + (vector+! s2-2 gp-0 s0-2) + (vector+float*! s2-2 s2-2 s1-2 -1.0) + (set! (-> v1-36 pos quad) (-> s2-2 quad)) + (set! (-> v1-36 stq z) 0.0) + (set! (-> v1-36 stq x) 0.0) + (set! (-> v1-36 stq y) 1.0) + (set! (-> v1-36 col) s3-2) + (set! (-> v1-36 col a) s4-5) + (let ((v1-37 (&+ v1-36 32))) + (vector+float*! s2-2 gp-0 s0-2 -1.0) + (vector+float*! s2-2 s2-2 s1-2 -1.0) + (set! (-> v1-37 pos quad) (-> s2-2 quad)) + (set! (-> v1-37 stq z) 0.0) + (set! (-> v1-37 stq x) 1.0) + (set! (-> v1-37 stq y) 1.0) + (set! (-> v1-37 col) s3-2) + (set! (-> v1-37 col a) s4-5) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod relocate ((this simple-prim) (offset int)) + (if (nonzero? (-> this strip)) + (&+! (-> this strip) offset) + ) + (call-parent-method this offset) + ) + +(defun sloppy-lead-player-location ((arg0 vector) (arg1 vector) (arg2 float)) + (let* ((s4-0 (get-trans *target* 0)) + (f30-1 (+ 0.49 (/ (vector-vector-distance s4-0 arg1) arg2))) + ) + (vector-! arg0 (vector+float*! (new 'stack-no-clear 'vector) s4-0 (get-transv *target*) f30-1) arg1) + ) + ) + +(defbehavior cty-sniper-turret-reticle-post cty-sniper-turret-reticle () + (if (logtest? (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (sound-play "reticle-steady" :id (-> self reticle-looping-sound)) + ) + (init-strips self) + (gen-prim-verts self) + (none) + ) + +(defbehavior cty-sniper-turret-reticle-handler cty-sniper-turret-reticle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('update) + (-> arg3 param 0) + (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (matrix->quaternion (-> self root quat) (math-camera-matrix)) + ) + (('collide-dist) + #f + ) + (('on) + (logior! (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (set! (-> self ring-inner num-verts) (the-as uint 4)) + (set! (-> self ring-middle num-verts) (the-as uint 4)) + (let ((v0-1 (the-as object 4))) + (set! (-> self ring-outer num-verts) (the-as uint v0-1)) + v0-1 + ) + ) + (('off) + (logclear! (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (set! (-> self ring-inner num-verts) (the-as uint 0)) + (set! (-> self ring-middle num-verts) (the-as uint 0)) + (set! (-> self ring-outer num-verts) (the-as uint 0)) + (sound-stop (-> self reticle-looping-sound)) + (sound-stop (-> self reticle-lockon-sound)) + ) + (('lock) + (go-virtual lock) + ) + (('unlock) + (go-virtual idle) + ) + (('die) + (sound-stop (-> self reticle-looping-sound)) + (sound-stop (-> self reticle-lockon-sound)) + (go empty-state) + ) + ) + ) + +(defstate idle (cty-sniper-turret-reticle) + :virtual #t + :event cty-sniper-turret-reticle-handler + :enter (behavior () + (set! (-> self current-color) (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x10)) + (set! (-> self ring-scale-multiplier) 1.3) + (set! (-> self current-alpha) (the-as uint 16)) + (set! (-> self wander-offset 0 quad) (the-as uint128 0)) + (let ((gp-0 (-> self wander-offset 1))) + (let* ((f30-0 -16384.0) + (f28-0 32768.0) + (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-8 (the-as number (logior #x3f800000 v1-7))) + ) + (set! (-> gp-0 x) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-8))))) + ) + (let* ((f30-1 -16384.0) + (f28-1 32768.0) + (v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-14 (the-as number (logior #x3f800000 v1-13))) + ) + (set! (-> gp-0 y) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-14))))) + ) + (set! (-> gp-0 z) 0.0) + (set! (-> gp-0 w) 1.0) + ) + (set! (-> self wander-offset-reset-time) (+ (-> *display* game-clock frame-counter) (seconds 1))) + (sound-stop (-> self reticle-lockon-sound)) + ) + :trans (behavior () + (let ((v1-1 (current-time))) + (set! (-> self inner-ring-offset) (* 312.0762 (the float (mod v1-1 210)))) + (set! (-> self middle-ring-offset) (* 43.690666 (the float (mod v1-1 1500)))) + (set! (-> self outer-ring-offset) (* 70.46882 (the float (mod v1-1 930)))) + ) + (when (< (-> self wander-offset-reset-time) (-> *display* game-clock frame-counter)) + (set! (-> self wander-offset 0 quad) (-> self wander-offset 1 quad)) + (let ((gp-0 (-> self wander-offset 1))) + (let* ((f30-0 -16384.0) + (f28-0 32768.0) + (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-11 (the-as number (logior #x3f800000 v1-10))) + ) + (set! (-> gp-0 x) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-11))))) + ) + (let* ((f30-1 -16384.0) + (f28-1 32768.0) + (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-17 (the-as number (logior #x3f800000 v1-16))) + ) + (set! (-> gp-0 y) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-17))))) + ) + (set! (-> gp-0 z) 0.0) + (set! (-> gp-0 w) 1.0) + ) + (set! (-> self wander-offset-reset-time) (+ (-> *display* game-clock frame-counter) (seconds 1))) + ) + (if (logtest? (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (sound-play "turret-scan" :id (-> self reticle-lockon-sound)) + ) + ) + :code sleep-code + :post cty-sniper-turret-reticle-post + ) + +(defstate lock (cty-sniper-turret-reticle) + :virtual #t + :event cty-sniper-turret-reticle-handler + :enter (behavior () + (set-time! (-> self lockon-start-time)) + (let ((gp-0 (new-stack-vector0))) + (let ((f30-0 + (- 1.0 + (* 0.0033333334 (the float (- (-> self wander-offset-reset-time) (-> *display* game-clock frame-counter)))) + ) + ) + ) + (set! (-> gp-0 x) (lerp-clamp (-> self wander-offset 0 x) (-> self wander-offset 1 x) f30-0)) + (set! (-> gp-0 y) (lerp-clamp (-> self wander-offset 0 y) (-> self wander-offset 1 y) f30-0)) + ) + (set! (-> self wander-offset 0 quad) (-> gp-0 quad)) + ) + (set-vector! (-> self wander-offset 1) 0.0 0.0 0.0 1.0) + (set! (-> self wander-offset-reset-time) (+ (-> *display* game-clock frame-counter) (seconds 1))) + ) + :trans (behavior () + 450 + (let ((v1-3 (- (current-time) (+ (-> self lockon-start-time) (seconds 1.5))))) + (cond + ((< v1-3 0) + (set! (-> self current-color) (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x18)) + ) + ((< v1-3 (seconds 0.49)) + (let ((f30-0 (* 0.006802721 (the float v1-3)))) + (set! (-> self current-color) (rgba-lerp + (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x18) + (new 'static 'rgba :r #x10 :g #x40 :b #xf0 :a #x80) + (the-as rgba f30-0) + ) + ) + (set! (-> self current-alpha) (the-as uint (the int (lerp 24.0 128.0 f30-0)))) + ) + ) + (else + (set! (-> self current-color) (new 'static 'rgba :r #x10 :g #x40 :b #xf0 :a #x80)) + (set! (-> self current-alpha) (the-as uint 128)) + ) + ) + ) + ) + :code (behavior () + (let ((f30-0 (-> self inner-ring-offset)) + (f28-0 (-> self middle-ring-offset)) + (f26-0 (-> self outer-ring-offset)) + (gp-0 450) + ) + (while (< (current-time) (+ gp-0 (-> self lockon-start-time))) + (let ((f24-0 (/ (the float (- (current-time) (-> self lockon-start-time))) (the float gp-0)))) + (set! (-> self inner-ring-offset) (lerp-clamp f30-0 0.0 (* 3.0 f24-0))) + (set! (-> self middle-ring-offset) (lerp-clamp f28-0 0.0 (* 2.0 f24-0))) + (set! (-> self outer-ring-offset) (lerp-clamp f26-0 0.0 f24-0)) + ) + (suspend) + ) + ) + (sound-stop (-> self reticle-lockon-sound)) + (let ((gp-1 (current-time)) + (f30-1 147.0) + ) + (while (< (the float (current-time)) (+ f30-1 (the float gp-1))) + (set! (-> self ring-scale-multiplier) + (lerp-clamp 1.3 0.5 (/ (- (the float (current-time)) (the float gp-1)) f30-1)) + ) + (if (logtest? (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (sound-play "turret-lock" :id (-> self reticle-lockon-sound)) + ) + (suspend) + ) + ) + (sleep-code) + ) + :post cty-sniper-turret-reticle-post + ) + +;; WARN: Return type mismatch process vs cty-sniper-turret-reticle. +(defmethod relocate ((this cty-sniper-turret-reticle) (offset int)) + (if (nonzero? (-> this ring-inner)) + (&+! (-> this ring-inner) offset) + ) + (if (nonzero? (-> this ring-middle)) + (&+! (-> this ring-middle) offset) + ) + (if (nonzero? (-> this ring-outer)) + (&+! (-> this ring-outer) offset) + ) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (the-as cty-sniper-turret-reticle ((method-of-type process relocate) this offset)) + ) + +(defskelgroup skel-cty-sniper-turret cty-sniper-turret cty-sniper-turret-lod0-jg cty-sniper-turret-idle-ja + ((cty-sniper-turret-lod0-mg (meters 20)) (cty-sniper-turret-lod1-mg (meters 999999))) + :bounds (static-spherem 0 36864 0 36864) + :origin-joint-index 3 + ) + +(defskelgroup skel-cty-sniper-turret-explode cty-sniper-turret cty-sniper-turret-explode-lod0-jg cty-sniper-turret-explode-idle-ja + ((cty-sniper-turret-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *cty-sniper-turret-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 4 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 28 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index 3) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(defpart 4855 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 0.0) + (:b :copy g) + (:a 96.0 64.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +(defmethod fire-shot ((this cty-sniper-turret)) + (let* ((s5-0 (-> this node-list data (-> this gun-aims-from-joint))) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) s5-0)) + (s5-1 (-> s5-0 bone transform fvec)) + (v1-5 (rand-vu-sphere-point-uniform! (new 'stack-no-clear 'vector) (* 0.05 (rand-vu)))) + (s3-2 (vector+! (new 'stack-no-clear 'vector) s5-1 v1-5)) + (s5-2 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (vector-normalize! s3-2 512000.0) + (set! (-> s5-2 ent) (-> this entity)) + (set! (-> s5-2 charge) 1.0) + (set! (-> s5-2 options) (projectile-options)) + (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) + (set! (-> s5-2 pos quad) (-> s4-0 quad)) + (set! (-> s5-2 vel quad) (-> s3-2 quad)) + (set! (-> s5-2 notify-handle) (process->handle this)) + (set! (-> s5-2 owner-handle) (the-as handle #f)) + (set! (-> s5-2 target-handle) (the-as handle #f)) + (set! (-> s5-2 target-pos quad) (the-as uint128 0)) + (set! (-> s5-2 ignore-handle) (process->handle this)) + (let* ((v1-19 *game-info*) + (a0-17 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-17) + (set! (-> s5-2 attack-id) a0-17) + ) + (set! (-> s5-2 timeout) (seconds 4)) + (spawn-projectile cty-sniper-turret-shot s5-2 this *default-dead-pool*) + ) + ) + +(defmethod get-trans ((this cty-sniper-turret) (arg0 int)) + "Get the `trans` for this process." + (case arg0 + ((2 3) + (let ((v1-2 (new 'static 'vector :w 1.0))) + (vector<-cspace! v1-2 (-> this node-list data (-> this gun-aims-from-joint))) + ) + ) + (else + (vector+! + (new 'static 'vector :w 1.0) + (the-as vector (-> this root root-prim prim-core)) + (-> this pos-cam-offset) + ) + ) + ) + ) + +(defmethod cty-sniper-turret-method-40 ((this cty-sniper-turret)) + (and (should-check-los? (-> this los) 0) + (< (vector-vector-xz-distance (-> this root trans) (target-pos 0)) 163840.0) + (< -16384.0 (- (-> (target-pos 0) y) (-> this root trans y))) + ) + ) + +(defmethod cty-sniper-turret-method-41 ((this cty-sniper-turret)) + (and (logtest? (-> this flags) (cty-sniper-turret-flag cst7)) + (or (los-control-method-11 (-> this los) 0) + (< 204800.0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) + (< (- (-> (target-pos 0) y) (-> this root trans y)) -24576.0) + ) + ) + ) + +(defbehavior sniper-turret-post cty-sniper-turret () + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 *target*) + (a1-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (cond + ((and (logtest? (-> self flags) (cty-sniper-turret-flag cst0)) a1-1) + (if (logtest? (-> self flags) (cty-sniper-turret-flag cst9)) + (los-control-method-9 (-> self los) a1-1 (the-as vector #f) 819.2 4096.0) + ) + (when (or (logtest? (-> self flags) (cty-sniper-turret-flag cst12)) (cty-sniper-turret-method-41 self)) + (cond + ((logtest? (-> self flags) (cty-sniper-turret-flag cst12)) + (logclear! (-> self flags) (cty-sniper-turret-flag cst12)) + (remove-setting! 'pov-offset) + (send-event self 'pov-cam-off) + (send-event (handle->process (-> self reticle)) 'off) + '(go (ready)) + ) + (else + (remove-setting! 'interp-time) + (logior! (-> self flags) (cty-sniper-turret-flag cst12)) + ) + ) + ) + (when *target* + (let ((f30-0 (if *target* + (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + ) + ) + (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self gun-aims-from-joint)))) + ) + (let* ((v1-43 (sloppy-lead-player-location (new 'stack-no-clear 'vector) gp-1 512000.0)) + (s4-1 (vector+! (new 'stack-no-clear 'vector) v1-43 gp-1)) + ) + (set! s4-1 (cond + ((logtest? (-> self flags) (cty-sniper-turret-flag cst11)) + (empty) + s4-1 + ) + (else + (get-trans *target* 3) + ) + ) + ) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> self gun-current-aim-location))) + (f28-0 (vector-length s5-1)) + ) + (if *target* + (look-at! (-> *target* neck) gp-1 'attacking self) + ) + (if (< (* 98304.0 (seconds-per-frame)) f28-0) + (vector+! + (-> self gun-current-aim-location) + (-> self gun-current-aim-location) + (vector-normalize! s5-1 (* 98304.0 (seconds-per-frame))) + ) + (set! (-> self gun-current-aim-location quad) (-> s4-1 quad)) + ) + ) + ) + (let ((t9-13 quaternion-look-at!) + (a0-21 (-> self gun-elev-jmod rotation)) + (a1-14 (vector-! (new 'stack-no-clear 'vector) (-> self gun-current-aim-location) gp-1)) + ) + (let ((f0-4 1.0)) + (.lvf vf1 (&-> a1-14 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((v1-63 f0-4)) + (.mov vf3 v1-63) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a1-14 quad) vf1) + (t9-13 a0-21 a1-14 *up-vector*) + ) + ) + (when (logtest? (-> self flags) (cty-sniper-turret-flag cst7)) + (send-event (handle->process (-> self reticle)) 'update (-> self gun-current-aim-location)) + (let ((f0-6 (* 0.000018780049 (+ -20480.0 f30-0)))) + (set! (-> self pos-cam-offset y) (lerp-clamp 53248.0 106496.0 f0-6)) + ) + (set-setting! 'pov-offset 'abs (-> self pos-cam-offset) 0) + (let ((a1-20 (vector-xz-normalize-copy! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self gun-current-aim-location)) + 1.0 + ) + ) + ) + (quaternion-look-at! (-> self gun-azimuth-jmod rotation) a1-20 *up-vector*) + ) + (quaternion-copy! (-> self gun-shoulder-jmod rotation) (new 'static 'quaternion :x 0.5 :w 0.8660254)) + (quaternion-copy! (-> self gun-elbow-jmod rotation) (new 'static 'quaternion :x -0.5 :w 0.8660254)) + (set! (-> self fov-mult) (lerp-clamp 1.3 0.45 (* 0.0000048828124 f30-0))) + (set-setting! 'fov 'rel (-> self fov-mult) 0) + ) + ) + ) + ) + (else + (send-event (handle->process (-> self reticle)) 'off) + ) + ) + ) + (transform-post) + (none) + ) + ) + +(defbehavior cty-sniper-turret-handler cty-sniper-turret ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('fire-suppress) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (cty-sniper-turret-flag cst4))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (cty-sniper-turret-flag cst4))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('set-spread) + (set! (-> self gun-spread) (the-as float (-> arg3 param 0))) + ) + (('use-los) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (cty-sniper-turret-flag cst9))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (cty-sniper-turret-flag cst9))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('limit-reticle-elev) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (cty-sniper-turret-flag cst10))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (cty-sniper-turret-flag cst10))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('pov-cam-on) + (sound-play "interface-open") + (remove-setting! 'entity-name) + (let ((v1-18 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + ) + (persist-with-delay *setting-control* 'rapid-tracking (seconds 0.5) 'rapid-tracking #f 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-pov-track 0.0 0) + (set-setting! 'allow-look-around #f 0.0 0) + (let ((v1-27 (process->ppointer self))) + (set-setting! 'pov-handle v1-27 3.0 (-> v1-27 0 pid)) + ) + (set-setting! 'pov-offset 'abs (-> self pos-cam-offset) 0) + (set-setting! 'scanlines 'abs 0.2 0) + (set-setting! 'matrix-blend-max-angle 'abs (degrees 360.0) 0) + (setup-masks (-> self draw) 0 1) + (let ((gp-1 (process-spawn hud-cty-sniper-fight :init hud-init-by-other :name "hud-cty-sniper-fight" :to self))) + (set! (-> self hud-buttons) (ppointer->handle gp-1)) + (send-event (handle->process (-> self hud-buttons)) 'enable) + (send-event (handle->process (-> self hud-buttons)) 'force-show) + (let ((a1-18 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-18 from) (process->ppointer self)) + (set! (-> a1-18 num-params) 0) + (set! (-> a1-18 message) 'get-buttons-actor-group) + (let* ((t9-17 send-event-function) + (v1-60 (-> self actor-group 0 data 0 actor)) + (a1-19 (the-as (pointer actor-group) (t9-17 + (if v1-60 + (-> v1-60 extra process) + ) + a1-18 + ) + ) + ) + ) + (if a1-19 + (draw-hud-buttons (the-as hud-cty-sniper-fight (-> gp-1 0)) a1-19) + ) + ) + ) + ) + (logior! (-> self flags) (cty-sniper-turret-flag cst7)) + (set! v0-0 (logclear (-> self flags) (cty-sniper-turret-flag cst12))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + v0-0 + ) + (('pov-cam-off) + (let ((v1-71 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-71 prim-core collide-as) (collide-spec)) + (set! (-> v1-71 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "interface-close") + (let ((v1-76 (-> *camera* slave))) + (when (and (-> v1-76 0 next-state) (= (-> v1-76 0 next-state name) 'cam-pov-track)) + (set! (-> v1-76 0 blend-from-type) (camera-blend-from-type unknown-0)) + 0 + ) + ) + (remove-setting! 'interp-time) + (remove-setting! 'pov-handle) + (remove-setting! 'mode-name) + (remove-setting! 'allow-look-around) + (remove-setting! 'pov-offset) + (remove-setting! 'scanlines) + (remove-setting! 'matrix-blend-max-angle) + (setup-masks (-> self draw) 1 0) + (quaternion-identity! (-> self gun-azimuth-jmod rotation)) + (quaternion-identity! (-> self gun-shoulder-jmod rotation)) + (quaternion-identity! (-> self gun-elbow-jmod rotation)) + (send-event (handle->process (-> self hud-buttons)) 'hide-and-die) + (logclear! (-> *target* focus-status) (focus-status ignore)) + (logclear! (-> self flags) (cty-sniper-turret-flag cst7)) + (remove-setting! 'fov) + ) + (('get-rotate-quat) + (-> self rotate-quat) + ) + (('get-gun-elevation-cam) + (-> self gun-elev-cam) + ) + (('update) + (-> arg3 param 1) + (new 'stack-no-clear 'vector) + (let ((gp-3 (new 'stack-no-clear 'quaternion)) + (s5-3 (the-as cspace (-> arg3 param 2))) + ) + (vector<-cspace+vector! (-> self root trans) s5-3 (-> self offset)) + (matrix->quaternion gp-3 (-> s5-3 bone transform)) + ) + ) + (('die) + (go-virtual die) + ) + ) + ) + +(defmethod cty-sniper-turret-method-37 ((this cty-sniper-turret) (arg0 vector) (arg1 float)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> s4-1 quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s3-0 s5-0) (cos arg1)) + ) + ) + +(defstate waiting-for-batteries (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :enter (behavior () + '() + ) + :trans (behavior () + (dotimes (gp-0 (length (-> self actor-group 0))) + (let ((v1-2 (-> self actor-group 0 data gp-0)) + (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) 'alive) + (let ((t9-0 send-event-function) + (v1-3 (-> v1-2 actor)) + ) + (if (t9-0 + (if v1-3 + (-> v1-3 extra process) + ) + a1-0 + ) + (go-virtual asleep) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defstate asleep (cty-sniper-turret) + :virtual #t + :enter (behavior () + (send-event self 'pov-cam-off) + (send-event (handle->process (-> self reticle)) 'unlock) + ) + :exit (behavior () + (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) 'start-music) + (let ((t9-0 send-event-function) + (v1-4 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-0 + (handle->process (if (-> v1-4 manager) + (-> v1-4 manager manager) + (the-as handle #f) + ) + ) + a1-0 + ) + ) + ) + (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) 'turret-awakens) + (let ((t9-1 send-event-function) + (v1-14 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-1 + (handle->process (if (-> v1-14 manager) + (-> v1-14 manager manager) + (the-as handle #f) + ) + ) + a1-1 + ) + ) + ) + ) + :code (behavior () + (ja-no-eval :group! cty-sniper-turret-deactivate-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + :post (behavior () + (if (and (ja-done? 0) (< (if *target* + (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 266240.0 + ) + ) + (go-virtual ready #t) + ) + (ja-post) + ) + ) + +(defstate locked-on (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :exit (behavior () + (logclear! (-> self flags) (cty-sniper-turret-flag cst3)) + ) + :trans (behavior () + (if (cty-sniper-turret-method-39 self) + (go-virtual die) + ) + ) + :code (behavior () + (logior! (-> self flags) (cty-sniper-turret-flag cst3)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.49)) + (suspend) + ) + ) + (let ((gp-1 (rand-vu-int-range 3 6))) + (dotimes (s5-0 gp-1) + (fire-shot self) + (ja-no-eval :group! cty-sniper-turret-barrelfire-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (suspend) + (if (and *target* (logtest? (-> *target* target-flags) (target-flags tf2 tinvuln1))) + (go-virtual fire) + ) + ) + ) + (go-virtual fire) + ) + :post (behavior () + (let* ((gp-0 *target*) + (a1-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (if a1-1 + (los-control-method-9 (-> self los) a1-1 (the-as vector #f) 819.2 4096.0) + ) + ) + (when (or (cty-sniper-turret-method-41 self) (logtest? (-> self flags) (cty-sniper-turret-flag cst12))) + (cond + ((logtest? (-> self flags) (cty-sniper-turret-flag cst12)) + (logclear! (-> self flags) (cty-sniper-turret-flag cst12)) + (remove-setting! 'pov-offset) + (send-event self 'pov-cam-off) + (send-event (handle->process (-> self reticle)) 'off) + (go-virtual fire) + ) + (else + (remove-setting! 'interp-time) + (logior! (-> self flags) (cty-sniper-turret-flag cst12)) + ) + ) + ) + (ja-post) + ) + ) + +(defstate ready (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :enter (behavior ((arg0 symbol)) + (logior! (-> self flags) (cty-sniper-turret-flag cst0)) + (set-time! (-> self gun-timer)) + (send-event (handle->process (-> self reticle)) 'unlock) + (set! (-> self gun-current-aim-location quad) (-> *target* control trans quad)) + (send-event (handle->process (-> self reticle)) 'update (-> self gun-current-aim-location)) + ) + :trans (behavior () + (if (cty-sniper-turret-method-39 self) + (go-virtual die) + ) + ) + :code (behavior ((arg0 symbol)) + (when arg0 + (ja-no-eval :group! cty-sniper-turret-activate-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! cty-sniper-turret-activate-ja :num! max) + ) + (if (not (cty-sniper-turret-method-39 self)) + (go-virtual fire) + ) + (until #f + (ja-no-eval :group! cty-sniper-turret-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post sniper-turret-post + ) + +(defstate fire (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :enter (behavior () + (logior! (-> self flags) (cty-sniper-turret-flag cst8)) + (send-event (handle->process (-> self reticle)) 'unlock) + (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) + ) + :exit (behavior () + (disable *screen-filter*) + ) + :trans (behavior () + (cond + ((cty-sniper-turret-method-39 self) + (go-virtual die) + ) + ((< 266240.0 (if *target* + (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + ) + (go-virtual asleep) + ) + ) + ) + :code (behavior () + (local-vars (v1-56 time-frame) (a0-17 int) (gp-5 time-frame) (f30-1 float)) + (until #f + (while (not (logtest? (-> self flags) (cty-sniper-turret-flag cst7))) + (until (cty-sniper-turret-method-40 self) + (suspend) + ) + 1.0 + (remove-setting! 'entity-name) + (set-setting! 'interp-time 'abs 450.0 0) + (set-setting! 'allow-look-around #f 0.0 0) + (suspend) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0))) + (s5-2 (vector-! (new 'stack-no-clear 'vector) (camera-pos) (target-pos 0))) + ) + (set! (-> gp-1 y) 0.0) + (set! (-> s5-2 y) 0.0) + (let ((f30-0 (vector-dot gp-1 s5-2))) + (when (and (< f30-0 0.0) (not (-> *setting-control* user-current freeze-screen))) + (set-setting! 'mode-name 'cam-no-trans 0.0 0) + (suspend) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 (seconds 0.5)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (the-as uint128 0)) + (cond + ((< (* (-> s5-2 x) (-> gp-1 z)) (* (-> s5-2 z) (-> gp-1 x))) + (set! (-> s3-0 z) (- (-> s5-2 x))) + (set! (-> s3-0 x) (-> s5-2 z)) + ) + (else + (set! (-> s3-0 z) (-> s5-2 x)) + (set! (-> s3-0 x) (- (-> s5-2 z))) + ) + ) + (vector+! s3-0 s3-0 (target-pos 0)) + (+! (-> s3-0 y) 20480.0) + (set! (-> *camera* slave 0 trans quad) (-> s3-0 quad)) + ) + (vector-! gp-1 (-> self root trans) (target-pos 0)) + (vector-! s5-2 (camera-pos) (target-pos 0)) + (set-setting! 'interp-time 'abs 300.0 0) + (suspend) + ) + ) + ) + (set-setting! 'mode-name 'cam-pov-track 0.0 0) + (let ((v1-43 (process->ppointer self))) + (set-setting! 'pov-handle v1-43 3.0 (-> v1-43 0 pid)) + ) + (set-setting! 'pov-offset 'abs (-> self pos-cam-offset) 0) + (when (not (-> *setting-control* user-current freeze-screen)) + (set-setting! 'matrix-blend-max-angle 'abs (degrees 10.0) 0) + (let ((gp-2 (current-time))) + (until (>= v1-56 a0-17) + (suspend) + (set! v1-56 (- (current-time) gp-2)) + (set! a0-17 (if (< 0.0 f30-0) + 450 + 300 + ) + ) + ) + ) + (remove-setting! 'matrix-blend-max-angle) + ) + ) + ) + (cond + ((not (-> *setting-control* user-current freeze-screen)) + (setup + *screen-filter* + (new 'static 'vector) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 0.08 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (logior! (-> *target* focus-status) (focus-status ignore)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.08)) + (suspend) + ) + ) + (send-event self 'pov-cam-on) + (send-event (handle->process (-> self reticle)) 'on) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector) + (* 0.08 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 0.08)) + (suspend) + ) + ) + (disable *screen-filter*) + ) + (else + (suspend) + 0 + ) + ) + ) + (until (not (focus-test? *target* grabbed)) + (until (not (focus-test? *target* grabbed)) + (suspend) + (set! f30-1 (rand-vu-float-range 2.0 4.5)) + (set! gp-5 (current-time)) + (label cfg-43) + ) + (label cfg-44) + (suspend) + (b! (not (time-elapsed? gp-5 (the int (* 300.0 f30-1)))) cfg-43) + (logclear! (-> *target* focus-status) (focus-status ignore)) + ) + (logior! (-> self flags) (cty-sniper-turret-flag cst11)) + (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) + (send-event (handle->process (-> self reticle)) 'lock) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) (process->ppointer self)) + (set! (-> a1-17 num-params) 0) + (set! (-> a1-17 message) 'turret-firing) + (let ((t9-25 send-event-function) + (v1-126 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-25 + (handle->process (if (-> v1-126 manager) + (-> v1-126 manager manager) + (the-as handle #f) + ) + ) + a1-17 + ) + ) + ) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 1.5)) + (when (focus-test? *target* grabbed) + (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) + (send-event (handle->process (-> self reticle)) 'unlock) + (goto cfg-44) + ) + (suspend) + ) + ) + (if (and (logtest? (-> self flags) (cty-sniper-turret-flag cst7)) (not (cty-sniper-turret-method-39 self))) + (go-virtual locked-on) + ) + (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) + (send-event (handle->process (-> self reticle)) 'unlock) + ) + #f + ) + :post sniper-turret-post + ) + +(defstate die (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :code (behavior () + (set-setting! 'faction-command '((faction-strength kg -5)) 0.0 0) + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (quaternion-identity! (-> self gun-azimuth-jmod rotation)) + (quaternion-identity! (-> self gun-shoulder-jmod rotation)) + (quaternion-identity! (-> self gun-elbow-jmod rotation)) + (remove-setting! 'interp-time) + (suspend) + (send-event self 'pov-cam-off) + (send-event (handle->process (-> self reticle)) 'off) + (set-setting! 'mode-name 'cam-no-trans 0.0 0) + (persist-with-delay *setting-control* 'rapid-tracking (seconds 0.1) 'rapid-tracking #f 0.0 0) + (suspend) + (let ((a3-4 (res-lump-struct (-> self entity) 'cutaway-camera structure))) + (when a3-4 + (set-setting! 'entity-name a3-4 0.0 0) + (suspend) + (suspend) + (suspend) + (suspend) + (suspend) + (remove-setting! 'interp-time) + (suspend) + (remove-setting! 'entity-name) + ) + ) + (suspend) + (ja-no-eval :group! cty-sniper-turret-collapse-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (suspend) + (set-setting! 'interp-time 'abs 600.0 0) + (remove-setting! 'mode-name) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.25)) + (suspend) + ) + ) + (send-event (handle->process (-> self reticle)) 'die) + (let ((v1-71 (-> self root root-prim))) + (set! (-> v1-71 prim-core collide-as) (collide-spec)) + (set! (-> v1-71 prim-core collide-with) (collide-spec)) + ) + 0 + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (go-virtual explode) + ) + :post ja-post + ) + +(defstate explode (cty-sniper-turret) + :virtual #t + :enter (behavior () + (sound-play "turret-explode") + (let ((v1-3 (-> self root 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)) + (set! (-> self root root-prim local-sphere w) 491520.0) + ) + :exit (behavior () + (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) 'turret-killed) + (let ((t9-0 send-event-function) + (v1-4 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-0 + (handle->process (if (-> v1-4 manager) + (-> v1-4 manager manager) + (the-as handle #f) + ) + ) + a1-0 + ) + ) + ) + ) + :code (behavior () + (cond + ((logtest? (-> *part-group-id-table* 1465 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1465)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1465)) + ) + ) + (suspend) + (let ((gp-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *up-vector* quad)) + (vector-normalize-copy! (-> gp-2 fountain-rand-transv-lo) s5-0 81920.0) + (vector-normalize-copy! (-> gp-2 fountain-rand-transv-hi) s5-0 245760.0) + ) + (set! (-> gp-2 fountain-rand-transv-lo x) -61440.0) + (set! (-> gp-2 fountain-rand-transv-lo z) -61440.0) + (set! (-> gp-2 fountain-rand-transv-hi x) 61440.0) + (set! (-> gp-2 fountain-rand-transv-hi z) 61440.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cty-sniper-turret-explode" (the-as (pointer level) #f)) + 10 + gp-2 + *cty-sniper-turret-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defmethod cty-sniper-turret-method-39 ((this cty-sniper-turret)) + (with-pp + (cond + ((and (= (length (-> this actor-group 0)) 1) (not (-> this actor-group 0 data 0 actor))) + #f + ) + (else + (dotimes (s5-0 (length (-> this actor-group 0))) + (let ((v1-10 (-> this actor-group 0 data s5-0)) + (a1-0 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'alive) + (let ((t9-1 send-event-function) + (v1-11 (-> v1-10 actor)) + ) + (if (t9-1 + (if v1-11 + (-> v1-11 extra process) + ) + a1-0 + ) + (return #f) + ) + ) + ) + ) + #t + ) + ) + ) + ) + +(defmethod deactivate ((this cty-sniper-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (logclear! (-> this flags) (cty-sniper-turret-flag cst6)) + (sound-stop (-> this turn-sound-id)) + (disable *screen-filter*) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch process-focusable vs cty-sniper-turret. +(defmethod relocate ((this cty-sniper-turret) (offset int)) + (the-as cty-sniper-turret ((method-of-type process-focusable relocate) this offset)) + ) + +(defmethod cty-sniper-turret-method-38 ((this cty-sniper-turret) (arg0 vector) (arg1 quaternion) (arg2 vector) (arg3 float)) + (let ((s1-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s1-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s1-0 reaction) cshape-reaction-default) + (set! (-> s1-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s0-0 (new 'process 'collide-shape-prim-group s1-0 (the-as uint 5) 0))) + (set! (-> s1-0 total-prims) (the-as uint 6)) + (set! (-> s0-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s0-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s0-0 prim-core action) (collide-action solid)) + (set-vector! (-> s0-0 local-sphere) 0.0 0.0 0.0 32768.0) + (set! (-> s1-0 root-prim) s0-0) + ) + (pusher-init s1-0) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 5) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 6) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 7) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid)) + (set! (-> v1-22 transform-index) 8) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (set! (-> s1-0 nav-radius) (* 0.75 (-> s1-0 root-prim local-sphere w))) + (let ((v1-25 (-> s1-0 root-prim))) + (set! (-> s1-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s1-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> this root) s1-0) + ) + (set! (-> this root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> this root quat) arg1) + (set! (-> this offset quad) (-> arg2 quad)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 10)) + (init-los! (-> this los) this (seconds 0.3) 327680.0 (collide-spec backgnd)) + (init (-> this gun-elev-jmod) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this gun-azimuth-jmod) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this gun-elbow-jmod) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this gun-shoulder-jmod) this (the-as uint 5) (joint-mod-base-flags attached)) + (set! (-> this gun-elev) 0.0) + (set! (-> this gun-elev-cam) 0.0) + (set! (-> this gun-spread) 728.1778) + (set! (-> this gun-elev-joint-index) 8) + (set! (-> this gun-azimuth-joint-index) 4) + (quaternion-zero! (-> this tank-quat)) + (quaternion-copy! (-> this rotate-quat) arg1) + (set! (-> this rotate-rate) 0.0) + (set! (-> this rotate-mult) arg3) + (set! (-> this pos-cam-offset quad) (-> (new 'static 'vector :y 61440.0 :w 1.0) quad)) + (set-time! (-> this gun-timer)) + (set! (-> this flags) (cty-sniper-turret-flag)) + (set! (-> this fov-mult) 1.0) + (set! (-> this shot-range) 327680.0) + (set! (-> this gun-aims-from-joint) 10) + (set! (-> this reticle) + (process->handle (ppointer->process (process-spawn + cty-sniper-turret-reticle + arg0 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (lookup-texture-id-by-name "holo-curve" (the-as string #f)) + :name "cty-sniper-turret-reticle" + :to this + ) + ) + ) + ) + (let ((a0-62 (-> this skel root-channel 0))) + (set! (-> a0-62 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-62 frame-num) 0.0) + (joint-control-channel-group! a0-62 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (set! (-> this turn-sound-id) (new-sound-id)) + (logior! (-> this flags) (cty-sniper-turret-flag cst9)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 129) (the-as int #f) (the-as vector #t) 0)) + (go (method-of-object this waiting-for-batteries)) + ) + +(defmethod init-from-entity! ((this cty-sniper-turret) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + ;; og:preserve-this added + (stack-size-set! (-> this main-thread) 1024) + (set! (-> this entity) arg0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-1 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) v1-1) + ) + ) + (set! (-> this hud-buttons) (the-as handle #f)) + (let ((t9-1 (method-of-object this cty-sniper-turret-method-38)) + (a1-6 (-> arg0 extra trans)) + (a2-1 (-> arg0 quat)) + (a3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a3-1 x) 0.0) + (set! (-> a3-1 y) 0.0) + (set! (-> a3-1 z) 0.0) + (set! (-> a3-1 w) 1.0) + (t9-1 this a1-6 a2-1 a3-1 0.0) + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-chick.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-chick.gc index 86786c3b32..2e2f718b88 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-chick.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-chick.gc @@ -7,3 +7,972 @@ ;; DECOMP BEGINS +(defskelgroup skel-citizen-chick citizen-chick citizen-chick-lod0-jg -1 + ((citizen-chick-lod0-mg (meters 20)) (citizen-chick-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow citizen-chick-shadow-mg + ) + +(define *citizen-chick-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 20 22) + :knocked-land (new 'static 'array int32 2 21 23) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 20 22)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 19 18)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 19 18)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 19 18)) + ) + :anim-cover-head-start 14 + :anim-cover-head-loop 15 + :anim-cover-head-end 16 + :speech-ambient 27 + :speech-alert 28 + :speech-cower 29 + :speech-touched-by-player 30 + :speech-shot-by-player 31 + :speech-avoiding-player-vehicle 32 + :speech-hit-by-player-vehicle 33 + ) + ) + +(deftype citizen-chick (civilian) + () + ) + + +(define *citizen-chick-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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 10 + :notice-anim 10 + :hostile-anim -1 + :hit-anim 10 + :knocked-anim 20 + :knocked-land-anim 21 + :die-anim 10 + :die-falling-anim 10 + :victory-anim 10 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance-delta (meters 0.1) + :default-hit-points 1.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 4.5) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 20480.0 + :knocked-soft-vy-hi 40960.0 + :knocked-medium-vxz-lo 40960.0 + :knocked-medium-vxz-hi 73728.0 + :knocked-medium-vy-lo 24576.0 + :knocked-medium-vy-hi 53248.0 + :knocked-hard-vxz-lo 53248.0 + :knocked-hard-vxz-hi 102400.0 + :knocked-hard-vy-lo 40960.0 + :knocked-hard-vy-hi 81920.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 8192.0 + :knocked-yellow-vxz-hi 16384.0 + :knocked-yellow-vy-lo 12288.0 + :knocked-yellow-vy-hi 24576.0 + :knocked-red-vxz-lo 12288.0 + :knocked-red-vxz-hi 24576.0 + :knocked-red-vy-lo 20480.0 + :knocked-red-vy-hi 36864.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 32768.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :z 1.0 :w 14.399715) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 776.6016 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :z 1.0 :w 32759.936) + :geo-tform (new 'static 'vector :x -0.0132 :y 0.103 :z 0.9945 :w 32703.047) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 892.5184 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.998 :z -0.0627 :w 1005.7045) + :geo-tform (new 'static 'vector :x -0.0174 :y 0.085 :z 0.9962 :w 32364.498) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 763.4944 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.0652 :z 0.9978 :w 7454.156) + :geo-tform (new 'static 'vector :x -0.0365 :y 0.214 :z 0.9761 :w 23936.934) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 561.9712 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3949 :z 0.9186 :w 22918.867) + :geo-tform (new 'static 'vector :x -0.5186 :y 0.8187 :z 0.2463 :w 10966.448) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6318 :z 0.7751 :w 6096.8506) + :geo-tform (new 'static 'vector :x 0.2578 :y 0.9617 :z 0.0926 :w 15893.045) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.0947 :z -0.9955 :w 7977.8794) + :geo-tform (new 'static 'vector :x 0.1172 :y 0.3467 :z 0.9305 :w 41298.84) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5223 :z -0.8527 :w 21621.0) + :geo-tform (new 'static 'vector :x -0.3996 :y -0.859 :z -0.3197 :w 15644.244) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2192 :z -0.9756 :w 7433.6577) + :geo-tform (new 'static 'vector :x 0.7974 :y 0.0095 :z 0.6032 :w 34256.594) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint 3 + :pre-tform (new 'static 'vector :z 1.0 :w 17.640106) + :geo-tform (new 'static 'vector :z 1.0 :w 1112.1277) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 832.3072 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :z -1.0 :w 13150.417) + :geo-tform (new 'static 'vector :x -0.1671 :y -0.0657 :z 0.9837 :w 12017.9) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 524.288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2094 :z 0.9778 :w 11988.609) + :geo-tform (new 'static 'vector :x 0.9887 :y -0.1433 :z 0.0422 :w 6040.7266) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9963 :z 0.0852 :w 5976.6104) + :geo-tform (new 'static 'vector :x -0.8827 :y -0.4697 :z 0.0099 :w 11882.987) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9608 :z -0.2772 :w 10351.757) + :geo-tform (new 'static 'vector :x -0.826 :y -0.5058 :z -0.2485 :w 11192.42) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 12 + :pre-tform (new 'static 'vector :z 1.0 :w 15361.583) + :geo-tform (new 'static 'vector :x -0.0332 :y 0.1941 :z -0.9804 :w 15875.422) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 594.3296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.215 :z -0.9766 :w 15500.575) + :geo-tform (new 'static 'vector :x 0.7755 :y 0.6147 :z -0.1434 :w 6094.921) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9338 :z -0.3575 :w 4780.7783) + :geo-tform (new 'static 'vector :x -0.9242 :y 0.3246 :z 0.201 :w 9991.874) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9282 :z 0.372 :w 9409.367) + :geo-tform (new 'static 'vector :x -0.934 :y 0.3205 :z 0.1574 :w 10100.427) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint 5 + :pre-tform (new 'static 'vector :x 0.9806 :z -0.1956 :w 1580.9104) + :geo-tform (new 'static 'vector :x -0.0195 :y 0.2824 :z 0.959 :w 32647.85) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 696.7296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.3059 :z 0.952 :w 7279.739) + :geo-tform (new 'static 'vector :x 0.344 :y 0.9317 :z 0.1158 :w 25729.506) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 371.9168 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.4303 :z 0.9026 :w 6036.6484) + :geo-tform (new 'static 'vector :x 0.2319 :y 0.9724 :z 0.0232 :w 30738.059) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 289.9968 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.922 :z -0.3869 :w 3968.6052) + :geo-tform (new 'static 'vector :x 0.0273 :y 0.8678 :z 0.4961 :w 31513.57) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 280.576 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 11 + :pre-tform (new 'static 'vector :x -0.1937 :z -0.981 :w 7246.88) + :geo-tform (new 'static 'vector :x -0.014 :y 0.9998 :z 0.0019 :w 38307.16) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 335.4624 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 11 + :pre-tform (new 'static 'vector :x -0.1631 :z -0.9865 :w 5719.964) + :geo-tform (new 'static 'vector :x -0.2341 :y 0.9715 :z 0.0353 :w 35807.234) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 299.008 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint 11 + :pre-tform (new 'static 'vector :x 0.7102 :z 0.7039 :w 1501.9758) + :geo-tform (new 'static 'vector :x 0.0925 :y 0.7746 :z 0.6255 :w 34903.016) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 316.2112 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim 4 + :run-anim 7 + :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 8) + :maximum-rotation-rate (degrees 720) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *citizen-chick-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod coin-flip? ((this citizen-chick)) + #f + ) + +(defmethod get-inv-mass ((this citizen-chick)) + 0.5 + ) + +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this citizen-chick)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-5 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-5 + (get-trans a0-5 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f30-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) + (vector-negate-in-place! s5-1) + ) + (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f1-2 (deg- f30-0 f28-0)) + (f2-0 (fabs f1-2)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) + ) + (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) + (set! f30-0 (+ (cond + ((< f2-0 16384.0) + (if (>= f1-2 0.0) + f0-8 + (- f0-8) + ) + ) + ((>= f1-2 0.0) + (- 32768.0 f0-8) + ) + (else + (+ -32768.0 f0-8) + ) + ) + f28-0 + ) + ) + (if (< f30-0 0.0) + (set! f30-0 (+ 65536.0 f30-0)) + ) + ) + ) + ) + ) + ) + (the-as degrees f30-0) + ) + ) + +(defmethod knocked-anim-handler ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-0 (ja-done? 0))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + (when s5-0 + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + ) + (set! (-> a0-6 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-6 param 1) (-> arg1 anim-speed)) + (set! (-> a0-6 frame-num) 3.0) + (joint-control-channel-group! + a0-6 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + num-func-seek! + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +(defmethod knocked-anim ((this citizen-chick) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-131 this 1 a2-0)) + (a1-7 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) + yellow-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) + (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) + (set! (-> a0-15 param 1) (-> arg0 anim-speed)) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim a1-7) num-func-seek!) + ) + ) + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-131 this 3 a2-2)) + (a1-14 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) + blue-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) + (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) + (set! (-> a0-30 param 1) 1.0) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim a1-14) num-func-seek!) + ) + ) + ) + (else + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-39 (-> this skel root-channel 0))) + (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-39 param 1) (-> arg0 anim-speed)) + (set! (-> a0-39 frame-num) 0.0) + (joint-control-channel-group! a0-39 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this citizen-chick) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + ) + (set! (-> a0-2 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! + a0-2 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + num-func-seek! + ) + ) + #t + ) + +(defstate knocked (citizen-chick) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (the-as collide-shape-prim-group (-> self root root-prim)))) + (logior! (-> v1-5 child 0 prim-core action) (collide-action no-standon)) + (logclear! (-> v1-5 child 1 prim-core action) (collide-action no-standon)) + (set! (-> v1-5 child 1 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + +(defstate get-up-front (citizen-chick) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-front) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +(defstate get-up-back (citizen-chick) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-back) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +(defstate wait (citizen-chick) + :virtual #t + :code (behavior () + (let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0)))) + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! citizen-chick-idle-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + #f + ) + ) + +(defmethod init-enemy-collision! ((this citizen-chick)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 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 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 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) 4096.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this citizen-chick)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-chick" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *citizen-chick-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *citizen-chick-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 26) + (let ((v1-18 (rnd-int this 3))) + (cond + ((zero? v1-18) + (set! (-> this anim-walk) 4) + (set! (-> this dist-walk-anim) 15728.64) + (set! (-> this speed-walk) 14745.6) + ) + ((= v1-18 1) + (set! (-> this anim-walk) 5) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 8192.0) + ) + ((= v1-18 2) + (set! (-> this anim-walk) 6) + (set! (-> this dist-walk-anim) 15728.64) + (set! (-> this speed-walk) 12288.0) + ) + ) + ) + (let ((v1-33 (rnd-int this 3))) + (cond + ((zero? v1-33) + (set! (-> this anim-panic-run) 11) + ) + ((= v1-33 1) + (set! (-> this anim-panic-run) 11) + ) + ((= v1-33 2) + (set! (-> this anim-panic-run) 7) + ) + ) + ) + (let ((v1-39 (rnd-int this 3))) + (cond + ((zero? v1-39) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) + ) + ((= v1-39 1) + (set! (-> this dist-run-anim) 28385.28) + (set! (-> this anim-run) 8) + ) + ((= v1-39 2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 9) + ) + ) + ) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 13) + (set! (-> this anim-dive) 17) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (rnd-float-range this 1.0 1.25)) + (f0-17 (rnd-float-range this 1.0 1.25)) + ) + (set-vector! (-> this root scale) f0-17 f30-0 f0-17 1.0) + ) + (let ((f0-19 (rnd-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-19 f0-19 f0-19 1.0) + ) + (set! (-> this water-anim) 12) + (logior! (-> this flags) (citizen-flag female)) + 0 + (none) + ) + +(defmethod citizen-method-194 ((this citizen-chick)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (rnd-int this 3))) + (cond + ((zero? v1-11) + (setup-masks (-> this draw) 32 0) + ) + ((= v1-11 1) + (setup-masks (-> this draw) #x4000 0) + ) + ((= v1-11 2) + (setup-masks (-> this draw) #x8000 0) + ) + ) + ) + (let ((v1-20 (rnd-int this 3))) + (cond + ((zero? v1-20) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-20 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-20 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + (let ((v1-29 (rnd-int this 3))) + (cond + ((zero? v1-29) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-29 1) + (setup-masks (-> this draw) 512 0) + ) + ((= v1-29 2) + (setup-masks (-> this draw) 4096 0) + ) + ) + ) + (let ((v1-38 (rnd-int this 3))) + (cond + ((zero? v1-38) + (setup-masks (-> this draw) 2 0) + (let ((v1-42 (rnd-int this 2))) + (cond + ((zero? v1-42) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-42 1) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + ) + ((= v1-38 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-38 2) + (setup-masks (-> this draw) 2048 0) + (let ((v1-54 (rnd-int this 2))) + (cond + ((zero? v1-54) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-54 1) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + ) + ) + ) + (logior! (-> this flags) (citizen-flag female)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-enemy.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-enemy.gc index d414313326..45456fcee0 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-enemy.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-enemy.gc @@ -7,3 +7,287 @@ ;; DECOMP BEGINS +(deftype citizen-enemy (citizen) + ((next-update-target time-frame) + (minimap connection-minimap) + ) + (:methods + (set-traffic-danger (_type_) none) + (find-new-focus (_type_) object) + ) + ) + + +(defmethod enemy-common-post ((this citizen-enemy)) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + (when (and (not (focus-test? this disable dead ignore inactive)) + (< (-> this next-update-target) (current-time)) + (not (logtest? (enemy-flag lock-focus) (-> this enemy-flags))) + (-> this next-state) + (= (-> this next-state name) 'active) + ) + (find-new-focus this) + (set! (-> this next-update-target) (+ (current-time) (seconds 0.2))) + (set-traffic-danger this) + ) + ((method-of-type citizen enemy-common-post) this) + (none) + ) + +(defmethod send-attack-on-jump-or-knocked ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) + (cond + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) + ) + ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-6 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask guard civilian) (-> arg0 mask)) + (and v1-6 + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +(defmethod event-handler ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('event-death) + #f + ) + (('effect-control) + (let ((a0-3 (-> arg3 param 0))) + (cond + ((string= (the-as string a0-3) "death-default") + (cond + ((< 0.0 (-> this hit-points)) + #t + ) + (else + (let ((v1-2 (-> this root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + #f + ) + ) + ) + (else + #f + ) + ) + ) + ) + (('end-task) + (let ((v0-0 (the-as object (logclear (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-0)) + v0-0 + ) + ) + (else + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod set-traffic-danger ((this citizen-enemy)) + (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) + (set! (-> a1-0 sphere r) 40960.0) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (set! (-> a1-0 notify-radius) 122880.0) + (set! (-> a1-0 danger-level) 1.0) + (set! (-> a1-0 decay-rate) 0.0) + (set! (-> a1-0 flags) (the-as uint 1)) + (set! (-> a1-0 danger-type) (the-as uint 7)) + (set! (-> a1-0 handle) (process->handle this)) + (add-danger (-> this controller traffic) a1-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod find-new-focus ((this citizen-enemy)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (set! (-> s5-0 w) 122880.0) + (let ((s4-0 (the-as process-drawable #f))) + (let ((f30-0 122880.0)) + (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 64))) + (countdown (s2-0 (fill-actor-list-for-box *actor-hash* s5-0 s3-0 64)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-6 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-6 + (let* ((s0-0 (-> a0-6 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (!= this s1-1) + (not (focus-test? (the-as process-focusable s1-1) inactive)) + (not (focus-test? (the-as process-focusable s1-1) disable)) + (not (logtest? (process-mask enemy) (-> s1-1 mask))) + (not (logtest? (process-mask crate) (-> s1-1 mask))) + (not (logtest? (process-mask vehicle) (-> s1-1 mask))) + s1-1 + (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((f0-1 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) + (when (or (not s4-0) (< f0-1 f30-0)) + (set! s4-0 s1-1) + (set! f30-0 f0-1) + ) + ) + ) + ) + ) + ) + ) + ) + (if (and *target* (< (vector-vector-distance (target-pos 0) s5-0) f30-0)) + (set! s4-0 *target*) + ) + ) + (when s4-0 + (try-update-focus (-> this focus) (the-as process-focusable s4-0) this) + (go-hostile this) + ) + ) + ) + 0 + ) + +(defstate active (citizen-enemy) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defstate inactive (citizen-enemy) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((t9-0 (-> (method-of-type citizen inactive) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +(defmethod citizen-method-194 ((this citizen-enemy)) + (let ((t9-0 (method-of-type citizen citizen-method-194))) + (t9-0 this) + ) + (if (-> this skel effect) + (logior! (-> this skel effect flags) (effect-control-flag ecf0)) + ) + (logior! (-> this mask) (process-mask enemy)) + (reset-to-collide-spec (-> this focus) (collide-spec jak civilian player-list bot-targetable jak-vehicle)) + (let ((v1-12 (-> this nav))) + (set! (-> v1-12 sphere-mask) (the-as uint #x1000e8)) + ) + 0 + (set! (-> this anim-shuffle) (-> this enemy-info walk-anim)) + (set! (-> this anim-walk) (-> this enemy-info walk-anim)) + (set! (-> this speed-walk) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-walk-anim) (-> this enemy-info walk-travel-speed)) + (set! (-> this anim-run) (-> this enemy-info run-anim)) + (set! (-> this dist-run-anim) (-> this enemy-info run-travel-speed)) + (set! (-> this speed-run) (-> this enemy-info run-travel-speed)) + (set! (-> this fated-time) 0) + (logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this enemy-flags) (enemy-flag trackable trackable-backup)) + (logclear! (-> this focus-status) (focus-status dead)) + (logior! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0)) + ) + (ja-channel-set! 0) + 0 + (none) + ) + +(defmethod go-die ((this citizen-enemy)) + ((method-of-type nav-enemy go-die) this) + ) + +(defmethod go-hostile ((this citizen-enemy)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) + ) + ) + +(defmethod go-stare ((this citizen-enemy)) + (go (method-of-object this active)) + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-fat.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-fat.gc index 703477719b..7afc93ffa4 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-fat.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-fat.gc @@ -7,3 +7,1021 @@ ;; DECOMP BEGINS +(defskelgroup skel-citizen-fat citizen-fat citizen-fat-lod0-jg -1 + ((citizen-fat-lod0-mg (meters 20)) (citizen-fat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow citizen-fat-shadow-mg + ) + +(define *citizen-fat-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 20 22) + :knocked-land (new 'static 'array int32 2 21 23) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 20 22)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + ) + :anim-cover-head-start 28 + :anim-cover-head-loop 29 + :anim-cover-head-end 30 + :speech-ambient 19 + :speech-alert 20 + :speech-cower 21 + :speech-touched-by-player 22 + :speech-shot-by-player 23 + :speech-avoiding-player-vehicle 24 + :speech-hit-by-player-vehicle 25 + ) + ) + +(deftype citizen-fat (civilian) + () + ) + + +(define *citizen-fat-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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 20 + :knocked-land-anim 21 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 11 + :jump-in-air-anim 11 + :jump-land-anim 11 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance-delta (meters 0.1) + :default-hit-points 1.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 4.5) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 20480.0 + :knocked-soft-vy-hi 40960.0 + :knocked-medium-vxz-lo 40960.0 + :knocked-medium-vxz-hi 73728.0 + :knocked-medium-vy-lo 24576.0 + :knocked-medium-vy-hi 53248.0 + :knocked-hard-vxz-lo 53248.0 + :knocked-hard-vxz-hi 102400.0 + :knocked-hard-vy-lo 40960.0 + :knocked-hard-vy-hi 81920.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 8192.0 + :knocked-yellow-vxz-hi 16384.0 + :knocked-yellow-vy-lo 12288.0 + :knocked-yellow-vy-hi 24576.0 + :knocked-red-vxz-lo 12288.0 + :knocked-red-vxz-hi 24576.0 + :knocked-red-vy-lo 20480.0 + :knocked-red-vy-hi 36864.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 32768.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9956 :y 0.0755 :z -0.0549 :w 34275.477) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :y -0.1262 :z -0.9919 :w 14.399715) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1925.12 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9223 :y -0.0007 :z -0.3862 :w 32775.19) + :geo-tform (new 'static 'vector :x 0.9203 :y -0.1312 :z -0.3683 :w 34427.207) + :axial-slop 965.27246 + :max-angle 5853.9307 + :coll-rad 2340.4543 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2005 :z -0.9796 :w 2271.4595) + :geo-tform (new 'static 'vector :x 0.1581 :y 0.9865 :z -0.0421 :w 8845.103) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1692.0576 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7243 :z -0.6893 :w 2846.8657) + :geo-tform (new 'static 'vector :x -0.1479 :y 0.9867 :z 0.066 :w 8858.61) + :axial-slop 965.27246 + :max-angle 4573.776 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.8955 :z -0.445 :w 13969.198) + :geo-tform (new 'static 'vector :x -0.7036 :y -0.676 :z 0.2186 :w 20755.123) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1223.8848 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8754 :z -0.4832 :w 13897.382) + :geo-tform (new 'static 'vector :x -0.3584 :y -0.8556 :z -0.3732 :w 18419.002) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 901.5296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.0404 :z -0.9991 :w 8581.703) + :geo-tform (new 'static 'vector :x 0.2116 :y -0.9532 :z 0.2155 :w 17374.959) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 949.0432 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0279 :z 0.9996 :w 3558.259) + :geo-tform (new 'static 'vector :x -0.9963 :y -0.085 :z -0.0097 :w 9371.43) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1292.6976 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4821 :z 0.876 :w 10845.134) + :geo-tform (new 'static 'vector :x -0.5782 :y 0.7328 :z 0.3585 :w 34858.27) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1266.0736 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6376 :z 0.7703 :w 15514.556) + :geo-tform (new 'static 'vector :x 0.0502 :y 0.9291 :z 0.3662 :w 35412.96) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1164.9023 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.963 :z -0.2693 :w 7833.773) + :geo-tform (new 'static 'vector :x -0.0243 :y 0.0434 :z 0.9987 :w 31253.5) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1002.7008 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2155 :z -0.9764 :w 1509.913) + :geo-tform (new 'static 'vector :x -0.2514 :y 0.9548 :z 0.1584 :w 16456.654) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1101.0048 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.9221 :y -0.0002 :z -0.3868 :w 16.09273) + :geo-tform (new 'static 'vector :x -0.9217 :y 0.0096 :z 0.3876 :w 10.176285) + :axial-slop 965.27246 + :max-angle 2330.5146 + :coll-rad 1939.456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :z -1.0 :w 12461.907) + :geo-tform (new 'static 'vector :x -0.3106 :y -0.4242 :z 0.8505 :w 16421.393) + :axial-slop 965.27246 + :max-angle 2253.4373 + :coll-rad 983.8592 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6836 :z 0.7298 :w 14527.329) + :geo-tform (new 'static 'vector :x 0.6717 :y -0.6833 :z 0.286 :w 11624.775) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1144.4224 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.693 :z 0.7208 :w 8269.915) + :geo-tform (new 'static 'vector :x -0.693 :y -0.5965 :z -0.4047 :w 14961.978) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1106.3296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5333 :z -0.8459 :w 11592.299) + :geo-tform (new 'static 'vector :x -0.6362 :y -0.6968 :z -0.331 :w 13379.302) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1120.6656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint 13 + :pre-tform (new 'static 'vector :z 1.0 :w 12451.658) + :geo-tform (new 'static 'vector :x -0.5073 :y 0.5962 :z -0.6221 :w 12900.307) + :axial-slop 965.27246 + :max-angle 2242.4417 + :coll-rad 829.44 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8844 :z -0.4666 :w 10098.569) + :geo-tform (new 'static 'vector :x 0.7665 :y 0.5537 :z -0.3251 :w 13637.15) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 889.6512 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6949 :z -0.719 :w 11076.858) + :geo-tform (new 'static 'vector :x -0.8013 :y 0.5535 :z 0.2267 :w 15242.5625) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1168.1792 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7409 :z 0.6715 :w 12293.717) + :geo-tform (new 'static 'vector :x -0.6542 :y 0.6831 :z 0.3245 :w 13102.194) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1168.1792 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 11 + :turn-anim 11 + :run-anim 15 + :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 8) + :maximum-rotation-rate (degrees 720) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *citizen-fat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod coin-flip? ((this citizen-fat)) + #f + ) + +(defmethod get-inv-mass ((this citizen-fat)) + 0.5 + ) + +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this citizen-fat)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-5 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-5 + (get-trans a0-5 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f30-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) + (vector-negate-in-place! s5-1) + ) + (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f1-2 (deg- f30-0 f28-0)) + (f2-0 (fabs f1-2)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) + ) + (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) + (set! f30-0 (+ (cond + ((< f2-0 16384.0) + (if (>= f1-2 0.0) + f0-8 + (- f0-8) + ) + ) + ((>= f1-2 0.0) + (- 32768.0 f0-8) + ) + (else + (+ -32768.0 f0-8) + ) + ) + f28-0 + ) + ) + (if (< f30-0 0.0) + (set! f30-0 (+ 65536.0 f30-0)) + ) + ) + ) + ) + ) + ) + (the-as degrees f30-0) + ) + ) + +(defmethod knocked-anim-handler ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-0 (ja-done? 0))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + (when s5-0 + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + ) + (set! (-> a0-6 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-6 param 1) (-> arg1 anim-speed)) + (set! (-> a0-6 frame-num) 3.0) + (joint-control-channel-group! + a0-6 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + num-func-seek! + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +(defmethod knocked-anim ((this citizen-fat) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-131 this 1 a2-0)) + (a1-7 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) + yellow-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) + (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) + (set! (-> a0-15 param 1) (-> arg0 anim-speed)) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim a1-7) num-func-seek!) + ) + ) + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-131 this 3 a2-2)) + (a1-14 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) + blue-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) + (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) + (set! (-> a0-30 param 1) 1.0) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim a1-14) num-func-seek!) + ) + ) + ) + (else + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-39 (-> this skel root-channel 0))) + (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-39 param 1) (-> arg0 anim-speed)) + (set! (-> a0-39 frame-num) 0.0) + (joint-control-channel-group! a0-39 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this citizen-fat) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + ) + (set! (-> a0-2 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! + a0-2 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + num-func-seek! + ) + ) + #t + ) + +(defstate knocked (citizen-fat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (the-as collide-shape-prim-group (-> self root root-prim)))) + (logior! (-> v1-5 child 0 prim-core action) (collide-action no-standon)) + (logclear! (-> v1-5 child 1 prim-core action) (collide-action no-standon)) + (set! (-> v1-5 child 1 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + +(defstate get-up-front (citizen-fat) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-front) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +(defstate get-up-back (citizen-fat) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-back) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +(defstate wait (citizen-fat) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (until #f + (let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0))) + (gp-0 (rand-vu-int-range 1 5)) + (s5-0 (rand-vu-int-count 2)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (if (zero? s5-0) + (ja-no-eval :group! citizen-fat-idle-to-arms-hips-ja :num! min) + (ja-no-eval :group! citizen-fat-idle-to-arms-crossed-ja :num! min) + ) + (let ((f28-0 0.0)) + (while (< f28-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f28-0 f28-0 f28-0) (* 3.0 f28-0 f28-0)) 0.0 1.0) + ) + (suspend) + (+! f28-0 (seconds-per-frame)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (while (> gp-0 0) + (+! gp-0 -1) + (cond + ((zero? s5-0) + (ja-no-eval :group! citizen-fat-arms-hips-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (else + (ja-no-eval :group! citizen-fat-arms-crossed-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + ) + ) + (if (-> self wait-return-state) + (go (-> self wait-return-state)) + ) + ) + #f + ) + ) + +(defmethod init-enemy-collision! ((this citizen-fat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 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 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 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) 4096.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this citizen-fat)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-fat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *citizen-fat-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *citizen-fat-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 12) + (let ((v1-18 (rnd-int this 3))) + (cond + ((zero? v1-18) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 1) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 2) + (set! (-> this anim-walk) 14) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ) + ) + (let ((v1-33 (rnd-int this 3))) + (cond + ((zero? v1-33) + (set! (-> this anim-panic-run) 17) + ) + ((= v1-33 1) + (set! (-> this anim-panic-run) 17) + ) + ((= v1-33 2) + (set! (-> this anim-panic-run) 15) + ) + ) + ) + (set! (-> this dist-run-anim) 20480.0) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (set! (-> this anim-run) 15) + ) + ((= v1-40 1) + (set! (-> this anim-run) 16) + ) + ((= v1-40 2) + (set! (-> this anim-run) 16) + ) + ) + ) + (set! (-> this speed-run) 32768.0) + (set! (-> this anim-on-ground) 19) + (set! (-> this anim-dive) 18) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (rnd-float-range this 1.0 1.25)) + (f0-15 (rnd-float-range this 1.0 1.25)) + ) + (set-vector! (-> this root scale) f0-15 f30-0 f0-15 1.0) + ) + (let ((f0-17 (rnd-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-17 f0-17 f0-17 1.0) + ) + (set! (-> this water-anim) 32) + 0 + (none) + ) + +(defmethod citizen-method-194 ((this citizen-fat)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (let ((v1-7 (rnd-int this 2))) + (cond + ((zero? v1-7) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (rnd-int this 3))) + (cond + ((zero? v1-11) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-11 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-11 2) + (setup-masks (-> this draw) #x8000 0) + ) + ) + ) + (let ((v1-20 (rnd-int this 4))) + (cond + ((zero? v1-20) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-20 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-20 2) + (setup-masks (-> this draw) 130 0) + ) + ) + ) + (setup-masks (-> this draw) 512 0) + (let ((v1-31 (rnd-int this 3))) + (cond + ((zero? v1-31) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-31 1) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-31 2) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (setup-masks (-> this draw) 32 0) + ) + ((= v1-40 1) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-40 2) + (setup-masks (-> this draw) #x20000 0) + ) + ) + ) + (let ((v1-49 (rnd-int this 3))) + (cond + ((zero? v1-49) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-49 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-49 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ((= v1-7 1) + (setup-masks (-> this draw) #x400000 0) + (setup-masks (-> this draw) #x200000 0) + (let ((v1-63 (rnd-int this 2))) + (cond + ((zero? v1-63) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-63 1) + (setup-masks (-> this draw) #x80000 0) + ) + ) + ) + (let ((v1-70 (rnd-int this 2))) + (cond + ((zero? v1-70) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-70 1) + (setup-masks (-> this draw) #x100000 0) + ) + ) + ) + (let ((v1-77 (rnd-int this 4))) + (cond + ((zero? v1-77) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-77 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-77 2) + (setup-masks (-> this draw) 130 0) + ) + ) + ) + (if (zero? (rnd-int this 1)) + (setup-masks (-> this draw) #x20000 0) + ) + (let ((v1-91 (rnd-int this 3))) + (cond + ((zero? v1-91) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-91 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-91 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-h.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-h.gc index 1cb065e0b5..c5eba60983 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-h.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-h.gc @@ -5,5 +5,104 @@ ;; name in dgo: citizen-h ;; dgos: DESRESC, WWD, CWI +;; +++citizen-flag +(defenum citizen-flag + :type uint16 + :bitfield #t + (persistent) + (run-mode) + (shuffle-mode) + (in-pursuit) + (hostile) + (target-in-sight) + (sticky-weapon) + (knocked-out-car) + (knocked-out-bike) + (dark-guard) + (female) + (in-formation) + (neck-no-auto-look-at) + (talking) + (in-mission) + ) +;; ---citizen-flag + + ;; DECOMP BEGINS +(deftype citizen (nav-enemy) + ((self citizen :override) + (ppointer (pointer citizen) :override) + (flags citizen-flag) + (traffic-id int8) + (hit-by-player-count int8) + (gnd-height float) + (speed-scale float) + (controller vehicle-controller :inline) + (squad squad-control) + (danger-pos sphere :inline) + (dest-point vector :inline :overlay-at (-> controller turn-exit-point)) + (vehicle handle) + (formation handle :overlay-at vehicle) + (formation-index int8) + (anim-shuffle int32) + (dist-walk-anim float) + (speed-walk float) + (anim-walk int32) + (dist-run-anim float) + (speed-run float) + (anim-run int32) + (travel-anim-scale-speed float) + (water-anim int32) + (interp float) + (last-danger-time time-frame) + (next-time-look-at time-frame) + (stop-time-look-at time-frame) + (wait-return-state (state citizen)) + (wait-time time-frame) + (shield-handle handle) + (cp-valid? symbol) + (cp-sphere sphere :inline) + (cp-vec vector :inline) + (cp-next-time time-frame) + (cp-exit-time time-frame) + (cp-force vector :inline) + (cp-plane plane :inline) + (cp-factor float) + (faction-mode uint8) + (attacker-info city-attacker-info) + (mission-squad mission-squad-control) + (probe-counter uint32) + ) + (:state-methods + wait + inactive + in-ditch + ) + (:methods + (init-enemy-defaults! (_type_ nav-enemy-info) none :replace) + (set-squad (_type_) none) + (citizen-method-194 (_type_) none) + (citizen-method-195 (_type_) none) + (go-inactive (_type_) none) + (find-segment (_type_ vector vector) nav-segment) + (nav-segment-callback (_type_ vector traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (citizen-method-199 (_type_ nav-segment) none) + (citizen-method-200 (_type_) symbol) + (citizen-method-201 (_type_ vector) none) + (citizen-method-202 (_type_ vector vector) none) + (citizen-method-203 (_type_ vector) none) + (gen-clear-path (_type_) nav-segment) + (citizen-method-205 (_type_) none) + (citizen-method-206 (_type_) none) + (citizen-method-207 (_type_ vector float) nav-segment) + (citizen-method-208 (_type_ vector) none) + (get-run-anim (_type_) int) + (citizen-method-210 (_type_ int process) none) + (set-alert-level (_type_ int) none) + (go-from-behavior (_type_ traffic-object-spawn-params) none) + (citizen-method-213 (_type_) none) + (citizen-method-214 (_type_ nav-control vector) none) + (citizen-method-215 (_type_) none) + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc index df15b22e2b..11942cdac4 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc @@ -7,3 +7,1133 @@ ;; DECOMP BEGINS +(defskelgroup skel-citizen-norm citizen-norm citizen-norm-lod0-jg -1 + ((citizen-norm-lod0-mg (meters 20)) (citizen-norm-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow citizen-norm-shadow-mg + ) + +(define *citizen-norm-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 18 20) + :knocked-land (new 'static 'array int32 2 19 21) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 18 20)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 24 24)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 24 24)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 24 24)) + ) + :anim-cover-head-start 26 + :anim-cover-head-loop 27 + :anim-cover-head-end 28 + :car-stance-anim 31 + :bike-stance-anim 30 + :get-in-car-anim 32 + :seat-flag #x2 + :speech-ambient 19 + :speech-alert 20 + :speech-cower 21 + :speech-touched-by-player 22 + :speech-shot-by-player 23 + :speech-avoiding-player-vehicle 24 + :speech-hit-by-player-vehicle 25 + ) + ) + +(deftype citizen-norm (civilian) + () + (:state-methods + knocked-off-vehicle + ) + ) + + +(define *citizen-norm-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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 18 + :knocked-land-anim 19 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 12 + :jump-in-air-anim 12 + :jump-land-anim 12 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance (meters 10) + :notice-distance-delta (meters 0.1) + :default-hit-points 1.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 4.5) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 49152.0 + :knocked-soft-vy-lo 36864.0 + :knocked-soft-vy-hi 73728.0 + :knocked-medium-vxz-lo 81920.0 + :knocked-medium-vxz-hi 143360.0 + :knocked-medium-vy-lo 49152.0 + :knocked-medium-vy-hi 102400.0 + :knocked-hard-vxz-lo 102400.0 + :knocked-hard-vxz-hi 122880.0 + :knocked-hard-vy-lo 81920.0 + :knocked-hard-vy-hi 102400.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 16384.0 + :knocked-yellow-vxz-hi 32768.0 + :knocked-yellow-vy-lo 24576.0 + :knocked-yellow-vy-hi 49152.0 + :knocked-red-vxz-lo 40960.0 + :knocked-red-vxz-hi 61440.0 + :knocked-red-vy-lo 36864.0 + :knocked-red-vy-hi 73728.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 32768.0 + :knocked-blue-vy-hi 49152.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 1.0 :w 35283.07) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.0076 :y 0.9921 :z 0.1239) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 944.9472 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.0794 :z 0.9967 :w 32767.965) + :geo-tform (new 'static 'vector :x 0.0726 :y 0.1093 :z 0.9912 :w 32708.4) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 1220.1984 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9988 :z 0.0451 :w 2259.0806) + :geo-tform (new 'static 'vector :x -0.0157 :y 0.9998 :z -0.012 :w 34465.492) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 1045.7087 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5419 :z 0.8402 :w 415.13416) + :geo-tform (new 'static 'vector :x 0.0009 :y 0.9998 :z 0.0122 :w 34465.676) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 369.4592 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.1383 :z 0.9902 :w 15972.161) + :geo-tform (new 'static 'vector :x 0.1734 :y 0.2732 :z 0.946 :w 15088.391) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 757.3504 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.406 :z 0.9137 :w 14397.095) + :geo-tform (new 'static 'vector :x -0.8824 :y 0.419 :z 0.2128 :w 10897.436) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 943.3088 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8899 :z 0.4559 :w 9807.463) + :geo-tform (new 'static 'vector :x 0.5839 :y 0.806 :z 0.0945 :w 7551.8223) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.3207 :z -0.947 :w 15692.25) + :geo-tform (new 'static 'vector :x 0.1676 :y -0.0297 :z -0.9852 :w 16216.993) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1965 :z -0.9803 :w 16207.8545) + :geo-tform (new 'static 'vector :x -0.9965 :y -0.0765 :z -0.0291 :w 7626.661) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9981 :z -0.0585 :w 7603.1772) + :geo-tform (new 'static 'vector :x 0.9672 :y 0.0993 :z 0.2329 :w 33489.59) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :z -1.0 :w 10.15808) + :geo-tform (new 'static 'vector :x 0.2392 :y 0.0404 :z -0.9699) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 1006.3872 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :z -1.0 :w 10839.891) + :geo-tform (new 'static 'vector :x -0.253 :y -0.0825 :z 0.9637 :w 11579.046) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3032 :z 0.9528 :w 11534.791) + :geo-tform (new 'static 'vector :x 0.9808 :y -0.1876 :z 0.0501 :w 5559.5283) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9946 :z 0.1021 :w 5458.348) + :geo-tform (new 'static 'vector :x -0.8838 :y -0.4355 :z -0.1697 :w 10838.162) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9071 :z -0.4205 :w 9664.376) + :geo-tform (new 'static 'vector :x -0.8646 :y -0.4535 :z -0.2154 :w 10479.789) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 471.04 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint 13 + :pre-tform (new 'static 'vector :z 1.0 :w 10820.357) + :geo-tform (new 'static 'vector :x -0.0785 :y 0.0487 :z -0.9956 :w 9567.073) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1026 :z -0.9946 :w 9554.785) + :geo-tform (new 'static 'vector :x 0.9932 :y 0.1129 :z -0.0238 :w 4384.3403) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9987 :z -0.048 :w 4355.8506) + :geo-tform (new 'static 'vector :x -0.8653 :y 0.5006 :z 0.0132 :w 11708.225) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9489 :z 0.3149 :w 9987.923) + :geo-tform (new 'static 'vector :x -0.8062 :y 0.5342 :z 0.2537 :w 11107.588) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 572.2112 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 9 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0151 :w 3411.8406) + :geo-tform (new 'static 'vector :x -0.3858 :y 0.7112 :z 0.5872 :w 20326.883) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 538.624 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.4594 :z 0.888 :w 1846.4587) + :geo-tform (new 'static 'vector :x 0.2602 :y 0.8098 :z 0.5256 :w 42878.53) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 548.864 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 12 + :turn-anim 12 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 2) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 10) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *citizen-norm-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod coin-flip? ((this citizen-norm)) + #f + ) + +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this citizen-norm)) + (the-as + degrees + (cond + ((logtest? (-> this flags) (citizen-flag knocked-out-car knocked-out-bike)) + ((method-of-type nav-enemy get-knockback-angle) this) + ) + (else + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-6 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-6 + (get-trans a0-6 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f30-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) + (vector-negate-in-place! s5-1) + ) + (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f1-2 (deg- f30-0 f28-0)) + (f2-0 (fabs f1-2)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) + ) + (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) + (set! f30-0 (+ (cond + ((< f2-0 16384.0) + (if (>= f1-2 0.0) + f0-8 + (- f0-8) + ) + ) + ((>= f1-2 0.0) + (- 32768.0 f0-8) + ) + (else + (+ -32768.0 f0-8) + ) + ) + f28-0 + ) + ) + (if (< f30-0 0.0) + (set! f30-0 (+ 65536.0 f30-0)) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + ) + ) + ) + +(defmethod knocked-anim-handler ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-0 (ja-done? 0))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + (when s5-0 + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + ) + (set! (-> a0-6 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-6 param 1) (-> arg1 anim-speed)) + (set! (-> a0-6 frame-num) 3.0) + (joint-control-channel-group! + a0-6 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + num-func-seek! + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +(defmethod knocked-anim ((this citizen-norm) (arg0 enemy-knocked-info)) + (local-vars (v1-36 knocked-type)) + (cond + ((logtest? (-> this flags) (citizen-flag knocked-out-car)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) + ) + (logclear! (-> this flags) (citizen-flag knocked-out-car)) + ) + ((logtest? (-> this flags) (citizen-flag knocked-out-bike)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 34))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 34)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 34)) num-func-seek!) + ) + (logclear! (-> this flags) (citizen-flag knocked-out-bike)) + ) + ((begin (set! v1-36 (-> this incoming knocked-type)) (= v1-36 (knocked-type yellow-shot))) + (ja-channel-push! 1 (seconds 0.1)) + (let* ((a2-2 (ash 1 (-> this info prev-yellow-hit))) + (v1-39 (enemy-method-131 this 1 a2-2)) + (a1-11 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-39 8)) (the-as uint (-> this info)))) + yellow-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-yellow-hit) v1-39) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim a1-11)) + (set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) + (set! (-> a0-21 param 1) (-> arg0 anim-speed)) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim a1-11) num-func-seek!) + ) + ) + ) + ((= v1-36 (knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-4 (ash 1 (-> this info prev-blue-hit))) + (v1-48 (enemy-method-131 this 3 a2-4)) + (a1-18 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-48 8)) (the-as uint (-> this info)))) + blue-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-blue-hit) v1-48) + (let ((a0-36 (-> this skel root-channel 0))) + (set! (-> a0-36 frame-group) (the-as art-joint-anim a1-18)) + (set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-18) frames num-frames) -1))) + (set! (-> a0-36 param 1) 1.0) + (set! (-> a0-36 frame-num) 0.0) + (joint-control-channel-group! a0-36 (the-as art-joint-anim a1-18) num-func-seek!) + ) + ) + ) + (else + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (if (or (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (= (-> this incoming knocked-type) (knocked-type dark-shot)) + ) + (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + ) + (let ((a0-47 (-> this skel root-channel 0))) + (set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-47 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-47 param 1) (-> arg0 anim-speed)) + (set! (-> a0-47 frame-num) 0.0) + (joint-control-channel-group! a0-47 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this citizen-norm) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> arg0 anim-speed) 1.0) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + ) + (set! (-> a0-2 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! + a0-2 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + num-func-seek! + ) + ) + #t + ) + +(defstate knocked (citizen-norm) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (the-as collide-shape-prim-group (-> self root root-prim)))) + (logior! (-> v1-5 child 0 prim-core action) (collide-action no-standon)) + (logclear! (-> v1-5 child 1 prim-core action) (collide-action no-standon)) + (set! (-> v1-5 child 1 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + +(defstate get-up-front (citizen-norm) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-front) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +(defstate get-up-back (citizen-norm) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-back) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +(defstate wait (citizen-norm) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (until #f + (let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0))) + (gp-0 (rand-vu-int-range 1 5)) + (s5-0 (rand-vu-int-count 2)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (if (zero? s5-0) + (ja-no-eval :group! citizen-norm-idle-to-arms-hips-ja :num! min) + (ja-no-eval :group! citizen-norm-idle-to-arms-crossed-ja :num! min) + ) + (let ((f28-0 0.0)) + (while (< f28-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f28-0 f28-0 f28-0) (* 3.0 f28-0 f28-0)) 0.0 1.0) + ) + (suspend) + (+! f28-0 (seconds-per-frame)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (while (> gp-0 0) + (+! gp-0 -1) + (cond + ((zero? s5-0) + (ja-no-eval :group! citizen-norm-arms-hips-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (else + (ja-no-eval :group! citizen-norm-arms-crossed-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + ) + ) + (if (-> self wait-return-state) + (go (-> self wait-return-state)) + ) + ) + #f + ) + ) + +(defmethod go-from-behavior ((this citizen-norm) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((11) + (speech-control-method-12 *speech-control* this (speech-type civ-m-player-stealing-vehicle)) + (set! (-> this root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> this root quat) (-> arg0 rotation)) + (set! (-> this vehicle) (-> arg0 handle)) + (ja-channel-set! 1) + (case (-> (the-as vehicle (handle->process (-> this vehicle))) info object-type) + (((traffic-type civilian-bike-a) (traffic-type civilian-bike-b) (traffic-type civilian-bike-c)) + (logior! (-> this flags) (citizen-flag knocked-out-bike)) + (let ((v1-16 (-> this skel root-channel 0))) + (set! (-> v1-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) + ) + ) + (((traffic-type civilian-car-a) (traffic-type civilian-car-b) (traffic-type civilian-car-c)) + (logior! (-> this flags) (citizen-flag knocked-out-car)) + (let ((v1-22 (-> this skel root-channel 0))) + (set! (-> v1-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) + ) + ) + ) + (ja-post) + (setup-masks (-> this draw) 0 -1) + (let ((s5-1 (-> arg0 user-data))) + (if (not (logtest? s5-1 32)) + (setup-masks (-> this draw) 32 0) + ) + (if (not (logtest? s5-1 16)) + (setup-masks (-> this draw) 16 0) + ) + (if (not (logtest? s5-1 2)) + (setup-masks (-> this draw) 2 0) + ) + (if (not (logtest? s5-1 4096)) + (setup-masks (-> this draw) 8192 0) + ) + (if (not (logtest? s5-1 8)) + (setup-masks (-> this draw) 8 0) + ) + (if (not (logtest? s5-1 512)) + (setup-masks (-> this draw) 1024 0) + ) + (if (not (logtest? s5-1 #x4000)) + (setup-masks (-> this draw) #x8000 0) + ) + (if (not (logtest? s5-1 4)) + (setup-masks (-> this draw) 4 0) + ) + (if (not (logtest? s5-1 256)) + (setup-masks (-> this draw) 512 0) + ) + (if (not (logtest? s5-1 8192)) + (setup-masks (-> this draw) #x4000 0) + ) + (if (not (logtest? s5-1 64)) + (setup-masks (-> this draw) 128 0) + ) + (if (not (logtest? s5-1 2048)) + (setup-masks (-> this draw) 4096 0) + ) + (if (not (logtest? #x10000 s5-1)) + (setup-masks (-> this draw) #x20000 0) + ) + (if (not (logtest? s5-1 128)) + (setup-masks (-> this draw) 256 0) + ) + (if (logtest? #x40000 s5-1) + (setup-masks (-> this draw) 2048 0) + (setup-masks (-> this draw) 2048 0) + ) + ) + (go (method-of-object this knocked-off-vehicle)) + ) + (else + ((method-of-type civilian go-from-behavior) this arg0) + ) + ) + 0 + (none) + ) + +(defstate knocked-off-vehicle (citizen-norm) + :virtual #t + :event enemy-event-handler + :enter (behavior () + '() + ) + :code (behavior () + (suspend) + (citizen-method-206 self) + ) + ) + +(defmethod init-enemy-collision! ((this citizen-norm)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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) 4096.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this citizen-norm)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *citizen-norm-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (try-update-focus (-> this focus) *target* this) + (-> this neck) + (set! (-> this info) *citizen-norm-global-info*) + (set! (-> this anim-shuffle) 11) + (let ((v1-18 (rnd-int this 3))) + (cond + ((zero? v1-18) + (set! (-> this anim-walk) 12) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 10240.0) + ) + ((= v1-18 1) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 2) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 4370.432) + (set! (-> this speed-walk) 4096.0) + ) + ) + ) + (let ((v1-33 (rnd-int this 3))) + (cond + ((zero? v1-33) + (set! (-> this anim-panic-run) 15) + ) + ((= v1-33 1) + (set! (-> this anim-panic-run) 15) + ) + ((= v1-33 2) + (set! (-> this anim-panic-run) 14) + ) + ) + ) + (set! (-> this dist-run-anim) 28672.0) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (set! (-> this anim-run) 14) + ) + ((= v1-40 1) + (set! (-> this anim-run) 14) + ) + ((= v1-40 2) + (set! (-> this anim-run) 14) + ) + ) + ) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 17) + (set! (-> this anim-dive) 16) + (set! (-> this anim-get-up-front) 22) + (set! (-> this anim-get-up-back) 23) + (let ((f30-0 (rnd-float-range this 1.0 1.25)) + (f0-11 (rnd-float-range this 1.0 1.25)) + ) + (set-vector! (-> this root scale) f0-11 f30-0 f0-11 1.0) + ) + (let ((f0-13 (rnd-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-13 f0-13 f0-13 1.0) + ) + (set! (-> this water-anim) 29) + 0 + (none) + ) + +(defmethod citizen-method-194 ((this citizen-norm)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (set! (-> this dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 32 0) + (let ((v1-10 (rnd-int this 4))) + (cond + ((zero? v1-10) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-10 1) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-10 2) + (setup-masks (-> this draw) #x10000 0) + ) + ((= v1-10 3) + (setup-masks (-> this draw) #x200000 0) + ) + ) + ) + (let ((v1-21 (rnd-int this 3))) + (cond + ((zero? v1-21) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-21 1) + (setup-masks (-> this draw) 8192 0) + ) + ((= v1-21 2) + (setup-masks (-> this draw) #x40000 0) + ) + ) + ) + (let ((v1-30 (rnd-int this 4))) + (cond + ((zero? v1-30) + (setup-masks (-> this draw) 8 0) + ) + ((= v1-30 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-30 2) + (setup-masks (-> this draw) #x8000 0) + ) + ((= v1-30 3) + (setup-masks (-> this draw) #x100000 0) + ) + ) + ) + (let ((v1-41 (rnd-int this 5))) + (cond + ((zero? v1-41) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-41 1) + (setup-masks (-> this draw) 512 0) + ) + ((= v1-41 2) + (setup-masks (-> this draw) #x4000 0) + ) + ((= v1-41 3) + (setup-masks (-> this draw) #x80000 0) + ) + ) + ) + (let ((v1-52 (rnd-int this 4))) + (cond + ((zero? v1-52) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-52 1) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-52 2) + (setup-masks (-> this draw) #x20000 0) + ) + ((= v1-52 3) + (setup-masks (-> this draw) #x400000 0) + ) + ) + ) + (setup-masks (-> this draw) 16 0) + (let ((v1-65 (rnd-int this 4))) + (cond + ((zero? v1-65) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-65 1) + (setup-masks (-> this draw) #x800000 0) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen.gc index 5063a26345..78a0bb6c2d 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen.gc @@ -7,3 +7,1834 @@ ;; DECOMP BEGINS +(define *citizen-debug* #f) + +(defmethod set-squad ((this citizen)) + (set! (-> this squad) #f) + 0 + (none) + ) + +(defmethod citizen-method-195 ((this citizen)) + (let ((v1-0 (-> this nav))) + (logclear! (-> v1-0 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) + (let ((a1-6 v1-0)) + (set! (-> a1-6 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + (let ((a1-8 v1-0)) + (set! (-> a1-8 nav-cull-radius) 12288.0) + ) + 0 + (logclear! (-> v1-0 flags) (nav-control-flag output-sphere-hash)) + ) + (set! (-> this enemy-info callback-info) *physics-nav-callback-info*) + (let ((v1-2 this)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + 0 + (none) + ) + +(defmethod citizen-method-194 ((this citizen)) + (remove-from-process *part-engine* this) + (set! (-> this faction-mode) (the-as uint 0)) + (logior! (-> this fact enemy-options) (enemy-option knocked-into-water)) + (if (-> this skel effect) + (logclear! (-> this skel effect flags) (effect-control-flag ecf2)) + ) + (set! (-> this draw death-draw-overlap) (the-as uint 0)) + (set! (-> this draw death-timer) (the-as uint 0)) + (set! (-> this draw death-timer-org) (the-as uint 0)) + (set! (-> this draw death-vertex-skip) (the-as uint 0)) + (set! (-> this draw death-effect) (the-as uint 0)) + (logclear! (-> this focus-status) (focus-status disable dead inactive hit)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (clear-focused (-> this focus)) + (logand! (-> this enemy-flags) (enemy-flag drawn-mirrored)) + (logclear! (-> this draw status) (draw-control-status no-draw lod-set)) + (set! (-> this draw death-timer) (the-as uint 0)) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let ((v1-29 (-> this root root-prim))) + (set! (-> v1-29 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-29 prim-core collide-with) (-> this root backup-collide-with)) + ) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (enemy-setup-gem) + (logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this enemy-flags) (enemy-flag trackable trackable-backup)) + (logior! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) + (set! (-> this fated-time) 0) + (set! (-> this probe-counter) (the-as uint 0)) + (set! (-> this hit-by-player-count) 0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 0.0 0.0 1.0) + (update-transforms (-> this root)) + (citizen-method-215 this) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod update-awareness! ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) + (when arg1 + (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans)))) + (when (< f0-0 (-> arg1 rating)) + (set! (-> arg1 rating) f0-0) + (set! (-> arg1 proc) arg0) + (set! (-> arg1 aware) (enemy-aware ea3)) + ) + ) + ) + (the-as enemy-aware 3) + ) + +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod get-enemy-aware ((this citizen) (arg0 enemy-aware)) + (the-as enemy-aware 3) + ) + +(defmethod go-stare ((this citizen)) + (go (method-of-object this flee)) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod go-hostile ((this citizen)) + (go-inactive this) + ) + +(defmethod go-flee ((this citizen)) + (go (method-of-object this flee)) + ) + +(defmethod go-best-state ((this citizen)) + (go (method-of-object this active)) + ) + +(defmethod penetrate->next-state ((this citizen) (arg0 process) (arg1 event-message-block) (arg2 float)) + (if (logtest? (penetrate jak-dark-nuke) (-> this incoming penetrate-using)) + 'traffic-off-force + (call-parent-method this arg0 arg1 arg2) + ) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod go-die ((this citizen)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (go-inactive this) + ) + +(defmethod cleanup-for-death ((this citizen)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (go-inactive this) + (none) + ) + +(defmethod go-inactive ((this citizen)) + (cond + ((and (-> this mission-squad) (-> this attacker-info)) + (remove-attacker (-> this mission-squad) (-> this attacker-info)) + (set! (-> this attacker-info) #f) + (set! (-> this mission-squad) #f) + ) + (else + ) + ) + (vehicle-controller-method-11 (-> this controller)) + (logclear! (-> this flags) (citizen-flag persistent in-formation)) + (set! (-> this vehicle) (the-as handle #f)) + (let ((s5-0 (-> this child))) + (while s5-0 + (send-event (ppointer->process s5-0) 'notice 'die) + (set! s5-0 (-> s5-0 0 brother)) + ) + ) + (set! (-> this shield-handle) (the-as handle #f)) + (logior! (-> this focus-status) (focus-status inactive)) + (set! (-> this event-hook) (-> (method-of-object this inactive) event)) + (go (method-of-object this inactive)) + 0 + (none) + ) + +(defmethod enemy-method-63 ((this citizen) (arg0 float)) + (let ((v0-1 (call-parent-method this arg0))) + (when (and (logtest? (-> this incoming penetrate-using) (penetrate board)) + (not (logtest? (-> this incoming penetrate-using) (penetrate spin))) + ) + (let ((v1-6 (handle->process (-> this incoming attacker-handle)))) + (when (= (-> (the-as target v1-6) type) target) + (cond + ((and (-> this next-state) (let ((a0-14 (-> this next-state name))) + (or (= a0-14 'get-up-front) (= a0-14 'get-up-back) (= a0-14 'knocked)) + ) + ) + (set! v0-1 0.000000000000000000000000000000000000000000001) + ) + ((and (logtest? (-> (the-as target v1-6) control mod-surface flags) (surface-flag air)) + (not (logtest? (-> (the-as target v1-6) control status) (collide-status on-surface))) + ) + (set! v0-1 0.0) + ) + ) + ) + ) + ) + v0-1 + ) + ) + +(defmethod citizen-method-210 ((this citizen) (arg0 int) (arg1 process)) + (let ((a0-1 (-> this squad))) + (when (and a0-1 arg1) + (if #t + (squad-control-method-18 a0-1 arg0 arg1) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-alert-level ((this citizen) (arg0 int)) + (let ((a0-1 (-> this squad))) + (if a0-1 + (set-alert-level0 a0-1 arg0) + ) + ) + 0 + (none) + ) + +(defmethod get-inv-mass ((this citizen)) + 1.0 + ) + +(defmethod find-segment ((this citizen) (arg0 vector) (arg1 vector)) + (find-best-segment (-> this controller traffic) arg0 arg1 1) + ) + +(defmethod nav-segment-callback ((this citizen) + (arg0 vector) + (arg1 traffic-find-segment-struct) + (arg2 (function traffic-find-segment-struct nav-segment none)) + ) + (callback-on-nav-segments-in-sphere (-> this controller traffic) arg0 1 arg1 arg2) + 0 + (none) + ) + +(defmethod citizen-method-199 ((this citizen) (arg0 nav-segment)) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-controller-method-13 (-> this controller) (-> arg0 branch) (the-as vector (-> arg0 vertex))) + 0 + (none) + ) + +(defmethod citizen-method-200 ((this citizen)) + (let* ((v1-0 (-> this controller)) + (gp-1 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 turn-exit-point) (-> v1-0 path-prev-point))) + (s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> v1-0 turn-exit-point))) + ) + (set! (-> s5-1 y) 0.0) + (set! (-> gp-1 y) 0.0) + (vector-xz-normalize! gp-1 1.0) + (< -16384.0 (vector-dot s5-1 gp-1)) + ) + ) + +(defmethod go-from-behavior ((this citizen) (arg0 traffic-object-spawn-params)) + (let ((v1-0 (-> arg0 behavior))) + (cond + ((zero? v1-0) + (go (method-of-object this idle)) + ) + ((= v1-0 2) + (go (method-of-object this active)) + ) + ((= v1-0 3) + (go (method-of-object this hostile)) + ) + (else + (go-inactive this) + ) + ) + ) + 0 + (none) + ) + +;; WARN: disable def twice: 164. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-3 object)) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (let ((v1-1 #f)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) + (knocked-type blue-shot) + (knocked-type red-shot) + (knocked-type explode-or-darkjak) + ) + (set! v1-1 #t) + ) + (((knocked-type none)) + (+! (-> this hit-by-player-count) 1) + (set! v1-1 (>= (-> this hit-by-player-count) 2)) + ) + ) + (when v1-1 + (let* ((s5-0 (handle->process (-> this incoming attacker-handle))) + (a2-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if a2-5 + (citizen-method-210 this 1 a2-5) + ) + ) + ) + ) + (freeze-hit-begin) + (go (method-of-object this knocked)) + ) + (('traffic-off) + (if (not (logtest? (-> this flags) (citizen-flag persistent))) + (go-inactive this) + ) + ) + (('formation-set-destination) + (when (and (-> this next-state) (let ((v1-20 (-> this next-state name))) + (or (= v1-20 'active) (= v1-20 'wait)) + ) + ) + (let ((v1-21 (the-as object (-> arg3 param 0))) + (a0-20 (-> this nav state)) + ) + (logclear! (-> a0-20 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-20 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-20 target-pos quad) (-> (the-as vector v1-21) quad)) + ) + 0 + (if (and (and (-> this next-state) (= (-> this next-state name) 'wait)) (-> this wait-return-state)) + (go (-> this wait-return-state)) + ) + ) + ) + (('formation-exit) + (logclear! (-> this flags) (citizen-flag in-formation)) + (set! (-> this vehicle) (the-as handle #f)) + #f + ) + (('go-invulnerable) + (set! v0-3 (logclear (-> this enemy-flags) (enemy-flag vulnerable))) + (set! (-> this enemy-flags) (the-as enemy-flag v0-3)) + v0-3 + ) + (('go-vulnerable) + (when (not (and (-> this next-state) + (let ((v1-36 (-> this next-state name))) + (or (= v1-36 'inactive) (= v1-36 'dying) (= v1-36 'die-falling) (= v1-36 'die-fast)) + ) + ) + ) + (set! v0-3 (logior (-> this enemy-flags) (enemy-flag vulnerable))) + (set! (-> this enemy-flags) (the-as enemy-flag v0-3)) + v0-3 + ) + ) + (('impact-impulse) + #f + ) + (('traffic-off-force) + (go-inactive this) + ) + (('traffic-activate) + (if (not (focus-test? this inactive)) + (return #f) + ) + (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (let ((s5-1 (the-as traffic-object-spawn-params (-> arg3 param 0)))) + (cond + ((logtest? (-> s5-1 flags) (traffic-spawn-flags tsf4)) + (logior! (-> this flags) (citizen-flag in-formation)) + (set! (-> this vehicle) (-> s5-1 handle-parent)) + (set! (-> this formation-index) (the-as int (-> s5-1 user-data))) + (set! (-> this speed-scale) 1.0) + ) + (else + (logclear! (-> this flags) (citizen-flag in-formation)) + (set! (-> this speed-scale) (rnd-float-range this 0.9 1.1)) + ) + ) + (if (logtest? (-> s5-1 flags) (traffic-spawn-flags tsf7)) + (logior! (-> this flags) (citizen-flag in-mission)) + (logclear! (-> this flags) (citizen-flag in-mission)) + ) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (set! (-> this root trans quad) (-> s5-1 position quad)) + (quaternion-copy! (-> this root quat) (-> s5-1 rotation)) + (set! (-> this root transv quad) (-> s5-1 velocity quad)) + (let ((a0-46 (-> s5-1 nav-mesh))) + (when a0-46 + (change-to a0-46 this) + (if (not (-> this nav)) + (go-inactive this) + ) + (let ((v1-77 (-> this nav state))) + (set! (-> v1-77 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a1-20 (-> s5-1 nav-branch))) + (when a1-20 + (vehicle-controller-method-13 (-> this controller) a1-20 (-> this root trans)) + (let ((a0-50 (-> this nav state)) + (v1-84 (-> this dest-point)) + ) + (logclear! (-> a0-50 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-50 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-50 target-pos quad) (-> v1-84 quad)) + ) + 0 + ) + ) + (citizen-method-195 this) + (citizen-method-194 this) + (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (set! (-> this gnd-height) (-> this root gspot-pos y)) + (go-from-behavior this s5-1) + ) + ) + ) + ) + (('nav-mesh-kill) + (remove-process-drawable (-> this nav state mesh) this) + (set! (-> this nav) #f) + (go-inactive this) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod citizen-method-213 ((this citizen)) + (set! (-> this root transv x) 0.0) + (set! (-> this root transv z) 0.0) + (when (-> this enemy-info move-to-ground) + (if (focus-test? this under-water) + (accelerate-fall! this (-> this root transv)) + (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) + ) + ) + (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) + (let ((v1-15 (-> this enemy-info))) + (set! (-> a2-0 gnd-collide-with) (-> this gnd-collide-with)) + (set! (-> a2-0 popup) 8192.0) + (set! (-> a2-0 dont-move-if-overlaps?) #t) + (set! (-> a2-0 hover-if-no-ground?) (-> v1-15 hover-if-no-ground)) + (set! (-> a2-0 overlaps-params options) (overlaps-others-options oo0 oo2)) + (set! (-> a2-0 overlaps-params collide-with-filter) (-> v1-15 overlaps-others-collide-with-filter)) + ) + (set! (-> a2-0 overlaps-params tlist) *touching-list*) + (-> a2-0 overlaps-params) + (move-above-ground! this (-> this root transv) a2-0) + ) + 0 + (none) + ) + +(defmethod enemy-common-post ((this citizen)) + (with-pp + (when (and (not (logtest? (-> this flags) (citizen-flag in-mission))) + *cty-faction-manager* + (and (or (not (-> this draw)) + (not (logtest? (-> this draw status) (draw-control-status on-screen))) + (let ((f0-0 450560.0)) + (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> this root trans) (math-camera-pos))) + ) + ) + (nonzero? (-> this controller branch)) + (or (not (cty-faction-manager-method-23 *cty-faction-manager* (the-as uint (-> this controller branch clock-mask))) + ) + (not (logtest? (cty-faction-manager-method-9 + *cty-faction-manager* + (the-as int (-> this controller branch clock-type)) + (-> pp level name) + ) + 1 + ) + ) + ) + ) + ) + (format + 0 + "Going inactive (~s). Terr ~d, level ~s~%" + (-> this name) + (-> this controller branch clock-type) + (-> pp level name) + ) + (go-inactive this) + ) + (+! (-> this probe-counter) 1) + (when (< (-> this next-time-look-at) (current-time)) + (when (and (nonzero? (-> this neck)) (not (logtest? (-> this flags) (citizen-flag neck-no-auto-look-at)))) + (let ((a0-11 (the-as process-focusable (handle->process (-> this focus handle)))) + (s5-3 (new 'stack-no-clear 'vector)) + ) + (cond + (a0-11 + (set! (-> s5-3 quad) (-> (get-trans a0-11 2) quad)) + ) + (*target* + (set! (-> s5-3 quad) (-> (get-trans *target* 2) quad)) + ) + (else + (set! (-> s5-3 quad) (-> (camera-pos) quad)) + ) + ) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (set! (-> s5-3 quad) (-> this danger-pos quad)) + ) + (when (< (vector-vector-distance s5-3 (-> this root trans)) 122880.0) + (set-look-at-mode! this 1) + (target-set! (-> this neck) s5-3) + ) + ) + (when (< (-> this stop-time-look-at) (current-time)) + (shut-down (-> this neck)) + (set! (-> this next-time-look-at) (+ (current-time) (the int (* 300.0 (rnd-float-range this 0.0 20.0))))) + (set! (-> this stop-time-look-at) + (+ (-> this next-time-look-at) (the int (* 300.0 (rnd-float-range this 5.0 10.0)))) + ) + ) + ) + ) + (let ((a0-26 (-> this enemy-flags))) + (when (and (logtest? a0-26 (enemy-flag auto-reset-penetrate)) + (time-elapsed? (-> this auto-reset-penetrate-time) (seconds 0.1)) + ) + (set! (-> this enemy-flags) (logclear a0-26 (enemy-flag auto-reset-penetrate))) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (let ((v1-84 0)) + (if (logtest? (penetrate knocked) (-> this root penetrate-using)) + (set! v1-84 (logior (shl 2 32) v1-84)) + ) + (set! (-> this root penetrate-using) (the-as penetrate v1-84)) + ) + ) + ) + (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) + (set-time! (-> this last-draw-time)) + ) + (let ((s5-6 (-> this draw shadow-ctrl))) + (when (!= *nav-enemy-dummy-shadow-control* s5-6) + (let ((f0-10 (vector-vector-distance (camera-pos) (-> this root trans)))) + (cond + ((< 163840.0 f0-10) + (logior! (-> s5-6 settings flags) (shadow-flags disable-draw)) + 0 + ) + ((not (handle->process (-> this ragdoll-proc))) + (let ((v1-104 s5-6)) + (logclear! (-> v1-104 settings flags) (shadow-flags disable-draw)) + ) + 0 + (let* ((f0-11 (lerp-scale 0.0 1.0 f0-10 163840.0 40960.0)) + (f0-14 (fmax 0.01 (+ (* -2.0 f0-11 f0-11 f0-11) (* 3.0 f0-11 f0-11)))) + ) + (set! (-> s5-6 settings shadow-dir w) (* 614400.0 f0-14)) + ) + ) + ) + ) + ) + ) + (when (logtest? (enemy-flag check-water checking-water) (-> this enemy-flags)) + (check-water this) + (when (and (focus-test? this touch-water) (< (-> this root trans y) (+ -11468.8 (-> this water-surface-height)))) + (set! (-> this root trans y) (+ -11468.8 (-> this water-surface-height))) + (if (not (and (-> this next-state) (= (-> this next-state name) 'in-ditch))) + (go (method-of-object this in-ditch)) + ) + ) + ) + (ja-post) + 0 + (none) + ) + ) + +(defmethod move-above-ground! ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> this root))) + (set! (-> arg1 on-ground?) #f) + (set! (-> arg1 do-move?) #t) + (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) + (set! (-> arg1 old-gspot-normal quad) (-> gp-0 gspot-normal quad)) + (set! (-> gp-0 trans-old-old-old quad) (-> gp-0 trans-old-old quad)) + (set! (-> gp-0 trans-old-old quad) (-> gp-0 trans-old quad)) + (set! (-> gp-0 trans-old quad) (-> gp-0 trans quad)) + (set! (-> gp-0 prev-status) (-> gp-0 status)) + (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) + (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) + (when (not (logtest? (logxor (-> this traffic-id) (the-as int (-> this probe-counter))) 7)) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (logclear! (-> gp-0 status) (collide-status on-ground)) + (let* ((a0-10 this) + (t9-1 (method-of-object a0-10 enemy-above-ground?)) + (a1-2 s2-0) + (a2-2 (new 'stack-no-clear 'vector)) + ) + (let ((v1-15 (-> gp-0 trans))) + (let ((a3-0 (-> gp-0 transv))) + (let ((t0-1 0.15)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a3-0 quad)) + ) + (.lvf vf4 (&-> v1-15 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 (&-> a2-2 quad) vf6) + (when (t9-1 a0-10 a1-2 a2-2 (-> arg1 gnd-collide-with) 16384.0 81920.0 1024.0) + (set! (-> gp-0 gspot-pos quad) (-> gp-0 trans quad)) + (set! (-> gp-0 gspot-pos y) (-> s2-0 best-other-tri intersect y)) + (set! (-> gp-0 gspot-normal quad) (-> s2-0 best-other-tri normal quad)) + (logior! (-> gp-0 status) (collide-status on-ground)) + (set! (-> gp-0 ground-pat) (-> s2-0 best-other-tri pat)) + ) + ) + ) + (set! (-> this gnd-height) (-> gp-0 gspot-pos y)) + (set! (-> gp-0 gspot-pos y) (-> arg1 old-gspot-pos y)) + ) + (let ((f0-5 (- (-> this gnd-height) (-> gp-0 gspot-pos y)))) + (cond + ((< 0.0 f0-5) + (+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5)) + ) + (else + (+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5)) + (if (< (-> gp-0 gspot-pos y) (-> this gnd-height)) + (set! (-> gp-0 gspot-pos y) (-> this gnd-height)) + ) + ) + ) + ) + (set! (-> arg1 on-ground?) #t) + (set! (-> arg1 pat) (-> gp-0 ground-pat)) + (when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y)) + (set! (-> arg1 new-pos y) (-> gp-0 gspot-pos y)) + (set! (-> gp-0 ground-impact-vel) (- (vector-dot arg0 (-> gp-0 dynam gravity-normal)))) + (set! (-> arg0 y) 0.0) + ) + (set! (-> gp-0 trans quad) (-> arg1 new-pos quad)) + (when (-> arg1 do-move?) + (cond + ((-> arg1 on-ground?) + (let ((a1-3 (-> gp-0 gspot-pos)) + (a0-18 (-> gp-0 gspot-normal)) + (v1-42 (-> arg1 pat)) + ) + (set! (-> gp-0 ground-touch-point quad) (-> a1-3 quad)) + (set! (-> gp-0 poly-normal quad) (-> a0-18 quad)) + (set! (-> gp-0 surface-normal quad) (-> a0-18 quad)) + (set! (-> gp-0 local-normal quad) (-> a0-18 quad)) + (set! (-> gp-0 ground-poly-normal quad) (-> a0-18 quad)) + (set! (-> gp-0 poly-pat) v1-42) + (set! (-> gp-0 cur-pat) v1-42) + (set! (-> gp-0 ground-pat) v1-42) + ) + (logior! (-> gp-0 status) (collide-status on-surface on-ground touch-surface)) + ) + (else + (logclear! (-> gp-0 status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> gp-0 root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-52 (-> gp-0 dynam gravity-normal))) + (set! (-> gp-0 local-normal quad) (-> v1-52 quad)) + (set! (-> gp-0 surface-normal quad) (-> v1-52 quad)) + (set! (-> gp-0 poly-normal quad) (-> v1-52 quad)) + ) + (set! (-> gp-0 coverage) 0.0) + (set! (-> gp-0 touch-angle) 0.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod normalize-heading! ((this citizen) (arg0 nav-control)) + (let ((t9-0 (method-of-object this citizen-method-214)) + (v1-1 arg0) + (a3-0 (-> arg0 state)) + (a2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (t9-0 this v1-1 a2-0) + ) + 0 + (none) + ) + +(defmethod citizen-method-214 ((this citizen) (arg0 nav-control) (arg1 vector)) + (set! (-> arg1 y) 0.0) + (vector-normalize! arg1 1.0) + (let ((gp-0 (new 'stack-no-clear 'quaternion)) + (s5-1 (-> this root quat)) + ) + (quaternion-set! gp-0 0.0 (-> arg1 x) 0.0 (+ 1.0 (-> arg1 z))) + (quaternion-normalize! gp-0) + (quaternion-smooth-seek! + s5-1 + s5-1 + gp-0 + (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + ) + ) + 0 + (none) + ) + +(defmethod nav-enemy-method-187 ((this citizen)) + (nav-enemy-method-188 this) + (let ((a0-2 this)) + (when (logtest? (enemy-flag ef37) (-> a0-2 enemy-flags)) + (cond + ((logtest? (enemy-flag ef39) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) + (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (set! (-> this gnd-height) (-> this root gspot-pos y)) + ) + (else + (normalize-heading! this (-> this nav)) + (nav-enemy-method-161 this (-> this nav)) + ) + ) + ) + ) + (enemy-common-post this) + (update-transforms (-> this root)) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod go-idle2 ((this citizen)) + (go (method-of-object this active)) + 0 + ) + +(defmethod init-enemy-defaults! ((this citizen) (arg0 nav-enemy-info)) + (set-squad this) + (if (not (-> this squad)) + (format 0 "citizen::initialize-enemy: error: no squad-control~%") + ) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) + (let ((t9-2 (method-of-type nav-enemy init-enemy-defaults!))) + (t9-2 this arg0) + ) + (set! (-> this speed-scale) (rnd-float-range this 0.9 1.1)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (vehicle-controller-method-9 (-> this controller)) + (citizen-method-194 this) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) + ) + (set! (-> this travel-anim-scale-speed) 1.0) + 0 + (none) + ) + +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this citizen) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; WARN: Return type mismatch none vs object. +(defbehavior citizen-init-by-other citizen ((arg0 traffic-object-spawn-params)) + (stack-size-set! (-> self main-thread) 512) + (logclear! (-> self mask) (process-mask enemy)) + (init-enemy-collision! self) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 rotation)) + (if (not (logtest? (-> arg0 flags) (traffic-spawn-flags tsf0))) + (traffic-entity-hack (-> arg0 object-type)) + ) + (set! (-> self vehicle) (-> arg0 handle)) + (set! (-> self interp) 0.0) + (logclear! (-> self flags) (citizen-flag run-mode)) + (logclear! (-> self flags) (citizen-flag shuffle-mode)) + (set! (-> self shield-handle) (the-as handle #f)) + (if (logtest? (-> arg0 flags) (traffic-spawn-flags tsf3)) + (logior! (-> self flags) (citizen-flag dark-guard)) + ) + (set! (-> self attacker-info) #f) + (set! (-> self mission-squad) #f) + (init-enemy! self) + (set! (-> self traffic-id) (the-as int (-> arg0 id))) + (go-inactive self) + ) + +(defmethod get-run-anim ((this citizen)) + (-> this anim-run) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defbehavior citizen-travel-anim citizen ((arg0 int) (arg1 int)) + (local-vars (f28-0 float)) + (logclear! (-> self flags) (citizen-flag shuffle-mode)) + (logclear! (-> self flags) (citizen-flag run-mode)) + (let ((v1-6 (ja-group))) + (when (not (and v1-6 (= v1-6 (-> self draw art-group data (-> self anim-walk))))) + (ja-channel-push! 2 (the-as time-frame arg1)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-walk)) + :num! (loop!) + :dist (-> self dist-walk-anim) + :frame-num (ja-aframe 4.0 0) + ) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-3 (-> self interp))) + (set! (-> gp-1 frame-interp 1) f0-3) + (set! (-> gp-1 frame-interp 0) f0-3) + ) + (set! (-> gp-1 dist) (-> self dist-run-anim)) + (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data (get-run-anim self)))) + (set! (-> gp-1 param 0) 0.0) + (joint-control-channel-group! + gp-1 + (the-as art-joint-anim (-> self draw art-group data (get-run-anim self))) + num-func-chan + ) + ) + ) + ) + (until #f + (let ((f30-0 (-> self nav state speed))) + (lerp-scale 0.0 1.0 f30-0 (-> self speed-walk) (-> self speed-run)) + (set! f28-0 + (cond + ((< f30-0 4096.0) + (cond + ((logtest? (-> self flags) (citizen-flag shuffle-mode)) + (set! f28-0 1.0) + (ja :chan 1 :group! (-> self draw art-group data (-> self anim-shuffle)) :dist 4096.0) + ) + (else + (set! f28-0 0.0) + (when (= (-> self interp) 0.0) + (logclear! (-> self flags) (citizen-flag run-mode)) + (logior! (-> self flags) (citizen-flag shuffle-mode)) + ) + ) + ) + f28-0 + ) + ((< 24576.0 f30-0) + (cond + ((logtest? (-> self flags) (citizen-flag run-mode)) + (set! f28-0 1.0) + (ja :chan 1 :group! (-> self draw art-group data (get-run-anim self)) :dist (-> self dist-run-anim)) + ) + (else + (set! f28-0 0.0) + (when (= (-> self interp) 0.0) + (logior! (-> self flags) (citizen-flag run-mode)) + (logclear! (-> self flags) (citizen-flag shuffle-mode)) + ) + ) + ) + f28-0 + ) + ((or (logtest? (-> self flags) (citizen-flag run-mode)) (logtest? (-> self flags) (citizen-flag shuffle-mode))) + (set! f28-0 0.0) + (when (= (-> self interp) 0.0) + (logclear! (-> self flags) (citizen-flag run-mode)) + (logclear! (-> self flags) (citizen-flag shuffle-mode)) + ) + f28-0 + ) + (else + 0.0 + ) + ) + ) + (seek! (-> self interp) f28-0 (* 4.0 (seconds-per-frame))) + (let ((v1-76 (-> self skel root-channel 1)) + (f0-21 (-> self interp)) + ) + (set! (-> v1-76 frame-interp 1) f0-21) + (set! (-> v1-76 frame-interp 0) f0-21) + ) + (let* ((f0-22 (current-cycle-distance (-> self skel))) + (f0-25 (/ (/ (* 16.0 f30-0) (* 15.0 f0-22)) (-> self root scale x))) + ) + (if (logtest? (-> self flags) (citizen-flag shuffle-mode)) + (set! f0-25 1.0) + ) + (let ((f0-26 (* f0-25 (-> self travel-anim-scale-speed)))) + (ja :num! (loop! f0-26)) + ) + ) + ) + (ja :chan 1 :num! (chan 0)) + (suspend) + ) + #f + ) + +(defmethod citizen-method-201 ((this citizen) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((s1-0 (-> this nav state current-poly))) + (let ((a1-2 (-> this nav state))) + (set! (-> s5-0 quad) (-> a1-2 heading quad)) + ) + (set! (-> s5-0 y) 0.0) + (vector-xz-normalize! s5-0 20480.0) + (set! (-> s4-0 quad) (-> s5-0 quad)) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s1-0 s4-0 s2-0) + ) + (cond + ((-> s2-0 found-boundary) + (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> this dest-point) (-> this controller path-prev-point))) + (s0-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 intersection) (-> this controller path-prev-point))) + ) + (vector-! (new 'stack-no-clear 'vector) s5-0 s4-0) + (set! (-> s1-2 y) 0.0) + (vector-xz-normalize! s1-2 1.0) + (vector-rotate90-around-y! s1-2 s1-2) + (if (< 0.0 (vector-dot s1-2 s0-1)) + (vector-negate! arg0 s1-2) + (set! (-> arg0 quad) (-> s1-2 quad)) + ) + ) + (vector-xz-normalize! arg0 8192.0) + ) + (else + (set! (-> arg0 quad) (the-as uint128 0)) + ) + ) + ) + 0 + (none) + ) + +(defmethod citizen-method-202 ((this citizen) (arg0 vector) (arg1 vector)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> this root trans quad)) + (let ((a1-1 (-> this nav state))) + (set! (-> s2-0 quad) (-> a1-1 heading quad)) + ) + (set! (-> s2-0 y) 0.0) + (vector-xz-normalize! s2-0 20480.0) + (set! (-> s5-0 y) (-> arg0 y)) + (cond + ((< (vector-vector-xz-distance arg0 s5-0) (-> arg0 w)) + (vector-! (new 'stack-no-clear 'vector) arg0 s5-0) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + 0.0 + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> this dest-point) (-> this controller path-prev-point))) + (s1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this controller path-prev-point))) + ) + (set! (-> s2-2 y) 0.0) + (vector-xz-normalize! s2-2 1.0) + (vector-rotate90-around-y! s2-2 s2-2) + (if (< 0.0 (vector-dot s2-2 s1-1)) + (vector-negate! arg1 s2-2) + (set! (-> arg1 quad) (-> s2-2 quad)) + ) + ) + (vector-xz-normalize! arg1 (* 5.0 (- (-> arg0 w) (vector-vector-xz-distance arg0 s5-0)))) + ) + ((line-sphere-intersection? arg0 s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s2-0)) + (let ((s3-3 (vector-! (new 'stack-no-clear 'vector) arg0 s5-0)) + (s5-1 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + 0.0 + (vector-rotate90-around-y! s5-1 s2-0) + (vector-xz-normalize! s5-1 1.0) + (let ((f30-1 (vector-dot s5-1 s3-3))) + (vector-*! s4-1 s3-3 s5-1 f30-1) + (vector-xz-normalize! s5-1 20480.0) + (if (< 0.0 f30-1) + (vector-negate! arg1 s5-1) + (set! (-> arg1 quad) (-> s5-1 quad)) + ) + ) + ) + ) + (else + (set! (-> arg1 quad) (the-as uint128 0)) + ) + ) + ) + 0 + (none) + ) + +(defmethod citizen-method-203 ((this citizen) (arg0 vector)) + (local-vars (sv-288 nav-poly) (sv-304 clamp-travel-vector-to-mesh-return-info) (sv-320 vector)) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (the-as vector (-> this cp-sphere)))) + (s4-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (set! (-> arg0 quad) (the-as uint128 0)) + (when (-> this cp-valid?) + (set! (-> this cp-valid?) #f) + (set! (-> s2-0 quad) (-> this cp-vec quad)) + (set! (-> s2-0 y) 0.0) + (vector-xz-normalize! s2-0 1.0) + (vector-rotate90-around-y! s2-0 s2-0) + (set! (-> s3-1 y) 0.0) + (vector-*! s4-0 s3-1 s2-0 (vector-dot s3-1 s2-0)) + (let ((f30-0 (- 1.0 (/ (vector-length s4-0) (vector-length (-> this cp-vec)))))) + (vector+! s4-0 s4-0 (the-as vector (-> this cp-sphere))) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! sv-320 (new 'stack-no-clear 'vector)) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (set! sv-304 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (set! sv-288 (-> this nav state current-poly)) + (let ((f28-0 (+ (-> this cp-sphere r) (-> this nav-radius-backup)))) + (when sv-288 + (vector-normalize-copy! s0-0 s2-0 f28-0) + (vector-normalize-copy! sv-320 s2-0 (- f28-0)) + (clamp-vector-to-mesh-no-gaps (-> this nav) s4-0 sv-288 s0-0 sv-304) + (let ((a0-12 (-> this nav)) + (t9-7 (method-of-type nav-control clamp-vector-to-mesh-no-gaps)) + (a1-10 s4-0) + (a3-3 sv-320) + ) + (t9-7 a0-12 a1-10 sv-288 a3-3 sv-304) + ) + (let* ((v1-22 s0-0) + (f0-11 (sqrtf (+ (* (-> v1-22 x) (-> v1-22 x)) (* (-> v1-22 z) (-> v1-22 z))))) + (v1-24 sv-320) + (f1-10 (sqrtf (+ (* (-> v1-24 x) (-> v1-24 x)) (* (-> v1-24 z) (-> v1-24 z))))) + ) + (cond + ((< 0.0 (vector-dot s2-0 s3-1)) + (if (< 4096.0 f0-11) + (set! (-> s1-0 quad) (-> s0-0 quad)) + (set! (-> s1-0 quad) (-> sv-320 quad)) + ) + ) + ((< 4096.0 f1-10) + (set! (-> s1-0 quad) (-> sv-320 quad)) + ) + (else + (set! (-> s1-0 quad) (-> s0-0 quad)) + ) + ) + ) + (set! (-> arg0 quad) (-> s1-0 quad)) + (let ((a1-11 (new 'stack-no-clear 'vector))) + (set! (-> a1-11 quad) (-> this root trans quad)) + (set! (-> a1-11 y) 0.0) + (let ((f0-15 (- f28-0 (vector-vector-xz-distance s4-0 a1-11)))) + (if (< f0-15 0.0) + (set! f0-15 0.0) + ) + (vector-normalize! arg0 (* (-> this cp-factor) f0-15 f30-0)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype iter-seg (structure) + ((self citizen) + (score float) + (seg nav-segment) + (cp-plane plane :inline) + (desired-dir vector :inline) + ) + ) + + +(defun iter-seg-clear-path ((arg0 iter-seg) (arg1 nav-segment)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s2-0 (-> arg0 self)) + (a0-1 (-> arg1 branch src-node)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> a0-1 position quad)) + (set! (-> s4-0 w) 1.0) + (let ((a0-4 (-> arg1 branch dest-node)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> a0-4 position quad)) + (set! (-> s3-0 w) 1.0) + (set! (-> s4-0 y) 0.0) + (set! (-> s3-0 y) 0.0) + (set! (-> s4-0 w) 1.0) + (set! (-> s3-0 w) 1.0) + (when *citizen-debug* + ) + (when #t + (cond + ((< 0.0 (vector4-dot (the-as vector (-> arg0 cp-plane)) s3-0)) + (let ((s0-1 (vector-! (new 'stack-no-clear 'vector) s3-0 s4-0)) + (s1-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 root trans) s4-0)) + ) + (set! (-> s1-1 y) 0.0) + (vector-rotate90-around-y! s0-1 s0-1) + (vector-normalize! s0-1 1.0) + (let ((a1-3 s1-1)) + (let ((v1-17 s1-1)) + (let ((a0-12 s0-1)) + (let ((a2-2 (- (vector-dot s0-1 s1-1)))) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-12 quad)) + ) + (.lvf vf4 (&-> v1-17 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 (&-> a1-3 quad) vf6) + ) + (vector+! s1-1 s1-1 s4-0) + (cond + ((< 0.0 (vector-dot (the-as vector (-> arg0 cp-plane)) (vector-! (new 'stack-no-clear 'vector) s3-0 s1-1))) + (vector-vector-xz-distance s3-0 (-> s2-0 cp-sphere)) + (let ((s1-3 (vector-! (new 'stack-no-clear 'vector) s3-0 (the-as vector (-> s2-0 cp-sphere)))) + (s0-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s0-2 quad) (-> s2-0 cp-vec quad)) + (set! (-> s0-2 y) 0.0) + (vector-normalize! s0-2 1.0) + (set! (-> s1-3 y) 0.0) + (let ((f30-0 (vector-dot s0-2 s1-3))) + (if (and *cty-faction-manager* (not (logtest? (cty-faction-manager-method-9 + *cty-faction-manager* + (the-as int (-> arg1 branch clock-type)) + (-> pp level name) + ) + 1 + ) + ) + ) + (set! f30-0 (+ -409600.0 f30-0)) + ) + (when (< (-> arg0 score) f30-0) + (set! (-> arg0 score) f30-0) + (set! (-> arg0 seg) arg1) + ) + ) + ) + (if *citizen-debug* + (add-debug-line #t (bucket-id debug-no-zbuf1) s4-0 s3-0 *color-black* #f *color-white*) + ) + ) + (else + (if *citizen-debug* + (add-debug-line #t (bucket-id debug-no-zbuf1) s1-1 s3-0 *color-red* #f (the-as rgba -1)) + ) + ) + ) + ) + ) + (else + #f + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod gen-clear-path ((this citizen)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'iter-seg)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this cp-vec quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) + (set! (-> s4-0 w) 81920.0) + (set! (-> gp-0 seg) #f) + (set! (-> gp-0 score) (the-as float #xff800000)) + (set! (-> s3-0 y) 0.0) + (vector-rotate90-around-y! s3-0 s3-0) + (vector-normalize! s3-0 1.0) + (set! (-> gp-0 cp-plane quad) (-> s3-0 quad)) + (set! (-> gp-0 cp-plane w) (- (vector-dot s3-0 (the-as vector (-> this cp-sphere))))) + ) + (when (< (vector4-dot (the-as vector (-> gp-0 cp-plane)) (-> this root trans)) 0.0) + (set! (-> gp-0 cp-plane x) (- (-> gp-0 cp-plane x))) + (set! (-> gp-0 cp-plane y) (- (-> gp-0 cp-plane y))) + (set! (-> gp-0 cp-plane z) (- (-> gp-0 cp-plane z))) + (set! (-> gp-0 cp-plane w) (- (-> gp-0 cp-plane w))) + ) + (set! (-> gp-0 self) this) + (nav-segment-callback + this + s4-0 + (the-as traffic-find-segment-struct gp-0) + (the-as (function traffic-find-segment-struct nav-segment none) iter-seg-clear-path) + ) + (when *citizen-debug* + (if (-> gp-0 seg) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> gp-0 seg vertex)) + (-> gp-0 seg vertex 1) + *color-blue* + #f + *color-white* + ) + ) + ) + (-> gp-0 seg) + ) + ) + +(defmethod citizen-method-205 ((this citizen)) + (when (-> this cp-valid?) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> this cp-force quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((a1-0 (-> this nav state))) + (set! (-> s5-0 quad) (-> a1-0 heading quad)) + ) + (set! (-> s5-0 y) 0.0) + (vector-xz-normalize! s5-0 1.0) + (vector-xz-normalize! s4-0 1.0) + (when (< (fabs (vector-dot s4-0 s5-0)) (cos 14563.556)) + (vector-negate! (new 'stack-no-clear 'vector) s5-0) + (let ((a1-6 (gen-clear-path this))) + (if a1-6 + (citizen-method-199 this a1-6) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun iter-seg-new-dir ((arg0 iter-seg) (arg1 nav-segment)) + (with-pp + (-> 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 ((f30-0 (vector-dot s4-1 (-> arg0 desired-dir)))) + (when (and (< (-> arg0 score) f30-0) + (or (not *cty-faction-manager*) (logtest? (cty-faction-manager-method-9 + *cty-faction-manager* + (the-as int (-> arg1 branch clock-type)) + (-> pp level name) + ) + 1 + ) + ) + ) + (set! (-> arg0 score) f30-0) + (set! (-> arg0 seg) arg1) + arg1 + ) + ) + ) + ) + ) + ) + ) + +(defmethod citizen-method-207 ((this citizen) (arg0 vector) (arg1 float)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'iter-seg)) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> this cp-vec quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) + (set! (-> s4-0 w) arg1) + (set! (-> gp-0 seg) #f) + (set! (-> gp-0 score) (the-as float #xff800000)) + (set! (-> gp-0 desired-dir quad) (-> arg0 quad)) + (vector-normalize! (-> gp-0 desired-dir) 1.0) + (set! (-> gp-0 self) this) + (nav-segment-callback + this + s4-0 + (the-as traffic-find-segment-struct gp-0) + (the-as (function traffic-find-segment-struct nav-segment none) iter-seg-new-dir) + ) + (when *citizen-debug* + (if (-> gp-0 seg) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> gp-0 seg vertex)) + (-> gp-0 seg vertex 1) + *color-blue* + #f + *color-white* + ) + ) + ) + (-> gp-0 seg) + ) + ) + +;; WARN: Function (method 208 citizen) has a return type of none, but the expression builder found a return statement. +(defmethod citizen-method-208 ((this citizen) (arg0 vector)) + (dotimes (s4-0 6) + (let ((a1-2 (citizen-method-207 this arg0 (* 81920.0 (the float (+ s4-0 1)))))) + (when a1-2 + (citizen-method-199 this a1-2) + (return #f) + ) + ) + ) + 0 + (none) + ) + +(defmethod citizen-method-206 ((this citizen)) + (let ((s4-0 (the-as vehicle (handle->process (-> this vehicle))))) + (let ((v1-4 (-> this root root-prim))) + (set! (-> v1-4 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-4 prim-core collide-with) (-> this root backup-collide-with)) + ) + (when s4-0 + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> s4-0 root trans)))) + (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root quat))) + (v1-10 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root quat))) + ) + (if (< 0.0 (vector-dot s5-1 s3-0)) + (vector+! s5-1 v1-10 s3-0) + (vector-! s5-1 v1-10 s3-0) + ) + ) + (vector-normalize! s5-1 32768.0) + (set! (-> s5-1 y) 71680.0) + (vector+! s5-1 s5-1 (-> s4-0 root transv)) + (send-event + this + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 0.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (vector s5-1) + (knock (knocked-type vehicle)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate in-ditch (citizen) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self wait-time) (set-reaction-time! self (seconds 1) (seconds 5))) + (if (= (-> self water-anim) -1) + (go-inactive self) + ) + (when (focus-test? self touch-water) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (set! (-> a1-3 quad) (-> self root trans quad)) + (set! (-> a1-3 y) (+ 40.96 (-> self water-surface-height))) + (splash-spawn 0.2 a1-3 1) + ) + ) + ) + :exit (behavior () + '() + ) + :trans #f + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (cond + ((focus-test? self touch-water) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self water-anim)) :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (set! (-> gp-0 y) (+ 40.96 (-> self water-surface-height))) + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) (zero? (-> self draw cur-lod))) + (let ((f0-6 (y-angle (-> self root)))) + (rings-water-spawn f0-6 gp-0 *null-vector* 3072.0 4096.0) + ) + ) + ) + (suspend) + (ja :num! (seek! max 0.5)) + ) + ) + #f + ) + (else + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max 0.1) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + ) + #f + ) + ) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +(defstate wait (citizen) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :exit (behavior () + '() + ) + :trans (behavior () + (cond + ((not (logtest? (-> self flags) (citizen-flag in-formation))) + (if (and (-> self wait-return-state) (time-elapsed? (-> self state-time) (-> self wait-time))) + (go (-> self wait-return-state)) + ) + ) + (else + (let ((a0-3 (handle->process (-> self vehicle)))) + (if (and a0-3 (= (process->handle self) (get-leader-handle (the-as formation-object a0-3)))) + (go (-> self wait-return-state)) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + ) + #f + ) + :post (behavior () + (when (not (logtest? (-> self flags) (citizen-flag in-formation))) + (let ((a1-1 (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (-> self root trans)))) + (seek-toward-heading-vec! (-> self root) a1-1 32768.0 (seconds 0.05)) + ) + ) + (nav-enemy-simple-post) + ) + ) + +(defstate active (citizen) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (when (logtest? (-> self nav state flags) (nav-state-flag directional-mode)) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (let ((a0-18 (-> self nav state)) + (v1-17 (-> self dest-point)) + ) + (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-18 target-pos quad) (-> v1-17 quad)) + ) + 0 + ) + (nav-enemy-method-176 self) + (let ((v1-23 (-> self nav state))) + (set! (-> v1-23 speed) 0.0) + ) + 0 + (let ((a0-21 (-> self nav state)) + (v1-26 *null-vector*) + ) + (set! (-> a0-21 velocity quad) (-> v1-26 quad)) + ) + 0 + (let ((v1-29 (-> self nav))) + (set! (-> v1-29 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + (set! (-> self wait-time) (set-reaction-time! self (seconds 4) (seconds 30))) + (if (zero? (-> self controller branch)) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (if (and *cty-faction-manager* + (nonzero? (-> self controller branch)) + (not (logtest? (cty-faction-manager-method-9 + *cty-faction-manager* + (the-as int (-> self controller branch clock-type)) + (-> self level name) + ) + 1 + ) + ) + ) + (citizen-method-208 self (vector-float*! + (new 'stack-no-clear 'vector) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + -1.0 + ) + ) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) + (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) + (< (-> self root trans y) 4096.0) + ) + (go-virtual in-ditch) + ) + (when (and (time-elapsed? (-> self state-time) (-> self wait-time)) + (not (logtest? (-> self flags) (citizen-flag in-formation))) + ) + (let ((f0-2 (-> self nav state speed))) + (set! (-> self nav target-speed) (seek f0-2 0.0 (* 12288.0 (seconds-per-frame)))) + ) + 0 + (when (= (-> self nav state speed) 0.0) + (set! (-> self wait-return-state) (the-as (state citizen) (-> self state))) + (set! (-> self wait-time) (set-reaction-time! self (seconds 1) (seconds 5))) + (go-virtual wait) + ) + ) + (when (logtest? (-> self flags) (citizen-flag in-formation)) + (let ((a0-10 (handle->process (-> self vehicle)))) + 1.0 + (when a0-10 + (let ((f0-9 (get-target-speed (the-as formation-object a0-10) self (-> self formation-index))) + (v1-46 (-> self nav)) + ) + (set! (-> v1-46 target-speed) (* (-> self speed-scale) (-> self speed-walk) f0-9)) + ) + 0 + ) + ) + ) + (let ((f0-11 2867.2) + (v1-50 (-> self root transv)) + ) + (if (< f0-11 (sqrtf (+ (* (-> v1-50 x) (-> v1-50 x)) (* (-> v1-50 z) (-> v1-50 z))))) + (set-time! (-> self cp-next-time)) + ) + ) + (when (< (+ (-> self cp-next-time) (seconds 2)) (current-time)) + (let ((a1-5 (vector-! (new 'stack-no-clear 'vector) (-> self controller path-prev-point) (-> self dest-point)))) + (set-time! (-> self cp-next-time)) + (citizen-method-208 self a1-5) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) + ) + :post (behavior () + (cond + ((not (logtest? (-> self flags) (citizen-flag in-formation))) + (when (and (nonzero? (-> self controller branch)) + (let ((f0-0 (vector-vector-xz-distance-squared (-> self root trans) (-> self dest-point))) + (f1-0 16384.0) + ) + (or (< f0-0 (* f1-0 f1-0)) (logtest? (-> self nav state flags) (nav-state-flag at-target))) + ) + ) + (let ((gp-0 (-> self controller branch))) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (when (= gp-0 (-> self controller branch)) + (let ((a0-5 (-> self nav state)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 quad) (-> a0-5 heading quad)) + (vector-float*! a1-2 a1-2 -1.0) + (citizen-method-208 self a1-2) + ) + ) + ) + ) + (let ((a0-10 (-> self nav state)) + (v1-21 (-> self dest-point)) + ) + (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-10 target-pos quad) (-> v1-21 quad)) + ) + 0 + ) + (else + (let ((a0-13 (handle->process (-> self vehicle)))) + (when (and a0-13 (!= (process->handle self) (get-leader-handle (the-as formation-object a0-13)))) + (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) + (let ((t9-4 vector-vector-xz-distance-squared) + (a0-16 (-> self root trans)) + (a2-2 (-> self nav state)) + (a1-12 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-12 quad) (-> a2-2 target-pos quad)) + (let ((f0-2 (t9-4 a0-16 a1-12)) + (f1-3 4096.0) + ) + (< f0-2 (* f1-3 f1-3)) + ) + ) + ) + (-> self nav state speed) + (set! (-> self wait-return-state) (the-as (state citizen) (-> self state))) + (go-virtual wait) + ) + ) + ) + ) + ) + (nav-enemy-method-187 self) + ) + ) + +(defstate inactive (citizen) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('nav-mesh-kill 'traffic-activate 'traffic-off-force 'traffic-off 'change-guard-type 'handle-gem-pickup) + (event-handler self proc argc message block) + ) + ) + ) + :enter (behavior () + (when (-> self nav) + (citizen-method-195 self) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + ) + (let ((a0-5 (handle->process (-> self ragdoll-proc)))) + (when a0-5 + (deactivate a0-5) + (set! (-> self ragdoll-proc) (the-as handle #f)) + ) + ) + (logior! (-> self focus-status) (focus-status disable inactive)) + (let ((v1-17 (-> self root root-prim))) + (set! (-> v1-17 prim-core collide-as) (collide-spec)) + (set! (-> v1-17 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (vehicle-controller-method-11 (-> self controller)) + ) + :exit (behavior () + '() + ) + :code sleep-code + ) + +(defstate knocked (citizen) + :virtual #t + :trans (behavior () + (let ((a1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-from-two-vectors-max-angle! gp-0 a1-1 *up-vector* (* 7281.778 (seconds-per-frame))) + (quaternion*! (-> self root quat) gp-0 (-> self root quat)) + ) + (let ((t9-3 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + +(defmethod on-dying ((this citizen)) + (when (handle->process (-> this shield-handle)) + (let ((a0-6 (handle->process (-> this shield-handle)))) + (send-event a0-6 'shield-detach) + ) + ) + ((method-of-type nav-enemy on-dying) this) + (none) + ) + +(defmethod deactivate ((this citizen)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (nop!) + (call-parent-method this) + (none) + ) + +(defmethod citizen-method-215 ((this citizen)) + 0 + (none) + ) + +(defmethod get-penetrated-by ((this citizen)) + (logior (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (the int (-> this hit-points))) + (penetrate vehicle) + ) + ) + +(defmethod get-gem-pool-idx ((this citizen)) + (if (zero? (-> *setting-control* user-current gem-pool-index)) + -1 + (-> *setting-control* user-current gem-pool-index) + ) + ) + +(defmethod enemy-method-152 ((this citizen)) + 0.5 + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/civilian.gc b/goal_src/jak3/levels/city/traffic/citizen/civilian.gc index 776794f6b0..69c475d667 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/civilian.gc @@ -7,3 +7,2110 @@ ;; DECOMP BEGINS +(deftype civilian-anim-info (structure) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) + ) + :pack-me + ) + + +(deftype civilian-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (knocked-land int32 2) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim civilian-anim-info 1 :inline) + (blue-hit-anim civilian-anim-info 3 :inline) + (anim-cover-head-start int32) + (anim-cover-head-loop int32) + (anim-cover-head-end int32) + (car-stance-anim int32) + (bike-stance-anim int32) + (get-in-car-anim int32) + (get-on-bike-anim int32) + (seat-flag uint8) + (speech-ambient int8) + (speech-alert int8) + (speech-cower int8) + (speech-touched-by-player int8) + (speech-shot-by-player int8) + (speech-avoiding-player-vehicle int8) + (speech-hit-by-player-vehicle int8) + (speech-player-stealing-vehicle int8) + ) + ) + + +(deftype civilian (citizen) + ((info civilian-global-info) + (anim-panic-run int32) + (anim-on-ground int32) + (anim-dive int32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (last-second-pos vector :inline) + (last-distance float) + (next-time time-frame) + (dive-target-point vector :inline) + (dive-reaction float) + (allow-dive symbol) + (dive-finished? symbol) + (hit-face uint32) + (seat int32) + ) + (:state-methods + avoid-danger + clear-path + on-ground + dive + get-up-front + get-up-back + cower-ground + wait-for-ride + move-to-vehicle + board-vehicle + ride + exit-vehicle + wait-at-dest + ) + (:methods + (civilian-method-229 (_type_ nav-branch int vector float) float) + (civilian-method-230 (_type_ vector) nav-segment) + (civilian-method-231 (_type_) none) + (civilian-method-232 (_type_ vector) symbol) + (start-ragdoll (_type_ art-joint-anim) none) + ) + ) + + +(defmethod set-squad ((this civilian)) + (set! (-> this squad) *ff-squad-control*) + 0 + (none) + ) + +(defmethod get-run-anim ((this civilian)) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (-> this anim-panic-run) + (-> this anim-run) + ) + ) + +(defmethod within-gspot-range? ((this civilian)) + #f + ) + +(defmethod cleanup-for-death ((this civilian)) + (logclear! (-> this flags) (citizen-flag persistent)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (let ((a1-1 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-1 sphere quad) (-> this root trans quad)) + (set! (-> a1-1 sphere r) 40960.0) + (set! (-> a1-1 velocity quad) (-> this root transv quad)) + (set! (-> a1-1 notify-radius) 122880.0) + (set! (-> a1-1 danger-level) 1.0) + (set! (-> a1-1 decay-rate) 0.0) + (set! (-> a1-1 flags) (the-as uint 1)) + (set! (-> a1-1 danger-type) (the-as uint 7)) + (set! (-> a1-1 handle) (process->handle this)) + (set! (-> a1-1 handle) (the-as handle #f)) + (add-danger (-> this controller traffic) a1-1) + ) + (go-inactive this) + (none) + ) + +(defmethod send-attack-to-all-tshapes ((this civilian) (arg0 process-focusable) (arg1 event-message-block)) + 0 + ) + +;; WARN: Return type mismatch none vs object. +(defmethod go-hostile ((this civilian)) + (cleanup-for-death this) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod go-die ((this civilian)) + (cleanup-for-death this) + ) + +(defmethod go-from-behavior ((this civilian) (arg0 traffic-object-spawn-params)) + (let ((v1-0 (-> arg0 behavior))) + (cond + ((zero? v1-0) + (go (method-of-object this idle)) + ) + ((= v1-0 2) + (go (method-of-object this active)) + ) + ((= v1-0 3) + (go (method-of-object this hostile)) + ) + ((= v1-0 7) + (logior! (-> this flags) (citizen-flag persistent)) + (go (method-of-object this wait-for-ride)) + ) + (else + (go-inactive this) + ) + ) + ) + 0 + (none) + ) + +(defmethod citizen-method-194 ((this civilian)) + (let ((t9-0 (method-of-type citizen citizen-method-194))) + (t9-0 this) + ) + (logior! (-> this mask) (process-mask civilian)) + (set! (-> this hit-points) (the float (rand-vu-int-range 1 4))) + (set! (-> this hit-points) 4.0) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) + (set! (-> this fact pickup-spawn-amount) 0.0) + (when (zero? (mod (the-as int (rand-uint31-gen *random-generator*)) 11)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + ) + 0 + (none) + ) + +(defmethod civilian-method-230 ((this civilian) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> this root trans quad)) + (set! (-> v1-0 w) 81920.0) + (let ((s5-0 (find-segment this v1-0 arg0))) + (if s5-0 + (citizen-method-199 this s5-0) + ) + s5-0 + ) + ) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this civilian)) + (the-as search-info-flag 0) + ) + +(defmethod event-handler ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('combo) + #f + ) + (('touched) + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + (('panic) + (let ((a0-5 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this danger-pos quad) (-> a0-5 sphere quad)) + ) + (if (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) + ) + ) + (go (method-of-object this flee)) + ) + ) + (('event-death) + (if (= (-> this hit-points) 0.0) + (do-effect (-> this skel effect) "death-default" 0.0 -1) + ) + ) + (('avoid) + (set-time! (-> this last-danger-time)) + (let ((a0-14 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this danger-pos quad) (-> a0-14 sphere quad)) + ) + (if (and (-> this next-state) (let ((v1-17 (-> this next-state name))) + (or (= v1-17 'active) (= v1-17 'wait)) + ) + ) + (go (method-of-object this avoid-danger)) + ) + ) + (('clear-path) + (set-time! (-> this last-danger-time)) + (let ((v1-22 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-22 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-22 velocity quad)) + (let ((v1-23 (-> v1-22 danger-type))) + (cond + ((zero? v1-23) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 20.0) + ) + ((= v1-23 1) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 20.0) + ) + ((or (= v1-23 2) (= v1-23 8)) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) + ) + ((= v1-23 3) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) + ) + ((= v1-23 4) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 2.0) + ) + ((= v1-23 5) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) + ) + ((= v1-23 6) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) + ) + ) + ) + ) + (let ((s5-1 (-> this cp-plane))) + (set! (-> s5-1 quad) (-> this cp-vec quad)) + (set! (-> s5-1 y) 0.0) + (vector-rotate90-around-y! s5-1 s5-1) + (vector-normalize! s5-1 1.0) + (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> this cp-sphere))))) + ) + (set! (-> this cp-exit-time) (+ (current-time) (seconds 4))) + (if (and (-> this next-state) (let ((v1-53 (-> this next-state name))) + (or (= v1-53 'active) (= v1-53 'wait) (= v1-53 'avoid-danger)) + ) + ) + (go (method-of-object this clear-path)) + ) + ) + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-14 *speech-control* (the-as handle this)) + (if (logtest? (-> this flags) (citizen-flag female)) + (speech-control-method-12 *speech-control* this (speech-type civ-f-shot-by-player)) + (speech-control-method-12 *speech-control* this (speech-type civ-m-shot-by-player)) + ) + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + (('end-task) + (let ((v0-0 (the-as object (logclear (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-0)) + v0-0 + ) + ) + (else + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod civilian-method-229 ((this civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) + (when (nonzero? arg1) + (-> arg0 src-node) + (let* ((s3-0 (-> arg0 dest-node)) + (t9-0 vector-vector-xz-distance) + (a0-1 arg2) + (a2-1 s3-0) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-1 position quad)) + (set! (-> a1-1 w) 1.0) + (let ((s1-0 (t9-0 a0-1 a1-1)) + (s2-0 (-> s3-0 branch-count)) + (f30-0 0.0) + ) + (dotimes (s0-0 s2-0) + (+! f30-0 (civilian-method-229 this (-> s3-0 branch-array s0-0) (+ arg1 -1) arg2 s1-0)) + ) + ;; og:preserve-this fix divide by zero + (set! arg3 (+ s1-0 (the float (/-signed-0-guard (the int f30-0) s2-0)))) + ) + ) + ) + arg3 + ) + +(defstate wait (civilian) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type citizen wait) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +(defbehavior civilian-flee-post civilian () + (let* ((gp-0 (-> self controller)) + (s4-0 (-> gp-0 branch dest-node)) + (s5-0 (the-as nav-branch #f)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (-> self controller path-prev-point))) + ) + 0.0 + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self dest-point)))) + (set! (-> s2-1 y) 0.0) + (set! (-> s3-1 y) 0.0) + (vector-xz-normalize! s3-1 1.0) + (let ((f0-4 (vector-dot s2-1 s3-1))) + (when (< -16384.0 f0-4) + (cond + ((zero? (-> s4-0 branch-count)) + ) + (else + (let ((s3-2 (-> s4-0 branch-count)) + (f30-0 0.0) + ) + (dotimes (s2-2 s3-2) + (let* ((s1-0 (-> s4-0 branch-array s2-2)) + (f0-5 (civilian-method-229 self s1-0 4 (-> self danger-pos) 0.0)) + ) + (when (< f30-0 f0-5) + (set! f30-0 f0-5) + (set! s5-0 s1-0) + ) + ) + ) + ) + ) + ) + (when s5-0 + (vehicle-controller-method-11 gp-0) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> gp-0 turn-exit-point quad)) + (vehicle-controller-method-10 gp-0 s5-0) + (set! (-> gp-0 path-prev-point quad) (-> s4-1 quad)) + ) + (set! (-> gp-0 branch) s5-0) + (let ((a1-3 (-> s5-0 dest-node)) + (v1-23 (-> gp-0 turn-exit-point)) + ) + (set! (-> v1-23 quad) (-> a1-3 position quad)) + (set! (-> v1-23 w) 1.0) + ) + ) + ) + ) + ) + ) + (when (< (-> self cp-next-time) (current-time)) + (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 2) (seconds 4)))) + (citizen-method-203 self (-> self cp-force)) + ) + (add-offset-to-target! (-> self nav state) (-> self cp-force)) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (-> self cp-force)) + *color-red* + #f + (the-as rgba -1) + ) + ) + (let ((a0-18 (-> self nav state)) + (v1-42 (-> self dest-point)) + ) + (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-18 target-pos quad) (-> v1-42 quad)) + ) + 0 + (set! (-> (new 'stack-no-clear 'vector) quad) (-> self nav state target-pos quad)) + (nav-enemy-method-187 self) + (none) + ) + +(defstate flee (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (nav-enemy-method-177 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((a1-5 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self danger-pos))))) + (civilian-method-230 self a1-5) + ) + (if (zero? (-> self controller branch)) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (if (zero? (-> self controller branch)) + (civilian-method-231 self) + ) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.0 0.0 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (< (vector-vector-distance (-> self root trans) (camera-pos)) 204800.0) + ) + (if (logtest? (-> self flags) (citizen-flag female)) + (speech-control-method-12 *speech-control* self (speech-type civ-f-alert)) + (speech-control-method-12 *speech-control* self (speech-type civ-m-alert)) + ) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) + (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) + (< (-> self root trans y) 4096.0) + ) + (go-virtual in-ditch) + ) + (citizen-method-205 self) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self anim-panic-run))) 30) + ) + :post (behavior () + (civilian-flee-post) + ) + ) + +(defbehavior civilian-avoid-danger-post civilian () + (local-vars (sv-352 nav-poly)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self danger-pos))))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (-> self root trans)))) + (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (the-as vector (-> self danger-pos))) + (let ((s1-1 (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (-> self controller path-prev-point)))) + (set! (-> s5-1 y) 0.0) + (set! (-> s1-1 y) 0.0) + (vector-xz-normalize! s1-1 1.0) + (vector-rotate90-around-y! s1-1 s1-1) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((v1-6 (-> self nav)) + (a0-8 (-> self danger-pos)) + (a1-5 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-5 vertex)) (the-as vector a0-8) (the-as vector (-> v1-6 state mesh bounds))) + (set! (-> a1-5 vertex1 x) (-> v1-6 nearest-y-threshold)) + (set! (-> a1-5 data 20) (the-as uint 2)) + (set! sv-352 (nav-mesh-method-45 (-> v1-6 state mesh) a1-5)) + ) + (when sv-352 + (vector-normalize-copy! s3-0 s1-1 40960.0) + (clamp-vector-to-mesh-no-gaps (-> self nav) (-> self danger-pos) sv-352 s3-0 s0-0) + (vector-normalize-copy! s2-0 s1-1 -40960.0) + (let ((a0-14 (-> self nav)) + (t9-7 (method-of-type nav-control clamp-vector-to-mesh-no-gaps)) + (a1-9 (-> self danger-pos)) + (a3-3 s2-0) + ) + (t9-7 a0-14 a1-9 sv-352 a3-3 s0-0) + ) + (let* ((v1-12 s3-0) + (f0-7 (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z))))) + (v1-14 s2-0) + (f1-7 (sqrtf (+ (* (-> v1-14 x) (-> v1-14 x)) (* (-> v1-14 z) (-> v1-14 z))))) + ) + (cond + ((< 0.0 (vector-dot s1-1 gp-1)) + (if (< 8192.0 f0-7) + (set! (-> s4-0 quad) (-> s3-0 quad)) + (set! (-> s4-0 quad) (-> s2-0 quad)) + ) + ) + ((< 8192.0 f1-7) + (set! (-> s4-0 quad) (-> s2-0 quad)) + ) + (else + (set! (-> s4-0 quad) (-> s3-0 quad)) + ) + ) + ) + (let* ((v1-24 gp-1) + (f0-13 (sqrtf (+ (* (-> v1-24 x) (-> v1-24 x)) (* (-> v1-24 z) (-> v1-24 z))))) + ) + (let ((f1-12 0.8) + (v1-27 s5-1) + ) + (* f1-12 (sqrtf (+ (* (-> v1-27 x) (-> v1-27 x)) (* (-> v1-27 z) (-> v1-27 z))))) + ) + (let ((f0-15 (/ (- (-> self danger-pos r) f0-13) (-> self danger-pos r)))) + (if (< f0-15 0.0) + (set! f0-15 0.0) + ) + (if (< 0.8 f0-15) + (set! f0-15 0.8) + ) + (set! (-> gp-1 quad) (-> s4-0 quad)) + (vector-xz-normalize! gp-1 (* 16384.0 f0-15)) + ) + ) + (vector-xz-normalize! s5-1 16384.0) + ) + ) + ) + (vector+! gp-1 gp-1 s5-1) + ) + (vector-xz-normalize! gp-1 4096.0) + (let ((a0-27 (-> self nav state)) + (v1-41 (vector+! (new 'stack-no-clear 'vector) gp-1 (-> self root trans))) + ) + (logclear! (-> a0-27 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-27 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-27 target-pos quad) (-> v1-41 quad)) + ) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +(defbehavior civilian-avoid-danger-post2 civilian () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (citizen-method-202 self (-> self danger-pos) gp-0) + (add-offset-to-target! (-> self nav state) gp-0) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) gp-0) + *color-blue* + #f + (the-as rgba -1) + ) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (citizen-method-201 self gp-1) + (add-offset-to-target! (-> self nav state) gp-1) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) gp-1) + *color-green* + #f + (the-as rgba -1) + ) + ) + ) + (let ((a0-6 (-> self nav state)) + (v1-23 (-> self dest-point)) + ) + (logclear! (-> a0-6 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-6 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-6 target-pos quad) (-> v1-23 quad)) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +(defstate avoid-danger (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + (set! (-> self next-time) (+ (current-time) (set-reaction-time! self (seconds 1) (seconds 2)))) + (set! (-> self last-second-pos quad) (-> self root trans quad)) + (set! (-> self last-distance) (vector-vector-xz-distance (-> self dest-point) (-> self root trans))) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.0 0.0 1.0 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) + (go-virtual active) + ) + (when (citizen-method-200 self) + (cond + ((< (* 2.0 (-> self danger-pos r)) (vector-vector-xz-distance (-> self danger-pos) (-> self dest-point))) + (go-virtual active) + ) + (else + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (set! (-> self last-distance) (vector-vector-xz-distance (-> self dest-point) (-> self root trans))) + ) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (civilian-avoid-danger-post2) + ) + ) + +(defbehavior civilian-clear-path-post civilian () + (local-vars (sv-304 nav-poly)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self cp-sphere)))) + (s1-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> self cp-vec quad)) + (set! (-> gp-0 y) 0.0) + (vector-xz-normalize! gp-0 1.0) + (vector-rotate90-around-y! gp-0 gp-0) + (set! (-> s5-1 y) 0.0) + (vector-*! s1-0 s5-1 gp-0 (vector-dot s5-1 gp-0)) + (vector+! s1-0 s1-0 (the-as vector (-> self cp-sphere))) + (vector-xz-normalize! s5-1 1.0) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (set! sv-304 (-> self nav state current-poly)) + (let ((f30-0 (+ 4096.0 (-> self cp-sphere r)))) + (when sv-304 + (vector-normalize-copy! s3-0 gp-0 f30-0) + (vector-normalize-copy! s2-0 gp-0 (- f30-0)) + (clamp-vector-to-mesh-no-gaps (-> self nav) s1-0 sv-304 s3-0 s0-0) + (let ((a0-12 (-> self nav)) + (t9-8 (method-of-type nav-control clamp-vector-to-mesh-no-gaps)) + (a3-3 s2-0) + ) + (t9-8 a0-12 s1-0 sv-304 a3-3 s0-0) + ) + (let* ((v1-14 s3-0) + (f0-9 (sqrtf (+ (* (-> v1-14 x) (-> v1-14 x)) (* (-> v1-14 z) (-> v1-14 z))))) + (v1-16 s2-0) + (f1-8 (sqrtf (+ (* (-> v1-16 x) (-> v1-16 x)) (* (-> v1-16 z) (-> v1-16 z))))) + ) + (cond + ((< 0.0 (vector-dot gp-0 s5-1)) + (if (< 4096.0 f0-9) + (set! (-> s4-0 quad) (-> s3-0 quad)) + (set! (-> s4-0 quad) (-> s2-0 quad)) + ) + ) + ((< 4096.0 f1-8) + (set! (-> s4-0 quad) (-> s2-0 quad)) + ) + (else + (set! (-> s4-0 quad) (-> s3-0 quad)) + ) + ) + ) + (set! (-> gp-0 quad) (-> s4-0 quad)) + ) + ) + ) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) gp-0) + *color-blue* + #f + (the-as rgba -1) + ) + ) + (let ((a0-21 (-> self nav state)) + (v1-34 (vector+! (new 'stack-no-clear 'vector) gp-0 (-> self root trans))) + ) + (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-21 target-pos quad) (-> v1-34 quad)) + ) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +(defbehavior civilian-clear-path-post2 civilian () + (citizen-method-205 self) + (when (< (-> self cp-next-time) (current-time)) + (citizen-method-203 self (-> self cp-force)) + (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 4) (seconds 8)))) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (citizen-method-201 self gp-1) + (add-offset-to-target! (-> self nav state) gp-1) + ) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (-> self cp-force)) + *color-blue* + #f + (the-as rgba -1) + ) + ) + (add-offset-to-target! (-> self nav state) (-> self cp-force)) + (let ((a0-9 (-> self nav state)) + (v1-25 (-> self dest-point)) + ) + (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-9 target-pos quad) (-> v1-25 quad)) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +(defstate clear-path (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 4) (seconds 8)))) + (set! (-> self cp-force quad) (the-as uint128 0)) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.0 1.0 0.0 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + (when (citizen-method-200 self) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (set! (-> self last-distance) (vector-vector-xz-distance (-> self dest-point) (-> self root trans))) + ) + (let ((v1-8 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self cp-sphere))))) + (cond + ((< (* 0.5 (vector-length (-> self cp-vec))) (vector-length v1-8)) + (let ((a0-10 (-> self nav))) + (set! (-> a0-10 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + (let ((a0-12 (-> self nav))) + (set! (-> a0-12 acceleration) (-> self enemy-info walk-acceleration)) + ) + 0 + (let ((a0-14 (-> self nav))) + (set! (-> a0-14 turning-acceleration) (-> self enemy-info walk-turning-acceleration)) + ) + 0 + ) + (else + (let ((a0-16 (-> self nav))) + (set! (-> a0-16 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((a0-18 (-> self nav))) + (set! (-> a0-18 acceleration) (-> self enemy-info run-acceleration)) + ) + 0 + (let ((a0-20 (-> self nav))) + (set! (-> a0-20 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + ) + ) + (if (and (-> self allow-dive) + (< (vector-length v1-8) (* (-> self dive-reaction) (vector-length (-> self cp-vec)))) + (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (* 0.5 (-> self cp-sphere r))) + ) + (civilian-method-231 self) + ) + ) + (if (< (-> self cp-exit-time) (current-time)) + (go-virtual active) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 30) + ) + :post (behavior () + (civilian-clear-path-post2) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod civilian-method-231 ((this civilian)) + (if (< (-> this nav state speed) 8192.0) + (go (method-of-object this on-ground)) + (go (method-of-object this dive)) + ) + (none) + ) + +(defstate on-ground (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-8 (-> self root root-prim))) + (set! (-> v1-8 prim-core collide-as) (collide-spec)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) + ) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) + ) + :trans (behavior () + (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) + (go-virtual get-up-front) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-on-ground)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +(defstate dive (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (let ((v1-8 (-> self root root-prim))) + (set! (-> v1-8 prim-core collide-as) (collide-spec)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (let ((v1-12 (-> self nav))) + (set! (-> v1-12 sphere-mask) (the-as uint 0)) + ) + 0 + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 target-speed) 32768.0) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 acceleration) 32768.0) + ) + 0 + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-4 (-> self nav state))) + (set! (-> gp-0 quad) (-> a1-4 heading quad)) + ) + (vector-normalize! gp-0 614400.0) + (vector+! (-> self dive-target-point) (-> self root trans) gp-0) + (set! (-> self dive-target-point quad) (-> gp-0 quad)) + ) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) + ) + (set! (-> self dive-finished?) #f) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) + ) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) + (when (-> self nav) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-dive)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (add-offset-to-target! (-> self nav state) (-> self dive-target-point)) + (if (>= (ja-frame-num 0) 6.0) + (vector-v*float++! (-> self dive-target-point) (-> self dive-target-point) -20.0) + ) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (set! (-> self dive-finished?) #t) + (set! (-> self root transv quad) (the-as uint128 0)) + (go-virtual cower-ground) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 *null-vector*) + ) + (logior! (-> a0-0 flags) (nav-state-flag directional-mode)) + (set! (-> a0-0 travel quad) (-> v1-1 quad)) + ) + 0 + (if (-> self dive-finished?) + (enemy-common-post self) + (nav-enemy-method-187 self) + ) + ) + ) + +(defstate cower-ground (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-8 (-> self root root-prim))) + (set! (-> v1-8 prim-core collide-as) (collide-spec)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (let ((v1-12 (-> self nav))) + (set! (-> v1-12 sphere-mask) (the-as uint 0)) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.2 0.2 0.2 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) + ) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) + (when (-> self nav) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self info anim-cover-head-start)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self info anim-cover-head-loop)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) + (goto cfg-9) + ) + ) + #f + (label cfg-9) + (ja-no-eval :group! (-> self draw art-group data (-> self info anim-cover-head-end)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (go-virtual get-up-front) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 *null-vector*) + ) + (logior! (-> a0-0 flags) (nav-state-flag directional-mode)) + (set! (-> a0-0 travel quad) (-> v1-1 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +(defmethod start-ragdoll ((this civilian) (arg0 art-joint-anim)) + (cond + ((handle->process (-> this ragdoll-proc)) + (ja-channel-push! 1 0) + (let ((s4-0 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! s4-0 arg0 num-func-identity) + (set! (-> s4-0 frame-num) 0.0) + ) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))) ragdoll) this) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! gp-1 arg0 num-func-identity) + (set! (-> gp-1 frame-num) 0.0) + ) + ) + ) + 0 + (none) + ) + +(defstate knocked-recover (civilian) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((a0-3 (-> self nav state)) + (v1-5 *null-vector*) + ) + (logior! (-> a0-3 flags) (nav-state-flag directional-mode)) + (set! (-> a0-3 travel quad) (-> v1-5 quad)) + ) + 0 + (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (vector-reset! (-> self root transv)) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :code (behavior () + (let ((v1-1 (if (zero? (-> self hit-face)) + (-> self anim-get-up-front) + (-> self anim-get-up-back) + ) + ) + ) + (start-ragdoll self (the-as art-joint-anim (-> self draw art-group data v1-1))) + ) + (ja-no-eval :num! (seek! max (-> self speed-scale))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (if (enemy-method-109 self) + (go-die self) + (go-virtual flee) + ) + ) + ) + +(defstate get-up-front (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (start-ragdoll self (the-as art-joint-anim (-> self draw art-group data (-> self anim-get-up-front)))) + (ja-no-eval :num! (seek! max (-> self speed-scale))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (go-virtual flee) + ) + :post (behavior () + (reset-penetrate! self) + (let ((a0-1 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-3 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +(defstate get-up-back (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (start-ragdoll self (the-as art-joint-anim (-> self draw art-group data (-> self anim-get-up-back)))) + (ja-no-eval :num! (seek! max (-> self speed-scale))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (go-virtual flee) + ) + :post (behavior () + (reset-penetrate! self) + (let ((a0-1 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-3 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +(defbehavior civilian-falling-post civilian () + (let ((gp-0 (-> self root))) + (cond + ((focus-test? self under-water) + (accelerate-fall! self (-> gp-0 transv)) + ) + (else + (let ((a1-1 (new-stack-vector0))) + (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 a1-1 (-> self enemy-info slip-factor))) + ) + ) + ) + (let ((a2-1 (new 'stack-no-clear 'collide-query))) + (set! (-> a2-1 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> a2-1 ignore-process0) self) + (set! (-> a2-1 ignore-process1) (-> self vehicle process 0)) + (set! (-> a2-1 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> gp-0 pat-ignore-mask))) + (set! (-> a2-1 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide gp-0 (-> gp-0 transv) a2-1 (meters 0)) + ) + ) + (apply-friction self) + (enemy-common-post self) + (none) + ) + +(defmethod enemy-method-90 ((this civilian) (arg0 ragdoll-proc)) + (let* ((s3-0 (-> arg0 ragdoll)) + (s2-0 (-> s3-0 ragdoll-joints)) + (s1-0 + (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (-> s3-0 orient-tform) (-> s3-0 orient-tform w)) + ) + (s4-0 (new 'stack-no-clear 'matrix)) + (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + ) + (quaternion-normalize! (quaternion*! s1-0 (the-as quaternion (-> s2-0 0)) s1-0)) + (quaternion->matrix s4-0 s1-0) + (if (logtest? (-> s3-0 ragdoll-flags) (ragdoll-flag mirror)) + (matrix*! s4-0 s4-0 (-> s3-0 mirror)) + ) + (cond + ((>= (vector-dot (-> s5-0 uvec) (-> s4-0 fvec)) 0.0) + (set! (-> this hit-face) (the-as uint 1)) + (vector-negate! (-> s4-0 uvec) (-> s4-0 uvec)) + ) + (else + (set! (-> this hit-face) (the-as uint 0)) + 0 + ) + ) + (vector-flatten! (-> s5-0 fvec) (-> s4-0 uvec) (-> s5-0 uvec)) + (vector-normalize! (-> s5-0 fvec) 1.0) + (vector-cross! (-> s5-0 rvec) (-> s5-0 uvec) (-> s5-0 fvec)) + (matrix->quaternion (-> this root quat) s5-0) + ) + 0 + (none) + ) + +(defstate knocked (civilian) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type citizen knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self hit-face) + (the-as + uint + (if (< (vector-dot (-> self root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + 0.0 + ) + 1 + 0 + ) + ) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type citizen knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (reset-penetrate! self) + ) + ) + +(defstate wait-for-ride (civilian) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('board-vehicle) + (let ((a0-1 (the-as process (-> block param 0)))) + (when a0-1 + (let ((v0-0 (the-as object (process->handle a0-1)))) + (set! (-> self vehicle) (the-as handle v0-0)) + v0-0 + ) + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((a0-5 (-> self nav state)) + (v1-10 *null-vector*) + ) + (logior! (-> a0-5 flags) (nav-state-flag directional-mode)) + (set! (-> a0-5 travel quad) (-> v1-10 quad)) + ) + 0 + (set! (-> self vehicle) (the-as handle #f)) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + ) + :trans (behavior () + (if (and (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) (< (-> self root trans y) 4096.0)) + (go-virtual in-ditch) + ) + (when (-> self vehicle) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info object-type) + (((traffic-type civilian-car-a) + (traffic-type civilian-car-b) + (traffic-type civilian-car-c) + (traffic-type civilian-bike-a) + (traffic-type civilian-bike-b) + (traffic-type civilian-bike-c) + ) + (go-virtual move-to-vehicle) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max 0.1) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +(defmethod civilian-method-232 ((this civilian) (arg0 vector)) + (let ((s3-0 (the-as vehicle (handle->process (-> this vehicle)))) + (s4-0 (new 'stack 'collide-query)) + ) + (vehicle-method-66 s3-0 arg0 (-> this seat)) + (vector-! arg0 arg0 (-> s3-0 root trans)) + (vector-normalize! arg0 (+ 14336.0 (vector-length arg0))) + (vector+! arg0 arg0 (-> s3-0 root trans)) + (when (enemy-above-ground? this s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> arg0 y) (-> s4-0 best-other-tri intersect y)) + (let ((v1-14 (-> this nav)) + (a1-10 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-10 vertex)) arg0 (the-as vector (-> v1-14 state mesh bounds))) + (set! (-> a1-10 vertex1 x) (-> v1-14 nearest-y-threshold)) + (set! (-> a1-10 data 20) (the-as uint 2)) + (if (nav-mesh-method-45 (-> v1-14 state mesh) a1-10) + (return #t) + ) + ) + ) + ) + #f + ) + +(defun do-spline2 ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +(defstate move-to-vehicle (civilian) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (enemy-event-handler proc argc message block) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-4 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-4 enemy-flags))) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-4 enemy-flags)))) + ) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-4 enemy-flags)))) + (set! (-> v1-4 nav callback-info) (-> v1-4 enemy-info callback-info)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-7 enemy-flags)))) + ) + 0 + (nav-enemy-method-177 self) + (let ((v1-12 (-> self nav state))) + (set! (-> v1-12 speed) 0.0) + ) + 0 + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 sphere-mask) (the-as uint #x1000f8)) + ) + 0 + ) + :exit (behavior () + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-0 (-> self nav))) + (set! (-> v1-0 sphere-mask) (the-as uint #x1000fe)) + ) + ) + 0 + (logclear! (-> self flags) (citizen-flag persistent)) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s0-0 (the-as vehicle (handle->process (-> self vehicle))))) + (cond + (s0-0 + (set! (-> self seat) + (get-best-seat s0-0 (-> self root trans) (the-as vehicle-seat-flag (-> self info seat-flag)) 1) + ) + (cond + ((!= (-> self seat) -1) + (vehicle-method-66 s0-0 gp-0 (-> self seat)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (set! (-> s2-0 quad) (-> self root trans quad)) + (set! (-> s1-0 quad) (-> gp-0 quad)) + (vector-! s5-0 gp-0 (-> s0-0 root trans)) + (vector-z-quaternion! s4-0 (-> self root quat)) + (let ((f30-1 (* 0.5 (vector-vector-xz-distance s2-0 s1-0)))) + (vector-normalize! s4-0 (* 2.0 f30-1)) + (vector-normalize! s5-0 (* 4.0 f30-1)) + ) + (do-spline2 s3-0 s2-0 s4-0 s1-0 s5-0 0.8) + (let ((v1-21 (-> self nav state))) + (logclear! (-> v1-21 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-21 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-21 target-pos quad) (-> s3-0 quad)) + ) + ) + 0 + (if (and (< (vector-dot (vector-normalize! s4-0 1.0) (vector-normalize! s5-0 1.0)) -0.5) + (< (vector-vector-xz-distance gp-0 (-> self root trans)) 18432.0) + (< (fabs (- (-> gp-0 y) (-> self root trans y))) 20480.0) + ) + (go-virtual board-vehicle) + ) + ) + ) + (else + (go-virtual wait-for-ride) + ) + ) + ) + (else + (go-virtual wait-for-ride) + ) + ) + ) + (if (< 73728.0 (vector-vector-xz-distance gp-0 (-> self root trans))) + (go-virtual wait-for-ride) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate board-vehicle (civilian) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('vehicle-crash) + #f + ) + (('end-task) + (go-die self) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-7 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot)) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (local-vars (sv-128 float) (sv-144 float)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) :num! min) + (let ((f30-0 0.0)) + (while (< f30-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 1.0 (+ (* -2.0 f30-0 f30-0 f30-0) (* 3.0 f30-0 f30-0)) 0.0 1.0) + ) + (suspend) + (+! f30-0 (* 3.0 (seconds-per-frame))) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (set! (-> gp-2 quad) (-> self root trans quad)) + (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) + :num! (seek! (ja-aframe 5.0 0) 0.86956525) + :frame-num (ja-aframe 1.0 0) + ) + (until (ja-done? 0) + (let ((s2-0 (the-as vehicle (handle->process (-> self vehicle)))) + (s1-0 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s2-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! s3-0 (-> s2-0 root quat)) + (vehicle-method-66 s2-0 s1-0 (-> self seat)) + (vector-! s4-1 s1-0 gp-2) + (let ((s2-1 lerp-scale) + (s1-1 0.0) + (s0-0 1.0) + ) + (set! sv-128 (ja-aframe-num 0)) + (set! sv-144 (ja-aframe 1.0 0)) + (let* ((t0-1 (ja-aframe 5.0 0)) + (f30-1 (s2-1 s1-1 s0-0 sv-128 sv-144 t0-1)) + ) + (quaternion-rotate-local-y! s3-0 s3-0 (* f30-1 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + (quaternion-slerp! (-> self root quat) s5-0 s3-0 f30-1) + (vector+float*! (-> self root trans) gp-2 s4-1 f30-1) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 5.0 0) 0.86956525)) + ) + ) + ) + (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) + :num! (seek! (ja-aframe 12.0 0) 0.4) + :frame-num (ja-aframe 5.0 0) + ) + (until (ja-done? 0) + (let ((s5-1 (the-as vehicle (handle->process (-> self vehicle)))) + (gp-4 (new 'stack-no-clear 'quaternion)) + ) + (if (not s5-1) + (go-virtual wait-for-ride) + ) + (quaternion-copy! gp-4 (-> s5-1 root quat)) + (vehicle-method-66 s5-1 (-> self root trans) (-> self seat)) + (let ((f0-22 (lerp-scale 0.0 1.0 (ja-aframe-num 0) (ja-aframe 7.0 0) (ja-aframe 10.0 0)))) + (quaternion-rotate-local-y! (-> self root quat) gp-4 (* (- 1.0 f0-22) (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 0.4)) + ) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defstate ride (civilian) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit-vehicle) + (let ((a0-1 (the-as object (-> block param 0)))) + (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) + ) + (if (time-elapsed? (-> self state-time) (seconds 1)) + (go-virtual exit-vehicle) + ) + ) + (('end-task) + (go-die self) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-7 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (when (-> self nav) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-5 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-8 self)) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logclear (-> v1-8 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defstate exit-vehicle (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (change-to (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)) self) + (if (not (-> self nav)) + (go-inactive self) + ) + (let ((v1-8 (-> self nav state))) + (set! (-> v1-8 current-poly) (the-as nav-poly #f)) + ) + 0 + (citizen-method-208 + self + (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (let ((a0-7 (-> self nav state)) + (v1-14 (-> self dest-point)) + ) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-pos quad) (-> v1-14 quad)) + ) + 0 + (citizen-method-195 self) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (logior! (-> self flags) (citizen-flag persistent)) + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + (set-time! (-> self state-time)) + (let ((v1-28 (-> self root root-prim))) + (set! (-> v1-28 prim-core collide-as) (collide-spec)) + (set! (-> v1-28 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-30 self)) + (set! (-> v1-30 enemy-flags) (the-as enemy-flag (logclear (-> v1-30 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-30 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-33 self)) + (set! (-> v1-33 enemy-flags) (the-as enemy-flag (logclear (-> v1-33 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (local-vars (sv-128 float) (sv-144 float)) + (ja-channel-push! 1 (seconds 0.1)) + (remove-riders (the-as vehicle (handle->process (-> self vehicle))) (the-as handle self)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) + :num! (seek! (ja-aframe 5.0 0) 0.5) + :frame-num (ja-aframe 12.0 0) + ) + (until (ja-done? 0) + (let ((s5-0 (the-as vehicle (handle->process (-> self vehicle)))) + (gp-1 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! gp-1 (-> s5-0 root quat)) + (vehicle-method-66 s5-0 (-> self root trans) (-> self seat)) + (let ((f0-3 (lerp-scale 0.0 1.0 (ja-aframe-num 0) (ja-aframe 10.0 0) (ja-aframe 7.0 0)))) + (quaternion-rotate-local-y! (-> self root quat) gp-1 (* f0-3 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 5.0 0) 0.5)) + ) + (let ((gp-3 (new 'stack-no-clear 'vector)) + (s5-2 (new 'stack-no-clear 'quaternion)) + ) + (while (not (civilian-method-232 self gp-3)) + (let ((s4-1 (the-as vehicle (handle->process (-> self vehicle)))) + (s3-1 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s3-1 (-> s4-1 root quat)) + (vehicle-method-66 s4-1 (-> self root trans) (-> self seat)) + (quaternion-rotate-local-y! (-> self root quat) s3-1 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + (suspend) + ) + (let ((v1-43 (the-as vehicle (handle->process (-> self vehicle))))) + (quaternion-copy! s5-2 (-> v1-43 root quat)) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) + :num! (seek! (ja-aframe 1.0 0) 0.5) + :frame-num (ja-aframe 5.0 0) + ) + (until (ja-done? 0) + (let ((a0-46 (the-as vehicle (handle->process (-> self vehicle)))) + (s2-1 (new 'stack-no-clear 'vector)) + (s4-3 (new 'stack-no-clear 'vector)) + (s3-2 (new 'stack-no-clear 'quaternion)) + ) + (vehicle-method-66 a0-46 s2-1 (-> self seat)) + (vector-! s4-3 s2-1 gp-3) + (let ((s2-2 lerp-scale) + (s1-1 0.0) + (s0-0 1.0) + ) + (set! sv-128 (ja-aframe-num 0)) + (set! sv-144 (ja-aframe 5.0 0)) + (let* ((t0-1 (ja-aframe 1.0 0)) + (f0-12 (s2-2 s1-1 s0-0 sv-128 sv-144 t0-1)) + (f30-0 (- 1.0 f0-12)) + ) + (quaternion-rotate-local-y! s3-2 s5-2 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + (quaternion-copy! (-> self root quat) s3-2) + (vector+float*! (-> self root trans) gp-3 s4-3 f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 1.0 0) 0.5)) + ) + ) + (let ((v1-74 (-> self root root-prim))) + (set! (-> v1-74 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-74 prim-core collide-with) (-> self root backup-collide-with)) + ) + (go-virtual active) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defstate wait-at-dest (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max 0.1) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; WARN: Return type mismatch city-attacker-info-flag vs none. +(defmethod citizen-method-215 ((this civilian)) + (when (and *cty-attack-controller* (nonzero? *cty-attack-controller*)) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 1) + (logior! (-> this attacker-info flags) (city-attacker-info-flag cai1)) + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/guard.gc b/goal_src/jak3/levels/city/traffic/citizen/guard.gc index c7386c656f..e9b4fdcfb5 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/guard.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/guard.gc @@ -7,3 +7,2249 @@ ;; DECOMP BEGINS +(define *guard-died-recently?* #f) + +(defskelgroup skel-crimson-guard crimson-guard crimson-guard-lod0-jg -1 + ((crimson-guard-lod0-mg (meters 20)) (crimson-guard-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow crimson-guard-shadow-mg + :origin-joint-index 3 + ) + +(define *crimson-guard-global-info* + (new 'static 'guard-global-info + :knocked (new 'static 'array int32 2 31 8) + :knocked-land (new 'static 'array int32 2 32 9) + :yellow-hit-anim (new 'static 'inline-array guard-anim-info 2 + (new 'static 'guard-anim-info :anim-index (new 'static 'array int32 2 13 15)) + (new 'static 'guard-anim-info :anim-index (new 'static 'array int32 2 15 13)) + ) + :yellow-land-anim (new 'static 'inline-array guard-anim-info 2 + (new 'static 'guard-anim-info :anim-index (new 'static 'array int32 2 14 16)) + (new 'static 'guard-anim-info :anim-index (new 'static 'array int32 2 16 14)) + ) + :blue-hit-anim (new 'static 'array int32 1 10) + :pad (new 'static 'array uint8 4 #xa #x0 #x0 #x0) + ) + ) + +(define *crimson-guard-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 8 + :knocked-land-anim 9 + :die-anim 17 + :die-falling-anim 8 + :victory-anim 4 + :jump-wind-up-anim 7 + :jump-in-air-anim 4 + :jump-land-anim 7 + :neck-joint 30 + :look-at-joint 6 + :bullseye-joint 5 + :sound-hit (static-sound-name "guard-hit") + :sound-die (static-sound-name "guard-die") + :notice-distance (meters 100) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 100) + :default-hit-points 4.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 4.5) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 61440.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim 5 + :run-anim 6 + :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 8) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 3) + :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! (-> *crimson-guard-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod set-squad ((this crimson-guard)) + (set! (-> this squad) *ff-squad-control*) + 0 + (none) + ) + +(defmethod crimson-guard-method-259 ((this crimson-guard) (arg0 vector)) + (local-vars + (sv-240 vector) + (sv-256 (function vector vector vector)) + (sv-272 vector) + (sv-288 vector) + (sv-304 vector) + (sv-320 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! sv-240 arg0) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (let ((v1-1 (-> this root trans))) + (let ((a0-1 *y-vector*)) + (let ((a1-2 8192.0)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-1 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 (&-> s0-0 quad) vf6) + (set! sv-320 (new 'stack-no-clear 'vector)) + (set! sv-304 (new 'stack-no-clear 'vector)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (-> this node-list data 4 bone transform) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (set! (-> s0-0 quad) (-> this root trans quad)) + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags)) + (let ((a1-6 s0-0)) + (let ((v1-13 s0-0)) + (let ((a0-9 s4-0)) + (let ((a2-1 4096.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.lvf vf4 (&-> v1-13 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 (&-> a1-6 quad) vf6) + ) + ) + (else + (let ((a1-7 s0-0)) + (let ((v1-14 s0-0)) + (let ((a0-10 s4-0)) + (let ((a2-3 2048.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.lvf vf4 (&-> v1-14 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 (&-> a1-7 quad) vf6) + ) + ) + ) + (let ((a1-8 s0-0)) + (let ((v1-15 s0-0)) + (let ((a0-11 s3-0)) + (let ((a2-5 8540.16)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-11 quad)) + ) + (.lvf vf4 (&-> v1-15 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 (&-> a1-8 quad) vf6) + ) + (vector-normalize! (vector-! sv-320 sv-240 s0-0) 1.0) + (set! sv-288 (new 'stack-no-clear 'vector)) + (let ((v1-19 (-> sv-240 quad))) + (set! (-> sv-288 quad) v1-19) + ) + (set! sv-256 vector-rotate90-around-y!) + (set! sv-272 (new 'stack-no-clear 'vector)) + (let* ((a1-13 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) sv-288 s0-0) -2998.272)) + (v0-5 (sv-256 sv-272 a1-13)) + ) + (vector+! sv-288 sv-288 v0-5) + ) + (vector-normalize! (vector-! sv-320 sv-288 s0-0) 1.0) + (vector-z-quaternion! sv-304 (-> this root quat)) + (rot-zxy-from-vector! s2-0 sv-304) + (rot-zxy-from-vector! s1-0 sv-320) + (set! (-> s5-0 x) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 x) (-> s2-0 x))))) + (set! (-> s5-0 y) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 y) (-> s2-0 y))))) + (set! (-> s5-0 z) 0.0) + (let ((s2-1 (new 'stack-no-clear 'quaternion))) + (let ((s1-1 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s2-1 s4-0 (-> s5-0 x)) + (quaternion-vector-angle! s1-1 s3-0 (-> s5-0 y)) + (quaternion*! s2-1 s1-1 s2-1) + ) + (quaternion-slerp! (-> this joint quat) (-> this joint quat) s2-1 (* 5.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod crimson-guard-method-260 ((this crimson-guard)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) + 0 + (none) + ) + +(define *guard-min-id-hack* 255) + +;; WARN: Return type mismatch time-frame vs none. +(defmethod enemy-common-post ((this crimson-guard)) + (when (nonzero? (-> this controller branch)) + (let* ((v1-2 *cty-faction-manager*) + (a1-0 (-> this controller branch clock-type)) + (s5-0 (-> v1-2 territory-faction-modes 0 data (+ 0 (* a1-0 16)))) + ) + (when (!= (-> this faction-mode) s5-0) + (if (not (send-event this 'change-faction-mode s5-0 (-> this faction-mode))) + (set! (-> this faction-mode) (the-as uint s5-0)) + ) + ) + ) + ) + (crimson-guard-method-261 this) + (if (= (-> this faction-mode) 1) + (logclear! (-> this flags) (citizen-flag persistent)) + ) + (let ((t9-2 (method-of-type citizen enemy-common-post))) + (t9-2 this) + ) + (update-transforms (-> this root)) + (if (< (-> this traffic-id) *guard-min-id-hack*) + (set! *guard-min-id-hack* (-> this traffic-id)) + ) + (if (-> this joint-enable) + (crimson-guard-method-259 this (-> this target-pos-predict-miss)) + (crimson-guard-method-260 this) + ) + (if (logtest? (-> this draw status) (draw-control-status on-screen)) + (set-time! (-> this last-onscreen-time)) + ) + (none) + ) + +(defmethod go-die ((this crimson-guard)) + (set! *guard-died-recently?* #t) + ((method-of-type nav-enemy go-die) this) + ) + +(defmethod go-best-state ((this crimson-guard)) + (if (not (logtest? (-> this flags) (citizen-flag hostile))) + (go (method-of-object this active)) + (go-hostile this) + ) + ) + +(defmethod get-damage-from-attack ((this crimson-guard) (arg0 object) (arg1 event-message-block)) + (let ((v0-0 ((method-of-type nav-enemy get-damage-from-attack) this arg0 arg1))) + (-> arg1 param 1) + v0-0 + ) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this crimson-guard)) + (the-as search-info-flag (cond + ((not (-> *setting-control* user-current gun-target-guards?)) + 1 + ) + ((and (-> this next-state) (let ((v1-5 (-> this next-state name))) + (or (= v1-5 'exit-transport) (= v1-5 'jump)) + ) + ) + 0 + ) + (else + (the-as int (call-parent-method this)) + ) + ) + ) + ) + +;; WARN: disable def twice: 182. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('victory) + (when (= (-> this faction-mode) 1) + (crimson-guard-method-285 this 100) + (set! (-> this hit-points) (fmax 2.0 (-> this hit-points))) + (+! (-> this hit-points) 2.0) + (set! (-> this hit-points) (fmin 8.0 (-> this hit-points))) + ) + ) + (('member-attacked) + (set! v0-0 (lambda ((arg0 process) (arg1 city-attacker-info)) + (if (zero? (-> arg1 self-type)) + (-> *cty-attack-controller* guard-angry-hatred-info-index) + -1 + ) + ) + ) + (set! (-> this attacker-info hatred-map-callback) (the-as (function process city-attacker-info int) v0-0)) + v0-0 + ) + (('change-faction-mode) + (let ((a0-6 (-> arg3 param 1)) + (v1-8 (-> arg3 param 0)) + ) + (when (and (= a0-6 0) (= v1-8 1)) + (crimson-guard-method-285 this 100) + (set! (-> this hit-points) 7.0) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this target-status handle) (the-as handle #f)) + ) + ) + #f + ) + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-14 *speech-control* (the-as handle this)) + (if (>= (-> this hit-points) 1.0) + (speech-control-method-13 *speech-control* this (speech-type guard-hit) (-> this traffic-id)) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('event-death) + (if (= (-> this hit-points) 0.0) + (do-effect (-> this skel effect) "death-default" 0.0 -1) + ) + ) + (('change-guard-type) + (crimson-guard-method-267 this (the-as guard-type (-> arg3 param 0)) #f) + ) + (('bouncing-off) + (when (or (and (-> this next-state) (= (-> this next-state name) 'active)) + (and (-> this next-state) (= (-> this next-state name) 'wait)) + ) + (speech-control-method-17 *speech-control* (speech-type guard-chatter) 0.3) + (speech-control-method-17 *speech-control* (speech-type guard-chatter-jak) 0.3) + (speech-control-method-13 *speech-control* this (speech-type guard-bumped-by-jak) (-> this traffic-id)) + (go (method-of-object this close-attack-active)) + ) + ) + (('combo) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (!= (-> this hit-points) 0.0)) + ) + ) + (('avoid) + #f + ) + (('panic) + (set-time! (-> this last-danger-time)) + (let ((s5-1 (the-as object (-> arg3 param 0)))) + (case (-> (the-as traffic-danger-info s5-1) danger-type) + ((7) + (set! (-> this cp-factor) 20.0) + (let ((s4-1 (method-of-object this citizen-method-210)) + (s3-1 1) + (s5-2 (handle->process (-> (the-as traffic-danger-info s5-1) handle))) + ) + (s4-1 this s3-1 (if (type? s5-2 process-focusable) + s5-2 + ) + ) + ) + ) + ((6) + (when (and (< 1.5 (-> (the-as traffic-danger-info s5-1) danger-level)) + (and (and (-> this next-state) (let ((v1-61 (-> this next-state name))) + (or (= v1-61 'hostile) + (= v1-61 'grenade-throw) + (= v1-61 'grenade-throw-post-reloading) + (= v1-61 'search) + (= v1-61 'active) + (= v1-61 'idle) + (= v1-61 'tazer-hostile) + (= v1-61 'grenade-hostile) + (= v1-61 'rifle-hostile) + ) + ) + ) + (< (vector-vector-xz-distance (-> this root trans) (the-as vector (+ (the-as uint s5-1) 0))) 32768.0) + ) + ) + (set! (-> this danger-pos quad) (-> (the-as traffic-danger-info s5-1) sphere quad)) + (go (method-of-object this flee-danger)) + ) + ) + ) + ) + ) + (('clear-path) + (set-time! (-> this last-danger-time)) + (let ((v1-69 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-69 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-69 velocity quad)) + (let ((v1-70 (-> v1-69 danger-type))) + (cond + ((zero? v1-70) + (citizen-method-210 this 1 *target*) + ) + ((= v1-70 1) + ) + ((= v1-70 2) + ) + ((= v1-70 3) + ) + ((= v1-70 4) + ) + ((= v1-70 5) + ) + ((= v1-70 6) + ) + ((= v1-70 7) + (citizen-method-210 this 1 *target*) + ) + ) + ) + ) + (let ((s5-3 (-> this cp-plane))) + (set! (-> s5-3 quad) (-> this cp-vec quad)) + (set! (-> s5-3 y) 0.0) + (vector-rotate90-around-y! s5-3 s5-3) + (vector-normalize! s5-3 1.0) + (set! (-> s5-3 w) (- (vector-dot (the-as vector s5-3) (the-as vector (-> this cp-sphere))))) + ) + (set! v0-0 (+ (current-time) (seconds 1))) + (set! (-> this cp-exit-time) (the-as time-frame v0-0)) + v0-0 + ) + (('end-pursuit) + (when *debug-segment* + (when (focus-test? this inactive) + (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> this pid)) + (break!) + 0 + ) + ) + (when (not (focus-test? this dead)) + (when (logtest? (-> this flags) (citizen-flag hostile)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-208 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) + ) + ) + ) + (('alert-begin) + (when *debug-segment* + (when (focus-test? this inactive) + (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> this pid)) + (break!) + 0 + ) + ) + ) + (('alert-end) + (when *debug-segment* + (when (focus-test? this inactive) + (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> this pid)) + (break!) + 0 + ) + ) + ) + (('notify) + (let ((a0-86 (-> arg3 param 0)) + (v1-111 (the-as object (-> arg3 param 1))) + ) + (when (= a0-86 'attack) + (when (not (logtest? (-> (the-as process-focusable v1-111) mask) (process-mask target))) + (when (focus-test? (the-as process-focusable v1-111) dead) + (format #t "guard killed target~%") + (speech-control-method-13 *speech-control* this (speech-type guard-battle-victory) (-> this traffic-id)) + ) + ) + ) + ) + ) + (else + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod get-inv-mass ((this crimson-guard)) + 0.6666667 + ) + +(defmethod knocked-land-anim ((this crimson-guard) (arg0 enemy-knocked-info)) + (cond + ((>= 0.0 (-> this hit-points)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + (a0-5 (-> this skel root-channel 0)) + ) + (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim a1-2) num-func-seek!) + ) + (set! (-> this hit-face) (the-as uint -1)) + #t + ) + (else + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type red-shot) (knocked-type vehicle)) + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((= (-> this small-hit) 1) + (let ((a1-7 (-> this + draw + art-group + data + (-> (the-as + guard-global-info + (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim) 8)) (the-as uint (-> this info))) + ) + yellow-land-anim + 0 + anim-index-front + ) + ) + ) + (a0-16 (-> this skel root-channel 0)) + ) + (set! (-> a0-16 frame-group) (the-as art-joint-anim a1-7)) + (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) + (set! (-> a0-16 param 1) (-> arg0 anim-speed)) + (set! (-> a0-16 frame-num) 0.0) + (joint-control-channel-group! a0-16 (the-as art-joint-anim a1-7) num-func-seek!) + ) + (set! (-> this hit-face) (the-as uint -1)) + #t + ) + (else + (let ((a1-8 (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + (a0-20 (-> this skel root-channel 0)) + ) + (set! (-> a0-20 frame-group) (the-as art-joint-anim a1-8)) + (set! (-> a0-20 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) + (set! (-> a0-20 param 1) (-> arg0 anim-speed)) + (set! (-> a0-20 frame-num) 0.0) + (joint-control-channel-group! a0-20 (the-as art-joint-anim a1-8) num-func-seek!) + ) + #t + ) + ) + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-23 (-> this skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) + (set! (-> a0-23 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) + ) + (set! (-> a0-23 param 1) (-> arg0 anim-speed)) + (set! (-> a0-23 frame-num) 0.0) + (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) + ) + (set! (-> this hit-face) (the-as uint -1)) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-12 (-> this draw art-group data (-> this info knocked-land (-> this hit-face))))) + (set! (-> arg0 anim-speed) 1.0) + (let ((a0-28 (-> this skel root-channel 0))) + (set! (-> a0-28 frame-group) (the-as art-joint-anim a1-12)) + (set! (-> a0-28 param 0) (the float (+ (-> (the-as art-joint-anim a1-12) frames num-frames) -1))) + (set! (-> a0-28 param 1) (-> arg0 anim-speed)) + (set! (-> a0-28 frame-num) 0.0) + (joint-control-channel-group! a0-28 (the-as art-joint-anim a1-12) num-func-seek!) + ) + ) + #t + ) + ) + ) + ) + ) + +(defmethod go-from-behavior ((this crimson-guard) (arg0 traffic-object-spawn-params)) + (let ((a1-1 (-> arg0 guard-type))) + (if (or (and (!= a1-1 11) (!= a1-1 (-> this guard-type))) (= (-> arg0 behavior) 11)) + (crimson-guard-method-267 this (the-as guard-type a1-1) (= (-> arg0 behavior) 11)) + ) + ) + (when #f + (let ((s4-0 (new 'stack-no-clear 'shield-sphere-spawn-params))) + (set! (-> s4-0 owner) (process->handle this)) + (set! (-> s4-0 sphere-size) 3.4) + (set! (-> s4-0 shield-strength) 3) + (set! (-> s4-0 shield-type) (shield-type shield-type-0)) + (set! (-> s4-0 enable-time) (seconds 3)) + (set! (-> s4-0 disable-time) (seconds 1.5)) + (set! (-> s4-0 offset-vec quad) (-> *up-vector* quad)) + (vector-float*! (-> s4-0 offset-vec) (-> s4-0 offset-vec) 8192.0) + (let ((s3-0 (the-as process #f))) + (let* ((s2-0 (get-process *default-dead-pool* shield-sphere #x4000 1)) + (v1-22 (when s2-0 + (let ((t9-2 (method-of-type process activate))) + (t9-2 s2-0 this "process" (the-as pointer #x70004000)) + ) + (run-now-in-process s2-0 shield-sphere-init-by-other s4-0) + (-> s2-0 ppointer) + ) + ) + ) + (if v1-22 + (set! s3-0 (-> v1-22 0)) + ) + ) + (if s3-0 + (set! (-> this shield-handle) (process->handle s3-0)) + ) + ) + ) + ) + (case (-> arg0 behavior) + ((5) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + (let ((s4-1 (-> this focus)) + (s3-1 (method-of-type enemy-focus enemy-focus-method-13)) + (s5-1 (handle->process (-> arg0 handle))) + ) + (s3-1 + s4-1 + (the-as process-focusable (if (type? s5-1 process-focusable) + s5-1 + ) + ) + (enemy-aware ea3) + ) + ) + (go (method-of-object this arrest)) + ) + ((6) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + (logior! (-> this flags) (citizen-flag hostile)) + (set! (-> this transport) (-> arg0 handle)) + (set! (-> this transport-side) (-> arg0 user-data)) + (crimson-guard-method-265 this 0.0) + (let* ((s4-2 (-> this squad)) + (s5-2 (get-focus s4-2)) + ) + (if (and (>= (the-as uint (get-alert-level s4-2)) (the-as uint 1)) s5-2) + (try-update-focus (-> this focus) s5-2 this) + ) + ) + (go (method-of-object this exit-transport)) + ) + ((9) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + (set! (-> this focus handle) (-> arg0 handle)) + (set! (-> this target-status handle) (-> arg0 handle)) + (go (method-of-object this waiting-ambush)) + ) + ((3) + (set! (-> this focus handle) (-> arg0 handle)) + (set! (-> this target-status handle) (-> arg0 handle)) + (go-hostile this) + ) + ((11) + (set! (-> this root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> this root quat) (-> arg0 rotation)) + (set! (-> this vehicle) (-> arg0 handle)) + (ja-channel-set! 1) + (case (-> (the-as vehicle (handle->process (-> this vehicle))) info object-type) + (((traffic-type civilian-bike-a) + (traffic-type civilian-bike-b) + (traffic-type civilian-bike-c) + (traffic-type guard-bike) + ) + (logior! (-> this flags) (citizen-flag knocked-out-bike)) + (let ((v1-93 (-> this skel root-channel 0))) + (set! (-> v1-93 frame-group) (the-as art-joint-anim (-> this draw art-group data 35))) + ) + ) + (((traffic-type civilian-car-a) + (traffic-type civilian-car-b) + (traffic-type civilian-car-c) + (traffic-type guard-car) + ) + (logior! (-> this flags) (citizen-flag knocked-out-car)) + (let ((v1-99 (-> this skel root-channel 0))) + (set! (-> v1-99 frame-group) (the-as art-joint-anim (-> this draw art-group data 36))) + ) + ) + ) + (ja-post) + (go (method-of-object this knocked-off-vehicle)) + ) + (else + ((method-of-type citizen go-from-behavior) this arg0) + ) + ) + 0 + (none) + ) + +(defmethod crimson-guard-method-258 ((this crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((f0-0 1228.8) + (f30-0 6144.0) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> s5-0 move-dist) arg1 arg0) + (let ((v1-4 s5-0)) + (set! (-> v1-4 radius) f0-0) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (cond + ((>= f0-1 0.0) + (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) f0-1) + (cond + ((< (vector-dot + (-> s5-0 best-other-tri normal) + (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri))) + ) + 0.0 + ) + (return 1) + ) + (else + ) + ) + ) + (else + (vector-! (-> s5-0 move-dist) arg1 arg0) + ) + ) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (let ((a0-19 (-> s5-0 start-pos))) + (let ((v1-15 (-> s5-0 move-dist))) + (let ((a1-10 -0.1)) + (.mov vf7 a1-10) + ) + (.lvf vf5 (&-> v1-15 quad)) + ) + (.lvf vf4 (&-> arg0 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 (&-> a0-19 quad) vf6) + ) + (let ((a1-11 (-> s5-0 move-dist))) + (let ((v1-16 (-> s5-0 move-dist))) + (let ((a0-20 (-> s5-0 move-dist))) + (let ((a2-4 0.1)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-20 quad)) + ) + (.lvf vf4 (&-> v1-16 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 (&-> a1-11 quad) vf6) + ) + (let ((v1-17 s5-0)) + (set! (-> v1-17 radius) f30-0) + (set! (-> v1-17 collide-with) (collide-spec civilian enemy hit-by-player-list hit-by-others-list)) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) (handle->process (-> this focus handle))) + (set! (-> v1-17 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + ) + (cond + ((< (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) + 0 + ) + (else + (let* ((s4-1 (-> s5-0 best-other-tri collide-ptr)) + (v1-20 (if (type? s4-1 collide-shape-prim) + s4-1 + ) + ) + ) + (cond + ((and v1-20 (< (vector-dot + (-> s5-0 best-other-tri normal) + (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri))) + ) + 0.0 + ) + ) + (let ((v1-22 (-> (the-as collide-shape-prim v1-20) cshape process))) + (if (and v1-22 (= (-> v1-22 type) target)) + 1 + 2 + ) + ) + ) + (else + 0 + ) + ) + ) + ) + ) + ) + ) + ) + +;; WARN: disable def twice: 6. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod crimson-guard-method-290 ((this crimson-guard)) + (if #t + (handle->process (-> this attacker-info enemy)) + (squad-control-city-method-35 (-> this squad) this (-> this focus handle)) + ) + ) + +(defmethod crimson-guard-method-261 ((this crimson-guard)) + (when (not (handle->process (-> this target-status handle))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this target-status handle) (the-as handle #f)) + ) + (let ((s5-0 #f)) + (let ((s4-0 (crimson-guard-method-290 this))) + (cond + (s4-0 + (when (!= (-> this target-status handle) (process->handle s4-0)) + (if (handle->process (-> this target-status handle)) + (speech-control-method-13 *speech-control* this (speech-type guard-change-targets) (-> this traffic-id)) + ) + (set! (-> this target-status handle) (process->handle s4-0)) + (crimson-guard-method-289 this 0.0) + (set-time! (-> this last-choose-new-enemy-time)) + (set! s5-0 #t) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + ) + ) + (else + (when (!= (-> this target-status handle) #f) + (set! s5-0 #t) + (set! (-> this target-status handle) (the-as handle #f)) + ) + ) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 0.5))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (if (and (= (-> this faction-mode) 1) (time-elapsed? (-> this pursuit-start-time) (seconds 5))) + (logclear! (-> this flags) (citizen-flag in-pursuit)) + ) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> this root trans quad)) + (+! (-> a1-4 y) 8192.0) + (let ((s4-1 (squad-control-method-17 (-> this squad) a1-4 (-> this traffic-id) (-> this target-status)))) + (let* ((s3-0 this) + (s2-0 (method-of-object s3-0 enemy-method-70)) + (s1-0 (handle->process (-> this target-status handle))) + ) + (s2-0 + s3-0 + (the-as process-focusable (if (type? s1-0 process-focusable) + s1-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (let ((v1-58 (handle->process (-> this focus handle)))) + (b! + (not (and v1-58 + (not (logtest? (-> (the-as process-focusable v1-58) focus-status) (focus-status disable dead inactive))) + ) + ) + cfg-65 + :delay (nop!) + ) + ) + (set! (-> this target-pos quad) (-> this target-status position quad)) + (set! (-> this target-vel-vec quad) (-> this target-status velocity quad)) + (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) + (when (logtest? (-> s4-1 flags) (squad-target-flag updated)) + (if (crimson-guard-method-256 this) + (logior! (-> this flags) (citizen-flag target-in-sight)) + (logclear! (-> this flags) (citizen-flag target-in-sight)) + ) + ) + (set! (-> this target-flags) (the-as uint (-> s4-1 flags))) + ) + ) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> this target-pos) (-> this root trans)))) + (let ((s4-2 (new 'stack-no-clear 'vector))) + (rnd-float-range this -16384.0 16384.0) + (rnd-float-range this -1820.4445 1820.4445) + (let ((s0-0 (new 'stack-no-clear 'quaternion)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (vector-normalize-copy! s4-2 s5-2 1.0) + (quaternion-vector-angle! s0-0 s4-2 (rnd-float-range this -32768.0 32768.0)) + (vector-orient-by-quat! s3-1 *y-vector* s0-0) + (vector-rotate-around-axis! s5-2 (the-as quaternion s5-2) (rnd-float-range this -910.2222 910.2222) s3-1) + ) + ) + (vector+! (-> this target-pos-predict-miss) (-> this root trans) s5-2) + ) + (vector-! (-> this target-self) (-> this target-pos) (-> this root trans)) + (set! (-> this target-self-xz quad) (-> this target-self quad)) + (set! (-> this target-self-xz y) 0.0) + (set! (-> this target-self-dist) (vector-length (-> this target-self))) + (set! (-> this target-self-xz-dist) (vector-length (-> this target-self-xz))) + (when (and (< (-> this target-self-xz-dist) 163840.0) (= (-> this faction-mode) 1)) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + ) + (set! (-> this target-y-angle) + (deg-diff (quaternion-y-angle (-> this root quat)) (vector-y-angle (-> this target-self))) + ) + (b! #t cfg-78 :delay (nop!)) + (label cfg-65) + (set! (-> this target-status handle) (the-as handle #f)) + (set! (-> this attacker-info next-update-target-time) 0) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (when (and s5-0 + (not (and (-> this next-state) (let ((v1-109 (-> this next-state name))) + (or (= v1-109 'active) (= v1-109 'knocked) (= v1-109 'knocked-recover)) + ) + ) + ) + ) + ) + ) + (label cfg-78) + 0 + (none) + ) + +(defmethod crimson-guard-method-280 ((this crimson-guard)) + #f + ) + +(defmethod crimson-guard-method-284 ((this crimson-guard) (arg0 vector)) + (case (-> this guard-type) + (((guard-type rifle)) + (set! (-> arg0 x) 81920.0) + (set! (-> arg0 y) 184320.0) + ) + (((guard-type grenade)) + (set! (-> arg0 x) 81920.0) + (set! (-> arg0 y) 143360.0) + ) + (else + (set! (-> arg0 x) 0.0) + (set! (-> arg0 y) 122880.0) + ) + ) + arg0 + ) + +(defmethod crimson-guard-method-286 ((this crimson-guard)) + (case (-> this guard-type) + (((guard-type grenade)) + 2 + ) + (((guard-type rifle)) + 6 + ) + (((guard-type tazer)) + 0 + ) + ) + ) + +(defmethod crimson-guard-method-285 ((this crimson-guard) (arg0 int)) + (+! (-> this ammo-count) arg0) + (set! (-> this ammo-count) (max 0 (min (-> this ammo-count) (crimson-guard-method-286 this)))) + ) + +(defmethod crimson-guard-method-283 ((this crimson-guard)) + (* 0.8 (cond + ((and (crimson-guard-method-280 this) (not (crimson-guard-method-272 this))) + 4096000.0 + ) + (else + (case (-> this guard-type) + (((guard-type rifle)) + 143360.0 + ) + (((guard-type grenade)) + (if (or (> (-> this ammo-count) 0) (not (-> this urgent-fire))) + 81920.0 + 8192.0 + ) + ) + (else + 32768.0 + ) + ) + ) + ) + ) + ) + +(defmethod crimson-guard-method-289 ((this crimson-guard) (arg0 float)) + (let ((f30-0 (crimson-guard-method-283 this))) + (let* ((f28-0 30037.334) + (f26-0 5461.334) + (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-6 (the-as number (logior #x3f800000 v1-5))) + ) + (set! (-> this last-quick-target-spot-angle) (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-6))) arg0)) + ) + (squad-control-method-31 + (-> this squad) + (-> this move-position) + this + (-> this target-status handle) + f30-0 + (-> this last-quick-target-spot-angle) + ) + ) + (none) + ) + +(defmethod crimson-guard-method-282 ((this crimson-guard) (arg0 vector) (arg1 traffic-target-formation) (arg2 (pointer float)) (arg3 int)) + (local-vars (sv-16 int) (sv-24 float) (sv-28 float) (sv-32 float)) + (set! sv-16 -1) + ;; og:preserve-this + (set! sv-24 (the-as float #x7f800000)) + (set! sv-28 (crimson-guard-method-283 this)) + (let ((v1-4 (-> this guard-type))) + (set! sv-32 (the-as float (if (or (= v1-4 (guard-type rifle)) (= v1-4 (guard-type grenade))) + #x47200000 + #x46000000 + ) + ) + ) + ) + (dotimes (s1-0 arg3) + (when (>= (-> arg1 circle-range s1-0) sv-32) + (let* ((a1-3 (vector-rotate-around-y! + (new 'stack-no-clear 'vector) + *x-vector* + (* 182.04445 (/ (* 360.0 (the float s1-0)) (the float arg3))) + ) + ) + (a0-6 (vector+float*! (new 'stack-no-clear 'vector) arg0 a1-3 (fmin sv-28 (-> arg1 circle-range s1-0)))) + (f0-8 (vector-vector-distance a0-6 (-> this root trans))) + ) + (when (and (< f0-8 sv-24) (= (-> arg2 s1-0) 0.0)) + (set! sv-16 s1-0) + (set! sv-24 f0-8) + ) + ) + ) + ) + (cond + ((!= sv-16 -1) + (let ((v1-26 (vector-rotate-around-y! + (new 'stack-no-clear 'vector) + *x-vector* + (* 182.04445 (/ (* 360.0 (the float sv-16)) (the float arg3))) + ) + ) + ) + (vector+float*! (-> this move-position) arg0 v1-26 (fmin sv-28 (-> arg1 circle-range sv-16))) + ) + (set! (-> arg2 sv-16) (fmin sv-28 (-> arg1 circle-range sv-16))) + ) + (else + (set! (-> this move-position quad) (-> this root trans quad)) + ) + ) + (!= sv-16 -1) + ) + +(defmethod crimson-guard-method-262 ((this crimson-guard)) + (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) + (set! (-> a1-0 sphere r) 40960.0) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (set! (-> a1-0 notify-radius) 122880.0) + (set! (-> a1-0 danger-level) 1.0) + (set! (-> a1-0 decay-rate) 0.0) + (set! (-> a1-0 flags) (the-as uint 1)) + (set! (-> a1-0 danger-type) (the-as uint 0)) + (add-danger (-> this controller traffic) a1-0) + ) + (none) + ) + +(defmethod crimson-guard-method-256 ((this crimson-guard)) + (let ((s5-0 (get-trans this 3)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> this target-pos quad)) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0))) + (vector-normalize! s3-1 409600.0) + (set! (-> this los-status) + (the-as uint (crimson-guard-method-258 this s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) + ) + ) + ) + (zero? (-> this los-status)) + ) + +(defun do-spline ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +(defmethod crimson-guard-method-268 ((this crimson-guard)) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (-> this root)) + (s3-0 (lambda ((arg0 crimson-guard) (arg1 collide-shape) (arg2 vector)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (vector+! s3-0 (-> arg1 trans) arg2) + (closest-point-on-mesh (-> arg0 nav) s4-0 s3-0 (the-as nav-poly #f)) + (cond + ((< 409.6 (vector-vector-distance s3-0 s4-0)) + #f + ) + ((let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> s4-0 quad)) + (set! (-> a1-4 w) (-> arg0 root nav-radius)) + (add-root-sphere-to-hash! (-> arg0 nav) a1-4 #x10046e) + ) + #f + ) + (else + (let ((a1-5 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-5 start-pos quad) (-> arg1 trans quad)) + (vector-! (-> a1-5 move-dist) s4-0 (-> a1-5 start-pos)) + (let ((v1-10 a1-5)) + (set! (-> v1-10 radius) 2048.0) + (set! (-> v1-10 collide-with) (-> arg1 root-prim prim-core collide-with)) + (set! (-> v1-10 ignore-process0) arg0) + (set! (-> v1-10 ignore-process1) #f) + (set! (-> v1-10 ignore-pat) (-> arg1 pat-ignore-mask)) + (set! (-> v1-10 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* a1-5) 0.0) + #f + #t + ) + ) + ) + ) + ) + ) + ) + ) + (cond + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) + (go (method-of-object this roll-right)) + ) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) + (go (method-of-object this roll-left)) + ) + (else + (go-hostile this) + ) + ) + ) + ) + +(defmethod crimson-guard-method-265 ((this crimson-guard) (arg0 float)) + (let* ((s3-0 (handle->process (-> this transport))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s4-0 + (let ((s2-0 (matrix<-transformq! + (new 'stack-no-clear 'matrix) + (the-as transformq (-> (the-as process-focusable s4-0) root trans)) + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 x) (if (zero? (-> this transport-side)) + -8192.0 + 8192.0 + ) + ) + (set! (-> s3-1 y) 12288.0) + (set! (-> s3-1 z) (lerp-scale -16384.0 -49152.0 arg0 0.0 1.0)) + (set! (-> s3-1 w) 1.0) + (quaternion-rotate-local-y! (-> this root quat) (-> (the-as process-focusable s4-0) root quat) 32768.0) + (vector-matrix*! (-> this root trans) s3-1 s2-0) + ) + ) + ) + (let ((f0-5 (fmax 0.0 (fmin 1.0 (* 3.3333333 arg0))))) + (set-vector! (-> this draw color-mult) f0-5 f0-5 f0-5 1.0) + ) + 0 + (none) + ) + +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] +(defmethod crimson-guard-method-266 ((this crimson-guard) (arg0 vector)) + (local-vars + (f0-8 float) + (sv-768 vector) + (sv-784 vector) + (sv-800 nav-control) + (sv-816 nav-poly) + (sv-832 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (f30-0 0.0) + ) + (dotimes (s3-0 2) + (vector-normalize! s4-0 (* 4096.0 (+ 4.0 (* 2.0 (the float s3-0))))) + (dotimes (s2-0 6) + (set! sv-768 (new 'stack-no-clear 'vector)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack 'collide-query)) + ) + (vector-rotate-around-y! sv-768 s4-0 (* 182.04445 (the float (+ (* 23 s2-0) -70)))) + (let ((v1-10 s1-0)) + (let ((a0-6 (-> this root trans))) + (let ((a1-5 sv-768)) + (let ((a2-2 1.0)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a1-5 quad)) + ) + (.lvf vf4 (&-> a0-6 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 (&-> v1-10 quad) vf6) + ) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) + ) + (let ((v1-14 (-> this nav)) + (a0-8 s1-0) + (a1-7 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-7 vertex)) a0-8 (the-as vector (-> v1-14 state mesh bounds))) + (set! (-> a1-7 vertex1 x) (-> v1-14 nearest-y-threshold)) + (set! (-> a1-7 data 20) (the-as uint 2)) + (set! sv-816 (nav-mesh-method-45 (-> v1-14 state mesh) a1-7)) + ) + (when sv-816 + (let* ((v1-18 s4-0) + ; (f0-7 (-> sv-768 x)) + ; (f1-4 (-> sv-768 y)) + ; (f2-2 (-> sv-768 z)) + ; (f3-2 (-> v1-18 x)) + ; (f4-0 (-> v1-18 y)) + ; (f5-0 (-> v1-18 z)) + ) + ;; og:preserve-this vector-dot + ; (.mula.s f0-7 f3-2) + ; (.madda.s f1-4 f4-0) + ; (.madd.s f0-8 f2-2 f5-0) + (set! f0-8 (vector-dot sv-768 v1-18)) + ) + (let ((f28-0 f0-8)) + (new 'stack-no-clear 'vector) + (let ((a1-8 (new 'stack-no-clear 'vector))) + (set! (-> a1-8 quad) (-> s1-0 quad)) + (set! (-> a1-8 w) 8192.0) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-8 32)) + (when (< f30-0 f28-0) + (set! f30-0 f28-0) + (set! sv-784 (new 'stack-no-clear 'vector)) + (let ((a3-3 (new 'stack-no-clear 'vector))) + (set! sv-800 (-> this nav)) + (set! sv-832 sv-784) + (let* ((v1-29 s1-0) + (a0-18 (-> sv-800 state mesh)) + (t9-7 (method-of-object a0-18 project-point-onto-plane-of-poly-local)) + (a2-7 sv-832) + (t0-2 (vector-! (new 'stack-no-clear 'vector) v1-29 (the-as vector (-> sv-800 state mesh bounds)))) + ) + (t9-7 a0-18 sv-816 a2-7 a3-3 t0-2) + ) + ) + (let ((v1-30 sv-832)) + (let ((a0-21 (-> sv-800 state mesh bounds))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-832 quad)) + (.lvf vf5 (&-> a0-21 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-30 quad) vf6) + ) + 0 + (set! (-> s1-0 y) (-> sv-784 y)) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) + ) + (set! (-> arg0 quad) (-> s1-0 quad)) + ) + ) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + ) + +(defmethod go-directed2 ((this crimson-guard)) + (let ((s5-0 (-> this nav state)) + (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (set! (-> s5-0 heading quad) (-> v1-2 quad)) + ) + 0 + (let ((s5-1 (-> this nav state)) + (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (logior! (-> s5-1 flags) (nav-state-flag directional-mode)) + (set! (-> s5-1 travel quad) (-> v1-7 quad)) + ) + 0 + (let ((s5-2 (-> this nav state)) + (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (set! (-> s5-2 velocity quad) (-> v1-12 quad)) + ) + 0 + (crimson-guard-method-261 this) + (set! (-> this move-position quad) (-> this target-pos quad)) + (go-hostile this) + ) + +(defmethod jump-wind-up-anim ((this crimson-guard) (arg0 enemy-jump-info)) + #f + ) + +(defmethod jump-in-air-anim ((this crimson-guard) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this 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 ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) + (set! (-> s4-0 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-0 param 1) (-> arg0 anim-speed)) + (set! (-> s4-0 frame-num) (ja-aframe 0.0 0)) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) + ) + #t + ) + +(defmethod jump-land-anim ((this crimson-guard) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this 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.01)) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) + (set! (-> s4-0 param 0) (ja-aframe 9.0 0)) + (set! (-> s4-0 param 1) (-> arg0 anim-speed)) + (set! (-> s4-0 frame-num) (ja-aframe 4.0 0)) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) + ) + #t + ) + +(defmethod jump-anim-handler ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) + (local-vars (s5-0 symbol)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (not (jump-wind-up-anim this arg1)) + ) + ((= v1-0 1) + (set! s5-0 (ja-done? 0)) + (let ((s4-1 (-> this skel root-channel 0))) + (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-1 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja-blend-eval) + s5-0 + ) + ((= v1-0 2) + (jump-in-air-anim this arg1) + #f + ) + ((= v1-0 3) + (set! s5-0 (ja-done? 0)) + (let ((s4-2 (-> this skel root-channel 0))) + (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-2 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja-blend-eval) + s5-0 + ) + ((= v1-0 4) + (not (jump-land-anim this arg1)) + ) + ((= v1-0 5) + (set! s5-0 (ja-done? 0)) + (let ((s4-3 (-> this skel root-channel 0))) + (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) + (set! (-> s4-3 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja-blend-eval) + s5-0 + ) + (else + #t + ) + ) + ) + ) + +(defmethod init-enemy-collision! ((this crimson-guard)) + (let ((s5-0 (new 'process 'crimson-guard-collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (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 10240.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 hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 6144.0 0.0 6144.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 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 6144.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec civilian)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak civilian enemy hit-by-others-list player-list)) + (set! (-> v1-17 transform-index) 14) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 2048.0 4096.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec civilian)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak civilian enemy hit-by-others-list player-list)) + (set! (-> v1-19 transform-index) 14) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 -12288.0 6144.0) + ) + (set! (-> s5-0 nav-radius) 6144.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod relocate ((this crimson-guard) (offset int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) offset) + ) + (if (nonzero? (-> this l-control)) + (&+! (-> this l-control) offset) + ) + (call-parent-method this offset) + ) + +(defmethod init-enemy! ((this crimson-guard)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode polar-look-at) this 4)) + (set! (-> this state-stack) (new 'process 'boxed-array state 6)) + (set! (-> this state-stack length) 0) + (set! (-> this info) *crimson-guard-global-info*) + (init-enemy-defaults! this *crimson-guard-nav-enemy-info*) + (let ((v1-9 (-> this nav))) + (set! (-> v1-9 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 143360.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this anim-shuffle) 5) + (set! (-> this anim-walk) 5) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 12288.0) + (set! (-> this dist-run-anim) 34078.72) + (set! (-> this anim-run) 6) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-get-up-front) 33) + (set! (-> this anim-get-up-back) 34) + (set! (-> this l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 19) this 0.0)) + (set! (-> this l-control state points-to-draw) 0) + (set! (-> this water-anim) -1) + (set! (-> this minimap) #f) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs city-target-type. +(defun guard-type->city-target-type ((arg0 guard-type)) + (let ((v1-0 arg0)) + (the-as city-target-type (cond + ((= v1-0 (guard-type grenade)) + (the-as city-target-type (city-target-type guard-grenade)) + ) + ((= v1-0 (guard-type rifle)) + (the-as city-target-type (city-target-type guard-rifle)) + ) + ((= v1-0 (guard-type tazer)) + (the-as city-target-type (city-target-type guard-tazer)) + ) + (else + (the-as city-target-type (city-target-type guard-tazer)) + ) + ) + ) + ) + ) + +;; WARN: Function (method 267 crimson-guard) has a return type of none, but the expression builder found a return statement. +(defmethod crimson-guard-method-267 ((this crimson-guard) (arg0 guard-type) (arg1 symbol)) + (if (= arg0 (-> this guard-type)) + (return 0) + ) + (set! (-> this guard-type) arg0) + (set! (-> this settings) (get-unit-settings-by-idx (-> this squad) (the-as int (-> this guard-type)))) + (setup-masks (-> this draw) 0 30) + (case (-> this guard-type) + (((guard-type tazer) (guard-type grenade)) + (setup-masks (-> this draw) 16 0) + (set! (-> this root nav-radius) 8192.0) + ) + (else + (setup-masks (-> this draw) 8 0) + (set! (-> this root nav-radius) 6144.0) + ) + ) + (set! (-> this ammo-count) (crimson-guard-method-286 this)) + (if (and (or (= (-> this guard-type) (guard-type rifle)) (= (-> this guard-type) (guard-type grenade))) + (not (or (= (-> this faction-mode) 1) (logtest? (-> this flags) (citizen-flag in-mission)))) + ) + (set! (-> this ammo-count) (/ (-> this ammo-count) 2)) + ) + (if (-> this attacker-info) + (set! (-> this attacker-info self-type) (the-as int (guard-type->city-target-type (-> this guard-type)))) + ) + (cond + ((and (not arg1) (logtest? (-> this flags) (citizen-flag dark-guard))) + (setup-masks (-> this draw) 5 0) + (set-vector! (-> this root scale) 1.1 1.1 1.1 1.0) + (set-vector! (-> this joint scale) 1.1 1.0 1.1 1.0) + (let* ((a0-24 (-> this neck)) + (t9-7 (method-of-object a0-24 trs-set!)) + (a1-6 #f) + (a2-5 #f) + (a3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a3-0 x) 0.9090909) + (set! (-> a3-0 y) 1.0) + (set! (-> a3-0 z) 0.9090909) + (set! (-> a3-0 w) 1.0) + (t9-7 a0-24 (the-as vector a1-6) (the-as quaternion a2-5) a3-0) + ) + (mode-set! (-> this neck) (joint-mod-mode rotate2)) + (set! (-> this joint parented-scale?) #t) + (set! (-> this neck parented-scale?) #t) + ) + (else + (setup-masks (-> this draw) 3 0) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> this joint scale) 1.0 1.0 1.0 1.0) + (let* ((a0-37 (-> this neck)) + (t9-10 (method-of-object a0-37 trs-set!)) + (a1-9 #f) + (a2-7 #f) + (a3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a3-1 x) 1.0) + (set! (-> a3-1 y) 1.0) + (set! (-> a3-1 z) 1.0) + (set! (-> a3-1 w) 1.0) + (t9-10 a0-37 (the-as vector a1-9) (the-as quaternion a2-7) a3-1) + ) + (mode-set! (-> this neck) (joint-mod-mode reset)) + ) + ) + 0 + (none) + ) + +(defmethod citizen-method-194 ((this crimson-guard)) + (let ((t9-0 (method-of-type citizen citizen-method-194))) + (t9-0 this) + ) + (set! (-> this player-attack-count) 0) + (set! (-> this next-update-target-time) 0) + (set! (-> this pursuit-start-time) 0) + (set! (-> this last-choose-new-enemy-time) 0) + (if (logtest? (-> this flags) (citizen-flag dark-guard)) + (set! (-> this hit-points) (* 2.0 (-> this enemy-info default-hit-points))) + ) + (set! (-> this hit-face) (the-as uint -1)) + (if (not (logtest? (-> this flags) (citizen-flag in-mission))) + (crimson-guard-method-267 this (the-as guard-type (ff-squad-control-method-54 (-> this squad) 6)) #f) + (crimson-guard-method-267 this (guard-type tazer) #f) + ) + (let ((v1-15 (-> this nav))) + (set! (-> v1-15 sphere-mask) (the-as uint #x1000de)) + ) + 0 + (set! (-> this last-fire-time) 0) + (set! (-> this total-flee-time) 0) + (set! (-> this num-times-reloading-interrupted) 0) + (set! (-> this joint-enable) #f) + (set! (-> this urgent-fire) #f) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask guard)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) + (set! (-> this fact pickup-spawn-amount) 0.0) + (let* ((v1-25 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-26 (the-as number (logior #x3f800000 v1-25))) + (f0-6 (+ -1.0 (the-as float v1-26))) + ) + (cond + ((< f0-6 0.1) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + ) + ((< f0-6 0.2) + (set! (-> this fact pickup-amount) 10.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + ) + ) + ) + (set! (-> this fact fade-time) (seconds 10)) + (set! (-> this target-status handle) (the-as handle #f)) + (let ((v1-44 (rnd-int this 2))) + (cond + ((zero? v1-44) + (set! (-> this anim-shoot 0 anim-index) 19) + (set! (-> this anim-shoot 0 start) 1.0) + (set! (-> this anim-shoot 0 end) 12.0) + (set! (-> this anim-shoot 1 anim-index) 26) + (set! (-> this anim-shoot 1 start) 12.0) + (set! (-> this anim-shoot 1 end) 22.0) + (set! (-> this anim-shoot 2 anim-index) 24) + (set! (-> this anim-shoot 2 start) 20.0) + (set! (-> this anim-shoot 2 end) 30.0) + ) + ((= v1-44 1) + (set! (-> this anim-shoot 0 anim-index) 27) + (set! (-> this anim-shoot 0 start) 2.0) + (set! (-> this anim-shoot 0 end) 9.0) + (set! (-> this anim-shoot 1 anim-index) 29) + (set! (-> this anim-shoot 1 start) 18.0) + (set! (-> this anim-shoot 1 end) 26.0) + (set! (-> this anim-shoot 2 anim-index) 30) + (set! (-> this anim-shoot 2 start) 26.0) + (set! (-> this anim-shoot 2 end) 35.0) + ) + ) + ) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (reset-to-collide-spec + (-> this focus) + (collide-spec jak enemy hit-by-others-list player-list bot-targetable jak-vehicle) + ) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 25) (the-as int #f) (the-as vector #t) 0)) + ) + (set! (-> this move-index) -1) + (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.15))) + (ja-channel-set! 0) + 0 + (none) + ) + +(defbehavior orient-towards-code crimson-guard ((arg0 degrees)) + (when (< arg0 (fabs (-> self target-y-angle))) + (ja-channel-push! 1 (seconds 0.1)) + (while (< arg0 (fabs (-> self target-y-angle))) + (let ((f0-1 (-> self target-y-angle)) + (f30-0 24576.0) + ) + (if (< f0-1 0.0) + (set! f30-0 (- f30-0)) + ) + (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (set! f0-1 (- f0-1)) + ) + (cond + ((< f0-1 0.0) + (ja-no-eval :group! crimson-guard-stab-shuffle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* f30-0 (seconds-per-frame))) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! crimson-guard-stab-shuffle-ja :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* f30-0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + #f + ) + ) + +(defmethod crimson-guard-method-269 ((this crimson-guard) (arg0 process-focusable)) + (let ((f0-0 (if (and (zero? (-> this ammo-count)) (-> this urgent-fire)) + 32768.0 + 16384.0 + ) + ) + ) + (and (< (-> this target-self-xz-dist) f0-0) + (< (fabs (-> this target-y-angle)) 7281.778) + (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) + (logtest? (-> this flags) (citizen-flag target-in-sight)) + (or (zero? (-> this ammo-count)) (not (-> this urgent-fire))) + ) + ) + ) + +(defmethod crimson-guard-method-270 ((this crimson-guard)) + (when (and (not (logtest? (-> this flags) (citizen-flag in-formation))) + (not (logtest? (-> this flags) (citizen-flag in-mission))) + ) + (when (and (not (logtest? (-> this draw status) (draw-control-status on-screen))) + (let ((a1-0 (-> this clock)) + (a0-3 (-> this traffic-id)) + ) + (not (logtest? (logxor a0-3 (-> a1-0 integral-frame-counter)) 15)) + ) + (not (logtest? (-> this flags) (citizen-flag sticky-weapon))) + ) + (let ((a1-3 (ff-squad-control-method-55 + (-> this squad) + (the-as int (-> this guard-type)) + (the-as int (-> this faction-mode)) + ) + ) + ) + (when (!= a1-3 (-> this guard-type)) + (crimson-guard-method-267 this (the-as guard-type a1-3) #f) + (return #t) + ) + ) + ) + ) + #f + ) + +(defmethod send-attack-to-all-tshapes ((this crimson-guard) (arg0 process-focusable) (arg1 event-message-block)) + (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) + (when s4-0 + (let ((s3-0 (-> s4-0 head))) + (while s3-0 + (get-touched-prim s3-0 (-> arg0 root) s4-0) + (when (logtest? (-> (get-touched-prim s3-0 (-> this root) s4-0) prim-core action) (collide-action deadly)) + (let* ((a0-3 this) + (t9-2 (method-of-object a0-3 send-attack)) + (a1-3 arg0) + (a2-3 s4-0) + (v1-10 *game-info*) + (a3-1 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a3-1) + (if (t9-2 a0-3 a1-3 a2-3 a3-1) + (return 0) + ) + ) + ) + (set! s3-0 (-> s3-0 next)) + ) + ) + ) + ) + 0 + ) + +(defmethod get-incoming-attack! ((this crimson-guard) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + (call-parent-method this arg0 arg1 arg2 arg3 arg4) + 0 + (none) + ) + +(defmethod get-penetrated-by ((this crimson-guard)) + (let ((gp-0 4160)) + (if (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'get-up-front) (= v1-3 'get-up-back)) + ) + ) + (set! gp-0 0) + ) + (logior (logclear + (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (the int (-> this hit-points))) + gp-0 + ) + (penetrate vehicle) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod go-inactive ((this crimson-guard)) + (call-parent-method this) + (set! (-> this guard-riot-shield) (the-as handle #f)) + (none) + ) + +(defmethod normalize-heading! ((this crimson-guard) (arg0 nav-control)) + (let ((t9-0 (method-of-object this citizen-method-214)) + (v1-1 arg0) + (a3-0 (-> arg0 state)) + (a2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (t9-0 this v1-1 a2-0) + ) + 0 + (none) + ) + +(defmethod enemy-method-50 ((this crimson-guard) (arg0 int)) + 0 + (none) + ) + +(defmethod crimson-guard-method-288 ((this crimson-guard) (arg0 process-focusable)) + (crimson-guard-method-287 this arg0) + ) + +(defmethod crimson-guard-method-287 ((this crimson-guard) (arg0 process-focusable)) + (cond + ((logtest? (process-mask guard) (-> arg0 mask)) + -1.0 + ) + ((logtest? (process-mask metalhead) (-> arg0 mask)) + 0.5 + ) + ((= (-> arg0 type) target) + -0.01 + ) + ((logtest? (process-mask civilian) (-> arg0 mask)) + -1.0 + ) + ((logtest? (process-mask kg-robot) (-> arg0 mask)) + (case (-> arg0 stack 968) + ((8) + (case (-> this guard-type) + (((guard-type grenade)) + 0.4 + ) + (((guard-type rifle)) + 0.6 + ) + (else + 0.5 + ) + ) + ) + ((6) + (case (-> this guard-type) + (((guard-type grenade)) + 0.6 + ) + (else + 0.5 + ) + ) + ) + (else + 0.5 + ) + ) + ) + ((and (logtest? (process-mask vehicle) (-> arg0 mask)) (not (logtest? (process-mask enemy) (-> arg0 mask)))) + -1.0 + ) + (else + -1.0 + ) + ) + ) + +(defmethod enemy-method-69 ((this crimson-guard)) + 0 + (none) + ) + +(defbehavior go-active-if-necessary crimson-guard () + (when (not (handle->process (-> self target-status handle))) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (go-virtual active) + ) + ) + +(defmethod citizen-method-215 ((this crimson-guard)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this (the-as int (guard-type->city-target-type (-> this guard-type)))) + ) + ) + (none) + ) + +(defmethod damage-enemy! ((this crimson-guard) (arg0 object) (arg1 event-message-block)) + (when (-> *setting-control* user-current gun-target-guards?) + (let ((v1-4 (handle->process (-> this incoming attacker-handle)))) + (when v1-4 + (when (= (-> v1-4 type) target) + (when (time-elapsed? (-> this last-player-attack-time) (seconds 0.5)) + (+! (-> this player-attack-count) 1) + (set-time! (-> this last-player-attack-time)) + ) + (when (or (< 1 (-> this player-attack-count)) + (not (logtest? (-> this incoming penetrate-using) (penetrate board))) + (logtest? (-> this incoming penetrate-using) (penetrate spin)) + ) + (if (logtest? (-> this flags) (citizen-flag in-formation)) + (send-event (handle->process (-> this vehicle)) 'member-attacked) + (send-event this 'member-attacked) + ) + ) + ) + ) + ) + ) + (call-parent-method this arg0 arg1) + ) + +(defmethod crimson-guard-method-272 ((this crimson-guard)) + #f + ) + +(defmethod crimson-guard-method-271 ((this crimson-guard)) + #f + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc b/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc index 010c78fd31..c5a7e37a84 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc @@ -7,3 +7,1047 @@ ;; DECOMP BEGINS +(defskelgroup skel-mh-flitter city-flitter city-flitter-lod0-jg -1 + ((city-flitter-lod0-mg (meters 20)) (city-flitter-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + :shadow city-flitter-shadow-mg + :origin-joint-index 3 + ) + +(deftype metalhead-flitter (mh-squad-member) + ((move-angle float) + (heading symbol) + (change-dir-time time-frame) + (last-change-dir time-frame) + (off-screen-timer time-frame) + (amb-sound-timer time-frame) + (attack-time time-frame) + (target-pos vector :inline) + (attack-pos vector :inline) + (base-height float) + ) + (:state-methods + attack + ambush-jumping + ) + (:methods + (metalhead-flitter-method-224 (_type_) none) + (metalhead-flitter-method-225 (_type_) none) + (metalhead-flitter-method-226 (_type_ process-focusable) symbol) + (metalhead-flitter-method-227 (_type_ symbol) none) + (metalhead-flitter-method-228 (_type_) float) + ) + ) + + +(define *fact-info-mh-flitter-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 4) + ) + +(define *metalhead-flitter-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 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 3 + :param1 6 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim 8 + :hit-anim 4 + :knocked-anim 14 + :knocked-land-anim 15 + :die-anim 13 + :die-falling-anim 12 + :victory-anim 4 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint -1 + :look-at-joint 28 + :bullseye-joint 3 + :sound-hit (static-sound-name "mh-flitter-hit") + :sound-die (static-sound-name "mh-flitter-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 6) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 1 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 275251.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 28 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 696.32 :z 1843.2 :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 7 + :turn-anim 9 + :run-anim 8 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 120) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 5) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 5) + :frustration-distance (meters 12) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *metalhead-flitter-nav-enemy-info* fact-defaults) *fact-info-mh-flitter-defaults*) + +(defmethod metalhead-flitter-method-226 ((this metalhead-flitter) (arg0 process-focusable)) + (and (logtest? (-> this draw status) (draw-control-status on-screen)) + (let ((s4-0 (camera-matrix))) + (camera-pos) + (let* ((s3-0 (get-trans arg0 0)) + (s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 fvec) 1.0)) + (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s3-0) 1.0)) + ) + (< 0.0 (vector-dot s5-1 v1-7)) + ) + ) + ) + ) + +(defmethod knocked-anim ((this metalhead-flitter) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) + ) + #t + ) + (((knocked-type blue-shot)) + (let ((v1-17 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-17 (= v1-17 (-> this draw art-group data 15))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 17))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 17)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) 1.0) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 17)) num-func-seek!) + ) + #t + ) + (else + ((method-of-type nav-enemy knocked-anim) this arg0) + ) + ) + ) + +(defmethod knocked-land-anim ((this metalhead-flitter) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> v1-4 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> v1-4 param 1) 1.0) + (set! (-> v1-4 frame-num) 0.0) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + #t + ) + ) + (else + ((method-of-type mh-squad-member knocked-land-anim) this arg0) + ) + ) + ) + +(defmethod go-stare2 ((this metalhead-flitter)) + (if (and (= (-> this focus aware) (enemy-aware ea2)) (not (nav-enemy-method-174 this))) + (go (method-of-object this pacing)) + (go (method-of-object this stare)) + ) + ) + +(defstate ambush (metalhead-flitter) + :virtual #t + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (set! (-> self base-height) (-> self root trans y)) + (let ((v1-13 (-> self root root-prim))) + (set! (-> v1-13 prim-core collide-as) (collide-spec)) + (set! (-> v1-13 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((a0-4 (the-as process-focusable (handle->process (-> self focus handle))))) + (when a0-4 + (let* ((gp-1 (-> self root)) + (s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-1 trans)) 1.0)) + (f0-1 (deg-diff (quaternion-y-angle (-> gp-1 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-1 quat) (-> gp-1 quat) f0-1) + ) + ) + ) + ) + :code (behavior () + (case (-> self level name) + (('ruins) + (cond + ((logtest? (-> *part-group-id-table* 255 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 255)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 255)) + ) + ) + ) + (('strip) + (cond + ((logtest? (-> *part-group-id-table* 256 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 256)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 256)) + ) + ) + ) + ) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 0.6)) + (suspend) + ) + ) + (+! (-> self root trans y) -8192.0) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) + (suspend) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (go-virtual ambush-jumping) + ) + ) + +(defstate ambush-jumping (metalhead-flitter) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (set-look-at-mode! self 1) + (set-time! (-> self state-time)) + (let ((gp-0 (-> self root))) + (vector-reset! (-> gp-0 transv)) + (set! (-> gp-0 transv y) (* 4096.0 (rnd-float-range self 34.0 38.0))) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!)) + (until #f + (when (< (-> self base-height) (-> self root trans y)) + (cond + ((logtest? (-> *part-group-id-table* 257 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 257)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 257)) + ) + ) + (goto cfg-14) + ) + (suspend) + (ja :num! (seek!)) + ) + #f + (until #f + (when (< (+ 204.8 (-> self base-height)) (-> self root trans y)) + (let ((v1-64 (-> self root root-prim))) + (set! (-> v1-64 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-64 prim-core collide-with) (-> self root backup-collide-with)) + ) + (goto cfg-15) + ) + (label cfg-14) + (suspend) + (ja :num! (seek!)) + ) + #f + (until #f + (label cfg-15) + (if (or (and (>= 0.0 (-> self root transv y)) (>= (+ 1638.4 (-> self base-height)) (-> self root trans y))) + (logtest? (-> self root status) (collide-status on-ground)) + ) + (goto cfg-30) + ) + (suspend) + (if (not (ja-done? 0)) + (ja :num! (seek!)) + ) + ) + #f + (label cfg-30) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (if (logtest? (-> self root status) (collide-status on-ground)) + (goto cfg-37) + ) + (suspend) + ) + #f + (label cfg-37) + (go-virtual hostile) + ) + :post nav-enemy-falling-post + ) + +(defmethod enemy-method-108 ((this metalhead-flitter) (arg0 process-focusable)) + (focus-test? arg0 mech) + ) + +(defmethod metalhead-flitter-method-224 ((this metalhead-flitter)) + (let* ((s5-0 (handle->process (-> this focus handle))) + (s3-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when s3-0 + (let* ((s5-1 (get-trans s3-0 0)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this root trans))) + (f30-0 (vector-length s4-1)) + ) + (cond + ((enemy-method-108 this s3-0) + (go-flee this) + ) + ((and (< f30-0 32768.0) (not (metalhead-flitter-method-226 this s3-0))) + (go (method-of-object this circling)) + ) + ((and (< f30-0 (-> this enemy-info notice-nav-radius)) (time-elapsed? (-> this state-time) (seconds 0.2))) + (set! (-> this target-pos quad) (-> s5-1 quad)) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> s4-1 quad)) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> this root transv quad)) + (vector-normalize! s5-2 f30-0) + (if (>= (vector-dot s3-1 s5-2) 0.98) + (go (method-of-object this attack)) + ) + ) + ) + ) + ((< f30-0 32768.0) + (set! (-> this target-pos quad) (-> s5-1 quad)) + ) + ((or (time-elapsed? (-> this last-change-dir) (-> this change-dir-time)) + (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) + ) + (set-time! (-> this last-change-dir)) + (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (if (-> this heading) + (set-vector! s3-2 (-> s4-1 z) (-> s4-1 y) (- (-> s4-1 x)) 1.0) + (set-vector! s3-2 (- (-> s4-1 z)) (-> s4-1 y) (-> s4-1 x) 1.0) + ) + (set! (-> this heading) (not (-> this heading))) + (let ((f28-1 (rand-vu-float-range (* 0.75 f0-9) f0-9)) + (s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 (* -0.6 f30-0))) + ) + (vector-normalize! s3-2 f28-1) + (vector+! s3-2 s3-2 s4-2) + ) + (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) + (vector+! s2-0 s5-1 s3-2) + (set! (-> this target-pos quad) (-> s2-0 quad)) + ) + ) + ) + ) + 0 + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch time-frame vs none. +(defmethod metalhead-flitter-method-225 ((this metalhead-flitter)) + (when (time-elapsed? (-> this amb-sound-timer) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) + (sound-play "flitter-amb" :position (-> this root trans)) + (set-time! (-> this amb-sound-timer)) + ) + (none) + ) + +(defbehavior metalhead-flitter-fall-and-play-death-anim metalhead-flitter ((arg0 int) (arg1 float) (arg2 time-frame)) + (local-vars (v1-29 symbol)) + (stop-look-at! self) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim arg0)) + (let ((s4-1 (get-knockback-dir! self (new 'stack-no-clear 'vector))) + (s3-0 (-> self root)) + ) + (when (if (type? s3-0 collide-shape-moving) + s3-0 + ) + (set! (-> self root transv y) 33775.48) + (ja :num-func num-func-identity :frame-num 0.0) + (set-time! (-> self state-time)) + (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) + (until v1-29 + (let ((f0-2 102400.0)) + (set! (-> self root transv x) (* (-> s4-1 x) f0-2)) + (set! (-> self root transv z) (* (-> s4-1 z) f0-2)) + ) + (suspend) + (ja :num! (seek! max arg1)) + (set! v1-29 (or (ja-done? 0) (time-elapsed? (-> self state-time) arg2))) + ) + ) + ) + 0 + (none) + ) + +(defstate active (metalhead-flitter) + :virtual #t + :post (behavior () + (metalhead-flitter-method-225 self) + (let ((t9-1 (-> (method-of-type mh-squad-member active) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +(defstate stare (metalhead-flitter) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (until #f + (when (not (enemy-method-105 self 2730.6667 #t)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 9)) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75)) + ) + (let ((v1-25 self)) + (set! (-> v1-25 enemy-flags) (the-as enemy-flag (logclear (-> v1-25 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-29 (ja-group))) + (if (not (and v1-29 (= v1-29 (-> self draw art-group data (-> self enemy-info idle-anim))))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (metalhead-flitter-method-225 self) + (let ((t9-1 (-> (method-of-type mh-squad-member stare) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +(defstate hostile (metalhead-flitter) + :virtual #t + :enter (behavior () + (set-time! (-> self last-change-dir)) + (set! (-> self change-dir-time) 0) + (set! (-> self attack-time) (+ (current-time) (seconds 0.35))) + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (metalhead-flitter-method-224 self) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self target-pos)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate die (metalhead-flitter) + :virtual #t + :enter (behavior () + (sound-play "flitter-die") + (let ((t9-2 (-> (method-of-type mh-squad-member die) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (metalhead-flitter-fall-and-play-death-anim + (the-as int (-> self draw art-group data (-> self enemy-info die-anim))) + 1.0 + (seconds 2) + ) + (send-event self 'death-end) + (cleanup-for-death self) + ) + ) + +(defmethod metalhead-flitter-method-228 ((this metalhead-flitter)) + (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) + ) + +(defstate attack (metalhead-flitter) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (set! (-> self amb-sound-timer) 0) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-7 *game-info*) + (a0-13 (+ (-> v1-7 attack-id) 1)) + ) + (set! (-> v1-7 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (metalhead-flitter-method-227 self #t) + ) + :exit (behavior () + (metalhead-flitter-method-227 self #f) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (local-vars (s5-2 object)) + (let* ((s5-0 (handle->process (-> self focus handle))) + (gp-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (set! s5-2 (cond + ((and gp-0 + (not (time-elapsed? (-> self state-time) (seconds 1.5))) + gp-0 + (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((s5-1 (-> self nav state)) + (v1-10 (get-trans gp-0 0)) + ) + (logclear! (-> s5-1 flags) (nav-state-flag directional-mode)) + (logior! (-> s5-1 flags) (nav-state-flag target-poly-dirty)) + (set! (-> s5-1 target-pos quad) (-> v1-10 quad)) + ) + 0 + (set! s5-2 (-> self attack-pos)) + (set! (-> (the-as vector s5-2) quad) (-> (get-trans gp-0 3) quad)) + s5-2 + ) + (else + (go-stare self) + ) + ) + ) + ) + ) + :code (behavior () + (sound-play "flitter-attack") + (ja-channel-push! 2 (seconds 0.1)) + (let ((f30-0 (metalhead-flitter-method-228 self))) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! max 0.8) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! (-> self draw art-group data 11) + :num! (chan 0) + :frame-interp0 f30-0 + :frame-interp1 f30-0 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (set! f30-0 (seek f30-0 (metalhead-flitter-method-228 self) (* 0.2 (seconds-per-frame)))) + (ja :num! (seek! max 0.8)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + ) + ) + (let ((v1-41 self)) + (set! (-> v1-41 enemy-flags) (the-as enemy-flag (logclear (-> v1-41 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-41 nav callback-info) *null-nav-callback-info*) + ) + 0 + (ja-channel-push! 1 (seconds 0.1)) + (metalhead-flitter-method-227 self #f) + (logclear! (-> self focus-status) (focus-status dangerous)) + (dotimes (gp-2 (rnd-int self 3)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-best-state self) + ) + :post nav-enemy-travel-post + ) + +(defstate victory (metalhead-flitter) + :virtual #t + :post (behavior () + (metalhead-flitter-method-225 self) + (nav-enemy-simple-post) + ) + ) + +(defstate stare (metalhead-flitter) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (until #f + (when (not (enemy-method-105 self 2730.6667 #t)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 9)) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75)) + ) + (let ((v1-25 self)) + (set! (-> v1-25 enemy-flags) (the-as enemy-flag (logclear (-> v1-25 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-29 (ja-group))) + (if (not (and v1-29 (= v1-29 (-> self draw art-group data (-> self enemy-info idle-anim))))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (metalhead-flitter-method-225 self) + (let ((t9-1 (-> (method-of-type nav-enemy stare) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +(defstate circling (metalhead-flitter) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy circling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-time! (-> self off-screen-timer)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (the-as process-focusable gp-0) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (let ((v1-11 (-> self focus aware))) + (cond + ((= v1-11 (enemy-aware ea3)) + (cond + ((when gp-0 + (let* ((gp-1 self) + (s5-1 (method-of-object gp-1 metalhead-flitter-method-226)) + (s4-0 (handle->process (-> self focus handle))) + ) + (s5-1 gp-1 (the-as process-focusable (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + ) + ) + (if (and (get-focus! self) (time-elapsed? (-> self off-screen-timer) (seconds 0.3))) + (go-hostile self) + ) + ) + (else + (set-time! (-> self off-screen-timer)) + ) + ) + ) + ((= v1-11 (enemy-aware ea2)) + (go-stare self) + ) + ((>= 1 (the-as int v1-11)) + (go-virtual active) + ) + ) + ) + (if (or (nav-enemy-method-174 self) (logtest? (enemy-flag ef42) (-> self enemy-flags))) + (go-stare2 self) + ) + ) + ) + ) + :code (behavior () + (nav-enemy-method-177 self) + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info run-anim)) + :num! (seek! max (rnd-float-range self 0.9 1.1)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (rnd-float-range self 0.9 1.1))) + ) + ) + #f + ) + ) + +(defmethod metalhead-flitter-method-227 ((this metalhead-flitter) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) + (if arg0 + (logior! (-> a2-1 prim-core action) (collide-action deadly)) + (logclear! (-> a2-1 prim-core action) (collide-action deadly)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod init-enemy-collision! ((this metalhead-flitter)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 10240.0 0.0 15360.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-12 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> v1-12 local-sphere) 0.0 5734.4 0.0 5734.4) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot crate civilian hit-by-others-list player-list)) + (set! (-> v1-14 prim-core action) (collide-action deadly)) + (set! (-> v1-14 transform-index) 34) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 3481.6) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot crate civilian hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action deadly)) + (set! (-> v1-16 transform-index) 35) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 3481.6) + ) + (set! (-> s5-0 nav-radius) 3686.4) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this metalhead-flitter)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-flitter" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *metalhead-flitter-nav-enemy-info*) + (set! (-> this move-angle) 10922.667) + (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) + #t + #f + ) + ) + (set! (-> this change-dir-time) 0) + (set! (-> this off-screen-timer) 0) + (set! (-> this amb-sound-timer) 0) + (set-gravity-length (-> this root dynam) 491520.0) + (set! (-> this minimap) #f) + (set! (-> this water-anim) 8) + (none) + ) + +(defmethod citizen-method-194 ((this metalhead-flitter)) + (let ((t9-0 (method-of-type mh-squad-member citizen-method-194))) + (t9-0 this) + ) + (add-connection + *part-engine* + this + 28 + this + 468 + (new 'static 'vector :x 942.08 :y -860.16 :z 1269.76 :w 163840.0) + ) + (add-connection + *part-engine* + this + 28 + this + 468 + (new 'static 'vector :x -942.08 :y -860.16 :z 1269.76 :w 163840.0) + ) + (set! (-> this speed-walk) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-walk-anim) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-run-anim) (-> this enemy-info run-travel-speed)) + 0 + (none) + ) + +(defmethod citizen-method-215 ((this metalhead-flitter)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 7) + ) + ) + (none) + ) + +(defstate in-ditch (metalhead-flitter) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + +(defstate die-fast (metalhead-flitter) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/metalhead-grunt.gc b/goal_src/jak3/levels/city/traffic/citizen/metalhead-grunt.gc index cb1b5b73bf..0d74ce0131 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/metalhead-grunt.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/metalhead-grunt.gc @@ -5,5 +5,1559 @@ ;; name in dgo: metalhead-grunt ;; dgos: CTYPESB +;; +++mh-grunt-flag +(defenum mh-grunt-flag + :type uint8 + :bitfield #t + (mg0 0) + (mg1 1) + (mg2 2) + ) +;; ---mh-grunt-flag + + ;; DECOMP BEGINS +(defskelgroup skel-mh-grunt city-grunt city-grunt-lod0-jg -1 + ((city-grunt-lod0-mg (meters 20)) (city-grunt-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow city-grunt-shadow-mg + :origin-joint-index 16 + ) + +(deftype mh-grunt-anim-info (structure) + ((anim-index int32) + (travel-speed meters) + ) + :pack-me + ) + + +(deftype mh-grunt-global-info (basic) + ((patrol-anim mh-grunt-anim-info 2 :inline) + (charge-anim mh-grunt-anim-info 1 :inline) + (attack-anim mh-grunt-anim-info 1 :inline) + ) + ) + + +(define *fact-info-mh-grunt-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 43) + ) + +(define *metalhead-grunt-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 6 + :hostile-anim -1 + :hit-anim -1 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim -1 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim 10 + :jump-in-air-anim 11 + :jump-land-anim 12 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 16 + :sound-hit (static-sound-name "mh-grunt-hit") + :sound-die (static-sound-name "mh-grunt-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.5) + :ragdoll-rotate-velocity-mult 0.5 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 51609.6 + :knocked-soft-vxz-hi 87654.4 + :knocked-soft-vy-lo 49152.0 + :knocked-soft-vy-hi 73728.0 + :knocked-medium-vxz-lo 73728.0 + :knocked-medium-vxz-hi 98304.0 + :knocked-medium-vy-lo 65536.0 + :knocked-medium-vy-hi 73728.0 + :knocked-hard-vxz-lo 41779.2 + :knocked-hard-vxz-hi 60620.8 + :knocked-hard-vy-lo 93388.8 + :knocked-hard-vy-hi 103219.2 + :knocked-huge-vxz-lo 82739.2 + :knocked-huge-vxz-hi 126156.8 + :knocked-huge-vy-lo 101580.8 + :knocked-huge-vy-hi 111411.2 + :knocked-yellow-vxz-lo 20480.0 + :knocked-yellow-vxz-hi 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 12288.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 49152.0 + :knocked-red-vy-hi 73728.0 + :knocked-blue-vxz-lo 20480.0 + :knocked-blue-vxz-hi 24576.0 + :knocked-blue-vy-lo 12288.0 + :knocked-blue-vy-hi 40960.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 1.0 :w 10625.897) + :scale (new 'static 'vector :x 0.6399 :y 0.6399 :z 0.6399) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0 :w 1170.3455) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 2268.7744 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 4000.9365) + :geo-tform (new 'static 'vector :x 1.0 :w 12817.95) + :axial-slop 2169.078 + :max-angle 2296.8184 + :coll-rad 2867.2 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10540.374) + :geo-tform (new 'static 'vector :x -1.0 :w 12551.108) + :axial-slop 2169.078 + :max-angle 2226.3489 + :coll-rad 2209.3823 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 13046.233) + :geo-tform (new 'static 'vector :x 1.0 :w 18078.088) + :axial-slop 2169.078 + :max-angle 3210.7178 + :coll-rad 1644.544 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4178 :z -0.9083 :w 11487.004) + :geo-tform (new 'static 'vector :x -0.5907 :y -0.4565 :z 0.665 :w 25388.248) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1641.6768 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1565 :z -0.9875 :w 12747.589) + :geo-tform (new 'static 'vector :x -0.0123 :y 0.7268 :z 0.6864 :w 28823.824) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1295.1552 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z 0.3463 :w 15464.585) + :geo-tform (new 'static 'vector :x 0.0404 :y 0.9991 :z 0.0016 :w 26660.428) + :axial-slop 2169.078 + :max-angle 2671.921 + :coll-rad 1899.3152 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z 0.346 :w 14.381512) + :geo-tform (new 'static 'vector :x 0.5827 :y 0.8005 :z 0.1389 :w 27752.074) + :axial-slop 2169.078 + :max-angle 2077.3455 + :coll-rad 1787.904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.418 :z 0.9082 :w 11484.565) + :geo-tform (new 'static 'vector :x 0.5908 :y -0.4564 :z 0.665 :w 40148.812) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1563.8528 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1563 :z 0.9875 :w 12751.085) + :geo-tform (new 'static 'vector :x 0.0122 :y 0.7266 :z 0.6866 :w 36713.688) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z -0.3461 :w 15469.664) + :geo-tform (new 'static 'vector :x -0.0404 :y 0.9991 :z 0.0015 :w 38877.887) + :axial-slop 2169.078 + :max-angle 2330.5876 + :coll-rad 1610.1376 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9377 :z -0.3468 :w 16.074524) + :geo-tform (new 'static 'vector :x -0.2371 :y 0.2169 :z -0.9468 :w 20556.623) + :axial-slop 2169.078 + :max-angle 1879.882 + :coll-rad 1629.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 42847.234) + :geo-tform (new 'static 'vector :x -1.0 :w 16468.232) + :axial-slop 2169.078 + :max-angle 2508.973 + :coll-rad 1812.0704 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 3567.2522) + :geo-tform (new 'static 'vector :x 1.0 :w 42973.14) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1858.3552 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2349 :z -0.9718 :w 18020.252) + :geo-tform (new 'static 'vector :x 0.3808 :y 0.3151 :z 0.8691 :w 29486.395) + :axial-slop 2169.078 + :max-angle 3698.87 + :coll-rad 877.3632 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9998 :z 0.0086 :w 4412.9214) + :geo-tform (new 'static 'vector :x 0.3995 :y -0.4805 :z 0.7804 :w 25729.781) + :axial-slop 2169.078 + :max-angle 3691.5154 + :coll-rad 1524.9408 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7835 :z 0.621 :w 14960.958) + :geo-tform (new 'static 'vector :x 0.2887 :y 0.6587 :z 0.6945 :w 40555.97) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7644 :z -0.6445 :w 17272.176) + :geo-tform (new 'static 'vector :x 0.5513 :y 0.3614 :z 0.7516 :w 33063.24) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9734 :z 0.2283 :w 7149.304) + :geo-tform (new 'static 'vector :x -0.7224 :y -0.6901 :z -0.0373 :w 15253.522) + :axial-slop 2169.078 + :max-angle 1294.1176 + :coll-rad 659.456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 43 + :parent-joint 20 + :pre-tform (new 'static 'vector :x 0.4934 :z 0.8696 :w 6514.1875) + :geo-tform (new 'static 'vector :x -0.0332 :y 0.8825 :z 0.4687 :w 37613.457) + :axial-slop 2169.078 + :max-angle 1411.5544 + :coll-rad 605.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -1.0 :w 9863.842) + :geo-tform (new 'static 'vector :x -1.0 :w 12698.965) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1488.0768 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -1.0 :w 1462.5452) + :geo-tform (new 'static 'vector :x 0.9995 :y -0.0161 :z -0.0185 :w 7921.737) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1285.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9958 :z -0.09 :w 1956.7229) + :geo-tform (new 'static 'vector :x 0.9998 :y 0.0041 :z 0.0071 :w 33050.805) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1801.8304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6114.891) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0127 :z 0.0043 :w 8018.73) + :axial-slop 2169.078 + :max-angle 2497.213 + :coll-rad 794.2144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6305.8555) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0172 :z 0.0018 :w 6908.7324) + :axial-slop 2169.078 + :max-angle 1846.1127 + :coll-rad 556.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 44 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6830.7266) + :geo-tform (new 'static 'vector :x 0.9993 :y -0.0365 :z -0.006 :w 3790.2383) + :axial-slop 2169.078 + :max-angle 1491.563 + :coll-rad 542.3104 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.2352 :z 0.9718 :w 18022.729) + :geo-tform (new 'static 'vector :x -0.3537 :y 0.3542 :z 0.8654 :w 34566.508) + :axial-slop 2169.078 + :max-angle 3739.2292 + :coll-rad 1540.096 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8967 :z -0.4423 :w 5274.7744) + :geo-tform (new 'static 'vector :x -0.0105 :y 0.862 :z -0.5065 :w 24694.367) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8194 :z -0.573 :w 13110.112) + :geo-tform (new 'static 'vector :x -0.2576 :y 0.7211 :z 0.6428 :w 24504.475) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1751.4496 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8027 :z 0.596 :w 15135.011) + :geo-tform (new 'static 'vector :x -0.5895 :y 0.2007 :z 0.7821 :w 36329.734) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 45 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8262 :z 0.5632 :w 7707.525) + :geo-tform (new 'static 'vector :x -0.6943 :y 0.7184 :z -0.0381 :w 14762.858) + :axial-slop 2169.078 + :max-angle 2015.6871 + :coll-rad 573.0304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 46 + :parent-joint 29 + :pre-tform (new 'static 'vector :x 0.9975 :z -0.0684 :w 3277.692) + :geo-tform (new 'static 'vector :x -0.2795 :y 0.7979 :z 0.5336 :w 35258.77) + :axial-slop 2169.078 + :max-angle 1851.9927 + :coll-rad 468.992 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5769 :z -0.8166 :w 8297.695) + :geo-tform (new 'static 'vector :x -0.6954 :y -0.0651 :z 0.7153 :w 9511.8955) + :axial-slop 2169.078 + :max-angle 2863.5044 + :coll-rad 1868.5952 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5774 :z 0.8162 :w 8293.489) + :geo-tform (new 'static 'vector :x 0.948 :y -0.2986 :z 0.1083 :w 34953.68) + :axial-slop 2169.078 + :max-angle 2569.885 + :coll-rad 1893.9904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.3449 :z -0.9384 :w 16372.404) + :geo-tform (new 'static 'vector :x 0.088 :y -0.8342 :z 0.5442 :w 20057.604) + :axial-slop 2169.078 + :max-angle 3185.0312 + :coll-rad 1327.9232 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6081 :z 0.7936 :w 10429.526) + :geo-tform (new 'static 'vector :x 0.213 :y -0.975 :z -0.061 :w 19499.654) + :axial-slop 2169.078 + :max-angle 2031.8344 + :coll-rad 423.1168 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.9512 :z -0.3084 :w 2006.2573) + :geo-tform (new 'static 'vector :x -0.0464 :y 0.9956 :z 0.0799 :w 26746.152) + :axial-slop 2169.078 + :max-angle 2505.2957 + :coll-rad 533.7088 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7105 :z 0.7034 :w 3017.6597) + :geo-tform (new 'static 'vector :x 0.0381 :y 0.9847 :z -0.1692 :w 26846.422) + :axial-slop 2169.078 + :max-angle 2064.8572 + :coll-rad 408.3712 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.9371 :z 0.3486 :w 15668.893) + :geo-tform (new 'static 'vector :x -0.2897 :y 0.1004 :z 0.9516 :w 31568.328) + :axial-slop 2169.078 + :max-angle 2784.2424 + :coll-rad 1593.7535 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.3452 :z 0.9383 :w 16373.424) + :geo-tform (new 'static 'vector :x 0.1347 :y 0.823 :z -0.5515 :w 19233.342) + :axial-slop 2169.078 + :max-angle 2773.2288 + :coll-rad 1373.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4593 :z -0.888 :w 10428.289) + :geo-tform (new 'static 'vector :x 0.1971 :y 0.977 :z 0.079 :w 17810.5) + :axial-slop 2169.078 + :max-angle 1984.8488 + :coll-rad 616.448 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.9998 :z -0.0063 :w 3668.4868) + :geo-tform (new 'static 'vector :x 0.0529 :y 0.9969 :z 0.056 :w 38759.062) + :axial-slop 2169.078 + :max-angle 1981.1897 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7207 :z -0.6929 :w 3011.8708) + :geo-tform (new 'static 'vector :x -0.0298 :y 0.9808 :z -0.1918 :w 38536.098) + :axial-slop 2169.078 + :max-angle 2276.2654 + :coll-rad 534.528 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint 12 + :pre-tform (new 'static 'vector :x 0.9375 :z -0.3477 :w 15673.973) + :geo-tform (new 'static 'vector :x 0.2894 :y 0.1005 :z 0.9517 :w 33957.168) + :axial-slop 2169.078 + :max-angle 2685.1372 + :coll-rad 1853.0304 + ) + ) + ) + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 6 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 614.4 :z -3276.8 :r 327680.0) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim -1 + :run-anim 7 + :taunt-anim 4 + :run-travel-speed (meters 7) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *metalhead-grunt-nav-enemy-info* fact-defaults) *fact-info-mh-grunt-defaults*) + +(deftype metalhead-grunt (mh-squad-member) + ((patrol-anim mh-grunt-anim-info) + (charge-anim mh-grunt-anim-info) + (attack-anim mh-grunt-anim-info) + (intro-path path-control) + (use-charge-anim-index int8 :offset 1100) + (jumping-ambush-path-pt int8) + (mh-grunt-flags mh-grunt-flag) + (state-timeout2 time-frame) + (next-warn-time time-frame) + (dest vector :inline) + (pad uint8 16) + ) + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) + (:methods + (metalhead-grunt-method-228 (_type_ float) process-focusable) + (get-nav-info (_type_) nav-enemy-info) + (metalhead-grunt-method-230 (_type_ symbol) object) + ) + ) + + +(define *mh-grunt-global-info* (new 'static 'mh-grunt-global-info + :patrol-anim (new 'static 'inline-array mh-grunt-anim-info 2 + (new 'static 'mh-grunt-anim-info :anim-index 5 :travel-speed (meters 7)) + (new 'static 'mh-grunt-anim-info :anim-index 7 :travel-speed (meters 7)) + ) + :charge-anim (new 'static 'inline-array mh-grunt-anim-info 1 + (new 'static 'mh-grunt-anim-info :anim-index 7 :travel-speed (meters 7)) + ) + :attack-anim (new 'static 'inline-array mh-grunt-anim-info 1 + (new 'static 'mh-grunt-anim-info :anim-index 8 :travel-speed (meters 12)) + ) + ) + ) + +(defmethod event-handler ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((= (-> this hit-points) 0.0) + (let ((s5-1 (-> this incoming knocked-type))) + (cond + ((and (= s5-1 (knocked-type yellow-shot)) + (not (and (-> this next-state) (let ((v1-31 (-> this next-state name))) + (or (= v1-31 'knocked) (= v1-31 'jump) (= v1-31 'jump-land)) + ) + ) + ) + (zero? (rnd-int this 3)) + (let ((f0-2 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (f1-2 32768.0) + ) + (>= f0-2 (* f1-2 f1-2)) + ) + ) + (go-die this) + ) + ((or (= s5-1 (knocked-type yellow-shot)) (= s5-1 (knocked-type blue-shot))) + (set! (-> this incoming knocked-type) (knocked-type none)) + (go (method-of-object this knocked)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + ) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (else + ((method-of-type mh-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod go-ambush-delay ((this metalhead-grunt)) + (cond + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) + ) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) + ) + (else + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) + ) + ) + ) + +(defstate falling-ambush (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let* ((gp-1 *target*) + (a0-4 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (when a0-4 + (let* ((gp-2 (-> self root)) + (s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-2 trans)) 1.0)) + (f0-0 (deg-diff (quaternion-y-angle (-> gp-2 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-2 quat) (-> gp-2 quat) f0-0) + ) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let* ((v1-17 *game-info*) + (v0-9 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) v0-9) + (set! (-> self attack-id) v0-9) + ) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek!) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sound-play "grunt-notice") + (go-virtual hostile) + ) + :post nav-enemy-falling-post + ) + +(defmethod go-directed2 ((this metalhead-grunt)) + (case (-> this jump-why) + ((2) + (go (method-of-object this jumping-ambush-cont)) + ) + (else + ((method-of-type mh-squad-member go-directed2) this) + ) + ) + ) + +(defstate jumping-ambush (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy ambush) enter)) + (when (zero? (-> self intro-path)) + (format 0 "ERROR: ~A has no intro path, skipping jumping-ambush~%" (-> self name)) + (go-virtual notice) + ) + (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) + ) + :code (behavior () + (set! (-> self jumping-ambush-path-pt) 1) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 1.0 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-1 from) v1-5) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate jumping-ambush-cont (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((a0-0 (-> self intro-path)) + (v1-1 (+ (-> self jumping-ambush-path-pt) 1)) + ) + (if (< v1-1 (-> a0-0 curve num-cverts)) + (set! (-> self jumping-ambush-path-pt) v1-1) + (go-best-state self) + ) + ) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 (the float (-> self jumping-ambush-path-pt)) 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-9 (process->ppointer self))) + (set! (-> a1-1 from) v1-9) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate active (metalhead-grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (or (and v1-2 (= v1-2 (-> self draw art-group data 7))) + (let ((v1-8 (ja-group))) + (and v1-8 (or (= v1-8 (-> self draw art-group data 5)) (= v1-8 (-> self draw art-group data 7)))) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (set! (-> self patrol-anim) (-> *mh-grunt-global-info* patrol-anim (rnd-int self 2))) + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + ) + (let ((v1-37 (ja-group))) + (if (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (when (nonzero? (-> self patrol-anim anim-index)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (set! (-> self patrol-anim) (the-as mh-grunt-anim-info (-> *mh-grunt-global-info* patrol-anim))) + (let ((v1-67 (-> self nav))) + (set! (-> v1-67 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + ) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (dotimes (s4-1 s5-1) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (zero? (rnd-int self 3)) + (let ((v1-107 self)) + (set! (-> v1-107 enemy-flags) (the-as enemy-flag (logclear (-> v1-107 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-107 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-171 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-171 enemy-flags))) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-171 enemy-flags)))) + ) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-171 enemy-flags)))) + (set! (-> v1-171 nav callback-info) (-> v1-171 enemy-info callback-info)) + ) + 0 + ) + ) + ) + #f + ) + ) + +(defmethod metalhead-grunt-method-228 ((this metalhead-grunt) (arg0 float)) + (local-vars (v1-5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (get-focus! this))) + (when gp-0 + (let ((v1-3 (get-trans gp-0 0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s4-0 v1-3 (-> this root trans)) + (.lvf vf1 (&-> s4-0 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-5 vf1) + (let* ((f30-0 v1-5) + (f0-0 arg0) + (f28-0 (* f0-0 f0-0)) + (f0-2 12288.0) + ) + (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) + (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) + (f1-0 1228.8) + ) + (cond + ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) + (go (method-of-object this attack)) + ) + ((let ((f0-10 12288.0)) + (< f30-0 (* f0-10 f0-10)) + ) + (go (method-of-object this spin-attack)) + ) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + ) + +(defstate hostile (metalhead-grunt) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (metalhead-grunt-method-228 self 13312.0)) + (gp-0 (current-time)) + ) + (when (and (>= gp-0 (-> self next-warn-time)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + (when (and a0-1 (let ((f0-0 65536.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans a0-1 0) (-> self root trans))) + ) + ) + (sound-play "grunt-warn") + (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + ) + ) + ) + ) + :code (behavior () + (let ((f30-0 1.0)) + (until #f + (metalhead-grunt-method-228 self 22528.0) + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-9 (ja-group))) + (when (not (and v1-9 (= v1-9 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((v1-13 (-> self nav))) + (set! (-> v1-13 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-chase-post + ) + +(defstate attack (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self nav state))) + (set! (-> v1-1 speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-10 *game-info*) + (a0-5 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a0-5) + (set! (-> self attack-id) a0-5) + ) + (metalhead-grunt-method-230 self #t) + ) + :exit (behavior () + (metalhead-grunt-method-230 self #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (reset-penetrate! self) + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *mh-grunt-global-info* attack-anim (rnd-int self 1))) + (let ((v1-5 (-> self nav))) + (set! (-> v1-5 target-speed) (-> self attack-anim travel-speed)) + ) + 0 + (let ((v1-7 (-> self nav))) + (set! (-> v1-7 turning-acceleration) 49152.0) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-17 (ja-group))) + (if (not (and v1-17 (= v1-17 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self charge-anim anim-index)))) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe 3.0 0)) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (let ((v1-57 0)) + (let ((a0-22 (the-as object (-> *mh-grunt-global-info* charge-anim))) + (a1-7 (-> self charge-anim)) + ) + (dotimes (a2-3 1) + (when (= (the-as mh-grunt-anim-info a0-22) a1-7) + (set! v1-57 a2-3) + (goto cfg-21) + ) + (set! a0-22 (&+ (the-as mh-grunt-anim-info a0-22) 8)) + ) + ) + (label cfg-21) + (set! (-> self use-charge-anim-index) v1-57) + ) + (go-virtual hostile) + ) + :post nav-enemy-chase-post + ) + +(defstate spin-attack (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (if (not gp-0) + (go-stare self) + ) + (set! (-> self focus-pos quad) (-> (get-trans gp-0 0) quad)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-21 *game-info*) + (a0-13 (+ (-> v1-21 attack-id) 1)) + ) + (set! (-> v1-21 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (metalhead-grunt-method-230 self #t) + ) + :exit (behavior () + (metalhead-grunt-method-230 self #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *mh-grunt-global-info* attack-anim (rnd-int self 1))) + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-13 (ja-group))) + (if (not (and v1-13 (= v1-13 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a0-9 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-9 + (set! (-> self focus-pos quad) (-> (get-trans a0-9 0) quad)) + ) + ) + (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (go-virtual hostile) + ) + :post nav-enemy-simple-post + ) + +(defstate stop-chase (metalhead-grunt) + :virtual #t + :code (behavior () + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self patrol-anim) (-> *mh-grunt-global-info* patrol-anim (rnd-int self 2))) + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-24 (ja-group))) + (if (not (and v1-24 (= v1-24 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defstate wait-for-focus (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (-> (method-of-type nav-enemy idle) enter) + :trans (behavior () + (let ((s5-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when s5-0 + (let ((gp-0 (get-trans s5-0 0))) + (when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))) + (>= 163840.0 (vector-vector-distance (-> self root trans) gp-0)) + ) + (or (not (logtest? (-> self fact enemy-options) (enemy-option user8))) + (and (not (focus-test? s5-0 in-air)) (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root trans y))))) + ) + ) + (cond + ((and (logtest? (-> self fact enemy-options) (enemy-option user9)) + (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector-! s5-1 gp-0 (-> self root trans)) + (let ((f0-2 32768.0) + (v1-26 s5-1) + ) + (if (or (>= f0-2 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) + (>= 20024.889 (fabs (deg- (y-angle (-> self root)) (atan (-> s5-1 x) (-> s5-1 z))))) + ) + (go-virtual notice) + ) + ) + ) + ) + (else + (go-virtual notice) + ) + ) + ) + ) + ) + ) + ) + :code (-> (method-of-type nav-enemy idle) code) + :post (-> (method-of-type nav-enemy idle) post) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod metalhead-grunt-method-230 ((this metalhead-grunt) (arg0 symbol)) + 0 + ) + +;; WARN: Return type mismatch mh-squad-member vs metalhead-grunt. +(defmethod relocate ((this metalhead-grunt) (offset int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) offset) + ) + (the-as metalhead-grunt ((method-of-type mh-squad-member relocate) this offset)) + ) + +(defmethod init-enemy-collision! ((this metalhead-grunt)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 6144.0 0.0 17408.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 9830.4 0.0 4915.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action semi-solid)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 4915.2) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid)) + (set! (-> v1-19 transform-index) 16) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 2252.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 14) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set! (-> v1-23 transform-index) 10) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-25 prim-core action) (collide-action semi-solid)) + (set! (-> v1-25 transform-index) 6) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-27 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-27 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-27 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod get-nav-info ((this metalhead-grunt)) + *metalhead-grunt-nav-enemy-info* + ) + +(defmethod citizen-method-194 ((this metalhead-grunt)) + (let ((t9-0 (method-of-type mh-squad-member citizen-method-194))) + (t9-0 this) + ) + (add-connection + *part-engine* + this + 6 + this + 468 + (new 'static 'vector :x 1433.6 :y 2785.28 :z -1761.28 :w 163840.0) + ) + (add-connection + *part-engine* + this + 6 + this + 468 + (new 'static 'vector :x -1433.6 :y 2785.28 :z -1761.28 :w 163840.0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this metalhead-grunt)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-grunt" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this (get-nav-info this)) + (let ((v1-6 (-> this neck))) + (set! (-> v1-6 up) (the-as uint 1)) + (set! (-> v1-6 nose) (the-as uint 2)) + (set! (-> v1-6 ear) (the-as uint 0)) + (set-vector! (-> v1-6 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-6 ignore-angle) 30947.555) + ) + (let ((v1-8 (-> this nav))) + (set! (-> v1-8 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (let ((s5-2 *mh-grunt-global-info*)) + (set! (-> this patrol-anim) (-> s5-2 patrol-anim (rnd-int this 2))) + (set! (-> this charge-anim) (-> s5-2 charge-anim (rnd-int this 1))) + (set! (-> this attack-anim) (-> s5-2 attack-anim (rnd-int this 1))) + ) + (set! (-> this use-charge-anim-index) -1) + (if (zero? (rnd-int this 2)) + (logior! (-> this mh-grunt-flags) (mh-grunt-flag mg0)) + ) + (if (zero? (rnd-int this 2)) + (logior! (-> this mh-grunt-flags) (mh-grunt-flag mg2)) + ) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) + (set! (-> this water-anim) -1) + (set! (-> this minimap) #f) + (set! (-> this water-anim) 7) + 0 + (none) + ) + +(defstate knocked-recover (metalhead-grunt) + :virtual #t + :code (behavior () + (ja-channel-push! 1 0) + (let ((gp-0 (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll))) + (when gp-0 + (let ((a0-5 (-> gp-0 ragdoll-joints))) + (if (< 0.0 (vector-dot (-> self node-list data (-> a0-5 0 joint-index) bone transform fvec) *y-vector*)) + (ja-no-eval :group! (-> self draw art-group data 13) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! (-> self draw art-group data 14) :num! (seek!) :frame-num 0.0) + ) + ) + (enable-ragdoll! gp-0 self) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +(defmethod citizen-method-215 ((this metalhead-grunt)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 6) + ) + ) + (none) + ) + +(defstate in-ditch (metalhead-grunt) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + +(defstate die-fast (metalhead-grunt) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc b/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc index d423961013..fd4916bd9c 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc @@ -7,3 +7,1184 @@ ;; DECOMP BEGINS +(deftype metalhead-predator-shot (metalhead-shot) + () + ) + + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this metalhead-predator-shot) (arg0 projectile-options)) + (case arg0 + (((projectile-options po0)) + (sound-play "pred-shot-hit") + ) + (((projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-8 (static-sound-spec "pred-shot-loop" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-8 volume) 1024) + (set! (-> a0-8 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-8 (-> this sound-id) (-> this root trans)) + ) + ) + ) + (none) + ) + +(defmethod setup-collision! ((this metalhead-predator-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate jak-yellow-shot)) + (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 projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (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 projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec jak bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +(defmethod init-proj-settings! ((this metalhead-predator-shot)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'predator-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.767)) + (set! (-> this sound-id) (new-sound-id)) + (set-gravity-length (-> this root dynam) 573440.0) + (none) + ) + +(defskelgroup skel-metalhead-predator predator predator-lod0-jg predator-idle-ja + ((predator-lod0-mg (meters 20)) (predator-lod1-mg (meters 40)) (predator-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 4) + ) + +(define *metalhead-predator-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 5 + :hostile-anim -1 + :hit-anim 5 + :knocked-anim 12 + :knocked-land-anim 13 + :die-anim 11 + :die-falling-anim 11 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 7 + :look-at-joint 8 + :bullseye-joint 6 + :sound-hit (static-sound-name "metalhead-preda") + :sound-die (static-sound-name "metalhead-preda") + :notice-distance-delta (meters 0.1) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 81920.0 + :knocked-soft-vxz-hi 81920.0 + :knocked-soft-vy-lo 69632.0 + :knocked-soft-vy-hi 69632.0 + :knocked-medium-vxz-lo 81920.0 + :knocked-medium-vxz-hi 81920.0 + :knocked-medium-vy-lo 69632.0 + :knocked-medium-vy-hi 69632.0 + :knocked-hard-vxz-lo 81920.0 + :knocked-hard-vxz-hi 81920.0 + :knocked-hard-vy-lo 69632.0 + :knocked-hard-vy-hi 69632.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 40960.0 + :knocked-yellow-vxz-hi 53248.0 + :knocked-yellow-vy-lo 40960.0 + :knocked-yellow-vy-hi 53248.0 + :knocked-red-vxz-lo 102400.0 + :knocked-red-vxz-hi 102400.0 + :knocked-red-vy-lo 81920.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 32768.0 + :knocked-blue-vy-hi 49152.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 6 + :turn-anim 5 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 3) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *metalhead-predator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(deftype metalhead-predator (mh-squad-member) + ((los los-control :inline) + (want-stop symbol) + (target-pos vector :inline) + (curr-node int32) + (hide-pos vector :inline) + (next-change time-frame) + (shoot-angle float) + (miss-amount float) + (ambient-sound-id sound-id) + (shock-effect-time time-frame) + (shock-effect-end time-frame) + (fade float) + (dest-fade float) + ) + (:state-methods + fire + close-attack + ) + (:methods + (toggle-collide-deadly (_type_ symbol) none) + (metalhead-predator-method-225 (_type_ int float) none) + (metalhead-predator-method-226 (_type_ vector vector vector) symbol) + (metalhead-predator-method-227 (_type_) none) + ) + ) + + +(set! (-> *lightning-spec-id-table* 42) (new 'static 'lightning-spec + :name "lightning-metalhead-predator-shock-skel" + :flags (lightning-spec-flags lsf0) + :rand-func #x2 + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.5 + :num-points 32 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "predator-zap" :group 0) + ) + ) + +(defmethod metalhead-predator-method-227 ((this metalhead-predator)) + (cond + ((< (-> this hit-points) 2.0) + (when (!= (-> this dest-fade) 128.0) + (sound-play "pred-uncloak") + (set! (-> this sound) (the-as ambient-sound 0)) + 0 + ) + (set! (-> this dest-fade) 128.0) + ) + (else + (set! (-> this dest-fade) 0.0) + ) + ) + (seek! (-> this fade) (-> this dest-fade) (* 60.0 (seconds-per-frame))) + (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) + (cond + ((zero? (-> this draw force-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + ) + ((= (-> this draw force-fade) 128) + (setup-masks (-> this draw) 0 8) + (setup-masks (-> this draw) 4 0) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + ) + (else + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 4 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + ) + ) + (if (< 245760.0 (vector-vector-distance (-> this root trans) (camera-pos))) + (setup-masks (-> this draw) 0 8) + ) + (when (< (current-time) (-> this shock-effect-end)) + (when (time-elapsed? (-> this shock-effect-time) (seconds 0.04)) + (set-time! (-> this shock-effect-time)) + (process-drawable-shock-skel-effect + this + (-> *lightning-spec-id-table* 42) + lightning-probe-callback + (-> *part-id-table* 160) + 2048.0 + -1 + -1 + ) + ) + ) + 0 + (none) + ) + +(defmethod enemy-common-post ((this metalhead-predator)) + (when (< 1 (the-as int (-> this focus aware))) + (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) + (when s5-0 + (set! (-> this focus-pos quad) (-> (get-trans s5-0 5) quad)) + (los-control-method-9 (-> this los) s5-0 (-> this focus-pos) 819.2 4096.0) + ) + ) + ) + (let ((t9-2 (method-of-type mh-squad-member enemy-common-post))) + (t9-2 this) + ) + (metalhead-predator-method-227 this) + (none) + ) + +;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (set! (-> this shock-effect-end) (+ (current-time) (seconds 1))) + ((method-of-type mh-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + (('combo) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (!= (-> this hit-points) 0.0)) + ) + ) + (else + ((method-of-type mh-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod knocked-anim ((this metalhead-predator) (arg0 enemy-knocked-info)) + (cond + ((= (-> this hit-points) 0.0) + (case (-> this incoming knocked-type) + (((knocked-type red-shot)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) + ) + ) + ) + #t + ) + (else + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let ((v1-31 (rnd-int this 2))) + (cond + ((zero? v1-31) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) + ) + ) + ((= v1-31 1) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) + (set! (-> a0-12 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) + ) + (set! (-> a0-12 param 1) (-> arg0 anim-speed)) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) + ) + ) + ) + ) + ) + (((knocked-type red-shot)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> a0-15 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> a0-15 param 1) (-> arg0 anim-speed)) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-17 (-> this skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) + (set! (-> a0-17 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) + ) + (set! (-> a0-17 param 1) (-> arg0 anim-speed)) + (set! (-> a0-17 frame-num) 0.0) + (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) + ) + ) + ) + #t + ) + ) + ) + +(defmethod knocked-land-anim ((this metalhead-predator) (arg0 enemy-knocked-info)) + (cond + ((= (-> this hit-points) 0.0) + (case (-> this incoming knocked-type) + (((knocked-type red-shot)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) + ) + ) + ) + #t + ) + (else + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) + (set! (-> a0-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-8 param 1) (-> arg0 anim-speed)) + (set! (-> a0-8 frame-num) 0.0) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) + ) + ) + (((knocked-type red-shot)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) + ) + (set! (-> a0-11 param 1) (-> arg0 anim-speed)) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) + (set! (-> a0-13 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) + ) + (set! (-> a0-13 param 1) (-> arg0 anim-speed)) + (set! (-> a0-13 frame-num) 0.0) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) + ) + ) + ) + #t + ) + ) + ) + +(defmethod get-inv-mass ((this metalhead-predator)) + 0.5 + ) + +(defmethod metalhead-predator-method-226 ((this metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((f0-0 1228.8) + (f30-0 6144.0) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> s5-0 move-dist) arg1 arg0) + (let ((v1-4 s5-0)) + (set! (-> v1-4 radius) f0-0) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (cond + ((>= f0-1 0.0) + (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) f0-1) + (cond + ((< (vector-dot + (-> s5-0 best-other-tri normal) + (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri))) + ) + 0.0 + ) + ) + (else + ) + ) + ) + (else + (vector-! (-> s5-0 move-dist) arg1 arg0) + ) + ) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (let ((v1-14 s5-0)) + (set! (-> v1-14 radius) f30-0) + (set! (-> v1-14 collide-with) (collide-spec enemy hit-by-player-list hit-by-others-list)) + (set! (-> v1-14 ignore-process0) this) + (set! (-> v1-14 ignore-process1) (handle->process (-> this focus handle))) + (set! (-> v1-14 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-14 action-mask) (collide-action solid)) + ) + ) + (cond + ((< (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) + #t + ) + (else + (let ((s4-1 (-> s5-0 best-other-tri collide-ptr))) + (if (and (if (type? s4-1 collide-shape-prim) + s4-1 + ) + (< (vector-dot + (-> s5-0 best-other-tri normal) + (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri))) + ) + 0.0 + ) + ) + #f + ) + ) + ) + ) + ) + ) + +(defmethod metalhead-predator-method-225 ((this metalhead-predator) (arg0 int) (arg1 float)) + (local-vars (sv-272 vector) (sv-288 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((a1-1 (-> this node-list data arg0)) + (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (set! (-> s5-0 ent) (-> this entity)) + (set! (-> s5-0 charge) 1.0) + (set! (-> s5-0 options) (projectile-options)) + (logclear! (-> s5-0 options) (projectile-options po14 po15 po16)) + (set! (-> s5-0 notify-handle) (process->handle this)) + (set! (-> s5-0 owner-handle) (the-as handle #f)) + (set! (-> s5-0 target-handle) (the-as handle #f)) + (set! (-> s5-0 target-pos quad) (the-as uint128 0)) + (set! (-> s5-0 ignore-handle) (process->handle this)) + (let* ((v1-13 *game-info*) + (a0-12 (+ (-> v1-13 attack-id) 1)) + ) + (set! (-> v1-13 attack-id) a0-12) + (set! (-> s5-0 attack-id) a0-12) + ) + (set! (-> s5-0 timeout) (seconds 4)) + (vector<-cspace! (-> s5-0 pos) a1-1) + (let ((s3-0 (the-as process-focusable (handle->process (-> this focus handle)))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (when s3-0 + (seek! (-> this miss-amount) (* 0.2 (vector-length (-> s3-0 root transv))) 4096.0) + (set! (-> s2-0 quad) (-> (get-trans s3-0 3) quad)) + (set! sv-272 (new 'stack-no-clear 'vector)) + (let ((v1-28 (-> s5-0 pos)) + (a0-19 s2-0) + ) + (.lvf vf4 (&-> v1-28 quad)) + (.lvf vf5 (&-> a0-19 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-272 quad) vf6) + (let* ((f0-5 (vector-length sv-272)) + (f0-6 (* 0.0000018780048 f0-5)) + ) + (set! sv-288 (new 'stack-no-clear 'vector)) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (let ((a0-20 s2-0)) + (let ((v1-34 s2-0)) + (let ((a1-6 (-> s3-0 root transv))) + (let ((a2-2 f0-6)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a1-6 quad)) + ) + (.lvf vf4 (&-> v1-34 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 (&-> a0-20 quad) vf6) + ) + (vector-normalize! sv-272 1.0) + (vector-flatten! sv-288 *up-vector* sv-272) + (vector-normalize! sv-288 1.0) + (vector-cross! s0-0 sv-272 sv-288) + (vector-normalize! s0-0 1.0) + (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-272 (-> this shoot-angle)))) + (vector-orient-by-quat! sv-288 sv-288 a2-5) + ) + (let* ((t9-9 quaternion-vector-angle!) + (a0-28 (new 'stack-no-clear 'quaternion)) + (a2-6 (-> this shoot-angle)) + (a2-7 (t9-9 a0-28 sv-272 a2-6)) + ) + (vector-orient-by-quat! s0-0 s0-0 a2-7) + ) + (let ((a0-30 s1-1)) + (let ((v1-36 s2-0)) + (let ((a1-17 (-> this miss-amount))) + (.mov vf7 a1-17) + ) + (.lvf vf5 (&-> sv-288 quad)) + (.lvf vf4 (&-> v1-36 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 (&-> a0-30 quad) vf6) + ) + (let ((v1-37 s2-0)) + (let ((a0-31 (* arg1 (-> this miss-amount)))) + (.mov vf7 a0-31) + ) + (.lvf vf5 (&-> s0-0 quad)) + (.lvf vf4 (&-> s1-1 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 (&-> v1-37 quad) vf6) + ) + ) + ) + (vector-! (-> s5-0 vel) s2-0 (-> s5-0 pos)) + (vector-normalize! (-> s5-0 vel) 409600.0) + (when (metalhead-predator-method-226 + this + (-> s5-0 pos) + (vector+! (new 'stack-no-clear 'vector) (-> s5-0 pos) (-> s5-0 vel)) + (get-trans s3-0 3) + ) + (vector-normalize! (-> s5-0 vel) 532480.0) + (spawn-projectile metalhead-predator-shot s5-0 this *default-dead-pool*) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defstate active (metalhead-predator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member active) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member active) trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +(defstate hostile (metalhead-predator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self want-stop) #f) + (set-time! (-> self state-time)) + (set! (-> self next-change) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 4.0 8.0))))) + (if (zero? (rnd-int self 3)) + (sound-play "pred-talk") + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (if (and gp-0 (or (focus-test? gp-0 inactive) (focus-test? gp-0 disable))) + (set! gp-0 (the-as process-focusable #f)) + ) + (when (not gp-0) + (set! (-> self current-enemy) (the-as handle #f)) + (go-virtual active) + ) + (when (get-focus! self) + (when (and gp-0 (time-elapsed? (-> self state-time) (-> self reaction-time))) + (cond + ((< (vector-vector-xz-distance (get-trans gp-0 0) (-> self root trans)) 16384.0) + (go-virtual close-attack) + ) + ((should-check-los? (-> self los) 0) + (go-virtual fire) + ) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 6.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +(defstate fire (metalhead-predator) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-2 *game-info*) + (a0-1 (+ (-> v1-2 attack-id) 1)) + ) + (set! (-> v1-2 attack-id) a0-1) + (set! (-> self attack-id) a0-1) + ) + (set-traffic-danger self) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :exit (behavior () + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (let ((v1-2 (the-as process-focusable (handle->process (-> self focus handle))))) + (if (and v1-2 (or (focus-test? v1-2 inactive) (focus-test? v1-2 disable))) + (set! v1-2 (the-as process-focusable #f)) + ) + (when (not v1-2) + (set! (-> self current-enemy) (the-as handle #f)) + (go-virtual active) + ) + ) + ) + :code (behavior () + (label cfg-0) + 1.0 + (let ((gp-0 0)) + (set! (-> self shoot-angle) (* 182.04445 (rand-vu-float-range -45.0 45.0))) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (< 9.0 (ja-frame-num 0)) (zero? gp-0)) + (set! gp-0 1) + (metalhead-predator-method-225 self 12 1.0) + ) + (when (and (< 11.0 (ja-frame-num 0)) (= gp-0 1)) + (set! gp-0 2) + (metalhead-predator-method-225 self 16 -1.0) + ) + (let ((s5-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when s5-0 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans s5-0 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + (if (< (vector-vector-distance (-> self root trans) (get-trans s5-0 0)) 24576.0) + (go-virtual close-attack) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (b! #t cfg-26 :delay (nop!)) + (b! (not #f) cfg-0 :delay (empty-form)) + (label cfg-26) + (go-hostile self) + ) + :post enemy-simple-post + ) + +(defstate close-attack (metalhead-predator) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-traffic-danger self) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-9 *game-info*) + (a0-5 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a0-5) + (set! (-> self attack-id) a0-5) + ) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 target-speed) 4096.0) + ) + 0 + ) + :exit (behavior () + (toggle-collide-deadly self #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-0 #f)) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (< 4.0 (ja-frame-num 0)) (not gp-0)) + (toggle-collide-deadly self #t) + (set! gp-0 #t) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-32 (-> self nav state))) + (set! (-> v1-32 speed) 0.0) + ) + 0 + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (zero? (rnd-int self 3)) + (sound-play "pred-talk") + ) + (go-hostile self) + ) + :post nav-enemy-chase-post + ) + +(defmethod toggle-collide-deadly ((this metalhead-predator) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (+ (-> (the-as collide-shape-prim-group v1-1) num-children) -2))) + (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child (+ a0-1 2)))) + (if arg0 + (logior! (-> a2-1 prim-core action) (collide-action deadly)) + (logclear! (-> a2-1 prim-core action) (collide-action deadly)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod init-enemy-collision! ((this metalhead-predator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (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 11264.0 0.0 17203.2) + (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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak civilian hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 5120.0 0.0 5120.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 enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd jak civilian 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 9216.0 0.0 5120.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-17 transform-index) 7) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-19 transform-index) 16) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 3276.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-21 transform-index) 12) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 3276.8) + ) + (set! (-> s5-0 nav-radius) 6144.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! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod relocate ((this metalhead-predator) (offset int)) + (call-parent-method this offset) + ) + +(defmethod init-enemy! ((this metalhead-predator)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-metalhead-predator" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *metalhead-predator-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (set! (-> this draw lod-set lod 1 dist) 573440.0) + (set! (-> this anim-shuffle) 6) + (set! (-> this anim-walk) 6) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 16179.2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) + (set! (-> this speed-run) 49152.0) + (set! (-> this water-anim) 7) + (init-los! + (-> this los) + this + (seconds 0.1) + 327680.0 + (collide-spec backgnd obstacle hit-by-others-list los-blocker) + ) + (set! (-> this minimap) #f) + 0 + (none) + ) + +(defmethod citizen-method-194 ((this metalhead-predator)) + (let ((t9-0 (method-of-type mh-squad-member citizen-method-194))) + (t9-0 this) + ) + (add-connection *part-engine* this 8 this 468 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) + (add-connection + *part-engine* + this + 8 + this + 468 + (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0) + ) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> this draw force-fade) (the-as uint 0)) + (set! (-> this fade) 0.0) + (set! (-> this dest-fade) 0.0) + (set! (-> this curr-node) -1) + (set! (-> this next-change) 0) + (set! (-> this miss-amount) 16384.0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + 0 + (none) + ) + +(defmethod citizen-method-215 ((this metalhead-predator)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 8) + ) + ) + (none) + ) + +(defstate in-ditch (metalhead-predator) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + +(defstate die-fast (metalhead-predator) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/traffic-engine-h.gc b/goal_src/jak3/levels/city/traffic/traffic-engine-h.gc index 4f92eb31b1..3dfa4318c5 100644 --- a/goal_src/jak3/levels/city/traffic/traffic-engine-h.gc +++ b/goal_src/jak3/levels/city/traffic/traffic-engine-h.gc @@ -51,6 +51,22 @@ ;; ---traffic-suppressor-flag +;; +++traffic-type-flag +(defenum traffic-type-flag + :bitfield #t + :type uint8 + (ttf0) + (ttf1) + (ttf2) + (ttf3) + (ttf4) + (ttf5) + (ttf6) + (ttf7) + ) +;; ---traffic-type-flag + + ;; DECOMP BEGINS (deftype nav-segment (structure) @@ -81,8 +97,8 @@ (nav-territories uint32) ) (:methods - (vis-cell-method-9 () none) - (vis-cell-method-10 () none) + (reset-segment-counts (_type_) none) + (debug-draw (_type_) none) ) ) @@ -124,9 +140,9 @@ (cell-size vector :inline) ) (:methods - (grid-info-method-9 () none) - (grid-info-method-10 () none) - (grid-info-method-11 () none) + (setup-grid-from-bounding-box (_type_ (pointer bounding-box) int int) none) + (lookup-cell-for-point (_type_ vis-grid-pos vector) none) + (lookup-box-for-sphere (_type_ vis-grid-box vector) none) (debug-draw-grid (_type_ rgba) none) (debug-draw-cell (_type_ vis-grid-pos rgba) none) ) @@ -144,16 +160,16 @@ (pad-array int8 56) ) (:methods - (city-level-info-method-9 () none) - (city-level-info-method-10 () none) - (city-level-info-method-11 () none) - (city-level-info-method-12 () none) - (city-level-info-method-13 () none) - (city-level-info-method-14 () none) - (city-level-info-method-15 () none) - (city-level-info-method-16 () none) - (city-level-info-method-17 () none) - (city-level-info-method-18 () none) + (city-level-info-method-9 (_type_) object) + (init-vis-ray (_type_ vis-ray vector vector) none) + (city-level-info-method-11 (_type_ vis-ray) none) + (city-level-info-method-12 (_type_ vector nav-branch vector) vector) + (lookup-cell-by-position (_type_ vector) vis-cell) + (get-first-cell-in-box (_type_ vis-grid-box) vis-cell) + (sphere-in-grid? (_type_ vector int) symbol) + (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (update-suppressions-from-traffic-engine (_type_ traffic-engine) none) + (city-level-info-method-18 (_type_) none) ) ) @@ -167,12 +183,12 @@ (active-cell-box bounding-box :inline) ) (:methods - (traffic-level-data-method-9 () none) - (traffic-level-data-method-10 () none) - (traffic-level-data-method-11 () none) - (traffic-level-data-method-12 () none) - (traffic-level-data-method-13 () none) - (traffic-level-data-method-14 () none) + (reset! (_type_) none) + (add-active-cell (_type_ vis-cell) none) + (remove-active-cell (_type_ int) none) + (add-newly-active-cell (_type_ vis-cell) none) + (per-frame-cell-update (_type_) none) + (debug-draw (_type_) none) ) ) @@ -187,7 +203,7 @@ (deftype traffic-object-type-info (structure) - ((flags uint8) + ((flags traffic-type-flag) (active-count int8) (inactive-count int8) (reserve-count uint16) @@ -212,11 +228,11 @@ (array traffic-suppression-box 16 :inline) ) (:methods - (traffic-suppressor-method-9 () none) - (traffic-suppressor-method-10 () none) - (traffic-suppressor-method-11 () none) - (traffic-suppressor-method-12 () none) - (traffic-suppressor-method-13 () none) + (reset-boxes (_type_) none) + (add-new-supression-box (_type_ traffic-suppression-params) none) + (remove-box-by-id (_type_ int) none) + (update-box-from-params (_type_ traffic-suppression-params) none) + (debug-draw (_type_) none) ) ) @@ -232,24 +248,24 @@ (active-object-type-list traffic-type 126) ) (:methods - (traffic-tracker-method-9 () none) - (traffic-tracker-method-10 () none) - (traffic-tracker-method-11 () none) - (traffic-tracker-method-12 () none) - (traffic-tracker-method-13 () none) - (traffic-tracker-method-14 () none) + (traffic-tracker-method-9 (_type_) none) + (traffic-tracker-method-10 (_type_) none) + (traffic-tracker-method-11 (_type_) none) + (add-active-process (_type_ traffic-type handle) none) + (remove-active-process (_type_ int) handle) + (add-reserved-process (_type_ traffic-type handle) none) (get-from-inactive-by-type (_type_ traffic-type) handle) - (traffic-tracker-method-16 () none) - (traffic-tracker-method-17 () none) - (traffic-tracker-method-18 () none) - (traffic-tracker-method-19 () none) - (traffic-tracker-method-20 () none) - (traffic-tracker-method-21 () none) - (traffic-tracker-method-22 () none) - (traffic-tracker-method-23 () none) - (traffic-tracker-method-24 () none) - (traffic-tracker-method-25 () none) - (traffic-tracker-method-26 () none) + (get-from-inactive-by-handle (_type_ traffic-type handle) handle) + (deactivate-object (_type_ int symbol) none) + (set-process-to-killed (_type_ process) none) + (deactivate-all (_type_ symbol) none) + (deactivate-all-of-type (_type_ traffic-type symbol) none) + (activate-from-params (_type_ traffic-object-spawn-params) none) + (activate-by-type (_type_ traffic-type nav-segment float) none) + (activate-by-handle (_type_ traffic-object-spawn-params) none) + (reset (_type_ uint traffic-engine) none) + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) + (for-all-active-processes-of-type (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none) ) ) @@ -268,62 +284,64 @@ (level-data-array traffic-level-data 2 :inline) (object-type-info-array traffic-object-type-info 29 :inline) (tracker-array traffic-tracker 2 :inline) - (inactive-object-array handle 580 :offset 7456) + (tracker0 traffic-tracker :inline :overlay-at (-> tracker-array 0)) + (tracker1 traffic-tracker :inline :offset 6304) + (inactive-object-array handle 580 :offset 7456) (suppressor traffic-suppressor :inline) - (danger-sphere-count int8 :offset 12656) + (danger-sphere-count int8 :offset 12656) (danger-sphere-array traffic-danger-info 4 :inline) - (allow-spawning? symbol :offset 12928) + (allow-spawning? symbol :offset 12928) ) (:methods (new (symbol type) _type_) - (traffic-engine-method-9 () none) + (update-traffic (_type_) none) (reset-and-init-from-manager (_type_ process) none) - (traffic-engine-method-11 () none) - (traffic-engine-method-12 () none) - (traffic-engine-method-13 () none) - (traffic-engine-method-14 () none) - (traffic-engine-method-15 () none) - (traffic-engine-method-16 () none) - (traffic-engine-method-17 () none) - (traffic-engine-method-18 () none) - (traffic-engine-method-19 () none) + (squad-stop-alarm-sound (_type_) none) + (stub (_type_) none) + (add-object (_type_ traffic-type process) none) + (sphere-in-loaded-city-infos? (_type_ vector int) symbol) + (activate-one-citizen (_type_ nav-segment float) none) + (activate-one-vehicle (_type_ nav-segment float) none) + (can-dest-be-used? (_type_ nav-branch) symbol) + (child-killed (_type_ process) none) + (deactivate-all-from-level (_type_ symbol) none) (find-best-segment (_type_ vector vector int) nav-segment) (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) (add-danger (_type_ traffic-danger-info) none) - (traffic-engine-method-23 () none) - (traffic-engine-method-24 () none) - (traffic-engine-method-25 () none) - (traffic-engine-method-26 () none) - (traffic-engine-method-27 () none) - (traffic-engine-method-28 () none) - (traffic-engine-method-29 () none) - (traffic-engine-method-30 () none) - (traffic-engine-method-31 () none) - (traffic-engine-method-32 () none) - (traffic-engine-method-33 () none) - (traffic-engine-method-34 () none) - (traffic-engine-method-35 () none) - (traffic-engine-method-36 () none) - (traffic-engine-method-37 () none) - (traffic-engine-method-38 () none) - (traffic-engine-method-39 () none) - (traffic-engine-method-40 () none) - (traffic-engine-method-41 () none) - (traffic-engine-method-42 () none) - (traffic-engine-method-43 () none) - (traffic-engine-method-44 () none) - (traffic-engine-method-45 () none) - (traffic-engine-method-46 () none) - (traffic-engine-method-47 () none) - (traffic-engine-method-48 () none) - (traffic-engine-method-49 () none) - (traffic-engine-method-50 () none) - (traffic-engine-method-51 () none) - (traffic-engine-method-52 () none) - (traffic-engine-method-53 () none) - (traffic-engine-method-54 () none) - (traffic-engine-method-55 () none) - (traffic-engine-method-56 () none) - (traffic-engine-method-57 () none) + (target-count (_type_ float) none) + (deactivate-all (_type_) none) + (deactivate-by-type (_type_ traffic-type) none) + (restore-default-settings (_type_) none) + (set-object-target-level (_type_ int float) none) + (set-object-target-count (_type_ int int) none) + (set-object-reserve-count (_type_ int uint) none) + (get-object-reserve-count (_type_ int) uint) + (get-object-remaining-count (_type_ int) int) + (activate-object (_type_ traffic-object-spawn-params) none) + (activate-by-handle (_type_ traffic-object-spawn-params) none) + (set-parking-spot-prob (_type_ int float) none) + (get-random-parking-spot-type (_type_) traffic-type) + (new-suppression-box (_type_ traffic-suppression-params) none) + (remove-suppression-box (_type_ traffic-suppression-params) none) + (update-suppression-box (_type_ traffic-suppression-params) none) + (stub1 (_type_) none) + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) + (set-object-auto-activate (_type_ int symbol) none) + (check-proc-in-tracker (_type_ process int) none) + (kill-traffic-sphere (_type_ vector) none) + (level-link (_type_ level) none) + (level-unlink (_type_ level) none) + (add-squad-ctrl (_type_ squad-control) none) + (stub2 (_type_) none) + (stub3 (_type_) none) + (handle-new-vis-cell (_type_ vis-cell) none) + (init-sync-masks (_type_) none) + (stub4 (_type_) none) + (update-traffic-amount (_type_) none) + (update-danger (_type_) none) + (update-danger-from-target (_type_) none) + (stub5 (_type_) none) + (update-suppressor (_type_) none) + (recompute-suppressions (_type_) none) ) ) diff --git a/goal_src/jak3/levels/city/traffic/traffic-engine.gc b/goal_src/jak3/levels/city/traffic/traffic-engine.gc index ac5552aae0..ae8a202efc 100644 --- a/goal_src/jak3/levels/city/traffic/traffic-engine.gc +++ b/goal_src/jak3/levels/city/traffic/traffic-engine.gc @@ -5,5 +5,1817 @@ ;; name in dgo: traffic-engine ;; dgos: DESRESC, WWD, CWI +(deftype traffic-engine-stack-var0 (structure) + ((params traffic-object-spawn-params :inline :offset 0) + (vec0 vector :inline :offset 128) + (vec1 vector :inline :offset 144) + (vec2 vector :inline :offset 160) + (vec3 vector :inline :offset 176) + ) + ) + +(declare-type hvehicle vehicle) + ;; DECOMP BEGINS +(define *traffic-suppress-activation* #f) + +(defun get-level-nav-graph-by-id ((arg0 int)) + (dotimes (v1-0 (-> *level* length)) + (let ((a1-3 (-> *level* level v1-0))) + (when (= (-> a1-3 status) 'active) + (when (and (!= (-> a1-3 bsp city-level-info) 0) (!= (-> a1-3 bsp city-level-info nav-graph) 0)) + (let ((a1-6 (-> a1-3 bsp city-level-info nav-graph))) + (if (and (!= a1-6 0) (= (-> a1-6 id) arg0)) + (return a1-6) + ) + ) + ) + ) + ) + ) + (the-as nav-graph #f) + ) + +(defmethod for-all-active-processes ((this traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) + (let ((s4-0 (-> this traffic))) + (countdown (s3-0 (-> this active-object-count)) + (let ((a1-1 (-> s4-0 object-type-info-array (-> this active-object-type-list s3-0))) + (a0-2 (handle->process (-> this active-object-list s3-0))) + ) + (if (not (focus-test? (the-as process-focusable a0-2) inactive)) + (arg0 (the-as process-focusable a0-2) a1-1) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod for-all-active-processes-of-type ((this traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) + (let ((s3-0 (-> this traffic))) + (countdown (s2-0 (-> this active-object-count)) + (let ((a0-1 (-> this active-object-type-list s2-0))) + (when (= a0-1 arg0) + (let ((a1-1 (-> s3-0 object-type-info-array a0-1)) + (a0-3 (handle->process (-> this active-object-list s2-0))) + ) + (if (not (focus-test? (the-as process-focusable a0-3) inactive)) + (arg1 (the-as process-focusable a0-3) a1-1) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod add-active-process ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) + (let ((v1-0 (-> this active-object-count))) + (when (< v1-0 (the-as uint 126)) + (set! (-> this active-object-list v1-0) arg1) + (set! (-> this active-object-type-list v1-0) arg0) + (+! (-> this active-object-count) 1) + (let ((v1-6 (-> this traffic object-type-info-array arg0))) + (+! (-> v1-6 active-count) 1) + ) + ) + ) + 0 + (none) + ) + +(defmethod remove-active-process ((this traffic-tracker) (arg0 int)) + (let ((v0-0 (-> this active-object-list arg0))) + (let ((v1-3 (-> this active-object-type-list arg0)) + (a2-1 (+ (-> this active-object-count) -1)) + ) + (when (>= a2-1 0) + (set! (-> this active-object-list arg0) (-> this active-object-list a2-1)) + (set! (-> this active-object-type-list arg0) (-> this active-object-type-list a2-1)) + (+! (-> this active-object-count) -1) + (let ((v1-6 (-> this traffic object-type-info-array v1-3))) + (+! (-> v1-6 active-count) -1) + ) + ) + ) + v0-0 + ) + ) + +(defmethod add-reserved-process ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) + (let* ((v1-2 (-> this traffic object-type-info-array arg0)) + (a1-2 (-> v1-2 inactive-count)) + ) + (when (< a1-2 20) + (set! (-> v1-2 array a1-2) arg1) + (+! (-> v1-2 inactive-count) 1) + (+! (-> v1-2 reserve-count) 1) + (+! (-> this inactive-object-count) 1) + ) + ) + 0 + (none) + ) + +(defmethod get-from-inactive-by-type ((this traffic-tracker) (arg0 traffic-type)) + (let ((v1-2 (-> this traffic object-type-info-array arg0)) + (a1-2 0) + (v0-0 (the-as handle #f)) + ) + (let ((a2-1 (+ (-> v1-2 inactive-count) -1))) + (when (>= a2-1 0) + (set! v0-0 (-> v1-2 array a1-2)) + (set! (-> v1-2 array a1-2) (-> v1-2 array a2-1)) + (+! (-> v1-2 inactive-count) -1) + (+! (-> v1-2 reserve-count) -1) + (+! (-> this inactive-object-count) -1) + ) + ) + v0-0 + ) + ) + +(defmethod get-from-inactive-by-handle ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) + (let ((v1-2 (-> this traffic object-type-info-array arg0)) + (v0-0 (the-as handle #f)) + ) + (let* ((a3-0 (+ (-> v1-2 inactive-count) -1)) + (a1-3 a3-0) + ) + (while (and (>= a1-3 0) (!= (-> v1-2 array a1-3) arg1)) + (+! a1-3 -1) + ) + (when (>= a1-3 0) + (set! v0-0 (-> v1-2 array a1-3)) + (set! (-> v1-2 array a1-3) (-> v1-2 array a3-0)) + (+! (-> v1-2 inactive-count) -1) + (+! (-> this inactive-object-count) -1) + ) + ) + v0-0 + ) + ) + +(defmethod deactivate-object ((this traffic-tracker) (arg0 int) (arg1 symbol)) + (with-pp + (let* ((s3-0 (-> this active-object-type-list arg0)) + (s5-0 'traffic-off) + (s2-0 (remove-active-process this arg0)) + (s1-0 (handle->process s2-0)) + (v1-5 (the-as object #t)) + ) + (when s1-0 + (when (not (focus-test? (the-as process-focusable s1-0) inactive)) + (if arg1 + (set! s5-0 'traffic-off-force) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) s5-0) + (set! v1-5 (send-event-function s1-0 a1-2)) + ) + ) + (cond + (v1-5 + (add-reserved-process this s3-0 s2-0) + ) + (else + (add-active-process this s3-0 s2-0) + (when *debug-segment* + (when arg1 + (format 0 "traffic-engine::deactivate-object: ~s event refused~%" s5-0) + (format 0 "obj ~s~%" s1-0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod set-process-to-killed ((this traffic-tracker) (arg0 process)) + (let ((v1-0 -1)) + (let ((a0-3 (process->handle arg0)) + (a1-4 (-> this active-object-count)) + ) + (b! #t cfg-8 :delay (nop!)) + (label cfg-6) + (+! a1-4 -1) + (b! (!= (-> this active-object-list a1-4) a0-3) cfg-8 :delay (empty-form)) + (set! v1-0 (the-as int a1-4)) + (b! #t cfg-10 :delay (nop!)) + (label cfg-8) + (b! (nonzero? a1-4) cfg-6 :delay (nop!)) + ) + (label cfg-10) + (when (!= v1-0 -1) + (let ((s5-0 (-> this active-object-type-list v1-0))) + (let ((a2-4 (remove-active-process this v1-0))) + (add-reserved-process this s5-0 a2-4) + ) + (let ((v1-5 (-> this traffic object-type-info-array s5-0))) + (+! (-> v1-5 killed-count) 1) + (+! (-> v1-5 reserve-count) -1) + ) + ) + #t + ) + ) + 0 + (none) + ) + +(defmethod deactivate-all-of-type ((this traffic-tracker) (arg0 traffic-type) (arg1 symbol)) + (countdown (s3-0 (-> this active-object-count)) + (if (= (-> this active-object-type-list s3-0) arg0) + (deactivate-object this (the-as int s3-0) arg1) + ) + ) + 0 + (none) + ) + +(defmethod deactivate-all ((this traffic-tracker) (arg0 symbol)) + (countdown (s4-0 (-> this active-object-count)) + (deactivate-object this (the-as int s4-0) arg0) + ) + 0 + (none) + ) + +;; WARN: Function (method 21 traffic-tracker) has a return type of none, but the expression builder found a return statement. +(defmethod activate-from-params ((this traffic-tracker) (arg0 traffic-object-spawn-params)) + (local-vars (sv-16 handle)) + (let ((gp-0 (-> arg0 object-type))) + (b! (logtest? (process-mask enemy guard) (-> *kernel-context* prevent-from-run)) cfg-21 :delay (nop!)) + (set! (-> arg0 proc) #f) + (let ((v1-5 (-> this traffic object-type-info-array gp-0))) + (when (and (> (-> v1-5 inactive-count) 0) (> (-> v1-5 reserve-count) 0)) + (set! sv-16 (get-from-inactive-by-type this gp-0)) + (let ((s3-0 (handle->process sv-16))) + (when s3-0 + (when (= gp-0 (traffic-type formation)) + (when (not (rigid-body-object-method-30 (the-as vehicle s3-0))) + (add-reserved-process this gp-0 sv-16) + (return 0) + ) + ) + (cond + ((send-event s3-0 'traffic-activate arg0 (-> this traffic)) + (set! (-> arg0 proc) s3-0) + (add-active-process this gp-0 sv-16) + 0 + ) + (else + (add-reserved-process this gp-0 sv-16) + ) + ) + ) + ) + 0 + ) + ) + ) + (label cfg-21) + 0 + (none) + ) + +;; WARN: Function (method 22 traffic-tracker) has a return type of none, but the expression builder found a return statement. +(defmethod activate-by-type ((this traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) + (let ((s1-0 (-> this traffic object-type-info-array arg0))) + (when (and (> (-> s1-0 inactive-count) 0) + (> (-> s1-0 reserve-count) 0) + (or (< (-> s1-0 active-count) (-> s1-0 target-count)) (< (the-as uint arg0) (the-as uint 17))) + (logtest? (-> s1-0 flags) (traffic-type-flag ttf2)) + (logtest? (-> s1-0 flags) (traffic-type-flag ttf3)) + (not (logtest? (-> s1-0 flags) (traffic-type-flag ttf4))) + (< (-> s1-0 active-count) (-> s1-0 want-count)) + ) + (when *cty-faction-manager* + (if (not (cty-faction-manager-method-23 *cty-faction-manager* (the-as uint (-> arg1 branch clock-mask)))) + (return #f) + ) + (if (not (logtest? (cty-faction-manager-method-9 *cty-faction-manager* (the-as int (-> arg1 branch clock-type)) (-> s1-0 level)) + 2 + ) + ) + (return #f) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'traffic-engine-stack-var0))) + (let ((s0-0 (-> arg1 branch))) + (set! (-> s4-0 params object-type) arg0) + (set! (-> s4-0 params flags) (traffic-spawn-flags)) + (set! (-> s4-0 params guard-type) (-> s1-0 guard-type)) + (set! (-> s4-0 params nav-branch) s0-0) + (let ((v1-29 s0-0)) + (set! (-> s4-0 vec2 x) (* 1024.0 (the float (-> v1-29 speed-limit)))) + ) + (vector-! (-> s4-0 vec0) (-> arg1 vertex 1) (the-as vector (-> arg1 vertex))) + (vector-normalize! (-> s4-0 vec0) 1.0) + (vector+float*! (-> s4-0 params position) (the-as vector (-> arg1 vertex)) (-> s4-0 vec0) arg2) + (let ((f0-6 (* (+ -0.5 (rand-vu)) (* 256.0 (the float (-> s0-0 width)))))) + (+! (-> s4-0 params position x) (* -1.0 (-> s4-0 vec0 z) f0-6)) + (+! (-> s4-0 params position z) (* (-> s4-0 vec0 x) f0-6)) + ) + ) + (set! (-> s4-0 vec2 y) + (+ (* 0.5 (-> s4-0 vec2 x)) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) + ) + (vector-float*! (-> s4-0 params velocity) (-> s4-0 vec0) (-> s4-0 vec2 x)) + (vector-float*! (-> s4-0 vec1) (-> s4-0 vec0) (-> s4-0 vec2 y)) + (when (not (add-sphere-with-mask-and-id (-> this object-hash) (-> s4-0 params position) (-> s4-0 vec1) 20480.0 -1)) + (set! (-> s4-0 params behavior) (the-as uint 2)) + (set! (-> s4-0 params nav-mesh) #f) + (-> arg1 nav-mesh-id) + (if (= (-> arg1 tracker-id) 1) + (set! (-> s4-0 params nav-mesh) (get-nav-mesh (the-as actor-id (-> arg1 nav-mesh-id)))) + ) + (forward-up-nopitch->quaternion (-> s4-0 params rotation) (-> s4-0 vec0) (new 'static 'vector :y 1.0 :w 1.0)) + (set! (-> this rand) (rand-vu)) + (activate-from-params this (-> s4-0 params)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod activate-by-handle ((this traffic-tracker) (arg0 traffic-object-spawn-params)) + (local-vars (sv-16 handle)) + (let ((gp-0 (-> arg0 object-type))) + (set! (-> arg0 proc) #f) + (when (> (-> this traffic object-type-info-array gp-0 inactive-count) 0) + (set! sv-16 (get-from-inactive-by-handle this gp-0 (-> arg0 handle))) + (let ((s3-0 (handle->process sv-16))) + (when s3-0 + (cond + ((send-event s3-0 'traffic-activate arg0 (-> this traffic)) + (set! (-> arg0 proc) s3-0) + (add-active-process this gp-0 sv-16) + 0 + ) + (else + (add-reserved-process this gp-0 sv-16) + ) + ) + ) + ) + 0 + ) + ) + 0 + (none) + ) + +(defmethod reset ((this traffic-tracker) (arg0 uint) (arg1 traffic-engine)) + (set! (-> this traffic) arg1) + (set! (-> this object-hash) (-> arg1 object-hash)) + (set! (-> this rand) 0.5) + (set! (-> this id) arg0) + (set! (-> this active-object-count) (the-as uint 0)) + (set! (-> this inactive-object-count) 0) + 0 + (none) + ) + +(defmethod reset-and-init-from-manager ((this traffic-engine) (arg0 process)) + (set! (-> this allow-spawning?) #t) + (set! (-> this manager) (process->handle arg0)) + (set! (-> this flags) (the-as uint 0)) + (set! (-> this danger-sphere-count) 0) + (set! (-> *game-info* wanted-flash) #f) + (let ((v1-5 (-> this inactive-object-array))) + (dotimes (a0-5 29) + (let ((a1-3 (-> this object-type-info-array a0-5))) + (set! (-> a1-3 flags) (traffic-type-flag ttf1 ttf2)) + (set! (-> a1-3 inactive-count) 0) + (set! (-> a1-3 active-count) 0) + (set! (-> a1-3 target-count) 20) + (set! (-> a1-3 reserve-count) (the-as uint #x7d00)) + (set! (-> a1-3 killed-count) (the-as uint 0)) + (set! (-> a1-3 array) v1-5) + (set! (-> a1-3 level) #f) + ) + (set! v1-5 (&-> v1-5 20)) + ) + ) + (set! (-> this object-type-info-array 6 guard-type) (the-as uint 0)) + (set! (-> this object-type-info-array 14 guard-type) (the-as uint 6)) + (set! (-> this object-type-info-array 15 guard-type) (the-as uint 9)) + (set! (-> this object-type-info-array 16 guard-type) (the-as uint 8)) + (set! (-> this object-type-info-array 26 level) 'ctywide) + (set! (-> this object-type-info-array 28 level) 'ctywide) + (let ((v1-13 17)) + (dotimes (a0-6 12) + (set! (-> this object-type-info-array v1-13 tracker-index) (the-as uint 0)) + (+! v1-13 1) + ) + ) + (let ((v1-16 0)) + (dotimes (a0-7 17) + (set! (-> this object-type-info-array v1-16 tracker-index) (the-as uint 1)) + (+! v1-16 1) + ) + ) + (dotimes (s5-0 2) + (reset (-> this tracker-array s5-0) (the-as uint s5-0) this) + ) + (reset-boxes (-> this suppressor)) + (set! (-> this object-hash object-count) 0) + (clear-bucket-array (-> this object-hash)) + (dotimes (s5-1 2) + (reset! (-> this level-data-array s5-1)) + ) + (dotimes (s5-2 (-> *level* length)) + (let ((a1-9 (-> *level* level s5-2))) + (if (= (-> a1-9 status) 'active) + (level-link this a1-9) + ) + ) + ) + (dotimes (v1-49 4) + (set! (-> this squad-control-array v1-49) #f) + ) + 0 + (none) + ) + +(defmethod squad-stop-alarm-sound ((this traffic-engine)) + (dotimes (s5-0 4) + (let ((a0-1 (-> this squad-control-array s5-0))) + (if a0-1 + (stop-alarm-sound a0-1) + ) + ) + ) + 0 + (none) + ) + +(defmethod level-link ((this traffic-engine) (arg0 level)) + (format #t "traffic-engine: level birth ~S~%" (-> arg0 nickname)) + (cond + ((or (not *debug-segment*) + (not (and (get-nav-graph-editor) (= (-> (get-nav-graph-editor) nav-graph nav_graph_id) 1))) + ) + (when (and (nonzero? (-> arg0 bsp city-level-info)) (nonzero? (-> arg0 bsp city-level-info nav-graph))) + (let ((s4-0 (-> arg0 bsp city-level-info))) + (let ((v1-13 (-> arg0 bsp city-level-info nav-graph))) + (when (not (-> v1-13 patched)) + (dotimes (a0-8 (the-as int (-> s4-0 cell-count))) + (let ((a1-3 (-> s4-0 cell-array a0-8))) + (set! (-> a1-3 nav-territories) (the-as uint 0)) + (set! (-> a1-3 segment-array) + (the-as (inline-array nav-segment) (-> s4-0 segment-array (the-as int (the-as uint (-> a1-3 segment-array))))) + ) + ) + ) + (dotimes (a0-11 (-> s4-0 segment-count)) + (let ((a1-6 (-> s4-0 segment-array a0-11))) + (set! (-> a1-6 branch) + (the-as + nav-branch + (+ (the-as uint (the-as nav-branch (-> v1-13 branch-array))) (* (the-as int (-> a1-6 branch)) 16)) + ) + ) + (logior! + (-> s4-0 cell-array (-> a1-6 cell-id) nav-territories) + (ash 1 (the-as int (-> a1-6 branch clock-type))) + ) + ) + ) + (dotimes (a0-14 (-> v1-13 node-count)) + (let ((a1-12 (-> v1-13 node-array a0-14))) + (set! (-> a1-12 branch-array) + (the-as + (inline-array nav-branch) + (+ (the-as uint (-> v1-13 branch-array)) (* (the-as int (-> a1-12 branch-array)) 16)) + ) + ) + ) + ) + (dotimes (a0-17 (-> v1-13 branch-count)) + (let* ((a1-15 (-> v1-13 branch-array a0-17)) + (t0-4 (the-as object (-> a1-15 src-node))) + (a2-17 (the-as object (-> a1-15 dest-node))) + ) + (set! (-> a1-15 src-node) (the-as nav-node (+ (the-as uint (-> v1-13 node-array)) (* (the-as int t0-4) 32)))) + (cond + ((< #x186a0 (the-as int a2-17)) + (let ((a2-18 (- (the-as uint #xffffffff) (the-as uint a2-17)))) + (set! (-> a1-15 dest-node) (-> v1-13 link-array a2-18 dummy-node)) + ) + ) + (else + (set! (-> a1-15 dest-node) + (the-as nav-node (+ (the-as uint (-> v1-13 node-array)) (* (the-as int a2-17) 32))) + ) + ) + ) + ) + ) + (set! (-> v1-13 patched) #t) + ) + (dotimes (a0-21 (-> v1-13 branch-count)) + (set! (-> v1-13 branch-array a0-21 user-count) (the-as uint 0)) + 0 + ) + ) + (dotimes (v1-16 (the-as int (-> s4-0 cell-count))) + (let ((a0-23 (-> s4-0 cell-array v1-16))) + (set! (-> a0-23 flags) (vis-cell-flag)) + (set! (-> a0-23 prev-flags) (vis-cell-flag)) + ) + 0 + ) + (let ((s3-0 0)) + (dotimes (s2-0 (-> s4-0 segment-count)) + (let ((s1-0 (-> s4-0 segment-array s2-0))) + (vector-vector-distance (the-as vector (-> s1-0 vertex)) (-> s1-0 vertex 1)) + (when (< (-> s1-0 spawn-spacing) 0.0) + (inspect s1-0) + #t + (+! s3-0 1) + (set! (-> s1-0 spawn-spacing) (fabs (-> s1-0 spawn-spacing))) + ) + ) + ) + (format #t "birth-level ~s found ~d bad segs~%" arg0 s3-0) + ) + ) + ) + ) + (else + 0 + ) + ) + (let ((s4-1 (the-as traffic-level-data #f))) + (dotimes (v1-31 2) + (let ((a0-34 (-> this level-data-array v1-31))) + (if (zero? (-> a0-34 city-info)) + (set! s4-1 a0-34) + ) + ) + ) + (if (not s4-1) + (format 0 "level-data not found~%") + ) + (when s4-1 + (set! (-> s4-1 city-info) (-> arg0 bsp city-level-info)) + (set! (-> s4-1 active-cell-count) (the-as uint 0)) + 0 + ) + ) + (dotimes (gp-1 (-> *level* length)) + (let ((v1-43 (-> *level* level gp-1))) + (when (= (-> v1-43 status) 'active) + (when (nonzero? (-> v1-43 bsp city-level-info)) + (let ((s5-1 (-> v1-43 bsp city-level-info nav-graph))) + (when (and (nonzero? s5-1) (-> s5-1 patched)) + (dotimes (s4-2 (-> s5-1 link-count)) + (let ((s3-1 (-> s5-1 link-array s4-2))) + (when (not (-> s3-1 dest-graph)) + (let ((s2-1 (get-level-nav-graph-by-id (the-as int (-> s3-1 dest-graph-id))))) + (when (and s2-1 (-> s2-1 patched)) + (dotimes (s1-1 (-> s2-1 node-count)) + (when (= (-> s3-1 dest-node-id) (-> s2-1 node-array s1-1 id)) + (set! (-> s3-1 dest-graph) s2-1) + (set-dst-node (-> s5-1 branch-array (-> s3-1 src-branch-id)) (-> s2-1 node-array s1-1)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod level-unlink ((this traffic-engine) (arg0 level)) + (let ((s4-0 (-> arg0 bsp city-level-info nav-graph))) + (dotimes (v1-2 2) + (let ((a0-4 (-> this level-data-array v1-2))) + (when (= (-> a0-4 city-info) (-> arg0 bsp city-level-info)) + (set! (-> a0-4 city-info) (the-as city-level-info 0)) + 0 + ) + ) + ) + (when (nonzero? s4-0) + (dotimes (s3-0 (-> *level* length)) + (let ((v1-9 (-> *level* level s3-0))) + (when (= (-> v1-9 status) 'active) + (when (and (!= arg0 v1-9) (!= (-> v1-9 bsp city-level-info) 0)) + (let ((s2-0 (-> v1-9 bsp city-level-info nav-graph))) + (when (nonzero? s2-0) + (dotimes (s1-0 (-> s2-0 link-count)) + (let ((s0-0 (-> s2-0 link-array s1-0))) + (when (= (-> s0-0 dest-graph) s4-0) + (set! (-> s0-0 dest-graph) (get-level-nav-graph-by-id (the-as int (-> s0-0 dest-graph-id)))) + (when (-> s0-0 dest-graph) + (set-dst-node (-> s2-0 branch-array (-> s0-0 src-branch-id)) (-> s0-0 dummy-node)) + (set! (-> s0-0 dest-graph) #f) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((s4-1 (-> arg0 bsp city-level-info nav-graph))) + (dotimes (s3-1 (-> s4-1 link-count)) + (let ((s2-1 (-> s4-1 link-array s3-1))) + (set-dst-node (-> s4-1 branch-array (-> s2-1 src-branch-id)) (-> s2-1 dummy-node)) + (set! (-> s2-1 dest-graph) #f) + ) + ) + ) + (deactivate-all-from-level this (-> arg0 name)) + 0 + (none) + ) + +(defmethod for-all-active-processes ((this traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) + (dotimes (s4-0 2) + (for-all-active-processes (-> this tracker-array s4-0) arg0) + ) + 0 + (none) + ) + +(defmethod add-object ((this traffic-engine) (arg0 traffic-type) (arg1 process)) + (add-reserved-process + (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) + arg0 + (process->handle arg1) + ) + 0 + (none) + ) + +(defmethod child-killed ((this traffic-engine) (arg0 process)) + (cond + ((type? arg0 citizen) + (set-process-to-killed (-> this tracker1) arg0) + ) + ((type? arg0 vehicle) + (set-process-to-killed (-> this tracker0) arg0) + ) + (else + 0 + ) + ) + 0 + (none) + ) + +(defmethod activate-one-citizen ((this traffic-engine) (arg0 nav-segment) (arg1 float)) + (let ((a1-1 (+ (rand-vu-int-count 12) 17))) + (activate-by-type (-> this tracker0) (the-as traffic-type a1-1) arg0 arg1) + ) + 0 + (none) + ) + +;; WARN: Function (method 16 traffic-engine) has a return type of none, but the expression builder found a return statement. +(defmethod activate-one-vehicle ((this traffic-engine) (arg0 nav-segment) (arg1 float)) + (if (-> *setting-control* user-current nuke-active?) + (return 0) + ) + (when (not *cty-faction-manager*) + (let ((a1-1 0)) + (dotimes (v1-6 17) + (let ((a0-3 (-> this object-type-info-array v1-6))) + (if (or (zero? (-> a0-3 inactive-count)) (zero? (-> a0-3 reserve-count))) + (set! a1-1 (logior a1-1 (ash 1 v1-6))) + ) + ) + ) + (let ((a1-2 (rand-vu-int-count-excluding 17 a1-1))) + (activate-by-type (-> this tracker1) (the-as traffic-type a1-2) arg0 arg1) + ) + ) + (return 0) + ) + (let ((s3-0 -1)) + (let ((f30-0 -1.0)) + (dotimes (s2-0 17) + (let ((v1-15 (-> this object-type-info-array s2-0))) + (when (and (> (-> v1-15 inactive-count) 0) (> (-> v1-15 reserve-count) 0)) + (let ((s1-0 (-> this object-type-info-array s2-0))) + (when (-> s1-0 level) + (let ((s0-0 + (-> s1-0 + target-counts + (cty-faction-manager-method-10 *cty-faction-manager* (the-as int (-> arg0 branch clock-type)) (-> s1-0 level)) + ) + ) + ) + (when (< (-> s1-0 active-count) s0-0) + (when (logtest? (cty-faction-manager-method-9 *cty-faction-manager* (the-as int (-> arg0 branch clock-type)) (-> s1-0 level)) + 2 + ) + (let* ((f0-2 (/ (the float (-> s1-0 active-count)) (the float s0-0))) + (f0-3 (- 1.0 f0-2)) + ) + (when (< f30-0 f0-3) + (set! f30-0 f0-3) + (set! s3-0 s2-0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (if (>= s3-0 0) + (activate-by-type (-> this tracker1) (the-as traffic-type s3-0) arg0 arg1) + ) + ) + 0 + (none) + ) + +(defmethod handle-new-vis-cell ((this traffic-engine) (arg0 vis-cell)) + (dotimes (s4-0 (-> arg0 segment-count)) + (let* ((s3-0 (-> arg0 segment-array s4-0)) + (s1-0 (-> s3-0 tracker-id)) + ) + (when (and (logtest? (logxor (-> arg0 flags) (the-as uint (-> arg0 prev-flags))) (ash 1 s1-0)) + (and (not (logtest? (-> arg0 flags) (vis-cell-flag suppress))) + (not (or (can-dest-be-used? this (-> s3-0 branch)) (let ((a0-7 (-> s3-0 branch))) + (>= (-> a0-7 user-count) (-> a0-7 max-user-count)) + ) + ) + ) + ) + ) + (let* ((s2-0 (-> this tracker-array s1-0)) + (f30-0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing))) + ) + (cond + ((= s1-0 1) + (when (nonzero? (-> s3-0 nav-mesh-id)) + (while (and (< f30-0 (-> s3-0 length)) + (> (-> s2-0 inactive-object-count) 0) + (< (-> s3-0 branch density) (the-as uint 128)) + ) + (activate-one-vehicle this s3-0 f30-0) + (set! f30-0 (+ 24576.0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) + ) + ) + ) + (else + (while (and (< f30-0 (-> s3-0 length)) + (> (-> s2-0 inactive-object-count) 0) + (< (-> s3-0 branch density) (the-as uint 128)) + ) + (activate-one-citizen this s3-0 f30-0) + (set! f30-0 (+ 49152.0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) + ) + ) + ) + (if (>= f30-0 (-> s3-0 length)) + (set! (-> s2-0 rand) + (fmax 0.0 (- (-> s2-0 rand) (/ (-> s3-0 length) (* (-> s3-0 spawn-spacing) (-> this inv-density-factor))))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod stub ((this traffic-engine)) + (when #f + ) + 0 + (none) + ) + +(defmethod sphere-in-loaded-city-infos? ((this traffic-engine) (arg0 vector) (arg1 int)) + (dotimes (s3-0 2) + (let ((v1-3 (-> this level-data-array s3-0))) + (when (nonzero? (-> v1-3 city-info)) + (if (sphere-in-grid? (-> v1-3 city-info) arg0 arg1) + (return #t) + ) + ) + ) + ) + #f + ) + +(defmethod can-dest-be-used? ((this traffic-engine) (arg0 nav-branch)) + (let ((v1-0 (-> arg0 src-node))) + (or (logtest? (-> arg0 flags) (nav-branch-flags nabflags-0)) + (logtest? (-> v1-0 flags) (nav-node-flag-byte blocked)) + (not (-> arg0 dest-node)) + (>= (-> arg0 user-count) (-> arg0 max-user-count)) + ) + ) + ) + +(defmethod init-sync-masks ((this traffic-engine)) + (+! (-> this sync-clock) 1) + (set! (-> this sync-mask-8) (the-as uint (ash 1 (the-as int (logand (-> this sync-clock) 7))))) + (set! (-> this sync-mask-16) (the-as uint (ash 1 (the-as int (logand (-> this sync-clock) 15))))) + (set! (-> this sync-mask-32) (the-as uint (ash 1 (the-as int (logand (-> this sync-clock) 31))))) + (let ((v1-10 (/ (current-time) 300))) + (set! (-> this sync-array 0) (the-as uint 255)) + (let ((a1-12 (mod v1-10 20))) + (set! (-> this sync-array 1) (the-as uint (cond + ((>= 6 a1-12) + 1 + ) + ((>= 9 a1-12) + 2 + ) + ((>= 16 a1-12) + 4 + ) + (else + 8 + ) + ) + ) + ) + ) + (let ((a1-15 (mod v1-10 30))) + (set! (-> this sync-array 2) (the-as uint (cond + ((>= 6 a1-15) + 1 + ) + ((>= 9 a1-15) + 2 + ) + ((>= 16 a1-15) + 4 + ) + ((>= 19 a1-15) + 8 + ) + ((>= 26 a1-15) + 16 + ) + (else + 32 + ) + ) + ) + ) + ) + (let ((v1-11 (mod v1-10 40))) + (set! (-> this sync-array 3) (the-as uint (cond + ((>= 6 v1-11) + 1 + ) + ((>= 9 v1-11) + 2 + ) + ((>= 16 v1-11) + 4 + ) + ((>= 19 v1-11) + 8 + ) + ((>= 26 v1-11) + 16 + ) + ((>= 29 v1-11) + 32 + ) + ((>= 36 v1-11) + 64 + ) + (else + 128 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod update-danger-from-target ((this traffic-engine)) + (local-vars (v1-20 float) (v1-32 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 *target*)) + (when s5-0 + (let ((v1-1 (-> this danger-sphere-array))) + (set! (-> v1-1 0 handle) (process->handle s5-0)) + (let ((a0-4 (-> s5-0 focus-status)) + (f0-0 0.0) + (f1-0 0.0) + (f3-0 1.0) + (f2-0 0.0) + ) + (cond + ((logtest? (focus-status mech dark shooting) a0-4) + (set! f0-0 245760.0) + (set! f1-0 163840.0) + (set! f2-0 1.0) + (set! f3-0 0.0) + ) + ((logtest? (focus-status gun) a0-4) + (set! f0-0 102400.0) + (set! f1-0 61440.0) + (set! f2-0 0.5) + (set! f3-0 0.5) + ) + ((logtest? (focus-status flut board pilot) a0-4) + (set! f0-0 40960.0) + (set! f1-0 24576.0) + (set! f2-0 0.5) + ) + ((logtest? a0-4 (focus-status dangerous)) + (set! f0-0 61440.0) + (set! f1-0 40960.0) + (set! f3-0 0.0) + (set! f2-0 0.5) + ) + (else + (set! f3-0 1.5) + ) + ) + (set! (-> v1-1 0 decay-rate) (* 0.1 f3-0)) + (when (< (-> v1-1 0 danger-level) f2-0) + (set! (-> v1-1 0 danger-level) f2-0) + (set! (-> v1-1 0 sphere r) f1-0) + (set! (-> v1-1 0 notify-radius) f0-0) + ) + ) + (let ((f0-1 (-> v1-1 0 sphere r))) + (set! (-> v1-1 0 sphere quad) (-> s5-0 control trans quad)) + (set! (-> v1-1 0 sphere r) f0-1) + ) + (set! (-> v1-1 0 velocity quad) (-> s5-0 control transv quad)) + (let ((f0-3 (- (-> v1-1 0 danger-level) (* (-> v1-1 0 decay-rate) (seconds-per-frame))))) + (set! (-> v1-1 0 danger-level) (fmax 0.0 f0-3)) + ) + ) + (let ((s3-0 (-> s5-0 focus-status)) + (f30-0 0.0) + (s4-0 (new 'stack-no-clear 'inline-array 'traffic-suppression-box 2)) + ) + (set! (-> s4-0 0 bbox max quad) (-> s5-0 control transv quad)) + (vector-z-quaternion! (the-as vector (-> s4-0 1)) (get-quat s5-0 3)) + (set! (-> s4-0 1 data 16) (the-as uint 3)) + (cond + ((logtest? (focus-status shooting) s3-0) + (vector-float*! (the-as vector (-> s4-0 0)) (the-as vector (-> s4-0 1)) 409600.0) + (set! f30-0 4096.0) + (set! (-> s4-0 1 data 16) (the-as uint 0)) + 0 + ) + ((and (logtest? (focus-status gun) s3-0) + (not (and (logtest? (focus-status pilot) s3-0) (let* ((v1-19 (-> s4-0 0 bbox max)) + (f0-6 40960.0) + (f0-8 (* f0-6 f0-6)) + ) + (.lvf vf1 (&-> v1-19 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-20 vf1) + (< f0-8 v1-20) + ) + ) + ) + ) + (vector-float*! (the-as vector (-> s4-0 0)) (the-as vector (-> s4-0 1)) 163840.0) + (set! f30-0 8192.0) + (set! (-> s4-0 1 data 16) (the-as uint 1)) + ) + ((logtest? (focus-status dangerous flut board pilot) s3-0) + (vector-float*! (the-as vector (-> s4-0 0)) (-> s4-0 0 bbox max) 2.0) + (let* ((v1-31 (-> s4-0 0)) + (f0-11 20480.0) + (f0-13 (* f0-11 f0-11)) + ) + (.lvf vf1 (&-> v1-31 bbox min 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-32 vf1) + (if (< f0-13 v1-32) + (set! f30-0 20480.0) + ) + ) + (set! (-> s4-0 1 data 16) (the-as uint (cond + ((logtest? (focus-status pilot) s3-0) + 3 + ) + ((logtest? (focus-status flut board) s3-0) + 2 + ) + ((logtest? s3-0 (focus-status dangerous)) + 4 + ) + (else + 5 + ) + ) + ) + ) + ) + ) + (when (< 0.0 f30-0) + (let ((s3-1 (new 'stack-no-clear 'array 'collide-shape 40)) + (s2-1 (new 'stack 'traffic-danger-info)) + ) + (set! (-> s2-1 sphere quad) (-> s5-0 control trans quad)) + (set! (-> s2-1 danger-type) (-> s4-0 1 data 16)) + (set! (-> s2-1 sphere r) f30-0) + (set! (-> s2-1 velocity quad) (-> s4-0 0 bbox min quad)) + (let ((gp-1 (fill-actor-list-for-sphere + (-> this object-hash) + (-> s2-1 sphere) + (-> s2-1 velocity) + (-> s2-1 sphere r) + s3-1 + 40 + -1 + ) + ) + ) + (dotimes (s5-1 gp-1) + (let* ((s4-1 (-> s3-1 s5-1)) + (a0-52 (if (type? s4-1 citizen) + s4-1 + ) + ) + ) + (if a0-52 + (send-event (the-as process-tree a0-52) 'clear-path s2-1) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod update-danger ((this traffic-engine)) + (update-danger-from-target this) + (dotimes (s5-0 (-> this danger-sphere-count)) + (let ((s4-0 (-> this danger-sphere-array s5-0))) + (when (< 0.0 (-> s4-0 danger-level)) + (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 40)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 quad) (-> s4-0 sphere quad)) + (set! (-> a1-0 w) (-> s4-0 notify-radius)) + (let ((s2-0 (fill-actor-list-for-box (-> this object-hash) a1-0 s3-0 40))) + (dotimes (s1-0 s2-0) + (let* ((s0-0 (-> s3-0 s1-0)) + (a0-6 (if (type? s0-0 citizen) + s0-0 + ) + ) + ) + (when a0-6 + (if (= (-> s4-0 danger-type) 8) + (send-event (the-as process-tree a0-6) 'clear-path s4-0) + (send-event + (the-as process-tree a0-6) + (if (< 0.5 (-> s4-0 danger-level)) + 'panic + 'avoid + ) + s4-0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> this danger-sphere-count) 1) + 0 + (none) + ) + +(defmethod add-danger ((this traffic-engine) (arg0 traffic-danger-info)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((a1-1 (new 'stack-no-clear 'traffic-danger-info))) + (let ((a0-1 (-> a1-1 sphere))) + (let ((v1-0 (-> arg0 sphere))) + (let ((a2-0 (- (-> arg0 notify-radius)))) + (.mov vf6 a2-0) + ) + (.lvf vf4 (&-> v1-0 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-1 quad) vf5) + ) + (let ((a0-2 (-> a1-1 velocity))) + (let ((v1-1 (-> arg0 sphere))) + (let ((a2-1 (-> arg0 notify-radius))) + (.mov vf6 a2-1) + ) + (.lvf vf4 (&-> v1-1 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-2 quad) vf5) + ) + (set! (-> a1-1 handle) (new 'static 'handle :process #x5dc :u64 #x5dc)) + (new-suppression-box this (the-as traffic-suppression-params a1-1)) + ) + (let ((v1-5 (-> this danger-sphere-count))) + (when (< v1-5 4) + (let ((a0-5 (-> this danger-sphere-array v1-5))) + (mem-copy! (the-as pointer a0-5) (the-as pointer arg0) 54) + ) + (+! (-> this danger-sphere-count) 1) + ) + ) + 0 + (none) + ) + ) + +(defmethod kill-traffic-sphere ((this traffic-engine) (arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 64))) + (countdown (s5-0 (fill-actor-list-for-box *actor-hash* arg0 gp-0 64)) + (let* ((s4-0 (-> gp-0 s5-0)) + (v1-3 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (if v1-3 + (send-event (-> v1-3 process) 'traffic-off-force) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Function (method 52 traffic-engine) has a return type of none, but the expression builder found a return statement. +(defmethod update-traffic-amount ((this traffic-engine)) + (local-vars (sv-48 int) (sv-64 nav-segment)) + (if (not (-> this allow-spawning?)) + (return 0) + ) + (set! (-> this object-hash object-count) 0) + (clear-bucket-array (-> this object-hash)) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((a2-0 *target*)) + (when a2-0 + (cond + ((focus-test? a2-0 pilot) + (when (nonzero? (-> a2-0 pilot)) + (let ((a2-1 (handle->process (-> a2-0 pilot vehicle)))) + (when a2-1 + (set! (-> s5-0 quad) (-> (the-as process-focusable a2-1) root root-prim prim-core world-sphere quad)) + (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) a2-1)) + ) + ) + ) + ) + (else + (set! (-> s5-0 quad) (-> a2-0 control trans quad)) + (set! (-> s5-0 w) 20480.0) + (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) a2-0)) + ) + ) + ) + ) + (countdown (s4-0 (-> this tracker0 active-object-count)) + (let ((s3-0 (handle->process (-> this tracker0 active-object-list s4-0)))) + (cond + (s3-0 + (cond + ((focus-test? (the-as process-focusable s3-0) inactive) + (deactivate-object (-> this tracker0) (the-as int s4-0) #f) + ) + ((begin + (let ((v1-32 (-> (the-as process-focusable s3-0) root))) + (set! (-> s5-0 quad) (-> v1-32 trans quad)) + (set! (-> s5-0 w) (-> v1-32 root-prim prim-core world-sphere w)) + ) + (sphere-in-loaded-city-infos? this s5-0 0) + ) + (set! (-> (the-as vehicle s3-0) traffic-hash-id) + (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) s3-0)) + ) + ) + (else + (deactivate-object (-> this tracker0) (the-as int s4-0) #f) + ) + ) + ) + (else + (remove-active-process (-> this tracker0) (the-as int s4-0)) + ) + ) + ) + ) + (countdown (s4-1 (-> this tracker1 active-object-count)) + (let ((s3-1 (handle->process (-> this tracker1 active-object-list s4-1)))) + (cond + (s3-1 + (cond + ((focus-test? (the-as process-focusable s3-1) inactive) + (deactivate-object (-> this tracker1) (the-as int s4-1) #f) + ) + (else + (let ((v1-53 (-> (the-as process-focusable s3-1) root))) + (set! (-> s5-0 quad) (-> v1-53 trans quad)) + (set! (-> s5-0 w) (-> v1-53 root-prim prim-core world-sphere w)) + ) + (when (logtest? (-> (the-as citizen s3-1) flags) (citizen-flag in-formation)) + ) + (if (sphere-in-loaded-city-infos? this s5-0 1) + (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) s3-1)) + (deactivate-object (-> this tracker1) (the-as int s4-1) #f) + ) + ) + ) + ) + (else + (remove-active-process (-> this tracker1) (the-as int s4-1)) + ) + ) + ) + ) + ) + (dotimes (s5-1 2) + (let ((s4-2 (-> this level-data-array s5-1))) + (when (nonzero? (-> s4-2 city-info)) + (dotimes (s3-2 (the-as int (-> s4-2 newly-active-cell-count))) + (let ((a1-19 (-> s4-2 newly-active-cell-list s3-2))) + (handle-new-vis-cell this a1-19) + ) + ) + (dotimes (s3-3 2) + (when (> (-> this tracker-array s3-3 inactive-object-count) 0) + (let ((s2-0 (the-as nav-segment #f))) + (let ((f30-0 10000000000000000000000000000000000000.0)) + (dotimes (s1-0 (the-as int (-> s4-2 active-cell-count))) + (let ((s0-0 (-> s4-2 active-cell-list s1-0))) + (when (and (logtest? (-> s0-0 flags) (ash 1 s3-3)) (not (logtest? (-> s0-0 flags) (vis-cell-flag suppress)))) + (set! sv-48 0) + (while (< sv-48 (-> s0-0 incoming-segment-count)) + (set! sv-64 (-> s0-0 segment-array sv-48)) + (when (= (-> sv-64 tracker-id) s3-3) + (when (and (not (logtest? (-> s4-2 city-info cell-array (-> sv-64 from-cell-id) flags) (ash 1 s3-3))) + (< (-> sv-64 branch density) (the-as uint 128)) + ) + (let ((f0-3 (rand-vu))) + (when (< f0-3 f30-0) + (set! f30-0 f0-3) + (set! s2-0 sv-64) + ) + ) + ) + ) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + ) + (when s2-0 + (let ((a0-46 (-> s2-0 branch))) + (when (not (or (>= (-> a0-46 user-count) (-> a0-46 max-user-count)) (can-dest-be-used? this (-> s2-0 branch)))) + (cond + ((= s3-3 1) + (if (nonzero? (-> s2-0 nav-mesh-id)) + (activate-one-vehicle this s2-0 0.0) + ) + ) + (else + (activate-one-citizen this s2-0 0.0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod update-traffic ((this traffic-engine)) + (init-sync-masks this) + (update-suppressor this) + (let ((s5-0 (new 'stack-no-clear 'bounding-box))) + (set-vector! + (-> s5-0 min) + 10000000000000000000000000000000000000.0 + 10000000000000000000000000000000000000.0 + 10000000000000000000000000000000000000.0 + 1.0 + ) + (set-vector! + (-> s5-0 max) + -10000000000000000000000000000000000000.0 + -10000000000000000000000000000000000000.0 + -10000000000000000000000000000000000000.0 + 1.0 + ) + (dotimes (s4-0 2) + (let ((s3-0 (-> this level-data-array s4-0))) + (when (nonzero? (-> s3-0 city-info)) + (per-frame-cell-update s3-0) + (add-box! s5-0 (-> s3-0 active-cell-box)) + 0 + ) + ) + ) + (update-grid-for-objects-in-box (-> this object-hash) 253 (-> s5-0 min) (-> s5-0 max)) + ) + (when *cty-faction-manager* + (let ((a1-2 0)) + (dotimes (v1-22 2) + (let ((a0-17 (-> this level-data-array v1-22))) + (when (nonzero? (-> a0-17 city-info)) + (dotimes (a2-3 (the-as int (-> a0-17 active-cell-count))) + (set! a1-2 (logior a1-2 (-> a0-17 active-cell-list a2-3 nav-territories))) + ) + ) + ) + ) + (cty-faction-manager-method-20 *cty-faction-manager* (the-as uint a1-2)) + ) + (cty-faction-manager-method-13 *cty-faction-manager*) + ) + (if *cty-attack-controller* + (mission-squad-control-method-16 *cty-attack-controller*) + ) + (update-traffic-amount this) + (dotimes (s5-1 4) + (let ((a0-23 (-> this squad-control-array s5-1))) + (if a0-23 + (update a0-23) + ) + ) + ) + (update-danger this) + 0 + (none) + ) + +(defmethod callback-on-nav-segments-in-sphere ((this traffic-engine) + (arg0 vector) + (arg1 int) + (arg2 traffic-find-segment-struct) + (arg3 (function traffic-find-segment-struct nav-segment none)) + ) + (dotimes (s1-0 2) + (let ((v1-3 (-> this level-data-array s1-0))) + (if (nonzero? (-> v1-3 city-info)) + (callback-on-nav-segments-in-sphere (-> v1-3 city-info) arg0 arg1 arg2 arg3) + ) + ) + ) + 0 + (none) + ) + +(deftype traffic-find-segment-struct (structure) + ((best-seg nav-segment) + (best-rating float) + (dir vector :inline) + ) + ) + + +(defmethod find-best-segment ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) + (let ((gp-0 (new 'stack-no-clear 'traffic-find-segment-struct))) + (set! (-> gp-0 dir quad) (-> arg1 quad)) + (set! (-> gp-0 best-rating) -10000000000000000000000000000000000000.0) + (set! (-> gp-0 best-seg) #f) + (callback-on-nav-segments-in-sphere + this + arg0 + arg2 + gp-0 + (lambda ((arg0 traffic-find-segment-struct) (arg1 nav-segment)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 (-> arg1 vertex 1) (the-as vector (-> arg1 vertex))) + (let ((a2-1 v1-0) + (a3-1 v1-0) + (f0-0 (-> arg1 length)) + ) + (vector-float*! a2-1 a3-1 (/ 1.0 f0-0)) + ) + (let ((f0-4 (vector-dot v1-0 (-> arg0 dir)))) + (when (< (-> arg0 best-rating) f0-4) + (set! (-> arg0 best-rating) f0-4) + (set! (-> arg0 best-seg) arg1) + ) + ) + ) + (none) + ) + ) + (-> gp-0 best-seg) + ) + ) + +(defmethod target-count ((this traffic-engine) (arg0 float)) + (dotimes (v1-0 29) + (let ((a2-2 (-> this object-type-info-array v1-0))) + (set! (-> a2-2 target-count) (the int (* arg0 (the float (max 0 (+ (-> a2-2 want-count) -1)))))) + ) + ) + 0 + (none) + ) + +(defmethod restore-default-settings ((this traffic-engine)) + (let ((t9-0 (-> *traffic-info* restore-speech-callback))) + (if t9-0 + (t9-0) + ) + ) + (target-count this 1.0) + (set! (-> this inv-density-factor) 5.0) + (let ((v1-6 32)) + (dotimes (a0-2 29) + (let ((a1-3 (-> this object-type-info-array a0-2))) + (set! (-> a1-3 flags) (traffic-type-flag ttf1 ttf2)) + (set! (-> a1-3 reserve-count) (the-as uint (max 1000 (min #xfde8 (* 1000 (-> a1-3 want-count)))))) + (set! (-> a1-3 killed-count) (the-as uint 0)) + (set! (-> a1-3 parking-spot-prob) + (the-as uint (if (and (zero? (-> a1-3 tracker-index)) + (not (logtest? (-> a1-3 flags) (traffic-type-flag ttf0))) + (!= a0-2 27) + (!= a0-2 26) + ) + v1-6 + 0 + ) + ) + ) + (let ((a2-9 a0-2)) + (if (or (= a2-9 17) (or (= a2-9 18) (= a2-9 19) (= a2-9 28))) + (set! (-> a1-3 parking-spot-prob) (the-as uint 128)) + ) + ) + ) + ) + ) + (let ((v1-9 (-> this object-type-info-array 6))) + (logior! (-> v1-9 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-10 (-> this object-type-info-array 7))) + (logior! (-> v1-10 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-11 (-> this object-type-info-array 24))) + (logior! (-> v1-11 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-12 (-> this object-type-info-array 25))) + (logior! (-> v1-12 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-13 (-> this object-type-info-array 26))) + (logior! (-> v1-13 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-14 (-> this object-type-info-array 5))) + (set! (-> v1-14 target-count) 0) + (logclear! (-> v1-14 flags) (traffic-type-flag ttf1 ttf2)) + ) + (let ((v1-15 (-> this object-type-info-array 3))) + (set! (-> v1-15 target-count) 0) + (logclear! (-> v1-15 flags) (traffic-type-flag ttf2)) + ) + (let ((v1-16 (-> this object-type-info-array 4))) + (set! (-> v1-16 target-count) 0) + (logclear! (-> v1-16 flags) (traffic-type-flag ttf2)) + ) + (let ((v1-17 (-> this object-type-info-array 23))) + (set! (-> v1-17 target-count) 0) + (logclear! (-> v1-17 flags) (traffic-type-flag ttf1 ttf2)) + ) + (let ((v1-18 (-> this object-type-info-array 28))) + (set! (-> v1-18 target-count) 0) + (logclear! (-> v1-18 flags) (traffic-type-flag ttf2)) + (logior! (-> v1-18 flags) (traffic-type-flag ttf3)) + ) + (dotimes (s5-0 4) + (let ((a0-25 (-> this squad-control-array s5-0))) + (if a0-25 + (init-alert a0-25) + ) + ) + ) + 0 + (none) + ) + +(defmethod deactivate-all ((this traffic-engine)) + (deactivate-all (-> this tracker0) #t) + (deactivate-all (-> this tracker1) #t) + 0 + (none) + ) + +(defmethod deactivate-by-type ((this traffic-engine) (arg0 traffic-type)) + (let ((a2-0 (-> this object-type-info-array arg0))) + (deactivate-all-of-type (-> this tracker-array (-> a2-0 tracker-index)) arg0 #t) + ) + 0 + (none) + ) + +(defmethod deactivate-all-from-level ((this traffic-engine) (arg0 symbol)) + (local-vars (v1-6 nav-branch)) + (countdown (s4-0 (-> this tracker0 active-object-count)) + (let ((v1-3 (handle->process (-> this tracker0 active-object-list s4-0)))) + (when v1-3 + (cond + ((focus-test? (the-as process-focusable v1-3) inactive) + (deactivate-object (-> this tracker0) (the-as int s4-0) #f) + ) + ((begin (set! v1-6 (-> (the-as hvehicle v1-3) controller branch)) (and v1-6 (nonzero? v1-6))) + (let ((v1-7 (-> v1-6 dest-node))) + (cond + (v1-7 + (if (= arg0 (-> v1-7 level)) + (deactivate-object (-> this tracker0) (the-as int s4-0) #t) + ) + ) + (else + 0 + ) + ) + ) + ) + (else + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-object-auto-activate ((this traffic-engine) (arg0 int) (arg1 symbol)) + (let ((v1-2 (-> this object-type-info-array arg0))) + (if arg1 + (logior! (-> v1-2 flags) (traffic-type-flag ttf2)) + (logclear! (-> v1-2 flags) (traffic-type-flag ttf2)) + ) + ) + 0 + (none) + ) + +(defmethod set-object-target-level ((this traffic-engine) (arg0 int) (arg1 float)) + (let ((v1-2 (-> this object-type-info-array arg0))) + (set! (-> v1-2 target-count) (the int (* arg1 (the float (max 0 (+ (-> v1-2 want-count) -1)))))) + ) + 0 + (none) + ) + +(defmethod set-object-target-count ((this traffic-engine) (arg0 int) (arg1 int)) + (set! (-> this object-type-info-array arg0 target-count) arg1) + 0 + (none) + ) + +(defmethod set-object-reserve-count ((this traffic-engine) (arg0 int) (arg1 uint)) + (set! (-> this object-type-info-array arg0 reserve-count) arg1) + 0 + (none) + ) + +(defmethod get-object-reserve-count ((this traffic-engine) (arg0 int)) + (-> this object-type-info-array arg0 reserve-count) + ) + +(defmethod get-object-remaining-count ((this traffic-engine) (arg0 int)) + (let ((a0-1 (-> this object-type-info-array arg0))) + (+ (-> a0-1 active-count) (-> a0-1 reserve-count)) + ) + ) + +(defmethod set-parking-spot-prob ((this traffic-engine) (arg0 int) (arg1 float)) + (let ((v1-2 (-> this object-type-info-array arg0))) + (set! (-> v1-2 parking-spot-prob) (the-as uint (min 255 (the int (* 256.0 arg1))))) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs traffic-type. +(defmethod get-random-parking-spot-type ((this traffic-engine)) + (let ((s4-0 0) + (s5-0 0) + ) + (let ((s3-0 17) + (s2-0 28) + ) + (while (>= (the-as uint s2-0) (the-as uint s3-0)) + (let ((s1-0 (-> this object-type-info-array s3-0))) + (if (and (logtest? (-> s1-0 flags) (traffic-type-flag ttf3)) + (= (status-of-level-and-borrows *level* (-> s1-0 level) 'ignore-borrow) 'active) + ) + (+! s4-0 (-> s1-0 parking-spot-prob)) + ) + ) + (+! s3-0 1) + ) + ) + (let ((s4-1 (mod (the-as int (rand-uint31-gen *random-generator*)) (+ s4-0 1))) + (s3-1 17) + (s2-1 28) + ) + (while (>= (the-as uint s2-1) (the-as uint s3-1)) + (let ((s1-1 (-> this object-type-info-array s3-1))) + (when (and (logtest? (-> s1-1 flags) (traffic-type-flag ttf3)) + (= (status-of-level-and-borrows *level* (-> s1-1 level) #f) 'active) + ) + (+! s5-0 (-> s1-1 parking-spot-prob)) + (if (< s4-1 s5-0) + (return (the-as traffic-type s3-1)) + ) + ) + ) + (+! s3-1 1) + ) + ) + ) + (the-as traffic-type 29) + ) + +(defmethod activate-object ((this traffic-engine) (arg0 traffic-object-spawn-params)) + (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) + (activate-from-params (-> this tracker-array (-> a2-0 tracker-index)) arg0) + ) + 0 + (none) + ) + +(defmethod activate-by-handle ((this traffic-engine) (arg0 traffic-object-spawn-params)) + (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) + (activate-by-handle (-> this tracker-array (-> a2-0 tracker-index)) arg0) + ) + 0 + (none) + ) + +(defmethod new-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) + (add-new-supression-box (-> this suppressor) arg0) + (none) + ) + +(defmethod remove-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) + (remove-box-by-id (-> this suppressor) (the-as int arg0)) + (none) + ) + +(defmethod update-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) + (update-box-from-params (-> this suppressor) arg0) + (none) + ) + +(defmethod update-suppressor ((this traffic-engine)) + (let ((v1-3 (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)))) + (dotimes (a1-3 16) + (let ((a2-2 (-> this suppressor array a1-3))) + (when (logtest? (-> a2-2 flags) (traffic-suppression-box-flag in-use)) + (let ((a3-3 (-> a2-2 duration))) + (cond + ((< a3-3 (the-as uint v1-3)) + (logclear! (-> a2-2 flags) (traffic-suppression-box-flag in-use)) + (logior! (-> this suppressor flags) (traffic-suppressor-flag needs-update)) + ) + (else + (set! (-> a2-2 duration) (- a3-3 (the-as uint v1-3))) + ) + ) + ) + ) + ) + ) + ) + (when (logtest? (-> this suppressor flags) (traffic-suppressor-flag needs-update)) + (logclear! (-> this suppressor flags) (traffic-suppressor-flag needs-update)) + (recompute-suppressions this) + ) + 0 + (none) + ) + +(defmethod recompute-suppressions ((this traffic-engine)) + (dotimes (s5-0 2) + (let ((v1-3 (-> this level-data-array s5-0))) + (if (nonzero? (-> v1-3 city-info)) + (update-suppressions-from-traffic-engine (-> v1-3 city-info) this) + ) + ) + ) + 0 + (none) + ) + +(defmethod add-squad-ctrl ((this traffic-engine) (arg0 squad-control)) + (let ((v1-0 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (b! (-> this squad-control-array v1-0) cfg-3 :delay (empty-form)) + (set! (-> this squad-control-array v1-0) arg0) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + (+! v1-0 1) + (label cfg-4) + (b! (< v1-0 4) cfg-1) + ) + (label cfg-6) + 0 + (none) + ) + +(defmethod check-proc-in-tracker ((this traffic-engine) (arg0 process) (arg1 int)) + (let ((v1-3 (-> this tracker-array arg1)) + (a0-3 (process->handle arg0)) + ) + (dotimes (a3-4 (the-as int (-> v1-3 active-object-count))) + (b! (= (-> v1-3 active-object-list a3-4) a0-3) cfg-10 :delay (nop!)) + ) + ) + (format *stdebug* "proc pid ~d (~a) not found in tracker ~d~%" (-> arg0 pid) arg0 arg1) + (label cfg-10) + 0 + 0 + (none) + ) + +(defmethod new traffic-engine ((allocation symbol) (type-to-make type)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 object-hash) ((method-of-type spatial-hash new) allocation spatial-hash #xc1c0 253)) + s5-0 + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/traffic-manager.gc b/goal_src/jak3/levels/city/traffic/traffic-manager.gc index 7612aae52c..29a0eaef9c 100644 --- a/goal_src/jak3/levels/city/traffic/traffic-manager.gc +++ b/goal_src/jak3/levels/city/traffic/traffic-manager.gc @@ -6,11 +6,36 @@ ;; dgos: DESRESC, WWD, CWI (define-extern vehicle-manager-start (function process none)) +(define-extern traffic-object-spawn (function process traffic-object-spawn-params process-drawable)) +(define-extern level->sound-bank-name (function symbol symbol)) (define-extern *traffic-fast-spawn* symbol) -;; DECOMP BEGINS +(declare-type citizen-norm citizen) +(define-extern citizen-norm type) +(declare-type citizen-chick citizen) +(define-extern citizen-chick type) +(declare-type citizen-fat citizen) +(define-extern citizen-fat type) +(declare-type metalhead-predator citizen) +(define-extern metalhead-predator type) +(declare-type metalhead-grunt citizen) +(define-extern metalhead-grunt type) +(declare-type metalhead-flitter citizen) +(define-extern metalhead-flitter type) +(declare-type wlander-male citizen) +(define-extern wlander-male type) +(declare-type wlander-female citizen) +(define-extern wlander-female type) +(declare-type crimson-guard citizen) +(define-extern crimson-guard type) +(declare-type roboguard-city citizen) +(define-extern roboguard-city type) +(declare-type flying-turret citizen) +(define-extern flying-turret type) +(declare-type spydroid citizen) +(define-extern spydroid type) -;; TODO stubs +;; DECOMP BEGINS (define *traffic-engine* (the-as traffic-engine #f)) @@ -28,30 +53,15 @@ ) (:methods (traffic-manager-method-16 (_type_) none) - (traffic-manager-method-17 (_type_) none) + (spawn-all (_type_) none) (traffic-manager-method-18 (_type_) none) - (traffic-manager-method-19 (_type_) none) + (kill-all (_type_) none) (traffic-manager-method-20 (_type_) none) (traffic-manager-method-21 (_type_) none) (traffic-manager-method-22 (_type_) none) ) ) -(defmethod traffic-manager-method-16 ((this traffic-manager)) - (none) - ) - -(defmethod traffic-manager-method-17 ((this traffic-manager)) - (none) - ) - -(defmethod traffic-manager-method-21 ((this traffic-manager)) - (none) - ) - -(defbehavior traffic-manager-event-handler traffic-manager ((proc process) (argc int) (msg symbol) (block event-message-block)) - #f - ) (defun draw-city-info ((arg0 city-level-info) (arg1 vis-grid-pos)) (let ((v1-0 (-> arg0 grid-info box))) @@ -72,11 +82,36 @@ (none) ) +(defmethod traffic-manager-method-16 ((this traffic-manager)) + (traffic-manager-method-22 this) + (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (set-setting! 'gem-pool-index #f 0.0 1) + ) + (update-traffic (-> this traffic-engine)) + (cond + ((-> *setting-control* user-current traffic-spawn) + (traffic-manager-method-18 this) + (spawn-all this) + ) + (else + (kill-all this) + ) + ) + (if *debug-segment* + (stub (-> this traffic-engine)) + ) + (if *display-traffic-height-map* + (debug-draw *traffic-height-map* (target-pos 0)) + ) + 0 + (none) + ) + (defmethod traffic-manager-method-18 ((this traffic-manager)) (let ((s5-0 0)) (while (< (the-as uint s5-0) (the-as uint 29)) (let ((v1-2 (-> this traffic-engine object-type-info-array s5-0))) - (when (logtest? (-> v1-2 flags) 2) + (when (logtest? (-> v1-2 flags) (traffic-type-flag ttf1)) (let ((a0-5 (+ (-> v1-2 active-count) (-> v1-2 inactive-count)))) (when (< (-> v1-2 want-count) a0-5) (let ((a0-10 (handle->process (get-from-inactive-by-type @@ -101,8 +136,8 @@ (none) ) -(defmethod traffic-manager-method-19 ((this traffic-manager)) - ((method-of-object (-> this traffic-engine) traffic-engine-method-24)) +(defmethod kill-all ((this traffic-manager)) + (deactivate-all (-> this traffic-engine)) (let ((s5-0 0)) (while (< (the-as uint s5-0) (the-as uint 29)) (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) @@ -127,6 +162,225 @@ (none) ) +(defmethod spawn-all ((this traffic-manager)) + (dotimes (s5-0 29) + (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) + (logclear! (-> s4-0 flags) (traffic-type-flag ttf3)) + (if (= (status-of-level-and-borrows *level* (-> s4-0 level) #f) 'active) + (logior! (-> s4-0 flags) (traffic-type-flag ttf3)) + ) + ) + ) + (let ((s5-1 1) + (s4-1 0) + (s3-1 #x1fffffff) + ) + (if (-> this fast-spawn) + (set! s5-1 120) + ) + (b! #t cfg-38 :delay (nop!)) + (label cfg-8) + (let* ((s2-0 (-> this spawn-params)) + (s1-0 (the-as int (-> s2-0 object-type))) + ) + (when (logtest? s3-1 (ash 1 s1-0)) + (let ((s0-0 (-> this traffic-engine object-type-info-array (the-as traffic-type s1-0)))) + (let ((v1-21 (+ (-> s0-0 active-count) (-> s0-0 inactive-count)))) + (b! + (not (and (logtest? (-> s0-0 flags) (traffic-type-flag ttf1)) + (logtest? (-> s0-0 flags) (traffic-type-flag ttf3)) + (not (logtest? (-> s0-0 flags) (traffic-type-flag ttf4))) + (< v1-21 (-> s0-0 want-count)) + ) + ) + cfg-31 + :delay (nop!) + ) + (logclear! (-> s2-0 flags) (traffic-spawn-flags tsf3)) + (if (and (= (-> s2-0 object-type) (traffic-type guard-a)) + (> (-> this dark-guard-ratio) 0) + (zero? (mod v1-21 (-> this dark-guard-ratio))) + ) + (logior! (-> s2-0 flags) (traffic-spawn-flags tsf3)) + ) + ) + (let ((a2-1 (traffic-object-spawn this s2-0))) + (b! (not a2-1) cfg-29 :delay (nop!)) + (add-object (-> this traffic-engine) (the-as traffic-type s1-0) a2-1) + ) + (+! (-> s0-0 reserve-count) -1) + ) + (+! (-> s2-0 id) 1) + (+! s4-1 1) + (b! #t cfg-30 :delay (nop!)) + (label cfg-29) + (format #t "traffic-manager: unable to spawn~%") + (b! #t cfg-43 :delay (nop!)) + (label cfg-30) + (b! #t cfg-35 :delay (nop!)) + (label cfg-31) + (set! s3-1 (logclear s3-1 (ash 1 s1-0))) + ) + (label cfg-35) + (let ((v1-37 (+ s1-0 1))) + (if (>= (the-as uint v1-37) (the-as uint 29)) + (set! v1-37 0) + ) + (set! (-> s2-0 object-type) (the-as traffic-type v1-37)) + ) + ) + (label cfg-38) + (b! (and (< s4-1 s5-1) (nonzero? s3-1)) cfg-8 :delay (nop!)) + ) + (label cfg-43) + (set! (-> this fast-spawn) #f) + 0 + 0 + (none) + ) + +;; WARN: Return type mismatch process vs formation-object. +(defun formation-spawn ((arg0 process) (arg1 type) (arg2 formation-info)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* arg1 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg0 "formation" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 formation-init-by-other arg2) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as formation-object gp-0) + ) + ) + +(defun type-from-traffic-object-type ((arg0 traffic-type)) + (case arg0 + (((traffic-type civilian-male)) + citizen-norm + ) + (((traffic-type civilian-female)) + citizen-chick + ) + (((traffic-type civilian-fat)) + citizen-fat + ) + (((traffic-type civilian-pilot)) + citizen-norm + ) + (((traffic-type metalhead-predator)) + metalhead-predator + ) + (((traffic-type metalhead-grunt)) + metalhead-grunt + ) + (((traffic-type metalhead-flitter)) + metalhead-flitter + ) + (((traffic-type wlander-male)) + wlander-male + ) + (((traffic-type wlander-female)) + wlander-female + ) + (((traffic-type guard-a)) + crimson-guard + ) + (((traffic-type guard-pilot)) + crimson-guard + ) + (((traffic-type roboguard)) + roboguard-city + ) + (((traffic-type spydroid)) + spydroid + ) + (((traffic-type flying-turret)) + flying-turret + ) + (else + (the-as type #f) + ) + ) + ) + +;; WARN: Return type mismatch process vs process-drawable. +(defun citizen-spawn ((arg0 process) (arg1 traffic-type) (arg2 traffic-object-spawn-params)) + (let ((gp-0 (the-as process #f))) + (let* ((a1-1 (type-from-traffic-object-type arg1)) + (s3-0 (get-process *default-dead-pool* a1-1 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-2 (method-of-type process activate))) + (t9-2 s3-0 arg0 "citizen" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 citizen-init-by-other arg2) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as process-drawable gp-0) + ) + ) + +(defun traffic-object-spawn ((arg0 process) (arg1 traffic-object-spawn-params)) + (let ((v0-0 (the-as process-drawable #f))) + (case (-> arg1 object-type) + (((traffic-type civilian-bike-a)) + (set! v0-0 (vehicle-spawn (vehicle-type h-bike-a) arg1)) + ) + (((traffic-type civilian-bike-b)) + (set! v0-0 (vehicle-spawn (vehicle-type h-bike-b) arg1)) + ) + (((traffic-type civilian-bike-c)) + (set! v0-0 (vehicle-spawn (vehicle-type h-bike-c) arg1)) + ) + (((traffic-type bike-d)) + (set! v0-0 (vehicle-spawn (vehicle-type h-bike-d) arg1)) + ) + (((traffic-type civilian-car-a)) + (set! v0-0 (vehicle-spawn (vehicle-type h-car-a) arg1)) + ) + (((traffic-type civilian-car-b)) + (set! v0-0 (vehicle-spawn (vehicle-type h-car-b) arg1)) + ) + (((traffic-type civilian-car-c)) + (set! v0-0 (vehicle-spawn (vehicle-type h-car-c) arg1)) + ) + (((traffic-type civilian-male) + (traffic-type civilian-female) + (traffic-type civilian-fat) + (traffic-type civilian-pilot) + (traffic-type metalhead-predator) + (traffic-type metalhead-grunt) + (traffic-type metalhead-flitter) + (traffic-type wlander-male) + (traffic-type wlander-female) + (traffic-type guard-a) + (traffic-type guard-pilot) + (traffic-type roboguard) + (traffic-type spydroid) + (traffic-type flying-turret) + ) + (set! v0-0 (citizen-spawn arg0 (-> arg1 object-type) arg1)) + ) + (((traffic-type formation)) + (set! v0-0 (formation-spawn arg0 formation-object (the-as formation-info arg1))) + ) + ) + v0-0 + ) + ) + (defmethod traffic-manager-method-20 ((this traffic-manager)) (set! (-> this traffic-engine) *traffic-engine*) (reset-and-init-from-manager (-> this traffic-engine) this) @@ -153,7 +407,7 @@ (if (and *vehicle-manager* (!= (-> this level) (-> *vehicle-manager* level))) (change-parent *vehicle-manager* *entity-pool*) ) - ; ((method-of-object (-> this traffic-engine) traffic-engine-method-11)) + (squad-stop-alarm-sound (-> this traffic-engine)) (set! *traffic-manager* #f) (remove-setting *setting-control* this 'task-mask) (apply-settings *setting-control*) @@ -162,10 +416,372 @@ (none) ) +(defmethod traffic-manager-method-21 ((this traffic-manager)) + (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (set-setting! 'gem-pool-index #f 0.0 1) + ) + (let ((s5-1 (new 'stack-no-clear 'array 'int8 29))) + (set! (-> s5-1 17) 2) + (set! (-> s5-1 18) 2) + (set! (-> s5-1 19) 2) + (set! (-> s5-1 20) 2) + (set! (-> s5-1 21) 2) + (set! (-> s5-1 22) 2) + (set! (-> s5-1 24) 0) + (set! (-> s5-1 25) 0) + (set! (-> s5-1 26) 0) + (set! (-> s5-1 0) 20) + (set! (-> s5-1 1) 20) + (set! (-> s5-1 2) 1) + (set! (-> s5-1 3) 1) + (set! (-> s5-1 4) 1) + (set! (-> s5-1 6) 14) + (set! (-> s5-1 7) 0) + (set! (-> s5-1 8) 5) + (set! (-> s5-1 9) 9) + (set! (-> s5-1 10) 3) + (set! (-> s5-1 11) 14) + (set! (-> s5-1 12) 14) + (set! (-> s5-1 13) 3) + (set! (-> s5-1 14) 10) + (set! (-> s5-1 15) 15) + (set! (-> s5-1 16) 10) + (set! (-> s5-1 27) 0) + (set! (-> s5-1 28) 0) + (set! (-> this fast-spawn) *traffic-fast-spawn*) + (traffic-manager-method-20 this) + (let ((v1-29 (-> this traffic-engine))) + (dotimes (a0-4 29) + (set! (-> v1-29 object-type-info-array a0-4 want-count) (-> s5-1 a0-4)) + ) + ) + ) + (let ((s5-2 (-> this spawn-params))) + (set! (-> s5-2 object-type) (traffic-type guard-a)) + (set! (-> s5-2 behavior) (the-as uint 1)) + (set! (-> s5-2 id) (the-as uint 0)) + (set! (-> s5-2 nav-mesh) #f) + (set! (-> s5-2 nav-branch) #f) + (set! (-> s5-2 proc) #f) + (set! (-> s5-2 handle) (the-as handle #f)) + (set! (-> s5-2 user-data) (the-as uint 0)) + (set! (-> s5-2 flags) (traffic-spawn-flags tsf1)) + (set! (-> s5-2 guard-type) (the-as uint 11)) + (set! (-> s5-2 entity) #f) + (vector-reset! (-> s5-2 velocity)) + (vector-reset! (-> s5-2 position)) + (forward-up-nopitch->quaternion + (-> s5-2 rotation) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (set! (-> s5-2 id) (the-as uint 1)) + ) + (set! (-> this dark-guard-ratio) 0) + (restore-default-settings (-> this traffic-engine)) + (set! *traffic-manager* this) + 0 + (none) + ) + (define *traffic-vehicle-level-borrow-list* (the-as object '(#f))) (define *traffic-vehicle-level-sound-list* (the-as object '(#f))) +(defbehavior traffic-manager-event-handler traffic-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((gp-0 (the-as object #t))) + (case arg2 + (('child-killed) + (child-killed (-> self traffic-engine) arg0) + ) + (('increase-alert-level) + (break!) + 0 + ) + (('decrease-alert-level) + (break!) + 0 + ) + (('set-alert-level) + (break!) + 0 + ) + (('set-max-alert-level) + (break!) + 0 + ) + (('get-alert-level) + (break!) + 0 + ) + (('set-alert-duration) + (break!) + 0 + ) + (('disable-spawning) + (set! (-> self traffic-engine allow-spawning?) #f) + (format 0 "Disable spawn ~%") + ) + (('enable-spawning) + (set! (-> self traffic-engine allow-spawning?) #t) + (format 0 "Enable spawn ~%") + ) + (('deactivate-all) + (deactivate-all (-> self traffic-engine)) + ) + (('set-target-level) + (let ((f0-0 (the-as float (-> arg3 param 0)))) + (target-count (-> self traffic-engine) f0-0) + ) + ) + (('set-guard-target-level) + (break!) + 0 + ) + (('restore-default-settings) + (restore-default-settings (-> self traffic-engine)) + ) + (('add-danger-sphere) + (let ((a1-7 (-> arg3 param 0))) + (add-danger (-> self traffic-engine) (the-as traffic-danger-info a1-7)) + ) + ) + (('spawn-object) + (let ((s5-0 (the-as object (-> arg3 param 0)))) + (set! (-> (the-as traffic-object-spawn-params s5-0) proc) + (traffic-object-spawn self (the-as traffic-object-spawn-params s5-0)) + ) + ) + ) + (('activate-object) + (let ((a1-9 (-> arg3 param 0))) + (activate-object (-> self traffic-engine) (the-as traffic-object-spawn-params a1-9)) + ) + ) + (('activate-specific-object) + (let ((a1-10 (-> arg3 param 0))) + (activate-by-handle (-> self traffic-engine) (the-as traffic-object-spawn-params a1-10)) + ) + ) + (('get-object-remaining-count) + (let ((a1-11 (-> arg3 param 0))) + (set! gp-0 (get-object-remaining-count (-> self traffic-engine) (the-as int a1-11))) + ) + ) + (('set-object-reserve-count) + (let ((a1-12 (-> arg3 param 0)) + (a2-1 (-> arg3 param 1)) + ) + (set-object-reserve-count (-> self traffic-engine) (the-as int a1-12) a2-1) + ) + ) + (('get-object-reserve-count) + (let ((a1-13 (-> arg3 param 0))) + (set! gp-0 (get-object-reserve-count (-> self traffic-engine) (the-as int a1-13))) + ) + ) + (('set-object-target-level) + (let ((a1-14 (-> arg3 param 0)) + (f0-1 (the-as float (-> arg3 param 1))) + ) + (set-object-target-level (-> self traffic-engine) (the-as int a1-14) f0-1) + ) + ) + (('set-object-target-count) + (let ((a1-15 (-> arg3 param 0)) + (a2-3 (-> arg3 param 1)) + ) + (set-object-target-count (-> self traffic-engine) (the-as int a1-15) (the-as int a2-3)) + ) + ) + (('set-guard-target-count-range) + (break!) + 0 + ) + (('deactivate-by-type) + (let ((a1-16 (-> arg3 param 0))) + (deactivate-by-type (-> self traffic-engine) (the-as traffic-type a1-16)) + ) + ) + (('new-suppression-box) + (let ((a1-17 (-> arg3 param 0))) + (new-suppression-box (-> self traffic-engine) (the-as traffic-suppression-params a1-17)) + ) + ) + (('update-suppression-box) + (let ((a1-18 (-> arg3 param 0))) + (update-suppression-box (-> self traffic-engine) (the-as traffic-suppression-params a1-18)) + ) + ) + (('kill-traffic-sphere) + (let ((a1-19 (-> arg3 param 0))) + (kill-traffic-sphere (-> self traffic-engine) (the-as vector a1-19)) + ) + ) + (('set-guard-multi-focus) + (break!) + 0 + ) + (('player-enter-vehicle) + (let ((s5-1 (-> arg3 param 0))) + (when *city-borrow-manager* + (set! (car (ref& *traffic-vehicle-level-borrow-list* 0)) + (-> self traffic-engine object-type-info-array s5-1 level) + ) + (set! (car (ref& *traffic-vehicle-level-sound-list* 0)) + (level->sound-bank-name (-> self traffic-engine object-type-info-array s5-1 level)) + ) + (remove-setting! 'borrow-hold) + (set-setting! 'borrow-hold-perm *traffic-vehicle-level-borrow-list* 0.0 0) + (set-setting! 'city-sound *traffic-vehicle-level-sound-list* 0.0 1) + ) + ) + ) + (('player-exit-vehicle) + (let ((v1-31 (-> arg3 param 0))) + (when *city-borrow-manager* + (set! (car (ref& *traffic-vehicle-level-borrow-list* 0)) + (-> self traffic-engine object-type-info-array v1-31 level) + ) + (remove-setting! 'borrow-hold-perm) + (set-setting! 'borrow-hold *traffic-vehicle-level-borrow-list* 0.0 0) + (remove-setting! 'city-sound) + ) + ) + ) + (('set-disable-pursuit-control) + (break!) + 0 + ) + (('set-object-auto-activate) + (let ((a1-29 (-> arg3 param 0)) + (a2-10 (-> arg3 param 1)) + ) + (set-object-auto-activate (-> self traffic-engine) (the-as int a1-29) (the-as symbol a2-10)) + ) + ) + (('set-guard-force-visible) + (break!) + 0 + ) + (('end-pursuit-by-type) + (break!) + 0 + ) + (('level-loaded) + (let ((a1-30 (-> arg3 param 0))) + (level-link (-> self traffic-engine) (the-as level a1-30)) + ) + ) + (('level-killed) + (let ((s5-4 (the-as object (-> arg3 param 0)))) + (level-unlink (-> self traffic-engine) (the-as level s5-4)) + (format #t "traffic-manager : level killed ~S~%" (-> (the-as level s5-4) nickname)) + ) + ) + (('add-object) + (let ((a1-33 (-> arg3 param 0)) + (a2-12 (-> arg3 param 1)) + ) + (add-object (-> self traffic-engine) (the-as traffic-type a1-33) (the-as process a2-12)) + ) + ) + (('get-num-normal-available) + (let* ((v1-44 (the-as msg-get-num-inactive (-> arg3 param 0))) + (a1-35 (-> self traffic-engine object-type-info-array (-> v1-44 obj-type))) + ) + (set! (-> v1-44 num-inactive-out) (- (-> a1-35 target-count) (-> a1-35 active-count))) + ) + ) + (('get-num-inactive) + (let* ((v1-45 (the-as msg-get-num-inactive (-> arg3 param 0))) + (a1-37 (-> v1-45 obj-type)) + ) + (set! (-> v1-45 num-inactive-out) (-> self traffic-engine object-type-info-array a1-37 inactive-count)) + ) + ) + (('get-inactive-object-list) + (let ((v1-46 (the-as msg-get-inactive-objects (-> arg3 param 0)))) + (set! (-> v1-46 object-type-info-array) (-> self traffic-engine object-type-info-array)) + ) + ) + (('borrow-query-remaining) + (let ((a0-129 (-> arg3 param 0)) + (v1-47 0) + ) + (dotimes (a1-39 29) + (let ((a2-15 (-> self traffic-engine object-type-info-array a1-39))) + (if (= (-> a2-15 level) a0-129) + (+! v1-47 (-> a2-15 active-count)) + ) + ) + ) + (set! gp-0 v1-47) + ) + (goto cfg-131) + ) + (('borrow-notify-shutdown-end) + (let ((v1-49 (-> arg3 param 0))) + (dotimes (a0-133 29) + (let ((a1-42 (-> self traffic-engine object-type-info-array a0-133))) + (if (= (-> a1-42 level) v1-49) + (logclear! (-> a1-42 flags) (traffic-type-flag ttf4)) + ) + ) + ) + ) + ) + (('borrow-notify-shutdown-begin) + (let ((v1-51 (-> arg3 param 0))) + (dotimes (a0-136 29) + (let ((a1-45 (-> self traffic-engine object-type-info-array a0-136))) + (if (= (-> a1-45 level) v1-51) + (logior! (-> a1-45 flags) (traffic-type-flag ttf4)) + ) + ) + ) + ) + ) + (('kill-all) + (format #t "traffic-manager::kill-all~%") + (deactivate-all (-> self traffic-engine)) + (kill-all self) + ) + (('spawn-all) + (format #t "traffic-manager::spawn-all~%") + (set! (-> self fast-spawn) #t) + (spawn-all self) + ) + (('set-density-factor) + (let ((f0-2 (the-as float (-> arg3 param 0)))) + (set! (-> self traffic-engine inv-density-factor) (/ 5.0 f0-2)) + ) + ) + (('rider-off) + (let ((s5-5 (-> self child))) + (while s5-5 + (send-event (ppointer->process s5-5) 'rider-off) + (set! s5-5 (-> s5-5 0 brother)) + ) + ) + ) + (('rider-on) + (let ((s5-6 (-> self child))) + (while s5-6 + (send-event (ppointer->process s5-6) 'rider-on) + (set! s5-6 (-> s5-6 0 brother)) + ) + ) + ) + (else + (set! gp-0 #f) + ) + ) + (label cfg-131) + gp-0 + ) + ) + (defbehavior traffic-manager-init-by-other traffic-manager () (stack-size-set! (-> self main-thread) 128) (ctywide-entity-hack) @@ -304,7 +920,7 @@ :virtual #t :event traffic-manager-event-handler :enter (behavior () - (traffic-manager-method-17 self) + (spawn-all self) ) :code (behavior () (suspend) @@ -614,4 +1230,35 @@ :level #x7 ) ) - ) \ No newline at end of file + ) + +;; WARN: Function (method 22 traffic-manager) has a return type of none, but the expression builder found a return statement. +(defmethod traffic-manager-method-22 ((this traffic-manager)) + (if (not *cty-faction-manager*) + (return 0) + ) + (dotimes (v1-3 7) + (let ((a1-1 (-> *cty-faction-manager* faction-spawn v1-3 current-level)) + (a0-3 -1) + ) + (dotimes (a2-0 (-> *want-count-levels* length)) + (when (= (-> *want-count-levels* a2-0 level) a1-1) + (set! a0-3 a2-0) + 0 + (goto cfg-11) + ) + ) + (label cfg-11) + (when (>= a0-3 0) + (let ((a0-9 (-> *want-count-levels* a0-3 want-groups v1-3))) + (dotimes (a1-7 (-> a0-9 bindings length)) + (set! (-> *traffic-engine* object-type-info-array (-> a0-9 bindings a1-7 obj-type) want-count) + (the-as int (-> a0-9 bindings a1-7 count)) + ) + ) + ) + ) + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/bike.gc b/goal_src/jak3/levels/city/traffic/vehicle/bike.gc index 4ba7dfe3a8..193cd282ed 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/bike.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/bike.gc @@ -5,5 +5,1893 @@ ;; name in dgo: bike ;; dgos: CWI +(deftype bike-stack-var0 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (vec2 vector :inline :offset 32) + (mat matrix :inline :offset 48) + (vec3 vector :inline :offset 112) + (vec4 vector :inline :offset 128) + (vec5 vector :inline :offset 144) + ) + ) + ;; DECOMP BEGINS +(defskelgroup skel-h-bike-a bikea bikea-lod0-jg bikea-idle-ja + ((bikea-lod0-mg (meters 20)) (bikea-lod1-mg (meters 40)) (bikea-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.4) + :shadow bikea-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-h-bike-b bikeb bikeb-lod0-jg bikeb-idle-ja + ((bikeb-lod0-mg (meters 20)) (bikeb-lod1-mg (meters 40)) (bikeb-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.4) + :shadow bikeb-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-h-bike-c bikec bikec-lod0-jg bikec-idle-ja + ((bikec-lod0-mg (meters 20)) (bikec-lod1-mg (meters 40)) (bikec-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.8) + :shadow bikec-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-h-bike-d newbike newbike-lod0-jg newbike-idle-ja + ((newbike-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.4) + :shadow newbike-shadow-mg + :origin-joint-index 3 + ) + +(define *h-bike-explosion-info* + (new 'static 'vehicle-explosion-info + :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) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level 'ctywide + :skel #f + :skel-name "skel-vehicle-explosion" + :anim 2 + ) + ) + +(define *h-bike-a-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-bike-a-constants* + :flags #x70 + :object-type (traffic-type civilian-bike-a) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -819.2 :z 10240.0 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -10240.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x10 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x4 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 4096.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(define *h-bike-b-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-bike-b-constants* + :flags #x70 + :object-type (traffic-type civilian-bike-b) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :z 11059.2 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -8192.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 4096.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 757.76 :z 1175.552 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(define *h-bike-c-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-bike-c-constants* + :flags #x70 + :object-type (traffic-type civilian-bike-c) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 3640.889 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -614.4 :z 13721.6 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 614.4 :z -7168.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 8192.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 8192.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 802.816 :z 1318.912 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(define *h-bike-d-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-bike-d-constants* + :flags #x70 + :object-type (traffic-type bike-d) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -819.2 :z 10240.0 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -10240.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x10 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x4 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 4096.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(set! (-> *h-bike-a-constants* explosion) *h-bike-explosion-info*) + +(set! (-> *h-bike-b-constants* explosion) *h-bike-explosion-info*) + +(set! (-> *h-bike-c-constants* explosion) *h-bike-explosion-info*) + +(deftype h-bike-base (hvehicle) + () + ) + + +(defmethod rigid-body-object-method-38 ((this h-bike-base)) + (call-parent-method this) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (if (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf0)) + (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf0))) + (< 0.0 (-> this jump-time)) + ) + (sound-play "bike-hop") + ) + (if (zero? (-> this roll-sound-id)) + (set! (-> this roll-sound-id) (new-sound-id)) + ) + (let* ((f0-5 + (* 4.0 + (-> this force-scale) + (-> this sputter-sound-envelope) + (-> this info handling inv-max-engine-thrust) + (+ (-> this roll-thrust 0) (-> this roll-thrust 1)) + ) + ) + (f1-7 (* 0.32 f0-5)) + (f0-6 0.5) + ) + (sound-play-by-name + (static-sound-name "bike-thrust") + (-> this roll-sound-id) + (the int (* 1024.0 f1-7)) + (the int (* 1524.0 f0-6)) + 0 + (sound-group) + #t + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-78 ((this h-bike-base)) + (call-parent-method this) + (when (and (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + ) + (let ((s5-0 (new 'stack-no-clear 'bike-stack-var0))) + (let* ((v1-6 (-> s5-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-7 (-> a3-0 rvec quad)) + (a1-1 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-6 rvec quad) a0-7) + (set! (-> v1-6 uvec quad) a1-1) + (set! (-> v1-6 fvec quad) a2-0) + (set! (-> v1-6 trans quad) a3-1) + ) + (set-vector! (-> s5-0 vec4) 0.0 -1.0 0.0 1.0) + (vector-rotate*! (-> s5-0 vec4) (-> s5-0 vec4) (-> s5-0 mat)) + (let ((s4-0 (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y -1228.8 :z 2457.6 :w 1.0) + (new 'static 'vector :x -2048.0 :y -1228.8 :z 2457.6 :w 1.0) + ) + ) + (s3-0 (new 'static 'inline-array vector 2 + (new 'static 'vector :x -0.707 :y 0.707 :w 1.0) + (new 'static 'vector :x 0.707 :y 0.707 :w 1.0) + ) + ) + ) + (dotimes (s2-0 2) + (when (< 0.0 (-> this roll-thrust s2-0)) + (vector-rotate*! (-> s5-0 vec4) (-> s3-0 s2-0) (-> s5-0 mat)) + (vector-matrix*! (-> s5-0 vec3) (-> s4-0 s2-0) (-> s5-0 mat)) + (set! (-> s5-0 vec5 quad) (-> this rbody matrix uvec quad)) + (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (set! (-> s5-0 vec2 y) 1638.4) + (set! (-> s5-0 vec2 z) 12288.0) + (let ((f0-9 (* (-> this roll-thrust s2-0) (-> this force-scale) (-> this info info inv-mass))) + (f1-3 (-> this info extra gravity)) + ) + (set! (-> s5-0 vec2 x) (* f0-9 (/ 1.0 f1-3))) + ) + (set! (-> s5-0 vec2 w) (-> this fog-fade)) + (forward-up->quaternion (the-as quaternion (-> s5-0 vec0)) (-> s5-0 vec4) (-> s5-0 vec5)) + (vehicle-draw-thruster (-> this info particle-common) (the-as vehicle-draw-thruster-params (-> s5-0 vec0))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype h-bike-a (h-bike-base) + ((fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (rudder joint-mod-rotate-local :inline) + (brake-l joint-mod-rotate-local :inline) + (brake-r joint-mod-rotate-local :inline) + ) + ) + + +(defmethod init-collision! ((this h-bike-a)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 11264.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 -819.2 4505.6 3686.4) + (set! (-> v1-11 nav-radius) 6144.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-13 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 -3686.4 4096.0) + (set! (-> v1-13 nav-radius) 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 160)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 204.8 3276.8 1228.8 3276.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 -819.2 9011.2 1638.4) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 1228.8 -8601.6 2048.0) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this h-bike-a)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f28-0 (* -5461.3335 (-> this controls lean-z))) + (f26-0 (* -13653.333 (-> this controls brake))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f28-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f28-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f28-0) f30-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f28-0) f30-0)) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f26-0) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this h-bike-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-bike-a-constants*) + (init (-> this fin-fl) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 10) (joint-mod-base-flags attached)) + 0 + (none) + ) + +(deftype h-bike-b (h-bike-base) + ((fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (rudder joint-mod-rotate-local :inline) + (rudder-f joint-mod-rotate-local :inline) + (brake-l joint-mod-rotate-local :inline) + (brake-r joint-mod-rotate-local :inline) + (flap-l joint-mod-rotate-local :inline) + (flap-r joint-mod-rotate-local :inline) + ) + ) + + +(defmethod init-collision! ((this h-bike-b)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 11264.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 -409.6 4505.6 4300.8) + (set! (-> v1-11 nav-radius) 6144.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-13 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 -3686.4 4096.0) + (set! (-> v1-13 nav-radius) 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 160)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 204.8 3276.8 1228.8 3276.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 -819.2 9011.2 1638.4) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 1228.8 -8601.6 2048.0) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this h-bike-b)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 13653.333 (-> this controls brake))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0)) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this flap-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this flap-r rotation) s5-0 (- f28-0)) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this h-bike-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-bike-b-constants*) + (init (-> this fin-rl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this rudder-f) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this flap-l) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this flap-r) this (the-as uint 11) (joint-mod-base-flags attached)) + 0 + (none) + ) + +(deftype h-bike-c (h-bike-base) + ((fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (fin2-fl joint-mod-rotate-local :inline) + (fin2-fr joint-mod-rotate-local :inline) + (rudder joint-mod-rotate-local :inline) + (brake-l joint-mod-rotate-local :inline) + (brake-r joint-mod-rotate-local :inline) + (spoiler-l joint-mod-rotate-local :inline) + (spoiler-r joint-mod-rotate-local :inline) + ) + ) + + +(defmethod init-collision! ((this h-bike-c)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 13312.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 4505.6 4300.8) + (set! (-> v1-11 nav-radius) 7577.6) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-13 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 -3686.4 4096.0) + (set! (-> v1-13 nav-radius) 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 160)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 204.8 3276.8 1228.8 3276.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 9011.2 3686.4) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 1228.8 -8601.6 2048.0) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this h-bike-c)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 13653.333 (-> this controls brake))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this spoiler-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this spoiler-r rotation) s5-0 (- f28-0)) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this h-bike-c)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-bike-c-constants*) + (init (-> this fin-fl) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this fin2-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin2-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 11) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 12) (joint-mod-base-flags attached)) + (init (-> this spoiler-l) this (the-as uint 13) (joint-mod-base-flags attached)) + (init (-> this spoiler-r) this (the-as uint 14) (joint-mod-base-flags attached)) + 0 + (none) + ) + +(deftype h-bike-d (h-bike-a) + () + ) + + +(defmethod init-rbody-control! ((this h-bike-d)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-d" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-bike-d-constants*) + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (init (-> this fin-fl) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 10) (joint-mod-base-flags attached)) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-method-109 ((this h-bike-d)) + (cleanup-for-death this) + (go empty-state) + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/car.gc b/goal_src/jak3/levels/city/traffic/vehicle/car.gc index 2bee9eb05f..b2068b7edd 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/car.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/car.gc @@ -7,3 +7,1968 @@ ;; DECOMP BEGINS +(defskelgroup skel-h-car-a cara cara-lod0-jg cara-idle-ja + ((cara-lod0-mg (meters 20)) (cara-lod1-mg (meters 40)) (cara-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.2) + :shadow cara-shadow-mg + ) + +(defskelgroup skel-h-car-b carb carb-lod0-jg carb-idle-ja + ((carb-lod0-mg (meters 20)) (carb-lod1-mg (meters 40)) (carb-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow carb-shadow-mg + ) + +(defskelgroup skel-h-car-c carc carc-lod0-jg carc-idle-ja + ((carc-lod0-mg (meters 20)) (carc-lod1-mg (meters 40)) (carc-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.3) + :shadow carc-shadow-mg + ) + +(defskelgroup skel-h-hellcat hellcat hellcat-lod0-jg hellcat-idle-ja + ((hellcat-lod0-mg (meters 20)) (hellcat-lod1-mg (meters 40)) (hellcat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :shadow hellcat-shadow-mg + :origin-joint-index 3 + ) + +(define *h-car-explosion-info* + (new 'static 'vehicle-explosion-info + :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) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level 'ctywide + :skel #f + :skel-name "skel-vehicle-explosion" + :anim 2 + ) + ) + +(define *h-car-a-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 3) (meters 6)) + ) + :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 '*h-car-a-constants* + :flags #x68 + :object-type (traffic-type civilian-car-a) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 39) + :inv-max-engine-thrust 0.000006260016 + :engine-response-rate 20.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.4 + :air-drag-factor 1.0 + :steering-thruster-factor 3.0 + :steering-thruster-max-gain 3.5 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.6 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 3) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.09 + :engine-pitch-mod-amp 0.01 + :engine-sound-select 5 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-5") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :z -14336.0 :w 1.0) + (new 'static 'vector :x -3072.0 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6963.2 :y -1024.0 :z -7372.8 :w 1.0) + (new 'static 'vector :x -6963.2 :y -1024.0 :z -7372.8 :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 3072.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -3072.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 4915.2 :z 15564.8 :w 1.0) + (new 'static 'vector :x -4915.2 :z 15564.8 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 24.0 + :inv-hit-points 0.041666668 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 3 + :rider-stance #x1 + :grab-rail-count 6 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 6 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4505.6 :y -2662.4 :z 15360.0 :w 1.0) + (new 'static 'vector :x -4505.6 :y -2662.4 :z 15360.0 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 7372.8 :y -819.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x 7372.8 :y -819.2 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -7372.8 :y -819.2 :z 4096.0 :w 1.0) + (new 'static 'vector :x -7372.8 :y -819.2 :z -4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3686.4 :y -409.6 :z -14950.4 :w 1.0) + (new 'static 'vector :x 3686.4 :y -409.6 :z -14950.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3837.952 :y -409.6 :z -14950.4 :w 1.0) + (new 'static 'vector :x 6041.6 :y -614.4 :z -9011.2 :w 1.0) + ) + :normal (new 'static 'vector :x 0.707 :z -0.707 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -6041.6 :y -614.4 :z -9011.2 :w 1.0) + (new 'static 'vector :x -3837.952 :y -409.6 :z -14950.4 :w 1.0) + ) + :normal (new 'static 'vector :x -0.707 :z -0.707 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 4079.616 :y 819.2 :z -311.296 :w (the-as float #x30000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -4079.616 :y 819.2 :z -311.296 :w (the-as float #x30000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 3751.936 :z -10563.584 :w (the-as float #x40000)) + ) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 614.4 :y 614.4 :z 1433.6 :w 1.0) + (new 'static 'vector :x 614.4 :y 614.4 :z -1433.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +(define *h-car-b-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 6.0 + :inv-mass 0.16666667 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-car-b-constants* + :flags #x68 + :object-type (traffic-type civilian-car-b) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 40) + :inv-max-engine-thrust 0.0000061035157 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.4 + :air-drag-factor 1.0 + :steering-thruster-factor 3.5 + :steering-thruster-max-gain 3.8 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.55 + :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.69 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 3) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select 6 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-6") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4096.0 :y 1638.4 :z -13107.2 :w 1.0) + (new 'static 'vector :x -4096.0 :y 1638.4 :z -13107.2 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6553.6 :y 3072.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -6553.6 :y 3072.0 :z -10240.0 :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 4096.0 :y 1638.4 :z -10240.0 :w 1.0) + (new 'static 'vector :x -4096.0 :y 1638.4 :z -10240.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 4096.0 :y 2457.6 :z 15155.2 :w 1.0) + (new 'static 'vector :x -4096.0 :y 2457.6 :z 15155.2 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3891.2 :y 4096.0 :z -12697.6 :w 1.0) + (new 'static 'vector :x -3891.2 :y 4096.0 :z -12697.6 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 24.0 + :inv-hit-points 0.041666668 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 9011.2 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -9011.2 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 4 + :color (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + (new 'static 'vector :x 0.6 :y 1.0 :z 0.8 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 3 + :rider-stance #x1 + :grab-rail-count 5 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 5 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6963.2 :y -2048.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x 6963.2 :y -2048.0 :z 1638.4 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -6963.2 :y -2048.0 :z 1638.4 :w 1.0) + (new 'static 'vector :x -6963.2 :y -2048.0 :z -3276.8 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4096.0 :y -1638.4 :z 16384.0 :w 1.0) + (new 'static 'vector :x 3891.2 :y -1638.4 :z 16384.0 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3891.2 :y -1638.4 :z 16384.0 :w 1.0) + (new 'static 'vector :x -4096.0 :y -1638.4 :z 16384.0 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -819.2 :y 1024.0 :z -12697.6 :w 1.0) + (new 'static 'vector :x 819.2 :y 1024.0 :z -12697.6 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 4218.88 :y 999.424 :z -172.032 :w (the-as float #x30000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -3891.2 :y 999.424 :z -172.032 :w (the-as float #x30000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 3751.936 :z -8192.0 :w (the-as float #x40000)) + ) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 122.88 :y -1433.6 :z 614.4 :w 1.0) + (new 'static 'vector :x 122.88 :y 1433.6 :z 614.4 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +(define *h-car-c-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 9.0 + :inv-mass 0.11111111 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z -4096.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-car-c-constants* + :flags #x68 + :object-type (traffic-type civilian-car-c) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 35) + :inv-max-engine-thrust 0.0000069754465 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.4 + :air-drag-factor 1.0 + :steering-thruster-factor 3.0 + :steering-thruster-max-gain 3.0 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.75 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters -2) + :turning-accel (meters 15) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select 7 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-7") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3891.2 :z -15155.2 :w 1.0) + (new 'static 'vector :x -3891.2 :z -15155.2 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 3481.6 :z -20480.0 :w 1.0) + (new 'static 'vector :x -2457.6 :y 3481.6 :z -20480.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 + (new 'static 'vector :x -0.4 :z -0.92 :w 1.0) + (new 'static 'vector :x 0.4 :z -0.92 :w 1.0) + ) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4096.0 :y 2048.0 :z -14336.0 :w 1.0) + (new 'static 'vector :x -4096.0 :y 2048.0 :z -14336.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y 409.6 :z 8601.6 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2867.2 :y 2048.0 :z -18022.4 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z -18022.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 24.0 + :inv-hit-points 0.041666668 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 4915.2 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -13107.2 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z -4096.0 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z -4096.0 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -12288.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -4096.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -9830.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -12288.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 4 + :color (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 0.6 :y 1.2 :z 1.2 :w 1.0) + (new 'static 'vector :x 0.7 :y 1.25 :z 0.8 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.6 :z 1.5 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 4 + :rider-stance #x1 + :grab-rail-count 9 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 9 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 5324.8 :y -819.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x 5324.8 :y -819.2 :z 2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -5324.8 :y -819.2 :z 2048.0 :w 1.0) + (new 'static 'vector :x -5324.8 :y -819.2 :z -4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y -204.8 :z 9830.4 :w 1.0) + (new 'static 'vector :y -204.8 :z 10547.2 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y -204.8 :z 10547.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y -204.8 :z 9830.4 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -204.8 :y 3276.8 :z -20889.6 :w 1.0) + (new 'static 'vector :x 204.8 :y 3276.8 :z -20889.6 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :y 3481.6 :z -19660.8 :w 1.0) + (new 'static 'vector :x 3891.2 :y 3481.6 :z -16793.6 :w 1.0) + ) + :normal (new 'static 'vector :x 0.707 :z -0.707 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3891.2 :y 3481.6 :z -16793.6 :w 1.0) + (new 'static 'vector :x -3072.0 :y 3481.6 :z -19660.8 :w 1.0) + ) + :normal (new 'static 'vector :x -0.707 :z -0.707 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4915.2 :z -14745.6 :w 1.0) + (new 'static 'vector :x 4915.2 :z -12697.6 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -4915.2 :z -12697.6 :w 1.0) + (new 'static 'vector :x -4915.2 :z -14745.6 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 761.856 :z 1368.064 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2867.2 :y 1638.4 :z -2867.2 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2867.2 :y 1638.4 :z -2867.2 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 4239.36 :z -14192.64 :w (the-as float #x40000)) + ) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 696.32 :y -1433.6 :z 614.4 :w 1.0) + (new 'static 'vector :x 696.32 :y 1433.6 :z 614.4 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +(define *h-hellcat-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 20.0 + :inv-mass 0.05 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :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 '*h-hellcat-constants* + :flags #x4c + :object-type (traffic-type guard-car) + :guard-type #x5 + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 30) + :inv-max-engine-thrust 0.000008138021 + :engine-response-rate 8.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.3 + :air-drag-factor 1.0 + :steering-thruster-factor 3.0 + :steering-thruster-max-gain 2.0 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-speed-factor 61440.0 + :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 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters -2) + :turning-accel (meters 12) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select 8 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-8") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 3 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :y 4096.0 :z -17612.8 :w 1.0) + (new 'static 'vector :x -6144.0 :y 4096.0 :z -17612.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :y 5529.6 :z -17612.8 :w 1.0) + (new 'static 'vector :x -6144.0 :y 5529.6 :z -17612.8 :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 2048.0 :y 4096.0 :z -16384.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 4096.0 :z -16384.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 5734.4 :y 1843.2 :z 15769.6 :w 1.0) + (new 'static 'vector :x -5734.4 :y 1843.2 :z 15769.6 :w 1.0) + (new 'static 'vector :y 6963.2 :z 6922.24 :w 1.0) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 10362.88 :y 4710.4 :z -16998.4 :w 1.0) + (new 'static 'vector :x -10362.88 :y 4710.4 :z -16998.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.25 + :hit-points 30.0 + :inv-hit-points 0.033333335 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z 8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z 6144.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :y 2048.0 :z -7782.4 :w 1.0) + :brake-local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 3 + :rider-stance #x1 + :grab-rail-count 6 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 6 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 409.6 :z 24576.0 :w 1.0) + (new 'static 'vector :x 3276.8 :y 409.6 :z 25395.2 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3276.8 :y 409.6 :z 25395.2 :w 1.0) + (new 'static 'vector :x -3686.4 :y 409.6 :z 24576.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 8601.6 :z -409.6 :w 1.0) + (new 'static 'vector :x 8601.6 :y -409.6 :z 2867.2 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -8601.6 :y -409.6 :z 2867.2 :w 1.0) + (new 'static 'vector :x -8601.6 :z -409.6 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y -409.6 :z -15974.4 :w 1.0) + (new 'static 'vector :x 10240.0 :y -409.6 :z -13926.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -10240.0 :y -409.6 :z -13926.4 :w 1.0) + (new 'static 'vector :y -409.6 :z -15974.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 5120.0 :y 819.2 :z 2457.6 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -5120.0 :y 819.2 :z 2457.6 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 3686.4 :z -8192.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +(set! (-> *h-car-a-constants* explosion) *h-car-explosion-info*) + +(set! (-> *h-car-b-constants* explosion) *h-car-explosion-info*) + +(set! (-> *h-car-c-constants* explosion) *h-car-explosion-info*) + +(set! (-> *h-hellcat-constants* explosion) *h-car-explosion-info*) + +(deftype h-car-base (hvehicle) + ((rider-hand-joint-array int8 2) + ) + ) + + +(defmethod vehicle-method-113 ((this h-car-base) (arg0 vector) (arg1 int) (arg2 int)) + (vector-matrix*! + arg0 + (-> this info rider rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint-array arg1) bone transform) + ) + 0 + (none) + ) + +(deftype h-car-a (h-car-base) + ((steering-wheel-l joint-mod-rotate-local :inline) + (steering-wheel-r joint-mod-rotate-local :inline) + (fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (rudder-l joint-mod-rotate-local :inline) + (rudder-r joint-mod-rotate-local :inline) + (rudder joint-mod-rotate-local :inline) + ) + ) + + +(defmethod init-collision! ((this h-car-a)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 3686.4 0.0 12288.0 4096.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -3686.4 0.0 12288.0 4096.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 819.2 5734.4 4915.2) + (set! (-> v1-15 nav-radius) 14336.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 144)))) + (set! (-> v1-17 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 2048.0 -4096.0 5734.4) + (set! (-> v1-17 nav-radius) 14336.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 4915.2 0.0 -11468.8 4096.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) -4915.2 0.0 -11468.8 4096.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this h-car-a)) + (let ((f30-0 (* 3640.889 (-> this controls steering))) + (f28-0 (* 9102.223 (-> this controls steering))) + (f26-0 (* -3640.889 (-> this controls lean-z))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this steering-wheel-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this steering-wheel-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this h-car-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-car-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-car-a-constants*) + (set! (-> this rider-hand-joint-array 0) 11) + (set! (-> this rider-hand-joint-array 1) 12) + (init (-> this steering-wheel-l) this (the-as uint 11) (joint-mod-base-flags attached)) + (init (-> this steering-wheel-r) this (the-as uint 12) (joint-mod-base-flags attached)) + (init (-> this fin-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this rudder-l) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this rudder-r) this (the-as uint 9) (joint-mod-base-flags attached)) + 0 + (none) + ) + +(deftype h-car-b (h-car-base) + ((steering-wheel-l joint-mod-rotate-local :inline) + (steering-wheel-r joint-mod-rotate-local :inline) + (fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + ) + ) + + +(defmethod init-collision! ((this h-car-b)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 3686.4 409.6 13107.2 3686.4) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -3686.4 409.6 13107.2 3686.4) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 819.2 6553.6 4096.0) + (set! (-> v1-15 nav-radius) 14336.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 128)))) + (set! (-> v1-17 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 2457.6 -2457.6 5734.4) + (set! (-> v1-17 nav-radius) 14336.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 4505.6 409.6 -11059.2 3686.4) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) -4505.6 409.6 -11059.2 3686.4) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this h-car-b)) + (let ((f30-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 9102.223 (-> this controls steering))) + (gp-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this steering-wheel-l rotation) gp-0 f28-0) + (quaternion-vector-angle! (-> this steering-wheel-r rotation) gp-0 f28-0) + (quaternion-vector-angle! (-> this fin-fl rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-fr rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this h-car-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-car-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-car-b-constants*) + (set! (-> this rider-hand-joint-array 0) 8) + (set! (-> this rider-hand-joint-array 1) 9) + (init (-> this steering-wheel-l) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this steering-wheel-r) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this fin-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 7) (joint-mod-base-flags attached)) + 0 + (none) + ) + +(deftype h-car-c (h-car-base) + ((steering-wheel joint-mod-rotate-local :inline) + (fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (fin2-rl joint-mod-rotate-local :inline) + (fin2-rr joint-mod-rotate-local :inline) + ) + ) + + +(defmethod init-collision! ((this h-car-c)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 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 21299.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 3686.4 -819.2 6963.2 3276.8) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -3686.4 -819.2 6963.2 3276.8) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 128)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 2457.6 0.0 6144.0) + (set! (-> v1-15 nav-radius) 12288.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-17 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 2048.0 -10240.0 4915.2) + (set! (-> v1-17 nav-radius) 10240.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 2048.0 -16384.0 4096.0) + ) + (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 21299.2) + ) + (set! (-> s5-0 nav-radius) 16384.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! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this h-car-c)) + (let ((f30-0 (* -5461.3335 (-> this controls steering))) + (f28-0 (* -5461.3335 (-> this controls lean-z))) + (f0-3 (* 9102.223 (-> this controls steering))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) + (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this h-car-c)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-car-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-car-c-constants*) + (set! (-> this rider-hand-joint-array 0) 10) + (init (-> this steering-wheel) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this fin-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this fin2-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin2-rr) this (the-as uint 7) (joint-mod-base-flags attached)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/test-bike.gc b/goal_src/jak3/levels/city/traffic/vehicle/test-bike.gc index 664b25d3c2..91cc293b05 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/test-bike.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/test-bike.gc @@ -7,3 +7,726 @@ ;; DECOMP BEGINS +(deftype test-bike (h-bike-c) + () + ) + + +(define *test-bike-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :friction-factor 0.516 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 1.5) (meters 2) (meters 5)) + ) + :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 '*test-bike-constants* + :flags #x11 + :object-type (traffic-type civilian-bike-c) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 32.0 + :engine-intake-factor 1.0 + :brake-factor 2.0 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 100) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :ground-probe-offset (meters 0.5) + :cos-ground-effect-angle 0.00000000000000006123032 + :spring-lift-factor 0.35 + :air-drag-factor 1.2 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 6.0 + :steering-thruster-max-gain 2.0 + :steering-thruster-half-gain-speed (meters 80) + :tire-steering-angle 1274.3112 + :tire-steering-speed-factor 61440.0 + :tire-static-friction 0.5 + :tire-static-friction-speed (meters 1) + :tire-dynamic-friction 0.25 + :tire-dynamic-friction-speed (meters 3) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 8.0 + :drag-force-factor 1.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :roll-angle 7281.778 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 0.125) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 2.5) + :string-max-height (meters 2.5) + :string-min-length (meters 5) + :string-max-length (meters 5.5) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 2 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -614.4 :z 13721.6 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 614.4 :z -7168.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.25) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.75) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 0.25) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 8192.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 8192.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 802.816 :z 1318.912 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(defmethod init-rbody-control! ((this test-bike)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *test-bike-constants*) + (init (-> this fin-fl) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this fin2-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin2-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 11) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 12) (joint-mod-base-flags attached)) + (init (-> this spoiler-l) this (the-as uint 13) (joint-mod-base-flags attached)) + (init (-> this spoiler-r) this (the-as uint 14) (joint-mod-base-flags attached)) + 0 + (none) + ) + +(deftype evan-test-bike (h-bike-a) + () + ) + + +(define *evan-test-bike-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*evan-test-bike-constants* + :flags #x70 + :object-type (traffic-type civilian-bike-a) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 30.0 + :engine-intake-factor 1.0 + :brake-factor 2.0 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -819.2 :z 10240.0 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -10240.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x10 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x4 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 0.6 :y 0.6 :z 1.5 :w 1.0)) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 4096.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(defmethod init-rbody-control! ((this evan-test-bike)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *evan-test-bike-constants*) + (init (-> this fin-fl) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 10) (joint-mod-base-flags attached)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-control.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-control.gc index 72a4b94a34..f351345df4 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-control.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-control.gc @@ -50,7 +50,7 @@ ) (:methods (vehicle-controller-method-9 (_type_) none) - (vehicle-controller-method-10 (_type_ traffic-tracker) none) + (vehicle-controller-method-10 (_type_ nav-branch) none) (vehicle-controller-method-11 (_type_) none) (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none) (vehicle-controller-method-13 (_type_ nav-branch vector) none) @@ -168,7 +168,7 @@ ) (defmethod vehicle-controller-method-13 ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) - (vehicle-controller-method-10 this (the-as traffic-tracker arg0)) + (vehicle-controller-method-10 this arg0) (set! (-> this path-prev-point quad) (-> arg1 quad)) (set! (-> this branch) arg0) (let ((v1-3 arg0)) @@ -325,10 +325,10 @@ ) ) -(defmethod vehicle-controller-method-10 ((this vehicle-controller) (arg0 traffic-tracker)) +(defmethod vehicle-controller-method-10 ((this vehicle-controller) (arg0 nav-branch)) (when (not (logtest? (-> this flags) (vehicle-controller-flag attached))) (logior! (-> this flags) (vehicle-controller-flag attached)) - (+! (-> arg0 active-object-count) 1) + (+! (-> arg0 user-count) 1) ) 0 (none) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc index b74598fde2..2d548c8d7b 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc @@ -448,7 +448,7 @@ (look-select uint8) (color-option-count int8) (color-option-select int8) - (color vector) + (color (inline-array vector)) (gun-yaw-min float) (gun-yaw-max float) (gun-pitch-min float) @@ -519,7 +519,7 @@ (deftype rigid-body-vehicle-constants (rigid-body-object-constants) ((flags uint32) - (object-type uint8) + (object-type traffic-type) (guard-type uint8) (vehicle-type vehicle-type-u8) (engine vehicle-engine-info :inline) @@ -554,7 +554,8 @@ (deftype vehicle (rigid-body-object) - ((info rigid-body-vehicle-constants :override) + ((self vehicle :override) + (info rigid-body-vehicle-constants :override) (v-flags vehicle-flag :overlay-at flags) (unknown-flags vehicle-flag :offset 296) (squad squad-control) @@ -632,7 +633,7 @@ (vehicle-method-70 (_type_) uint) (get-best-seat (_type_ vector vehicle-seat-flag int) int) (remove-riders (_type_ handle) none) - (vehicle-method-73 (_type_) none) + (vehicle-method-73 (_type_) float) (vehicle-method-74 (_type_ int time-frame) none) (vehicle-method-75 (_type_) none) (vehicle-method-76 (_type_) none) @@ -690,7 +691,7 @@ (vehicle-method-128 (_type_) symbol) (vehicle-method-129 (_type_) none) (vehicle-method-130 (_type_) none) - (vehicle-method-131 (_type_) none) + (vehicle-method-131 (_type_ traffic-object-spawn-params) none) (vehicle-method-132 (_type_ traffic-object-spawn-params) none) (vehicle-method-133 (_type_ traffic-object-spawn-params) none) (vehicle-method-134 (_type_) none) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-rider.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-rider.gc index dff7d6537a..15786c6ac9 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-rider.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-rider.gc @@ -5,5 +5,372 @@ ;; name in dgo: vehicle-rider ;; dgos: HGA, CWI, LFACTORY +;; +++vehicle-rider-flag +(defenum vehicle-rider-flag + :type uint8 + :bitfield #t + (vr0 0) + (vr1 1) + (vr2 2) + (vr3 3) + ) +;; ---vehicle-rider-flag + + ;; DECOMP BEGINS +(deftype vehicle-rider (process-focusable) + ((parent (pointer vehicle) :override) + (squad squad-control) + (flags vehicle-rider-flag) + (riding-anim int32) + (anim-t float) + (anim-speed float) + (seat-index int8) + ) + (:state-methods + inactive + active + taunt + got-passed + ) + (:methods + (initialize-collision (_type_) none) + (setup-lods (_type_) none) + (setup (_type_) none) + (vehicle-rider-post (_type_) none) + (go-inactive (_type_) none) + ) + ) + + +(defmethod get-trans ((this vehicle-rider) (arg0 int)) + "Get the `trans` for this process." + (-> this root trans) + ) + +(defmethod setup ((this vehicle-rider)) + (let* ((s4-0 (ppointer->process (-> this parent))) + (s5-0 (if (type? s4-0 vehicle) + s4-0 + ) + ) + ) + (logclear! (-> this flags) (vehicle-rider-flag vr2)) + (if (and s5-0 (nonzero? (vehicle-method-70 s5-0))) + (logior! (-> this flags) (vehicle-rider-flag vr2)) + ) + (put-rider-in-seat s5-0 (-> this seat-index) this) + ) + (set! (-> this anim-speed) (rand-vu-float-range 0.8 1.2)) + 0 + (none) + ) + +(defmethod go-inactive ((this vehicle-rider)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (put-rider-in-seat (ppointer->process (-> this parent)) (-> this seat-index) (the-as process #f)) + (go (method-of-object this inactive)) + 0 + (none) + ) + +(defmethod initialize-collision ((this vehicle-rider)) + (stack-size-set! (-> this main-thread) 16) + (ctywide-entity-hack) + (when (not (-> this level)) + (format 0 "vehicle-rider::initialize-collision: ERROR, no lwide level found~%") + (stack-size-set! (-> this main-thread) 256) + (go process-drawable-art-error "no lwide level found") + ) + (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) + 0 + (none) + ) + +(defmethod setup-lods ((this vehicle-rider)) + (logior! (-> this flags) (vehicle-rider-flag vr0)) + (set! (-> this draw lod-set lod 0 dist) 40960.0) + (set! (-> this draw lod-set lod 1 dist) 122880.0) + (set! (-> this draw lod-set lod 2 dist) 245760.0) + (set! (-> this draw lod-set lod 3 dist) 614400.0) + (set! (-> this seat-index) 0) + (set! (-> this anim-t) (* 65536.0 (rand-vu))) + (setup this) + 0 + (none) + ) + +(defmethod vehicle-rider-post ((this vehicle-rider)) + (let ((a0-1 (ppointer->process (-> this parent)))) + (when a0-1 + (+! (-> this anim-t) (* 41870.223 (-> this anim-speed) (seconds-per-frame))) + (if (< 65536.0 (-> this anim-t)) + (+! (-> this anim-t) -65536.0) + ) + (let* ((f0-5 (vehicle-method-73 a0-1)) + (f0-9 (+ (* 5.0 (- 1.0 f0-5)) (sin (-> this anim-t)))) + (gp-1 (-> this skel root-channel 0)) + ) + (set! (-> gp-1 num-func) num-func-identity) + (set! (-> gp-1 frame-num) (ja-aframe f0-9 0)) + ) + ) + ) + (ja-post) + 0 + (none) + ) + +(defbehavior vehicle-rider-event-handler vehicle-rider ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('traffic-on) + (logior! (-> self flags) (vehicle-rider-flag vr1)) + (when (logtest? (-> self flags) (vehicle-rider-flag vr0)) + (setup self) + (go-virtual active) + ) + ) + (('traffic-off) + (logclear! (-> self flags) (vehicle-rider-flag vr1)) + (go-inactive self) + ) + (('knocked-off) + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (let ((v1-14 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) + (set! (-> gp-0 object-type) (traffic-type civilian-male)) + (set! (-> gp-0 behavior) (the-as uint 11)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 nav-mesh) v1-14) + ) + (set! (-> gp-0 nav-branch) #f) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 handle) (process->handle (-> self parent 0))) + (set! (-> gp-0 user-data) (-> self draw seg-mask)) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (set! (-> gp-0 guard-type) (the-as uint 11)) + (set! (-> gp-0 entity) #f) + (vector-reset! (-> gp-0 velocity)) + (when (logtest? (-> self flags) (vehicle-rider-flag vr3)) + (squad-control-method-18 (-> self squad) 2 *target*) + (set! (-> gp-0 object-type) (traffic-type guard-a)) + ) + (set! (-> gp-0 position quad) (-> self root trans quad)) + (quaternion-copy! (-> gp-0 rotation) (-> self root quat)) + (send-event *traffic-manager* 'activate-object gp-0) + ) + (logclear! (-> self flags) (vehicle-rider-flag vr1)) + (go-inactive self) + ) + (('race-pass 'taunt) + (go-virtual taunt) + ) + (('race-got-passed) + (go-virtual got-passed) + ) + (('hide) + (set! v0-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('unhide) + (set! v0-0 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('rider-on) + (logior! (-> self flags) (vehicle-rider-flag vr0)) + (if (logtest? (-> self flags) (vehicle-rider-flag vr1)) + (go-virtual active) + ) + ) + (('rider-off) + (logclear! (-> self flags) (vehicle-rider-flag vr0)) + (go-inactive self) + ) + ) + ) + +(defstate active (vehicle-rider) + :virtual #t + :event vehicle-rider-event-handler + :enter (behavior () + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data (-> self riding-anim))) + ) + :code sleep-code + :post (behavior () + (vehicle-rider-post self) + ) + ) + +(defstate taunt (vehicle-rider) + :virtual #t + :event vehicle-rider-event-handler + :code sleep-code + :post (behavior () + (go-virtual active) + (vehicle-rider-post self) + ) + ) + +(defstate got-passed (vehicle-rider) + :virtual #t + :event vehicle-rider-event-handler + :code sleep-code + :post (behavior () + (go-virtual active) + (vehicle-rider-post self) + ) + ) + +(defstate inactive (vehicle-rider) + :virtual #t + :event vehicle-rider-event-handler + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this vehicle-rider) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +(defbehavior vehicle-rider-init-by-other vehicle-rider ((arg0 traffic-object-spawn-params)) + (set! (-> self squad) *ff-squad-control*) + (initialize-collision self) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 rotation)) + (logior! (-> self focus-status) (focus-status pilot-riding)) + (setup-lods self) + (cond + ((= (-> arg0 behavior) 1) + (go-inactive self) + ) + (else + (logior! (-> self flags) (vehicle-rider-flag vr1)) + (go-virtual active) + ) + ) + ) + +(defun vehicle-rider-spawn ((arg0 vehicle) (arg1 type) (arg2 traffic-object-spawn-params)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* arg1 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg0 "rider" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 vehicle-rider-init-by-other arg2) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +(deftype citizen-norm-rider (vehicle-rider) + () + ) + + +(defskelgroup skel-citizen-norm-rider citizen-norm-rider citizen-norm-rider-lod0-jg citizen-norm-rider-idle-ja + ((citizen-norm-rider-lod0-mg (meters 20)) (citizen-norm-rider-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) + +(defmethod setup ((this citizen-norm-rider)) + (call-parent-method this) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 32 0) + (cond + ((logtest? (-> this flags) (vehicle-rider-flag vr2)) + (set! (-> this riding-anim) 5) + (setup-masks (-> this draw) #x40000 0) + ) + (else + (set! (-> this riding-anim) 4) + (setup-masks (-> this draw) #x20000 0) + ) + ) + (let ((v1-12 (rand-vu-int-count 2))) + (cond + ((zero? v1-12) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-12 1) + (setup-masks (-> this draw) 4096 0) + ) + ) + ) + (let ((v1-18 (rand-vu-int-count 3))) + (cond + ((zero? v1-18) + (setup-masks (-> this draw) 8 0) + ) + ((= v1-18 1) + (setup-masks (-> this draw) 512 0) + ) + ((= v1-18 2) + (setup-masks (-> this draw) #x4000 0) + ) + ) + ) + (let ((v1-26 (rand-vu-int-count 4))) + (cond + ((zero? v1-26) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-26 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-26 2) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + (let ((v1-34 (rand-vu-int-count 3))) + (cond + ((zero? v1-34) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-34 1) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-34 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + (setup-masks (-> this draw) 16 0) + (if (zero? (rand-vu-int-count 3)) + (setup-masks (-> this draw) 128 0) + ) + 0 + (none) + ) + +(defmethod setup-lods ((this citizen-norm-rider)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm-rider" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this flags) (vehicle-rider-flag vr0)) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 286720.0) + (setup this) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc index 4d1ac7255e..0b7469c9f0 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc @@ -527,10 +527,8 @@ (-> this info rider rider-stance) ) -;; WARN: Return type mismatch float vs none. (defmethod vehicle-method-73 ((this vehicle)) (-> this controls steering) - (none) ) (defmethod get-linear-accel! ((this vehicle) (arg0 vector)) @@ -676,9 +674,7 @@ (set-time! (-> this state-time)) (let ((v1-19 (-> this info setup))) (let ((a1-0 (-> v1-19 color-option-select))) - (set! (-> this draw color-mult quad) - (-> (the-as (pointer uint128) (+ (the-as uint (-> v1-19 color)) (* a1-0 16)))) - ) + (set! (-> this draw color-mult quad) (-> v1-19 color a1-0 quad)) ) (+! (-> v1-19 color-option-select) 1) (when (>= (-> v1-19 color-option-select) (-> v1-19 color-option-count)) @@ -1092,7 +1088,7 @@ (let ((v1-0 (-> arg0 behavior))) (cond ((= v1-0 1) - (vehicle-method-131 this) + (vehicle-method-131 this arg0) (vehicle-method-109 this) ) ((zero? v1-0) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc index 0f75dc3329..54327da216 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc @@ -563,6 +563,7 @@ (none) ) +;; WARN: Return type mismatch int vs object. (defmethod rigid-body-object-method-30 ((this vehicle)) (cond ((logtest? (vehicle-flag sounds) (-> this v-flags)) @@ -596,7 +597,6 @@ (set! (-> this unknown-flags) (-> this v-flags)) (ja-post) 0 - (none) ) (defmethod rigid-body-object-method-54 ((this vehicle)) @@ -1349,7 +1349,7 @@ ) ) -(defmethod vehicle-method-131 ((this vehicle)) +(defmethod vehicle-method-131 ((this vehicle) (arg0 traffic-object-spawn-params)) 0 (none) ) diff --git a/goal_src/jak3/levels/comb/h-sled.gc b/goal_src/jak3/levels/comb/h-sled.gc index f901006537..4c80b104bc 100644 --- a/goal_src/jak3/levels/comb/h-sled.gc +++ b/goal_src/jak3/levels/comb/h-sled.gc @@ -99,7 +99,7 @@ (vector+! (-> this root trans) (-> this root trans) (new 'static 'vector :w 1.0)) (quaternion-rotate-y! (-> this root quat) (-> this root quat) 32768.0) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 object-type) (traffic-type guard-a)) (set! (-> s4-0 behavior) (the-as uint 0)) (set! (-> s4-0 id) (the-as uint 0)) (set! (-> s4-0 nav-mesh) #f) @@ -456,7 +456,7 @@ ) :name '*h-sled-constants* :flags #x4009 - :object-type #x14 + :object-type (traffic-type civilian-car-a) :guard-type #xb :vehicle-type (vehicle-type-u8 vt27) :transmission (new 'static 'vehicle-transmission-info :gear-count 1) @@ -721,7 +721,7 @@ :shadow-bot-clip -40960.0 :shadow-locus-dist 409600.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 diff --git a/goal_src/jak3/levels/common/ai/bot.gc b/goal_src/jak3/levels/common/ai/bot.gc index 268b98ca91..b94fb74d81 100644 --- a/goal_src/jak3/levels/common/ai/bot.gc +++ b/goal_src/jak3/levels/common/ai/bot.gc @@ -371,9 +371,9 @@ ) ) -(defmethod penetrate->next-state ((this bot)) +(defmethod penetrate->next-state ((this bot) (arg0 process) (arg1 event-message-block) (arg2 float)) (let* ((t9-0 (method-of-type nav-enemy penetrate->next-state)) - (v0-0 (t9-0 this)) + (v0-0 (t9-0 this arg0 arg1 arg2)) ) (if (logtest? (-> this bot-flags) (bot-flag bf03)) (set! v0-0 #f) diff --git a/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc b/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc index 9f6d446b56..502fe7a2a0 100644 --- a/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc +++ b/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc @@ -2468,8 +2468,11 @@ ) ) :exit (behavior () - (let ((v1-0 (-> self nav))) - (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-0 (-> self nav))) + (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ) ) 0 (logior! (-> self mask) (process-mask actor-pause)) diff --git a/goal_src/jak3/levels/common/enemy/mantis.gc b/goal_src/jak3/levels/common/enemy/mantis.gc index 7d3cc6ef94..fc8c26195e 100644 --- a/goal_src/jak3/levels/common/enemy/mantis.gc +++ b/goal_src/jak3/levels/common/enemy/mantis.gc @@ -801,8 +801,11 @@ :virtual #t :event enemy-event-handler :exit (behavior () - (let ((v1-0 (-> self nav))) - (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-0 (-> self nav))) + (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ) ) 0 ) @@ -1012,8 +1015,11 @@ ) :exit (behavior () (change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 0) self) - (let ((v1-2 (-> self nav))) - (set! (-> v1-2 max-rotation-rate) (-> self enemy-info maximum-rotation-rate)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-2 (-> self nav))) + (set! (-> v1-2 max-rotation-rate) (-> self enemy-info maximum-rotation-rate)) + ) ) 0 ) diff --git a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc index c4d6321a45..df7ec2c630 100644 --- a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc +++ b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc @@ -960,8 +960,11 @@ :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) (nav-enemy-method-179 self) - (let ((v1-4 (-> self nav))) - (set! (-> v1-4 target-speed) (-> self enemy-info run-travel-speed)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (-> self enemy-info run-travel-speed)) + ) ) 0 (let ((v1-6 (-> self nav))) @@ -1325,8 +1328,11 @@ ) :exit (behavior () (quaternion-identity! (-> self spin-jm quat)) - (let ((v1-1 (-> self nav))) - (logclear! (-> v1-1 shape nav-flags) (nav-flags has-extra-sphere)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-1 (-> self nav))) + (logclear! (-> v1-1 shape nav-flags) (nav-flags has-extra-sphere)) + ) ) 0 ) diff --git a/goal_src/jak3/levels/common/enemy/roboguard.gc b/goal_src/jak3/levels/common/enemy/roboguard.gc index 0e424252f8..3501e78f61 100644 --- a/goal_src/jak3/levels/common/enemy/roboguard.gc +++ b/goal_src/jak3/levels/common/enemy/roboguard.gc @@ -706,8 +706,11 @@ (defstate hostile (roboguard) :virtual #t :exit (behavior () - (let ((v1-0 (-> self nav))) - (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-0 (-> self nav))) + (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ) ) 0 ) diff --git a/goal_src/jak3/levels/common/enemy/spyder.gc b/goal_src/jak3/levels/common/enemy/spyder.gc index fcee22180d..19d6795e2c 100644 --- a/goal_src/jak3/levels/common/enemy/spyder.gc +++ b/goal_src/jak3/levels/common/enemy/spyder.gc @@ -1008,8 +1008,11 @@ ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) - (let ((v1-2 (-> self nav))) - (set! (-> v1-2 max-rotation-rate) (-> *spyder-nav-enemy-info* maximum-rotation-rate)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-2 (-> self nav))) + (set! (-> v1-2 max-rotation-rate) (-> *spyder-nav-enemy-info* maximum-rotation-rate)) + ) ) 0 ) diff --git a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc index 3035c0944d..556d2b5893 100644 --- a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc +++ b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc @@ -1174,8 +1174,11 @@ :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) (nav-enemy-method-179 self) - (let ((v1-4 (-> self nav))) - (set! (-> v1-4 target-speed) (-> self enemy-info run-travel-speed)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (-> self enemy-info run-travel-speed)) + ) ) 0 (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) diff --git a/goal_src/jak3/levels/common/enemy/spydroid.gc b/goal_src/jak3/levels/common/enemy/spydroid.gc index 22168de60a..8c8fb23de7 100644 --- a/goal_src/jak3/levels/common/enemy/spydroid.gc +++ b/goal_src/jak3/levels/common/enemy/spydroid.gc @@ -7,3 +7,1583 @@ ;; DECOMP BEGINS +(defpart 4699 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 4700 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4701 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 64.0) + (:b 0.0) + (:a 32.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4702 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 32.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4703 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 12.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4704 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 64.0) + (:b 0.0) + (:a 12.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4705 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 12.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4706 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.1)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 64.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4707 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.1)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 64.0) + (:b 0.0) + (:a 64.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4708 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.1)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defskelgroup skel-spydroid spydroid spydroid-lod0-jg spydroid-idle-ja + ((spydroid-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow spydroid-shadow-mg + ) + +(define *spydroid-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 21 :group "skel-kg-debris-c") + ) + ) + ) + +(deftype sensor-light-info (structure) + ((joint int16) + (part-index int16) + (offset vector :inline) + ) + ) + + +(deftype spydroid (kg-squad-member) + ((old-y-deg float) + (diff-angle float) + (desire-turn symbol) + (hit-target symbol) + (floor float) + (explode-part sparticle-launch-control) + (alert-level uint8) + (next-check-player-time time-frame) + (part-ids int16 9) + (sensor-lights sensor-light-info 3 :inline) + (last-sensor-time time-frame) + (exiting-wait? symbol) + ) + (:state-methods + attack + search + hunting + scan + undefined0 + spydroid-notice + flip + wait-for-vulnerable + exit-transport + ) + (:methods + (spydroid-method-231 (_type_ uint) object) + (spydroid-method-232 (_type_) int) + (spydroid-method-233 (_type_) int) + (spydroid-method-234 (_type_ vector) float) + (spydroid-method-235 (_type_) symbol) + (spydroid-method-236 (_type_) object) + (spydroid-method-237 (_type_ traffic-danger-info) symbol) + ) + (:states + wait-for-vulnerable-close + ) + ) + + +(define *spydroid-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 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 5 + :hit-anim -1 + :knocked-anim 9 + :knocked-land-anim 10 + :die-anim -1 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 4 + :look-at-joint 4 + :bullseye-joint 4 + :sound-hit (static-sound-name "spydroid-hit") + :sound-die (static-sound-name "spydroid-die") + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim -1 + :run-anim 5 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *spydroid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod enemy-common-post ((this spydroid)) + (spydroid-method-236 this) + ((method-of-type kg-squad-member enemy-common-post) this) + 0 + (none) + ) + +(defmethod event-handler ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('jump) + (set! (-> this floor) (-> (the-as enemy-jump-info (-> arg3 param 1)) anim-speed)) + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate knocked (spydroid) + :virtual #t + :enter (behavior () + (sound-play "droid-explode") + (cond + ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) quad) + ) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 221)) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) quad) + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 221)) + ) + ) + (if (not (-> *setting-control* user-current gun-special-mode)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + ) + (cleanup-for-death self) + ) + :code sleep-code + ) + +(defstate die-falling (spydroid) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member die-falling) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (not (time-elapsed? (-> self state-time) (seconds 2))) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 219)) + ) + ) + ) + ) + :code (behavior () + (if (not (-> *setting-control* user-current gun-special-mode)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + ) + (cleanup-for-death self) + ) + ) + +(defmethod spydroid-method-233 ((this spydroid)) + (when (handle->process (-> this focus handle)) + (let ((s4-0 (handle->process (-> this focus handle))) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> (the-as process-focusable s4-0) root root-prim prim-core world-sphere quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> this root trans)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (when (< (- (vector-normalize-ret-len! s5-1 1.0) (-> s3-0 w)) 10240.0) + (if (not (and s4-0 + (not (logtest? (-> (the-as process-focusable s4-0) focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + (return 3) + ) + (let ((gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (let ((f0-6 (vector-dot s5-1 gp-1))) + (cond + ((< 0.85 f0-6) + (return 2) + ) + ((< f0-6 0.0) + (return 1) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defstate wait-for-vulnerable-close (spydroid) + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + ) + :trans (behavior () + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when gp-0 + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (get-trans gp-0 0)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (let ((f0-2 (vector-normalize-ret-len! s5-1 1.0))) + (when (< 20480.0 f0-2) + (cond + ((and self (not (logtest? (-> self focus-status) (focus-status disable dead ignore grabbed)))) + (set! (-> self exiting-wait?) #t) + (go-virtual hostile) + ) + (else + (go-virtual wait-for-vulnerable) + ) + ) + ) + ) + (vector-float*! s5-1 s5-1 49152.0) + (let ((s4-2 (vector+! (new 'stack-no-clear 'vector) (get-trans gp-0 0) s5-1))) + (nav-mesh-method-10 (-> self nav state mesh) s4-2 s4-2 (the-as nav-poly #f)) + (let ((v1-26 (-> self nav state))) + (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-26 target-pos quad) (-> s4-2 quad)) + ) + ) + ) + 0 + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (not (and v1-2 (= v1-2 spydroid-run-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! spydroid-run-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate wait-for-vulnerable (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when gp-0 + (if (and (= (-> gp-0 type) target) + (< (vector-vector-xz-distance (-> self root trans) (get-trans gp-0 0)) 12288.0) + ) + (go wait-for-vulnerable-close) + ) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) + (and self (not (logtest? (-> self focus-status) (focus-status disable dead ignore grabbed)))) + (or (< 20480.0 (vector-vector-xz-distance (-> self root trans) (get-trans gp-0 0))) + (time-elapsed? (-> self state-time) (seconds 1.5)) + ) + ) + (set! (-> self exiting-wait?) #t) + (go-virtual hostile) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! spydroid-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (transform-post) + ) + ) + +(defstate hostile (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (spydroid-method-231 self (the-as uint 3)) + (nav-enemy-method-181 self) + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set! (-> self exiting-wait?) #f) + (if (-> self nav) + (nav-enemy-method-176 self) + ) + ) + :trans (behavior () + (let ((gp-0 (handle->process (-> self focus handle))) + ;; og:preserve-this + (go? (the object #f))) + (if (and (the-as process-focusable gp-0) + (not (and (the-as process-focusable gp-0) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + (= (-> (the-as process-focusable gp-0) type) target) + ) + (go-virtual wait-for-vulnerable) + ) + ;; og:preserve-this + (set! go? + (and (or (time-elapsed? (-> self state-time) (-> self reaction-time)) (-> self exiting-wait?)) gp-0) + ) + (when go? + (case (spydroid-method-233 self) + ((2) + (go-virtual attack) + ) + ((1) + (go-virtual flip) + ) + ((3) + (go-virtual wait-for-vulnerable) + ) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (not (and v1-2 (= v1-2 spydroid-run-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja :group! spydroid-run-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (* (rnd-float-range self 0.9 1.1) (-> self travel-anim-scale-speed)))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-chase-post) + ) + ) + +(defmethod spydroid-method-234 ((this spydroid) (arg0 vector)) + (let ((gp-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + 0.0 + 0.0 + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (set! (-> gp-0 y) 0.0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-normalize! gp-0 1.0) + (vector-normalize! s4-0 1.0) + (let* ((f0-7 (vector-dot s5-1 s4-0)) + (f0-8 (acos f0-7)) + ) + (if (< (vector-dot s5-1 gp-0) 0.0) + (set! f0-8 (* -1.0 f0-8)) + ) + f0-8 + ) + ) + ) + ) + +(defstate flip (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (nav-enemy-method-182 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f28-0 0.0) + (f0-0 0.0) + (f30-0 1.0) + ) + (let ((a0-2 (the-as process-focusable (handle->process (-> self focus handle))))) + (when a0-2 + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> (get-trans a0-2 3) quad)) + (set! f0-0 (spydroid-method-234 self gp-0)) + ) + (set! f28-0 (* 0.00024414062 f0-0)) + ) + ) + (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (set! f30-0 -1.0) + ) + (cond + ((>= f0-0 0.0) + (ja-no-eval :group! spydroid-turn-180-ja :num! (seek! f28-0) :frame-num 0.0) + (until (>= (ja-frame-num 0) f28-0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 65536.0 (seconds-per-frame) f30-0)) + (ja :num! (seek! f28-0)) + (suspend) + ) + ) + (else + (ja-no-eval :group! spydroid-turn-180-ja :num! (seek! 0.0) :frame-num (fabs f28-0)) + (until (= (ja-frame-num 0) 0.0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* -65536.0 (seconds-per-frame) f30-0)) + (ja :num! (seek! 0.0)) + (suspend) + ) + ) + ) + ) + (case (spydroid-method-233 self) + ((2) + (go-virtual attack) + ) + (else + (go-virtual hostile) + ) + ) + ) + :post enemy-simple-post + ) + +(defstate attack (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (logior! (-> self focus-status) (focus-status dangerous)) + (nav-enemy-method-182 self) + (let* ((v1-7 *game-info*) + (v0-2 (+ (-> v1-7 attack-id) 1)) + ) + (set! (-> v1-7 attack-id) v0-2) + (set! (-> self attack-id) v0-2) + ) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :code (behavior () + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let ((a0-2 (the-as process-focusable (handle->process (-> self focus handle))))) + (when a0-2 + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> (get-trans a0-2 3) quad)) + (vector-! gp-0 s5-0 (-> self root trans)) + ) + ) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! spydroid-attack-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s5-2 (vector-float*! (new 'stack-no-clear 'vector) gp-0 (* 49152.0 (seconds-per-frame))))) + (let* ((s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (closest-point-on-mesh (-> self nav) s4-0 (-> self root trans) (the-as nav-poly #f))) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> s5-2 quad)) + (when s1-0 + (set! (-> s3-0 y) 0.0) + (clamp-vector-to-mesh-no-gaps (-> self nav) s4-0 s1-0 s3-0 s2-0) + (if (-> s2-0 found-boundary) + (set! (-> s5-2 quad) (-> s3-0 quad)) + ) + ) + ) + (vector+! (-> self root trans) (-> self root trans) s5-2) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! spydroid-attack-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual hostile) + ) + :post enemy-simple-post + ) + +(defmethod spydroid-method-231 ((this spydroid) (arg0 uint)) + (when (!= (-> this alert-level) arg0) + (remove-from-process *part-engine* this) + (add-connection + *part-engine* + this + 8 + this + 4699 + (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 573440.0) + ) + (add-connection + *part-engine* + this + 10 + this + 4699 + (new 'static 'vector :x -245.76 :y -122.88 :z 901.12 :w 573440.0) + ) + (let ((v1-8 arg0)) + (cond + ((zero? v1-8) + (add-connection + *part-engine* + this + 4 + this + 4700 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 573440.0) + ) + (add-connection *part-engine* this 6 this 4703 (new 'static 'vector :z 614.4 :w 573440.0)) + (add-connection *part-engine* this 6 this 4706 (new 'static 'vector :z 614.4 :w 573440.0)) + ) + ((= v1-8 1) + (add-connection + *part-engine* + this + 4 + this + 4701 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 573440.0) + ) + (add-connection *part-engine* this 6 this 4704 (new 'static 'vector :z 614.4 :w 573440.0)) + (add-connection *part-engine* this 6 this 4707 (new 'static 'vector :z 614.4 :w 573440.0)) + ) + ((= v1-8 3) + (add-connection + *part-engine* + this + 4 + this + 4702 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 573440.0) + ) + (add-connection *part-engine* this 6 this 4705 (new 'static 'vector :z 614.4 :w 573440.0)) + (add-connection *part-engine* this 6 this 4708 (new 'static 'vector :z 614.4 :w 573440.0)) + ) + ) + ) + ) + (set! (-> this alert-level) arg0) + (let ((v1-28 (-> this alert-level))) + (cond + ((zero? v1-28) + (enemy-method-70 this (get-target-focus (-> this squad)) (the-as enemy-aware #f)) + ) + ((= v1-28 3) + (if (and (zero? (get-alert-level1 (-> this squad))) (= (-> this faction-mode) 0)) + (increment-alert-level (-> this squad) 1) + ) + ) + ) + ) + ) + +(defmethod nav-enemy-method-177 ((this spydroid)) + (set! (-> this travel-anim-scale-speed) 1.75) + (call-parent-method this) + (none) + ) + +(defmethod nav-enemy-method-176 ((this spydroid)) + (set! (-> this travel-anim-scale-speed) 0.5) + (call-parent-method this) + (none) + ) + +(defmethod spydroid-method-232 ((this spydroid)) + (if (< (current-time) (-> this next-check-player-time)) + (return 0) + ) + (set! (-> this next-check-player-time) + (the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 51) 25 (current-time))) + ) + (when (handle->process (-> this focus handle)) + (let ((a0-10 (the-as process-focusable (handle->process (-> this focus handle)))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> (get-trans a0-10 3) quad)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> this root trans)))) + 0.0 + 0.0 + (let ((f30-0 1.0) + (f0-2 (-> s4-1 y)) + ) + (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) + (set! f30-0 (* 0.1 f30-0)) + ) + (when (< f0-2 40960.0) + (set! (-> s4-1 y) 0.0) + (let ((f28-0 (vector-normalize-ret-len! s4-1 1.0))) + (when (< f28-0 (* 102400.0 f30-0)) + (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (let ((f30-1 (vector-dot s4-1 s3-0))) + (when (or (< 0.707 f30-1) (and (< -0.7 f30-1) (< f28-0 18432.0)) (< f28-0 16384.0)) + (let ((a1-6 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-6 start-pos quad) (-> this root trans quad)) + (+! (-> a1-6 start-pos y) 4096.0) + (vector-! (-> a1-6 move-dist) s5-0 (-> a1-6 start-pos)) + (let ((v1-45 a1-6)) + (set! (-> v1-45 radius) 40.96) + (set! (-> v1-45 collide-with) (collide-spec backgnd obstacle)) + (set! (-> v1-45 ignore-process0) #f) + (set! (-> v1-45 ignore-process1) #f) + (set! (-> v1-45 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-45 action-mask) (collide-action solid)) + ) + (return (cond + ((!= (fill-and-probe-using-line-sphere *collide-cache* a1-6) -100000000.0) + 0 + ) + ((< 0.707 f30-1) + 2 + ) + (else + 1 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defstate search (spydroid) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('panic) + (let ((gp-0 (the-as traffic-danger-info (-> block param 0)))) + (when (spydroid-method-237 self gp-0) + (set! (-> self move-dest quad) (-> gp-0 sphere quad)) + (let ((a0-4 (-> self nav state)) + (v1-5 (-> self move-dest)) + ) + (logclear! (-> a0-4 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-4 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-4 target-pos quad) (-> v1-5 quad)) + ) + 0 + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (set-time! (-> self state-time)) + (spydroid-method-231 self (the-as uint 1)) + (set-look-at-mode! self 2) + ) + :trans (behavior () + (if (or (time-elapsed? (-> self state-time) (seconds 15)) + (let ((f0-0 (vector-vector-xz-distance-squared (-> self root trans) (-> self move-dest))) + (f1-0 20480.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (go-virtual scan) + ) + (if (= (spydroid-method-232 self) 2) + (go-virtual spydroid-notice) + ) + (when (> (get-alert-level1 (-> self squad)) 0) + (spydroid-method-231 self (the-as uint 3)) + (enemy-method-70 self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) + (go-virtual hostile) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate scan (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-182 self) + (spydroid-method-231 self (the-as uint 1)) + (stop-look-at! self) + ) + :trans (behavior () + (if (= (spydroid-method-232 self) 2) + (go-virtual spydroid-notice) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! spydroid-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (>= (-> self alert-level) (the-as uint 3)) + (go-virtual hostile) + ) + (let ((a1-4 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (vector-float*! a1-4 a1-4 -1.0) + (citizen-method-208 self a1-4) + ) + (go-virtual active) + ) + :post enemy-simple-post + ) + +(defstate spydroid-notice (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-play "spydroid-jabber") + (set-time! (-> self state-time)) + (nav-enemy-method-182 self) + (set-look-at-mode! self 1) + (spydroid-method-231 self (the-as uint 2)) + (remove-from-process *part-engine* self) + (add-connection + *part-engine* + self + 8 + self + 4699 + (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 573440.0) + ) + (add-connection + *part-engine* + self + 10 + self + 4699 + (new 'static 'vector :x -245.76 :y -122.88 :z 901.12 :w 573440.0) + ) + (set-time! (-> self last-sensor-time)) + ) + :trans (behavior () + (if (< (+ (current-time) (seconds -0.15)) (-> self last-sensor-time)) + (spydroid-method-235 self) + ) + (if (>= (+ (current-time) (seconds -0.2)) (-> self last-sensor-time)) + (set-time! (-> self last-sensor-time)) + ) + (if (>= (-> self alert-level) (the-as uint 3)) + (go-virtual hostile) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (handle->process (-> self focus handle)) + (let* ((a0-9 (the-as process-focusable (handle->process (-> self focus handle)))) + (f0-0 (vector-vector-xz-distance-squared (get-trans a0-9 3) (-> self root trans))) + (f1-0 143360.0) + ) + (when (< (* f1-0 f1-0) f0-0) + (spydroid-method-231 self (the-as uint 3)) + (go-virtual hostile) + ) + ) + ) + (set-time! (-> self state-time)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! spydroid-idle-ja + :num! (seek! max (kg-squad-control-method-54 (-> self squad))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (kg-squad-control-method-54 (-> self squad)))) + ) + (spydroid-method-231 self (the-as uint 3)) + (go-virtual hostile) + ) + :post enemy-simple-post + ) + +(defstate wait (spydroid) + :virtual #t + :enter (behavior () + (go-virtual scan) + ) + ) + +(defmethod init-enemy-collision! ((this spydroid)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot civilian enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 2048.0 0.0 6144.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.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 enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot civilian enemy hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (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 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod coin-flip? ((this spydroid)) + #f + ) + +(defmethod deactivate ((this spydroid)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this explode-part)) + (kill-particles (-> this explode-part)) + ) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch kg-squad-member vs spydroid. +(defmethod relocate ((this spydroid) (offset int)) + (when (nonzero? (-> this explode-part)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) offset) + ) + ) + (the-as spydroid ((method-of-type kg-squad-member relocate) this offset)) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod citizen-method-194 ((this spydroid)) + (call-parent-method this) + (add-connection + *part-engine* + this + 4 + this + 4700 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 573440.0) + ) + (add-connection *part-engine* this 6 this 4703 (new 'static 'vector :z 614.4 :w 573440.0)) + (add-connection *part-engine* this 6 this 4706 (new 'static 'vector :z 614.4 :w 573440.0)) + (set! (-> this exiting-wait?) #f) + (let* ((v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-8 (the-as number (logior #x3f800000 v1-7))) + (f0-2 (+ -1.0 (the-as float v1-8))) + ) + (cond + ((< f0-2 0.1) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + ((< f0-2 0.18) + (set! (-> this fact pickup-type) (pickup-type health)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + (else + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 5.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + ) + ) + (set! (-> this enemy-flags) + (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag auto-death-phase-out))) + ) + (set! (-> this choose-new-enemy-delay-time) (seconds 0.1)) + (let ((v1-33 (-> this nav))) + (set! (-> v1-33 speed-scale) 1.0) + ) + 0 + (spydroid-method-231 this (the-as uint 0)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (set! (-> this next-check-player-time) 0) + (set! (-> this travel-anim-scale-speed) 0.5) + (none) + ) + +(defmethod spydroid-method-235 ((this spydroid)) + (cond + ((not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'wait-for-vulnerable) (= v1-3 'scan)) + ) + ) + ) + (set! (-> this sensor-lights 1 offset z) 0.15) + (set! (-> this sensor-lights 2 offset z) 0.15) + ) + (else + (set! (-> this sensor-lights 1 offset z) 0.0) + (set! (-> this sensor-lights 2 offset z) 0.0) + ) + ) + (dotimes (s5-0 3) + (let ((s3-0 (-> this sensor-lights s5-0)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> this node-list data (-> s3-0 joint)))) + (let* ((v1-13 s4-0) + (t0-0 (-> a1-1 bone transform)) + (a0-5 (-> t0-0 rvec quad)) + (a2-0 (-> t0-0 uvec quad)) + (a3-0 (-> t0-0 fvec quad)) + (t0-1 (-> t0-0 trans quad)) + ) + (set! (-> v1-13 rvec quad) a0-5) + (set! (-> v1-13 uvec quad) a2-0) + (set! (-> v1-13 fvec quad) a3-0) + (set! (-> v1-13 trans quad) t0-1) + ) + (vector<-cspace! (-> s4-0 trans) a1-1) + ) + (set! (-> s2-0 quad) (-> s3-0 offset quad)) + (set! (-> s2-0 w) 1.0) + (vector-matrix*! (-> s4-0 trans) s2-0 s4-0) + ) + (launch-particles (-> *part-id-table* (-> s3-0 part-index)) s4-0 :origin-is-matrix #t) + ) + ) + #f + ) + +(defmethod init-enemy! ((this spydroid)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *spydroid-nav-enemy-info*) + (call-parent-method this) + (let ((v1-5 (-> this neck))) + (set! (-> v1-5 up) (the-as uint 1)) + (set! (-> v1-5 nose) (the-as uint 2)) + (set! (-> v1-5 ear) (the-as uint 0)) + (set-vector! (-> v1-5 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-5 ignore-angle) 15473.777) + ) + (let ((v1-7 (-> this nav))) + (set! (-> v1-7 speed-scale) 1.0) + ) + 0 + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set! (-> this part-ids 0) 4700) + (set! (-> this part-ids 1) 4703) + (set! (-> this part-ids 2) 4706) + (set! (-> this part-ids 3) 4701) + (set! (-> this part-ids 4) 4704) + (set! (-> this part-ids 5) 4707) + (set! (-> this part-ids 6) 4702) + (set! (-> this part-ids 7) 4705) + (set! (-> this part-ids 8) 4708) + (set! (-> this sensor-lights 0 part-index) (-> this part-ids 6)) + (set! (-> this sensor-lights 0 joint) 4) + (set-vector! (-> this sensor-lights 0 offset) 0.2 -0.03 0.82 1.0) + (set! (-> this sensor-lights 1 part-index) (-> this part-ids 7)) + (set! (-> this sensor-lights 1 joint) 6) + (set! (-> this sensor-lights 1 offset quad) (the-as uint128 0)) + (set! (-> this sensor-lights 2 part-index) (-> this part-ids 8)) + (set! (-> this sensor-lights 2 joint) 6) + (set! (-> this sensor-lights 2 offset quad) (the-as uint128 0)) + (set! (-> this anim-shuffle) 3) + (set! (-> this anim-walk) 4) + (set! (-> this speed-walk) 16384.0) + (set! (-> this dist-walk-anim) 8192.0) + (set! (-> this dist-run-anim) 16384.0) + (set! (-> this anim-run) 5) + (set! (-> this speed-run) 32768.0) + (logclear! (-> this focus-status) (focus-status dangerous)) + (set! (-> this water-anim) 5) + 0 + (none) + ) + +(defmethod go-inactive ((this spydroid)) + (let ((v1-1 (-> this root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (call-parent-method this) + (none) + ) + +(defstate hunting (spydroid) + :virtual #t + :parent (spydroid active) + :event enemy-event-handler + :enter (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 enter))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + (spydroid-method-231 self (the-as uint 3)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (handle->process (-> self focus handle)) + (go-virtual hostile) + ) + (let ((f0-0 2867.2) + (v1-9 (-> self root transv)) + ) + (if (< f0-0 (sqrtf (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z))))) + (set-time! (-> self cp-next-time)) + ) + ) + (when (< (+ (-> self cp-next-time) (seconds 2)) (current-time)) + (let ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> self controller path-prev-point) (-> self dest-point)))) + (set-time! (-> self cp-next-time)) + (citizen-method-208 self a1-2) + ) + ) + ) + ) + +(defmethod spydroid-method-237 ((this spydroid) (arg0 traffic-danger-info)) + (when (zero? (-> this faction-mode)) + (let ((f30-0 (+ 204800.0 (-> arg0 notify-radius)))) + (and (< 0.98 (-> arg0 danger-level)) + (and (or (= (-> arg0 danger-type) 0) (= (-> arg0 danger-type) 3) (= (-> arg0 danger-type) 5)) + (< (fabs (- (-> arg0 sphere y) (-> this root trans y))) 61440.0) + (< (vector-vector-xz-distance-squared (-> this root trans) (-> arg0 sphere)) (* f30-0 f30-0)) + ) + ) + ) + ) + ) + +(defstate active (spydroid) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('panic) + (let ((gp-0 (the-as traffic-danger-info (-> block param 0)))) + (when (spydroid-method-237 self gp-0) + (set! (-> self move-dest quad) (-> gp-0 sphere quad)) + (go-virtual search) + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (spydroid-method-231 self (the-as uint 0)) + (set-time! (-> self state-time)) + (logior! (-> self flags) (citizen-flag neck-no-auto-look-at)) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (when (or (!= (-> self faction-mode) 0) (logtest? (-> self flags) (citizen-flag in-mission))) + (spydroid-method-236 self) + (go-virtual hostile) + ) + (case (spydroid-method-232 self) + ((2) + (go-virtual spydroid-notice) + ) + ) + (when (> (get-alert-level1 (-> self squad)) 0) + (spydroid-method-231 self (the-as uint 3)) + (enemy-method-70 self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) + (go-virtual hostile) + ) + ) + ) + +;; WARN: disable def twice: 120. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod spydroid-method-236 ((this spydroid)) + (local-vars (v0-6 object)) + (when (not (handle->process (-> this current-enemy))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + (let ((a0-6 (get-current-enemy this))) + (if a0-6 + (set! (-> this current-enemy) (process->handle a0-6)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 3))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (let* ((s5-0 (handle->process (-> this current-enemy))) + (a0-18 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and a0-18 + (not (logtest? (-> (the-as process-focusable a0-18) focus-status) (focus-status disable dead inactive))) + ) + (let* ((s5-1 this) + (s4-0 (method-of-object s5-1 enemy-method-70)) + (s3-0 (handle->process (-> this current-enemy))) + ) + (s4-0 + s5-1 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus this) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (f1-0 266240.0) + ) + (cond + ((< f0-0 (* f1-0 f1-0)) + (when (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (set! v0-6 (logior (-> this flags) (citizen-flag persistent))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + (else + (set! v0-6 (logclear (-> this flags) (citizen-flag persistent))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + ) + ) + (else + (set! (-> this focus handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent)) + (when (and (-> this next-state) (= (-> this next-state name) 'hostile)) + (if (nonzero? (-> this faction-mode)) + (go (method-of-object this hunting)) + (go (method-of-object this active)) + ) + ) + ) + ) + ) + ) + +(defmethod citizen-method-195 ((this spydroid)) + (call-parent-method this) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 sphere-mask) (the-as uint #x1000f8)) + ) + 0 + (none) + ) + +(defmethod citizen-method-215 ((this spydroid)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 11) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-from-behavior ((this spydroid) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((6) + (set! (-> this root trans quad) (-> arg0 position quad)) + (go (method-of-object this exit-transport)) + ) + (else + (call-parent-method this arg0) + ) + ) + (none) + ) + +(defstate exit-transport (spydroid) + :virtual #t + :enter (behavior () + (nav-enemy-method-182 self) + (logclear! (-> self root status) (collide-status on-surface touch-surface impact-surface)) + ) + :trans (behavior () + (if (logtest? (-> self root status) (collide-status on-surface touch-surface impact-surface)) + (go-virtual hostile) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! spydroid-knocked0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + :post (behavior () + (enemy-falling-post) + ) + ) diff --git a/goal_src/jak3/levels/common/external-player-control.gc b/goal_src/jak3/levels/common/external-player-control.gc index bd6401d078..d4ec86c290 100644 --- a/goal_src/jak3/levels/common/external-player-control.gc +++ b/goal_src/jak3/levels/common/external-player-control.gc @@ -5,5 +5,413 @@ ;; name in dgo: external-player-control ;; dgos: DESCHASE, LCTYPALT +;; +++player-controller-flag +(defenum player-controller-flag + :type uint32 + :bitfield #t + (pc0 0) + (pc1 1) + (lock-features 2) + (letterbox 3) + (pc4 4) + ) +;; ---player-controller-flag + + ;; DECOMP BEGINS +(define *target-controller-pad* (new 'static 'cpad-info)) + +(defun setup-control-pad ((arg0 cpad-info)) + (cpad-invalid! arg0) + (set! (-> arg0 button0) (the-as uint 0)) + (set! (-> arg0 valid) (the-as uint 0)) + 0 + (none) + ) + +(defun set-pad-world-dir ((arg0 cpad-info) (arg1 vector) (arg2 float)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 quad)) + (let ((s3-0 (matrix-transpose! (new 'stack-no-clear 'matrix) (-> *target* control cam-R-w)))) + (let ((s2-0 (matrix-from-two-vectors! + (new 'stack-no-clear 'matrix) + (-> *target* control cam-R-w uvec) + (-> *target* control local-normal) + ) + ) + ) + (matrix-transpose! s2-0 s2-0) + (vector-matrix*! s5-0 s5-0 s2-0) + ) + (vector-matrix*! s5-0 s5-0 s3-0) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 arg2) + (vector-rotate-around-y! s5-0 s5-0 32768.0) + (set! (-> arg0 stick0-dir) (atan (- (-> s5-0 x)) (- (-> s5-0 z)))) + (set! (-> arg0 stick0-speed) arg2) + (+! (-> s5-0 x) 1.0) + (+! (-> s5-0 z) 1.0) + (set! (-> s5-0 x) (* 0.5 (-> s5-0 x))) + (set! (-> s5-0 z) (* 0.5 (-> s5-0 z))) + (set! (-> arg0 leftx) (the-as uint (the int (* 255.0 (-> s5-0 x))))) + (if (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) + (set! (-> arg0 leftx) (the-as uint (* (the-as uint -1) (-> arg0 leftx)))) + ) + (set! (-> arg0 lefty) (the-as uint (the int (* 255.0 (-> s5-0 z))))) + ) + (none) + ) + +(defun override-player-controls ((arg0 cpad-info)) + (let ((v1-1 (-> *setting-control* user-current player-control-override))) + (logclear! (-> arg0 button0) (-> *setting-control* user-current player-control-mask)) + (logior! (-> arg0 button0) (logand (-> v1-1 button0) (-> *setting-control* user-current player-control-mask))) + (when (logtest? #x4000000 (-> *setting-control* user-current player-control-mask)) + (set! (-> arg0 leftx) (-> v1-1 leftx)) + (set! (-> arg0 lefty) (-> v1-1 lefty)) + (set! (-> arg0 stick0-dir) (-> v1-1 stick0-dir)) + (set! (-> arg0 stick0-speed) (-> v1-1 stick0-speed)) + ) + (when (logtest? #x8000000 (-> *setting-control* user-current player-control-mask)) + (set! (-> arg0 rightx) (-> v1-1 rightx)) + (set! (-> arg0 righty) (-> v1-1 righty)) + ) + ) + 0 + ) + +(deftype player-controller-init-params (structure) + ((mode symbol) + (flags player-controller-flag) + (targ-pos vector :inline) + (notify-proc handle) + ) + ) + + +(deftype player-controller (process-focusable) + ((params player-controller-init-params :inline) + (targ-pos vector :inline) + ) + (:state-methods + idle + active + clip-to-nav-mesh + lock + ) + (:methods + (set-nav-params (_type_) none) + (set-nav-mesh (_type_) none) + (set-params (_type_ player-controller-init-params) object) + (event-handler (_type_ process int symbol event-message-block) object) + ) + ) + + +;; WARN: Return type mismatch nav-callback-info vs none. +(defmethod set-nav-params ((this player-controller)) + (when (or (not (-> this nav)) (zero? (-> this nav))) + (let ((a0-4 (find-nearest-nav-mesh (target-pos 0) (the-as float #x7f800000)))) + (if a0-4 + (add-process-drawable-to-nav-mesh a0-4 this #t) + ) + ) + ) + (when (-> this nav) + (set! (-> this nav flags) (nav-control-flag display-marks)) + (let ((v1-9 (-> this nav))) + (set! (-> v1-9 sphere-mask) (the-as uint 0)) + ) + 0 + (let ((v1-11 (-> this nav))) + (set! (-> v1-11 target-speed) 4096.0) + ) + 0 + (let ((v1-13 (-> this nav))) + (set! (-> v1-13 acceleration) 409600.0) + ) + 0 + (let ((v1-15 (-> this nav))) + (set! (-> v1-15 turning-acceleration) 40960000.0) + ) + 0 + (let ((v1-17 (-> this nav))) + (set! (-> v1-17 speed-scale) 1.0) + ) + 0 + (let ((v1-19 (-> this nav))) + (set! (-> v1-19 max-rotation-rate) 18204444.0) + ) + 0 + (set! (-> this nav callback-info) *default-nav-callback-info*) + ) + (none) + ) + +(defbehavior player-controller-init-by-other player-controller ((arg0 player-controller-init-params)) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((v1-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set-vector! (-> v1-3 local-sphere) 0.0 0.0 0.0 0.01) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-3) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-6 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-6 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-6 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (set-params self arg0) + (go-virtual idle) + ) + +(defmethod set-params ((this player-controller) (arg0 player-controller-init-params)) + (mem-copy! (the-as pointer (-> this params)) (the-as pointer arg0) 40) + (set! (-> this targ-pos quad) (-> arg0 targ-pos quad)) + (case (-> arg0 mode) + (('active) + (if (not (and (-> this next-state) (= (-> this next-state name) 'active))) + (go (method-of-object this active)) + ) + ) + (('clip-to-nav-mesh) + (if (not (and (-> this next-state) (= (-> this next-state name) 'clip-to-nav-mesh))) + (go (method-of-object this clip-to-nav-mesh)) + ) + ) + (('lock) + (if (not (and (-> this next-state) (= (-> this next-state name) 'lock))) + (go (method-of-object this lock)) + ) + ) + (('idle) + (if (not (and (-> this next-state) (= (-> this next-state name) 'idle))) + (go (method-of-object this idle)) + ) + ) + ) + ) + +(defmethod set-nav-mesh ((this player-controller)) + (let ((a0-3 (find-nearest-nav-mesh (target-pos 0) (the-as float #x7f800000)))) + (if (and a0-3 (!= nav-mesh (-> this nav state mesh))) + (change-to a0-3 this) + ) + ) + (none) + ) + +(defbehavior player-controller-event-handler player-controller ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (event-handler self arg0 arg1 arg2 arg3) + ) + +(defmethod event-handler ((this player-controller) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('set-params) + (set-params this (the-as player-controller-init-params (-> arg3 param 0))) + ) + (('set-target) + (let ((v0-0 (the-as object (-> this targ-pos)))) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + ) + (('change-mode) + (set! (-> this params mode) (the-as symbol (-> arg3 param 0))) + (set-params this (-> this params)) + ) + ) + ) + +(defstate idle (player-controller) + :virtual #t + :event player-controller-event-handler + :enter (behavior () + (remove-setting! 'player-control-override) + (remove-setting! 'player-control-mask) + ) + :code sleep-code + ) + +(defstate clip-to-nav-mesh (player-controller) + :virtual #t + :event player-controller-event-handler + :enter (behavior () + (set-nav-params self) + ) + :trans (behavior () + (if (not *target*) + (go empty-state) + ) + (set-nav-mesh self) + (when (and (-> self nav) (nonzero? (-> self nav))) + (when (and (logtest? (-> self params flags) (player-controller-flag pc1)) (-> self nav state mesh)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (if (nav-mesh-method-10 (-> self nav state mesh) gp-0 (target-pos 0) (the-as nav-poly #f)) + (set! (-> gp-0 y) (-> (target-pos 0) y)) + ) + (move-to-point! (-> *target* control) gp-0) + ) + ) + ) + (set! (-> self root trans quad) (-> (target-pos 0) quad)) + ) + :code sleep-code + ) + +(defstate lock (player-controller) + :virtual #t + :event player-controller-event-handler + :enter (behavior () + (when (logtest? (-> self params flags) (player-controller-flag lock-features)) + (set-setting! 'duck #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'darkjak #f 0.0 0) + (set-setting! 'jump #f 0.0 0) + ) + (when (logtest? (-> self params flags) (player-controller-flag letterbox)) + (set-setting! 'letterbox 'abs 1.0 0) + (set-setting! 'letterbox-speed 'abs 2.0 0) + ) + (set-setting! 'player-control-override #f 0.0 *target-controller-pad*) + (let ((t1-7 #x400fff4)) + (if (not (logtest? (-> self params flags) (player-controller-flag pc0))) + (set! t1-7 (logior #x8000000 t1-7)) + ) + (set-setting! 'player-control-mask #f 0.0 t1-7) + ) + (setup-control-pad *target-controller-pad*) + ) + :exit (behavior () + (when (logtest? (-> self params flags) (player-controller-flag lock-features)) + (remove-setting! 'duck) + (remove-setting! 'board) + (remove-setting! 'darkjak) + (remove-setting! 'jump) + ) + (remove-setting! 'player-control-override) + (remove-setting! 'player-control-mask) + (when (logtest? (-> self params flags) (player-controller-flag letterbox)) + (remove-setting! 'letterbox) + (set-setting! 'letterbox-speed 'abs 4.0 0) + ) + ) + :code sleep-code + ) + +(defstate active (player-controller) + :virtual #t + :event player-controller-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (when (logtest? (-> self params flags) (player-controller-flag lock-features)) + (set-setting! 'duck #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'darkjak #f 0.0 0) + (set-setting! 'jump #f 0.0 0) + ) + (when (logtest? (-> self params flags) (player-controller-flag letterbox)) + (set-setting! 'letterbox 'abs 1.0 0) + (set-setting! 'letterbox-speed 'abs 2.0 0) + ) + (set-nav-params self) + (set-setting! 'player-control-override #f 0.0 *target-controller-pad*) + (let ((t1-7 #x400fff4)) + (if (not (logtest? (-> self params flags) (player-controller-flag pc0))) + (set! t1-7 (logior #x8000000 t1-7)) + ) + (set-setting! 'player-control-mask #f 0.0 t1-7) + ) + ) + :exit (behavior () + (when (logtest? (-> self params flags) (player-controller-flag lock-features)) + (remove-setting! 'duck) + (remove-setting! 'board) + (remove-setting! 'darkjak) + (remove-setting! 'jump) + ) + (remove-setting! 'player-control-override) + (remove-setting! 'player-control-mask) + (when (logtest? (-> self params flags) (player-controller-flag letterbox)) + (remove-setting! 'letterbox) + (set-setting! 'letterbox-speed 'abs 4.0 0) + ) + ) + :trans (behavior () + (if (not *target*) + (go empty-state) + ) + (if (or (not (-> self nav)) (zero? (-> self nav))) + (go-virtual idle) + ) + (set-nav-mesh self) + (when (and (logtest? (-> self params flags) (player-controller-flag pc1)) (-> self nav state mesh)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (if (nav-mesh-method-10 (-> self nav state mesh) gp-0 (target-pos 0) (the-as nav-poly #f)) + (set! (-> gp-0 y) (-> (target-pos 0) y)) + ) + (move-to-point! (-> *target* control) gp-0) + ) + ) + (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (set-virtual-cur-pos! (-> self nav state) (target-pos 0)) + (let ((a0-9 (-> self nav state)) + (v1-33 (-> self targ-pos)) + ) + (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-9 target-pos quad) (-> v1-33 quad)) + ) + 0 + (let ((gp-3 *target-controller-pad*)) + (let ((a1-7 (-> self nav state))) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> a1-7 velocity quad)) + ) + (let ((a0-12 (-> self nav state)) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-2 quad) (-> a0-12 heading quad)) + (let ((f30-0 (vector-vector-xz-distance (-> self root trans) (-> self targ-pos)))) + (let ((f28-0 1.0)) + (setup-control-pad gp-3) + (if (< f30-0 24576.0) + (set! f28-0 (lerp-scale 0.3 1.0 f30-0 4096.0 24576.0)) + ) + (set-pad-world-dir gp-3 s5-2 f28-0) + ) + (when (and (logtest? (-> self params flags) (player-controller-flag pc4)) + (or (and (>= 1024.0 (vector-length (get-transv *target*))) (< f30-0 12288.0)) + (and (< f30-0 14336.0) (focus-test? *target* board)) + ) + ) + (send-event (handle->process (-> self params notify-proc)) 'reached-destination) + (go-virtual idle) + ) + ) + ) + ) + ) + :code sleep-code + ) diff --git a/goal_src/jak3/levels/common/hvehicle/squad-control-h.gc b/goal_src/jak3/levels/common/hvehicle/squad-control-h.gc index c94a3a63f7..4751258a6d 100644 --- a/goal_src/jak3/levels/common/hvehicle/squad-control-h.gc +++ b/goal_src/jak3/levels/common/hvehicle/squad-control-h.gc @@ -46,6 +46,7 @@ (rand-burst-delay uint16) (rand-shot-delay uint16) ) + :allow-misaligned ) @@ -106,7 +107,7 @@ (set-sync-mask (_type_) none) (probe-backgnd-collision (_type_ vector vector) symbol) (squad-control-method-16 (_type_ vector process-focusable squad-target-status) none) - (squad-control-method-17 (_type_ vector int squad-target-status) none) + (squad-control-method-17 (_type_ vector int squad-target-status) squad-target-status) (squad-control-method-18 (_type_ int process) int) (set-alert-level0 (_type_ int) int) (start-alert (_type_ int) none) diff --git a/goal_src/jak3/levels/common/hvehicle/squad-control.gc b/goal_src/jak3/levels/common/hvehicle/squad-control.gc index ff096269df..971eb5d468 100644 --- a/goal_src/jak3/levels/common/hvehicle/squad-control.gc +++ b/goal_src/jak3/levels/common/hvehicle/squad-control.gc @@ -90,11 +90,9 @@ (none) ) -;; WARN: Return type mismatch squad-target-status vs none. -;; og:preserve-this +;; og:preserve-this duplicate ; (defmethod squad-control-method-17 ((this squad-control) (arg0 vector) (arg1 int) (arg2 squad-target-status)) -; (empty) -; (none) +; arg2 ; ) (defmethod squad-control-method-18 ((this squad-control) (arg0 int) (arg1 process)) @@ -213,7 +211,6 @@ (the-as symbol (and (handle->process arg0) (= (get-idx-in-status-arr this arg0) 0))) ) -;; WARN: Return type mismatch squad-target-status vs none. (defmethod squad-control-method-17 ((this squad-control) (arg0 vector) (arg1 int) (arg2 squad-target-status)) (logclear! (-> arg2 flags) (squad-target-flag visible-now updated)) (cond @@ -246,7 +243,7 @@ (logclear! (-> arg2 flags) (squad-target-flag updated)) ) ) - (none) + arg2 ) (defmethod squad-control-method-24 ((this squad-control)) diff --git a/goal_src/jak3/levels/common/race/race-manager.gc b/goal_src/jak3/levels/common/race/race-manager.gc index 6bf5ed479f..c952868fb6 100644 --- a/goal_src/jak3/levels/common/race/race-manager.gc +++ b/goal_src/jak3/levels/common/race/race-manager.gc @@ -1038,7 +1038,7 @@ (set! (-> s4-0 vec0 quad) (-> gp-0 info start-sphere quad)) (set! (-> s4-0 vec1 quad) (-> gp-0 info start-dir quad)) (set-vector! (-> s4-0 vec2) (-> s4-0 vec1 z) 0.0 (- (-> s4-0 vec1 x)) 1.0) - (set! (-> s4-0 params object-type) (the-as uint 23)) + (set! (-> s4-0 params object-type) (traffic-type vehicle-task)) (set! (-> s4-0 params behavior) (the-as uint 10)) (set! (-> s4-0 params id) (the-as uint 0)) (set! (-> s4-0 params nav-mesh) #f) diff --git a/goal_src/jak3/levels/desert/chase/desert-chase-path-h.gc b/goal_src/jak3/levels/desert/chase/desert-chase-path-h.gc index 4640fcb7c0..6a4bd6d687 100644 --- a/goal_src/jak3/levels/desert/chase/desert-chase-path-h.gc +++ b/goal_src/jak3/levels/desert/chase/desert-chase-path-h.gc @@ -7,3 +7,19 @@ ;; DECOMP BEGINS +(deftype deschase-node (structure) + ((position vector :inline) + (pos-x float :overlay-at (-> position data 0)) + (pos-y float :overlay-at (-> position data 1)) + (pos-z float :overlay-at (-> position data 2)) + (speed float) + (next-node int32) + ) + ) + + +(deftype deschase-path (structure) + ((node-count uint16) + (node (inline-array deschase-node)) + ) + ) diff --git a/goal_src/jak3/levels/desert/chase/desert-chase-path.gc b/goal_src/jak3/levels/desert/chase/desert-chase-path.gc index 107b6a1d41..7eba33e02e 100644 --- a/goal_src/jak3/levels/desert/chase/desert-chase-path.gc +++ b/goal_src/jak3/levels/desert/chase/desert-chase-path.gc @@ -7,3 +7,400 @@ ;; DECOMP BEGINS +(define *desert-chase-marauder-path* (new 'static 'deschase-path + :node-count #x50 + :node (new 'static 'inline-array deschase-node 80 + (new 'static 'deschase-node + :position (new 'static 'vector :x 6171114.5 :y 103217.97 :z 12076113.0) + :next-node 1 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6141173.0 :y 103217.97 :z 12241058.0) + :next-node 2 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6059498.5 :y 103218.38 :z 12343621.0) + :next-node 3 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5903399.5 :y 102786.664 :z 12505987.0) + :next-node 4 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5838478.0 :y 102786.664 :z 12646603.0) + :next-node 5 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5839911.5 :y 102786.664 :z 12840671.0) + :next-node 6 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6069165.5 :y 103464.14 :z 13123214.0) + :next-node 7 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6374071.0 :y 86857.73 :z 13419518.0) + :speed 16384.0 + :next-node 8 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6720224.5 :y 75224.266 :z 13569636.0) + :speed 16384.0 + :next-node 9 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6943006.0 :y 75921.41 :z 13605888.0) + :speed 16384.0 + :next-node 10 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7613275.5 :y 88437.555 :z 13514831.0) + :speed 16384.0 + :next-node 46 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7988264.0 :y 123324.01 :z 12824860.0) + :speed 16384.0 + :next-node 49 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7684750.0 :y 118384.23 :z 13634518.0) + :speed 16384.0 + :next-node 11 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7455169.5 :y 256129.44 :z 14134966.0) + :speed 16384.0 + :next-node 12 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7416257.5 :y 313731.47 :z 14450318.0) + :speed 16384.0 + :next-node 13 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7498300.0 :y 354459.66 :z 14788360.0) + :speed 16384.0 + :next-node 14 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7917075.5 :y 386711.56 :z 15349595.0) + :speed 16384.0 + :next-node 15 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8342322.5 :y 353510.6 :z 15460104.0) + :speed 16384.0 + :next-node 16 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8977202.0 :y 195093.7 :z 15438396.0) + :speed 16384.0 + :next-node 17 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9379347.0 :y 135773.8 :z 15164537.0) + :speed 16384.0 + :next-node 18 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10063993.0 :y 113954.41 :z 13986404.0) + :speed 16384.0 + :next-node 19 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 11021801.0 :y 122775.96 :z 13413906.0) + :speed 16384.0 + :next-node 20 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 11887451.0 :y 145189.69 :z 12549733.0) + :speed 16384.0 + :next-node 21 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12038346.0 :y 113069.26 :z 12379257.0) + :speed 16384.0 + :next-node 22 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12423616.0 :y 84316.98 :z 11828837.0) + :speed 16384.0 + :next-node 23 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12771489.0 :y 94443.11 :z 11096636.0) + :speed 16384.0 + :next-node 24 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12922099.0 :y 103745.945 :z 10752408.0) + :speed 16384.0 + :next-node 25 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 13012048.0 :y 141570.05 :z 10469743.0) + :speed 16384.0 + :next-node 26 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12894616.0 :y 205741.67 :z 10160208.0) + :speed 16384.0 + :next-node 27 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12469902.0 :y 234573.0 :z 9697606.0) + :speed 16384.0 + :next-node 28 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 11993947.0 :y 215212.44 :z 9265642.0) + :speed 16384.0 + :next-node 29 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10752613.0 :y 241458.38 :z 8241232.5) + :speed 16384.0 + :next-node 30 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10284317.0 :y 143553.33 :z 8058715.5) + :speed 16384.0 + :next-node 31 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9675201.0 :y 96550.914 :z 7868661.0) + :speed 16384.0 + :next-node 32 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9172049.0 :y 76422.35 :z 7427072.0) + :speed 16384.0 + :next-node 33 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8758926.0 :y 76116.375 :z 7317011.5) + :speed 16384.0 + :next-node 34 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8286903.0 :y 103902.414 :z 7306034.5) + :speed 16384.0 + :next-node 35 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8020868.5 :y 113698.81 :z 7419042.5) + :speed 16384.0 + :next-node 36 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7885331.5 :y 99130.164 :z 7650753.5) + :speed 16384.0 + :next-node 37 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7909866.5 :y 90708.79 :z 7933623.0) + :speed 16384.0 + :next-node 38 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8152350.0 :y 105081.65 :z 8582020.0) + :speed 16384.0 + :next-node 39 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8096480.5 :y 100046.44 :z 8786164.0) + :speed 16384.0 + :next-node 40 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7948778.5 :y 77104.74 :z 9512836.0) + :speed 16384.0 + :next-node 41 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8007351.0 :y 108013.16 :z 11117115.0) + :speed 16384.0 + :next-node 42 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8041552.5 :y 119379.97 :z 11799223.0) + :speed 16384.0 + :next-node 43 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8063835.5 :y 136027.75 :z 12527368.0) + :speed 16384.0 + :next-node 44 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7909497.5 :y 107760.02 :z 13230446.0) + :speed 16384.0 + :next-node 45 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6165913.0 :y 103217.97 :z 12276119.0) + :next-node 2 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6322503.0 :y 103217.97 :z 12247120.0) + :next-node 47 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7984496.0 :y 93854.516 :z 12095731.0) + :speed 16384.0 + :next-node 50 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7725546.5 :y 86930.64 :z 11389131.0) + :speed 16384.0 + :next-node 51 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7518903.0 :y 116947.766 :z 11047893.0) + :speed 16384.0 + :next-node 52 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7138466.5 :y 80252.516 :z 10817412.0) + :speed 16384.0 + :next-node 53 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6200237.5 :y 66664.445 :z 10777680.0) + :speed 16384.0 + :next-node 54 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5747260.0 :y 117487.62 :z 10399497.0) + :speed 16384.0 + :next-node 55 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5785680.5 :y 163153.1 :z 9988258.0) + :speed 16384.0 + :next-node 56 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5827542.0 :y 261514.86 :z 9435216.0) + :speed 16384.0 + :next-node 57 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5842902.0 :y 232043.31 :z 8828804.0) + :speed 16384.0 + :next-node 58 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5784656.5 :y 136654.03 :z 8382217.5) + :speed 16384.0 + :next-node 59 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5735669.0 :y 67932.98 :z 7747624.0) + :speed 16384.0 + :next-node 60 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5490727.5 :y 121842.484 :z 6632487.5) + :speed 16384.0 + :next-node 61 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 4772208.0 :y 156765.39 :z 5116804.5) + :speed 16384.0 + :next-node 62 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 4786585.0 :y 129592.12 :z 4529806.0) + :speed 16384.0 + :next-node 63 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 4915854.0 :y 197361.66 :z 4256848.5) + :speed 16384.0 + :next-node 64 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 4963655.0 :y 322608.75 :z 3686715.0) + :speed 16384.0 + :next-node 65 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5249351.0 :y 222091.27 :z 3068501.5) + :speed 16384.0 + :next-node 66 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5421096.0 :y 256218.72 :z 2950384.8) + :speed 16384.0 + :next-node 67 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5889760.5 :y 222968.62 :z 2912116.0) + :speed 16384.0 + :next-node 68 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6202695.0 :y 216614.1 :z 2909986.5) + :speed 16384.0 + :next-node 69 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6728703.0 :y 99570.89 :z 2910437.0) + :speed 16384.0 + :next-node 70 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7674018.5 :y 135836.88 :z 2834030.2) + :speed 16384.0 + :next-node 71 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9490594.0 :y 109878.88 :z 2894662.8) + :speed 16384.0 + :next-node 72 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9915309.0 :y 117802.6 :z 3004206.8) + :speed 16384.0 + :next-node 73 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10371153.0 :y 194768.08 :z 3505172.0) + :speed 16384.0 + :next-node 74 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10298244.0 :y 251813.89 :z 4208885.0) + :speed 16384.0 + :next-node 75 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10299923.0 :y 206769.36 :z 5070847.0) + :speed 16384.0 + :next-node 76 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10347109.0 :y 46356.89 :z 6077808.0) + :speed 16384.0 + :next-node 77 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10499480.0 :y 88315.49 :z 6486834.5) + :speed 16384.0 + :next-node 78 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10827815.0 :y 136688.03 :z 7431986.5) + :speed 16384.0 + :next-node 79 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 11062516.0 :y 238765.27 :z 7961599.0) + :speed 16384.0 + :next-node 30 + ) + ) + ) + ) diff --git a/goal_src/jak3/levels/desert/chase/desert-chase.gc b/goal_src/jak3/levels/desert/chase/desert-chase.gc index 4b022d04cd..df69feffd6 100644 --- a/goal_src/jak3/levels/desert/chase/desert-chase.gc +++ b/goal_src/jak3/levels/desert/chase/desert-chase.gc @@ -7,3 +7,2037 @@ ;; DECOMP BEGINS +(deftype deschase-point (structure) + ((pos vector :inline) + (quat quaternion :inline) + (i-node int8 :overlay-at (-> pos data 3)) + ) + ) + + +(define *stronghold-inside-point* (new 'static 'vector :x 6253938.5 :y 99123.2 :z 12145754.0 :w 1.0)) + +(define *stronghold-vehicle-stop-point* (new 'static 'vector :x 6413203.5 :y 103606.27 :z 12111851.0 :w 1.0)) + +(define *stronghold-player-goto-point* (new 'static 'vector :x 6321789.5 :y 99123.2 :z 12098191.0 :w 1.0)) + +(define *stronghold-marauder-start* (new 'static 'boxed-array :type deschase-point + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6207577.5 :y 159539.2 :z 11966325.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0002 :y -0.1364 :w -0.9906) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6395575.0 :y 159329.08 :z 12035728.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3977 :w 0.9174) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6444253.0 :y 159329.08 :z 12226157.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7455 :w -0.6664) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6297671.5 :y 158481.2 :z 12361336.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9791 :w 0.2032) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6063449.5 :y 159329.08 :z 12111502.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.5197 :w 0.8543) + ) + ) + ) + +(define *deschase-catapult-spawn-point* + (new 'static 'boxed-array :type deschase-point + (new 'static 'deschase-point + :pos (new 'static 'vector :x 5243015.0 :y 196608.0 :z 11060786.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.3797 :w 0.925) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 5784936.5 :y 84433.305 :z 10807021.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.1997 :w 0.9798) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6550656.5 :y 69453.82 :z 10759278.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.0015 :w 0.9999) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 7493730.0 :y 122130.84 :z 10950285.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3666 :w 0.9303) + ) + ) + ) + +(defpartgroup group-catapult-embers-fire + :id 454 + :flags (sp0 sp1 sp4) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1806 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7))) + ) + +(defpart 1806 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:x (meters -0.25) (meters 0.25)) + (:y (meters -0.25)) + (:z (meters -0.25) (meters 0.25)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 40.0) + (:b -64.0 4.0 32.0) + (:a 128.0 128.0) + (:scalevel-x (meters -0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters 0.0016666667) (meters 0.0016666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(deftype v-catapult-shot-embers (metalhead-grenade-shot) + ((ptracker-proc handle) + ) + ) + + +(defstate impact (v-catapult-shot-embers) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'touched) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (send-event (handle->process (-> self ptracker-proc)) 'draw #f) + (projectile-event-handler proc argc message block) + ) + (else + (projectile-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (suspend) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> self root) a1-0) + ) + (suspend) + ) + ) + (let ((v1-10 (-> self root root-prim))) + (set! (-> v1-10 prim-core collide-as) (collide-spec)) + (set! (-> v1-10 prim-core collide-with) (collide-spec)) + ) + 0 + (while (-> self child) + (suspend) + ) + (deactivate self) + ) + ) + +(defmethod projectile-method-25 ((this v-catapult-shot-embers)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) + ) + 0 + (none) + ) + +(defmethod projectile-method-26 ((this v-catapult-shot-embers)) + (set! (-> this ptracker-proc) + (process->handle + (-> (cond + ((logtest? (-> *part-group-id-table* 454 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn + part-tracker-subsampler + :to this + :group (-> *part-group-id-table* 454) + :duration (seconds 3) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 454) :duration (seconds 3)) + ) + ) + 0 + ) + ) + ) + 0 + (none) + ) + +(defmethod projectile-method-40 ((this v-catapult-shot-embers)) + 512 + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init-proj-settings! ((this v-catapult-shot-embers)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this blast-radius) 4096.0) + (set! (-> this max-speed) 135168.0) + (set! (-> this update-velocity) projectile-update-velocity-add-gravity) + (set! (-> this move) gren-canister-move) + (set! (-> this root dynam gravity y) 102400.0) + (set! (-> this root dynam gravity-length) 102400.0) + (set! (-> this root dynam gravity-max) 102400.0) + (let ((f0-5 1092.2667)) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-5) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 454) this)) + (set! (-> this ptracker-proc) (the-as handle #f)) + (none) + ) + +(defpartgroup group-catapult-target-glow + :id 455 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1807 :flags (sp6 sp7))) + ) + +(defpart 1807 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 40.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-catapult-target-scorched-earth + :id 456 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1808 :flags (is-3d sp3 sp7))) + ) + +(defpart 1808 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:y (meters 0.1)) + (:z (meters 8)) + (:scale-x (meters 1) (meters 2)) + (:scale-y (meters 5) (meters 5)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 0.85333335 0.85333335) + (:timer (seconds 3)) + (:flags (left-multiply-quat)) + (:next-time (seconds 0.25)) + (:next-launcher 1809) + (:rotate-y (degrees 0) (degrees 36000)) + ) + ) + +(defpart 1809 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.75)) (:next-launcher 1810)) + ) + +(defpart 1810 + :init-specs ((:fade-a -0.21333334)) + ) + +(deftype catapult-target (process-drawable) + ((alpha float) + ) + (:state-methods + idle + ) + (:methods + (catapult-target-method-21 (_type_) none) + ) + ) + + +(defbehavior catapult-target-handler catapult-target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-1 object)) + (case arg2 + (('update) + (let ((f0-1 (- (-> (the-as vector (-> arg3 param 0)) y) (-> self root trans y)))) + (set! (-> self alpha) (lerp-scale 128.0 0.0 f0-1 0.0 614400.0)) + ) + 0 + ) + (('on) + (set! v0-1 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-1)) + v0-1 + ) + (('off) + (set! v0-1 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-1)) + v0-1 + ) + (('die) + (activate! *camera-smush-control* 2048.0 30 150 1.0 0.8 (-> *display* camera-clock)) + (cond + ((logtest? (-> *part-group-id-table* 456 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 456)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 456)) + ) + ) + (let ((gp-2 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat))) + (s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (quaternion-rotate-y! gp-2 gp-2 (* 182.04445 (the float (rand-vu-int-count 90)))) + (dotimes (s3-1 4) + (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (quaternion-rotate-y! gp-2 gp-2 16384.0) + (quaternion-rotate-local-x! s5-0 gp-2 -12743.111) + (vector-z-quaternion! s4-0 gp-2) + (vector-normalize! s4-0 40960.0) + (vector+! s4-0 s4-0 (-> self root trans)) + (set! (-> s2-1 ent) (-> self entity)) + (set! (-> s2-1 charge) 1.0) + (set! (-> s2-1 options) (projectile-options)) + (logclear! (-> s2-1 options) (projectile-options po14 po15 po16)) + (set! (-> s2-1 pos quad) + (-> (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) quad) + ) + (set! (-> s2-1 notify-handle) (the-as handle #f)) + (set! (-> s2-1 owner-handle) (the-as handle #f)) + (set! (-> s2-1 target-handle) (the-as handle #f)) + (set! (-> s2-1 target-pos quad) (the-as uint128 0)) + (set! (-> s2-1 ignore-handle) (process->handle self)) + (let* ((v1-55 *game-info*) + (a0-42 (+ (-> v1-55 attack-id) 1)) + ) + (set! (-> v1-55 attack-id) a0-42) + (set! (-> s2-1 attack-id) a0-42) + ) + (set! (-> s2-1 timeout) (seconds 5)) + (set! (-> s2-1 damage) 1.0) + (logior! (-> s2-1 options) (projectile-options po14)) + (vector-normalize-copy! (-> s2-1 vel) (vector-z-quaternion! s4-0 s5-0) 81920.0) + (spawn-projectile v-catapult-shot-embers s2-1 (-> self parent 0) *default-dead-pool*) + ) + ) + ) + (go empty-state) + ) + ) + ) + +(defstate idle (catapult-target) + :virtual #t + :event catapult-target-handler + :trans (behavior () + (catapult-target-method-21 self) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch object vs none. +(defmethod catapult-target-method-21 ((this catapult-target)) + (set! (-> *part-id-table* 1807 init-specs 2 initial-valuef) + (lerp-scale 20480.0 32768.0 (- (-> (math-camera-pos) y) (-> this root trans y)) 12288.0 49152.0) + ) + (set! (-> *part-id-table* 1807 init-specs 8 initial-valuef) (-> this alpha)) + (spawn (-> this part) (-> this root trans)) + (none) + ) + +(defbehavior catapult-target-init-by-other catapult-target ((arg0 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 455) self)) + (go-virtual idle) + ) + +(deftype deschase-vehicle (structure) + ((handle handle) + (wait-timer time-frame) + (shot-fired? symbol) + ) + :allow-misaligned + ) + + +(deftype desert-chase-ambush-manager (task-manager) + ((marauder-nav-mesh nav-mesh) + (marauder handle 5) + (m-free-list (array uint8)) + (marauder-count uint8) + (total-spawned uint8) + (check-timer time-frame) + (marauder-entity entity-actor) + (h-player-controller handle) + (player-moved? symbol) + (vehicle-nav-mesh nav-mesh) + (vehicle deschase-vehicle 4 :inline) + (vehicle-count uint8) + (v-free-list (array uint8)) + (total-veh-spawned uint8) + (target-point vector 4 :inline) + (last-shot-time time-frame) + ) + (:methods + (spawn-marauder (_type_ deschase-point) none) + (spawn-v-catapult (_type_ int) handle) + (fire-catapult-shot (_type_ vector vector) none) + (desert-chase-ambush-manager-method-35 (_type_ int) none) + ) + ) + + +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +(defbehavior desert-chase-ambush-intro-sequence desert-chase-ambush-manager () + (local-vars + (a0-4 process) + (a1-0 event-message-block) + (t9-2 (function process-tree event-message-block object)) + ) + (was-squad-manager-start self) + (let ((v1-0 *was-squad-control*)) + (set! (-> v1-0 target-count) 3) + (set! (-> v1-0 reserve-count) 40) + ) + (label cfg-1) + (let ((gp-0 (entity-by-name "des-draw-bridge-1"))) + (when (not gp-0) + (suspend) + (goto cfg-1) + ) + (set! (-> *was-squad-control* target-count) 0) + (until (t9-2 a0-4 a1-0) + (suspend) + (set! 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) 'down?) + (set! t9-2 send-event-function) + (let ((v1-6 gp-0)) + (set! a0-4 (if v1-6 + (-> v1-6 extra process) + ) + ) + ) + ) + ) + (was-squad-manager-kill) + (set-setting! 'extra-bank '((desert1 strong1) (desert2 desert5)) 0.0 0) + (while (< 184320.0 (vector-vector-distance *stronghold-inside-point* (target-pos 0))) + (suspend) + ) + (set-setting! 'music 'chasmara 0.0 0) + (dotimes (gp-2 4) + (spawn-v-catapult self gp-2) + ) + (suspend) + (dotimes (gp-3 4) + (let* ((s4-0 (handle->process (-> self vehicle gp-3 handle))) + (s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s5-1 + (send-event s5-1 'ai-ignore-nav-mesh) + (send-event s5-1 'ai-set-mode 0) + (send-event s5-1 'ai-set-target-speed 0) + ) + ) + ) + (when (and *target* (focus-test? *target* pilot-riding) (handle->process (-> *target* pilot vehicle))) + (-> self player-vehicle) + (set-setting! 'letterbox 'abs 1.0 0) + (set-setting! 'letterbox-speed 'abs 2.0 0) + (set-setting! 'entity-name "camera-394" 0.0 0) + (sound-play "camera-pan-1" :position #f) + (let ((gp-5 (-> *target* pilot vehicle))) + (send-event (handle->process gp-5) 'ignore-damage #t) + (send-event (handle->process gp-5) 'ignore-impulse #t) + (send-event (handle->process gp-5) 'set-control-hook-ai) + (send-event (handle->process gp-5) 'ai-ignore-nav-mesh #t) + (send-event (handle->process gp-5) 'ai-set-target-speed 122880.0) + (send-event (handle->process gp-5) 'ai-set-target-position *stronghold-vehicle-stop-point*) + ) + (while (let ((f0-1 81920.0)) + (< (* f0-1 f0-1) (vector-vector-distance-squared (target-pos 0) *stronghold-vehicle-stop-point*)) + ) + (suspend) + ) + (process-spawn + simple-nav-sphere + 40960.0 + *stronghold-vehicle-stop-point* + (-> self marauder-nav-mesh) + -1 + :name "simple-nav-sphere" + :to self + ) + (set-setting! 'stop-vehicle? #t 0.0 0) + (send-event *target* 'change-mode 'normal) + (set-setting! 'pilot #f 0.0 0) + ) + (send-event *vehicle-manager* 'no-extra-bank) + (set-setting! 'extra-bank '((wasall1 strong2) (desert1 strong1) (desert2 desert5)) 0.0 0) + (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) + (set! (-> *display* force-sync) (the-as uint 240)) + (sound-play "camera-pan-2" :position #f) + (set-setting! 'entity-name "camera-399" 0.0 0) + (let ((v1-137 (-> self vehicle 3 handle process))) + (set-setting! 'sound-ear v1-137 0.0 (-> v1-137 0 pid)) + ) + (let ((gp-9 (current-time))) + (until (time-elapsed? gp-9 (seconds 1.5)) + (suspend) + ) + ) + (desert-chase-ambush-manager-method-35 self 3) + (let ((gp-10 (current-time))) + (until (time-elapsed? gp-10 (seconds 1)) + (suspend) + ) + ) + (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) + (set! (-> *display* force-sync) (the-as uint 240)) + (sound-play "camera-pan-3" :position #f) + (let ((v1-157 (-> self vehicle 2 handle process))) + (set-setting! 'sound-ear v1-157 0.0 (-> v1-157 0 pid)) + ) + (set-setting! 'entity-name "camera-400" 0.0 0) + (let ((gp-12 (current-time))) + (until (time-elapsed? gp-12 (seconds 1.5)) + (suspend) + ) + ) + (desert-chase-ambush-manager-method-35 self 2) + (let ((gp-13 (current-time))) + (until (time-elapsed? gp-13 (seconds 1)) + (suspend) + ) + ) + (desert-chase-ambush-manager-method-35 self 1) + (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) + (set! (-> *display* force-sync) (the-as uint 240)) + (sound-play "camera-pan-4" :position #f) + (let ((v1-181 (-> self vehicle 0 handle process))) + (set-setting! 'sound-ear v1-181 0.0 (-> v1-181 0 pid)) + ) + (set-setting! 'entity-name "camera-402" 0.0 0) + (let ((gp-15 (current-time))) + (until (time-elapsed? gp-15 (seconds 1.5)) + (suspend) + ) + ) + (desert-chase-ambush-manager-method-35 self 0) + (let ((gp-16 (current-time))) + (until (time-elapsed? gp-16 (seconds 1)) + (suspend) + ) + ) + (remove-setting! 'sound-ear) + (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) + (set! (-> *display* force-sync) (the-as uint 240)) + (sound-play "camera-pan-5" :position #f) + (set-setting! 'entity-name "camera-394" 0.0 0) + (remove-setting! 'letterbox) + (set-blackout-frames 0) + (until (process-release? *target*) + (suspend) + ) + (when *target* + (logior! (-> *target* focus-status) (focus-status teleporting)) + (process-drawable-show-all-cloth *target* #f) + (logior! (-> *target* draw status) (draw-control-status no-draw)) + (let ((gp-18 (get-continue-by-name *game-info* "desertf-stronghold-start"))) + (move-to-point! (-> *target* control) (-> gp-18 trans)) + (let ((t9-64 quaternion-copy!) + (a0-97 (-> *target* control quat-for-control)) + (a1-57 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> a1-57 x) (* 0.00003051851 (the float (-> gp-18 quat x)))) + (set! (-> a1-57 y) (* 0.00003051851 (the float (-> gp-18 quat y)))) + (set! (-> a1-57 z) (* 0.00003051851 (the float (-> gp-18 quat z)))) + (set! (-> a1-57 w) (* 0.00003051851 (the float (-> gp-18 quat w)))) + (t9-64 a0-97 a1-57) + ) + ) + (rot->dir-targ! (-> *target* control)) + ) + (suspend) + (when *target* + (process-drawable-show-all-cloth *target* #t) + (logclear! (-> *target* draw status) (draw-control-status no-draw)) + ) + (suspend) + (if *target* + (logclear! (-> *target* focus-status) (focus-status teleporting)) + ) + (let ((gp-19 (current-time))) + (until (time-elapsed? gp-19 (seconds 2.5)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (dotimes (gp-20 4) + (let ((s5-7 (-> self vehicle gp-20)) + (v1-253 (-> self vehicle gp-20 handle)) + ) + (when (!= v1-253 #f) + (let ((a0-110 (handle->process v1-253))) + (when a0-110 + (send-event a0-110 'go-die) + (set! (-> s5-7 handle) (the-as handle #f)) + (+! (-> self vehicle-count) -1) + (let ((s5-8 (-> self v-free-list))) + (set! (-> s5-8 (length s5-8)) (the-as uint gp-20)) + (+! (-> s5-8 length) 1) + ) + ) + ) + ) + ) + ) + (task-node-close! (game-task-node desert-chase-marauders-get-to-stronghold) 'event) + (none) + ) + +(defstate active (desert-chase-ambush-manager) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reached-destination) + (set! (-> self player-moved?) #t) + (send-event proc 'change-mode 'lock) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + ;; og:preserve-this + (local-vars (v1-6 object)) + (when (not (task-node-closed? (game-task-node desert-chase-marauders-introduction))) + (while (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status pilot-riding)))) + (suspend) + ) + (until v1-6 + (suspend) + (set! v1-6 + (and *target* (focus-test? *target* pilot-riding) (let ((gp-0 (handle->process (-> *target* pilot vehicle)))) + (if (type? gp-0 v-toad) + gp-0 + ) + ) + ) + ) + ) + ) + (let ((t1-0 8)) + (set-setting! 'vehicles 'set (shr t1-0 32) t1-0) + ) + (set-setting! 'pilot-exit #f 0.0 0) + (cond + ((task-node-closed? (game-task-node desert-chase-marauders-get-to-stronghold)) + (let ((gp-1 (new 'stack-no-clear 'inline-array 'traffic-object-spawn-params 1))) + (set! (-> gp-1 0 object-type) (traffic-type guard-a)) + (set! (-> gp-1 0 behavior) (the-as uint 0)) + (set! (-> gp-1 0 id) (the-as uint 0)) + (set! (-> gp-1 0 nav-mesh) #f) + (set! (-> gp-1 0 nav-branch) #f) + (set! (-> gp-1 0 proc) #f) + (set! (-> gp-1 0 handle) (the-as handle #f)) + (set! (-> gp-1 0 user-data) (the-as uint 0)) + (set! (-> gp-1 0 flags) (traffic-spawn-flags tsf5 tsf6)) + (set! (-> gp-1 0 guard-type) (the-as uint 11)) + (set! (-> gp-1 0 entity) #f) + (vector-reset! (-> gp-1 0 velocity)) + (set! (-> gp-1 0 position quad) (-> *stronghold-vehicle-stop-point* quad)) + (quaternion-copy! (-> gp-1 0 rotation) (new 'static 'quaternion :x -0.0297 :y -0.879 :z -0.019 :w -0.4753)) + (let ((gp-2 (vehicle-spawn (vehicle-type v-toad) (-> gp-1 0)))) + (when gp-2 + (set! (-> self player-vehicle) (process->handle gp-2)) + (process-spawn + simple-nav-sphere + 40960.0 + *stronghold-vehicle-stop-point* + (-> self marauder-nav-mesh) + -1 + :name "simple-nav-sphere" + :to self + ) + (set-setting! 'pilot #f 0.0 0) + (send-event gp-2 'ignore-damage #t) + (send-event gp-2 'ignore-impulse #t) + ) + ) + ) + ) + (else + (desert-chase-ambush-intro-sequence) + ) + ) + (set-setting! 'extra-bank '((wasall1 strong2) (desert1 strong1) (desert2 desert5)) 0.0 0) + (set-setting! 'music 'chasmara 0.0 0) + (set! (-> self hud-counter) + (ppointer->handle (process-spawn hud-marauder :init hud-init-by-other :name "hud-marauder" :to self)) + ) + (set! (-> *game-info* counter) (the float (- (+ (-> self marauder-count) 60) (-> self total-spawned)))) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 3)) + (suspend) + ) + ) + (until (and (>= (-> self total-spawned) (the-as uint 60)) (zero? (-> self marauder-count))) + (when (>= (+ (current-time) (seconds -0.5)) (-> self check-timer)) + (let* ((gp-5 (length *stronghold-marauder-start*)) + (s4-0 (rand-vu-int-count gp-5)) + ) + (dotimes (s5-1 gp-5) + (when (and (< (-> self marauder-count) (the-as uint 5)) (< (-> self total-spawned) (the-as uint 60))) + (spawn-marauder self (-> *stronghold-marauder-start* s4-0)) + (set! s4-0 (mod (+ s4-0 1) gp-5)) + ) + (set-time! (-> self check-timer)) + ) + ) + ) + (dotimes (gp-6 4) + (let ((s5-2 (-> self vehicle gp-6))) + (when (and (time-elapsed? (-> s5-2 wait-timer) (seconds 5)) (time-elapsed? (-> self last-shot-time) (seconds 3))) + (let ((s4-1 (new 'stack-no-clear 'vector)) + (s3-0 (-> self target-point gp-6)) + ) + (set! (-> s3-0 quad) (-> (target-pos 0) quad)) + (cond + ((rand-vu-percent? 0.2) + (+! (-> s3-0 x) (rand-vu-float-range -20480.0 20480.0)) + (+! (-> s3-0 z) (rand-vu-float-range -20480.0 20480.0)) + ) + (else + (let ((f30-2 (rand-vu-float-range 40960.0 81920.0))) + (+! (-> s3-0 x) (if (rand-vu-percent? 0.5) + (- f30-2) + f30-2 + ) + ) + (+! (-> s3-0 z) (if (rand-vu-percent? 0.5) + (- f30-2) + f30-2 + ) + ) + ) + ) + ) + (when (nav-mesh-method-11 (-> self marauder-nav-mesh) s3-0) + (set! (-> s3-0 y) (-> self marauder-nav-mesh bounds y)) + (vector+! s4-1 s3-0 (new 'static 'vector :y 614400.0 :w 1.0)) + (fire-catapult-shot self s4-1 s3-0) + (set-time! (-> self last-shot-time)) + ) + ) + (set! (-> s5-2 wait-timer) (+ (current-time) (the int (fmin 750.0 (* 1500.0 (rand-vu)))))) + ) + ) + ) + (let ((v1-119 (- (+ (-> self marauder-count) 60) (-> self total-spawned)))) + (cond + ((zero? v1-119) + (when (-> self hud-counter) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self hud-counter) (the-as handle #f)) + ) + ) + (else + (set! (-> *game-info* counter) (the float v1-119)) + ) + ) + ) + (suspend) + ) + (send-event *vehicle-manager* 'extra-bank '((wasall1 wastoad) (desert2 desert5))) + (send-event self 'complete) + ) + ) + +(defmethod fire-catapult-shot ((this desert-chase-ambush-manager) (arg0 vector) (arg1 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-5 (ppointer->handle (process-spawn catapult-target arg1 :name "catapult-target" :to this)))) + (set! (-> gp-0 ent) (-> this entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> arg0 quad)) + (set! (-> gp-0 notify-handle) (process->handle this)) + (set! (-> gp-0 owner-handle) (process->handle this)) + ;; og:preserve-this + (set! (-> gp-0 target-handle) v1-5) + ) + (set! (-> gp-0 target-pos quad) (-> arg1 quad)) + (set! (-> gp-0 ignore-handle) (process->handle this)) + (let* ((v1-13 *game-info*) + (a0-27 (+ (-> v1-13 attack-id) 1)) + ) + (set! (-> v1-13 attack-id) a0-27) + (set! (-> gp-0 attack-id) a0-27) + ) + (set! (-> gp-0 timeout) (seconds 10)) + (set! (-> gp-0 damage) 4.0) + (logior! (-> gp-0 options) (projectile-options po14)) + (spawn-projectile v-catapult-shot gp-0 this *default-dead-pool*) + ) + 0 + (none) + ) + +(defmethod task-manager-method-26 ((this desert-chase-ambush-manager)) + (dotimes (s5-0 5) + (let ((v1-2 (-> this marauder s5-0))) + (when (!= v1-2 #f) + (let ((s4-0 (handle->process v1-2))) + (cond + ((if (type? s4-0 process-focusable) + s4-0 + ) + ) + (else + (set! (-> this marauder s5-0) (the-as handle #f)) + (+! (-> this marauder-count) -1) + (let ((s4-1 (-> this m-free-list))) + (set! (-> s4-1 (length s4-1)) (the-as uint s5-0)) + (+! (-> s4-1 length) 1) + ) + ) + ) + ) + ) + ) + ) + ((method-of-type task-manager task-manager-method-26) this) + (none) + ) + +(defmethod desert-chase-ambush-manager-method-35 ((this desert-chase-ambush-manager) (arg0 int)) + (let* ((gp-0 (-> this vehicle arg0)) + (v1-2 (-> gp-0 handle)) + ) + (when (!= v1-2 #f) + (let* ((s2-0 (handle->process v1-2)) + (s4-0 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when s4-0 + (let ((s3-1 (-> this target-point arg0))) + (set! (-> s3-1 quad) (-> *stronghold-inside-point* quad)) + (+! (-> s3-1 x) (rand-vu-float-range -122880.0 122880.0)) + (+! (-> s3-1 z) (rand-vu-float-range -122880.0 122880.0)) + (send-event s4-0 'launch s3-1 this) + ) + (set! (-> gp-0 shot-fired?) #t) + (set-time! (-> gp-0 wait-timer)) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch connection-minimap vs none. +(defmethod spawn-marauder ((this desert-chase-ambush-manager) (arg0 deschase-point)) + (let ((s5-0 (-> this m-free-list))) + (when (nonzero? (length s5-0)) + (let ((s4-0 (-> s5-0 (+ (length s5-0) -1))) + (s3-0 43) + (f30-0 10.0) + ) + (when (and *target* (and (>= 5.0 (-> *target* fact health)) (rand-vu-percent? 0.6))) + (set! s3-0 20) + (set! f30-0 2.0) + ) + (let ((s1-0 (new 'stack-no-clear 'marauder-init-by-other-params))) + (set! (-> s1-0 trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> s1-0 quat) (-> arg0 quat)) + (set! (-> s1-0 entity) (-> this marauder-entity)) + (set! (-> s1-0 directed?) #f) + (set! (-> s1-0 no-initial-move-to-ground?) #t) + (set! (-> s1-0 multi-focus) #f) + (set! (-> s1-0 skip-jump) #f) + (let ((s2-2 (ppointer->process (process-spawn marauder this s1-0 :name "marauder" :to this)))) + (when s2-2 + (change-to (-> this marauder-nav-mesh) (the-as process-drawable s2-2)) + (let ((v1-26 (-> (the-as marauder s2-2) nav state))) + (set! (-> v1-26 current-poly) (the-as nav-poly #f)) + ) + 0 + (reset-to-collide-spec + (-> (the-as marauder s2-2) focus) + (collide-spec jak bot hit-by-others-list player-list jak-vehicle) + ) + (set! (-> (the-as marauder s2-2) fact pickup-type) (the-as pickup-type s3-0)) + (set! (-> (the-as marauder s2-2) fact pickup-amount) f30-0) + (set! (-> (the-as marauder s2-2) gun?) #f) + (set! (-> this marauder s4-0) (process->handle (the-as marauder s2-2))) + (+! (-> this marauder-count) 1) + (+! (-> s5-0 length) -1) + (+! (-> this total-spawned) 1) + (add-icon! *minimap* (the-as marauder s2-2) (the-as uint 117) (the-as int #f) (the-as vector #t) 0) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod spawn-v-catapult ((this desert-chase-ambush-manager) (arg0 int)) + (let ((gp-0 (-> this v-free-list))) + (when (nonzero? (length gp-0)) + (let ((s4-0 (-> this vehicle (-> gp-0 (+ (length gp-0) -1)))) + (s3-1 (-> *deschase-catapult-spawn-point* arg0)) + (s2-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0)) + ) + (vector-z-quaternion! (-> s2-0 vec) (-> s3-1 quat)) + (vector-float*! (-> s2-0 vec) (-> s2-0 vec) 0.0) + (set! (-> s2-0 params object-type) (traffic-type guard-a)) + (set! (-> s2-0 params behavior) (the-as uint 3)) + (set! (-> s2-0 params id) (the-as uint 0)) + (set! (-> s2-0 params nav-mesh) #f) + (set! (-> s2-0 params nav-branch) #f) + (set! (-> s2-0 params proc) #f) + (set! (-> s2-0 params handle) (the-as handle #f)) + (set! (-> s2-0 params user-data) (the-as uint 0)) + (set! (-> s2-0 params flags) (traffic-spawn-flags tsf6)) + (set! (-> s2-0 params guard-type) (the-as uint 11)) + (set! (-> s2-0 params entity) #f) + (set! (-> s2-0 params velocity quad) (-> s2-0 vec quad)) + (set! (-> s2-0 params position quad) (-> s3-1 pos quad)) + (quaternion-copy! (-> s2-0 params rotation) (-> s3-1 quat)) + (let ((a0-12 (vehicle-spawn (vehicle-type v-catapult) (-> s2-0 params)))) + (when a0-12 + (set! (-> s4-0 handle) (process->handle a0-12)) + (set! (-> s4-0 wait-timer) (the-as time-frame (+ (- 900 (the int (* 1500.0 (rand-vu)))) (current-time)))) + (+! (-> this vehicle-count) 1) + (+! (-> this total-veh-spawned) 1) + (+! (-> gp-0 length) -1) + (return (-> s4-0 handle)) + ) + ) + ) + ) + ) + (the-as handle #f) + ) + +(defmethod task-manager-method-25 ((this desert-chase-ambush-manager)) + (send-event (handle->process (-> this player-vehicle)) 'ignore-damage #f) + (send-event (handle->process (-> this player-vehicle)) 'ignore-impulse #f) + (let ((t9-2 (method-of-type task-manager task-manager-method-25))) + (t9-2 this) + ) + (set! (-> *marauder-nav-enemy-info* attack-damage) 2) + (let ((a0-14 (handle->process (-> this h-player-controller)))) + (if a0-14 + (deactivate a0-14) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this desert-chase-ambush-manager)) + (let ((t9-0 (method-of-type task-manager init!))) + (t9-0 this) + ) + (set! (-> this h-player-controller) (the-as handle #f)) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this desert-chase-ambush-manager)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'extra-bank '((desert2 desert5) (desert3 desert6)) 0.0 0) + (set! (-> this marauder-nav-mesh) (get-nav-mesh (the-as actor-id #xf064))) + (set! (-> this m-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 5)) + (dotimes (v1-4 5) + (set! (-> this marauder v1-4) (the-as handle #f)) + (set! (-> this m-free-list v1-4) (the-as uint v1-4)) + ) + (set! (-> this m-free-list length) 5) + (set! (-> this marauder-entity) (the-as entity-actor (entity-by-name "marauder-3"))) + (set! (-> *marauder-nav-enemy-info* attack-damage) 1) + (set! (-> this marauder-nav-mesh) (get-nav-mesh (the-as actor-id #xf064))) + (set! (-> this v-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 4)) + (dotimes (v1-10 4) + (set! (-> this vehicle v1-10 handle) (the-as handle #f)) + (set! (-> this vehicle v1-10 shot-fired?) #f) + (set! (-> this v-free-list v1-10) (the-as uint v1-10)) + ) + (set! (-> this v-free-list length) 4) + (set! (-> this player-moved?) #f) + (none) + ) + +(deftype deschase-artifact (process-drawable) + ((arrow handle) + (pos vector :inline) + (angs vector :inline) + ) + (:state-methods + idle + ) + (:methods + (check-pickup (_type_) none) + (rotate (_type_) none) + ) + ) + + +(defskelgroup skel-deschase-artifact pre-artifact-a pre-artifact-a-lod0-jg pre-artifact-a-idle-ja + ((pre-artifact-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defbehavior deschase-artifact-init-by-other deschase-artifact ((arg0 vector)) + (set! (-> self level) (level-get *level* 'deschase)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self pos quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-deschase-artifact" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (-> self draw shadow) + (set! (-> self draw shadow-ctrl) (new + 'process + 'shadow-control + -40960.0 + 40960.0 + 614400.0 + (the-as vector #f) + (shadow-flags shdf00 shdf04) + 245760.0 + ) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-1 pos quad) (-> arg0 quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags taf3)) + (set! (-> s5-1 map-icon) (the-as uint 13)) + (set! (-> self arrow) (process->handle (task-arrow-spawn s5-1 self))) + ) + (go-virtual idle) + ) + +(defstate idle (deschase-artifact) + :virtual #t + :trans (behavior () + (check-pickup self) + ) + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + :post (behavior () + (rotate self) + ) + ) + +(defmethod check-pickup ((this deschase-artifact)) + (let ((v1-0 *target*) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (when v1-0 + (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (set! (-> s5-0 w) 4096.0) + (when (focus-test? v1-0 pilot) + (let ((a1-4 (the-as process-focusable (handle->process (-> v1-0 pilot vehicle))))) + (set! (-> s5-0 quad) (-> a1-4 root root-prim prim-core world-sphere quad)) + ) + ) + (let ((f0-1 (vector-vector-distance-squared (-> this root trans) s5-0)) + (f1-1 (+ 12288.0 (-> s5-0 w))) + ) + (when (>= (* f1-1 f1-1) f0-1) + (sound-play "artifact-pickup") + (deactivate this) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod rotate ((this deschase-artifact)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (set! (-> gp-0 fvec x) (seconds-per-frame)) + (+! (-> this angs x) (* 32768.0 (-> gp-0 fvec x))) + (+! (-> this angs y) (* 23665.777 (-> gp-0 fvec x))) + (+! (-> this angs z) (* 20024.889 (-> gp-0 fvec x))) + (+! (-> this angs w) (* 22755.555 (-> gp-0 fvec x))) + (dotimes (v1-5 4) + (if (< 32768.0 (-> this angs data v1-5)) + (+! (-> this angs data v1-5) -65536.0) + ) + (if (< (-> this angs data v1-5) -32768.0) + (+! (-> this angs data v1-5) 65536.0) + ) + ) + (vector-reset! (-> gp-0 rvec)) + (set! (-> gp-0 rvec y) (+ 4915.2 (* 2048.0 (sin (-> this angs x))))) + (set! (-> gp-0 rvec x) (* 1024.0 (sin (-> this angs y)))) + (set! (-> gp-0 rvec z) (* 1024.0 (cos (-> this angs y)))) + (vector+! (-> this root trans) (-> this pos) (-> gp-0 rvec)) + (vector-reset! (-> gp-0 uvec)) + (set! (-> gp-0 uvec z) (* 5461.3335 (sin (-> this angs z)))) + (set! (-> gp-0 uvec y) (-> this angs w)) + (quaternion-zxy! (-> this root quat) (-> gp-0 uvec)) + ) + (ja-post) + 0 + (none) + ) + +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this deschase-artifact) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; WARN: Return type mismatch process vs deschase-artifact. +(defun deschase-artifact-spawn ((arg0 process) (arg1 vector)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn deschase-artifact arg1 :name "deschase-artifact" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as deschase-artifact gp-0) + ) + ) + +(deftype hud-desert-chase-marauders (hud) + () + ) + + +(defmethod draw ((this hud-desert-chase-marauders)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 482.0 (* 130.0 (-> this offset)))) + 25 + ) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -20 45) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-desert-chase-marauders)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + (set! (-> this values 1 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-desert-chase-marauders)) + (set! (-> this level) (level-get *level* 'deschase)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xc70))) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.8) + (set! (-> this strings 0 flags) (font-flags shadow kerning middle large)) + (set! (-> this strings 0 color) (font-color white)) + 0 + (none) + ) + +(define *stronghold-vehicle-start* (new 'static 'boxed-array :type deschase-point + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6089183.0 :y 99123.2 :z 11991433.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.4923 :z 0.0004 :w -0.8703) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6419560.5 :y 99123.2 :z 12347280.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0004 :y -0.9183 :w 0.3957) + ) + ) + ) + +(define *desert-chase-vehicle-start* (new 'static 'boxed-array :type deschase-point + (new 'static 'deschase-point + :pos (new 'static 'vector :x 8088014.5 :y 167103.69 :z 12576974.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.3283 :y 0.9339 :z -0.0804 :w 0.1161) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 8003995.5 :y 131172.36 :z 12836982.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.1975 :y 0.9546 :z 0.0761 :w 0.209) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 7909497.5 :y 107760.02 :z 13230446.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.178 :y 0.9448 :z -0.0933 :w 0.2583) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 7661562.5 :y 84980.125 :z 13392549.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.1404 :y 0.936 :z -0.0788 :w 0.3128) + ) + ) + ) + +(set! (-> *desert-chase-vehicle-start* 0 i-node) 45) + +(set! (-> *desert-chase-vehicle-start* 1 i-node) 45) + +(set! (-> *desert-chase-vehicle-start* 2 i-node) 45) + +(set! (-> *desert-chase-vehicle-start* 3 i-node) 46) + +(deftype deschase-vehicle-control (structure) + ((vehicle handle) + (target handle) + (path deschase-path) + (speed float) + (i-node int32) + (max-dist float) + (speed-factor float) + ) + :allow-misaligned + (:methods + (deschase-vehicle-control-method-9 (_type_) none) + (deschase-vehicle-control-method-10 (_type_) none) + (deschase-vehicle-control-method-11 (_type_) none) + (deschase-vehicle-control-method-12 (_type_) none) + ) + ) + + +(defmethod deschase-vehicle-control-method-9 ((this deschase-vehicle-control)) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this target) (the-as handle #f)) + (set! (-> this speed-factor) 1.0) + 0 + (none) + ) + +(defmethod deschase-vehicle-control-method-11 ((this deschase-vehicle-control)) + (let ((gp-0 (handle->process (-> this vehicle)))) + (when gp-0 + (let* ((s5-0 (-> this path node (-> this i-node))) + (f0-0 (-> s5-0 speed)) + ) + (if (>= 16384.0 f0-0) + (set! f0-0 327680.0) + ) + (let ((f30-0 (fmin f0-0 (* (-> this speed-factor) (-> this speed))))) + (send-event gp-0 'ai-set-target-process (handle->process (-> this target))) + (send-event gp-0 'ai-set-target-position (-> s5-0 position)) + (send-event gp-0 'ai-set-target-speed f30-0) + ) + ) + (send-event gp-0 'ai-ignore-nav-mesh) + ) + ) + 0 + (none) + ) + +(defmethod deschase-vehicle-control-method-10 ((this deschase-vehicle-control)) + (let* ((s5-0 (handle->process (-> this vehicle))) + (v1-3 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when v1-3 + (let* ((s5-1 (-> this path node (-> this i-node))) + (f0-0 (vector-vector-distance-squared (-> v1-3 root trans) (-> s5-1 position))) + (f1-0 40960.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let ((v1-7 (-> s5-1 next-node))) + (if (!= v1-7 -1) + (set! (-> this i-node) v1-7) + ) + ) + ) + ) + (deschase-vehicle-control-method-11 this) + ) + ) + 0 + (none) + ) + +(defmethod deschase-vehicle-control-method-12 ((this deschase-vehicle-control)) + (let* ((s5-0 (handle->process (-> this vehicle))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when (and (the-as process-focusable gp-0) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead))) + ) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (set! (-> s4-0 uvec quad) (-> (the-as process-focusable gp-0) root trans quad)) + (vector-float*! (-> s4-0 rvec) (-> (the-as process-focusable gp-0) root transv) 0.1) + (set! (-> s4-0 fvec x) 24576.0) + (let ((s5-1 (the-as (array collide-shape) ((method-of-type array new) + (the-as symbol (new 'stack-no-clear 'array 'collide-shape 128)) + array + collide-shape + 128 + ) + ) + ) + ) + (set! (-> s5-1 length) (fill-actor-list-for-sphere + *actor-hash* + (-> s4-0 uvec) + (-> s4-0 rvec) + (-> s4-0 fvec x) + (-> s5-1 data) + (-> s5-1 allocated-length) + -1 + ) + ) + (dotimes (s4-1 (-> s5-1 length)) + (let* ((s3-0 (-> s5-1 s4-1 process)) + (a0-15 (if (type? s3-0 v-marauder) + s3-0 + ) + ) + ) + (if (and a0-15 (!= a0-15 gp-0)) + (send-event + a0-15 + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 30.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 0.0)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype desert-chase-chase-manager (task-manager) + ((h-player-controller handle) + (check-timer time-frame) + (speech-time time-frame) + (last-speech int8) + (death-count int16) + (max-dist float) + (suck-factor float) + (player-moved? symbol) + (control-array deschase-vehicle-control 4 :inline) + (minimap connection-minimap :offset 472) + (artifact handle) + ) + (:methods + (spawn-chase-vehicle (_type_ deschase-vehicle deschase-point) none) + (update-chase-status (_type_) none) + ) + ) + + +(defmethod task-manager-method-25 ((this desert-chase-chase-manager)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (let ((a0-3 (handle->process (-> this h-player-controller)))) + (if a0-3 + (deactivate a0-3) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this desert-chase-chase-manager)) + (let ((t9-0 (method-of-type task-manager init!))) + (t9-0 this) + ) + (set! (-> this h-player-controller) (the-as handle #f)) + (set! (-> this artifact) (the-as handle #f)) + (dotimes (s5-0 4) + (deschase-vehicle-control-method-9 (-> this control-array s5-0)) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this desert-chase-chase-manager)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (let ((t1-0 8)) + (set-setting! 'vehicles 'set (shr t1-0 32) t1-0) + ) + (set-setting! 'exclusive-task #f 0.0 (-> this node-info task)) + (set-setting! 'pilot-exit #f 0.0 0) + (let ((a2-3 (-> *game-info* sub-task-list (-> this info final-node) death-count))) + (set! (-> this death-count) (the-as int a2-3)) + (set! (-> this suck-factor) (cond + ((< a2-3 (the-as uint 5)) + 0.0 + ) + ((< a2-3 (the-as uint 10)) + 0.25 + ) + (else + (fmin 1.0 (* 0.05 (the float a2-3))) + ) + ) + ) + (format #t "desert-chase-marauders::initialize death-count ~d, suck-factor ~f~%" a2-3 (-> this suck-factor)) + ) + (set! (-> this player-moved?) #f) + (none) + ) + +(defmethod task-manager-method-26 ((this desert-chase-chase-manager)) + (when (!= (-> this player-vehicle) #f) + (let* ((s5-0 (handle->process (-> this player-vehicle))) + (a0-5 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (if (or (not a0-5) (focus-test? a0-5 dead)) + (send-event this 'fail) + ) + ) + ) + (let ((s5-1 0)) + (dotimes (s4-0 4) + (let ((s3-0 (-> this control-array s4-0))) + (let* ((s2-0 (handle->process (-> s3-0 vehicle))) + (a0-14 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (if (and a0-14 (not (logtest? (-> (the-as process-focusable a0-14) focus-status) (focus-status dead)))) + (+! s5-1 1) + ) + ) + (deschase-vehicle-control-method-10 s3-0) + ) + ) + (set! (-> *game-info* counter) (the float s5-1)) + ) + (hud-timer-handler this) + ((method-of-type task-manager task-manager-method-26) this) + (none) + ) + +(defmethod spawn-chase-vehicle ((this desert-chase-chase-manager) (arg0 deschase-vehicle) (arg1 deschase-point)) + (let ((s5-0 (new 'stack-no-clear 'traffic-object-spawn-params))) + (set! (-> s5-0 object-type) (traffic-type guard-a)) + (set! (-> s5-0 behavior) (the-as uint 3)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 nav-mesh) #f) + (set! (-> s5-0 nav-branch) #f) + (set! (-> s5-0 proc) #f) + (set! (-> s5-0 handle) (the-as handle #f)) + (set! (-> s5-0 user-data) (the-as uint 0)) + (set! (-> s5-0 flags) (traffic-spawn-flags)) + (set! (-> s5-0 guard-type) (the-as uint 11)) + (set! (-> s5-0 entity) #f) + (vector-reset! (-> s5-0 velocity)) + (set! (-> s5-0 position quad) (-> arg1 pos quad)) + (quaternion-copy! (-> s5-0 rotation) (-> arg1 quat)) + (let ((s5-1 (vehicle-spawn (vehicle-type v-marauder-b) (the-as traffic-object-spawn-params (&-> s5-0 object-type)))) + ) + (if (not s5-1) + (format #t "vehicle-spawn failed~%") + ) + (when s5-1 + (format #t "vehicle-spawn pid ~d~%" (-> s5-1 pid)) + (set! (-> arg0 handle) (process->handle s5-1)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defmethod update-chase-status ((this desert-chase-chase-manager)) + (let ((s4-0 -1) + (s5-0 -1) + ) + (let ((s3-0 #f) + (s2-0 3) + ) + (until #f + (let* ((s1-0 (handle->process (-> this control-array s2-0 vehicle))) + (a0-5 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (cond + ((or (not a0-5) (focus-test? (the-as process-focusable a0-5) dead)) + (if s3-0 + (set! s4-0 s2-0) + ) + ) + (else + (when (not s3-0) + (set! s3-0 #t) + (set! s5-0 s2-0) + ) + ) + ) + ) + (+! s2-0 -1) + (if (< s2-0 0) + (goto cfg-21) + ) + ) + ) + #f + (label cfg-21) + (when (!= s4-0 -1) + (let ((v1-21 (-> this control-array s4-0 vehicle))) + (let ((a0-8 (+ s4-0 1))) + (while (>= s5-0 a0-8) + (set! (-> this control-array (+ a0-8 -1) vehicle) (-> this control-array a0-8 vehicle)) + (+! a0-8 1) + ) + ) + (set! (-> this control-array s5-0 vehicle) v1-21) + ) + ) + ) + 0 + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defbehavior desert-chase-chase-intro-sequence desert-chase-chase-manager () + (set-setting! 'extra-bank '((wasall1 wastoad) (desert2 desert5)) 0.0 0) + (set! (-> self player-moved?) #f) + (when *target* + (set-setting! 'entity-name "camera-394" 0.0 0) + (let ((gp-0 (new 'stack-no-clear 'player-controller-init-params))) + (set! (-> gp-0 mode) 'active) + (set! (-> gp-0 flags) (player-controller-flag pc1 lock-features letterbox pc4)) + (set! (-> gp-0 targ-pos quad) (-> *stronghold-player-goto-point* quad)) + (set! (-> gp-0 notify-proc) (process->handle self)) + (set! (-> self h-player-controller) + (ppointer->handle (process-spawn player-controller gp-0 :name "player-controller" :to *target*)) + ) + ) + ) + (set-setting! 'sound-ear-scale 'abs 0.25 0) + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer self)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'raise) + (let ((s5-1 send-event-function) + (v1-21 (entity-by-name "des-jump-bridge-2")) + ) + (s5-1 + (if v1-21 + (-> v1-21 extra process) + ) + gp-1 + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-2 from) (process->ppointer self)) + (set! (-> gp-2 num-params) 0) + (set! (-> gp-2 message) 'raise) + (let ((s5-2 send-event-function) + (v1-26 (entity-by-name "des-jump-bridge-1")) + ) + (s5-2 + (if v1-26 + (-> v1-26 extra process) + ) + gp-2 + ) + ) + ) + (set-time! (-> self check-timer)) + (until #f + (if (or (-> self player-moved?) + (or (< (vector-vector-distance (target-pos 0) *stronghold-player-goto-point*) 40960.0) + (time-elapsed? (-> self check-timer) (seconds 5)) + ) + ) + (goto cfg-32) + ) + (suspend) + ) + #f + (label cfg-32) + (let ((gp-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-4 from) (process->ppointer self)) + (set! (-> gp-4 num-params) 0) + (set! (-> gp-4 message) 'open) + (let ((s5-3 send-event-function) + (v1-44 (entity-by-name "des-garage-door-2")) + ) + (s5-3 + (if v1-44 + (-> v1-44 extra process) + ) + gp-4 + ) + ) + ) + (dotimes (v1-47 4) + (let ((a0-29 (-> self control-array v1-47))) + (set! (-> a0-29 speed) 327680.0) + ) + ) + (let ((gp-5 (-> self control-array))) + (when (not (handle->process (-> gp-5 0 vehicle))) + (spawn-chase-vehicle self (the-as deschase-vehicle gp-5) (-> *stronghold-vehicle-start* 0)) + (set! (-> gp-5 0 path) *desert-chase-marauder-path*) + (set! (-> gp-5 0 i-node) 0) + 0 + ) + ) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 1)) + (suspend) + ) + ) + (let ((gp-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-7 from) (process->ppointer self)) + (set! (-> gp-7 num-params) 0) + (set! (-> gp-7 message) 'open) + (let ((s5-4 send-event-function) + (v1-66 (entity-by-name "des-garage-door-1")) + ) + (s5-4 + (if v1-66 + (-> v1-66 extra process) + ) + gp-7 + ) + ) + ) + (let ((gp-8 (-> self control-array 1))) + (when (not (handle->process (-> gp-8 vehicle))) + (spawn-chase-vehicle self (the-as deschase-vehicle gp-8) (-> *stronghold-vehicle-start* 1)) + (set! (-> gp-8 path) *desert-chase-marauder-path*) + (set! (-> gp-8 i-node) 48) + ) + ) + (let ((gp-9 (current-time))) + (until (time-elapsed? gp-9 (seconds 1)) + (suspend) + ) + ) + (let ((gp-10 (-> self control-array 2))) + (when (not (handle->process (-> gp-10 vehicle))) + (spawn-chase-vehicle self (the-as deschase-vehicle gp-10) (-> *stronghold-vehicle-start* 0)) + (set! (-> gp-10 path) *desert-chase-marauder-path*) + (set! (-> gp-10 i-node) 0) + 0 + ) + ) + (let ((gp-11 (current-time))) + (until (time-elapsed? gp-11 (seconds 1)) + (suspend) + ) + ) + (let ((gp-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-12 from) (process->ppointer self)) + (set! (-> gp-12 num-params) 0) + (set! (-> gp-12 message) 'close) + (let ((s5-5 send-event-function) + (v1-99 (entity-by-name "des-garage-door-2")) + ) + (s5-5 + (if v1-99 + (-> v1-99 extra process) + ) + gp-12 + ) + ) + ) + (let ((gp-13 (-> self control-array 3))) + (when (not (handle->process (-> gp-13 vehicle))) + (spawn-chase-vehicle self (the-as deschase-vehicle gp-13) (-> *stronghold-vehicle-start* 1)) + (set! (-> gp-13 path) *desert-chase-marauder-path*) + (set! (-> gp-13 i-node) 48) + ) + ) + (let ((gp-14 (current-time))) + (until (time-elapsed? gp-14 (seconds 1)) + (suspend) + ) + ) + (let ((gp-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-15 from) (process->ppointer self)) + (set! (-> gp-15 num-params) 0) + (set! (-> gp-15 message) 'close) + (let ((s5-6 send-event-function) + (v1-118 (entity-by-name "des-garage-door-1")) + ) + (s5-6 + (if v1-118 + (-> v1-118 extra process) + ) + gp-15 + ) + ) + ) + (let ((gp-16 (current-time))) + (until (time-elapsed? gp-16 (seconds 1)) + (suspend) + ) + ) + (let ((gp-17 (current-time))) + (until (time-elapsed? gp-17 (seconds 4)) + (suspend) + ) + ) + (send-event (handle->process (-> self h-player-controller)) 'change-mode 'idle) + (dotimes (gp-18 4) + (let ((s5-7 (-> self control-array gp-18))) + (send-event (handle->process (-> s5-7 vehicle)) 'go-die) + (set! (-> s5-7 vehicle) (the-as handle #f)) + ) + ) + (remove-setting! 'pilot) + (remove-setting! 'entity-name) + (remove-setting! 'sound-ear-scale) + (send-event *vehicle-manager* 'no-extra-bank) + (remove-setting! 'extra-bank) + (none) + ) + +(defstate active (desert-chase-chase-manager) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reached-destination) + (set! (-> self player-moved?) #t) + (send-event proc 'change-mode 'lock) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (set-setting! 'allow-progress #f 0.0 0) + (until #f + (let ((a1-1 *target*)) + (if (and a1-1 (not (logtest? (focus-status teleporting) (-> a1-1 focus-status)))) + (goto cfg-8) + ) + ) + (suspend) + ) + #f + (label cfg-8) + (set-setting! 'music 'desres1 0.0 0) + (suspend) + (when (not (task-node-closed? (game-task-node desert-chase-marauders-chase))) + (desert-chase-chase-intro-sequence) + (task-node-close! (game-task-node desert-chase-marauders-chase) 'event) + ) + (set! (-> self player-vehicle) (-> *vehicle-info* handle-by-vehicle-type 15)) + (dotimes (gp-0 3) + (send-event (handle->process (-> self player-vehicle)) 'turbo-pickup) + ) + (remove-setting! 'allow-progress) + (talker-spawn-func (-> *talker-speech* 174) *entity-pool* (target-pos 0) (the-as region #f)) + (dotimes (gp-2 4) + (let ((s5-1 (-> self control-array gp-2))) + (let ((s4-1 (-> *desert-chase-vehicle-start* gp-2))) + (spawn-chase-vehicle self (the-as deschase-vehicle s5-1) s4-1) + (set! (-> s5-1 path) *desert-chase-marauder-path*) + (set! (-> s5-1 i-node) (-> s4-1 i-node)) + ) + (set! (-> s5-1 speed) 0.0) + (set! (-> s5-1 max-dist) 1638400.0) + ) + ) + (set! (-> self hud-counter) + (ppointer->handle + (process-spawn hud-desert-chase-marauders :init hud-init-by-other :name "hud-desert-chase-marauders" :to self) + ) + ) + (suspend) + (set-time! (-> self state-time)) + (until #f + (if (or (and *target* (focus-test? *target* pilot-riding)) + (or (< 204800.0 (vector-vector-distance (target-pos 0) *stronghold-player-goto-point*)) + (time-elapsed? (-> self state-time) (seconds 10)) + ) + ) + (goto cfg-43) + ) + (suspend) + ) + #f + (label cfg-43) + (let ((v1-58 (new 'static 'vector :x 204800.0 :y 192512.0 :z 180224.0 :w 122880.0))) + (dotimes (a0-27 4) + (let ((a1-16 (-> self control-array a0-27))) + (set! (-> a1-16 speed) (+ (-> v1-58 data a0-27) (* -24576.0 (-> self suck-factor)))) + (if *target* + (set! (-> a1-16 target) (process->handle *target*)) + ) + ) + ) + ) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 1)) + (suspend) + ) + ) + (was-squad-manager-start self) + (let ((v1-66 *was-squad-control*)) + (set! (-> v1-66 target-count) 2) + (set! (-> v1-66 reserve-count) 400) + (set! (-> v1-66 target-speed) 143360.0) + ) + (let ((gp-6 3)) + (until #f + (let ((v1-68 gp-6)) + (set! (-> self time-limit) (the-as time-frame (cond + ((zero? v1-68) + 0 + ) + ((= v1-68 1) + #x4650 + ) + ((= v1-68 2) + #x4650 + ) + ((= v1-68 3) + (+ (if (zero? (-> self death-count)) + 900 + 0 + ) + #x34bc + ) + ) + (else + 0 + ) + ) + ) + ) + ) + (set! (-> self max-dist) 2457600.0) + (if (= gp-6 3) + (set! (-> self max-dist) 3072000.0) + ) + (if (nonzero? gp-6) + (set-time! (-> self start-time)) + ) + (set! (-> self minimap) #f) + (until #f + (update-chase-status self) + (dotimes (s5-2 4) + (deschase-vehicle-control-method-12 (-> self control-array s5-2)) + ) + (dotimes (s5-3 gp-6) + (let* ((s4-2 (-> self control-array s5-3)) + (s2-0 (-> self control-array (+ s5-3 1))) + (s1-0 (handle->process (-> s4-2 vehicle))) + (s3-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + (s2-1 (handle->process (-> s2-0 vehicle))) + (v1-101 (if (type? s2-1 process-focusable) + s2-1 + ) + ) + ) + (when (and s3-0 v1-101) + (let ((f0-8 (vector-vector-distance + (-> (the-as process-focusable s3-0) root trans) + (-> (the-as process-focusable v1-101) root trans) + ) + ) + ) + (set! (-> s4-2 speed-factor) 1.0) + (if (< (-> s4-2 max-dist) f0-8) + (set! (-> s4-2 speed-factor) 0.0) + ) + ) + ) + ) + ) + (let ((v1-109 (-> self control-array gp-6))) + (set! (-> v1-109 speed-factor) 1.0) + (let* ((s4-3 (handle->process (-> v1-109 vehicle))) + (s5-4 (if (type? s4-3 process-focusable) + s4-3 + ) + ) + ) + (when (the-as process-focusable s5-4) + (if (not (-> self minimap)) + (set! (-> self minimap) + (add-icon! *minimap* (the-as process-focusable s5-4) (the-as uint 12) (the-as int #f) (the-as vector #t) 0) + ) + ) + (let ((f30-1 (vector-vector-distance (target-pos 0) (-> (the-as process-focusable s5-4) root trans)))) + (if (< (-> self max-dist) f30-1) + (send-event self 'fail) + ) + (when (and (< f30-1 532480.0) (time-elapsed? (-> self speech-time) (seconds 5))) + (set-time! (-> self speech-time)) + (let ((v1-131 (rand-vu-int-count 4))) + (when (!= v1-131 (-> self last-speech)) + (set! (-> self last-speech) v1-131) + (cond + ((zero? v1-131) + (talker-spawn-func (-> *talker-speech* 177) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-131 1) + (talker-spawn-func (-> *talker-speech* 178) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-131 2) + (talker-spawn-func (-> *talker-speech* 180) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-131 3) + (talker-spawn-func (-> *talker-speech* 181) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + ) + ) + 0 + ) + (when (or (not s5-4) (focus-test? (the-as process-focusable s5-4) dead)) + (if (and s5-4 (zero? gp-6)) + (set! (-> self artifact) + (process->handle (deschase-artifact-spawn self (-> (the-as process-focusable s5-4) root trans))) + ) + ) + (goto cfg-146) + ) + ) + ) + (suspend) + ) + #f + (label cfg-146) + (set! (-> self start-time) 0) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (if (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + ) + (let ((s5-5 (current-time))) + (until (time-elapsed? s5-5 (seconds 1)) + (suspend) + ) + ) + (+! gp-6 -1) + (if (= gp-6 -1) + (goto cfg-176) + ) + (if (zero? gp-6) + (send-event (handle->process (-> self control-array 0 vehicle)) 'no-pickup) + ) + (let ((v1-176 gp-6)) + (cond + ((zero? v1-176) + (talker-spawn-func (-> *talker-speech* 179) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-176 1) + (talker-spawn-func (-> *talker-speech* 175) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-176 2) + (talker-spawn-func (-> *talker-speech* 176) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + ) + #f + (label cfg-176) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> *was-squad-control* target-count) 0) + 0 + (until #f + (if (not (handle->process (-> self artifact))) + (goto cfg-193) + ) + (suspend) + ) + #f + (label cfg-193) + (send-event self 'complete) + ) + ) + +(defstate complete (desert-chase-chase-manager) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 4)) + (suspend) + ) + ) + (let ((t9-1 (-> (find-parent-state) code))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) diff --git a/goal_src/jak3/levels/desert/chase/desert-jump.gc b/goal_src/jak3/levels/desert/chase/desert-jump.gc index b8bf1bf5f0..d60ac10808 100644 --- a/goal_src/jak3/levels/desert/chase/desert-jump.gc +++ b/goal_src/jak3/levels/desert/chase/desert-jump.gc @@ -7,3 +7,1238 @@ ;; DECOMP BEGINS +(defpartgroup group-kamikaze-interceptor-fire + :id 453 + :flags (sp0 sp1 sp4) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1802 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7)) + (sp-item 1803 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7)) + (sp-item 1804 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7)) + ) + ) + +(defpart 1804 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 2.0 1.0) + (:x (meters -2) (meters 4)) + (:y (meters 0.5)) + (:z (meters -1) (meters 3)) + (:scale-x (meters 5) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 20.0 20.0) + (:scalevel-x (meters -0.04)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.9) + (:fade-a -0.15) + (:accel-y (meters 0.0016666667) (meters 0.0016666667)) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1802 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.2) + (:y (meters 0)) + (:scale-x (meters 25) (meters 6)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 32.0) + (:b 0.0) + (:a 8.0 8.0) + (:omega (degrees 2250011.2)) + (:timer (seconds 0.335) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1803 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.5) + (:x (meters -2) (meters 4)) + (:y (meters 1.5)) + (:z (meters -1) (meters 3)) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 160) (degrees 40)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 10.0) + (:a 1.0) + (:scalevel-x (meters 0.015) (meters 0.008333334)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.6 0.6) + (:accel-y (meters 0.00066666666) (meters 0.00066666666)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:next-time (seconds 0.167)) + (:next-launcher 1805) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1805 + :init-specs ((:fade-r -0.42666668) + (:fade-g 0.093333334) + (:fade-b 0.39333335) + (:fade-a -0.10909091) + (:accel-y (meters 0.00033333333)) + ) + ) + +(defskelgroup skel-wascity-airlock-debris wascity-airlock-debris wascity-airlock-debris-lod0-jg wascity-airlock-debris-idle-ja + ((wascity-airlock-debris-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +(define *wascity-airlock-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) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 28 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 30 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(deftype wascity-airlock-debris (process-drawable) + () + (:state-methods + idle + explode + ) + (:methods + (spawn-exploder (_type_) none) + ) + ) + + +(defstate idle (wascity-airlock-debris) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('explode) + (go-virtual explode) + ) + ) + ) + :code sleep-code + ) + +(defstate explode (wascity-airlock-debris) + :virtual #t + :code (behavior () + (let ((gp-0 (the-as entity-actor (entity-by-name "wascity-airlock-5"))) + (s5-0 (the-as entity-actor (entity-by-name "wascity-airlock-4"))) + ) + (when (and gp-0 s5-0) + (toggle-status gp-0 (entity-perm-status dead) #t) + (toggle-status s5-0 (entity-perm-status dead) #t) + (kill-by-type wascity-airlock *active-pool*) + (set! (-> self root trans quad) (-> gp-0 extra trans quad)) + (spawn-exploder self) + ) + ) + (suspend) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defmethod run-logic? ((this wascity-airlock-debris)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod spawn-exploder ((this wascity-airlock-debris)) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let ((v1-2 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) 327680.0))) + (vector+! v1-2 v1-2 (-> this root trans)) + (set! (-> gp-0 fountain-rand-transv-lo quad) (-> v1-2 quad)) + ) + (set! (-> gp-0 fountain-rand-transv-hi x) 81920.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 327680.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 4096.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 16384.0) + (set! (-> gp-0 hit-xz-reaction) 0.75) + (set! (-> gp-0 hit-y-reaction) 0.35) + (set! (-> gp-0 max-probes) (the-as uint (length (-> *wascity-airlock-exploder-params* joints)))) + (set! (-> gp-0 duration) (seconds 4)) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-wascity-airlock-debris" (the-as (pointer level) #f)) + 2 + gp-0 + *wascity-airlock-exploder-params* + :name "joint-exploder" + :to this + ) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this wascity-airlock-debris) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (go (method-of-object this idle)) + ) + +(deftype beam-generator (process-drawable) + ((arrow handle) + (pos vector :inline) + (angs vector :inline) + ) + (:state-methods + idle + die + ) + (:methods + (check-pickup (_type_) none) + (rotate (_type_) none) + ) + ) + + +(defskelgroup skel-beam-generator beam-generator beam-generator-lod0-jg beam-generator-idle-ja + ((beam-generator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow beam-generator-shadow-mg + ) + +(defbehavior beam-generator-init-by-other beam-generator ((arg0 vector) (arg1 entity-actor)) + (process-entity-set! self arg1) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self pos quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-beam-generator" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (-> self draw shadow) + (set! (-> self draw shadow-ctrl) (new + 'process + 'shadow-control + -40960.0 + 40960.0 + 614400.0 + (the-as vector #f) + (shadow-flags shdf00 shdf04) + 245760.0 + ) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-1 pos quad) (-> arg0 quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags taf3)) + (set! (-> s5-1 map-icon) (the-as uint 13)) + (set! (-> self arrow) (process->handle (task-arrow-spawn s5-1 self))) + ) + (go-virtual idle) + ) + +(defstate idle (beam-generator) + :virtual #t + :trans (behavior () + (check-pickup self) + ) + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + :post (behavior () + (rotate self) + ) + ) + +(defstate die (beam-generator) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + ) + ) + +(defmethod check-pickup ((this beam-generator)) + (let ((v1-0 *target*) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (when v1-0 + (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (set! (-> s5-0 w) 4096.0) + (when (focus-test? v1-0 pilot) + (let ((a1-4 (the-as process-focusable (handle->process (-> v1-0 pilot vehicle))))) + (set! (-> s5-0 quad) (-> a1-4 root root-prim prim-core world-sphere quad)) + ) + ) + (let ((f0-1 (vector-vector-distance-squared (-> this root trans) s5-0)) + (f1-1 (+ 12288.0 (-> s5-0 w))) + ) + (when (>= (* f1-1 f1-1) f0-1) + (talker-spawn-func (-> *talker-speech* 128) *entity-pool* (target-pos 0) (the-as region #f)) + (send-event (handle->process (-> this arrow)) 'die) + (go (method-of-object this die)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod rotate ((this beam-generator)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (set! (-> gp-0 fvec x) (seconds-per-frame)) + (+! (-> this angs x) (* 32768.0 (-> gp-0 fvec x))) + (+! (-> this angs y) (* 23665.777 (-> gp-0 fvec x))) + (+! (-> this angs z) (* 20024.889 (-> gp-0 fvec x))) + (+! (-> this angs w) (* 22755.555 (-> gp-0 fvec x))) + (dotimes (v1-5 4) + (if (< 32768.0 (-> this angs data v1-5)) + (+! (-> this angs data v1-5) -65536.0) + ) + (if (< (-> this angs data v1-5) -32768.0) + (+! (-> this angs data v1-5) 65536.0) + ) + ) + (vector-reset! (-> gp-0 rvec)) + (set! (-> gp-0 rvec y) (+ 4915.2 (* 2048.0 (sin (-> this angs x))))) + (set! (-> gp-0 rvec x) (* 1024.0 (sin (-> this angs y)))) + (set! (-> gp-0 rvec z) (* 1024.0 (cos (-> this angs y)))) + (vector+! (-> this root trans) (-> this pos) (-> gp-0 rvec)) + (vector-reset! (-> gp-0 uvec)) + (set! (-> gp-0 uvec z) (* 5461.3335 (sin (-> this angs z)))) + (set! (-> gp-0 uvec y) (-> this angs w)) + (quaternion-zxy! (-> this root quat) (-> gp-0 uvec)) + ) + (ja-post) + 0 + (none) + ) + +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this beam-generator) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +(deftype hud-wasdoors-health (hud) + () + ) + + +(defmethod draw ((this hud-wasdoors-health)) + (set-hud-piece-position! + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) + ) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 15 10) + (let ((f30-1 + (the float + (+ (the int (* 127.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 2)))))) 127) + ) + ) + ) + (set! (-> this sprites 1 color x) (the int (lerp-scale 64.0 128.0 f30-1 0.0 255.0))) + (set! (-> this sprites 1 color y) (the int (lerp-scale 64.0 128.0 f30-1 0.0 255.0))) + (set! (-> this sprites 1 color z) (the int (lerp-scale 64.0 128.0 f30-1 0.0 255.0))) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-wasdoors-health)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* health-bar)))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-wasdoors-health)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-transparent-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xace))) + ) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #xace))) + ) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xace))) + ) + (set! (-> this sprites 3 scale-x) 0.65) + (set! (-> this sprites 3 scale-y) 0.95) + (set! (-> this sprites 3 pos z) #xffffff) + 0 + (none) + ) + +(deftype hud-desert-catapult-count (hud) + () + ) + + +(defmethod draw ((this hud-desert-catapult-count)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 482.0 (* 130.0 (-> this offset)))) + 25 + ) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -20 60) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-desert-catapult-count)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-desert-catapult-count)) + (set! (-> this level) (level-get *level* 'desjump)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xace))) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.8) + (set! (-> this strings 0 flags) (font-flags shadow kerning middle large)) + (set! (-> this strings 0 color) (font-color white)) + 0 + (none) + ) + +(deftype desjump-point (structure) + ((pos vector :inline) + (quat quaternion :inline) + ) + ) + + +(define *desjump-wasdoors-pos* (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0)) + +(define *desjump-vehicle-path* (the-as (array (array desjump-point)) + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9631658.0 :y 117858.305 :z 2423129.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9983 :w 0.0566) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9501355.0 :y 119288.22 :z 1724418.5 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 8930882.0 :y 149373.75 :z 2460976.8 :w 1.0) + :quat (new 'static 'quaternion :y 0.9699 :w 0.2434) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9102560.0 :y 123364.97 :z 1795913.4 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 10259027.0 :y 116531.61 :z 2201311.2 :w 1.0) + :quat (new 'static 'quaternion :y -0.9269 :w 0.3752) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9727058.0 :y 119932.516 :z 1606351.2 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 10602098.0 :y 112007.58 :z 1830187.4 :w 1.0) + :quat (new 'static 'quaternion :y -0.915 :w 0.4034) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9916447.0 :y 120501.45 :z 1482014.2 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 10375236.0 :y 110511.31 :z 2096389.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.9286 :w 0.3709) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9508849.0 :y 123161.4 :z 1245483.9 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9639729.0 :y 122473.68 :z 1372115.8 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9996342.0 :y 119910.81 :z 2389373.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.9658 :w 0.2589) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9453793.0 :y 123170.41 :z 1286821.1 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9500160.0 :y 122431.08 :z 1457920.4 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9268282.0 :y 124794.06 :z 2578690.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.9999 :w 0.0133) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9270956.0 :y 138510.34 :z 1285244.9 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9313876.0 :y 128615.22 :z 1467933.1 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 8764265.0 :y 182223.25 :z 2371544.8 :w 1.0) + :quat (new 'static 'quaternion :y 0.9733 :w 0.2294) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9174787.0 :y 162145.08 :z 1362950.5 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9219156.0 :y 148370.64 :z 1482753.2 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + ) + ) + ) + +(deftype desjump-vehicle (structure) + ((handle handle) + (path-type uint8) + (path-pos uint8) + (ready? symbol) + (kamikaze? symbol) + (wait-timer time-frame) + ) + :pack-me + ) + + +(deftype desert-jump-manager (task-manager) + ((nav-mesh nav-mesh) + (vehicle desjump-vehicle 2 :inline) + (vehicle-count uint8) + (v-free-list (array uint8)) + (total-veh-spawned uint8) + (check-timer time-frame) + (hud-wasdoors-health handle :overlay-at (-> hud 2)) + (generator handle) + (interceptor desjump-vehicle 4 :inline) + (interceptor-count uint8) + (i-free-list (array uint8)) + (interceptor-timer time-frame) + (plane vector :inline) + (last-catapult-pos vector :inline) + (player-can-win? symbol) + ) + (:methods + (spawn-vehicle (_type_ uint vehicle-type) handle) + (spawn-beam-generator (_type_ vector) none) + (damage-airlock (_type_ int) none) + ) + ) + + +(defmethod taskman-event-handler ((this desert-jump-manager) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (with-pp + (case arg2 + (('notify) + (when (= (-> arg3 param 0) 'attack) + (let ((v1-2 (if (type? arg0 projectile) + (the-as projectile arg0) + ) + ) + ) + (if (and v1-2 (let ((f0-0 (vector-vector-distance-squared (-> v1-2 root trans) *desjump-wasdoors-pos*)) + (f1-0 20480.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (damage-airlock this 1) + ) + ) + ) + ) + (('explode-doors) + (want-display-level *load-state* 'wasdoors 'display) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 5) + 'entity-name + (the-as symbol "camera-398") + 0.0 + 0 + ) + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer pp)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'explode) + (let ((s5-1 send-event-function) + (v1-14 (entity-by-name "wascity-airlock-debris-1")) + ) + (s5-1 + (if v1-14 + (-> v1-14 extra process) + ) + gp-1 + ) + ) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +(defmethod damage-airlock ((this desert-jump-manager) (arg0 int)) + (when #t + (when (not (task-node-closed? (game-task-node desert-jump-mission-protect-doors))) + (cond + ((= arg0 1) + (+! (-> *game-info* health-bar) -0.15) + ) + ((zero? arg0) + (+! (-> *game-info* health-bar) -0.07) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate active (desert-jump-manager) + :virtual #t + :code (behavior () + (local-vars (v1-33 object) (f30-1 float)) + (set-setting! 'fog-special-interp-rate #f 0.025 0) + (set-setting! 'fog-special-interp-targ #f 0.4 0) + (cond + ((task-node-closed? (game-task-node desert-jump-mission-protect-doors)) + (spawn-beam-generator self (-> *desjump-vehicle-path* 0 (+ (length (-> *desjump-vehicle-path* 0)) -1) pos)) + ) + (else + (if (and *target* (nonzero? (-> *target* pilot))) + (send-event (handle->process (-> *target* pilot vehicle)) 'scale-max-hit-points 2.7) + ) + (let ((gp-1 (the-as entity-actor (entity-by-name "wascity-airlock-5")))) + (when gp-1 + (vector-z-quaternion! (-> self plane) (-> gp-1 quat)) + (set! (-> self plane w) (- (vector-dot (-> self plane) (-> gp-1 extra trans)))) + ) + ) + (until v1-33 + (suspend) + (set! v1-33 (and *target* (< 81920.0 (vector4-dot (-> self plane) (target-pos 0))))) + ) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-load '((ignore all) (allow desjump)) 0.0 0) + (let ((a1-7 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-7 9) #f) + (set! (-> a1-7 8) #f) + (set! (-> a1-7 7) #f) + (set! (-> a1-7 6) #f) + (set! (-> a1-7 5) #f) + (set! (-> a1-7 4) #f) + (set! (-> a1-7 3) 'desertb) + (set! (-> a1-7 2) 'desert-game) + (set! (-> a1-7 1) 'wasdoors) + (set! (-> a1-7 0) 'wasall) + (want-levels *load-state* a1-7) + ) + (set-setting! 'extra-bank '((desert2 desjump1)) 0.0 0) + (until (and (>= (-> self total-veh-spawned) (the-as uint 13)) + (zero? (-> self vehicle-count)) + (-> self player-can-win?) + ) + (when (>= (+ (current-time) (seconds -1)) (-> self interceptor-timer)) + (when (< (-> self interceptor-count) (the-as uint 4)) + (let ((gp-3 15)) + (dotimes (v1-56 4) + (let ((a0-25 (-> self interceptor v1-56))) + (if (!= (-> a0-25 handle) #f) + (set! gp-3 (logior gp-3 (ash 1 (the-as int (-> a0-25 path-type))))) + ) + ) + ) + (spawn-vehicle + self + (the-as uint (rand-vu-int-count-excluding (length *desjump-vehicle-path*) gp-3)) + (vehicle-type v-marauder) + ) + ) + (set-time! (-> self interceptor-timer)) + ) + ) + (when (>= (+ (current-time) (seconds -7)) (-> self check-timer)) + (when (and (< (-> self vehicle-count) (the-as uint 2)) (< (-> self total-veh-spawned) (the-as uint 13))) + (let ((gp-4 4080)) + (dotimes (v1-72 2) + (let ((a0-36 (-> self vehicle v1-72))) + (if (!= (-> a0-36 handle) #f) + (set! gp-4 (logior gp-4 (ash 1 (the-as int (-> a0-36 path-type))))) + ) + ) + ) + (if (= (-> self total-veh-spawned) 12) + (set! gp-4 (logior gp-4 2)) + ) + (spawn-vehicle + self + (the-as uint (rand-vu-int-count-excluding (length *desjump-vehicle-path*) gp-4)) + (vehicle-type v-catapult) + ) + ) + ) + (set-time! (-> self check-timer)) + ) + (suspend) + ) + ) + ) + (send-event (handle->process (-> self hud-wasdoors-health)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (when (not (task-node-closed? (game-task-node desert-jump-mission-protect-doors))) + (remove-setting! 'exclusive-load) + (spawn-beam-generator self (-> self last-catapult-pos)) + (task-node-close! (game-task-node desert-jump-mission-protect-doors) 'event) + ) + (set-setting! 'fog-special-interp-rate #f 0.05 0) + (set-setting! 'fog-special-interp-targ #f 0.1 0) + (while (or (handle->process (-> self generator)) (nonzero? (-> self interceptor-count))) + (dotimes (gp-5 4) + (let ((s5-3 (-> self interceptor gp-5))) + (when (!= (-> s5-3 handle) #f) + (let* ((s4-2 (handle->process (-> s5-3 handle))) + (a0-63 (if (type? s4-2 process-focusable) + s4-2 + ) + ) + ) + (when a0-63 + (cond + ((-> s5-3 kamikaze?) + (send-event + a0-63 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker-velocity (new 'static 'vector :w 1.0)) + ) + ) + ) + (set! (-> self interceptor gp-5 handle) (the-as handle #f)) + (+! (-> self interceptor-count) -1) + (let ((s5-4 (-> self i-free-list))) + (set! (-> s5-4 (length s5-4)) (the-as uint gp-5)) + (+! (-> s5-4 length) 1) + ) + ) + ((not (logtest? (-> (the-as process-focusable a0-63) draw status) (draw-control-status on-screen))) + (send-event a0-63 'go-die) + ) + ) + ) + ) + ) + ) + ) + (suspend) + ) + (when (handle->process (-> *game-info* dust-storm)) + 1.0 + (let ((gp-6 (-> *game-info* dust-storm))) + (until (>= 0.1 f30-1) + (let ((a1-34 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-34 from) (process->ppointer self)) + (set! (-> a1-34 num-params) 0) + (set! (-> a1-34 message) 'get-intensity) + (let ((t9-31 send-event-function) + (a0-75 (handle->process gp-6)) + ) + (set! f30-1 (the-as float (t9-31 a0-75 a1-34))) + ) + ) + (suspend) + ) + ) + ) + (let ((gp-7 (current-time))) + (until (time-elapsed? gp-7 (seconds 2)) + (suspend) + ) + ) + (send-event self 'complete) + ) + :post (behavior () + (set! (-> *game-info* counter) + (the float (- 13 (the-as int (- (-> self total-veh-spawned) (-> self vehicle-count))))) + ) + 0 + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod task-manager-method-26 ((this desert-jump-manager)) + (with-pp + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (>= 0.0 (-> *game-info* health-bar)) + (want-display-level *load-state* 'wasdoors 'display) + (set-setting! 'entity-name "camera-398" 0.0 0) + (let ((s5-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-0 from) (process->ppointer pp)) + (set! (-> s5-0 num-params) 0) + (set! (-> s5-0 message) 'explode) + (let ((s4-0 send-event-function) + (v1-9 (entity-by-name "wascity-airlock-debris-1")) + ) + (s4-0 + (if v1-9 + (-> v1-9 extra process) + ) + s5-0 + ) + ) + ) + (send-event this 'fail) + ) + (dotimes (s5-1 2) + (let* ((s4-1 (-> this vehicle s5-1)) + (v1-17 (-> s4-1 handle)) + ) + (when (!= v1-17 #f) + (let* ((s2-0 (handle->process v1-17)) + (s3-0 (if (type? s2-0 process-focusable) + (the-as process-focusable s2-0) + ) + ) + ) + (cond + ((and s3-0 (not (logtest? (-> s3-0 focus-status) (focus-status dead)))) + (set! (-> this last-catapult-pos quad) (-> s3-0 root trans quad)) + (let ((s1-0 (-> *desjump-vehicle-path* (-> s4-1 path-type) (-> s4-1 path-pos))) + (s2-1 (= (+ (length (-> *desjump-vehicle-path* (-> s4-1 path-type))) -1) (-> s4-1 path-pos))) + ) + (let ((f30-0 (vector-vector-distance-squared (-> s1-0 pos) (-> s3-0 root trans)))) + (when (and (not s2-1) (let ((f0-1 81920.0)) + (< f30-0 (* f0-1 f0-1)) + ) + ) + (+! (-> s4-1 path-pos) 1) + (send-event + s3-0 + 'ai-set-target-position + (-> *desjump-vehicle-path* (-> s4-1 path-type) (-> s4-1 path-pos) pos) + ) + (send-event s3-0 'ai-set-target-speed 163840.0) + (if *target* + (send-event s3-0 'ai-set-target-process *target*) + ) + ) + (when (and s2-1 + (let ((f0-4 122880.0)) + (< f30-0 (* f0-4 f0-4)) + ) + (not (-> s4-1 ready?)) + ) + (send-event s3-0 'ai-set-mode 0) + (send-event s3-0 'ai-set-target-speed 0) + (set-time! (-> s4-1 wait-timer)) + (set! (-> s4-1 ready?) #t) + (when (= (-> this total-veh-spawned) 13) + (send-event s3-0 'ignore-damage #f) + (send-event s3-0 'ignore-impulse #f) + ) + ) + ) + (when (and s2-1 + (-> s4-1 ready?) + (time-elapsed? (-> s4-1 wait-timer) (seconds 10)) + (not (focus-test? s3-0 inactive)) + (let ((a0-49 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 root quat))) + (a1-17 (vector-! (new 'stack-no-clear 'vector) *desjump-wasdoors-pos* (-> s3-0 root trans))) + ) + (< (vector-vector-angle-safe a0-49 a1-17) 5461.3335) + ) + ) + (send-event s3-0 'launch *desjump-wasdoors-pos* this) + (set-time! (-> s4-1 wait-timer)) + (if (>= 0.15 (-> *game-info* health-bar)) + (set! (-> this player-can-win?) #f) + ) + ) + ) + ) + (else + (set! (-> this vehicle s5-1 handle) (the-as handle #f)) + (+! (-> this vehicle-count) -1) + (let ((s4-2 (-> this v-free-list))) + (set! (-> s4-2 (length s4-2)) (the-as uint s5-1)) + (+! (-> s4-2 length) 1) + ) + ) + ) + ) + ) + ) + ) + (dotimes (s5-2 4) + (let* ((s3-1 (-> this interceptor s5-2)) + (v1-119 (-> s3-1 handle)) + ) + (when (!= v1-119 #f) + (let* ((s2-2 (handle->process v1-119)) + (s4-3 (if (type? s2-2 process-focusable) + s2-2 + ) + ) + ) + (cond + ((and (the-as process-focusable s4-3) + (not (logtest? (-> (the-as process-focusable s4-3) focus-status) (focus-status dead))) + ) + (let* ((s1-1 (-> *desjump-vehicle-path* (-> s3-1 path-type) (-> s3-1 path-pos))) + (s2-3 (= (+ (length (-> *desjump-vehicle-path* (-> s3-1 path-type))) -1) (-> s3-1 path-pos))) + (f0-9 (vector-vector-distance-squared (-> s1-1 pos) (-> (the-as process-focusable s4-3) root trans))) + ) + (cond + ((-> s3-1 kamikaze?) + (when (and (not s2-3) (let ((f1-3 81920.0)) + (< f0-9 (* f1-3 f1-3)) + ) + ) + (+! (-> s3-1 path-pos) 1) + (send-event + s4-3 + 'ai-set-target-position + (-> *desjump-vehicle-path* (-> s3-1 path-type) (-> s3-1 path-pos) pos) + ) + (send-event s4-3 'ai-set-target-speed 163840.0) + ) + (when (and s2-3 (not (-> s3-1 ready?))) + (send-event s4-3 'ai-ignore-nav-mesh #t) + (send-event + s4-3 + 'ai-set-target-position + (-> *desjump-vehicle-path* (-> s3-1 path-type) (-> s3-1 path-pos) pos) + ) + (send-event s4-3 'ai-set-target-speed 245760.0) + (set! (-> s3-1 ready?) #t) + ) + (when (and s2-3 + (-> s3-1 ready?) + (< (vector4-dot (-> this plane) (-> (the-as process-focusable s4-3) root trans)) 61440.0) + ) + (send-event + s4-3 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker-velocity (new 'static 'vector :w 1.0)) + ) + ) + ) + (damage-airlock this 0) + (set! (-> this interceptor s5-2 handle) (the-as handle #f)) + (+! (-> this interceptor-count) -1) + (let ((s4-4 (-> this i-free-list))) + (set! (-> s4-4 (length s4-4)) (the-as uint s5-2)) + (+! (-> s4-4 length) 1) + ) + ) + ) + (else + (when (and (time-elapsed? (-> s3-1 wait-timer) (seconds 3)) *target*) + (send-event s4-3 'ai-set-target-process *target*) + (send-event s4-3 'ai-set-target-speed 163840.0) + (send-event s4-3 'ai-set-target-position (target-pos 0)) + (set-time! (-> s3-1 wait-timer)) + ) + ) + ) + ) + ) + (else + (set! (-> this interceptor s5-2 handle) (the-as handle #f)) + (+! (-> this interceptor-count) -1) + (let ((s4-5 (-> this i-free-list))) + (set! (-> s4-5 (length s4-5)) (the-as uint s5-2)) + (+! (-> s4-5 length) 1) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +(defmethod spawn-beam-generator ((this desert-jump-manager) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg0 quad)) + (+! (-> s5-0 y) 8192.0) + (set! (-> this generator) + (ppointer->handle (process-spawn beam-generator s5-0 (-> this entity) :name "beam-generator" :to this)) + ) + ) + 0 + (none) + ) + +(defun part-tracker-check-parent ((arg0 part-tracker)) + (let ((v1-1 (-> arg0 parent 0))) + (when (and v1-1 (-> v1-1 next-state) (= (-> v1-1 next-state name) 'explode-into-nothing)) + (set! (-> arg0 linger-duration) (seconds 6)) + (send-event arg0 'draw #f) + ) + ) + ) + +(defmethod spawn-vehicle ((this desert-jump-manager) (arg0 uint) (arg1 vehicle-type)) + (let ((gp-0 (if (= arg1 (vehicle-type v-catapult)) + (-> this v-free-list) + (-> this i-free-list) + ) + ) + ) + (when (nonzero? (length gp-0)) + (let* ((v1-8 (-> gp-0 (+ (length gp-0) -1))) + (s5-0 (if (= arg1 (vehicle-type v-catapult)) + (-> this vehicle v1-8) + (-> this interceptor v1-8) + ) + ) + (s2-0 (-> *desjump-vehicle-path* arg0 0)) + (s0-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0)) + ) + (vector-z-quaternion! (-> s0-0 vec) (-> s2-0 quat)) + (vector-float*! (-> s0-0 vec) (-> s0-0 vec) 204800.0) + (set! (-> s0-0 params object-type) (traffic-type guard-a)) + (set! (-> s0-0 params behavior) (the-as uint 3)) + (set! (-> s0-0 params id) (the-as uint 0)) + (set! (-> s0-0 params nav-mesh) (-> this nav-mesh)) + (set! (-> s0-0 params nav-branch) #f) + (set! (-> s0-0 params proc) #f) + (set! (-> s0-0 params handle) (the-as handle #f)) + (set! (-> s0-0 params user-data) (the-as uint 0)) + (set! (-> s0-0 params flags) (traffic-spawn-flags)) + (set! (-> s0-0 params guard-type) (the-as uint 11)) + (set! (-> s0-0 params entity) #f) + (set! (-> s0-0 params velocity quad) (-> s0-0 vec quad)) + (set! (-> s0-0 params position quad) (-> s2-0 pos quad)) + (quaternion-copy! (-> s0-0 params rotation) (-> s2-0 quat)) + (let ((s2-1 (vehicle-spawn arg1 (-> s0-0 params)))) + (when s2-1 + (set! (-> s5-0 path-type) arg0) + (set! (-> s5-0 path-pos) (the-as uint 0)) + (set! (-> s5-0 handle) (process->handle s2-1)) + (set! (-> s5-0 ready?) #f) + (cond + ((= arg1 (vehicle-type v-catapult)) + (+! (-> this vehicle-count) 1) + (+! (-> this total-veh-spawned) 1) + ) + (else + (+! (-> this interceptor-count) 1) + (set! (-> s5-0 kamikaze?) (rand-vu-percent? 0.3)) + (cond + ((-> s5-0 kamikaze?) + (set! (-> (the-as wvehicle s2-1) minimap) + (add-icon! *minimap* s2-1 (the-as uint 128) (the-as int #f) (the-as vector #t) 0) + ) + (if (logtest? (-> *part-group-id-table* 453 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to s2-1 + :group (-> *part-group-id-table* 453) + :duration -1 + :callback (the-as (function part-tracker vector) part-tracker-check-parent) + :target s2-1 + :mat-joint 3 + ) + (part-tracker-spawn + part-tracker + :to s2-1 + :group (-> *part-group-id-table* 453) + :duration -1 + :callback (the-as (function part-tracker vector) part-tracker-check-parent) + :target s2-1 + :mat-joint 3 + ) + ) + ) + (else + ) + ) + ) + ) + (when (not (-> s5-0 kamikaze?)) + (send-event s2-1 'ai-set-attack-delay-factor 4.0) + (send-event s2-1 'ai-set-inaccuracy-factor 2.0) + ) + (when (and (= (-> this total-veh-spawned) 13) (= arg1 (vehicle-type v-catapult))) + (send-event s2-1 'no-pickup) + (send-event s2-1 'ignore-damage #t) + (send-event s2-1 'ignore-impulse #t) + ) + (+! (-> gp-0 length) -1) + (return (-> s5-0 handle)) + ) + ) + ) + ) + ) + (the-as handle #f) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this desert-jump-manager)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'music 'oasisfi 0.0 0) + (set! (-> *game-info* health-bar) 1.0) + (set! (-> *game-info* health-bar-owner) (process->handle this)) + (set! (-> this hud-wasdoors-health) + (ppointer->handle + (process-spawn hud-wasdoors-health :init hud-init-by-other :name "hud-wasdoors-health" :to this) + ) + ) + (set! (-> this hud-counter) + (ppointer->handle + (process-spawn hud-desert-catapult-count :init hud-init-by-other :name "hud-desert-catapult-count" :to this) + ) + ) + (set! (-> this nav-mesh) (get-nav-mesh (the-as actor-id #xa7d6))) + (set! (-> this v-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 2)) + (dotimes (v1-19 2) + (set! (-> this vehicle v1-19 handle) (the-as handle #f)) + (set! (-> this vehicle v1-19 ready?) #f) + (set! (-> this v-free-list v1-19) (the-as uint v1-19)) + ) + (set! (-> this v-free-list length) 2) + (set! (-> this i-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 4)) + (dotimes (v1-24 4) + (set! (-> this interceptor v1-24 handle) (the-as handle #f)) + (set! (-> this interceptor v1-24 ready?) #f) + (set! (-> this i-free-list v1-24) (the-as uint v1-24)) + ) + (set! (-> this i-free-list length) 4) + (set! (-> this generator) (the-as handle #f)) + (set! (-> this player-can-win?) #t) + (none) + ) diff --git a/goal_src/jak3/levels/desert/chase/marauder.gc b/goal_src/jak3/levels/desert/chase/marauder.gc index 640fb947d2..4e1a4ef6df 100644 --- a/goal_src/jak3/levels/desert/chase/marauder.gc +++ b/goal_src/jak3/levels/desert/chase/marauder.gc @@ -1526,8 +1526,8 @@ (call-parent-method this offset) ) -(defmethod penetrate->next-state ((this marauder)) - ((method-of-type nav-enemy penetrate->next-state) this) +(defmethod penetrate->next-state ((this marauder) (arg0 process) (arg1 event-message-block) (arg2 float)) + ((method-of-type nav-enemy penetrate->next-state) this arg0 arg1 arg2) ) ;; WARN: Return type mismatch number vs float. @@ -1861,15 +1861,15 @@ (none) ) -(defmethod init-enemy-defaults! ((this marauder) (arg0 enemy-info)) - (set! (-> (the-as nav-enemy-info arg0) nav-mesh) *default-nav-mesh*) +;; WARN: Return type mismatch int vs object. +(defmethod init-enemy-defaults! ((this marauder) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) 0 - (none) ) (defmethod init-enemy-collision! ((this marauder)) diff --git a/goal_src/jak3/levels/desert/chase/wcar-catapult.gc b/goal_src/jak3/levels/desert/chase/wcar-catapult.gc index b4941772f7..110b1a25a9 100644 --- a/goal_src/jak3/levels/desert/chase/wcar-catapult.gc +++ b/goal_src/jak3/levels/desert/chase/wcar-catapult.gc @@ -5,5 +5,2190 @@ ;; name in dgo: wcar-catapult ;; dgos: DESJUMP, DESCHASE +(define-extern *range-ftexplo-dust-color* curve-color-fast) +(define-extern *range-ftexplo-dust-alpha* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-dust-alpha* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *range-ftexplo-color* curve-color-fast) +(define-extern *range-ftexplo-alpha* curve2d-fast) +(define-extern *range-ftexplo-scale-x* curve2d-fast) +(define-extern *range-ftexplo-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-alpha* curve2d-fast) +(define-extern *curve-ftexplo-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-scale-y* curve2d-fast) +(define-extern *v-catapult-shot-impact-blur* curve2d-piecewise) + ;; DECOMP BEGINS +(defskelgroup skel-v-catapult catapult 38 41 + ((39 (meters 999999))) + :bounds (static-spherem 0 0 0 24) + :shadow 40 + :origin-joint-index 3 + ) + +(defskelgroup skel-v-catapult-wheel catapult catapult-wheel-lod0-jg catapult-wheel-idle-ja + ((catapult-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.5) + :longest-edge (meters 1.07) + :shadow catapult-wheel-shadow-mg + ) + +(define *v-catapult-turret-control-info* (new 'static 'turret-control-info + :joint-index 59 + :barrel-count 1 + :shot-speed 819200.0 + :attack-range 819200.0 + :damage 2.0 + :vehicle-damage-factor 1.0 + :vehicle-impulse-factor 1.0 + :rot-min (new 'static 'array float 2 -1820.4445 -16384.0) + :rot-max (new 'static 'array float 2 16384.0 16384.0) + :local-pos (new 'static 'vector :z 4096.0 :w 1.0) + :local-dir (new 'static 'vector :z 1.0 :w 1.0) + :barrel-array (new 'static 'inline-array turret-barrel-info 4 + (new 'static 'turret-barrel-info + :local-pos (new 'static 'vector :w 1.0) + :local-dir (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'turret-barrel-info) + (new 'static 'turret-barrel-info) + (new 'static 'turret-barrel-info) + ) + ) + ) + +(set! (-> *v-catapult-turret-control-info* shot-type) v-marauder-shot) + +(define *v-catapult-turret-guard-settings* (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 2 + :inaccuracy 0.5 + :acquire-delay (seconds 0.2) + :shot-delay (seconds 0.1) + :burst-delay (seconds 0.5) + :rand-burst-delay (seconds 1) + :rand-shot-delay (seconds 0.2) + ) + ) + +(set! (-> *v-catapult-constants* debris) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-panel") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "inter-pieces") + :art-level 'wasall + ) + ) + +(defskelgroup skel-v-catapult-debris-longspike catapult catapult-debris-longspike-lod0-jg -1 + ((catapult-debris-longspike-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(define *v-catapult-debris-longspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 29 :group "skel-v-catapult-debris-longspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-bar catapult catapult-debris-bar-lod0-jg -1 + ((catapult-debris-bar-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +(define *v-catapult-debris-bar-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 18 :group "skel-v-catapult-debris-bar") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-panel catapult catapult-debris-panel-lod0-jg -1 + ((catapult-debris-panel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(define *v-catapult-debris-lpanel-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-v-catapult-debris-panel") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rpanel-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-v-catapult-debris-panel") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-bumper catapult catapult-debris-bumper-lod0-jg -1 + ((catapult-debris-bumper-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) + +(define *v-catapult-debris-lbumperspikes-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 17 :group "skel-v-catapult-debris-bumper") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rbumperspikes-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 16 :group "skel-v-catapult-debris-bumper") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-smlspike catapult catapult-debris-smlspike-lod0-jg -1 + ((catapult-debris-smlspike-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(define *v-catapult-debris-lfspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rfspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-ltopspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 15 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rtopspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-lsidespikea-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 24 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-lsidespikeb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 25 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-lsidespikec-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 26 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-lsidespiked-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 27 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-lsidespikee-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 28 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rsidespikea-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 19 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rsidespikeb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 20 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rsidespikec-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 21 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rsidespiked-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 22 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rsidespikee-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 23 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-frontpanel-a catapult catapult-debris-frontpanel-a-lod0-jg -1 + ((catapult-debris-frontpanel-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lfpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 33 :group "skel-v-catapult-debris-frontpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rfpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 45 :group "skel-v-catapult-debris-frontpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-frontpanel-b catapult catapult-debris-frontpanel-b-lod0-jg -1 + ((catapult-debris-frontpanel-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lfpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 34 :group "skel-v-catapult-debris-frontpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rfpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 46 :group "skel-v-catapult-debris-frontpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-frontpanel-c catapult catapult-debris-frontpanel-c-lod0-jg -1 + ((catapult-debris-frontpanel-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lfpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 35 :group "skel-v-catapult-debris-frontpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rfpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 47 :group "skel-v-catapult-debris-frontpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-frontpanel-d catapult catapult-debris-frontpanel-d-lod0-jg -1 + ((catapult-debris-frontpanel-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lfpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 36 :group "skel-v-catapult-debris-frontpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rfpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 48 :group "skel-v-catapult-debris-frontpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-midpanel-a catapult catapult-debris-midpanel-a-lod0-jg -1 + ((catapult-debris-midpanel-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lmpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 37 :group "skel-v-catapult-debris-midpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rmpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 49 :group "skel-v-catapult-debris-midpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-midpanel-b catapult catapult-debris-midpanel-b-lod0-jg -1 + ((catapult-debris-midpanel-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lmpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 38 :group "skel-v-catapult-debris-midpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rmpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 50 :group "skel-v-catapult-debris-midpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-midpanel-c catapult catapult-debris-midpanel-c-lod0-jg -1 + ((catapult-debris-midpanel-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lmpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 39 :group "skel-v-catapult-debris-midpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rmpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 51 :group "skel-v-catapult-debris-midpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-midpanel-d catapult catapult-debris-midpanel-d-lod0-jg -1 + ((catapult-debris-midpanel-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lmpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 40 :group "skel-v-catapult-debris-midpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rmpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 52 :group "skel-v-catapult-debris-midpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-rearpanel-a catapult catapult-debris-rearpanel-a-lod0-jg -1 + ((catapult-debris-rearpanel-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lrpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 41 :group "skel-v-catapult-debris-rearpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rrpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 53 :group "skel-v-catapult-debris-rearpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-rearpanel-b catapult catapult-debris-rearpanel-b-lod0-jg -1 + ((catapult-debris-rearpanel-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lrpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 42 :group "skel-v-catapult-debris-rearpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rrpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 54 :group "skel-v-catapult-debris-rearpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-rearpanel-c catapult catapult-debris-rearpanel-c-lod0-jg -1 + ((catapult-debris-rearpanel-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lrpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 43 :group "skel-v-catapult-debris-rearpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rrpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 55 :group "skel-v-catapult-debris-rearpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defskelgroup skel-v-catapult-debris-rearpanel-d catapult catapult-debris-rearpanel-d-lod0-jg -1 + ((catapult-debris-rearpanel-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(define *v-catapult-debris-lrpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 44 :group "skel-v-catapult-debris-rearpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(define *v-catapult-debris-rrpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 56 :group "skel-v-catapult-debris-rearpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defpartgroup group-v-catapult-shot-chargeup + :id 448 + :linger-duration (seconds 0) + :flags (sp0) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1783 :flags (sp6) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1784 :period (seconds 30) :length (seconds 0.017)) + ) + ) + +(defpart 1783 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.015555556)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.06666667) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 3)) + (:next-launcher 1785) + ) + ) + +(defpart 1784 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 0.0) + (:fade-a 0.14222223) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 3)) + (:next-launcher 1785) + ) + ) + +(defpart 1785 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.85333335) (:flags (sp-cpuinfo-flag-2))) + ) + +(defpartgroup group-v-catapult-shot-idle + :id 449 + :flags (sp0) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1786 :fade-after (meters 270) :falloff-to (meters 270) :flags (sp6)) + (sp-item 1787 :fade-after (meters 270)) + (sp-item 1788 :fade-after (meters 270)) + ) + ) + +(defpart 1786 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 20.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 1787 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 60.0 60.0) + (:scalevel-x (meters -0.060000002)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-v-catapult-shot + :id 450 + :flags (sp0) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1789 :flags (sp6)) (sp-item 1790)) + ) + +(defpart 1789 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 20.0 40.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 1790 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters -0.060000002)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-v-catapult-shot-trail + :id 451 + :flags (sp0 sp13) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1788)) + ) + +(defpart 1788 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 2)) + (:scale-x (meters 3.2) (meters 0.8)) + (:scale-y (meters 2.4) (meters 0.4)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:scalevel-x (meters -0.0053333333) (meters -0.0053333333)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.6666667) + (:fade-b -3.4) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:next-time (seconds 0.25)) + (:next-launcher 1791) + (:rotate-y (degrees 0) (degrees 3600)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1791 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.48 -0.48)) + ) + +(defpartgroup group-v-catapult-shot-explosion + :id 452 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 1793 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1794 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1795 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1796 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1797 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1798 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1799 :period (seconds 30) :length (seconds 0.167)) + (sp-item 1800 :period (seconds 30) :length (seconds 0.5)) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +(defpart 1793 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 30.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 1794 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0 20.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1795 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 20.0 10.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.114285715) + (:fade-b -0.042857144) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1796 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1797 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-ftexplo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-v-catapult-shot-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 1797 init-specs 14 initial-valuef) + (the-as float *part-v-catapult-shot-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* color-start) *range-ftexplo-dust-color*) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* alpha-start) *range-ftexplo-dust-alpha*) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* scale-x-start) *range-ftexplo-dust-scale-x*) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* scale-y-start) *range-ftexplo-dust-scale-y*) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* a-scalar) *curve-ftexplo-dust-alpha*) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* scale-x-scalar) + *curve-ftexplo-dust-scale-x* + ) + +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* scale-y-scalar) + *curve-ftexplo-dust-scale-y* + ) + +(defpart 1799 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1800 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-ftexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-v-catapult-shot-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 1800 init-specs 16 initial-valuef) + (the-as float *part-v-catapult-shot-explosion-texture-curve-settings*) + ) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* color-start) *range-ftexplo-color*) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* alpha-start) *range-ftexplo-alpha*) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* scale-x-start) *range-ftexplo-scale-x*) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* scale-y-start) *range-ftexplo-scale-y*) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* a-scalar) *curve-ftexplo-alpha*) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* scale-x-scalar) *curve-ftexplo-scale-x*) + +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* scale-y-scalar) *curve-ftexplo-scale-y*) + +(defpart 1798 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 1801 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.02) (meters -0.02)) + (:rotvel-z (degrees -300) (degrees 600)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.001)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 70)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1792 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 50.0) + (:a 128.0) + (:fade-r -0.85333335) + (:fade-g -0.6666667) + (:fade-b -0.5) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2)) + ) + ) + +(defskelgroup skel-catapult-shot-sphere gun gun-red-sphere-lod0-jg gun-red-sphere-idle-ja + ((gun-red-sphere-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + :texture-level 10 + :sort 4 + ) + +(deftype catapult-shot-sphere (process-drawable) + ((current-alpha float) + (pad uint8 12) + ) + (:state-methods + active + ) + ) + + +(deftype catapult-shot-sphere-init-params (structure) + ((pos vector :inline) + ) + ) + + +(defbehavior catapult-shot-sphere-init-by-other catapult-shot-sphere ((arg0 catapult-shot-sphere-init-params)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-catapult-shot-sphere" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-identity! (-> self root quat)) + (go-virtual active) + ) + +(defstate active (catapult-shot-sphere) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (math-camera-matrix)) + (v1-0 (-> a2-0 rvec quad)) + (a0-0 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-0) + (set! (-> gp-0 uvec quad) a0-0) + (set! (-> gp-0 fvec quad) a1-0) + (set! (-> gp-0 trans quad) a2-1) + ) + (-> gp-0 fvec) + (-> gp-0 rvec) + (matrix->quat gp-0 (-> self root quat)) + ) + (set! (-> self current-alpha) (* 0.008333334 (the float (- (current-time) (-> self state-time))))) + (let ((f0-3 (+ (-> self root scale x) (* 24.0 (seconds-per-frame))))) + (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self draw art-group data 77) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! (-> self draw art-group data 78) :num! (seek! max 5.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 5.0)) + ) + (deactivate self) + ) + :post ja-post + ) + +(when (or (zero? *v-catapult-shot-impact-blur*) (!= loading-level global)) + (set! *v-catapult-shot-impact-blur* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *v-catapult-shot-impact-blur* 3 'loading-level (the-as int #f)) + ) + +(set! (-> *v-catapult-shot-impact-blur* pts data 0 first) 0.0) + +(set! (-> *v-catapult-shot-impact-blur* pts data 0 second) 0.0) + +(set! (-> *v-catapult-shot-impact-blur* pts data 1 first) 0.2) + +(set! (-> *v-catapult-shot-impact-blur* pts data 1 second) 1.0) + +(set! (-> *v-catapult-shot-impact-blur* pts data 2 first) 1.0) + +(set! (-> *v-catapult-shot-impact-blur* pts data 2 second) 0.0) + +(deftype v-catapult-shot (metalhead-grenade-shot) + ((trail-part sparticle-launch-control) + ) + ) + + +(defstate impact (v-catapult-shot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type metalhead-grenade-shot impact) enter))) + (if t9-0 + (t9-0) + ) + ) + (send-event (handle->process (-> self desired-target)) 'die) + ) + ) + +(defmethod projectile-method-25 ((this v-catapult-shot)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) + ) + (if (nonzero? (-> this trail-part)) + (push-back (-> this trail-part) (-> this root trans)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod projectile-method-39 ((this v-catapult-shot)) + (let ((t9-0 (method-of-type metalhead-grenade-shot projectile-method-39))) + (t9-0 this) + ) + (send-event (handle->process (-> this desired-target)) 'update (-> this root trans)) + (none) + ) + +(defmethod projectile-method-26 ((this v-catapult-shot)) + (cond + ((logtest? (-> *part-group-id-table* 452 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 452)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 452)) + ) + ) + 0 + (none) + ) + +(defmethod play-impact-sound ((this v-catapult-shot) (arg0 projectile-options)) + (case arg0 + (((projectile-options po0)) + (if (task-node-closed? (game-task-node desert-chase-marauders-get-to-stronghold)) + (sound-play "firebomb") + (sound-play "proj-incoming") + ) + ) + (((projectile-options po0 po1)) + (let ((f0-0 (vector-vector-distance-squared (-> this self root trans) (-> this desired-target-pos))) + (f1-0 614400.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let ((a0-9 (static-sound-spec "incoming" :group 0 :volume 0.0))) + (set! (-> a0-9 volume) 1024) + (sound-play-by-spec a0-9 (-> this sound-id) (-> this root trans)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch metalhead-grenade-shot vs v-catapult-shot. +(defmethod relocate ((this v-catapult-shot) (offset int)) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) offset) + ) + (the-as v-catapult-shot ((method-of-type metalhead-grenade-shot relocate) this offset)) + ) + +(defmethod projectile-method-40 ((this v-catapult-shot)) + 512 + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-proj-settings! ((this v-catapult-shot)) + (with-pp + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this blast-radius) 20480.0) + (set! (-> this max-speed) 135168.0) + (set! (-> this update-velocity) projectile-update-velocity-add-gravity) + (set! (-> this move) gren-canister-move) + (set! (-> this root dynam gravity y) 102400.0) + (set! (-> this root dynam gravity-length) 102400.0) + (set! (-> this root dynam gravity-max) 102400.0) + (let ((f0-5 1092.2667)) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-5) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 450) this)) + pp + (set! (-> this trail-part) + (the-as + sparticle-launch-control + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 1788) 5.0) + ) + ) + (set! (-> this sound-id) (new-sound-id)) + (none) + ) + ) + +(deftype v-catapult (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-gun-x joint-mod-rotate-local :inline) + (jmod-gun-y joint-mod-rotate-local :inline) + (turret-control turret-control :inline) + (sub-state-time uint32) + (sub-state int8) + (launch-projectile? symbol) + (targ-pos vector :inline) + (notify-handle handle) + (spawn-part? symbol) + (charge-time time-frame) + (exploding? symbol) + ) + (:methods + (fire-catapult-shot (_type_ vector vector) none) + (v-catapult-method-204 (_type_) symbol) + ) + ) + + +(defmethod control-hook-ai ((this v-catapult) (arg0 vehicle-controls)) + (let ((t9-0 (method-of-type wcar-base control-hook-ai))) + (t9-0 this arg0) + ) + (let ((v1-1 (-> this target-status))) + (let ((f0-0 (vector-length (-> v1-1 velocity)))) + (set! (-> this turret-control inaccuracy) (* 0.000012207031 (+ 20480.0 f0-0))) + ) + (turret-control-method-11 (-> this turret-control) this (-> v1-1 position) (-> v1-1 velocity)) + ) + (when (-> this launch-projectile?) + (let ((v1-5 (-> this sub-state))) + (cond + ((zero? v1-5) + (sound-play "proj-launch") + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 42))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 42)) frames num-frames) -1)) + ) + (set! (-> a0-11 param 1) 1.0) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 42)) num-func-seek!) + ) + (+! (-> this sub-state) 1) + ) + ((= v1-5 1) + (when (not (ja-done? 0)) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group frames num-frames) -1))) + (set! (-> a0-15 param 1) 1.0) + (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (when (ja-done? 0) + (set! (-> this sub-state-time) (the-as uint (current-time))) + (+! (-> this sub-state) 1) + ) + ) + ((= v1-5 2) + (when (>= (the-as uint (- (current-time) (the-as int (-> this sub-state-time)))) (the-as uint 900)) + (sound-play "catapult-retrct") + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 43))) + (set! (-> a0-22 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 43)) frames num-frames) -1)) + ) + (set! (-> a0-22 param 1) 1.0) + (set! (-> a0-22 frame-num) 0.0) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 43)) num-func-seek!) + ) + (+! (-> this sub-state) 1) + ) + ) + ((= v1-5 3) + (when (not (ja-done? 0)) + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 param 0) (the float (+ (-> a0-26 frame-group frames num-frames) -1))) + (set! (-> a0-26 param 1) 1.0) + (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (if (ja-done? 0) + (+! (-> this sub-state) 1) + ) + ) + ((= v1-5 4) + (+! (-> this sub-state) 1) + (set! (-> this notify-handle) (the-as handle #f)) + (set-time! (-> this charge-time)) + (logior! (-> this mask) (process-mask actor-pause)) + (let* ((s5-2 (-> this node-list data 7 bone)) + (v1-79 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-2 transform uvec) -12288.0)) + ) + (vector+! v1-79 (-> s5-2 transform trans) v1-79) + (cond + ((logtest? (-> *part-group-id-table* 448 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-79 quad)) + (part-tracker-spawn + part-tracker-subsampler + :to this + :group (-> *part-group-id-table* 448) + :duration (seconds 4) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-79 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 448) :duration (seconds 4)) + ) + ) + ) + ) + ((= v1-5 5) + (when (time-elapsed? (-> this charge-time) (seconds 3)) + (set! (-> this sub-state) 0) + (set! (-> this launch-projectile?) #f) + (set! (-> this spawn-part?) #t) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod fire-catapult-shot ((this v-catapult) (arg0 vector) (arg1 vector)) + (let ((s4-0 (new 'stack-no-clear 'traj2d-params)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (set! (-> s4-0 initial-tilt) 8192.0) + (set! (-> s4-0 gravity) 102400.0) + (vector-! s5-0 arg1 arg0) + (let* ((v1-3 s5-0) + (f0-11 + (* (- (* (sqrtf (+ (* (-> v1-3 x) (-> v1-3 x)) (* (-> v1-3 z) (-> v1-3 z)))) (tan (-> s4-0 initial-tilt))) + (-> s5-0 y) + ) + (/ 2.0 (-> s4-0 gravity)) + ) + ) + ) + (if (< 0.0 f0-11) + (sqrtf f0-11) + ) + ) + (let ((v1-8 s5-0)) + (set! (-> s4-0 x) (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z))))) + ) + (set! (-> s4-0 y) (-> s5-0 y)) + (when (traj2d-calc-initial-speed-using-tilt s4-0) + (let ((s1-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s1-0 ent) (-> this entity)) + (set! (-> s1-0 charge) 1.0) + (set! (-> s1-0 options) (projectile-options)) + (logclear! (-> s1-0 options) (projectile-options po14 po15 po16)) + (set! (-> s1-0 pos quad) (-> arg0 quad)) + (set! (-> s1-0 notify-handle) (process->handle (handle->process (-> this notify-handle)))) + (set! (-> s1-0 owner-handle) (process->handle this)) + (set! (-> s1-0 target-handle) (the-as handle #f)) + (set! (-> s1-0 target-pos quad) (-> arg1 quad)) + (set! (-> s1-0 ignore-handle) (process->handle this)) + (let* ((v1-29 *game-info*) + (a0-22 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-22) + (set! (-> s1-0 attack-id) a0-22) + ) + (set! (-> s1-0 timeout) (seconds 10)) + (set! (-> s1-0 damage) 4.0) + (logior! (-> s1-0 options) (projectile-options po14)) + (let ((s3-1 (new 'stack-no-clear 'quaternion))) + (vector-normalize! s5-0 1.0) + (quaternion-look-at! s3-1 s5-0 *up-vector*) + (quaternion-rotate-local-x! s3-1 s3-1 -8192.0) + (vector-z-quaternion! s5-0 s3-1) + ) + (vector-normalize-copy! (-> s1-0 vel) s5-0 (-> s4-0 initial-speed)) + (spawn-projectile v-catapult-shot s1-0 this *default-dead-pool*) + ) + ) + ) + 0 + (none) + ) + +(defmethod init-collision! ((this v-catapult)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((a0-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 144)))) + (set! (-> a0-15 prim-core action) (collide-action solid)) + (set! (-> a0-15 transform-index) 0) + ) + (let ((a0-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> a0-17 prim-core action) (collide-action solid)) + (set! (-> a0-17 transform-index) 0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-24 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-62 ((this v-catapult)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 32768.0 :z 15687.68 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -32768.0 :z 15687.68 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 28672.0 :z -24166.4 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -28672.0 :z -24166.4 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 11468.8 :z 26624.0 :w 20480.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 12288.0 :z -3276.8 :w 20480.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 8192.0 :z -26624.0 :w 16384.0)) + 16 + ) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this v-catapult)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 3))) + (set-vector! (-> s5-0 2) 1092.2667 1092.2667 0.0 0.0) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((s3-0 (-> this wheel s4-0))) + (-> s3-0 info) + (quaternion-set! + (-> s5-0 0) + 0.0 + 0.0 + (* (-> s3-0 sin-susp-ang) (-> s3-0 x-scale)) + (+ 1.0 (-> s3-0 cos-susp-ang)) + ) + (quaternion-normalize! (-> s5-0 0)) + (quaternion-axis-angle! (-> s5-0 1) 0.0 0.0 (-> s3-0 x-scale) (-> (&-> s5-0 0 data s4-0) 8)) + ) + (let ((v1-10 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-10 rotation) (-> s5-0 0) (-> s5-0 1)) + ) + 0 + ) + ) + (quaternion-axis-angle! (-> this jmod-gun-x rotation) 1.0 0.0 0.0 (- (-> this turret-control aim-rot-x))) + (quaternion-axis-angle! (-> this jmod-gun-y rotation) 0.0 1.0 0.0 (-> this turret-control aim-rot-y)) + 0 + (none) + ) + +(defmethod v-catapult-method-204 ((this v-catapult)) + (let* ((s4-0 (-> this node-list data 7 bone)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 transform uvec) -12288.0)) + ) + (vector+! s5-0 (-> s4-0 transform trans) s5-0) + (if (and (nonzero? (-> this part)) (-> this spawn-part?)) + (spawn (-> this part) s5-0) + ) + (when (and (not (-> this exploding?)) + *target* + (and (>= 28672.0 (vector-vector-distance s5-0 (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (send-event + this + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker-velocity (new 'static 'vector :w 1.0)) + ) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 452 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 452)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 452)) + ) + ) + (if (and *target* (nonzero? (-> *target* pilot))) + (send-event + (handle->process (-> *target* pilot vehicle)) + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 40.0) (vehicle-impulse-factor 20.0)) + ) + ) + ) + (let ((v0-3 #t)) + (set! (-> this exploding?) v0-3) + v0-3 + ) + ) + ) + ) + +(defmethod apply-damage ((this v-catapult) (arg0 float) (arg1 rigid-body-impact)) + (let ((t9-0 (method-of-type wcar-base apply-damage))) + (t9-0 this arg0 arg1) + ) + (let* ((s5-0 (-> this node-list data 3 bone transform)) + (s4-0 (-> this node-list data 3 bone transform fvec)) + (a1-4 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg1 point) (-> this root trans)) 1.0)) + (f0-1 (vector-dot (the-as vector s5-0) a1-4)) + (s5-1 (< 0.0 f0-1)) + (s4-1 (< (vector-vector-angle-safe s4-0 a1-4) 5461.3335)) + (a1-6 (new 'stack 'debris-tuning (the-as uint 1))) + ) + (set! (-> a1-6 fountain-rand-transv-lo quad) (-> this root trans quad)) + (set! (-> a1-6 hit-xz-reaction) 0.95) + (set! (-> a1-6 hit-y-reaction) 0.6) + (set! (-> a1-6 scale-rand-lo) 1.0) + (set! (-> a1-6 scale-rand-hi) 1.0) + (set! (-> a1-6 fountain-rand-transv-hi x) 40960.0) + (set! (-> a1-6 fountain-rand-transv-hi y) 81920.0) + (set! (-> a1-6 fountain-rand-transv-hi z) 8192.0) + (set! (-> a1-6 fountain-rand-transv-hi w) 20480.0) + (set! (-> a1-6 duration) (seconds 0.5)) + (cond + ((and s5-1 s4-1) + (cond + ((not (logtest? (-> this draw seg-mask) 4)) + (debris-spawn this a1-6 *v-catapult-debris-longspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 4) + ) + ((not (logtest? (-> this draw seg-mask) 2)) + (debris-spawn this a1-6 *v-catapult-debris-bar-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 2) + ) + ((not (logtest? (-> this draw seg-mask) 128)) + (debris-spawn this a1-6 *v-catapult-debris-lbumperspikes-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 128) + ) + ((not (logtest? #x10000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lfspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x10000) + ) + ((not (logtest? #x800000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-ltopspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x800000) + ) + ((not (logtest? (-> this draw seg-mask) 4096)) + (debris-spawn this a1-6 *v-catapult-debris-lfpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 4096) + ) + ((not (logtest? (-> this draw seg-mask) 8192)) + (debris-spawn this a1-6 *v-catapult-debris-lfpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 8192) + ) + ((not (logtest? (-> this draw seg-mask) #x4000)) + (debris-spawn this a1-6 *v-catapult-debris-lfpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x4000) + ) + ((not (logtest? (-> this draw seg-mask) #x8000)) + (debris-spawn this a1-6 *v-catapult-debris-lfpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x8000) + ) + ) + ) + (s4-1 + (cond + ((not (logtest? (-> this draw seg-mask) 2)) + (debris-spawn this a1-6 *v-catapult-debris-bar-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 2) + ) + ((not (logtest? #x20000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rbumperspikes-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x20000000) + ) + ((not (logtest? (shl 64 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 64 32)) + ) + ((not (logtest? (shl 4096 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rtopspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 4096 32)) + ) + ((not (logtest? (shl 4 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 4 32)) + ) + ((not (logtest? (shl 8 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 8 32)) + ) + ((not (logtest? (shl 16 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 16 32)) + ) + ((not (logtest? (shl 32 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 32 32)) + ) + ) + ) + (s5-1 + (cond + ((not (logtest? #x40000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespikea-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x40000) + ) + ((not (logtest? #x80000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespikeb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x80000) + ) + ((not (logtest? #x100000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespikec-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x100000) + ) + ((not (logtest? #x200000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespiked-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x200000) + ) + ((not (logtest? #x400000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespikee-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x400000) + ) + ((not (logtest? (-> this draw seg-mask) 256)) + (debris-spawn this a1-6 *v-catapult-debris-lmpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 256) + ) + ((not (logtest? (-> this draw seg-mask) 512)) + (debris-spawn this a1-6 *v-catapult-debris-lmpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 512) + ) + ((not (logtest? (-> this draw seg-mask) 1024)) + (debris-spawn this a1-6 *v-catapult-debris-lmpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 1024) + ) + ((not (logtest? (-> this draw seg-mask) 2048)) + (debris-spawn this a1-6 *v-catapult-debris-lmpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 2048) + ) + ((not (logtest? (-> this draw seg-mask) 8)) + (debris-spawn this a1-6 *v-catapult-debris-lrpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 8) + ) + ((not (logtest? (-> this draw seg-mask) 16)) + (debris-spawn this a1-6 *v-catapult-debris-lrpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 16) + ) + ((not (logtest? (-> this draw seg-mask) 32)) + (debris-spawn this a1-6 *v-catapult-debris-lrpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 32) + ) + ((not (logtest? (-> this draw seg-mask) 64)) + (debris-spawn this a1-6 *v-catapult-debris-lrpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 64) + ) + ) + ) + (else + (cond + ((not (logtest? (shl 128 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespikea-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 128 32)) + ) + ((not (logtest? (shl 256 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespikeb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 256 32)) + ) + ((not (logtest? (shl 512 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespikec-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 512 32)) + ) + ((not (logtest? (shl 1024 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespiked-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 1024 32)) + ) + ((not (logtest? (shl 2048 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespikee-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 2048 32)) + ) + ((not (logtest? #x40000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rmpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x40000000) + ) + ((not (logtest? (shl #x8000 16) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rmpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl #x8000 16)) + ) + ((not (logtest? (shl 1 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rmpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 1 32)) + ) + ((not (logtest? (shl 2 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rmpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 2 32)) + ) + ((not (logtest? #x2000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rrpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x2000000) + ) + ((not (logtest? #x4000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rrpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x4000000) + ) + ((not (logtest? #x8000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rrpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x8000000) + ) + ((not (logtest? #x10000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rrpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x10000000) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: disable def twice: 9. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod rbody-event-handler ((this v-catapult) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('launch) + (let ((a0-2 (the-as vector (-> arg3 param 0))) + (v1-1 (the-as process (-> arg3 param 1))) + ) + (when (and a0-2 v1-1) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this targ-pos quad) (-> a0-2 quad)) + (set! (-> this notify-handle) (process->handle v1-1)) + (let ((v0-0 (the-as object #t))) + (set! (-> this launch-projectile?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + (('event-fire) + (set! (-> this spawn-part?) #f) + (fire-catapult-shot this (-> this node-list data 7 bone transform trans) (-> this targ-pos)) + (let* ((s4-0 (-> this root quat)) + (s5-1 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-0) 40960.0)) + (v1-11 (vector-normalize! (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-0) -409600.0)) + ) + (vector+! s5-1 (-> this root trans) s5-1) + (send-event this 'apply-impulse s5-1 v1-11) + ) + ) + (('event-reset) + (let* ((s4-1 (-> this root quat)) + (s5-3 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-1) -40960.0)) + (v1-13 (vector-normalize! (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-1) -409600.0)) + ) + (vector+! s5-3 (-> this root trans) s5-3) + (send-event this 'apply-impulse s5-3 v1-13) + ) + ) + (else + ((method-of-type wcar-base rbody-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod init-rbody-control! ((this v-catapult)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-catapult" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-catapult-constants*) + (set! (-> this draw lod-set lod 0 dist) 1105920.0) + (set! (-> this rider-hand-joint-array 0) 3) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-gun-x) this (the-as uint 58) (joint-mod-base-flags attached)) + (init (-> this jmod-gun-y) this (the-as uint 57) (joint-mod-base-flags attached)) + (set-info (-> this turret-control) *v-catapult-turret-control-info*) + (set! (-> this turret-control flags) (-> this turret-control flags)) + (set! (-> this turret-control ignore-handle) (process->handle this)) + (set! (-> this turret-control guard-settings) *v-catapult-turret-guard-settings*) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-catapult-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-catapult-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + (set! (-> this eng-pitch-offset) (rand-vu-float-range -0.5 0.5)) + (set! (-> this launch-projectile?) #f) + (set! (-> this notify-handle) (the-as handle #f)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 449) this)) + (set! (-> this spawn-part?) #t) + (set! (-> this exploding?) #f) + 0 + (none) + ) + +(defstate explode (v-catapult) + :virtual #t + :enter (behavior () + (if (not (logtest? (vehicle-flag vf55) (-> self v-flags))) + (turbo-pickup-spawn (-> self root trans)) + ) + (let ((t9-1 (-> (method-of-type wcar-base explode) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + +(defstate hostile (v-catapult) + :virtual #t + :enter (behavior () + (if (not (-> self minimap)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 129) (the-as int #f) (the-as vector #t) 0)) + ) + (let ((t9-1 (-> (method-of-type wcar-base hostile) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type wcar-base hostile) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (v-catapult-method-204 self) + ) + ) + +(defstate die (v-catapult) + :virtual #t + :code (behavior () + (kill-by-type vehicle-wheel self) + (while (-> self child) + (suspend) + ) + (let ((t9-1 (-> (method-of-type wcar-base die) code))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) diff --git a/goal_src/jak3/levels/desert/chase/wcar-marauder-b.gc b/goal_src/jak3/levels/desert/chase/wcar-marauder-b.gc index 88b4f41e6f..a883190b4f 100644 --- a/goal_src/jak3/levels/desert/chase/wcar-marauder-b.gc +++ b/goal_src/jak3/levels/desert/chase/wcar-marauder-b.gc @@ -96,7 +96,7 @@ :shadow-bot-clip -32768.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 diff --git a/goal_src/jak3/levels/desert/hover/scorpion-gun.gc b/goal_src/jak3/levels/desert/hover/scorpion-gun.gc index cff617d423..0e43e01b82 100644 --- a/goal_src/jak3/levels/desert/hover/scorpion-gun.gc +++ b/goal_src/jak3/levels/desert/hover/scorpion-gun.gc @@ -1678,7 +1678,7 @@ ) :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'traffic-object-spawn-params))) - (set! (-> gp-0 object-type) (the-as uint 6)) + (set! (-> gp-0 object-type) (traffic-type guard-a)) (set! (-> gp-0 behavior) (the-as uint 3)) (set! (-> gp-0 id) (the-as uint 0)) (set! (-> gp-0 nav-mesh) #f) diff --git a/goal_src/jak3/levels/desert/oasis/oasis-defense.gc b/goal_src/jak3/levels/desert/oasis/oasis-defense.gc index acf1c0824a..2ccd890a92 100644 --- a/goal_src/jak3/levels/desert/oasis/oasis-defense.gc +++ b/goal_src/jak3/levels/desert/oasis/oasis-defense.gc @@ -297,7 +297,7 @@ ) (vector-z-quaternion! (-> s4-0 vec) (-> s5-1 quat)) (vector-float*! (-> s4-0 vec) (-> s4-0 vec) 204800.0) - (set! (-> s4-0 params object-type) (the-as uint 6)) + (set! (-> s4-0 params object-type) (traffic-type guard-a)) (set! (-> s4-0 params behavior) (the-as uint 3)) (set! (-> s4-0 params id) (the-as uint 0)) (set! (-> s4-0 params nav-mesh) (-> self nav-mesh)) @@ -667,7 +667,7 @@ 204800.0 ) ) - (set! (-> sv-240 params object-type) (the-as uint 6)) + (set! (-> sv-240 params object-type) (traffic-type guard-a)) (set! (-> sv-240 params behavior) (the-as uint 3)) (set! (-> sv-240 params id) (the-as uint 0)) (set! (-> sv-240 params nav-mesh) (-> this nav-mesh)) diff --git a/goal_src/jak3/levels/desert/race/course-race.gc b/goal_src/jak3/levels/desert/race/course-race.gc index 320bdc0755..596beabfc8 100644 --- a/goal_src/jak3/levels/desert/race/course-race.gc +++ b/goal_src/jak3/levels/desert/race/course-race.gc @@ -135,7 +135,7 @@ ) (set! (-> s3-0 vec1 quad) (-> s5-0 info start-sphere quad)) (set! (-> s3-0 vec2 quad) (-> s5-0 info start-dir quad)) - (set! (-> s3-0 params object-type) (the-as uint 23)) + (set! (-> s3-0 params object-type) (traffic-type vehicle-task)) (set! (-> s3-0 params behavior) (the-as uint 10)) (set! (-> s3-0 params id) (the-as uint 0)) (set! (-> s3-0 params nav-mesh) #f) diff --git a/goal_src/jak3/levels/desert/rescue/desert-rescue-bbush.gc b/goal_src/jak3/levels/desert/rescue/desert-rescue-bbush.gc index d0a723f6c6..4b96f15731 100644 --- a/goal_src/jak3/levels/desert/rescue/desert-rescue-bbush.gc +++ b/goal_src/jak3/levels/desert/rescue/desert-rescue-bbush.gc @@ -7,3 +7,284 @@ ;; DECOMP BEGINS +(deftype task-manager-desert-rescue-bbush (task-manager-desert-rescue) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (final-timeout time-frame) + ) + (:state-methods + show-finish + finish-bbush + ) + ) + + +(define *bbush-passenger-pos* (new 'loading-level 'boxed-array desert-passenger-info 8)) + +(dotimes (gp-0 (-> *bbush-passenger-pos* allocated-length)) + (set! (-> *bbush-passenger-pos* gp-0) (new 'loading-level 'desert-passenger-info)) + ) + +(define *__bbush-transport-path__* (new 'static 'inline-array vector 50 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + +(dotimes (v1-10 (-> *desresc-transport-path-1* length)) + (set! (-> *__bbush-transport-path__* v1-10 quad) (-> *desresc-transport-path-1* v1-10 pos quad)) + ) + +;; WARN: Return type mismatch quaternion vs none. +(defmethod init-transport-params! ((this task-manager-desert-rescue-bbush) (arg0 desert-rescue-transport-init-params)) + (set! (-> arg0 path-pts) *__bbush-transport-path__*) + (set! (-> arg0 num-pts) (-> this desresc-path allocated-length)) + (set! (-> arg0 pos quad) (-> this desresc-path 0 pos quad)) + (set! (-> arg0 desresc-path) (-> this desresc-path)) + (quaternion-identity! (-> arg0 quat)) + (none) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-desert-rescue-bbush)) + (local-vars (sv-16 res-tag)) + (set-setting! 'pilot-exit #f 0.0 0) + (let ((t1-1 2)) + (set-setting! 'vehicles 'set (shr t1-1 32) t1-1) + ) + (set-setting! 'airlock #f 0.0 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-7 (res-lump-data (entity-by-name "desresc-bbush-info-1") 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-7 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-7)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this passenger-pos) *bbush-passenger-pos*) + (set! (-> this desresc-path) *desresc-transport-path-1*) + (dotimes (s5-1 (-> *passenger-pos* length)) + (mem-copy! (the-as pointer (-> *bbush-passenger-pos* s5-1)) (the-as pointer (-> *passenger-pos* s5-1)) 56) + ) + (set! (-> this passenger-pos length) (-> *passenger-pos* length)) + (when (-> this actor-group) + (dotimes (s5-2 (-> this actor-group 0 length)) + (set! (-> *bbush-passenger-pos* s5-2 passenger-pos quad) + (-> this actor-group 0 data s5-2 actor extra trans quad) + ) + (set! (-> *bbush-passenger-pos* s5-2 beacon-pos quad) + (-> this actor-group 1 data s5-2 actor extra trans quad) + ) + (set! (-> *bbush-passenger-pos* s5-2 is-final?) #f) + (let ((s4-0 + (res-lump-value + (-> this actor-group 0 data s5-2 actor) + 'marauders + uint128 + :default (the-as uint128 3) + :time -1000000000.0 + ) + ) + (v1-47 (the int (* 300.0 (res-lump-float (-> this actor-group 0 data s5-2 actor) 'timeout :default 45.0)))) + ) + (set! (-> *bbush-passenger-pos* s5-2 num-marauders) (the-as int s4-0)) + (set! (-> *bbush-passenger-pos* s5-2 total-time) (the-as time-frame v1-47)) + ) + (set! (-> *bbush-passenger-pos* s5-2 sandstorm-intensity) + (* 0.5 (/ (the float (+ s5-2 1)) (the float (-> this actor-group 0 length)))) + ) + ) + (set! (-> this passenger-pos length) (-> this actor-group 0 length)) + (set! (-> this passenger-pos) *bbush-passenger-pos*) + ) + (let ((a0-41 (entity-by-name "desresc-bbush-info-1"))) + (if a0-41 + (set! (-> this final-timeout) + (the-as time-frame (the int (* 300.0 (res-lump-float a0-41 'timeout :default 60.0)))) + ) + ) + ) + ((method-of-type task-manager set-time-limit) this) + (dotimes (gp-1 3) + (speeches-reset (-> *rescue-speech-array* gp-1)) + ) + (set-setting! 'extra-bank '((desert2 desresc1)) 0.0 0) + (none) + ) + +(defstate active (task-manager-desert-rescue-bbush) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self entity) #f) + (dotimes (v1-4 (-> self passenger-pos length)) + (if (-> self passenger-pos v1-4 is-final?) + (set! (-> self current-passenger-index) v1-4) + ) + ) + (set-setting! 'fog-special-interp-targ #f 0.2 0) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-49 self) + (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x3e4ccccd) + (when (and *target* (focus-test? *target* pilot-riding)) + (set! (-> self jak-vehicle) (process->handle (the-as process (send-event *target* 'get-vehicle)))) + (when (handle->process (-> self jak-vehicle)) + (send-event (handle->process (-> self jak-vehicle)) 'scale-max-hit-points #x3fa66666) + (go-virtual rescue-start) + ) + ) + ) + ) + :code sleep-code + ) + +(defstate drop-off-passenger (task-manager-desert-rescue-bbush) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('dropped-off) + (task-manager-desert-rescue-method-45 self 2) + (+! (-> self current-passenger-index) 1) + (send-event (handle->process (-> self current-task-arrow)) 'leave) + (if (= (-> self current-passenger-index) (-> self passenger-pos length)) + (go-virtual show-finish) + (go-virtual pickup-passenger) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code sleep-code + ) + +(defstate show-finish (task-manager-desert-rescue-bbush) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (let ((a0-1 (entity-by-name "des-burning-bush-40"))) + (when a0-1 + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> a0-1 extra trans quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3)) + (set! (-> self current-task-arrow) (process->handle (task-arrow-spawn gp-0 self))) + ) + ) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((v1-0 (entity-by-name "des-burning-bush-40"))) + (when v1-0 + (let ((s5-0 (-> v1-0 extra trans))) + (if (< (vector-vector-xz-distance (target-pos 0) s5-0) 163840.0) + (go-virtual finish-bbush) + ) + ) + ) + ) + (set! (-> *game-info* timer) (- (-> self final-timeout) (- (current-time) (-> self state-time)))) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + ) + :code sleep-code + ) + +(defstate finish-bbush (task-manager-desert-rescue-bbush) + :virtual #t + :event task-manager-event-handler + :code (behavior () + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (send-event self 'complete) + (sleep-code) + ) + ) + +(defstate pickup-passenger (task-manager-desert-rescue-bbush) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self current-passenger) (the-as handle #f)) + (task-manager-desert-rescue-method-42 self) + (set-time! (-> self taxi-timer)) + (let ((v1-6 *was-squad-control*)) + (set! (-> v1-6 target-count) (-> self passenger-pos (-> self current-passenger-index) num-marauders)) + ) + ) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod task-manager-desert-rescue-method-49 ((this task-manager-desert-rescue)) + (set-setting! 'music 'desresbb 0.0 0) + (none) + ) diff --git a/goal_src/jak3/levels/desert/rescue/desert-rescue.gc b/goal_src/jak3/levels/desert/rescue/desert-rescue.gc index 2aa6de8116..583b02d319 100644 --- a/goal_src/jak3/levels/desert/rescue/desert-rescue.gc +++ b/goal_src/jak3/levels/desert/rescue/desert-rescue.gc @@ -5,5 +5,2578 @@ ;; name in dgo: desert-rescue ;; dgos: DESRESC +(declare-type desert-passenger-info structure) +(declare-type wland-passenger citizen) +(declare-type neo-sat nav-enemy) +(define-extern *transport-tread-settings* light-trail-composition) +(define-extern spawn-wlander (function desert-passenger-info process (pointer wland-passenger))) +(define-extern spawn-neo-sat (function vector quaternion process (pointer neo-sat))) + ;; DECOMP BEGINS +(define *desert-rescue-speech-list* (new 'static 'inline-array talker-speech-class 85 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "resc101" + :channel (gui-channel citizen) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc102" + :channel (gui-channel citizen) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc103" + :channel (gui-channel citizen) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc104" + :channel (gui-channel citizen) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc105" + :channel (gui-channel citizen) + :speech #x5 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc106" + :channel (gui-channel citizen) + :speech #x6 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc107" + :channel (gui-channel citizen) + :speech #x7 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc108" + :channel (gui-channel citizen) + :speech #x8 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc109" + :channel (gui-channel citizen) + :speech #x9 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc110" + :channel (gui-channel citizen) + :speech #xa + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc111" + :channel (gui-channel citizen) + :speech #xb + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc112" + :channel (gui-channel citizen) + :speech #xc + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc113" + :channel (gui-channel citizen) + :speech #xd + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc114" + :channel (gui-channel citizen) + :speech #xe + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc115" + :channel (gui-channel citizen) + :speech #xf + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc116" + :channel (gui-channel citizen) + :speech #x10 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc117" + :channel (gui-channel citizen) + :speech #x11 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc118" + :channel (gui-channel citizen) + :speech #x12 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc119" + :channel (gui-channel citizen) + :speech #x13 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc120" + :channel (gui-channel citizen) + :speech #x14 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc121" + :channel (gui-channel citizen) + :speech #x15 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc122" + :channel (gui-channel citizen) + :speech #x16 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc123" + :channel (gui-channel citizen) + :speech #x17 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc124" + :channel (gui-channel citizen) + :speech #x18 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc125" + :channel (gui-channel citizen) + :speech #x19 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc126" + :channel (gui-channel citizen) + :speech #x1a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc127" + :channel (gui-channel citizen) + :speech #x1b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc101a" + :channel (gui-channel citizen) + :speech #x1c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc102a" + :channel (gui-channel citizen) + :speech #x1d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc103a" + :channel (gui-channel citizen) + :speech #x1e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc104a" + :channel (gui-channel citizen) + :speech #x1f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc105a" + :channel (gui-channel citizen) + :speech #x20 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc106a" + :channel (gui-channel citizen) + :speech #x21 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc107a" + :channel (gui-channel citizen) + :speech #x22 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc108a" + :channel (gui-channel citizen) + :speech #x23 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc109a" + :channel (gui-channel citizen) + :speech #x24 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc110a" + :channel (gui-channel citizen) + :speech #x25 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc111a" + :channel (gui-channel citizen) + :speech #x26 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc112a" + :channel (gui-channel citizen) + :speech #x27 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc113a" + :channel (gui-channel citizen) + :speech #x28 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc114a" + :channel (gui-channel citizen) + :speech #x29 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc115a" + :channel (gui-channel citizen) + :speech #x2a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc116a" + :channel (gui-channel citizen) + :speech #x2b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc117a" + :channel (gui-channel citizen) + :speech #x2c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc118a" + :channel (gui-channel citizen) + :speech #x2d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc119a" + :channel (gui-channel citizen) + :speech #x2e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc120a" + :channel (gui-channel citizen) + :speech #x2f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc121a" + :channel (gui-channel citizen) + :speech #x30 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc122a" + :channel (gui-channel citizen) + :speech #x31 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc123a" + :channel (gui-channel citizen) + :speech #x32 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc124a" + :channel (gui-channel citizen) + :speech #x33 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc125a" + :channel (gui-channel citizen) + :speech #x34 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc126a" + :channel (gui-channel citizen) + :speech #x35 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc127a" + :channel (gui-channel citizen) + :speech #x36 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc101b" + :channel (gui-channel citizen) + :speech #x37 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc102b" + :channel (gui-channel citizen) + :speech #x38 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc103b" + :channel (gui-channel citizen) + :speech #x39 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc104b" + :channel (gui-channel citizen) + :speech #x3a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc105b" + :channel (gui-channel citizen) + :speech #x3b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc106b" + :channel (gui-channel citizen) + :speech #x3c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc107b" + :channel (gui-channel citizen) + :speech #x3d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc108b" + :channel (gui-channel citizen) + :speech #x3e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc109b" + :channel (gui-channel citizen) + :speech #x3f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc110b" + :channel (gui-channel citizen) + :speech #x40 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc111b" + :channel (gui-channel citizen) + :speech #x41 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc112b" + :channel (gui-channel citizen) + :speech #x42 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc113b" + :channel (gui-channel citizen) + :speech #x43 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc114b" + :channel (gui-channel citizen) + :speech #x44 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc115b" + :channel (gui-channel citizen) + :speech #x45 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc116b" + :channel (gui-channel citizen) + :speech #x46 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc117b" + :channel (gui-channel citizen) + :speech #x47 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc118b" + :channel (gui-channel citizen) + :speech #x48 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc119b" + :channel (gui-channel citizen) + :speech #x49 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc120b" + :channel (gui-channel citizen) + :speech #x4a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc121b" + :channel (gui-channel citizen) + :speech #x4b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc122b" + :channel (gui-channel citizen) + :speech #x4c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc123b" + :channel (gui-channel citizen) + :speech #x4d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc124b" + :channel (gui-channel citizen) + :speech #x4e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc125b" + :channel (gui-channel citizen) + :speech #x4f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc126b" + :channel (gui-channel citizen) + :speech #x50 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc127b" + :channel (gui-channel citizen) + :speech #x51 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax232" + :channel (gui-channel daxter) + :speech #x52 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax198" + :channel (gui-channel daxter) + :speech #x53 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax128" + :channel (gui-channel daxter) + :speech #x54 + :text-duration (seconds 1) + :neg #x1 + :on-close #f + :camera #f + ) + ) + ) + +(deftype rescue-speech-instance (speech-instance) + () + ) + + +(deftype desert-rescue-transport-init-params (structure) + ((pos vector :inline) + (quat quaternion :inline) + (path-pts (inline-array vector)) + (num-pts int32) + (desresc-path (array desert-transport-node)) + ) + ) + + +(deftype desert-passenger-info (structure) + ((passenger-pos vector :inline) + (beacon-pos vector :inline) + (transport-angle float) + (is-final? symbol) + (total-time time-frame) + (num-marauders int8) + (sandstorm-intensity float) + ) + ) + + +(deftype task-manager-desert-rescue (task-manager) + ((current-passenger-index int8) + (current-passenger handle) + (current-task-arrow handle) + (current-transport handle) + (taxi-timer time-frame) + (num-enemies-remaining int8 :offset 288) + (current-enemy handle) + (jak-vehicle handle) + (dust-storm handle) + (passenger-pos (array desert-passenger-info)) + (desresc-path (array desert-transport-node)) + ) + (:state-methods + pickup-passenger + drop-off-passenger + finish-task + fight + race-home + rescue-start + play-dead-wlander-movie + wait-for-vehicle-return + investigate-dead-wlander + fail-delay + ) + (:methods + (task-manager-desert-rescue-method-42 (_type_) none) + (spawn-sat (_type_) none) + (task-manager-desert-rescue-method-44 (_type_) none) + (task-manager-desert-rescue-method-45 (_type_ int) none) + (init-transport-params! (_type_ desert-rescue-transport-init-params) none) + (task-manager-desert-rescue-method-47 (_type_) time-frame) + (task-manager-desert-rescue-method-48 (_type_) float) + (task-manager-desert-rescue-method-49 (_type_) none) + ) + ) + + +(define *rescue-speech* + (new 'static 'boxed-array :type speech-info :length 7 :allocated-length 8 + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x1 :probability 1.0) + (new 'static 'speech-instance :speech #x2 :probability 1.0) + (new 'static 'speech-instance :speech #x3 :probability 1.0) + (new 'static 'speech-instance :speech #x4 :probability 1.0) + (new 'static 'speech-instance :speech #x5 :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x6 :probability 1.0) + (new 'static 'speech-instance :speech #x7 :probability 1.0) + (new 'static 'speech-instance :speech #x8 :probability 1.0) + (new 'static 'speech-instance :speech #xe :probability 1.0) + (new 'static 'speech-instance :speech #xf :probability 1.0) + (new 'static 'speech-instance :speech #x10 :probability 1.0) + (new 'static 'speech-instance :speech #x11 :probability 1.0) + (new 'static 'speech-instance :speech #x12 :probability 1.0) + (new 'static 'speech-instance :speech #x13 :probability 1.0) + (new 'static 'speech-instance :speech #x14 :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x9 :probability 1.0) + (new 'static 'speech-instance :speech #xa :probability 1.0) + (new 'static 'speech-instance :speech #xb :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x15 :probability 1.0) + (new 'static 'speech-instance :speech #x16 :probability 1.0) + (new 'static 'speech-instance :speech #x17 :probability 1.0) + (new 'static 'speech-instance :speech #xd :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #xc :probability 1.0) + (new 'static 'speech-instance :speech #x18 :probability 1.0) + (new 'static 'speech-instance :speech #x19 :probability 1.0) + (new 'static 'speech-instance :speech #x1a :probability 1.0) + (new 'static 'speech-instance :speech #x1b :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x52 :probability 1.0)) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x53 :probability 1.0)) + ) + ) + ) + +(define *rescue-speech-1* + (new 'static 'boxed-array :type speech-info :length 5 :allocated-length 8 + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x1c :probability 1.0) + (new 'static 'speech-instance :speech #x1d :probability 1.0) + (new 'static 'speech-instance :speech #x1e :probability 1.0) + (new 'static 'speech-instance :speech #x1f :probability 1.0) + (new 'static 'speech-instance :speech #x20 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x21 :probability 1.0) + (new 'static 'speech-instance :speech #x22 :probability 1.0) + (new 'static 'speech-instance :speech #x23 :probability 1.0) + (new 'static 'speech-instance :speech #x29 :probability 1.0) + (new 'static 'speech-instance :speech #x2a :probability 1.0) + (new 'static 'speech-instance :speech #x2b :probability 1.0) + (new 'static 'speech-instance :speech #x2c :probability 1.0) + (new 'static 'speech-instance :speech #x2d :probability 1.0) + (new 'static 'speech-instance :speech #x2e :probability 1.0) + (new 'static 'speech-instance :speech #x2f :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x24 :probability 1.0) + (new 'static 'speech-instance :speech #x25 :probability 1.0) + (new 'static 'speech-instance :speech #x26 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x30 :probability 1.0) + (new 'static 'speech-instance :speech #x31 :probability 1.0) + (new 'static 'speech-instance :speech #x32 :probability 1.0) + (new 'static 'speech-instance :speech #x28 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x27 :probability 1.0) + (new 'static 'speech-instance :speech #x33 :probability 1.0) + (new 'static 'speech-instance :speech #x34 :probability 1.0) + (new 'static 'speech-instance :speech #x35 :probability 1.0) + (new 'static 'speech-instance :speech #x36 :probability 1.0) + ) + ) + ) + ) + +(define *rescue-speech-2* + (new 'static 'boxed-array :type speech-info :length 5 :allocated-length 8 + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x37 :probability 1.0) + (new 'static 'speech-instance :speech #x38 :probability 1.0) + (new 'static 'speech-instance :speech #x39 :probability 1.0) + (new 'static 'speech-instance :speech #x3a :probability 1.0) + (new 'static 'speech-instance :speech #x3b :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x3c :probability 1.0) + (new 'static 'speech-instance :speech #x3d :probability 1.0) + (new 'static 'speech-instance :speech #x3e :probability 1.0) + (new 'static 'speech-instance :speech #x44 :probability 1.0) + (new 'static 'speech-instance :speech #x45 :probability 1.0) + (new 'static 'speech-instance :speech #x46 :probability 1.0) + (new 'static 'speech-instance :speech #x47 :probability 1.0) + (new 'static 'speech-instance :speech #x48 :probability 1.0) + (new 'static 'speech-instance :speech #x49 :probability 1.0) + (new 'static 'speech-instance :speech #x4a :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x3f :probability 1.0) + (new 'static 'speech-instance :speech #x40 :probability 1.0) + (new 'static 'speech-instance :speech #x41 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x4b :probability 1.0) + (new 'static 'speech-instance :speech #x4c :probability 1.0) + (new 'static 'speech-instance :speech #x4d :probability 1.0) + (new 'static 'speech-instance :speech #x43 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x42 :probability 1.0) + (new 'static 'speech-instance :speech #x4e :probability 1.0) + (new 'static 'speech-instance :speech #x4f :probability 1.0) + (new 'static 'speech-instance :speech #x50 :probability 1.0) + (new 'static 'speech-instance :speech #x51 :probability 1.0) + ) + ) + ) + ) + +(define *rescue-speech-array* + (the-as (array (array speech-info)) (new 'static 'boxed-array :type array :length 0 :allocated-length 3)) + ) + +(set! (-> *rescue-speech-array* 0) *rescue-speech*) + +(set! (-> *rescue-speech-array* 1) *rescue-speech-1*) + +(set! (-> *rescue-speech-array* 2) *rescue-speech-2*) + +(define *duststorm-gate-pos* (new 'static 'vector :x 9175730.0 :y 130316.695 :z 1006544.06 :w 1.0)) + +(define *duststorm-wind-angle* 14563.556) + +(define *home-pos* (new 'static 'vector :x 9258721.0 :y 125009.92 :z 787988.5 :w 1.0)) + +(define *snake-start-pos* (new 'static 'vector :x 2217369.5 :y 103464.96 :z 10151731.0 :w 1.0)) + +(define *snake-start-angle* 1820.4445) + +(define *passenger-pos* (new 'static 'boxed-array :type desert-passenger-info + (new 'static 'desert-passenger-info + :passenger-pos (new 'static 'vector :x 3470704.8 :y 275742.72 :z 5098496.0 :w 1.0) + :beacon-pos (new 'static 'vector :x 5855805.5 :y 107233.28 :z 8262902.0 :w 1.0) + :is-final? #f + :total-time (seconds 100) + :num-marauders 1 + :sandstorm-intensity 0.3 + ) + (new 'static 'desert-passenger-info + :passenger-pos (new 'static 'vector :x 1681981.5 :y 102400.0 :z 7980359.5 :w 1.0) + :beacon-pos (new 'static 'vector :x 5408399.5 :y 82821.12 :z 7242465.5 :w 1.0) + :is-final? #f + :total-time (seconds 90) + :num-marauders 2 + :sandstorm-intensity 0.5 + ) + (new 'static 'desert-passenger-info + :passenger-pos (new 'static 'vector :x 2482667.5 :y 389038.1 :z 6811853.0 :w 1.0) + :beacon-pos (new 'static 'vector :x 6194995.0 :y 87859.2 :z 4850729.0 :w 1.0) + :is-final? #f + :total-time (seconds 90) + :num-marauders 3 + :sandstorm-intensity 0.7 + ) + (new 'static 'desert-passenger-info + :passenger-pos (new 'static 'vector :x 2281472.0 :y 86135.195 :z 10281697.0 :w 1.0) + :beacon-pos (new 'static 'vector :x 2383872.0 :y 61559.195 :z 10273505.0 :w 1.0) + :is-final? #t + :total-time (seconds 260) + :sandstorm-intensity 1.0 + ) + ) + ) + +(deftype transport-path-control (path-control) + () + (:methods + (new (symbol type process-drawable (inline-array vector) int) _type_) + ) + ) + + +(define *__transport-path__* (new 'static 'inline-array vector 50 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + +(dotimes (v1-20 (-> *desresc-transport-path-0* length)) + (set! (-> *__transport-path__* v1-20 quad) (-> *desresc-transport-path-0* v1-20 pos quad)) + ) + +(defmethod new transport-path-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 (inline-array vector)) (arg2 int)) + 0 + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 process) arg0) + (set! (-> v0-0 name) #f) + (set! (-> v0-0 curve num-cverts) arg2) + (set! (-> v0-0 curve cverts) arg1) + v0-0 + ) + ) + +(defmethod get-num-verts ((this transport-path-control)) + (-> this curve num-cverts) + ) + +(if (or (zero? *transport-tread-settings*) (!= loading-level global)) + (set! *transport-tread-settings* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *transport-tread-settings* color-mode) (the-as uint 3)) + +(set! (-> *transport-tread-settings* color-repeat-dist) 73728.0) + +(set! (-> *transport-tread-settings* alpha-1-mode) (the-as uint 0)) + +(set! (-> *transport-tread-settings* alpha-2-mode) (the-as uint 6)) + +(set! (-> *transport-tread-settings* base-alpha) 0.2) + +(set! (-> *transport-tread-settings* alpha-repeat-dist) 12288.0) + +(set! (-> *transport-tread-settings* width-mode) (the-as uint 0)) + +(set! (-> *transport-tread-settings* base-width) 12288.0) + +(set! (-> *transport-tread-settings* width-repeat-dist) 4096.0) + +(set! (-> *transport-tread-settings* uv-mode) (the-as uint 3)) + +(set! (-> *transport-tread-settings* uv-repeat-dist) 20480.0) + +(set! (-> *transport-tread-settings* lie-mode) (the-as uint 0)) + +(set! (-> *transport-tread-settings* max-age) (seconds 20)) + +(if "tread-marks" + (set! (-> *transport-tread-settings* tex-id) + (the-as uint (lookup-texture-id-by-name "tread-marks" (the-as string #f))) + ) + (set! (-> *transport-tread-settings* tex-id) (the-as uint #x100300)) + ) + +(set! (-> *transport-tread-settings* width-curve) (the-as curve2d-piecewise *curve-unity*)) + +(set! (-> *transport-tread-settings* color-curve) (the-as curve-color-piecewise *trail-color-curve-white*)) + +(set! (-> *transport-tread-settings* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +(set! (-> *transport-tread-settings* alpha-curve-2) #f) + +(set! (-> *transport-tread-settings* zbuffer?) #f) + +(set! (-> *transport-tread-settings* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *transport-tread-settings* use-tape-mode?) #f) + +(set! (-> *transport-tread-settings* blend-mode) (the-as uint 2)) + +(set! (-> *transport-tread-settings* frame-stagger) (the-as uint 5)) + +(deftype desert-rescue-transport (process-focusable) + ((pitch float) + (target-pitch float) + (down-force float) + (ground-offset float) + (offset-dist float) + (angular-speed float) + (path-t float) + (current-node-index int16) + (current-stop-node-index int16) + (move-speed float) + (target-move-speed float) + (has-passenger? symbol) + (seek-speed float) + (is-braking? symbol) + (teleport-when-ready? symbol) + (die-when-ready? symbol) + (is-last-passenger? symbol) + (tread1 handle) + (tread2 handle) + (tread-frequency uint8) + (tread-last-spawn-index uint8) + (desresc-path (array desert-transport-node)) + (can-board? symbol) + ) + (:state-methods + undefined0 + die + undefined1 + following-path + waiting-for-passenger + preparing-for-launch + ) + (:methods + (desert-rescue-transport-method-34 (_type_) float) + (probe-ground (_type_ vector) float) + (get-node-stop-idx (_type_) int) + (desert-rescue-transport-method-37 (_type_ int int) quaternion) + (desert-rescue-transport-method-38 (_type_) quaternion) + (desert-rescue-transport-method-39 (_type_) quaternion) + (desert-rescue-transport-method-40 (_type_) none) + (desert-rescue-transport-method-41 (_type_) none) + (probe-ground2 (_type_ vector vector) float) + (desert-rescue-transport-method-43 (_type_) none) + (desert-rescue-transport-method-44 (_type_) symbol) + (desert-rescue-transport-method-45 (_type_) symbol) + ) + (:states + hidden-idle + idle-hidden + ) + ) + + +(define *replace-last* (the-as object 0)) + +(define *frequency* 10) + +(defmethod desert-rescue-transport-method-43 ((this desert-rescue-transport)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> this root trans quad)) + (let ((v1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + (s3-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> this tread-frequency) (the-as uint 10)) + (vector+float*! s2-0 s2-0 (-> v1-4 fvec) -27852.8) + (vector+float*! s3-0 s2-0 (-> v1-4 rvec) -14131.2) + (vector+float*! s5-0 s2-0 (-> v1-4 rvec) 14131.2) + (set! (-> *transport-tread-settings* tex-id) + (the-as uint (lookup-texture-id-by-name "tread-marks" (the-as string #f))) + ) + (set! (-> s3-0 y) (probe-ground2 this s3-0 s4-0)) + (+! (-> s3-0 y) 409.6) + (let ((v1-11 (the-as tread-trail-tracker (handle->process (-> this tread1))))) + (if (zero? (mod (-> this tread-last-spawn-index) (-> this tread-frequency))) + (tread-trail-method-22 (-> v1-11 trail) s3-0 s4-0) + (tread-trail-method-23 (-> v1-11 trail) s3-0 s4-0) + ) + ) + (set! (-> s5-0 y) (probe-ground2 this s5-0 s4-0)) + (+! (-> s5-0 y) 409.6) + (let ((v1-21 (the-as tread-trail-tracker (handle->process (-> this tread2))))) + (if (zero? (mod (-> this tread-last-spawn-index) (-> this tread-frequency))) + (tread-trail-method-22 (-> v1-21 trail) s5-0 s4-0) + (tread-trail-method-23 (-> v1-21 trail) s5-0 s4-0) + ) + ) + ) + ) + (+! (-> this tread-last-spawn-index) 1) + 0 + (none) + ) + +(defmethod probe-ground2 ((this desert-rescue-transport) (arg0 vector) (arg1 vector)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> gp-0 start-pos) arg0 *up-vector* 24576.0) + (set! (-> gp-0 move-dist quad) (the-as uint128 0)) + (set! (-> gp-0 move-dist y) -81920.0) + (let ((v1-4 gp-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) + (set! (-> arg1 quad) (-> gp-0 best-other-tri normal quad)) + (-> gp-0 best-other-tri intersect y) + ) + (else + -40960000.0 + ) + ) + ) + ) + +(defmethod probe-ground ((this desert-rescue-transport) (arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> gp-0 start-pos) arg0 *up-vector* 24576.0) + (set! (-> gp-0 move-dist quad) (the-as uint128 0)) + (set! (-> gp-0 move-dist y) -81920.0) + (let ((v1-4 gp-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) + (-> gp-0 best-other-tri intersect y) + -40960000.0 + ) + ) + ) + +;; WARN: Return type mismatch symbol vs object. +(defbehavior desert-transport-event-handler desert-rescue-transport ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 symbol)) + (case arg2 + (('passenger-pickup) + (set! v0-0 #t) + (set! (-> self has-passenger?) v0-0) + v0-0 + ) + (('note-last-passenger) + (set! v0-0 #t) + (set! (-> self is-last-passenger?) v0-0) + v0-0 + ) + (('die-when-ready) + (when (-> self is-last-passenger?) + (set! v0-0 #t) + (set! (-> self die-when-ready?) v0-0) + v0-0 + ) + ) + ) + ) + +(defmethod run-logic? ((this desert-rescue-transport)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod desert-rescue-transport-method-34 ((this desert-rescue-transport)) + (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (f30-0 (-> this offset-dist)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s4-0 (-> this root trans) s3-0 0.0) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (let* ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (* 0.5 f30-0))) + (s2-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (* -0.5 f30-0))) + (f28-0 (probe-ground this s5-1)) + (f0-6 (probe-ground this s2-1)) + ) + (set! (-> s5-1 y) f28-0) + (set! (-> s2-1 y) f0-6) + (let* ((f0-8 (- (+ f28-0 (-> this ground-offset)) (+ f0-6 (-> this ground-offset)))) + (f0-10 (asin (/ f0-8 f30-0))) + ) + (set! (-> this target-pitch) (- (fmax -8192.0 (fmin 8192.0 f0-10)))) + ) + ) + ) + (let ((f0-17 (* (+ (* 15.0 (- (-> this target-pitch) (-> this pitch))) (* 2.0 (- (-> this angular-speed)))) + (seconds-per-frame) + ) + ) + ) + (+! (-> this angular-speed) f0-17) + ) + (set! (-> this pitch) (+ (-> this pitch) (* (-> this angular-speed) (seconds-per-frame)))) + ) + +(defskelgroup skel-desert-rescue-transport desert-transport desert-transport-lod0-jg desert-transport-idle-ja + ((desert-transport-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 -2 12.5) + ) + +(defbehavior desert-rescue-transport-init-by-other desert-rescue-transport ((arg0 desert-rescue-transport-init-params)) + (stack-size-set! (-> self main-thread) 256) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self level) (level-get *level* 'desrescg)) + (let ((s5-0 (new 'process 'collide-shape-moving self (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)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 69632.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 4) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 69632.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-23 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-desert-rescue-transport" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (ja :group! (-> self draw art-group data 3) :num! (identity 1.0)) + (set! (-> self desresc-path) (-> arg0 desresc-path)) + (set! (-> self path) (new 'process 'transport-path-control self (-> arg0 path-pts) (-> arg0 num-pts))) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (set! (-> self target-pitch) 0.0) + (set! (-> self pitch) 0.0) + (set! (-> self ground-offset) -4096.0) + (set! (-> self offset-dist) 49152.0) + (set! (-> self current-node-index) -1) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set! (-> self current-node-index) 0) + (desert-rescue-transport-method-37 self 0 0) + (set! (-> self current-stop-node-index) (get-node-stop-idx self)) + (set! (-> self has-passenger?) #f) + (set! (-> self move-speed) 40960.0) + (set! (-> self seek-speed) 10240.0) + (set! (-> self target-move-speed) 12288.0) + (set! (-> self teleport-when-ready?) #f) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self die-when-ready?) #f) + (set! (-> self is-last-passenger?) #f) + (let ((gp-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> gp-1 tracked-obj) (process->handle self)) + (set! (-> gp-1 max-num-crumbs) 325) + (set! (-> gp-1 appearance) *transport-tread-settings*) + (let* ((v1-64 + (estimate-light-trail-mem-usage + (the-as uint (-> gp-1 max-num-crumbs)) + (the-as uint (= (-> gp-1 appearance lie-mode) 3)) + ) + ) + (s5-2 (get-process *default-dead-pool* tread-trail-tracker (+ v1-64 8192) 1)) + ) + (set! (-> self tread1) + (process->handle (-> (when s5-2 + (let ((t9-16 (method-of-type process activate))) + (t9-16 s5-2 self "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-2 tread-trail-tracker-init-by-other gp-1) + (-> s5-2 ppointer) + ) + 0 + ) + ) + ) + ) + (let* ((v1-73 + (estimate-light-trail-mem-usage + (the-as uint (-> gp-1 max-num-crumbs)) + (the-as uint (= (-> gp-1 appearance lie-mode) 3)) + ) + ) + (s5-3 (get-process *default-dead-pool* tread-trail-tracker (+ v1-73 8192) 1)) + ) + (set! (-> self tread2) + (process->handle (-> (when s5-3 + (let ((t9-20 (method-of-type process activate))) + (t9-20 s5-3 self "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-3 tread-trail-tracker-init-by-other gp-1) + (-> s5-3 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (set! (-> self tread-last-spawn-index) (the-as uint 0)) + (go-virtual following-path) + ) + +(defmethod relocate ((this desert-rescue-transport) (offset int)) + (call-parent-method this offset) + ) + +(defstate die (desert-rescue-transport) + :virtual #t + :code (behavior () + '() + ) + ) + +(define *transport-move-speed* 0.0) + +(defmethod get-node-stop-idx ((this desert-rescue-transport)) + (let ((v1-1 (+ (-> this current-node-index) 1)) + (a1-2 (+ (-> this desresc-path allocated-length) -1)) + ) + (while (>= a1-2 v1-1) + (if (-> this desresc-path v1-1 is-stop?) + (return v1-1) + ) + (+! v1-1 1) + ) + ) + -1 + ) + +(defmethod desert-rescue-transport-method-38 ((this desert-rescue-transport)) + (let ((s5-0 (displacement-between-points-at-percent-normalized! + (-> this path) + (new 'stack-no-clear 'vector) + (-> this path-t) + ) + ) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (quaternion-look-at! (-> this root quat) s5-0 *up-vector*) + ) + ) + +(defmethod desert-rescue-transport-method-37 ((this desert-rescue-transport) (arg0 int) (arg1 int)) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (the-as float arg1) 'interp) + (set! (-> this root trans y) (probe-ground this (-> this root trans))) + (set! (-> this current-node-index) arg0) + (set! (-> this path-t) (the-as float arg1)) + (desert-rescue-transport-method-38 this) + ) + +(defstate idle-hidden (desert-rescue-transport) + :event desert-transport-event-handler + :enter (behavior () + '() + ) + :trans (behavior () + (if (logtest? (-> self draw status) (draw-control-status on-screen)) + (go-virtual following-path) + ) + ) + :code sleep-code + ) + +(defmethod desert-rescue-transport-method-39 ((this desert-rescue-transport)) + (let* ((v1-4 (-> this desresc-path (-> this current-node-index) pos)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) v1-4 (-> this root trans))) + (s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + 0.0 + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (let ((f0-4 (vector-dot s3-1 s5-0))) + (cond + ((>= f0-4 0.9999) + (set! (-> s5-0 quad) (-> s3-1 quad)) + ) + (else + (vector-cross! s4-0 s5-0 s3-1) + (let ((f0-6 (fmin (acos f0-4) (* 5461.3335 (seconds-per-frame))))) + (vector-rotate-around-axis! s5-0 (the-as quaternion s5-0) f0-6 s4-0) + ) + ) + ) + ) + ) + (quaternion-look-at! (-> this root quat) s5-0 *up-vector*) + ) + ) + +(defstate preparing-for-launch (desert-rescue-transport) + :virtual #t + :event desert-transport-event-handler + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (+! (-> self current-node-index) 1) + (set! (-> self current-stop-node-index) (get-node-stop-idx self)) + (set! (-> self target-move-speed) 20480.0) + (go-virtual following-path) + ) + :post transform-post + ) + +(defmethod desert-rescue-transport-method-41 ((this desert-rescue-transport)) + 0 + (none) + ) + +(defmethod desert-rescue-transport-method-44 ((this desert-rescue-transport)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> this root trans quad)) + (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + (f30-0 43008.0) + ) + *color-green* + (vector+float*! gp-0 gp-0 (-> a1-1 fvec) -40960.0) + (< (vector-vector-distance (target-pos 0) gp-0) f30-0) + ) + ) + ) + +(defmethod desert-rescue-transport-method-45 ((this desert-rescue-transport)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> this root trans quad)) + (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + (f30-0 43008.0) + ) + *color-green* + (vector+float*! gp-0 gp-0 (-> a1-1 fvec) 49152.0) + (< (vector-vector-distance (target-pos 0) gp-0) f30-0) + ) + ) + ) + +(defstate waiting-for-passenger (desert-rescue-transport) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('can-board?) + (-> self can-board?) + ) + (('leave) + (go-virtual preparing-for-launch) + ) + (else + (desert-transport-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self teleport-when-ready?) #f) + (set! (-> self can-board?) #f) + ) + :trans (behavior () + (desert-rescue-transport-method-41 self) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (= (-> self skel root-channel 0 frame-num) (the float (ja-num-frames 0))) + (if (desert-rescue-transport-method-44 self) + (ja :num! (seek! 0.0)) + (ja :num! (seek!)) + ) + (suspend) + ) + (set! (-> self can-board?) #t) + (sleep-code) + ) + :post transform-post + ) + +(defstate hidden-idle (desert-rescue-transport) + :event desert-transport-event-handler + :trans (behavior () + (if (and (-> self die-when-ready?) (not (logtest? (-> self draw status) (draw-control-status on-screen)))) + (go-virtual die) + ) + (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> self desresc-path (-> self current-stop-node-index) pos))) + ) + (when (or (logtest? (-> self draw status) (draw-control-status on-screen)) (< f0-0 1024000.0)) + 0.0 + (let* ((f0-1 (* 0.0000048828124 f0-0)) + (f0-3 (fmax 1.0 (+ -2.0 f0-1))) + ) + (set! (-> self move-speed) (/ 245760.0 f0-3)) + ) + (set! (-> self target-move-speed) (-> self move-speed)) + (go-virtual following-path) + ) + ) + ) + :code sleep-code + :post transform-post + ) + +(defstate following-path (desert-rescue-transport) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('passenger-pickup) + (set! (-> self teleport-when-ready?) #t) + (desert-transport-event-handler proc argc message block) + ) + (('die) + (go-virtual die) + ) + (else + (desert-transport-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self is-braking?) #f) + (set! (-> self teleport-when-ready?) #f) + (send-event (handle->process (-> self tread1)) 'reset) + (send-event (handle->process (-> self tread2)) 'reset) + ) + :trans (behavior () + (desert-rescue-transport-method-43 self) + (if (and (-> self die-when-ready?) (not (logtest? (-> self draw status) (draw-control-status on-screen)))) + (go-virtual die) + ) + (when (and (-> self teleport-when-ready?) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + (< 286720.0 + (vector-vector-distance (-> self root trans) (-> self desresc-path (-> self current-stop-node-index) pos)) + ) + ) + (let* ((f0-3 (/ (the float (-> self current-stop-node-index)) (the float (+ (-> self path curve num-cverts) -1)))) + (f0-4 (path-control-method-26 (-> self path) f0-3 -245760.0)) + ) + (set! (-> self teleport-when-ready?) #f) + (desert-rescue-transport-method-37 + self + (the int (+ 1.0 (* f0-4 (the float (+ (-> self path curve num-cverts) -1))))) + (the-as int f0-4) + ) + ) + (go hidden-idle) + ) + (let ((f0-5 + (vector-vector-xz-distance (-> self root trans) (-> self desresc-path (-> self current-node-index) pos)) + ) + ) + (cond + ((= (-> self current-node-index) (-> self current-stop-node-index)) + (when (< f0-5 81920.0) + (when (not (-> self is-braking?)) + (set! (-> self is-braking?) #t) + (let ((f1-6 0.5) + (f2-3 (-> self move-speed)) + ) + (set! (-> self seek-speed) (/ (* f1-6 (* f2-3 f2-3)) f0-5)) + ) + ) + (set! (-> self target-move-speed) 0.0) + ) + (if (= (-> self move-speed) 0.0) + (go-virtual waiting-for-passenger) + ) + ) + (else + (if (and (< f0-5 40960.0) (< (-> self current-node-index) (+ (-> self desresc-path length) -1))) + (+! (-> self current-node-index) 1) + ) + ) + ) + ) + (let ((f0-9 (probe-ground self (-> self root trans)))) + (set! (-> self down-force) (- (-> self down-force) (* 204800.0 (seconds-per-frame)))) + (+! (-> self root trans y) (* (-> self down-force) (seconds-per-frame))) + (when (< (-> self root trans y) (+ f0-9 (-> self ground-offset))) + (set! (-> self root trans y) (+ f0-9 (-> self ground-offset))) + (set! (-> self down-force) 0.0) + ) + ) + (desert-rescue-transport-method-34 self) + (cond + ((< 4096.0 (-> self move-speed)) + (desert-rescue-transport-method-39 self) + ) + (else + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) + ) + ) + ) + (let ((gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (if (not (desert-rescue-transport-method-45 self)) + (vector+float*! (-> self root trans) (-> self root trans) gp-1 (* (-> self move-speed) (seconds-per-frame))) + ) + ) + (seek! (-> self move-speed) (-> self target-move-speed) (* (-> self seek-speed) (seconds-per-frame))) + (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) (-> self pitch)) + ) + :code (behavior () + (transform-and-sleep-code) + ) + :post transform-post + ) + +(define *nav-mesh-aid* #xb5d9) + +;; WARN: Return type mismatch (array desert-passenger-info) vs none. +(defmethod set-time-limit ((this task-manager-desert-rescue)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (dotimes (s5-0 3) + (speeches-reset (-> *rescue-speech-array* s5-0)) + ) + (set-setting! 'dust-storm-sound-scalar #f 0.9 0) + (set-setting! 'extra-bank '((desert2 desresc1)) 0.0 0) + (let ((t1-2 2)) + (set-setting! 'vehicles 'set (shr t1-2 32) t1-2) + ) + (set-setting! 'goggles 'abs 1.0 0) + (set-setting! 'scarf 'abs 1.0 0) + (set! (-> this desresc-path) *desresc-transport-path-0*) + (set! (-> this passenger-pos) *passenger-pos*) + (none) + ) + +(defmethod task-manager-desert-rescue-method-42 ((this task-manager-desert-rescue)) + (set! (-> this current-passenger) + (ppointer->handle (spawn-wlander (-> this passenger-pos (-> this current-passenger-index)) this)) + ) + (none) + ) + +(defmethod spawn-sat ((this task-manager-desert-rescue)) + (set! (-> this current-enemy) + (ppointer->handle (spawn-neo-sat + (-> this passenger-pos (-> this current-passenger-index) beacon-pos) + (quaternion-identity! (new 'stack-no-clear 'quaternion)) + this + ) + ) + ) + (none) + ) + +(defstate wait (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :code (behavior () + (while (or (not *target*) (not *spawn-actors*) (!= (status-of-level-and-borrows *level* 'desrescg #f) 'active)) + (suspend) + ) + (set-time-limit self) + (go-virtual active) + ) + ) + +(defstate active (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self entity) #f) + (dotimes (v1-2 (-> self passenger-pos length)) + (if (-> self passenger-pos v1-2 is-final?) + (set! (-> self current-passenger-index) v1-2) + ) + ) + (cond + ((or (task-node-open? (game-task-node desert-rescue-satellite-fight)) + (task-node-closed? (game-task-node desert-rescue-satellite-fight)) + ) + (let ((f30-0 (-> self passenger-pos (+ (-> self current-passenger-index) -1) sandstorm-intensity))) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity f30-0) + (set-setting! 'fog-special-interp-targ #f f30-0 0) + ) + ) + ((and *target* (focus-test? *target* pilot-riding)) + (set-setting! 'fog-special-interp-targ #f 0.2 0) + ) + (else + (set-setting! 'fog-special-interp-targ #f 0.2 0) + ) + ) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (cond + ((task-node-open? (game-task-node desert-rescue-satellite-fight)) + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 object-type) (traffic-type guard-a)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 nav-mesh) #f) + (set! (-> gp-0 nav-branch) #f) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 handle) (the-as handle #f)) + (set! (-> gp-0 user-data) (the-as uint 0)) + (set! (-> gp-0 flags) (traffic-spawn-flags tsf5)) + (set! (-> gp-0 guard-type) (the-as uint 11)) + (set! (-> gp-0 entity) #f) + (vector-reset! (-> gp-0 velocity)) + (set! (-> gp-0 position quad) (-> *snake-start-pos* quad)) + (quaternion-identity! (-> gp-0 rotation)) + (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *snake-start-angle*) + (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-0))) + ) + (set! (-> self current-transport) (the-as handle #f)) + (set! (-> self current-passenger) (the-as handle #f)) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + (set! (-> self num-enemies-remaining) 1) + (set! (-> self current-enemy) (the-as handle #f)) + (spawn-sat self) + (go-virtual fight) + ) + ((task-node-closed? (game-task-node desert-rescue-satellite-fight)) + (let ((gp-2 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-2 object-type) (traffic-type guard-a)) + (set! (-> gp-2 behavior) (the-as uint 0)) + (set! (-> gp-2 id) (the-as uint 0)) + (set! (-> gp-2 nav-mesh) #f) + (set! (-> gp-2 nav-branch) #f) + (set! (-> gp-2 proc) #f) + (set! (-> gp-2 handle) (the-as handle #f)) + (set! (-> gp-2 user-data) (the-as uint 0)) + (set! (-> gp-2 flags) (traffic-spawn-flags tsf5)) + (set! (-> gp-2 guard-type) (the-as uint 11)) + (set! (-> gp-2 entity) #f) + (vector-reset! (-> gp-2 velocity)) + (set! (-> gp-2 position quad) (-> *snake-start-pos* quad)) + (quaternion-identity! (-> gp-2 rotation)) + (quaternion-rotate-y! (-> gp-2 rotation) (-> gp-2 rotation) *snake-start-angle*) + (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-2))) + ) + (set! (-> self current-transport) (the-as handle #f)) + (set! (-> self current-passenger) (the-as handle #f)) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + (set! (-> self num-enemies-remaining) 0) + (set! (-> self current-enemy) (the-as handle #f)) + (set! (-> self taxi-timer) (+ (current-time) (seconds -60))) + (go-virtual wait-for-vehicle-return) + ) + (else + (task-manager-desert-rescue-method-49 self) + (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x3e4ccccd) + (when (and *target* (focus-test? *target* pilot-riding)) + (set! (-> self jak-vehicle) (process->handle (the-as process (send-event *target* 'get-vehicle)))) + (if (handle->process (-> self jak-vehicle)) + (go-virtual rescue-start) + ) + ) + ) + ) + ) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod task-manager-desert-rescue-method-49 ((this task-manager-desert-rescue)) + (set-setting! 'music 'desres1 0.0 0) + (none) + ) + +;; WARN: Return type mismatch quaternion vs none. +(defmethod init-transport-params! ((this task-manager-desert-rescue) (arg0 desert-rescue-transport-init-params)) + (set! (-> arg0 path-pts) *__transport-path__*) + (set! (-> arg0 num-pts) (-> this desresc-path allocated-length)) + (set! (-> arg0 pos quad) (-> this desresc-path 0 pos quad)) + (set! (-> arg0 desresc-path) (-> this desresc-path)) + (quaternion-identity! (-> arg0 quat)) + (none) + ) + +(defstate rescue-start (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set! (-> self current-passenger-index) 0) + (set! (-> self current-transport) (the-as handle #f)) + (set! (-> self current-passenger) (the-as handle #f)) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + (task-node-close! (game-task-node desert-rescue-post-intro) 'event) + (let ((gp-1 (new 'stack-no-clear 'desert-rescue-transport-init-params))) + (init-transport-params! self gp-1) + (let ((s5-0 (get-process *default-dead-pool* desert-rescue-transport #x4000 1))) + (set! (-> self current-transport) + (process->handle + (-> (when s5-0 + (let ((t9-6 (method-of-type desert-rescue-transport activate))) + (t9-6 (the-as desert-rescue-transport s5-0) self "desert-rescue-transport" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 desert-rescue-transport-init-by-other gp-1) + (-> s5-0 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (was-squad-manager-start self) + (let ((v1-13 *was-squad-control*)) + (set! (-> v1-13 reserve-count) 40) + ) + ) + :trans (behavior () + (go-virtual pickup-passenger) + ) + :code sleep-code + ) + +(defstate race-home (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-setting! 'dust-storm-sound-scalar #f 1.0 0) + (remove-setting! 'vehicles) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> *home-pos* quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 12)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3)) + (set! (-> self current-task-arrow) (process->handle (task-arrow-spawn gp-0 self))) + ) + (set-time! (-> self state-time)) + (task-node-close! (game-task-node desert-rescue-satellite-fight) 'event) + (was-squad-manager-start self) + (let ((v1-13 *was-squad-control*)) + (set! (-> v1-13 reserve-count) 40) + ) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-44 self) + (if (< (vector-vector-xz-distance (target-pos 0) *home-pos*) 61440.0) + (go-virtual finish-task) + ) + (if (or (not (handle->process (-> self jak-vehicle))) + (begin + (let* ((gp-2 #t) + (s5-0 (handle->process (-> self jak-vehicle))) + (v1-17 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-17 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (let ((v1-25 *was-squad-control*)) + (when v1-25 + (cond + ((< (-> *game-info* timer) (seconds 30)) + (set! (-> v1-25 target-count) 0) + 0 + ) + (else + (set! (-> v1-25 target-count) 4) + ) + ) + ) + ) + (let ((f0-1 (vector-vector-xz-distance (target-pos 0) *home-pos*))) + (if (and (not (logtest? (-> *rescue-speech-array* 0 6 flags) (speech-info-flag si6))) (< f0-1 4096000.0)) + (speech-play (-> *rescue-speech-array* 0) 6 *desert-rescue-speech-list* (target-pos 0)) + ) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + ) + :code sleep-code + ) + +(defstate investigate-dead-wlander (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-setting! 'stop-vehicle? #t 0.0 0) + ) + :exit (behavior () + (remove-setting! 'stop-vehicle?) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (cond + ((and *target* (focus-test? *target* pilot-riding) (< (vector-length (get-transv *target*)) 6144.0)) + (send-event *target* 'change-mode 'normal) + (set-time! (-> self state-time)) + (set-setting! 'pilot #f 0.0 0) + ) + ((and *target* (not (focus-test? *target* pilot-riding)) (time-elapsed? (-> self state-time) (seconds 1.7))) + (go-virtual play-dead-wlander-movie) + ) + ) + ) + :code sleep-code + ) + +(defstate play-dead-wlander-movie (task-manager-desert-rescue) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hide-wlander) + (let ((v1-2 (the-as wland-passenger (handle->process (-> self current-passenger))))) + (when v1-2 + (let ((v0-0 (the-as object (logior (-> v1-2 draw status) (draw-control-status no-draw))))) + (set! (-> v1-2 draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + ) + ) + ) + (('spawn-enemy) + (spawn-sat self) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (cond + (#t + (remove-setting! 'music) + (set! (-> self num-enemies-remaining) 1) + (set! (-> self current-enemy) (the-as handle #f)) + (process-spawn scene-player :init scene-player-init "desert-rescue-res-a" #t #f :name "scene-player") + ) + (else + (task-node-close! (game-task-node desert-rescue-dead-wlander-movie) 'event) + ) + ) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (when (task-node-closed? (game-task-node desert-rescue-dead-wlander-movie)) + (let ((v1-3 (the-as wland-passenger (handle->process (-> self current-passenger))))) + (if v1-3 + (logclear! (-> v1-3 draw status) (draw-control-status no-draw)) + ) + ) + (go-virtual fight) + ) + ) + :code sleep-code + ) + +(defstate wait-for-vehicle-return (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-setting! 'music 'desres3 0.0 0) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (let ((s5-0 (-> gp-0 pos)) + (s4-0 (handle->process (-> self jak-vehicle))) + ) + (set! (-> s5-0 quad) (-> (get-trans + (the-as process-focusable (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + 0 + ) + quad + ) + ) + ) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3)) + (set! (-> self current-task-arrow) (process->handle (task-arrow-spawn gp-0 self))) + ) + (set-setting! 'dust-storm-sound-scalar #f 1.0 0) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (send-event (handle->process (-> self jak-vehicle)) 'ignore-damage #f) + (send-event (handle->process (-> self jak-vehicle)) 'ignore-impulse #f) + (task-manager-desert-rescue-method-44 self) + (when (and *target* (focus-test? *target* pilot-riding)) + (send-event (handle->process (-> self current-task-arrow)) 'leave) + (go-virtual race-home) + ) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + ) + :code (behavior () + (until (time-elapsed? (-> self state-time) (seconds 3)) + (suspend) + ) + (talker-spawn-func (-> *desert-rescue-speech-list* 84) *entity-pool* (target-pos 0) (the-as region #f)) + (sleep-code) + ) + ) + +(defstate fight (task-manager-desert-rescue) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (when (and (= (-> block param 0) 'die) (= (process->handle proc) (-> self current-enemy))) + (+! (-> self num-enemies-remaining) -1) + (if (zero? (-> self num-enemies-remaining)) + (go-virtual wait-for-vehicle-return) + (spawn-sat self) + ) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-setting! 'pilot #f 0.0 0) + (when #f + (remove-setting! 'music) + (set! (-> self num-enemies-remaining) 1) + (set! (-> self current-enemy) (the-as handle #f)) + (spawn-sat self) + ) + (set-time! (-> self taxi-timer)) + (when #f + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 object-type) (traffic-type guard-a)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 nav-mesh) #f) + (set! (-> gp-0 nav-branch) #f) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 handle) (the-as handle #f)) + (set! (-> gp-0 user-data) (the-as uint 0)) + (set! (-> gp-0 flags) (traffic-spawn-flags tsf5)) + (set! (-> gp-0 guard-type) (the-as uint 11)) + (set! (-> gp-0 entity) #f) + (vector-reset! (-> gp-0 velocity)) + (set! (-> gp-0 position quad) (-> *snake-start-pos* quad)) + (quaternion-identity! (-> gp-0 rotation)) + (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *snake-start-angle*) + (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-0))) + ) + ) + (send-event (handle->process (-> self jak-vehicle)) 'ignore-damage #t) + (send-event (handle->process (-> self jak-vehicle)) 'ignore-impulse #t) + ) + :exit (behavior () + (remove-setting! 'pilot) + ) + :trans (behavior () + (local-vars (gp-0 symbol)) + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-44 self) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + (if (or (not (handle->process (-> self jak-vehicle))) + (begin + (let* ((gp-1 #t) + (s5-0 (handle->process (-> self jak-vehicle))) + (v1-21 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-0 v1-21 gp-1) + ) + gp-0 + ) + ) + (send-event self 'fail) + ) + ) + :code sleep-code + ) + +(defmethod task-manager-desert-rescue-method-48 ((this task-manager-desert-rescue)) + (let ((f30-0 (the-as float 0.0))) + (when (not (task-node-closed? (game-task-node desert-rescue-rescue))) + (let ((f0-1 (the float (-> *game-info* sub-task-list (game-task-node desert-rescue-rescue) death-count)))) + (set! f30-0 (lerp-scale-clamp 0.0 1.0 f0-1 3.0 8.0)) + ) + ) + f30-0 + ) + ) + +;; WARN: Return type mismatch int vs time-frame. +(defmethod task-manager-desert-rescue-method-47 ((this task-manager-desert-rescue)) + (let ((gp-0 (-> this passenger-pos (-> this current-passenger-index) total-time)) + (f0-0 (task-manager-desert-rescue-method-48 this)) + ) + (the time-frame (* (the float gp-0) (lerp 1.0 2.0 f0-0))) + ) + ) + +(defstate pickup-passenger (task-manager-desert-rescue) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fight) + (go-virtual investigate-dead-wlander) + ) + (('picked-up) + (go-virtual drop-off-passenger) + ) + (('fail-delay) + (go-virtual fail-delay) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (send-event + (handle->process (-> self jak-vehicle)) + 'scale-max-hit-points + (lerp 1.0 2.0 (task-manager-desert-rescue-method-48 self)) + ) + (set-time! (-> self state-time)) + (set! (-> self current-passenger) (the-as handle #f)) + (task-manager-desert-rescue-method-42 self) + (set-time! (-> self taxi-timer)) + (if (= (-> self current-passenger-index) (+ (-> self passenger-pos length) -1)) + (send-event (handle->process (-> self current-transport)) 'note-last-passenger) + ) + (let ((v1-24 *was-squad-control*)) + (set! (-> v1-24 target-count) + (the int (the float (-> self passenger-pos (-> self current-passenger-index) num-marauders))) + ) + ) + ) + :trans (behavior () + (local-vars (gp-3 symbol)) + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-44 self) + (let ((gp-0 (the-as wland-passenger (handle->process (-> self current-passenger))))) + (when gp-0 + (if (and (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 root trans)) 225280.0) + (or (not (logtest? (-> *rescue-speech* 0 flags) (speech-info-flag si6))) + (and (> (-> *rescue-speech* 0 play-time) 0) (time-elapsed? (-> *rescue-speech* 0 play-time) (seconds 5))) + ) + ) + (task-manager-desert-rescue-method-45 self 0) + ) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (let* ((gp-1 (handle->process (-> self current-passenger))) + (a0-16 (if (type? gp-1 process-focusable) + (the-as process-focusable gp-1) + ) + ) + ) + (if (or (not a0-16) (focus-test? a0-16 disable dead inactive)) + (send-event self 'fail-delay) + ) + ) + ) + (if (and (not (handle->process (-> self current-transport))) (= (-> *was-squad-control* active-count) 0)) + (task-node-close! (game-task-node desert-rescue-rescue) 'event) + ) + (send-event + (handle->process (-> self current-passenger)) + 'set-nav-mesh + (get-nav-mesh (the-as actor-id *nav-mesh-aid*)) + ) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + (if (or (not (handle->process (-> self jak-vehicle))) + (begin + (let* ((gp-4 #t) + (s5-1 (handle->process (-> self jak-vehicle))) + (v1-70 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-1 process-focusable) + (the-as process-focusable s5-1) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-3 v1-70 gp-4) + ) + gp-3 + ) + ) + (send-event self 'fail) + ) + ) + :code sleep-code + ) + +(defstate drop-off-passenger (task-manager-desert-rescue) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('dropped-off) + (task-manager-desert-rescue-method-45 self 2) + (+! (-> self current-passenger-index) 1) + (send-event (handle->process (-> self current-task-arrow)) 'leave) + (if (= (-> self current-passenger-index) (-> self passenger-pos length)) + (go-virtual complete) + (go-virtual pickup-passenger) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (task-manager-desert-rescue-method-45 self 1) + (send-event (handle->process (-> self current-transport)) 'passenger-pickup) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self passenger-pos (-> self current-passenger-index) beacon-pos quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3)) + (set! (-> self current-task-arrow) (process->handle (task-arrow-spawn gp-0 self))) + ) + ) + :trans (behavior () + (local-vars (gp-0 symbol)) + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-44 self) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + (if (or (not (handle->process (-> self jak-vehicle))) + (begin + (let* ((gp-1 #t) + (s5-0 (handle->process (-> self jak-vehicle))) + (v1-21 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-0 v1-21 gp-1) + ) + gp-0 + ) + ) + (send-event self 'fail) + ) + (let ((f30-0 + (vector-vector-distance (target-pos 0) (-> self passenger-pos (-> self current-passenger-index) beacon-pos)) + ) + ) + (if (and (< (-> *game-info* timer) (seconds 30)) + (and (< 614400.0 f30-0) + (or (not (logtest? (-> *rescue-speech* 3 flags) (speech-info-flag si6))) + (and (> (-> *rescue-speech* 3 play-time) 0) (time-elapsed? (-> *rescue-speech* 3 play-time) (seconds 40))) + ) + ) + ) + (task-manager-desert-rescue-method-45 self 3) + ) + (if (and (< (-> *game-info* timer) (seconds 10)) + (and (< 614400.0 f30-0) + (and (> (-> *rescue-speech* 3 play-time) 0) (time-elapsed? (-> *rescue-speech* 3 play-time) (seconds 10))) + (or (not (logtest? (-> *rescue-speech* 4 flags) (speech-info-flag si6))) + (and (> (-> *rescue-speech* 4 play-time) 0) (time-elapsed? (-> *rescue-speech* 4 play-time) (seconds 45))) + ) + ) + ) + (task-manager-desert-rescue-method-45 self 4) + ) + (if (< f30-0 81920.0) + (send-event (handle->process (-> self current-passenger)) 'exit-vehicle (-> self current-transport)) + ) + (if (< f30-0 20480.0) + (send-event (handle->process (-> self current-task-arrow)) 'hide) + (send-event (handle->process (-> self current-task-arrow)) 'show) + ) + ) + ) + :code sleep-code + ) + +(defmethod task-manager-method-25 ((this task-manager-desert-rescue)) + (send-event (handle->process (-> this current-passenger)) 'die-fast) + (call-parent-method this) + (none) + ) + +(defstate finish-task (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (talker-spawn-func (-> *talker-speech* 170) *entity-pool* (target-pos 0) (the-as region #f)) + (deactivate (handle->process (-> self hud-timer))) + (send-event (handle->process (-> self current-task-arrow)) 'leave) + ) + :trans (behavior () + '() + ) + :code (behavior () + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.5)) + (suspend) + ) + (send-event self 'complete) + ) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod task-manager-desert-rescue-method-44 ((this task-manager-desert-rescue)) + (let ((f0-0 (-> this passenger-pos (-> this current-passenger-index) sandstorm-intensity)) + (f1-1 (if (> (-> this current-passenger-index) 0) + (-> this passenger-pos (+ (-> this current-passenger-index) -1) sandstorm-intensity) + 0.2 + ) + ) + (f2-2 (/ (the float (- (current-time) (-> this taxi-timer))) + (the float (-> this passenger-pos (-> this current-passenger-index) total-time)) + ) + ) + ) + (if (-> this passenger-pos (-> this current-passenger-index) is-final?) + (set! f2-2 (* f2-2 f2-2)) + ) + (set-setting! 'fog-special-interp-targ #f (lerp f1-1 f0-0 f2-2) 0) + ) + (set-setting! 'fog-special-interp-rate #f 0.01 0) + (none) + ) + +;; og:preserve-this duplicate +; (defmethod task-manager-method-25 ((this task-manager-desert-rescue)) +; (call-parent-method this) +; (none) +; ) + +(defmethod task-manager-desert-rescue-method-45 ((this task-manager-desert-rescue) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3) (= v1-0 4)) + (let ((s5-0 (mod (-> this current-passenger-index) 3))) + 0 + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> (target-pos 0) quad)) + (let ((a0-8 (the-as process-focusable (handle->process (-> this current-passenger))))) + (if a0-8 + (set! (-> s4-0 quad) (-> (get-trans a0-8 3) quad)) + ) + ) + (let ((s4-1 (speech-play (-> *rescue-speech-array* s5-0) arg0 *desert-rescue-speech-list* s4-0))) + (when (>= s4-1 0) + (dotimes (s3-3 3) + (if (!= s3-3 s5-0) + (mark-speech-played (-> *rescue-speech-array* s3-3 arg0) s4-1) + ) + ) + ) + ) + ) + ) + ) + (else + (speech-play (-> *rescue-speech-array* 0) arg0 *desert-rescue-speech-list* (target-pos 0)) + ) + ) + ) + (none) + ) + +(defstate fail-delay (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (send-event self 'fail) + (sleep-code) + ) + ) diff --git a/goal_src/jak3/levels/desert/rescue/desresc-path.gc b/goal_src/jak3/levels/desert/rescue/desresc-path.gc index 099fa13592..dd0b40be5b 100644 --- a/goal_src/jak3/levels/desert/rescue/desresc-path.gc +++ b/goal_src/jak3/levels/desert/rescue/desresc-path.gc @@ -7,3 +7,205 @@ ;; DECOMP BEGINS +(deftype desert-transport-node (structure) + ((pos vector :inline) + (is-stop? symbol) + ) + ) + + +(define *desresc-transport-path-0* (new 'static 'boxed-array :type desert-transport-node + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6196182.0 :y 215947.67 :z 9253558.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5925682.0 :y 235313.56 :z 8948037.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5868665.0 :y 213170.17 :z 8671557.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5888490.5 :y 128275.664 :z 8337037.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5923757.0 :y 87350.07 :z 8139734.0 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5870017.5 :y 76057.805 :z 7894547.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5672508.0 :y 58489.652 :z 7758150.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5527551.0 :y 68619.47 :z 7466146.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5458369.5 :y 90043.59 :z 7101684.0 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5642975.5 :y 103924.94 :z 6626957.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5333318.5 :y 129668.71 :z 6372432.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5222480.5 :y 155880.66 :z 6057942.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5283060.0 :y 186220.55 :z 5749308.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5609142.5 :y 186021.89 :z 5486099.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5897951.5 :y 155497.27 :z 5348228.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6212156.0 :y 99508.23 :z 5045410.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6272776.5 :y 79628.29 :z 4719286.5 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6170582.0 :y 140795.9 :z 4548402.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6000680.0 :y 198616.67 :z 4405820.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5820701.5 :y 235186.17 :z 4330085.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5738986.5 :y 238085.33 :z 4255906.0 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5717236.0 :y 212852.73 :z 4058644.0 :w 1.0) + :is-stop? #f + ) + ) + ) + +(define *desresc-transport-path-1* (new 'static 'boxed-array :type desert-transport-node + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15695336.0 :y 86728.3 :z 8010381.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15516956.0 :y 92864.516 :z 8010751.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15364666.0 :y 96409.6 :z 7933500.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15200581.0 :y 92348.414 :z 7886683.0 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15011551.0 :y 93317.53 :z 7887707.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 14867456.0 :y 89701.99 :z 7885782.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 14638077.0 :y 82869.86 :z 7847688.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 14412182.0 :y 88968.805 :z 7880703.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 14100068.0 :y 98887.27 :z 7760566.5 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13938726.0 :y 123237.58 :z 7664106.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13803557.0 :y 139907.08 :z 7622122.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13721883.0 :y 140944.6 :z 7571456.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13555177.0 :y 140549.33 :z 7551261.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13383473.0 :y 136199.38 :z 7583005.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13129562.0 :y 127914.805 :z 7486093.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12857832.0 :y 70269.75 :z 7293992.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12686865.0 :y 65625.7 :z 7177706.5 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12513768.0 :y 66672.23 :z 7145348.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12386916.0 :y 65139.508 :z 7102667.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12306757.0 :y 32768.0 :z 6995597.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12404979.0 :y 45604.453 :z 6859611.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12506682.0 :y 54308.043 :z 6825695.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12699113.0 :y 52638.105 :z 6692822.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12936967.0 :y 48149.707 :z 6653418.5 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13037525.0 :y 65425.0 :z 6507437.0 :w 1.0) + :is-stop? #f + ) + ) + ) diff --git a/goal_src/jak3/levels/desert/rescue/neo-satellite.gc b/goal_src/jak3/levels/desert/rescue/neo-satellite.gc index bb3cc73e13..19fd7610df 100644 --- a/goal_src/jak3/levels/desert/rescue/neo-satellite.gc +++ b/goal_src/jak3/levels/desert/rescue/neo-satellite.gc @@ -5,5 +5,4097 @@ ;; name in dgo: neo-satellite ;; dgos: DESRESC +(define-extern *range-sat-explo-color* curve-color-fast) +(define-extern *range-sat-explo-alpha* curve2d-fast) +(define-extern *range-sat-explo-scale-x* curve2d-fast) +(define-extern *range-sat-explo-scale-y* curve2d-fast) +(define-extern *curve-sat-explo-alpha* curve2d-fast) +(define-extern *curve-sat-explo-scale-x* curve2d-fast) +(define-extern *curve-sat-explo-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(defskelgroup skel-neo-sat neo-satellite neo-satellite-lod0-jg neo-satellite-idle-ja + ((neo-satellite-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :shadow neo-satellite-shadow-mg + :origin-joint-index 3 + :global-effects 32 + ) + +(set! (-> *lightning-spec-id-table* 22) (new 'static 'lightning-spec + :name "neo-sat-lightning-shock" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :b #x40 :a #x80) + :end-color (new 'static 'rgba :r #x80 :b #x40 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-sat-shockwave ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 51) 200)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +(defpart 1679 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-sat-shockwave) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.06666667)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees 60) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defun spt-birth-func-part-sat-shockwave ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-sat-shockwave arg0 arg1 arg2) + (none) + ) + +(defpart 1680 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 0.5)) + (:scale-y (meters 1)) + (:r 50.0 128.0) + (:g 255.0) + (:b 8.0 64.0) + (:a 128.0 128.0) + (:omega (degrees 0)) + (:vel-z (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y (meters -0.001)) + (:fade-a -0.425) + (:friction 0.997 0.003) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'spt-func-part-neo-sat-shockwave-hot) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1681 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:scale-y (meters 1.2) (meters 0.5)) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 255.0) + (:vel-x (meters 0.00033333333)) + (:fade-r -5.5) + (:fade-g -20.0) + (:fade-a -3.4) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + (:func 'sparticle-turn-to-vel) + (:next-time (seconds 0.035)) + (:next-launcher 1682) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1682 + :init-specs ((:fade-r -20.0)) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-scorch-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (mod (the-as int (rand-uint31-gen *random-generator*)) 51)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-5 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 40)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-5))) + ) + (none) + ) + +(defpart 1683 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-scorch-bits) + (:num 4.0) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.05) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.0033333334) (meters 0.016666668)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defun spt-birth-func-part-scorch-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-scorch-bits arg0 arg1 arg2) + (none) + ) + +(defpart 1684 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0) + (:z (meters 0) (meters 4)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 10.0) + (:g 20.0) + (:b 255.0) + (:a 255.0) + (:vel-y (meters 0.016666668) (meters 0.05)) + (:vel-z (meters -0.33333334)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:fade-a -5.1 -5.1) + (:accel-y (meters -0.0033333334)) + (:friction 0.8) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:conerot-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-neo-sat-ground-impact + :id 418 + :duration (seconds 0.05) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1685 :flags (sp7)) (sp-item 1686 :flags (sp7))) + ) + +(defpart 1685 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-ground-impact) + (:num 10.0) + (:x (meters 2)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.06666667)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees -20) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-ground-impact ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-sat-shockwave arg0 arg1 arg2) + (none) + ) + +(defpart 1686 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 10.0) + (:scale-x (meters 2) (meters 1)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 110.0) + (:b 50.0) + (:a 64.0) + (:vel-z (meters 0.05) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.01)) + (:scalevel-y (meters -0.001)) + (:fade-a -0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:conerot-x (degrees 0) (degrees -45)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-neo-sat-ground-emerge + :id 419 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1687 :flags (sp7))) + ) + +(defpartgroup group-neo-sat-ground-dust + :id 420 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1688 :flags (sp7) :period (seconds 10) :length (seconds 0.05))) + ) + +(defpart 1687 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-ground-emerge) + (:num 0.3 0.3) + (:x (meters -2) (meters 4)) + (:y (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.00066666666) (meters -0.001)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-ground-emerge ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-sat-shockwave arg0 arg1 arg2) + (none) + ) + +(defpart 1688 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 10.0) + (:scale-x (meters 4) (meters 2)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 110.0) + (:b 50.0) + (:a 64.0) + (:vel-z (meters 0.05) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.01)) + (:scalevel-y (meters -0.001)) + (:fade-a -0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:conerot-x (degrees 0) (degrees -45)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-neo-sat-debris-fly + :id 421 + :duration (seconds 0.017) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1689 :flags (sp7)) (sp-item 1690 :flags (sp7)) (sp-item 1691)) + ) + +(defpart 1689 + :init-specs ((:texture (middot level-default-sprite)) + (:num 20.0) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.06666667) (meters 0.06666667)) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 0.167) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-y (degrees -30) (degrees 60)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1690 + :init-specs ((:texture (crate-wood-01-splinter level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 5.0 5.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 10.0 100.0) + (:b 200.0) + (:a 128.0) + (:vel-z (meters 0.016666668) (meters 0.1)) + (:rotvel-z (degrees -5) (degrees 10)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x400600 #x408900 #x405000)) + (:conerot-x (degrees 0) (degrees -40)) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1691 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:scale-y (meters 2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.013333334)) + (:scalevel-y (meters 0.0033333334)) + (:fade-a -0.21333334) + (:accel-y (meters 0.001)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-neo-sat-antenna-explode + :id 422 + :duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1692 :flags (sp7) :period (seconds 0.335) :length (seconds 0.017)) (sp-item 1693 :flags (sp7))) + ) + +(defpart 1692 + :init-specs ((:texture (middot level-default-sprite)) + (:num 100.0) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.06666667) (meters 0.06666667)) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 0.167) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1693 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.1 0.2) + (:scale-x (meters 2) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 40.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 255.0) + (:scalevel-y (meters 0.04)) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +(defpartgroup group-neo-sat-damage-light + :id 423 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1694 :flags (sp7)) (sp-item 1695 :flags (sp7))) + ) + +(defpart 1694 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:scale-x (meters 0.2) (meters 0.8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1695 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.05 0.1) + (:x (meters 0) (meters 2)) + (:y (meters -1)) + (:scale-x (meters 0.2) (meters 0.8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.001)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.001)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-neo-sat-damage-medium + :id 424 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1696 :flags (sp7)) (sp-item 1697 :flags (sp7))) + ) + +(defpart 1696 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:scale-x (meters 0.2) (meters 0.8)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1697 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.1 0.2) + (:x (meters 0) (meters 2)) + (:y (meters -1)) + (:scale-x (meters 0.4) (meters 0.8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 160.0) + (:scalevel-x (meters -0.001)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.26666668 -0.26666668) + (:accel-y (meters -0.001)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-neo-sat-damage-heavy + :id 425 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1698 :flags (sp7)) (sp-item 1699 :flags (sp7)) (sp-item 1700 :flags (sp7))) + ) + +(defpart 1698 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:scale-x (meters 0.6) (meters 1)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:vel-y (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1699 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.2 0.4) + (:x (meters 0) (meters 2)) + (:y (meters -1)) + (:scale-x (meters 0.6) (meters 0.8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 200.0) + (:b 255.0) + (:a 160.0) + (:scalevel-x (meters -0.001)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.26666668 -0.26666668) + (:accel-y (meters -0.001)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1700 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:x (meters 0) (meters 0.5)) + (:y (meters 0.5)) + (:scale-x (meters 0.5) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0 30.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.0033333334)) + (:scalevel-x (meters -0.0033333334) (meters -0.0033333334)) + (:scalevel-y (meters 0.0033333334) (meters 0.0033333334)) + (:fade-g -0.8) + (:fade-b -0.2) + (:fade-a -0.2 -0.6666667) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-neo-satellite-explode + :id 426 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1701 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1702 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1703 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1704 :period (seconds 30) :length (seconds 0.167)) + (sp-item 1705 :period (seconds 30) :length (seconds 0.335)) + (sp-item 1706 :period (seconds 30) :length (seconds 0.667) :offset 300) + (sp-item 1707 :period (seconds 30) :length (seconds 0.117)) + ) + ) + +(defpart 1707 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 10.0) + (:y (meters -3.5) (meters 2)) + (:scale-x (meters 5)) + (:rot-x 4) + (:scale-y (meters 0.2) (meters 0.4)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 0.0675)) + (:vel-y (meters 0.26666668) (meters 0.33333334)) + (:fade-a -0.51 -0.51) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.9 0.08) + (:timer (seconds 1.5) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 140)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1706 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 10.0) + (:x (meters -5) (meters 10)) + (:y (meters -5) (meters 10)) + (:z (meters -5) (meters 10)) + (:scale-x (meters 0.05) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 0.0 32.0) + (:b 255.0) + (:a 120.0 120.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0) (meters 0.01)) + (:fade-a -0.17 -0.1275) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.017)) + (:next-launcher 1708) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1708 + :init-specs ((:accel-x (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-y (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-z (meters -0.0033333334) 1 (meters 0.006666667)) + (:next-time (seconds 0.067) (seconds 0.03)) + (:next-launcher 1708) + ) + ) + +(defpart 1701 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 0.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 1702 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 30.0) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 30.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.06666667) + (:fade-g -0.025) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.99) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1704 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 30.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.6666667) (meters 0.26666668)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.13333334) + (:fade-g -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.8) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1705 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters -4) (meters 8)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.06666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-sat-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 32.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 64.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 64.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 64.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-sat-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-sat-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-sat-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-sat-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-sat-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 0.625 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-sat-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 0.625 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-neo-satellite-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.7) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 1705 init-specs 16 initial-valuef) + (the-as float *part-neo-satellite-explosion-texture-curve-settings*) + ) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* color-start) *range-sat-explo-color*) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* alpha-start) *range-sat-explo-alpha*) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* scale-x-start) *range-sat-explo-scale-x*) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* scale-y-start) *range-sat-explo-scale-y*) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* a-scalar) *curve-sat-explo-alpha*) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* scale-x-scalar) *curve-sat-explo-scale-x*) + +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* scale-y-scalar) *curve-sat-explo-scale-y*) + +(defpart 1703 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 40.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-neo-satellite-buildup + :id 427 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1709 :flags (is-3d sp7) :period (seconds 10) :length (seconds 2)) + (sp-item 1710 :flags (sp7) :period (seconds 10) :length (seconds 0.035)) + ) + ) + +(defpart 1709 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.4 0.4) + (:scale-x (meters 40) (meters 40)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0)) + (:r 128.0) + (:g 64.0) + (:b 255.0) + (:a 255.0) + (:scalevel-y (meters 0.033333335)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1711) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1711 + :init-specs ((:scalevel-y (meters 0))) + ) + +(defpart 1710 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(deftype neo-sat-laser-info (structure) + ((joint int16) + (rope-index int16) + ) + ) + + +(define *neo-sat-laser-array* (new 'static 'boxed-array :type neo-sat-laser-info + (new 'static 'neo-sat-laser-info :joint 4) + (new 'static 'neo-sat-laser-info :joint 5 :rope-index -1) + (new 'static 'neo-sat-laser-info :joint 6 :rope-index 1) + (new 'static 'neo-sat-laser-info :joint 7 :rope-index 1) + (new 'static 'neo-sat-laser-info :joint 8 :rope-index 2) + (new 'static 'neo-sat-laser-info :joint 9 :rope-index -1) + ) + ) + +(deftype neo-sat-hash-index (structure) + ((h0 float) + (h1 float) + ) + :pack-me + ) + + +(deftype rope-neo-sat-whip (rope-prim-system) + ((parent-handle handle) + ) + ) + + +(deftype neo-sat-yellow-ammo-pos (structure) + ((angle float) + (dist float) + ) + :allow-misaligned + ) + + +(define *neo-sat-focus-pos* (new 'static 'vector)) + +(deftype neo-sat (nav-enemy) + ((nav-vector vector :inline) + (y-movement float) + (ground-offset float) + (desired-y-height float) + (xz-vel float) + (x-vel float) + (z-vel float) + (offset-angle float) + (last-thrust-vec vector :inline) + (disc-joint joint-mod-rotate-local :inline) + (laser-rotate-angle float) + (wander-generate-time time-frame) + (hit-player? symbol) + (desired-float-height float) + (bob-speed-scalar float) + (on-ground? symbol) + (current-shockwave-radius float) + (active-laser-index int8) + (current-stage int8) + (fly-speed-scalar float) + (last-shockwave-radius float) + (ropes (array rope-neo-sat-whip)) + (max-speed float) + (spin-current float) + (spin-dest float) + (spin-speed float) + (hashed-heights float 1225) + (shockwave-origin vector :inline) + (current-height-probe-index int16) + (last-spawned-ring-index int16) + (global-neo-sat-index uint8) + (yellow-ammo-pos neo-sat-yellow-ammo-pos 4 :inline) + (num-yellow-ammo int8 :offset 5784) + (start-thrust-pos vector :inline) + (was-player-inside-cone? symbol) + (was-doing-cone-check? symbol) + (damage-part1 sparticle-launch-control) + (damage-part2 sparticle-launch-control) + (damage-part3 sparticle-launch-control) + (burst-dust-part sparticle-launch-control) + (warp-handle handle) + (spine-joint-mods joint-mod-rotate-local 6 :inline) + (actual-laser-rotate-angle float) + (last-particle-rotate float) + (trunk-joint joint-mod-rotate-local :inline) + (ground-height float) + (tentacle rope-joint-system) + (anim-loop? symbol) + (play-anim? symbol) + (anim-speed float) + (should-rise? symbol) + (last-play-laser-time time-frame) + (snd-laser-burn sound-id) + (snd-whips-loop sound-id 3) + (sound-last-snap-time time-frame 3) + (sound-next-play-time time-frame 3) + (new-spin-time time-frame) + (snd-arms-chatter sound-id) + (was-spinning? symbol) + (snd-hover sound-id) + (snd-spool-explosion sound-id) + (antenna-explode-part sparticle-launch-control) + (next-lightning-time time-frame) + ) + (:state-methods + sat-idle + neo-sat-drill-attack + neo-sat-drill-prepare + neo-sat-drill-returning + neo-sat-laser-attack + neo-sat-drill-impact + neo-sat-sit-and-spin + ground-burst + ) + (:methods + (neo-sat-method-198 (_type_) none) + (neo-sat-method-199 (_type_) none) + (neo-sat-method-200 (_type_) none) + (neo-sat-method-201 (_type_) float) + (neo-sat-probe-ground (_type_ vector) float) + (neo-sat-method-203 (_type_ symbol) vector) + (neo-sat-method-204 (_type_) none) + (neo-sat-method-205 (_type_) none) + (neo-sat-method-206 (_type_ int symbol) none) + (neo-sat-method-207 (_type_) none) + (neo-sat-method-208 (_type_) none) + (neo-sat-method-209 (_type_) float) + (neo-sat-method-210 (_type_) float) + (neo-sat-method-211 (_type_) none) + (neo-sat-method-212 (_type_ vector vector) vector) + (neo-sat-method-213 (_type_ float) int) + (neo-sat-method-214 (_type_ float) int) + (neo-sat-method-215 (_type_ float) float) + (neo-sat-method-216 (_type_ float) float) + (neo-sat-method-217 (_type_ int int) int) + (neo-sat-method-218 (_type_ vector) float) + (neo-sat-method-219 (_type_) none) + (neo-sat-method-220 (_type_) int) + (neo-sat-method-221 (_type_) symbol) + (neo-sat-method-222 (_type_ object vector) float) + (neo-sat-method-223 (_type_ vector int int) symbol) + (neo-sat-method-224 (_type_) none) + (neo-sat-method-225 (_type_ int) object) + (neo-sat-method-226 (_type_ int) rope-system-flag) + (neo-sat-method-227 (_type_ int) none) + (neo-sat-method-228 (_type_) none) + (move-to-ground-height (_type_ float) none) + (neo-sat-method-230 (_type_) none) + (spawn-shield (_type_) none) + (neo-sat-method-232 (_type_ vector) symbol) + (neo-sat-method-233 (_type_) quaternion) + ) + (:states + neo-sat-drill-halting + ) + ) + + +(define *alive-neo-sats* (new 'static 'boxed-array :type handle :length 0 :allocated-length 12)) + +(set! (-> *alive-neo-sats* length) (-> *alive-neo-sats* allocated-length)) + +(dotimes (v1-107 (-> *alive-neo-sats* length)) + (set! (-> *alive-neo-sats* v1-107) (the-as handle #f)) + ) + +(define *neo-sat-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim 4 + :hit-anim 4 + :knocked-anim 4 + :knocked-land-anim 4 + :die-anim 4 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :notice-distance (meters 30) + :notice-distance-delta (meters 10) + :default-hit-points 90.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim -1 + :run-anim 4 + :taunt-anim -1 + :run-travel-speed (meters 20) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 2) + :walk-travel-speed (meters 20) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 1) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 1) + :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! (-> *neo-sat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(deftype neo-sat-init-params (structure) + ((pos vector :inline) + (quat quaternion :inline) + ) + ) + + +(define *neo-sat-rope-tentacle* + (new 'static 'rope-joint-system-info :joint-info-array (new 'static 'boxed-array :type rope-joint-info + (new 'static 'rope-joint-info :joint-index 10) + (new 'static 'rope-joint-info :joint-index 11) + (new 'static 'rope-joint-info :joint-index 12) + (new 'static 'rope-joint-info :joint-index 13) + (new 'static 'rope-joint-info :joint-index 14) + (new 'static 'rope-joint-info :joint-index 15) + ) + ) + ) + +(define *neo-satellite-nav-mesh* (the-as actor-id #x11bae)) + +;; WARN: Return type mismatch none vs object. +(defbehavior neo-sat-init-by-other neo-sat ((arg0 neo-sat-init-params)) + (stack-size-set! (-> self main-thread) 512) + (logclear! (-> self mask) (process-mask enemy)) + (init-enemy-collision! self) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-sat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init (-> self disc-joint) self (the-as uint 3) (joint-mod-base-flags attached)) + (init (-> self trunk-joint) self (the-as uint 10) (joint-mod-base-flags attached)) + (set! (-> self snd-laser-burn) (new-sound-id)) + (set! (-> self snd-arms-chatter) (new-sound-id)) + (set! (-> self snd-hover) (new-sound-id)) + (dotimes (gp-2 3) + (set! (-> self snd-whips-loop gp-2) (new-sound-id)) + ) + (init-enemy-defaults! self *neo-sat-nav-enemy-info*) + (logior! (-> self skel status) (joint-control-status sync-math)) + (ja-no-eval :group! neo-satellite-idle-ja :num! zero) + (ja-post) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self ropes) (new 'process 'boxed-array rope-neo-sat-whip 3)) + (dotimes (gp-3 (-> self ropes allocated-length)) + (set! (-> self ropes gp-3) (new 'process 'rope-neo-sat-whip)) + (set! (-> self ropes gp-3 parent-handle) (process->handle self)) + (init! (-> self ropes gp-3) 20) + (logior! (-> self ropes gp-3 flags) (rope-system-flag rs0 rs1)) + (set! (-> self ropes gp-3 gravity) 409600.0) + (set! (-> self ropes gp-3 drag) 0.3) + (set! (-> self ropes gp-3 strip1 tex-id) (new 'static 'texture-id :index #xf :page #x5)) + (set! (-> self ropes gp-3 strip2 tex-id) (new 'static 'texture-id :index #xf :page #x5)) + (set! (-> self ropes gp-3 uv-repeat-dist) 40960.0) + (rope-system-method-21 (-> self ropes gp-3)) + ) + (set! (-> self ropes length) (-> self ropes allocated-length)) + (set! (-> self tentacle) (new 'process 'rope-joint-system)) + (set! (-> self damage-part1) (create-launch-control (-> *part-group-id-table* 423) self)) + (set! (-> self damage-part2) (create-launch-control (-> *part-group-id-table* 424) self)) + (set! (-> self damage-part3) (create-launch-control (-> *part-group-id-table* 425) self)) + (set! (-> self burst-dust-part) (create-launch-control (-> *part-group-id-table* 419) self)) + (set! (-> self antenna-explode-part) (create-launch-control (-> *part-group-id-table* 422) self)) + (dotimes (gp-4 (-> *neo-sat-laser-array* length)) + (init + (-> self spine-joint-mods gp-4) + self + (the-as uint (-> *neo-sat-laser-array* gp-4 joint)) + (joint-mod-base-flags attached) + ) + ) + (change-to (get-nav-mesh *neo-satellite-nav-mesh*) self) + (if (not (-> self nav)) + (go process-drawable-art-error "No nav mesh~%") + ) + (let ((v1-109 (-> self nav state))) + (set! (-> v1-109 current-poly) (the-as nav-poly #f)) + ) + 0 + (neo-sat-method-198 self) + (let ((v1-113 0)) + (while (< v1-113 (-> *alive-neo-sats* length)) + (when (= (-> *alive-neo-sats* v1-113) #f) + (set! (-> *alive-neo-sats* v1-113) (process->handle self)) + (set! (-> self global-neo-sat-index) (the-as uint v1-113)) + ) + ;; og:preserve-this + ; (break ((empty)) ((set! v1-113 (the-as int (+ 0 1))))) + (1+! v1-113) + ) + ) + ; (label cfg-28) + (init-enemy! self) + ) + +(defmethod neo-sat-method-198 ((this neo-sat)) + (let ((v1-0 (-> this nav))) + (logclear! (-> v1-0 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) + (let ((a1-7 v1-0)) + (set! (-> a1-7 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + (let ((a1-9 v1-0)) + (set! (-> a1-9 nav-cull-radius) 12288.0) + ) + 0 + (logclear! (-> v1-0 flags) (nav-control-flag output-sphere-hash)) + ) + (set! (-> this enemy-info callback-info) *physics-nav-callback-info*) + (let ((v1-2 this)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + 0 + (none) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod init-enemy-defaults! ((this neo-sat) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) + (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (t9-0 this arg0) + ) + (neo-sat-method-199 this) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod neo-sat-method-199 ((this neo-sat)) + (add-setting! 'music 'desres2 0.0 0) + (logclear! (-> this focus-status) (focus-status disable dead inactive hit)) + (clear-focused (-> this focus)) + (dotimes (v1-6 3) + (set! (-> this sound-last-snap-time v1-6) 0) + ) + (dotimes (v1-9 3) + (set! (-> this sound-next-play-time v1-9) 0) + ) + (logclear! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let ((v1-15 (-> this root root-prim))) + (set! (-> v1-15 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-15 prim-core collide-with) (-> this root backup-collide-with)) + ) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this enemy-flags) (enemy-flag trackable trackable-backup)) + (logior! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (update-transforms (-> this root)) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (let ((v1-31 (-> this nav))) + (set! (-> v1-31 sphere-mask) (the-as uint 65)) + ) + 0 + (let ((v1-33 (-> this nav))) + (set! (-> v1-33 acceleration) 409600000.0) + ) + 0 + (set! (-> this current-stage) 0) + (set! (-> this laser-rotate-angle) 0.0) + (set! (-> this actual-laser-rotate-angle) 0.0) + (set! (-> this hit-player?) #f) + (set! (-> this should-rise?) #f) + (set! (-> this play-anim?) #t) + (set! (-> this was-spinning?) #f) + (none) + ) + +(defmethod penetrate->next-state ((this neo-sat) (arg0 process) (arg1 event-message-block) (arg2 float)) + (when (< 0.0 arg2) + (let* ((a1-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this incoming attack-direction) 1.0)) + (s5-0 (matrix-f-u-compose (new 'stack-no-clear 'matrix) a1-2 *up-vector*)) + ) + (set! (-> s5-0 trans quad) (-> this root trans quad)) + (if (logtest? (-> *part-group-id-table* 421 flags) (sp-group-flag sp13)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 421) :mat-joint s5-0) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 421) :mat-joint s5-0) + ) + ) + (when (>= 0.0 (-> this hit-points)) + ) + ) + 'none + ) + +(defmethod nav-enemy-method-176 ((this neo-sat)) + 0 + (none) + ) + +(defmethod nav-enemy-method-177 ((this neo-sat)) + 0 + (none) + ) + +(defmethod init-enemy-collision! ((this neo-sat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak 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 -20480.0 0.0 81920.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 9420.8) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 -12288.0 0.0 5324.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set-vector! (-> v1-17 local-sphere) 0.0 -20480.0 0.0 4096.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set-vector! (-> v1-19 local-sphere) 0.0 -32768.0 0.0 8192.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-21 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-21 local-sphere) 0.0 9011.2 0.0 9420.8) + ) + (set! (-> s5-0 nav-radius) 6144.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! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-enemy! ((this neo-sat)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (set! (-> this draw lod-set lod 1 dist) 983040.0) + (ja-channel-push! 1 0) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity) + ) + (ja-post) + (set-setting! 'dust-storm-sound-scalar #f 0.75 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (go (method-of-object this sat-idle)) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod enemy-common-post ((this neo-sat)) + (call-parent-method this) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (when (-> this should-rise?) + (send-event this 'rise-up) + (set! (-> this should-rise?) #f) + ) + (when (-> this play-anim?) + (cond + ((-> this anim-loop?) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 param 0) (-> this anim-speed)) + (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (else + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) + (set! (-> a0-9 param 1) (-> this anim-speed)) + (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (seek! (-> this actual-laser-rotate-angle) (-> this laser-rotate-angle) (* 16384.0 (seconds-per-frame))) + (let ((v1-24 (-> this draw shadow-ctrl))) + (set! (-> v1-24 settings top-plane w) (- 4096.0)) + ) + 0 + (let ((v1-27 (-> this draw shadow-ctrl))) + (set! (-> v1-27 settings bot-plane w) (- (+ (- -12288.0 (-> this root trans y)) (-> this ground-height)))) + ) + 0 + (dotimes (s5-0 (-> *neo-sat-laser-array* length)) + (quaternion-identity! (the-as quaternion (+ (the-as uint (-> this spine-joint-mods 0 rotation)) (* s5-0 32)))) + (quaternion-rotate-local-x! + (the-as quaternion (+ (the-as uint (-> this spine-joint-mods 0 rotation)) (* s5-0 32))) + (the-as quaternion (+ (the-as uint (-> this spine-joint-mods 0 rotation)) (* s5-0 32))) + (- (-> this actual-laser-rotate-angle)) + ) + ) + (let ((a0-19 (handle->process (-> this focus handle)))) + (if a0-19 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-19) 0) quad)) + ) + ) + (let ((f0-18 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) + (when (< 0.0 f0-18) + (cond + ((< f0-18 0.27) + (spawn (-> this damage-part3) (-> this root trans)) + (when (< (-> this next-lightning-time) (current-time)) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 22) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + (set! (-> this next-lightning-time) (+ (current-time) (seconds 0.35))) + ) + ) + ((< f0-18 0.6) + (spawn (-> this damage-part2) (-> this root trans)) + ) + ((< f0-18 0.9) + (spawn (-> this damage-part1) (-> this root trans)) + ) + ) + ) + ) + (none) + ) + +(defmethod neo-sat-probe-ground ((this neo-sat) (arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> gp-0 start-pos) arg0 *up-vector* 81920.0) + (set! (-> gp-0 move-dist quad) (the-as uint128 0)) + (set! (-> gp-0 move-dist y) -245760.0) + (let ((v1-4 gp-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) + (-> gp-0 best-other-tri intersect y) + -40960000.0 + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod move-to-ground-height ((this neo-sat) (arg0 float)) + (set! (-> this ground-height) arg0) + (let ((f0-2 (+ arg0 (-> this ground-offset)))) + (set! (-> this on-ground?) #f) + (when (< (-> this root trans y) f0-2) + (set! (-> this root trans y) f0-2) + (set! (-> this y-movement) 0.0) + (set! (-> this on-ground?) #t) + ) + ) + (none) + ) + +(define *h0* 20.0) + +(define *h1* 8.0) + +(define *hs* 4.0) + +(defmethod neo-sat-method-201 ((this neo-sat)) + (when (and (-> this next-state) (= (-> this next-state name) 'neo-sat-drill-prepare)) + (let ((f0-1 (* 0.000010172526 (-> this spin-current)))) + (sound-play-by-name + (static-sound-name "sat-hover") + (-> this snd-hover) + 1024 + (the int (* 1524.0 (lerp 0.0 0.25 f0-1))) + 0 + (sound-group) + #t + ) + ) + ) + (let ((f30-1 (neo-sat-probe-ground this (-> this root trans)))) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (set! (-> a1-3 x) (-> this root trans x)) + (set! (-> a1-3 y) f30-1) + (set! (-> a1-3 z) (-> this root trans z)) + (set! (-> a1-3 w) 1.0) + (set-virtual-cur-pos! (-> this nav state) a1-3) + ) + (move-to-ground-height this f30-1) + (set! (-> this desired-y-height) (+ f30-1 (-> this desired-float-height))) + ) + (let ((f30-2 (- (-> this desired-y-height) (-> this root trans y))) + (f0-11 0.0) + ) + (when (< 8192.0 (fabs (-> this y-movement))) + (let ((f1-5 (* 0.00012207031 (+ -8192.0 (fabs (-> this y-movement)))))) + (fmax 0.0 (fmin 1.0 f1-5)) + ) + (set! f0-11 (lerp 0.0 *h1* 1.0)) + ) + (let ((f1-12 + (* (+ (* *h0* f30-2) (* f0-11 (- (-> this y-movement)))) *hs* (-> this bob-speed-scalar) (seconds-per-frame)) + ) + ) + (+! (-> this y-movement) (* f1-12 (seconds-per-frame))) + ) + ) + (set! (-> this root trans y) (+ (-> this root trans y) (* (-> this y-movement) (seconds-per-frame)))) + ) + +(define *m0* 30.0) + +(define *m1* 20.0) + +(define *ms* 1.5) + +(define *move-offset* 32768.0) + +(define *maxh* 16384.0) + +(define *minh* 16384.0) + +(define *maxl* 73728.0) + +(define *minl* 69632.0) + +(defmethod neo-sat-method-203 ((this neo-sat) (arg0 symbol)) + (let ((a0-1 (-> this nav state)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a0-1 target-pos quad)) + (let ((f30-0 (vector-vector-xz-distance (-> this root trans) a1-1))) + (-> this xz-vel) + (let ((s5-0 (new-stack-vector0))) + (when arg0 + (let ((a1-2 (the-as process-focusable (handle->process (-> this focus handle))))) + (if a1-2 + (vector-float*! s5-0 (-> a1-2 root transv) 1.0) + ) + ) + ) + (fabs (+ -32768.0 f30-0)) + (let ((s3-1 (vector+float*! (new 'stack-no-clear 'vector) s5-0 (-> this nav-vector) f30-0))) + (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this root transv) 1.0) + (-> this nav-vector) + ) + (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) s3-1 (-> this root transv)))) + (vector-lerp! (-> this last-thrust-vec) (-> this last-thrust-vec) s4-2 (* 2.0 (seconds-per-frame))) + (set! (-> s4-2 quad) (-> this last-thrust-vec quad)) + (let* ((f1-1 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this root transv) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-2 1.0) + ) + ) + (f0-18 (* (+ (* *m0* f30-0) (* -1.0 (vector-length (-> this root transv)) f1-1 *m1*)) + (lerp 1.0 2.0 (fmax 0.0 (fmin 1.0 (* 0.0000061035157 (vector-length s5-0))))) + *ms* + (seconds-per-frame) + ) + ) + ) + (vector-normalize! s4-2 (* f0-18 (seconds-per-frame))) + ) + (vector+! (-> this root transv) (-> this root transv) s4-2) + ) + ) + ) + ) + ) + (let ((f0-20 (vector-length (-> this root transv)))) + (if (< (-> this max-speed) f0-20) + (vector-float*! (-> this root transv) (-> this root transv) (/ (-> this max-speed) f0-20)) + ) + ) + (vector-v++! (-> this root trans) (-> this root transv)) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod neo-sat-method-204 ((this neo-sat)) + (set-setting! 'fov 'abs (degrees 75.0) 0) + (set-setting! 'string-min-height 'abs *minh* 0) + (set-setting! 'string-max-height 'abs *maxh* 0) + (set-setting! 'string-min-length 'abs *minl* 0) + (set-setting! 'string-max-length 'abs *maxl* 0) + (none) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod neo-sat-method-208 ((this neo-sat)) + (set-setting! 'fov 'abs (degrees 75.0) 0) + (set-setting! 'string-min-height 'abs (meters 4) 0) + (set-setting! 'string-max-height 'abs (meters 8) 0) + (set-setting! 'string-min-length 'abs *minl* 0) + (set-setting! 'string-max-length 'abs *maxl* 0) + (none) + ) + +(defmethod neo-sat-method-205 ((this neo-sat)) + (remove-setting! 'fov) + (remove-setting! 'string-min-height) + (remove-setting! 'string-max-height) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (none) + ) + +(defmethod neo-sat-method-233 ((this neo-sat)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans)))) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let ((s5-2 (quaternion-look-at! (new 'stack-no-clear 'quaternion) s5-1 *up-vector*))) + (quaternion-rotate-y! s5-2 s5-2 -10922.667) + (quaternion-slerp! + (-> this trunk-joint rotation) + (-> this trunk-joint rotation) + s5-2 + (* 2.0 (seconds-per-frame)) + ) + ) + ) + ) + +;; WARN: Return type mismatch quaternion vs none. +(defmethod neo-sat-method-200 ((this neo-sat)) + (neo-sat-method-201 this) + (neo-sat-method-203 this #t) + (neo-sat-method-233 this) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod neo-sat-method-207 ((this neo-sat)) + (set-setting! 'duststorm-push-player? #f 0.0 0) + (set! (-> this last-play-laser-time) 0) + (set! (-> this current-height-probe-index) 0) + (set! (-> this shockwave-origin quad) (-> this root trans quad)) + (let ((v1-8 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> *neo-sat-laser-array* 0 joint))) + ) + ) + 0.0 + 0.0 + (let* ((s5-0 (new 'stack-no-clear 'vector)) + (f30-0 (- (-> v1-8 y) (-> this root trans y))) + (a0-8 (vector-! (new 'stack-no-clear 'vector) v1-8 (-> this root trans))) + (f28-0 (sqrtf (+ (* (-> a0-8 x) (-> a0-8 x)) (* (-> a0-8 z) (-> a0-8 z))))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans))) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-1 y) 0.0) + (vector-normalize! s4-1 1.0) + (vector-float*! s4-1 s4-1 81920.0) + (vector+! s3-0 (-> this focus-pos) s4-1) + (vector-normalize! s4-1 1.0) + (vector-float*! s4-1 s4-1 f28-0) + (set! (-> s4-1 y) f30-0) + (vector+! s5-0 (-> this root trans) s4-1) + (let ((a0-19 (vector-! (new 'stack-no-clear 'vector) s3-0 s5-0))) + 0.0 + 0.0 + (let ((f30-1 (fabs (-> a0-19 y)))) + (set! (-> a0-19 y) 0.0) + (let ((f0-13 (vector-normalize-ret-len! a0-19 1.0))) + (set! (-> this laser-rotate-angle) (- (atan f30-1 f0-13))) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod event-handler ((this neo-sat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let ((a0-3 (-> arg3 param 1)) + (s1-0 (new 'stack-no-clear 'attack-info)) + ) + ((method-of-type attack-info attack-info-method-9) + (the-as attack-info a0-3) + s1-0 + (the-as process-drawable arg0) + this + ) + (if (and (not (logtest? (-> this enemy-flags) (enemy-flag vulnerable))) + (< (+ -8192.0 (-> this root trans y)) (-> s1-0 intersection y)) + ) + (send-event (handle->process (-> this warp-handle)) 'hit) + ) + ) + ) + (('notify) + (case (-> arg3 param 0) + (('attack) + (let ((v1-18 (the-as process (-> arg3 param 1)))) + (if (and v1-18 (= (-> v1-18 type) target) (> (-> this current-stage) 0)) + (set! (-> this hit-player?) #t) + ) + ) + ) + ) + ) + ) + (call-parent-method this arg0 arg1 arg2 arg3) + ) + +(defmethod coin-flip? ((this neo-sat)) + #f + ) + +(defstate neo-sat-drill-halting (neo-sat) + :event enemy-event-handler + :trans (behavior () + (if (-> self hit-player?) + (go-virtual hostile) + ) + (neo-sat-method-230 self) + (seek! (-> self anim-speed) 3.0 (* 0.15 (seconds-per-frame))) + (neo-sat-method-233 self) + (vector-float*! (-> self root transv) (-> self root transv) (fmax 0.0 (- 1.0 (* 2.0 (seconds-per-frame))))) + (vector-v++! (-> self root trans) (-> self root transv)) + (neo-sat-method-220 self) + (dotimes (gp-0 (-> *neo-sat-laser-array* length)) + (neo-sat-method-206 self (-> *neo-sat-laser-array* gp-0 joint) #f) + ) + (set! (-> self spin-current) 49152.0) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + (if (< (vector-length (-> self root transv)) 2048.0) + (go-virtual neo-sat-drill-returning) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate neo-sat-drill-returning (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((a0-12 (-> self nav state)) + (v1-4 (-> self shockwave-origin)) + ) + (logclear! (-> a0-12 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-12 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-12 target-pos quad) (-> v1-4 quad)) + ) + 0 + (set! (-> self last-thrust-vec quad) (the-as uint128 0)) + ) + :trans (behavior () + (if (-> self hit-player?) + (go-virtual hostile) + ) + (neo-sat-method-230 self) + (seek! (-> self anim-speed) 3.0 (* 0.15 (seconds-per-frame))) + (vector-! (-> self nav-vector) (-> self shockwave-origin) (-> self root trans)) + (set! (-> self nav-vector y) 0.0) + (vector-normalize! (-> self nav-vector) 1.0) + (neo-sat-method-203 self #f) + (neo-sat-method-233 self) + (neo-sat-method-220 self) + (neo-sat-method-201 self) + (dotimes (gp-0 (-> *neo-sat-laser-array* length)) + (neo-sat-method-206 self (-> *neo-sat-laser-array* gp-0 joint) #f) + ) + (set! (-> self spin-current) 49152.0) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self shockwave-origin)) 901.12) + (go-virtual neo-sat-drill-prepare) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate neo-sat-drill-prepare (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! neo-satellite-stab-ja :num! (seek!) :frame-num 0.0) + (set! (-> self anim-loop?) #f) + (set! (-> self anim-speed) 0.7) + (sound-stop (-> self snd-arms-chatter)) + ) + :trans (behavior () + (neo-sat-method-220 self) + (if (time-elapsed? (-> self state-time) (seconds 1.5)) + (go-virtual neo-sat-drill-attack) + ) + (if (-> self hit-player?) + (go-virtual hostile) + ) + (if #f + (neo-sat-method-230 self) + ) + (neo-sat-method-201 self) + (let* ((f0-1 (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (f30-0 (* f0-1 f0-1)) + ) + (set! (-> self bob-speed-scalar) (lerp 1.0 10.0 f30-0)) + (set! (-> self spin-current) (lerp 49152.0 98304.0 f30-0)) + ) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + (when #f + (dotimes (gp-0 (-> *neo-sat-laser-array* length)) + (neo-sat-method-206 self (-> *neo-sat-laser-array* gp-0 joint) #f) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (sound-stop (-> self snd-laser-burn)) + (neo-sat-method-208 self) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defmethod neo-sat-method-224 ((this neo-sat)) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs vector. +(defmethod rope-system-method-10 ((this rope-neo-sat-whip)) + (call-parent-method this) + (let ((s5-0 (the-as neo-sat (handle->process (-> this parent-handle))))) + (the-as vector (when (not (and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'neo-sat-sit-and-spin))) + (dotimes (s4-0 (-> this knots length)) + (let* ((f0-0 (neo-sat-method-218 s5-0 (the-as vector (-> this knots data s4-0)))) + (f0-1 (+ 614.4 f0-0)) + ) + (set! (-> this knots data s4-0 pos y) (fmax (-> this knots data s4-0 pos y) f0-1)) + ) + ) + #f + ) + ) + ) + ) + +(defmethod neo-sat-method-225 ((this neo-sat) (arg0 int)) + (let* ((gp-0 (-> *neo-sat-laser-array* arg0 joint)) + (a1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data gp-0))) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> this node-list data gp-0 bone transform fvec quad)) + (let ((gp-1 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) + (set! (-> gp-1 knots data 0 mass) (the-as float #x7f800000)) + (if (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) + (set! (-> gp-1 gravity-dir quad) (-> s3-0 quad)) + ) + (set! (-> gp-1 knots data 0 pos quad) (-> a1-3 quad)) + (set! (-> gp-1 knots data 0 prev-pos quad) (-> a1-3 quad)) + (set! (-> gp-1 knot-constraints data 0 dir quad) (-> s3-0 quad)) + (when (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) + (let ((f30-1 (- (-> a1-3 y) (neo-sat-method-218 this a1-3)))) + (dotimes (s2-0 (-> gp-1 knots length)) + (set! (-> gp-1 knots data s2-0 pos y) + (+ f30-1 (neo-sat-method-218 this (the-as vector (-> gp-1 knots data s2-0)))) + ) + (set! (-> gp-1 knots data s2-0 prev-pos y) (-> gp-1 knots data s2-0 pos y)) + ) + ) + ) + 0.0 + 0.0 + (let* ((f30-2 (/ 368640.0 (the float (+ (-> gp-1 knots length) -1)))) + (f28-0 (* 0.6666667 f30-2)) + ) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) + (let ((s2-1 (-> *neo-sat-laser-array* arg0 rope-index))) + (when (and (> (-> this sound-next-play-time s2-1) 0) (>= (- (current-time) (-> this sound-next-play-time s2-1)) 0)) + (sound-play "sat-whip-snap") + (set! (-> this sound-next-play-time s2-1) 0) + 0 + ) + (when (and (time-elapsed? (-> this sound-last-snap-time s2-1) (seconds 1.5)) + (not (time-elapsed? + (-> gp-1 knot-constraints data (+ (-> gp-1 knot-constraints length) -1) constrained-angle-time) + (seconds 0.1) + ) + ) + (zero? (-> this sound-next-play-time s2-1)) + ) + (set-time! (-> this sound-last-snap-time s2-1)) + (let* ((f0-10 (* 0.000030517578 (fabs (-> this spin-speed)))) + (f0-11 (* f0-10 f0-10)) + ) + (set! (-> this sound-next-play-time s2-1) (+ (current-time) (the int (* 300.0 (lerp 0.3 0.0 f0-11))))) + ) + ) + ) + (when (< 0.75 (/ (-> gp-1 knot-constraints data 0 length) f30-2)) + (let ((s2-3 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans)))) + 0.0 + 0.0 + 0.0 + 0.0 + (let ((f26-1 (fmax 0.0 (fmin 1.0 (* 0.000030517578 (fabs (-> this spin-speed))))))) + (set! (-> s2-3 y) 0.0) + (vector-normalize! s2-3 1.0) + (let* ((f0-23 (acos (vector-dot s2-3 s3-0))) + (f0-24 (* 0.000030517578 f0-23)) + (f22-0 (- 1.0 f0-24)) + (f1-10 (+ (lerp 0.0 0.75 (* f22-0 f22-0)) (lerp -0.25 0.25 f26-1))) + (f24-1 (fmax 0.0 (fmin 1.0 f1-10))) + (f0-29 (+ (lerp -0.5 0.5 f22-0) (lerp 0.0 0.5 f26-1))) + (f0-30 (fmin 1.0 f0-29)) + ) + (sound-play-by-name + (static-sound-name "sat-whip-loop-a") + (-> this snd-whips-loop (-> *neo-sat-laser-array* arg0 rope-index)) + (the int (* 1024.0 f24-1)) + (the int (* 1524.0 f0-30)) + 0 + (sound-group) + #t + ) + ) + ) + ) + ) + ) + (else + (sound-stop (-> this snd-whips-loop (-> *neo-sat-laser-array* arg0 rope-index))) + ) + ) + (when (not (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin))) + (set! f28-0 (* 2.0 f28-0)) + (set! f30-2 0.0) + ) + (dotimes (s5-1 (-> gp-1 knot-constraints length)) + (seek! (-> gp-1 knot-constraints data s5-1 length) f30-2 (* f28-0 (seconds-per-frame))) + ) + ) + (rope-system-method-18 gp-1) + ) + ) + ) + +(defmethod neo-sat-method-226 ((this neo-sat) (arg0 int)) + (let* ((s4-0 (-> *neo-sat-laser-array* arg0 joint)) + (a1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s4-0))) + (v1-5 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-5 quad) (-> this node-list data s4-0 bone transform fvec quad)) + 368640.0 + (let ((a0-15 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) + 0.0 + (let ((f0-2 0.0)) + (dotimes (a2-3 (-> a0-15 knots length)) + (vector+float*! (the-as vector (-> a0-15 knots data a2-3)) a1-3 v1-5 (* (the float a2-3) f0-2)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> a0-15 knots data 0 prev-pos)) (* a2-3 64)))) + (-> a0-15 knots data a2-3 pos quad) + ) + ) + ) + (dotimes (a1-6 (-> a0-15 knot-constraints length)) + (set! (-> a0-15 knot-constraints data a1-6 dir quad) (-> v1-5 quad)) + (set! (-> a0-15 knot-constraints data a1-6 length) 0.0) + (set! (-> a0-15 knot-constraints data a1-6 rest-seek-rate) 5461.3335) + (set! (-> a0-15 knot-constraints data a1-6 max-angle) 2730.6667) + ) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) + (logior! (-> a0-15 flags) (rope-system-flag rs0)) + ) + (else + (vector-float*! (-> a0-15 gravity-dir) *up-vector* -1.0) + (logclear! (-> a0-15 flags) (rope-system-flag rs0)) + ) + ) + (rope-system-method-22 a0-15) + ) + ) + ) + +(defmethod neo-sat-method-209 ((this neo-sat)) + (set-time! (-> this new-spin-time)) + (set! (-> this spin-current) (quaternion-y-angle (-> this disc-joint rotation))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let ((f30-0 (the float (sar (shl (the int (vector-y-angle s5-1)) 48) 48)))) + (set! (-> this spin-current) (the float (sar (shl (the int (-> this spin-current)) 48) 48))) + (when (= (-> this current-stage) 2) + (let* ((f30-1 -24576.0) + (f28-0 49152.0) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + (f0-14 (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-15))))) + (f0-15 (if (< f0-14 0.0) + (+ -21845.334 f0-14) + (+ 21845.334 f0-14) + ) + ) + ) + (set! (-> this spin-dest) (+ (-> this spin-current) f0-15)) + ) + (return 0.0) + ) + (let* ((v1-23 (-> this current-stage)) + (f28-4 (cond + ((zero? v1-23) + (let* ((f28-1 22755.555) + (f26-0 20935.113) + (v1-27 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-28 (the-as number (logior #x3f800000 v1-27))) + ) + (+ f28-1 (* f26-0 (+ -1.0 (the-as float v1-28)))) + ) + ) + ((= v1-23 1) + (let* ((f28-2 8192.0) + (f26-1 8192.0) + (v1-34 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-35 (the-as number (logior #x3f800000 v1-34))) + ) + (+ f28-2 (* f26-1 (+ -1.0 (the-as float v1-35)))) + ) + ) + (else + (let* ((f28-3 -3640.889) + (f26-2 7281.778) + (v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + ) + (+ f28-3 (* f26-2 (+ -1.0 (the-as float v1-41)))) + ) + ) + ) + ) + (f30-2 (deg- f30-0 (-> this spin-current))) + ) + 0.0 + -32768.0 + (let ((s5-2 #f)) + (if (< (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 12) + (set! s5-2 #t) + ) + (set! f30-2 (cond + (s5-2 + (if (< 0.0 f30-2) + (+ -65536.0 f30-2) + (+ 65536.0 f30-2) + ) + ) + (else + (empty) + f30-2 + ) + ) + ) + ) + (if (< f30-2 0.0) + (set! f28-4 (* -1.0 f28-4)) + ) + (let ((f0-40 (+ f30-2 f28-4))) + (set! (-> this spin-dest) (+ (-> this spin-current) f0-40)) + ) + ) + ) + ) + ) + +(defmethod neo-sat-method-228 ((this neo-sat)) + (neo-sat-method-225 this (-> this active-laser-index)) + (neo-sat-method-227 this (-> this active-laser-index)) + (case (-> this current-stage) + ((1) + (neo-sat-method-225 this 3) + (neo-sat-method-227 this 3) + ) + ((2) + (neo-sat-method-225 this 2) + (neo-sat-method-227 this 2) + (neo-sat-method-225 this 4) + (neo-sat-method-227 this 4) + ) + ) + (none) + ) + +(defmethod neo-sat-method-210 ((this neo-sat)) + (local-vars (s5-1 object)) + (let ((f0-0 143360.0)) + (if (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (go (method-of-object this ground-burst)) + ) + ) + (-> this spin-current) + 0.0 + (let ((f0-5 1.0) + (f1-1 (- (-> this spin-dest) (-> this spin-current))) + ) + (if (or (and (< 0.0 (-> this spin-speed)) (< f1-1 0.0)) (and (< (-> this spin-speed) 0.0) (< 0.0 f1-1))) + (* -1.0 f0-5) + ) + ) + (let* ((f0-10 + (* (+ (* 12.0 (- (-> this spin-dest) (-> this spin-current))) (* 6.0 (- (-> this spin-speed)))) + (seconds-per-frame) + ) + ) + (f0-11 (* 0.05 f0-10)) + ) + (+! (-> this spin-speed) f0-11) + ) + (let* ((v1-19 (-> this current-stage)) + (v1-20 (cond + ((zero? v1-19) + 50062.223 + ) + ((= v1-19 1) + 50062.223 + ) + ((= v1-19 2) + 36408.89 + ) + ) + ) + (f0-13 v1-20) + ) + (set! (-> this spin-speed) (fmax (fmin (-> this spin-speed) f0-13) (- f0-13))) + ) + (+! (-> this spin-current) (* (-> this spin-speed) (seconds-per-frame))) + (quaternion-rotate-y! + (-> this disc-joint rotation) + (-> this disc-joint rotation) + (* (-> this spin-speed) (seconds-per-frame)) + ) + (let ((s5-0 (handle->process (-> this focus handle)))) + (cond + ((and (if (type? s5-0 process-focusable) + s5-0 + ) + (begin + (let* ((s5-2 #t) + (s4-0 (handle->process (-> this focus handle))) + (v1-33 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + focus-status + ) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + (cmove-#f-nonzero s5-1 v1-33 s5-2) + ) + s5-1 + ) + ) + (if (or (time-elapsed? (-> this new-spin-time) (seconds 3)) + (and (< (-> this spin-speed) 910.2222) (< (fabs (- (-> this spin-current) (-> this spin-dest))) 546.13336)) + ) + (neo-sat-method-209 this) + ) + ) + (else + (set! (-> this spin-dest) (-> this spin-current)) + ) + ) + ) + (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* (-> this spin-dest)) + (set! (-> this laser-rotate-angle) (seek (-> this laser-rotate-angle) 0.0 (* 16384.0 (seconds-per-frame)))) + ) + +;; WARN: Return type mismatch number vs float. +(defmethod get-damage-from-attack ((this neo-sat) (arg0 object) (arg1 event-message-block)) + (let ((v0-1 (the-as number (call-parent-method this arg0 arg1)))) + (if (logtest? (penetrate dark-bomb dark-smack) (-> (the-as attack-info (-> arg1 param 1)) penetrate-using)) + (set! v0-1 #x41f00000) + ) + (the-as float v0-1) + ) + ) + +(defmethod damage-enemy! ((this neo-sat) (arg0 object) (arg1 event-message-block)) + (let ((f30-0 (call-parent-method this arg0 arg1))) + (let ((f28-0 (-> this hit-points)) + (f26-0 (* 30.0 (- 3.0 (the float (+ (-> this current-stage) 1))))) + ) + (sound-play "sat-hit") + (when (>= f26-0 f28-0) + (if (= f28-0 0.0) + (setup-masks (-> this draw) 0 4) + ) + (set! f30-0 (- f30-0 (- f26-0 f28-0))) + (set! (-> this hit-points) f26-0) + (set! (-> this should-rise?) #t) + ) + ) + f30-0 + ) + ) + +(defstate neo-sat-sit-and-spin (neo-sat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('rise-up) + (+! (-> self current-stage) 1) + (cond + ((= (-> self current-stage) 3) + (+! (-> self current-stage) -1) + (set! (-> self was-spinning?) #t) + (go-virtual die) + ) + (else + (set! (-> self was-spinning?) #t) + (go-virtual ground-burst) + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self active-laser-index) 0) + (neo-sat-method-209 self) + (set-time! (-> self state-time)) + (set-time! (-> self new-spin-time)) + (sound-play "sat-whip-out") + (neo-sat-method-226 self 0) + (case (-> self current-stage) + ((1) + (neo-sat-method-226 self 3) + ) + ((2) + (neo-sat-method-226 self 2) + (neo-sat-method-226 self 4) + ) + ) + ) + :trans (behavior () + (neo-sat-method-210 self) + (neo-sat-method-211 self) + (neo-sat-method-228 self) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun sparticle-height-set ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((a0-3 (the-as neo-sat (handle->process (-> *alive-neo-sats* (shr (the int (-> arg1 omega)) 16))))) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) (-> arg2 x)) + (set! (-> a1-2 y) (-> arg2 y)) + (set! (-> a1-2 z) (-> arg2 z)) + (set! (-> a1-2 w) 1.0) + (when a0-3 + (set! (-> arg2 y) (neo-sat-method-218 a0-3 a1-2)) + (+! (-> arg2 y) 2048.0) + ) + ) + (none) + ) + +(defun spt-func-part-neo-sat-shockwave-hot ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (sparticle-2d-spline-align-instant arg0 arg1 (the-as sprite-vec-data-2d arg2)) + (sparticle-height-set arg0 arg1 (the-as vector arg2)) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun sparticle-shockwave-set ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((a0-3 (the-as neo-sat (handle->process (-> *alive-neo-sats* (shr (the int (-> arg1 omega)) 16))))) + (v1-7 #f) + ) + (if a0-3 + (set! v1-7 (neo-sat-method-223 + a0-3 + (-> arg2 launchrot) + (the-as int (-> arg1 user-float)) + (logand (the-as int (-> arg1 omega)) #xffff) + ) + ) + ) + (if (not v1-7) + (set! (-> arg2 coneradius) 0.0) + ) + ) + (none) + ) + +(defmethod neo-sat-method-223 ((this neo-sat) (arg0 vector) (arg1 int) (arg2 int)) + (let ((v1-1 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* (* 327.68 (the float arg1)))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((f0-3 (- (-> this current-shockwave-radius) (* 73728.0 (the float arg2))))) + (if (< 163840.0 f0-3) + (return #f) + ) + (vector+float*! s4-0 (-> this shockwave-origin) v1-1 f0-3) + ) + (set! (-> s4-0 y) (neo-sat-method-218 this s4-0)) + (set! (-> arg0 x) (-> s4-0 x)) + (set! (-> arg0 y) (-> s4-0 y)) + (set! (-> arg0 z) (-> s4-0 z)) + ) + #t + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod neo-sat-method-211 ((this neo-sat)) + (let ((s5-0 (+ (-> this current-stage) 1)) + (f30-0 73728.0) + ) + (let* ((f28-0 91.022224) + (f26-0 1092.2667) + (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-6 (the-as number (logior #x3f800000 v1-5))) + ) + (set! (-> this last-particle-rotate) + (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-6))) (-> this last-particle-rotate)) + ) + ) + (let ((f0-6 (-> this last-particle-rotate))) + (set! (-> this last-particle-rotate) (- f0-6 (* (the float (the int (/ f0-6 2366.578))) 2366.578))) + ) + (dotimes (s4-0 s5-0) + (let ((f0-9 (- (-> this current-shockwave-radius) (* f30-0 (the float s4-0))))) + (when (and (>= f0-9 16384.0) (< f0-9 163840.0)) + (new 'stack-no-clear 'vector) + (let ((f28-1 (- (-> this current-shockwave-radius) (* f30-0 (the float s4-0)))) + (s3-0 #f) + ) + (when (< (-> this last-spawned-ring-index) s4-0) + (sound-play "sat-shockwave") + (set! (-> this last-spawned-ring-index) s4-0) + (set! s3-0 #t) + ) + (dotimes (s2-1 20) + (let* ((f26-1 (+ (-> this last-particle-rotate) (* 3276.8 (the float s2-1)))) + (f24-0 -1638.4) + (f22-0 3276.8) + (v1-25 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-26 (the-as number (logior #x3f800000 v1-25))) + (f0-17 (+ f24-0 (* f22-0 (+ -1.0 (the-as float v1-26))) f26-1)) + (s0-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* f0-17)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s1-0 (-> this shockwave-origin) s0-0 f28-1) + (set! (-> s1-0 y) (neo-sat-method-218 this s1-0)) + (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (lerp 409.6 2457.6 (* 0.0000061035157 f28-1))) + (let* ((f26-2 (-> *part-id-table* 1679 init-specs 3 initial-valuef)) + (f24-1 1.0) + (v1-41 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-42 (the-as number (logior #x3f800000 v1-41))) + ) + (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (* f26-2 (+ f24-1 (+ -1.0 (the-as float v1-42))))) + ) + (let ((a2-4 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s0-0 *up-vector*))) + (set! (-> a2-4 trans quad) (-> s1-0 quad)) + (launch-particles (-> *part-id-table* 1679) a2-4 :origin-is-matrix #t) + ) + ) + ) + (when s3-0 + (dotimes (s3-2 100) + (let* ((f26-3 182.04445) + (f24-2 -1.8) + (f22-1 3.6) + (v1-57 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-58 (the-as number (logior #x3f800000 v1-57))) + (f0-34 (+ (* f26-3 (+ f24-2 (* f22-1 (+ -1.0 (the-as float v1-58))))) (* 655.36 (the float s3-2)))) + (s1-1 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* f0-34)) + (s2-2 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s2-2 (-> this shockwave-origin) s1-1 f28-1) + (set! (-> s2-2 y) (neo-sat-method-218 this s2-2)) + (let ((a2-7 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s1-1 *up-vector*))) + (set! (-> a2-7 trans quad) (-> s2-2 quad)) + (set! (-> *part-id-table* 1680 init-specs 9 initial-valuef) + (the-as float (shl (-> this global-neo-sat-index) 16)) + ) + (launch-particles (-> *part-id-table* 1680) a2-7 :origin-is-matrix #t) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> this last-shockwave-radius) (-> this current-shockwave-radius)) + (+! (-> this current-shockwave-radius) (* 102400.0 (seconds-per-frame))) + (dotimes (s4-1 (-> this num-yellow-ammo)) + (when (and (>= (-> this current-shockwave-radius) (-> this yellow-ammo-pos s4-1 dist)) + (< (-> this last-shockwave-radius) (-> this yellow-ammo-pos s4-1 dist)) + ) + (let ((s3-3 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* (-> this yellow-ammo-pos s4-1 angle))) + ) + (vector-normalize! s3-3 (-> this yellow-ammo-pos s4-1 dist)) + (vector+! s3-3 s3-3 (-> this shockwave-origin)) + (set! (-> s3-3 y) (neo-sat-method-218 this s3-3)) + (birth-pickup-at-point s3-3 (pickup-type ammo-yellow) 10.0 #t *entity-pool* (the-as fact-info #f)) + ) + ) + ) + (let ((f28-2 (vector-vector-xz-distance (-> this root trans) (-> this focus-pos))) + (s4-2 (the-as object #f)) + ) + (let* ((s3-4 (handle->process (-> this focus handle))) + (v1-98 (if (type? s3-4 process-focusable) + (the-as process-focusable s3-4) + ) + ) + ) + (when v1-98 + (let ((v1-99 (-> v1-98 root))) + (set! s4-2 (and v1-99 (logtest? (-> (the-as collide-shape-moving v1-99) status) (collide-status on-surface)))) + ) + ) + ) + (when s4-2 + (dotimes (s4-4 s5-0) + (let ((f0-46 (- (-> this current-shockwave-radius) (* f30-0 (the float s4-4))))) + (if (and (>= f0-46 16384.0) (< f0-46 163840.0) (>= f0-46 (+ -4096.0 f28-2)) (>= (+ 4096.0 f28-2) f0-46)) + (send-event + (handle->process (-> this focus handle)) + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'generic)) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defstate neo-sat-drill-impact (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-stop (-> self snd-hover)) + (activate! *camera-smush-control* 1228.8 45 240 1.0 0.9 (-> *display* camera-clock)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 229 (seconds 0.5)) + (send-event (handle->process (-> self warp-handle)) 'turn-off) + (cond + ((logtest? (-> *part-group-id-table* 418 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 418)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 418)) + ) + ) + (sound-play "sat-in-ground") + (set! (-> self root transv quad) (the-as uint128 0)) + (set! (-> self current-shockwave-radius) 16384.0) + (set-time! (-> self state-time)) + (logior! (-> self enemy-flags) (enemy-flag vulnerable)) + (set! (-> self last-spawned-ring-index) -1) + (let ((f0-2 (get-remaining-player-ammo (pickup-type ammo-yellow)))) + (set! (-> self num-yellow-ammo) 0) + (if (>= 55.0 f0-2) + (+! (-> self num-yellow-ammo) 1) + ) + (if (>= 35.0 f0-2) + (+! (-> self num-yellow-ammo) 1) + ) + (if (>= 15.0 f0-2) + (+! (-> self num-yellow-ammo) 1) + ) + (if (>= 5.0 f0-2) + (+! (-> self num-yellow-ammo) 1) + ) + ) + (dotimes (gp-3 (-> self num-yellow-ammo)) + (let* ((f30-0 65536.0) + (v1-70 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-71 (the-as number (logior #x3f800000 v1-70))) + (f30-1 (* f30-0 (+ -1.0 (the-as float v1-71)))) + (f28-0 32768.0) + (f26-0 49152.0) + (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-77 (the-as number (logior #x3f800000 v1-76))) + (f0-10 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-77))))) + ) + (set! (-> self yellow-ammo-pos gp-3 angle) f30-1) + (set! (-> self yellow-ammo-pos gp-3 dist) f0-10) + ) + ) + ) + :trans (behavior () + (neo-sat-method-211 self) + (let ((v1-2 450)) + (if (= (-> self current-stage) 2) + (set! v1-2 675) + ) + (if (time-elapsed? (-> self state-time) v1-2) + (go-virtual neo-sat-sit-and-spin) + ) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate neo-sat-drill-attack (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self ground-offset) 4096.0) + (set! (-> self desired-float-height) -163840.0) + (set! (-> self bob-speed-scalar) 1.0) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root transv quad) (the-as uint128 0)) + (set! (-> self desired-float-height) 16384.0) + (set! (-> self start-thrust-pos quad) (-> self root trans quad)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (neo-sat-method-220 self) + (let ((f30-0 (neo-sat-probe-ground self (-> self root trans)))) + (let ((a2-0 (new 'stack-no-clear 'vector))) + (set! (-> a2-0 quad) (-> self root trans quad)) + (set! (-> a2-0 y) (+ (-> self start-thrust-pos y) (-> self desired-float-height))) + (cond + ((< 0.0 (-> self desired-float-height)) + (let* ((f1-4 (* 0.008333334 (the float (- (current-time) (-> self state-time))))) + (f1-6 (fmax 0.0 (fmin 1.0 f1-4))) + (f28-0 (- 1.0 (* (- 1.0 f1-6) (- 1.0 f1-6)))) + ) + (vector-lerp! (-> self root trans) (-> self start-thrust-pos) a2-0 f28-0) + (when (>= f28-0 0.95) + (set! (-> self desired-float-height) -102400.0) + (set-time! (-> self state-time)) + (set! (-> self start-thrust-pos quad) (-> self root trans quad)) + ) + ) + ) + (else + (let* ((f1-11 (* 0.008333334 (the float (- (current-time) (-> self state-time))))) + (f0-10 (fmax 0.0 (fmin 1.0 f1-11))) + ) + (vector-lerp! (-> self root trans) (-> self start-thrust-pos) a2-0 f0-10) + ) + ) + ) + ) + (move-to-ground-height self f30-0) + ) + (if (-> self on-ground?) + (go-virtual neo-sat-drill-impact) + ) + (set! (-> self spin-current) 98304.0) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate neo-sat-laser-attack (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (neo-sat-method-207 self) + (set! (-> self hit-player?) #f) + (set! (-> self wander-generate-time) 0) + (let ((v1-4 (-> self current-stage))) + (cond + ((zero? v1-4) + (set! (-> self max-speed) 32768.0) + ) + ((= v1-4 1) + (set! (-> self max-speed) 36864.0) + ) + ((= v1-4 2) + (set! (-> self max-speed) 40960.0) + ) + ) + ) + (set! (-> self fly-speed-scalar) 10.0) + (set! (-> self was-doing-cone-check?) #f) + ) + :trans (behavior () + (if (-> self hit-player?) + (go-virtual hostile) + ) + (seek! (-> self anim-speed) 3.0 (* 0.15 (seconds-per-frame))) + (when (time-elapsed? (-> self wander-generate-time) (seconds 1.5)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *x-vector* quad)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector-normalize! s5-0 65536.0) + (vector-rotate-y! s5-0 s5-0 (-> self offset-angle)) + (let* ((f30-0 -16384.0) + (f28-0 32768.0) + (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-17 (the-as number (logior #x3f800000 v1-16))) + ) + (set! (-> self offset-angle) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-17))) (-> self offset-angle))) + ) + (set! (-> self offset-angle) (the float (sar (shl (the int (-> self offset-angle)) 48) 48))) + (set-time! (-> self wander-generate-time)) + (vector+! gp-0 (-> self focus-pos) s5-0) + (let ((v1-26 (-> self nav state))) + (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-26 target-pos quad) (-> gp-0 quad)) + ) + ) + ) + 0 + ) + (neo-sat-method-203 self #f) + (neo-sat-method-233 self) + (if (-> self was-doing-cone-check?) + (neo-sat-method-230 self) + ) + (neo-sat-method-220 self) + (neo-sat-method-201 self) + (let* ((v1-41 (-> self current-stage)) + (f30-1 (cond + ((zero? v1-41) + -10012.444 + ) + ((= v1-41 1) + -10922.667 + ) + (else + -11832.889 + ) + ) + ) + ) + (seek! (-> self laser-rotate-angle) f30-1 (* 1820.4445 (seconds-per-frame))) + (if (and (>= 182.04445 (fabs (- (-> self laser-rotate-angle) f30-1))) + (let ((v1-50 (- (current-time) (-> self state-time))) + (a0-22 (-> self current-stage)) + ) + (>= v1-50 (cond + ((zero? a0-22) + 600 + ) + ((= a0-22 1) + 900 + ) + (else + 1200 + ) + ) + ) + ) + ) + (go neo-sat-drill-halting) + ) + (let ((gp-1 #t)) + (when (< (-> self laser-rotate-angle) -9102.223) + (set! gp-1 #f) + (when (not (-> self was-doing-cone-check?)) + (set! (-> self was-doing-cone-check?) #t) + (set! (-> self was-player-inside-cone?) (neo-sat-method-232 self (target-pos 0))) + ) + ) + (dotimes (s5-2 (-> *neo-sat-laser-array* length)) + (neo-sat-method-206 self (-> *neo-sat-laser-array* s5-2 joint) gp-1) + ) + ) + (let ((f0-24 (lerp 16384.0 32768.0 (/ (fabs (-> self laser-rotate-angle)) (fabs f30-1))))) + (if (< 32585.955 f0-24) + (set! f0-24 (lerp 32768.0 49152.0 (* 0.00055555557 (the float (- (current-time) (-> self state-time)))))) + ) + (set! (-> self spin-current) f0-24) + ) + ) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate die (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self next-lightning-time) 0) + (sound-play "sat-out-ground") + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (logclear! (-> self focus-status) (focus-status dangerous)) + (cond + ((logtest? (-> *part-group-id-table* 420 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 420)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 420)) + ) + ) + (set-time! (-> self state-time)) + (when (-> self was-spinning?) + (set! (-> self was-spinning?) #f) + (sound-play "sat-whip-in") + ) + ) + :exit (behavior () + (dotimes (gp-0 (-> self ropes length)) + (rope-system-method-21 (-> self ropes gp-0)) + ) + ) + :trans (behavior () + (when (< (-> self next-lightning-time) (current-time)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 22) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 22) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + (set! (-> self next-lightning-time) (+ (current-time) (seconds 0.05))) + ) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) + (spawn + (-> self burst-dust-part) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node neo-satellite-lod0-jg arm_top_ring)) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.9)) + (dotimes (gp-1 (-> self ropes length)) + (rope-system-method-21 (-> self ropes gp-1)) + ) + ) + (neo-sat-method-228 self) + ) + :code (behavior () + (set! (-> self play-anim?) #f) + (ja-channel-push! 1 (seconds 0.1)) + (let ((hand (the-as handle #f))) + (let ((f28-0 -1.0)) + (ja-no-eval :group! neo-satellite-death-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((f30-0 (ja-frame-num 0))) + (let ((f0-4 43.0) + (f26-0 48.0) + ) + (if (and (< f28-0 f0-4) (>= f30-0 f0-4)) + (sound-play "sat-fall-hit") + ) + (when (and (< f28-0 f26-0) (>= f30-0 f26-0)) + (set! (-> self next-lightning-time) (+ (seconds 1000) (current-time))) + (sound-play "sat-explode") + (set! hand + (process->handle + (-> (cond + ((logtest? (-> *part-group-id-table* 427 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 427)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 427)) + ) + ) + 0 + ) + ) + ) + ) + ) + (set! f28-0 f30-0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (send-event (ppointer->process (-> self parent)) 'notify 'die) + (send-event (handle->process hand) 'die) + ) + (cond + ((logtest? (-> *part-group-id-table* 426 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 426)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 426)) + ) + ) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 0.25)) + (suspend) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (until (time-elapsed? gp-6 (seconds 1.5)) + (suspend) + ) + ) + (go-virtual die-fast) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate ground-burst (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-play "sat-out-ground") + (send-event (handle->process (-> self warp-handle)) 'turn-on) + (cond + ((logtest? (-> *part-group-id-table* 420 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 420)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 420)) + ) + ) + (let ((v1-40 self)) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logclear (-> v1-40 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-40 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (set! (-> self desired-float-height) 163840.0) + (set! (-> self bob-speed-scalar) 10.0) + (neo-sat-method-204 self) + (set! (-> self ground-offset) 4096.0) + (set-time! (-> self state-time)) + (logclear! (-> self focus-status) (focus-status dangerous)) + (when (-> self was-spinning?) + (set! (-> self was-spinning?) #f) + (sound-play "sat-whip-in") + ) + (sound-play "sat-hover" :id (-> self snd-hover)) + ) + :exit (behavior () + (dotimes (gp-0 (-> self ropes length)) + (rope-system-method-21 (-> self ropes gp-0)) + ) + ) + :trans (behavior () + (neo-sat-method-201 self) + (when (not (time-elapsed? (-> self state-time) (seconds 1))) + (let* ((f1-2 (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (f1-5 (- 1.0 (* (- 1.0 f1-2) (- 1.0 f1-2)))) + (f0-3 (- 1.0 (* (- 1.0 f1-5) (- 1.0 f1-5)))) + ) + (set! (-> *part-id-table* 1687 init-specs 2 initial-valuef) (fmax 0.0 (lerp 10.0 0.0 f0-3))) + ) + (spawn (-> self burst-dust-part) (-> self root trans)) + ) + (seek! (-> self desired-float-height) 49152.0 (* 327680.0 (seconds-per-frame))) + (neo-sat-method-228 self) + (if (time-elapsed? (-> self state-time) (seconds 1.5)) + (go-virtual hostile) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate hostile (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-play "sat-arms" :id (-> self snd-arms-chatter)) + (set! (-> self laser-rotate-angle) 0.0) + (sound-stop (-> self snd-laser-burn)) + (set! (-> self fly-speed-scalar) 1.0) + (set! (-> self max-speed) 204800.0) + (set! (-> self active-laser-index) -1) + (let ((v1-5 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-5 enemy-flags))) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-5 enemy-flags)))) + ) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-5 enemy-flags)))) + (set! (-> v1-5 nav callback-info) (-> v1-5 enemy-info callback-info)) + ) + 0 + (let ((v1-8 (-> self nav))) + (set! (-> v1-8 target-speed) 4096.0) + ) + 0 + (set-time! (-> self state-time)) + (set! (-> self hit-player?) #f) + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (set! (-> self wander-generate-time) 0) + (set! (-> self last-thrust-vec quad) (the-as uint128 0)) + (set! (-> self ground-offset) 40960.0) + (set! (-> self desired-float-height) 49152.0) + (set! (-> self bob-speed-scalar) 1.0) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! neo-satellite-active-ja :num! (loop!) :frame-num 0.0) + (set! (-> self anim-loop?) #t) + (set! (-> self play-anim?) #t) + (set! (-> self anim-speed) 0.6) + (neo-sat-method-204 self) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (sound-play "sat-hover" :id (-> self snd-hover)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *x-vector* quad)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector-normalize! s5-0 12288.0) + (vector-rotate-y! s5-0 s5-0 (-> self offset-angle)) + (when (time-elapsed? (-> self wander-generate-time) (seconds 2)) + (let* ((f30-0 -16384.0) + (f28-0 32768.0) + (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-11 (the-as number (logior #x3f800000 v1-10))) + ) + (set! (-> self offset-angle) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-11))) (-> self offset-angle))) + ) + (set! (-> self offset-angle) (the float (sar (shl (the int (-> self offset-angle)) 48) 48))) + (set-time! (-> self wander-generate-time)) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 4)) + (or (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 81920.0) + (time-elapsed? (-> self state-time) (seconds 7)) + ) + ) + (go-virtual neo-sat-laser-attack) + ) + (vector+! gp-0 (-> self focus-pos) s5-0) + (let ((v1-34 (-> self nav state))) + (logclear! (-> v1-34 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-34 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-34 target-pos quad) (-> gp-0 quad)) + ) + ) + ) + 0 + (neo-sat-method-200 self) + (neo-sat-method-201 self) + (neo-sat-method-233 self) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate sat-idle (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (spawn-shield self) + ) + :trans (behavior () + (if (< (vector-vector-distance (-> self root trans) (-> self focus-pos)) 491520.0) + (go-virtual ground-burst) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! neo-satellite-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod nav-enemy-method-161 ((this neo-sat) (arg0 nav-control)) + (when (logtest? (enemy-flag ef37) (-> this enemy-flags)) + (let ((a2-1 (-> arg0 state))) + (set! (-> this nav-vector quad) (-> a2-1 travel quad)) + ) + (vector-normalize! (-> this nav-vector) 1.0) + ) + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer neo-sat). +(defun spawn-neo-sat ((arg0 vector) (arg1 quaternion) (arg2 process)) + (let ((s5-0 (new 'stack-no-clear 'neo-sat-init-params))) + (set! (-> s5-0 pos quad) (-> arg0 quad)) + (quaternion-copy! (-> s5-0 quat) arg1) + (process-spawn neo-sat s5-0 :name "neo-sat" :to arg2 :stack-size #x14000) + ) + ) + +(defmethod normalize-heading! ((this neo-sat) (arg0 nav-control)) + 0 + (none) + ) + +(defmethod run-logic? ((this neo-sat)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod relocate ((this neo-sat) (offset int)) + (if (nonzero? (-> this tentacle)) + (&+! (-> this tentacle) offset) + ) + (dotimes (v1-4 (-> this ropes length)) + (if (nonzero? (-> this ropes v1-4)) + (&+! (-> this ropes v1-4) offset) + ) + ) + (if (nonzero? (-> this ropes)) + (&+! (-> this ropes) offset) + ) + (if (nonzero? (-> this damage-part1)) + (&+! (-> this damage-part1) offset) + ) + (if (nonzero? (-> this damage-part2)) + (&+! (-> this damage-part2) offset) + ) + (if (nonzero? (-> this damage-part3)) + (&+! (-> this damage-part3) offset) + ) + (if (nonzero? (-> this burst-dust-part)) + (&+! (-> this burst-dust-part) offset) + ) + (if (nonzero? (-> this antenna-explode-part)) + (&+! (-> this antenna-explode-part) offset) + ) + (call-parent-method this offset) + ) + +(defpart 1712 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 1713 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 1714 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; WARN: Function (method 227 neo-sat) has a return type of none, but the expression builder found a return statement. +(defmethod neo-sat-method-227 ((this neo-sat) (arg0 int)) + (if (or (not (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin))) + (not (time-elapsed? (-> this state-time) (seconds 1.5))) + ) + (return 0) + ) + (let ((s5-0 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) + (dotimes (s4-0 (+ (-> s5-0 knots length) -1)) + (let ((v1-18 (-> s5-0 knots data s4-0)) + (a0-8 (-> s5-0 knots data (+ s4-0 1))) + (s3-0 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> s3-0 start-pos quad) (-> v1-18 pos quad)) + (vector-! (-> s3-0 move-dist) (the-as vector a0-8) (the-as vector v1-18)) + (let ((v1-19 s3-0)) + (set! (-> v1-19 radius) 40.96) + (set! (-> v1-19 collide-with) (collide-spec jak player-list)) + (set! (-> v1-19 ignore-process0) this) + (set! (-> v1-19 ignore-process1) #f) + (set! (-> v1-19 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-19 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) + (if (>= f0-1 0.0) + (vector-float*! (-> s3-0 move-dist) (-> s3-0 move-dist) f0-1) + (set! (-> s3-0 best-other-tri collide-ptr) #f) + ) + ) + (cond + ((and (-> s3-0 best-other-tri collide-ptr) (let ((s2-0 (-> s3-0 best-other-tri collide-ptr))) + (if (type? s2-0 collide-shape-prim-sphere) + s2-0 + ) + ) + ) + (let* ((s2-1 (-> s3-0 best-other-tri collide-ptr)) + (s2-2 (-> (the-as collide-shape-prim-sphere (if (type? s2-1 collide-shape-prim-sphere) + (the-as collide-shape-prim-sphere s2-1) + ) + ) + cshape + process + ) + ) + (s1-0 (the-as object #f)) + ) + (let* ((s0-0 s2-2) + (v1-29 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when v1-29 + (let ((v1-30 (-> v1-29 root))) + (set! s1-0 (and v1-30 (logtest? (-> (the-as collide-shape-moving v1-30) status) (collide-status on-surface)))) + ) + ) + ) + (when s1-0 + (send-event + s2-2 + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'generic)) + ) + ) + (send-event this 'notify 'attack s2-2) + ) + ) + (vector-normalize! (-> s3-0 move-dist) (+ 2048.0 (vector-length (-> s3-0 move-dist)))) + ) + (else + (set! (-> *part-id-table* 1714 init-specs 2 initial-valuef) 4096.0) + ) + ) + (set! (-> *part-id-table* 1712 init-specs 4 initial-valuef) (vector-length (-> s3-0 move-dist))) + ) + ) + ) + (none) + ) + +(defmethod neo-sat-method-206 ((this neo-sat) (arg0 int) (arg1 symbol)) + (let ((v1-2 (the int (* 75.0 (/ 65536.0 (-> this spin-current)))))) + (when (time-elapsed? (-> this last-play-laser-time) v1-2) + (sound-play "sat-laser") + (set-time! (-> this last-play-laser-time)) + ) + ) + (sound-play "sat-ground-burn" :id (-> this snd-laser-burn)) + (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0))) + (s4-1 (new 'stack-no-clear 'vector)) + (f30-0 491520.0) + (s2-1 (if arg1 + 1091 + 65 + ) + ) + ) + (set! (-> s4-1 quad) (-> this node-list data arg0 bone transform fvec quad)) + (vector-normalize! s4-1 1.0) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> s5-1 quad)) + (vector-float*! (-> s3-1 move-dist) s4-1 f30-0) + (let ((v1-16 s3-1)) + (set! (-> v1-16 radius) 4096.0) + (set! (-> v1-16 collide-with) (the-as collide-spec s2-1)) + (set! (-> v1-16 ignore-process0) this) + (set! (-> v1-16 ignore-process1) #f) + (set! (-> v1-16 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-16 action-mask) (collide-action solid)) + ) + (let ((f0-4 (fill-and-probe-using-line-sphere *collide-cache* s3-1))) + (if (>= f0-4 0.0) + (vector-float*! (-> s3-1 move-dist) (-> s3-1 move-dist) f0-4) + (set! (-> s3-1 best-other-tri collide-ptr) #f) + ) + ) + (cond + ((and (-> s3-1 best-other-tri collide-ptr) (let ((s2-2 (-> s3-1 best-other-tri collide-ptr))) + (if (type? s2-2 collide-shape-prim-sphere) + s2-2 + ) + ) + ) + (let* ((s2-3 (-> s3-1 best-other-tri collide-ptr)) + (s2-4 (-> (the-as collide-shape-prim-sphere (if (type? s2-3 collide-shape-prim-sphere) + (the-as collide-shape-prim-sphere s2-3) + ) + ) + cshape + process + ) + ) + ) + (send-event + s2-4 + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'shock)) + ) + ) + (send-event this 'notify 'attack s2-4) + ) + (vector-normalize! (-> s3-1 move-dist) (+ 2048.0 (vector-length (-> s3-1 move-dist)))) + ) + (else + (set! (-> *part-id-table* 1714 init-specs 2 initial-valuef) 4096.0) + ) + ) + (vector+float*! (-> s3-1 move-dist) (-> s3-1 move-dist) s4-1 4096.0) + (set! (-> *part-id-table* 1712 init-specs 4 initial-valuef) (vector-length (-> s3-1 move-dist))) + (draw-beam (-> *part-id-table* 1712) s5-1 (-> s3-1 move-dist) #f) + (let ((gp-1 (matrix-f-u-compose + (new 'stack-no-clear 'matrix) + (vector-cross! (new 'stack-no-clear 'vector) s4-1 *up-vector*) + *up-vector* + ) + ) + ) + (vector+! (-> gp-1 trans) (-> s3-1 move-dist) s5-1) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 1681) gp-1 :origin-is-matrix #t) + (launch-particles (-> *part-id-table* 1683) gp-1 :origin-is-matrix #t) + (launch-particles (-> *part-id-table* 1684) gp-1 :origin-is-matrix #t) + ) + ) + ) + (none) + ) + +(defmethod neo-sat-method-212 ((this neo-sat) (arg0 vector) (arg1 vector)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this shockwave-origin)))) + (set! (-> arg1 x) (+ 163840.0 (-> v1-1 x))) + (set! (-> arg1 y) (+ 163840.0 (-> v1-1 z))) + ) + arg1 + ) + +(defmethod neo-sat-method-215 ((this neo-sat) (arg0 float)) + (* 0.000108506945 arg0) + ) + +(defmethod neo-sat-method-216 ((this neo-sat) (arg0 float)) + (* 0.000108506945 arg0) + ) + +(defmethod neo-sat-method-213 ((this neo-sat) (arg0 float)) + 0 + (let ((a0-1 (the int (neo-sat-method-215 this arg0)))) + (max 0 (min 34 a0-1)) + ) + ) + +(defmethod neo-sat-method-214 ((this neo-sat) (arg0 float)) + 0 + (let ((a0-1 (the int (neo-sat-method-216 this arg0)))) + (max 0 (min 34 a0-1)) + ) + ) + +(defmethod neo-sat-method-217 ((this neo-sat) (arg0 int) (arg1 int)) + (+ arg0 (* 35 arg1)) + ) + +(defun compute-xz-pos ((arg0 neo-sat) (arg1 int) (arg2 int) (arg3 vector)) + (let ((f0-1 (+ -163840.0 (* 9216.0 (the float arg1)))) + (f1-3 (+ -163840.0 (* 9216.0 (the float arg2)))) + (v1-4 (new 'stack-no-clear 'vector)) + ) + (set-vector! v1-4 f0-1 0.0 f1-3 1.0) + (vector+! arg3 (-> arg0 shockwave-origin) v1-4) + ) + arg3 + ) + +(defmethod neo-sat-method-218 ((this neo-sat) (arg0 vector)) + (local-vars (sv-32 int) (sv-40 int) (sv-48 int) (sv-56 int)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (neo-sat-method-212 this arg0 s5-0) + (set! sv-32 (neo-sat-method-213 this (-> s5-0 x))) + (set! sv-40 (neo-sat-method-213 this (+ 9216.0 (-> s5-0 x)))) + (set! sv-48 (neo-sat-method-214 this (-> s5-0 y))) + (set! sv-56 (neo-sat-method-214 this (+ 9216.0 (-> s5-0 y)))) + (let* ((f26-0 (-> this hashed-heights (neo-sat-method-217 this sv-32 sv-48))) + (f24-0 (-> this hashed-heights (neo-sat-method-217 this sv-32 sv-56))) + (f30-0 (-> this hashed-heights (neo-sat-method-217 this sv-40 sv-48))) + (f28-0 (-> this hashed-heights (neo-sat-method-217 this sv-40 sv-56))) + (f26-1 (lerp-scale f26-0 f24-0 (neo-sat-method-216 this (-> s5-0 y)) (the float sv-48) (the float sv-56))) + (f0-16 (lerp-scale f30-0 f28-0 (neo-sat-method-216 this (-> s5-0 y)) (the float sv-48) (the float sv-56))) + ) + (lerp-scale f26-1 f0-16 (neo-sat-method-215 this (-> s5-0 x)) (the float sv-32) (the float sv-40)) + ) + ) + ) + +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +(defmethod neo-sat-method-222 ((this neo-sat) (arg0 object) (arg1 vector)) + (local-vars (sv-16 float) (sv-32 float) (sv-48 float) (sv-64 float)) + (let* ((s4-0 (neo-sat-method-213 this (-> arg1 x))) + (s3-0 (neo-sat-method-213 this (+ 9216.0 (-> arg1 x)))) + (s2-0 (neo-sat-method-214 this (-> arg1 y))) + (s1-0 (neo-sat-method-214 this (+ 9216.0 (-> arg1 y)))) + (f26-0 (-> this hashed-heights (neo-sat-method-217 this s4-0 s2-0))) + (f24-0 (-> this hashed-heights (neo-sat-method-217 this s4-0 s1-0))) + (f30-0 (-> this hashed-heights (neo-sat-method-217 this s3-0 s2-0))) + (f28-0 (-> this hashed-heights (neo-sat-method-217 this s3-0 s1-0))) + (s0-0 lerp-scale) + ) + (set! sv-16 f26-0) + (set! sv-32 f24-0) + (let* ((a2-5 (neo-sat-method-216 this (-> arg1 y))) + (a3-0 (the float s2-0)) + (t0-0 (the float s1-0)) + (f26-1 (s0-0 sv-16 sv-32 a2-5 a3-0 t0-0)) + (s0-1 lerp-scale) + ) + (set! sv-48 f30-0) + (set! sv-64 f28-0) + (let* ((a2-6 (neo-sat-method-216 this (-> arg1 y))) + (a3-1 (the float s2-0)) + (t0-1 (the float s1-0)) + (f0-20 (s0-1 sv-48 sv-64 a2-6 a3-1 t0-1)) + ) + (lerp-scale f26-1 f0-20 (neo-sat-method-215 this (-> arg1 x)) (the float s4-0) (the float s3-0)) + ) + ) + ) + ) + +(defmethod deactivate ((this neo-sat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set! (-> *alive-neo-sats* (-> this global-neo-sat-index)) (the-as handle #f)) + (dotimes (s5-0 3) + (sound-stop (-> this snd-whips-loop s5-0)) + ) + (sound-stop (-> this snd-laser-burn)) + (sound-stop (-> this snd-arms-chatter)) + (sound-stop (-> this snd-hover)) + (if (nonzero? (-> this damage-part1)) + (kill-particles (-> this damage-part1)) + ) + (if (nonzero? (-> this damage-part2)) + (kill-particles (-> this damage-part2)) + ) + (if (nonzero? (-> this damage-part3)) + (kill-particles (-> this damage-part3)) + ) + (if (nonzero? (-> this burst-dust-part)) + (kill-particles (-> this burst-dust-part)) + ) + (if (nonzero? (-> this antenna-explode-part)) + (kill-particles (-> this antenna-explode-part)) + ) + (call-parent-method this) + (none) + ) + +(defmethod neo-sat-method-221 ((this neo-sat)) + (let ((s5-0 0) + (s4-0 1224) + ) + (while (>= s4-0 s5-0) + (let ((a1-0 (mod s5-0 35)) + (a2-0 (/ s5-0 35)) + ) + (+ 16384.0 (* 9216.0 (the float a1-0))) + (let ((s3-0 (compute-xz-pos this a1-0 a2-0 (new 'stack-no-clear 'vector)))) + (new 'stack-no-clear 'vector) + (set! (-> s3-0 y) (neo-sat-method-218 this s3-0)) + (add-debug-x #t (bucket-id debug) s3-0 *color-blue*) + (set! (-> s3-0 y) (-> this hashed-heights s5-0)) + ) + ) + (+! s5-0 1) + ) + ) + #f + ) + +(defmethod neo-sat-method-220 ((this neo-sat)) + (dotimes (s5-0 8) + (if (>= (-> this current-height-probe-index) 1225) + (return 0) + ) + (let* ((a1-0 (mod (-> this current-height-probe-index) 35)) + (a2-0 (/ (-> this current-height-probe-index) 35)) + (s4-0 (compute-xz-pos this a1-0 a2-0 (new 'stack-no-clear 'vector))) + (f0-0 (neo-sat-probe-ground this s4-0)) + ) + (set! (-> this hashed-heights (-> this current-height-probe-index)) f0-0) + (set! (-> s4-0 y) f0-0) + ) + (+! (-> this current-height-probe-index) 1) + ) + (the-as int #f) + ) + +(defun neo-sat-inside-cone? ((arg0 vector) (arg1 float) (arg2 vector) (arg3 vector)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg3 arg0))) + 0.0 + (vector-normalize! s5-1 1.0) + (let ((f0-2 (vector-dot arg2 s5-1))) + (< (acos f0-2) (- 16384.0 arg1)) + ) + ) + ) + +(defmethod neo-sat-method-232 ((this neo-sat) (arg0 vector)) + (let* ((s2-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> *neo-sat-laser-array* 0 joint))) + ) + (f28-0 (vector-vector-xz-distance (-> this root trans) s2-0)) + (f30-0 (fabs (-> this laser-rotate-angle))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (let ((s3-1 (vector-float*! (new 'stack-no-clear 'vector) *up-vector* -1.0))) + (let ((f0-4 (* f28-0 (tan f30-0)))) + (set-vector! s4-0 (-> this root trans x) (+ (-> s2-0 y) f0-4) (-> this root trans z) 1.0) + ) + (neo-sat-inside-cone? s4-0 f30-0 s3-1 arg0) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod neo-sat-method-230 ((this neo-sat)) + (let ((s4-0 (-> this was-player-inside-cone?)) + (s5-1 (neo-sat-method-232 this (target-pos 0))) + ) + (let ((v1-1 s5-1)) + (when (or (and s4-0 (not v1-1)) (and v1-1 (not s4-0))) + (send-event + (handle->process (-> this focus handle)) + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'shock)) + ) + ) + (send-event this 'notify 'attack (handle->process (-> this focus handle))) + ) + ) + (set! (-> this was-player-inside-cone?) s5-1) + ) + (none) + ) + +(defskelgroup skel-neo-sat-shield neo-satellite-shield neo-satellite-shield-lod0-jg neo-satellite-shield-idle-ja + ((neo-satellite-shield-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +(deftype neo-sat-shield (process-drawable) + () + (:state-methods + active + turning-on + turning-off + hit + disabled + ) + (:methods + (neo-sat-shield-method-25 (_type_) none) + ) + ) + + +;; WARN: Return type mismatch quaternion vs none. +(defmethod neo-sat-shield-method-25 ((this neo-sat-shield)) + (let* ((s5-0 (ppointer->process (-> this parent))) + (a0-2 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (set! (-> this root trans quad) (-> (the-as process-focusable a0-2) root trans quad)) + ) + (quaternion-identity! (-> this root quat)) + (let ((s5-1 (-> (math-camera-matrix) fvec))) + 0.0 + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let ((f0-2 (vector-y-angle s5-1))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (+ 32768.0 f0-2)) + ) + ) + (none) + ) + +(defstate hit (neo-sat-shield) + :virtual #t + :trans (behavior () + (neo-sat-shield-method-25 self) + ) + :code (behavior () + (ja-no-eval :group! neo-satellite-shield-hit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual active) + ) + :post (behavior () + (ja-post) + ) + ) + +(defstate turning-off (neo-sat-shield) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> self draw force-fade) (the-as uint 0)) + 0 + ) + :trans (behavior () + (neo-sat-shield-method-25 self) + ) + :code (behavior () + (ja-no-eval :group! neo-satellite-shield-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((f0-6 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (set! (-> self draw force-fade) (the-as uint (the int (lerp 0.0 128.0 f0-6)))) + ) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self draw force-fade) (the-as uint 128)) + (go-virtual disabled) + ) + :post (behavior () + (ja-post) + ) + ) + +(defstate turning-on (neo-sat-shield) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status force-fade warp-cross-fade)) + ) + :trans (behavior () + (neo-sat-shield-method-25 self) + ) + :code (behavior () + (ja-no-eval :group! neo-satellite-shield-start-ja :num! (seek! max 0.3) :frame-num 0.0) + (until (ja-done? 0) + (let ((f0-6 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (set! (-> self draw force-fade) (the-as uint (the int (lerp 128.0 0.0 f0-6)))) + ) + (suspend) + (ja :num! (seek! max 0.3)) + ) + (set! (-> self draw force-fade) (the-as uint 0)) + (go-virtual active) + ) + :post (behavior () + (ja-post) + ) + ) + +(defstate disabled (neo-sat-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('turn-on) + (go-virtual turning-on) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :code sleep-code + ) + +(defstate active (neo-sat-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hit) + (go-virtual hit) + ) + (('turn-off) + (go-virtual turning-off) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> self draw force-fade) (the-as uint 0)) + 0 + ) + :trans (behavior () + (neo-sat-shield-method-25 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! neo-satellite-shield-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + ) + ) + +(defbehavior neo-sat-shield-init-by-other neo-sat-shield () + (stack-size-set! (-> self main-thread) 64) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-sat-shield" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go-virtual active) + ) + +(defmethod spawn-shield ((this neo-sat)) + (set! (-> this warp-handle) (the-as handle #f)) + (let ((s5-0 (get-process *default-dead-pool* neo-sat-shield #x4000 1))) + (set! (-> this warp-handle) + (process->handle + (-> (when s5-0 + (let ((t9-1 (method-of-type neo-sat-shield activate))) + (t9-1 (the-as neo-sat-shield s5-0) this "neo-sat-shield" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 neo-sat-shield-init-by-other) + (-> s5-0 ppointer) + ) + 0 + ) + ) + ) + ) + (none) + ) + +(defmethod get-trans ((this neo-sat) (arg0 int)) + "Get the `trans` for this process." + (cond + ((= arg0 3) + (vector+float*! *neo-sat-focus-pos* (-> this root trans) *up-vector* 12288.0) + *neo-sat-focus-pos* + ) + (else + (call-parent-method this arg0) + ) + ) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this neo-sat)) + (let ((v0-0 0)) + (if (!= (-> this hit-points) 0.0) + (set! v0-0 (logior (logior v0-0 16) 8)) + ) + (the-as search-info-flag v0-0) + ) + ) diff --git a/goal_src/jak3/levels/desert/rescue/rope-prim-system-h.gc b/goal_src/jak3/levels/desert/rescue/rope-prim-system-h.gc index 9cd171ed66..d368f0f7fc 100644 --- a/goal_src/jak3/levels/desert/rescue/rope-prim-system-h.gc +++ b/goal_src/jak3/levels/desert/rescue/rope-prim-system-h.gc @@ -7,3 +7,25 @@ ;; DECOMP BEGINS +(deftype rope-joint-system (rope-system) + ((info rope-joint-system-info) + (joint-mods joint-mod-world-array) + (proc handle) + ) + (:methods + (init (_type_ rope-joint-system-info process-drawable) symbol) + ) + ) + + +(deftype rope-prim-system (rope-system) + ((strip1 prim-strip) + (strip2 prim-strip) + (width float) + (alpha float) + (uv-repeat-dist float) + ) + (:methods + (add-prim-vert (_type_ prim-strip vector rgba float float) none) + ) + ) diff --git a/goal_src/jak3/levels/desert/rescue/rope-prim-system.gc b/goal_src/jak3/levels/desert/rescue/rope-prim-system.gc index 88738a71fa..691668857e 100644 --- a/goal_src/jak3/levels/desert/rescue/rope-prim-system.gc +++ b/goal_src/jak3/levels/desert/rescue/rope-prim-system.gc @@ -7,3 +7,314 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch float vs object. +(defmethod init! ((this rope-prim-system) (arg0 int)) + (call-parent-method this arg0) + (set! (-> this strip1) + (new 'process 'prim-strip (* arg0 4) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)) + ) + (set! (-> this strip2) + (new 'process 'prim-strip (* arg0 4) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)) + ) + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (set! (-> this alpha) 1.0) + (set! (-> this uv-repeat-dist) 40960000.0) + (set! (-> this width) 1228.8) + ) + +(define *rope-prim-alpha-blend* (new 'static 'gs-alpha :b #x1 :d #x1)) + +(defmethod rope-system-method-19 ((this rope-prim-system)) + (local-vars + (sv-112 vector) + (sv-116 vector) + (sv-120 matrix) + (sv-124 float) + (sv-128 float) + (sv-132 float) + (sv-136 float) + (sv-240 vector) + (sv-244 vector) + (sv-248 vector) + (sv-252 vector) + (sv-256 object) + (sv-260 rgbaf) + ) + (let ((f30-0 0.0)) + 0.0 + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (set! (-> this strip1 alpha) *rope-prim-alpha-blend*) + (set! (-> this strip2 alpha) *rope-prim-alpha-blend*) + (set! (-> this strip1 adnops 0 cmds) (gs-reg64 hack)) + (set! (-> this strip1 data0) (new 'static 'gs-test)) + (set! (-> this strip2 adnops 0 cmds) (gs-reg64 hack)) + (set! (-> this strip2 data0) (new 'static 'gs-test)) + (logior! (-> this strip1 flags) (prim-flags fog-enable)) + (logior! (-> this strip2 flags) (prim-flags fog-enable)) + (dotimes (s5-0 (-> this knots length)) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! sv-116 (new 'stack-no-clear 'vector)) + (set! sv-120 (new 'stack-no-clear 'matrix)) + (set! sv-124 (-> this width)) + (set! sv-128 (-> this alpha)) + (set! sv-132 (the-as float 0.0)) + (set! sv-136 (the-as float 0.0)) + (set! (-> sv-112 quad) (-> this knots data s5-0 pos quad)) + (cond + ((< s5-0 (+ (-> this knots length) -1)) + (vector-! sv-116 (the-as vector (-> this knots data (+ s5-0 1))) sv-112) + (set! sv-136 (vector-vector-distance sv-112 (the-as vector (-> this knots data (+ s5-0 1))))) + ) + (else + (vector-! sv-116 sv-112 (the-as vector (-> this knots data (+ s5-0 -1)))) + ) + ) + (let ((f0-7 (/ f30-0 (-> this uv-repeat-dist)))) + (set! sv-132 (- f0-7 (* (the float (the int (/ f0-7 6.0))) 6.0))) + ) + (vector-normalize! sv-116 1.0) + (matrix-f-u-compose sv-120 sv-116 *up-vector*) + (set! sv-240 (vector+float*! (new 'stack-no-clear 'vector) sv-112 (-> sv-120 rvec) (* 0.5 sv-124))) + (set! sv-244 (vector+float*! (new 'stack-no-clear 'vector) sv-112 (-> sv-120 rvec) (* -0.5 sv-124))) + (set! sv-248 (vector+float*! (new 'stack-no-clear 'vector) sv-112 (-> sv-120 uvec) (* 0.5 sv-124))) + (set! sv-252 (vector+float*! (new 'stack-no-clear 'vector) sv-112 (-> sv-120 uvec) (* -0.5 sv-124))) + (set! sv-256 (new 'stack-no-clear 'rgbaf)) + (set! sv-260 (new 'stack-no-clear 'rgbaf)) + (set! (-> sv-260 x) 1.0) + (set! (-> sv-260 y) 1.0) + (set! (-> sv-260 z) 1.0) + (set! (-> sv-260 w) sv-128) + (set! sv-256 (rgba<-rgbaf (the-as rgba sv-256) sv-260)) + (add-prim-vert this (-> this strip1) sv-240 (the-as rgba sv-256) 0.0 sv-132) + (add-prim-vert this (-> this strip1) sv-244 (the-as rgba sv-256) 1.0 sv-132) + (add-prim-vert this (-> this strip2) sv-248 (the-as rgba sv-256) 1.0 sv-132) + (add-prim-vert this (-> this strip2) sv-252 (the-as rgba sv-256) 0.0 sv-132) + (+! f30-0 sv-136) + ) + ) + 1 + (call-parent-method this) + ) + +(defmethod add-prim-vert ((this rope-prim-system) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) + (when (< (-> arg0 num-verts) (-> arg0 allocated-num-verts)) + (let ((v1-5 (-> arg0 data (-> arg0 num-verts)))) + (set! (-> v1-5 pos quad) (-> arg1 quad)) + (set! (-> v1-5 col) arg2) + (set! (-> v1-5 stq x) arg3) + (set! (-> v1-5 stq y) arg4) + ) + (+! (-> arg0 num-verts) 1) + ) + 0 + (none) + ) + +(defmethod relocate ((this rope-prim-system) (offset int)) + (if (nonzero? (-> this strip1)) + (&+! (-> this strip1) offset) + ) + (if (nonzero? (-> this strip2)) + (&+! (-> this strip2) offset) + ) + (call-parent-method this offset) + ) + +(defmethod rope-system-method-21 ((this rope-prim-system)) + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (call-parent-method this) + ) + +(defmethod init ((this rope-joint-system) (arg0 rope-joint-system-info) (arg1 process-drawable)) + (set! (-> this info) arg0) + (set! (-> this proc) (process->handle arg1)) + (let ((s4-0 (-> arg0 joint-info-array length))) + (init! this s4-0) + (set! (-> this joint-mods) (new 'process 'joint-mod-world-array s4-0)) + ) + (let ((a3-0 0) + (s4-1 0) + (s3-0 (+ (-> this joint-mods length) -1)) + ) + (while (>= s3-0 s4-1) + (init + (-> this joint-mods data s4-1) + arg1 + (the-as uint (-> this info joint-info-array s4-1 joint-index)) + (the-as joint-mod-base-flags a3-0) + ) + (set! a3-0 1) + (+! s4-1 1) + ) + ) + (dotimes (s4-2 (-> this knot-constraints length)) + (let ((s3-1 (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> arg1 node-list data (-> this info joint-info-array s4-2 joint-index)) + ) + ) + (a1-12 (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> arg1 node-list data (-> this info joint-info-array (+ s4-2 1) joint-index)) + ) + ) + ) + (set! (-> this knot-constraints data s4-2 length) (vector-vector-distance s3-1 a1-12)) + ) + ) + (dotimes (s4-3 (-> this joint-mods length)) + (let ((v1-44 + (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> arg1 node-list data (-> this info joint-info-array s4-3 joint-index)) + ) + ) + ) + (set! (-> this knots data s4-3 pos quad) (-> v1-44 quad)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> this knots data 0 prev-pos)) (* s4-3 64)))) + (-> v1-44 quad) + ) + ) + (when #t + (let ((s3-2 (-> this joint-mods data s4-3))) + (matrix->transformq + (-> s3-2 transform) + (-> arg1 node-list data (-> this info joint-info-array s4-3 joint-index) bone transform) + ) + (matrix->scale + (-> arg1 node-list data (-> this info joint-info-array s4-3 joint-index) bone transform) + (-> s3-2 transform scale) + ) + ) + ) + ) + #f + ) + +(defmethod relocate ((this rope-joint-system) (offset int)) + (if (nonzero? (-> this joint-mods)) + (&+! (-> this joint-mods) offset) + ) + (call-parent-method this offset) + ) + +(defmethod rope-system-method-10 ((this rope-joint-system)) + (call-parent-method this) + (let ((v1-1 (handle->process (-> this proc)))) + (vector<-cspace! + (the-as vector (-> this knots data)) + (-> (the-as process-drawable v1-1) node-list data (-> this info joint-info-array 0 joint-index)) + ) + ) + (let ((v0-3 (-> this knots data 0 prev-pos))) + (set! (-> v0-3 quad) (-> this knots data 0 pos quad)) + v0-3 + ) + ) + +(defmethod rope-system-method-19 ((this rope-joint-system)) + (local-vars (sv-288 vector)) + (call-parent-method this) + (let* ((s5-0 (-> this joint-mods data)) + (s4-0 (handle->process (-> this proc))) + (s3-0 (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable s4-0) + node-list + data + (-> this info joint-info-array 0 joint-index) + bone + transform + fvec + ) + 1.0 + ) + ) + (s2-0 (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (the-as vector (-> (the-as process-drawable s4-0) + node-list + data + (-> this info joint-info-array 0 joint-index) + bone + transform + ) + ) + 1.0 + ) + ) + ) + (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable s4-0) + node-list + data + (-> this info joint-info-array 0 joint-index) + bone + transform + uvec + ) + 1.0 + ) + (matrix->quaternion (-> s5-0 0 transform quat) (matrix-fr-compose (new 'stack-no-clear 'matrix) s3-0 s2-0)) + ) + (let ((s5-2 1) + (s4-2 (+ (-> this joint-mods length) -1)) + ) + (while (>= s4-2 s5-2) + (let ((v1-18 (-> this knots data (+ s5-2 -1))) + (a0-15 (-> this knots data s5-2)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (vector-! s2-1 (the-as vector a0-15) (the-as vector v1-18)) + (vector-normalize! s2-1 1.0) + (let ((s3-1 (-> this joint-mods data s5-2))) + (let ((s1-0 matrix-u-f-compose) + (s0-0 (new 'stack-no-clear 'matrix)) + ) + (set! sv-288 s2-1) + (let* ((a2-4 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-1 transform quat))) + (a1-28 (s1-0 s0-0 sv-288 a2-4)) + ) + (matrix->quaternion (-> s3-1 transform quat) a1-28) + ) + ) + (quaternion-normalize! (-> s3-1 transform quat)) + (let* ((v1-24 (-> this joint-mods data (+ s5-2 -1))) + (s1-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> v1-24 transform quat))) + (s0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-1 transform quat))) + ) + (vector-flatten! s1-1 s1-1 s2-1) + (vector-normalize! s1-1 1.0) + (let ((s2-3 (vector-cross! (new 'stack-no-clear 'vector) s0-1 s1-1)) + (f30-0 (vector-dot s0-1 s1-1)) + (s1-2 (new 'stack-no-clear 'quaternion)) + ) + (vector-normalize! s2-3 1.0) + (let ((f0-1 (acos f30-0))) + (when #t + (quaternion-vector-angle! s1-2 s2-3 f0-1) + (quaternion*! (-> s3-1 transform quat) s1-2 (-> s3-1 transform quat)) + (quaternion-normalize! (-> s3-1 transform quat)) + ) + ) + ) + ) + ) + ) + (+! s5-2 1) + ) + ) + (let ((v1-31 0) + (a0-35 (+ (-> this joint-mods length) -1)) + ) + (while (>= a0-35 v1-31) + (set! (-> this joint-mods data v1-31 transform trans quad) (-> this knots data v1-31 pos quad)) + (+! v1-31 1) + ) + ) + #f + ) diff --git a/goal_src/jak3/levels/desert/rescue/rope-system-h.gc b/goal_src/jak3/levels/desert/rescue/rope-system-h.gc index 7544db2fd9..7dd7959afb 100644 --- a/goal_src/jak3/levels/desert/rescue/rope-system-h.gc +++ b/goal_src/jak3/levels/desert/rescue/rope-system-h.gc @@ -5,5 +5,105 @@ ;; name in dgo: rope-system-h ;; dgos: DESRESC +;; +++rope-system-flag +(defenum rope-system-flag + :type uint64 + :bitfield #t + (rs0 0) + (rs1 1) + (rs2 2) + (rs3 3) + (rs4 4) + (rs5 5) + (rs6 6) + ) +;; ---rope-system-flag + + ;; DECOMP BEGINS +(deftype rope-knot (structure) + ((pos vector :inline) + (prev-pos vector :inline) + (force vector :inline) + (mass float) + ) + ) + + +(deftype rope-knot-constraint (structure) + ((dir vector :inline) + (length float) + (max-angle float) + (rest-seek-rate float) + (constrained-angle-time time-frame) + ) + ) + + +(deftype rope-knot-constraint-array (inline-array-class) + ((data rope-knot-constraint :inline :dynamic) + ) + ) + + +(set! (-> rope-knot-constraint-array heap-base) (the-as uint 48)) + +(deftype rope-knot-array (inline-array-class) + ((data rope-knot :inline :dynamic) + ) + ) + + +(set! (-> rope-knot-array heap-base) (the-as uint 64)) + +(deftype rope-system (basic) + ((knots rope-knot-array) + (knot-constraints rope-knot-constraint-array) + (accum-force vector :inline) + (gravity float) + (gravity-dir vector :inline) + (drag float) + (flags rope-system-flag) + (angular-mass-seek-rate float) + ) + (:methods + (init! (_type_ int) object) + (rope-system-method-10 (_type_) vector) + (rope-system-method-11 (_type_) vector) + (rope-system-method-12 (_type_ float) none) + (rope-system-method-13 (_type_) symbol) + (rope-system-method-14 (_type_) symbol) + (rope-system-method-15 (_type_) symbol) + (rope-system-method-16 (_type_ vector vector int) vector) + (rope-system-method-17 (_type_) symbol) + (rope-system-method-18 (_type_) object) + (rope-system-method-19 (_type_) symbol) + (rope-system-method-20 (_type_) symbol) + (rope-system-method-21 (_type_) rope-system-flag) + (rope-system-method-22 (_type_) rope-system-flag) + (rope-system-method-23 (_type_) symbol) + ) + ) + + +(deftype rope-joint-info (structure) + ((joint-index int16) + ) + :pack-me + ) + + +(deftype rope-joint-system-info (structure) + ((joint-info-array (array rope-joint-info)) + ) + ) + + +(deftype joint-mod-world-array (inline-array-class) + ((data joint-mod-set-world :inline :dynamic) + ) + ) + + +(set! (-> joint-mod-world-array heap-base) (the-as uint 64)) diff --git a/goal_src/jak3/levels/desert/rescue/rope-system.gc b/goal_src/jak3/levels/desert/rescue/rope-system.gc index 2b82fbd001..3327a49de0 100644 --- a/goal_src/jak3/levels/desert/rescue/rope-system.gc +++ b/goal_src/jak3/levels/desert/rescue/rope-system.gc @@ -7,3 +7,528 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch symbol vs object. +(defmethod init! ((this rope-system) (arg0 int)) + (set! (-> this accum-force quad) (the-as uint128 0)) + (logior! (-> this flags) (rope-system-flag rs6)) + (vector-float*! (-> this gravity-dir) *up-vector* -1.0) + (set! (-> this gravity) 196608.0) + (set! (-> this drag) 0.3) + (set! (-> this knots) (new 'process 'rope-knot-array arg0)) + (set! (-> this knot-constraints) (new 'process 'rope-knot-constraint-array (+ arg0 -1))) + (set! (-> this knots length) (-> this knots allocated-length)) + (set! (-> this knot-constraints length) (-> this knot-constraints allocated-length)) + (dotimes (v1-13 (-> this knots length)) + (set! (-> this knots data v1-13 pos quad) (the-as uint128 0)) + (set! (-> (the-as vector (+ (the-as uint (-> this knots data 0 prev-pos)) (* v1-13 64))) quad) + (the-as uint128 0) + ) + (set! (-> this knots data v1-13 mass) 1.0) + (set! (-> (the-as vector (+ (the-as uint (-> this knots data 0 force)) (* v1-13 64))) quad) + (the-as uint128 0) + ) + ) + (dotimes (v1-16 (-> this knot-constraints length)) + (set! (-> this knot-constraints data v1-16 max-angle) 3640.889) + (set! (-> this knot-constraints data v1-16 rest-seek-rate) (* 1820.4445 (seconds-per-frame))) + ) + #f + ) + +(defmethod rope-system-method-20 ((this rope-system)) + (dotimes (v1-0 (-> this knots length)) + (set! (-> (the-as vector (+ (the-as uint (-> this knots data 0 prev-pos)) (* v1-0 64))) quad) + (-> this knots data v1-0 pos quad) + ) + (set! (-> (the-as vector (+ (the-as uint (-> this knots data 0 force)) (* v1-0 64))) quad) (the-as uint128 0)) + ) + #f + ) + +;; WARN: Return type mismatch rope-knot-constraint-array vs rope-system. +(defmethod relocate ((this rope-system) (offset int)) + (if (nonzero? (-> this knots)) + (&+! (-> this knots) offset) + ) + (the-as rope-system (when (nonzero? (-> this knot-constraints)) + (let ((v0-0 (&+ (-> this knot-constraints) offset))) + (set! (-> this knot-constraints) v0-0) + v0-0 + ) + ) + ) + ) + +(defmethod rope-system-method-11 ((this rope-system)) + (if (logtest? (-> this flags) (rope-system-flag rs1)) + (vector-float*! (-> this accum-force) (-> this gravity-dir) (-> this gravity)) + ) + ) + +(defmethod rope-system-method-12 ((this rope-system) (arg0 float)) + (let ((f0-1 (* arg0 arg0)) + (f1-1 (-> this drag)) + ) + (dotimes (v1-0 (-> this knots length)) + (let ((a2-1 (-> this knots data v1-0)) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (let ((a3-0 (new 'stack-no-clear 'vector))) + (set! (-> a3-0 quad) (-> this accum-force quad)) + (vector+! a3-0 a3-0 (-> a2-1 force)) + (vector-float*! a1-3 (-> a2-1 pos) (- 2.0 f1-1)) + (vector-! a1-3 a1-3 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) + (vector+float*! a1-3 a1-3 a3-0 f0-1) + ) + (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) + (set! (-> a2-1 pos quad) (-> a1-3 quad)) + ) + ) + ) + 0 + (none) + ) + +(defmethod rope-system-method-17 ((this rope-system)) + (local-vars (f28-0 float)) + (dotimes (s5-0 (+ (-> this knots length) -1)) + (let* ((s1-0 (-> this knot-constraints data s5-0)) + (s4-0 (-> this knots data s5-0)) + (s3-0 (-> this knots data (+ s5-0 1))) + (s2-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector s3-0) (the-as vector s4-0))) + ) + 0.0 + (vector-normalize-ret-len! s2-1 1.0) + (let ((f30-0 (-> this knot-constraints data s5-0 length))) + (vector-normalize! (the-as vector s1-0) 1.0) + (let ((f0-3 (vector-dot s2-1 (the-as vector s1-0)))) + (when (< f0-3 0.999) + (let ((s0-0 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f0-4 (acos f0-3))) + (set! f28-0 (cond + ((< (-> this knot-constraints data s5-0 max-angle) (fabs f0-4)) + (let ((f1-3 (-> this knot-constraints data s5-0 max-angle))) + (if (< f0-4 0.0) + (set! f1-3 (* -1.0 f1-3)) + ) + (set! f28-0 (- f0-4 f1-3)) + ) + (set-time! (-> this knot-constraints data s5-0 constrained-angle-time)) + f28-0 + ) + (else + (seek 0.0 f0-4 (* (-> this knot-constraints data s5-0 rest-seek-rate) (seconds-per-frame))) + ) + ) + ) + ) + (vector-cross! s0-0 s2-1 (the-as vector s1-0)) + (vector-normalize! s0-0 1.0) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s0-0) + ) + (vector-normalize! s2-1 1.0) + (if (< s5-0 (+ (-> this knot-constraints length) -1)) + (set! (-> this knot-constraints data (+ s5-0 1) dir quad) (-> s2-1 quad)) + ) + (vector+float*! (the-as vector s3-0) (the-as vector s4-0) s2-1 f30-0) + ) + ) + ) + ) + ) + #f + ) + +(defmethod rope-system-method-15 ((this rope-system)) + (local-vars + (f24-0 float) + (sv-144 symbol) + (sv-160 int) + (sv-176 (function _varargs_ object)) + (sv-192 symbol) + (sv-208 int) + (sv-224 (function _varargs_ object)) + (sv-240 vector) + (sv-256 vector) + (sv-272 symbol) + (sv-288 int) + (sv-304 (function _varargs_ object)) + (sv-320 symbol) + (sv-336 int) + (sv-352 (function _varargs_ object)) + (sv-368 vector) + (sv-384 int) + (sv-400 (function _varargs_ object)) + (sv-416 int) + (sv-432 (function _varargs_ object)) + ) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (dotimes (s5-0 (+ (-> this knots length) -1)) + (let* ((s1-0 (-> this knot-constraints data s5-0)) + (s3-0 (-> this knots data s5-0)) + (s2-0 (-> this knots data (+ s5-0 1))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector s2-0) (the-as vector s3-0))) + ) + 0.0 + (vector-normalize-ret-len! s4-1 1.0) + (let ((f30-0 (-> this knot-constraints data s5-0 length))) + (vector-normalize! (the-as vector s1-0) 1.0) + (let ((f0-3 (vector-dot s4-1 (the-as vector s1-0)))) + (when (< f0-3 0.999) + (let ((s0-0 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f0-4 (acos f0-3))) + (set! f24-0 (cond + ((< (-> this knot-constraints data s5-0 max-angle) (fabs f0-4)) + (let ((f1-3 (-> this knot-constraints data s5-0 max-angle))) + (if (< f0-4 0.0) + (set! f1-3 (* -1.0 f1-3)) + ) + (set! f24-0 (- f0-4 f1-3)) + ) + (set-time! (-> this knot-constraints data s5-0 constrained-angle-time)) + f24-0 + ) + (else + (seek 0.0 f0-4 (* (-> this knot-constraints data s5-0 rest-seek-rate) (seconds-per-frame))) + ) + ) + ) + ) + (vector-cross! s0-0 s4-1 (the-as vector s1-0)) + (vector-normalize! s0-0 1.0) + (let* ((f0-7 (-> this knots data s5-0 mass)) + (f2-3 (-> this knots data (+ s5-0 1) mass)) + (f1-5 (+ f0-7 f2-3)) + (f28-0 (/ f2-3 f1-5)) + (f26-0 (/ f0-7 f1-5)) + ) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (set! (-> s1-1 quad) (-> s3-0 pos quad)) + (set! sv-368 (new 'stack-no-clear 'vector)) + (let ((v1-35 (-> s2-0 pos quad))) + (set! (-> sv-368 quad) v1-35) + ) + (set! sv-240 (new 'stack-no-clear 'vector)) + (let ((v1-38 (-> s4-1 quad))) + (set! (-> sv-240 quad) v1-38) + ) + (set! sv-256 (new 'stack-no-clear 'vector)) + (let ((v1-40 s4-1) + (f0-8 -1.0) + ) + (.lvf vf1 (&-> v1-40 quad)) + (let ((v1-41 f0-8)) + (.mov vf2 v1-41) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-256 quad) vf1) + (add-debug-line #f (bucket-id debug) s1-1 sv-368 *color-red* #f (the-as rgba -1)) + (vector-rotate-around-axis! sv-240 (the-as quaternion sv-240) f24-0 s0-0) + (vector-rotate-around-axis! sv-256 (the-as quaternion sv-256) f24-0 s0-0) + (vector-normalize! sv-240 1.0) + (vector-normalize! sv-256 1.0) + (add-debug-line + #f + (bucket-id debug) + s1-1 + (vector+float*! (new 'stack-no-clear 'vector) s1-1 sv-240 f30-0) + *color-yellow* + #f + (the-as rgba -1) + ) + (add-debug-line + #f + (bucket-id debug) + sv-368 + (vector+float*! (new 'stack-no-clear 'vector) sv-368 sv-256 f30-0) + *color-white* + #f + (the-as rgba -1) + ) + (let ((s0-1 add-debug-text-3d)) + (set! sv-144 (the-as symbol #f)) + (set! sv-160 583) + (set! sv-176 format) + (let ((a0-37 (clear *temp-string*)) + (a1-13 "p0") + ) + (sv-176 a0-37 a1-13) + ) + (let ((a2-8 *temp-string*) + (a3-7 s1-1) + (t0-5 3) + (t1-3 #f) + ) + (s0-1 sv-144 (the-as bucket-id sv-160) a2-8 a3-7 (the-as font-color t0-5) (the-as vector2h t1-3)) + ) + ) + (let ((s0-2 add-debug-text-3d)) + (set! sv-192 (the-as symbol #f)) + (set! sv-208 583) + (set! sv-224 format) + (let ((a0-40 (clear *temp-string*)) + (a1-15 "p1") + ) + (sv-224 a0-40 a1-15) + ) + (let ((a2-9 *temp-string*) + (a3-8 sv-368) + (t0-6 3) + (t1-4 #f) + ) + (s0-2 sv-192 (the-as bucket-id sv-208) a2-9 a3-8 (the-as font-color t0-6) (the-as vector2h t1-4)) + ) + ) + (let ((v1-49 sv-368) + (a0-42 s3-0) + (f0-11 f30-0) + ) + (vector+float*! v1-49 (the-as vector a0-42) sv-240 f0-11) + ) + (vector+float*! s1-1 (the-as vector s2-0) sv-256 f30-0) + (let ((s0-3 add-debug-text-3d)) + (set! sv-272 (the-as symbol #f)) + (set! sv-288 583) + (set! sv-304 format) + (let ((a0-45 (clear *temp-string*)) + (a1-19 "p0new") + ) + (sv-304 a0-45 a1-19) + ) + (let ((a2-10 *temp-string*) + (a3-9 s1-1) + (t0-7 7) + (t1-5 #f) + ) + (s0-3 sv-272 (the-as bucket-id sv-288) a2-10 a3-9 (the-as font-color t0-7) (the-as vector2h t1-5)) + ) + ) + (let ((s0-4 add-debug-text-3d)) + (set! sv-320 (the-as symbol #f)) + (set! sv-336 583) + (set! sv-352 format) + (let ((a0-48 (clear *temp-string*)) + (a1-21 "p1new") + ) + (sv-352 a0-48 a1-21) + ) + (let ((a2-11 *temp-string*) + (a3-10 sv-368) + (t0-8 7) + (t1-6 #f) + ) + (s0-4 sv-320 (the-as bucket-id sv-336) a2-11 a3-10 (the-as font-color t0-8) (the-as vector2h t1-6)) + ) + ) + (vector-lerp! (the-as vector s3-0) (the-as vector s3-0) s1-1 f28-0) + ) + (let ((t9-25 vector-lerp!) + (a0-51 s2-0) + (a1-24 s2-0) + (a3-12 f26-0) + ) + (t9-25 (the-as vector a0-51) (the-as vector a1-24) sv-368 a3-12) + ) + ) + ) + (let ((s1-2 add-debug-text-3d) + (s0-5 #f) + ) + (set! sv-384 583) + (set! sv-400 format) + (let ((a0-53 (clear *temp-string*)) + (a1-25 "p0f") + ) + (sv-400 a0-53 a1-25) + ) + (let ((a2-14 *temp-string*) + (a3-13 s3-0) + (t0-9 6) + (t1-7 #f) + ) + (s1-2 + s0-5 + (the-as bucket-id sv-384) + a2-14 + (the-as vector a3-13) + (the-as font-color t0-9) + (the-as vector2h t1-7) + ) + ) + ) + (let ((s1-3 add-debug-text-3d) + (s0-6 #f) + ) + (set! sv-416 583) + (set! sv-432 format) + (let ((a0-56 (clear *temp-string*)) + (a1-27 "p1f") + ) + (sv-432 a0-56 a1-27) + ) + (let ((a2-15 *temp-string*) + (a3-14 s2-0) + (t0-10 6) + (t1-8 #f) + ) + (s1-3 + s0-6 + (the-as bucket-id sv-416) + a2-15 + (the-as vector a3-14) + (the-as font-color t0-10) + (the-as vector2h t1-8) + ) + ) + ) + (vector-! s4-1 (the-as vector s2-0) (the-as vector s3-0)) + (vector-normalize! s4-1 1.0) + (rope-system-method-16 this (the-as vector s3-0) (the-as vector s2-0) s5-0) + (when (< s5-0 (+ (-> this knot-constraints length) -1)) + (cond + ((logtest? (-> this flags) (rope-system-flag rs4)) + (vector-lerp! + (the-as vector (-> this knot-constraints data (+ s5-0 1))) + (the-as vector (-> this knot-constraints data (+ s5-0 1))) + s4-1 + (* (-> this angular-mass-seek-rate) (seconds-per-frame)) + ) + (vector-normalize! (the-as vector (-> this knot-constraints data (+ s5-0 1))) 1.0) + ) + (else + (let ((v1-78 (-> this knot-constraints data (+ s5-0 1)))) + (set! (-> v1-78 dir quad) (-> s4-1 quad)) + v1-78 + ) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +(defmethod rope-system-method-13 ((this rope-system)) + (dotimes (s5-0 (+ (-> this knots length) -1)) + (let* ((s4-0 (-> this knots data s5-0)) + (s3-0 (-> this knots data (+ s5-0 1))) + (s2-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector s3-0) (the-as vector s4-0))) + ) + 0.0 + (vector-normalize-ret-len! s2-1 1.0) + (vector+float*! (the-as vector s3-0) (the-as vector s4-0) s2-1 (-> this knot-constraints data s5-0 length)) + ) + ) + #f + ) + +(defmethod rope-system-method-16 ((this rope-system) (arg0 vector) (arg1 vector) (arg2 int)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) + 0.0 + 0.0 + 0.0 + (let* ((f30-0 (-> this knot-constraints data arg2 length)) + (f2-0 (vector-normalize-ret-len! s5-1 1.0)) + (f0-3 (- f30-0 f2-0)) + (f3-1 (+ (-> this knots data arg2 mass) (-> this knots data (+ arg2 1) mass))) + (f1-2 (/ (-> this knots data arg2 mass) f3-1)) + (f3-2 (/ (-> this knots data (+ arg2 1) mass) f3-1)) + ) + (when (< 0.4 (/ (fabs f0-3) (fabs f2-0))) + (when (< f1-2 0.01) + (set! f1-2 0.01) + (set! f3-2 0.99) + ) + (when (< f3-2 0.01) + (set! f3-2 0.01) + (set! f1-2 0.99) + ) + ) + (vector+float*! arg1 arg1 s5-1 (* f0-3 f1-2)) + (vector+float*! arg0 arg0 s5-1 (* -1.0 f3-2 f0-3)) + ) + ) + ) + +(defmethod rope-system-method-14 ((this rope-system)) + (dotimes (s5-0 (+ (-> this knots length) -1)) + (let ((a1-0 (-> this knots data s5-0)) + (a2-0 (-> this knots data (+ s5-0 1))) + ) + (rope-system-method-16 this (the-as vector a1-0) (the-as vector a2-0) s5-0) + ) + ) + #f + ) + +;; WARN: Return type mismatch symbol vs vector. +(defmethod rope-system-method-10 ((this rope-system)) + (when (logtest? (-> this flags) (rope-system-flag rs0)) + (if (logtest? (-> this flags) (rope-system-flag rs3)) + (rope-system-method-15 this) + (rope-system-method-17 this) + ) + ) + (the-as vector (rope-system-method-14 this)) + ) + +(defmethod rope-system-method-18 ((this rope-system)) + (with-pp + (if (not (logtest? (-> this flags) (rope-system-flag rs6))) + (return 0) + ) + (when (not (logtest? (-> this flags) (rope-system-flag rs2))) + (rope-system-method-11 this) + (rope-system-method-12 this (* 0.0033333334 (the float (- (current-time) (-> pp clock old-frame-counter))))) + ) + (rope-system-method-10 this) + (rope-system-method-19 this) + ) + ) + +;; WARN: Return type mismatch int vs symbol. +(defmethod rope-system-method-19 ((this rope-system)) + (the-as symbol 0) + ) + +(defmethod rope-system-method-22 ((this rope-system)) + (rope-system-method-20 this) + (let ((v0-1 (logior (-> this flags) (rope-system-flag rs6)))) + (set! (-> this flags) v0-1) + v0-1 + ) + ) + +(defmethod rope-system-method-21 ((this rope-system)) + (rope-system-method-20 this) + (let ((v0-1 (logclear (-> this flags) (rope-system-flag rs6)))) + (set! (-> this flags) v0-1) + v0-1 + ) + ) + +(defmethod rope-system-method-23 ((this rope-system)) + (dotimes (s5-0 (-> this knot-constraints length)) + (let ((s4-0 (-> this knot-constraints data s5-0))) + (vector-! + (-> s4-0 dir) + (the-as vector (-> this knots data (+ s5-0 1))) + (the-as vector (-> this knots data s5-0)) + ) + (set! (-> s4-0 length) (vector-normalize-ret-len! (-> s4-0 dir) 1.0)) + ) + ) + #f + ) diff --git a/goal_src/jak3/levels/desert/rescue/wland-passenger.gc b/goal_src/jak3/levels/desert/rescue/wland-passenger.gc index ecfb866d4d..0b47f0e13c 100644 --- a/goal_src/jak3/levels/desert/rescue/wland-passenger.gc +++ b/goal_src/jak3/levels/desert/rescue/wland-passenger.gc @@ -7,3 +7,1588 @@ ;; DECOMP BEGINS +(deftype wland-passenger (citizen) + ((task-arrow handle) + (start-pos vector :inline) + (seat int32) + (transport handle) + (is-dead? symbol) + (front-back-interp float :offset 1080) + (left-right-interp float) + (up-down-interp float) + (original-trans vector :inline) + (desired-pos vector :inline) + (dest-quat quaternion :inline) + (original-quat quaternion :inline) + (backup-nav-mask uint32) + (task-man handle) + (nav-sphere-handle handle) + ) + (:state-methods + boarding + returning + board-vehicle + ride + exit-vehicle + approaching-transport + entering-transport + lying-prone + ride-start + wait-for-transport-to-open + ) + (:methods + (toggle-rod-of-god (_type_) none) + (can-board-vehicle? (_type_) symbol) + (wland-passenger-method-228 (_type_ vector) symbol) + (wland-passenger-method-229 (_type_ vector) float) + (wland-passenger-method-230 (_type_ vehicle vector) vector) + (wland-passenger-method-231 (_type_) float) + ) + ) + + +(defskelgroup skel-wland-passenger wland-passenger wland-passenger-lod0-jg -1 + ((wland-passenger-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow wland-passenger-shadow-mg + :origin-joint-index 3 + ) + +(deftype wland-passenger-init-by-other-params (traffic-object-spawn-params) + ((is-dead? symbol) + (parent handle) + ) + ) + + +(defmethod wland-passenger-method-229 ((this wland-passenger) (arg0 vector)) + (let ((gp-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + 0.0 + 0.0 + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (set! (-> gp-0 y) 0.0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-normalize! gp-0 1.0) + (vector-normalize! s4-0 1.0) + (let* ((f0-7 (vector-dot s5-1 s4-0)) + (f0-8 (acos f0-7)) + ) + (if (< (vector-dot s5-1 gp-0) 0.0) + (set! f0-8 (* -1.0 f0-8)) + ) + f0-8 + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod toggle-rod-of-god ((this wland-passenger)) + (if (< (vector-vector-distance (-> this root trans) (target-pos 0)) 122880.0) + (send-event (handle->process (-> this task-arrow)) 'hide) + (send-event (handle->process (-> this task-arrow)) 'show) + ) + (none) + ) + +(defmethod can-board-vehicle? ((this wland-passenger)) + (with-pp + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'get-vehicle) + (let ((v1-2 (the-as vehicle (send-event-function *target* a1-0)))) + (if v1-2 + (< (vector-length (-> v1-2 root transv)) 40960.0) + #f + ) + ) + ) + ) + ) + +(defun probe-for-transport-ground ((arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> gp-0 start-pos) arg0 *up-vector* 24576.0) + (set! (-> gp-0 move-dist quad) (the-as uint128 0)) + (set! (-> gp-0 move-dist y) -81920.0) + (let ((v1-4 gp-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) + (-> gp-0 best-other-tri intersect y) + -40960000.0 + ) + ) + ) + +(defun compute-y-height ((arg0 process-focusable) (arg1 vector)) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)))) + 0.0 + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (get-trans arg0 0)))) + (vector-normalize! s4-0 1.0) + (let ((f30-0 (vector-dot s3-1 s4-0)) + (s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat))) + (s2-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat))) + (s3-2 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s3-2 (get-trans arg0 0) s1-0 -57344.0) + (vector+float*! s3-2 s3-2 s2-1 4096.0) + (vector+float*! s4-1 (get-trans arg0 0) s1-0 -34816.0) + (vector+float*! s4-1 s4-1 s2-1 22528.0) + (let ((f30-1 (cond + ((< f30-0 -57344.0) + (-> arg1 y) + ) + ((< -34816.0 f30-0) + (-> s4-1 y) + ) + (else + (+ 2048.0 (lerp-scale (-> s3-2 y) (-> s4-1 y) f30-0 -57344.0 -34816.0)) + ) + ) + ) + ) + (fmax (probe-for-transport-ground arg1) f30-1) + ) + ) + ) + ) + ) + +(defun compute-transport-approach-pt ((arg0 process-focusable) (arg1 vector)) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)))) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)) + (let ((f30-0 (compute-y-height arg0 (target-pos 0))) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> (target-pos 0) quad)) + (set! (-> s3-1 y) f30-0) + ) + (vector+float*! arg1 (get-trans arg0 0) s5-0 -57344.0) + ) + arg1 + ) + +(defmethod should-move-to-ground? ((this wland-passenger)) + (not (and (-> this next-state) (= (-> this next-state name) 'entering-transport))) + ) + +(defstate entering-transport (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let* ((gp-0 (-> self nav state)) + (s5-0 (handle->process (-> self transport))) + (v1-8 (get-trans + (the-as vehicle (if (type? s5-0 process-focusable) + (the-as vehicle s5-0) + ) + ) + 0 + ) + ) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-pos quad) (-> v1-8 quad)) + ) + 0 + ) + :trans (behavior () + (let* ((gp-0 (handle->process (-> self transport))) + (a0-4 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (cond + (a0-4 + (set! (-> self root trans y) (compute-y-height (the-as process-focusable a0-4) (-> self root trans))) + (let ((t9-2 vector-vector-xz-distance) + (a0-5 (-> self root trans)) + (a2-0 (-> self nav state)) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-3 quad) (-> a2-0 target-pos quad)) + (when (< (t9-2 a0-5 a1-3) 14745.6) + (send-event (handle->process (-> self transport)) 'leave) + (send-event (handle->process (-> self transport)) 'die-when-ready) + (go-virtual die-fast) + ) + ) + ) + (else + (go-virtual die-fast) + ) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 90) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate wait-for-transport-to-open (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (set-time! (-> self state-time)) + (nav-enemy-method-178 self) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) + (send-event (handle->process (-> self transport)) 'can-board?) + ) + (go-virtual approaching-transport) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defun update-nav-sphere ((arg0 handle) (arg1 process-focusable) (arg2 vector)) + (if (not arg1) + (return 0) + ) + (let ((s0-0 (-> arg1 root trans)) + (s2-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + (f30-0 40960.0) + ) + (let ((s1-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> arg1 root quat))) + (s3-1 (compute-transport-approach-pt arg1 (new 'stack-no-clear 'vector))) + ) + (vector+float*! s5-0 s0-0 s2-0 -29900.8) + (vector+float*! s5-0 s5-0 s1-0 20480.0) + (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) s3-1 arg2)) + (s0-2 (vector-float*! (new 'stack-no-clear 'vector) s2-0 1.0)) + ) + 0.0 + (set! (-> s1-2 y) 0.0) + (vector-normalize! s1-2 1.0) + (set! (-> s0-2 y) 0.0) + (vector-normalize! s0-2 1.0) + (let ((f28-0 (vector-dot s0-2 s1-2))) + (cond + ((< (vector-vector-xz-distance arg2 s3-1) 6144.0) + (set! f30-0 (the-as float 0.0)) + ) + ((< 0.0 f28-0) + (set! f30-0 (lerp f30-0 0.0 f28-0)) + ) + ) + ) + ) + ) + (send-event (handle->process arg0) 'move-trans s5-0) + (send-event (handle->process arg0) 'set-radius f30-0) + ) + ) + +(defstate approaching-transport (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let* ((gp-0 (-> self nav state)) + (s5-0 compute-transport-approach-pt) + (s4-0 (handle->process (-> self transport))) + (v1-7 (s5-0 + (the-as process-focusable (if (type? s4-0 process-focusable) + s4-0 + ) + ) + (new 'stack-no-clear 'vector) + ) + ) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-pos quad) (-> v1-7 quad)) + ) + 0 + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + (let ((gp-1 (find-nearest-nav-mesh (-> self root trans) 8192.0))) + (if gp-1 + (set! (-> self nav-sphere-handle) + (ppointer->handle + (process-spawn simple-nav-sphere #x46a66666 (-> self root trans) gp-1 -1 :name "simple-nav-sphere" :to self) + ) + ) + ) + ) + ) + :exit (behavior () + (send-event (handle->process (-> self nav-sphere-handle)) 'die-fast) + ) + :trans (behavior () + (let ((gp-0 update-nav-sphere) + (s5-0 (-> self nav-sphere-handle)) + (s4-0 (handle->process (-> self transport))) + ) + (gp-0 + s5-0 + (the-as process-focusable (if (type? s4-0 process-focusable) + s4-0 + ) + ) + (-> self root trans) + ) + ) + (let ((t9-2 vector-vector-xz-distance) + (a0-5 (-> self root trans)) + (a2-1 (-> self nav state)) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-3 quad) (-> a2-1 target-pos quad)) + (when (< (t9-2 a0-5 a1-3) 2048.0) + (let ((v1-8 (-> self nav))) + (set! (-> v1-8 sphere-mask) (the-as uint 65)) + ) + 0 + (go-virtual entering-transport) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 30) + ) + :post (behavior () + (if (time-elapsed? (-> self state-time) (seconds 0.035)) + (nav-enemy-method-187 self) + (enemy-common-post self) + ) + ) + ) + +(defstate returning (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((a0-12 (-> self nav state)) + (v1-4 (-> self start-pos)) + ) + (logclear! (-> a0-12 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-12 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-12 target-pos quad) (-> v1-4 quad)) + ) + 0 + (nav-enemy-method-176 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (cond + ((and (< (vector-vector-distance (target-pos 0) (-> self start-pos)) 81920.0) (can-board-vehicle? self)) + (go-virtual boarding) + ) + ((< (vector-vector-xz-distance (-> self root trans) (-> self start-pos)) 6144.0) + (go-virtual active) + ) + ) + ) + (toggle-rod-of-god self) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defun do-spline3 ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +(defstate boarding (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (nav-enemy-method-177 self) + (set! (-> self backup-nav-mask) (get-sphere-mask (-> self nav))) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (toggle-rod-of-god self) + (cond + ((or (< 122880.0 (vector-vector-distance (target-pos 0) (-> self root trans))) + (< 163840.0 (vector-vector-distance (-> self root trans) (-> self start-pos))) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) + (go-virtual returning) + ) + ) + (else + (let ((gp-1 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (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) 'get-vehicle) + (let ((s5-0 (the-as vehicle (send-event-function *target* a1-2)))) + (if (not s5-0) + (return 0) + ) + (set! (-> self vehicle) (process->handle s5-0)) + (when s5-0 + (set! (-> self seat) (get-best-seat s5-0 (-> self root trans) (vehicle-seat-flag vsf1) 1)) + (when (!= (-> self seat) -1) + (vehicle-method-66 s5-0 gp-1 (-> self seat)) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s5-0 root quat))) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector+float*! gp-2 (-> s5-0 root trans) s4-0 24576.0) + (cond + ((< (vector-vector-xz-distance (-> self root trans) gp-2) 14336.0) + (let ((v1-32 (-> self nav))) + (set! (-> v1-32 sphere-mask) (the-as uint 65)) + ) + 0 + ) + (else + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 sphere-mask) (-> self backup-nav-mask)) + ) + 0 + ) + ) + (let ((a0-21 (-> self nav state)) + (v1-37 gp-2) + ) + (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-21 target-pos quad) (-> v1-37 quad)) + ) + 0 + (if (< (vector-vector-xz-distance gp-2 (-> self root trans)) 6144.0) + (go-virtual board-vehicle) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 90) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defmethod coin-flip? ((this wland-passenger)) + #f + ) + +(defmethod wland-passenger-method-230 ((this wland-passenger) (arg0 vehicle) (arg1 vector)) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)))) + (let ((a0-3 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)))) + (vector+float*! arg1 (-> arg0 root trans) a0-3 9830.4) + ) + (vector+float*! arg1 arg1 s5-0 -1843.2) + ) + (+! (-> arg1 y) -204.8) + arg1 + ) + +(define *progress* (the-as object #t)) + +(defstate board-vehicle (wland-passenger) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('vehicle-crash) + #f + ) + (('end-task) + (go-die self) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((v1-0 (-> self nav))) + (set! (-> v1-0 sphere-mask) (-> self backup-nav-mask)) + ) + 0 + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-7 (-> self root root-prim))) + (set! (-> v1-7 prim-core collide-as) (collide-spec)) + (set! (-> v1-7 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logclear (-> v1-9 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-9 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-12 self)) + (set! (-> v1-12 enemy-flags) (the-as enemy-flag (logclear (-> v1-12 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (send-event (handle->process (-> self task-arrow)) 'die) + (send-event (handle->process (-> self task-man)) 'picked-up) + (change-parent self *rigid-body-queue-manager*) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot)) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (ja-no-eval :group! wland-passenger-vehicle-jump-to-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s5-0 (ja-num-frames 0)) + (f0-4 (ja-frame-num 0)) + ) + 0.0 + (let ((f30-0 (/ f0-4 (the float s5-0))) + (s5-1 (the-as vehicle (handle->process (-> self vehicle)))) + ) + (let ((s4-1 (vector+float*! + (new 'stack-no-clear 'vector) + (-> s5-1 root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s5-1 root quat)) + -1638.4 + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (vector-! s3-1 s4-1 (-> self root trans)) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (let ((s4-2 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat))) + (a2-2 (quaternion-look-at! (new 'stack-no-clear 'quaternion) s3-1 *up-vector*)) + ) + (quaternion-slerp! (-> self root quat) s4-2 a2-2 f30-0) + ) + ) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s5-1 root quat)) + (let ((a2-4 (wland-passenger-method-230 self s5-1 (new 'stack-no-clear 'vector)))) + (vector-lerp! (-> self root trans) gp-0 a2-4 f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((gp-1 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) + (ja-no-eval :group! wland-passenger-vehicle-get-in-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s5-2 (handle->process (-> self vehicle))) + (s3-2 (ja-num-frames 0)) + (f30-1 (ja-frame-num 0)) + ) + 0.0 + (let* ((s4-3 (new 'stack-no-clear 'vector)) + (t9-18 (method-of-object self wland-passenger-method-230)) + (a0-27 self) + (a1-16 (handle->process (-> self vehicle))) + (s2-0 (t9-18 a0-27 (the-as vehicle a1-16) (new 'stack-no-clear 'vector))) + ) + (vehicle-method-66 (the-as vehicle s5-2) s4-3 (-> self seat)) + (let ((f30-2 (/ f30-1 (the float s3-2)))) + (vector-lerp! (-> self root trans) s2-0 s4-3 f30-2) + (let ((s4-4 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> (the-as vehicle s5-2) root quat)))) + (let ((f0-18 (the float (-> (the-as vehicle s5-2) info rider seat-array (-> self seat) angle)))) + (quaternion-rotate-local-y! s4-4 s4-4 f0-18) + ) + (quaternion-slerp! (-> self root quat) gp-1 s4-4 f30-2) + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-channel-push! 1 (seconds 1)) + (ja :group! wland-passenger-pilot-car-up-down-ja :num! (identity 1.0)) + (let ((gp-2 (the-as vehicle (handle->process (-> self vehicle))))) + (vehicle-method-66 gp-2 (-> self root trans) (-> self seat)) + (let ((f0-24 (the float (-> gp-2 info rider seat-array (-> self seat) angle)))) + (quaternion-rotate-local-y! (-> self root quat) (-> gp-2 root quat) f0-24) + ) + ) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride-start) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defstate exit-vehicle (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (change-to (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)) self) + (if (not (-> self nav)) + (go-inactive self) + ) + (citizen-method-195 self) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (logior! (-> self flags) (citizen-flag persistent)) + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + (set-time! (-> self state-time)) + (let ((v1-18 (-> self root root-prim))) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-20 self)) + (set! (-> v1-20 enemy-flags) (the-as enemy-flag (logclear (-> v1-20 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-20 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-23 self)) + (set! (-> v1-23 enemy-flags) (the-as enemy-flag (logclear (-> v1-23 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (send-event (handle->process (-> self task-man)) 'dropped-off) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (remove-riders (the-as vehicle (handle->process (-> self vehicle))) (the-as handle self)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (ja-no-eval :group! wland-passenger-vehicle-get-out-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let* ((gp-0 (the-as vehicle (handle->process (-> self vehicle)))) + (s5-0 (quaternion-copy! (-> self root quat) (-> gp-0 root quat))) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (wland-passenger-method-230 self gp-0 (new 'stack-no-clear 'vector))) + (s2-0 (ja-num-frames 0)) + (f0-4 (ja-frame-num 0)) + ) + 0.0 + (let ((f30-0 (/ f0-4 (the float s2-0)))) + (vehicle-method-66 gp-0 s4-0 (-> self seat)) + (vector-lerp! (-> self root trans) s4-0 s3-0 f30-0) + (let ((gp-1 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> gp-0 root quat)))) + (quaternion-rotate-y! s5-0 s5-0 0.0) + (quaternion-rotate-y! gp-1 gp-1 -16384.0) + (quaternion-slerp! (-> self root quat) s5-0 gp-1 f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-2 (the-as vehicle (handle->process (-> self vehicle))))) + (wland-passenger-method-230 self gp-2 (-> self root trans)) + (+! (-> self root trans y) 409.6) + (quaternion-copy! (-> self root quat) (-> gp-2 root quat)) + ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) -16384.0) + (set! (-> self original-trans quad) (-> self root trans quad)) + (quaternion-copy! (-> self original-quat) (-> self root quat)) + (let ((s4-1 (the-as vehicle (handle->process (-> self vehicle)))) + (s5-1 (new 'stack-no-clear 'vector)) + (gp-3 (new 'stack-no-clear 'vector)) + ) + (let ((v1-63 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-1 root quat)))) + (vector+float*! s5-1 (-> s4-1 root trans) v1-63 40960.0) + (vector+float*! (-> self desired-pos) (-> s4-1 root trans) v1-63 24576.0) + ) + (wland-passenger-method-228 self (-> self desired-pos)) + (vector-! gp-3 s5-1 (-> self root trans)) + (set! (-> gp-3 y) 0.0) + (vector-normalize! gp-3 1.0) + (quaternion-look-at! (-> self dest-quat) gp-3 *up-vector*) + ) + (ja-no-eval :group! wland-passenger-vehicle-get-out-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-4 (ja-num-frames 0)) + (f0-17 (ja-frame-num 0)) + ) + 0.0 + (let ((f30-1 (/ f0-17 (the float gp-4)))) + (quaternion-slerp! (-> self root quat) (-> self original-quat) (-> self dest-quat) f30-1) + (vector-lerp! (-> self root trans) (-> self original-trans) (-> self desired-pos) f30-1) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wland-passenger-vehicle-get-out-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-121 (-> self root root-prim))) + (set! (-> v1-121 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-121 prim-core collide-with) (-> self root backup-collide-with)) + ) + (send-event (handle->process (-> self task-arrow)) 'die) + (go-virtual wait-for-transport-to-open) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defmethod wland-passenger-method-228 ((this wland-passenger) (arg0 vector)) + (let ((s3-0 (the-as vehicle (handle->process (-> this vehicle)))) + (s4-0 (new 'stack 'collide-query)) + ) + (vehicle-method-66 s3-0 arg0 (-> this seat)) + (vector-! arg0 arg0 (-> s3-0 root trans)) + (vector-normalize! arg0 (+ 34816.0 (vector-length arg0))) + (vector+! arg0 arg0 (-> s3-0 root trans)) + (when (enemy-above-ground? this s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> arg0 y) (-> s4-0 best-other-tri intersect y)) + (let ((v1-14 (-> this nav)) + (a1-10 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-10 vertex)) arg0 (the-as vector (-> v1-14 state mesh bounds))) + (set! (-> a1-10 vertex1 x) (-> v1-14 nearest-y-threshold)) + (set! (-> a1-10 data 20) (the-as uint 2)) + (if (nav-mesh-method-45 (-> v1-14 state mesh) a1-10) + (return #t) + ) + ) + ) + ) + #f + ) + +(defmethod wland-passenger-method-231 ((this wland-passenger)) + (let ((s5-0 (the-as vehicle (handle->process (-> this vehicle))))) + (if (not s5-0) + (return 0.0) + ) + (vehicle-method-66 s5-0 (-> this root trans) (-> this seat)) + (let ((f0-1 (the float (-> s5-0 info rider seat-array (-> this seat) angle)))) + (quaternion-rotate-local-y! (-> this root quat) (-> s5-0 root quat) f0-1) + ) + ) + (let ((v1-15 (the-as vehicle (handle->process (-> this vehicle))))) + (if (or (not v1-15) (logtest? (-> v1-15 v-flags) (vehicle-flag dead))) + (citizen-method-206 this) + ) + ) + (when (and *target* (focus-test? *target* pilot-riding)) + (let ((s4-0 (-> *target* pilot))) + (when (nonzero? s4-0) + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (set! (-> s5-1 uvec x) (* 182.04445 (* 0.5454545 (the float (current-time))))) + (set! (-> s5-1 uvec z) (sin (-> s5-1 uvec x))) + (set! (-> s5-1 uvec w) (cos (-> s5-1 uvec x))) + (set! (-> s5-1 uvec y) (seconds-per-frame)) + (set! (-> s5-1 rvec quad) (-> s4-0 local-accel quad)) + (let ((f1-6 (+ (* 0.03 (-> s5-1 uvec z)) (* -1.0 (-> s5-1 rvec x) (-> s4-0 left-right-accel-factor))))) + (+! (-> this left-right-interp) (* (- f1-6 (-> this left-right-interp)) (fmin 1.0 (* 8.0 (-> s5-1 uvec y))))) + ) + (set! (-> this left-right-interp) (fmax -1.0 (fmin 1.0 (-> this left-right-interp)))) + (let* ((f0-17 (+ (* 0.03 (-> s5-1 uvec w)) (* -1.0 (-> s5-1 rvec z) (-> s4-0 front-back-accel-factor)))) + (f1-16 (+ -0.5 f0-17)) + ) + (+! (-> this front-back-interp) (* (- f1-16 (-> this front-back-interp)) (fmin 1.0 (* 8.0 (-> s5-1 uvec y))))) + ) + (set! (-> this front-back-interp) (fmax -1.0 (fmin 1.0 (-> this front-back-interp)))) + (let ((f1-25 (+ (* 0.03 (-> s5-1 uvec w)) (* -1.0 (-> s5-1 rvec y) (-> s4-0 up-down-accel-factor))))) + (+! (-> this up-down-interp) (* (- f1-25 (-> this up-down-interp)) (fmin 1.0 (* 8.0 (-> s5-1 uvec y))))) + ) + ) + (set! (-> this up-down-interp) (fmax -1.0 (fmin 1.0 (-> this up-down-interp)))) + ) + ) + ) + (when (not (time-elapsed? (-> this state-time) (seconds 1))) + (set! (-> this up-down-interp) 0.0) + (set! (-> this left-right-interp) 0.0) + (set! (-> this front-back-interp) -1.0) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior wland-passenger-wcar-anim-loop wland-passenger () + (ja-channel-push! 3 (seconds 1)) + (ja :group! wland-passenger-pilot-car-turn-back-ja) + (ja :chan 1 :group! wland-passenger-pilot-car-turn-front-ja) + (ja :chan 2 :group! wland-passenger-pilot-car-up-down-ja) + (until #f + (let ((f30-0 (* 5.0 (+ 1.0 (-> self left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-3 (* 0.5 (+ 1.0 (-> self front-back-interp))))) + (set! (-> gp-1 frame-interp 1) f0-3) + (set! (-> gp-1 frame-interp 0) f0-3) + ) + (set! (-> gp-1 num-func) num-func-identity) + (set! (-> gp-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (let ((f0-6 (* 5.0 (- 1.0 (-> self up-down-interp)))) + (gp-2 (-> self skel root-channel 2)) + ) + (let ((f1-7 (fabs (-> self up-down-interp)))) + (set! (-> gp-2 frame-interp 1) f1-7) + (set! (-> gp-2 frame-interp 0) f1-7) + ) + (set! (-> gp-2 num-func) num-func-identity) + (set! (-> gp-2 frame-num) (ja-aframe f0-6 2)) + ) + (suspend) + ) + #f + (none) + ) + +(defstate ride (wland-passenger) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit-vehicle) + (when (< (vector-length (-> (the-as vehicle (handle->process (-> self vehicle))) root transv)) 20480.0) + (set! (-> self transport) (the-as handle (-> block param 0))) + (go-virtual exit-vehicle) + ) + ) + (('end-task) + (go-die self) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-7 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + :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 ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + (wland-passenger-method-231 self) + ) + :code (behavior () + (wland-passenger-wcar-anim-loop) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defstate ride-start (wland-passenger) + :virtual #t + :parent (wland-passenger ride) + :trans (behavior () + (wland-passenger-method-231 self) + (if (time-elapsed? (-> self state-time) (seconds 1)) + (go-virtual ride) + ) + ) + :code sleep-code + ) + +(defstate lying-prone (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (toggle-rod-of-god self) + (when (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 348160.0) + (send-event (handle->process (-> self task-man)) 'fight) + (send-event (handle->process (-> self task-arrow)) 'die) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja :group! wland-passenger-getup-front-ja :num! zero) + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate active (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag vulnerable)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (cond + ((handle->process (-> self transport)) + (go-virtual approaching-transport) + ) + ((-> self is-dead?) + (go-virtual lying-prone) + ) + ((and (< (vector-vector-distance (target-pos 0) (-> self start-pos)) 81920.0) (can-board-vehicle? self)) + (go-virtual boarding) + ) + ((< 20480.0 (vector-vector-xz-distance (-> self root trans) (-> self start-pos))) + (go-virtual returning) + ) + ) + (toggle-rod-of-god self) + (when (or (logtest? (-> self draw status) (draw-control-status no-draw)) + (< 409600.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) + ) + (let ((gp-3 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)))) + (set! (-> gp-3 y) 0.0) + (vector-normalize! gp-3 1.0) + (quaternion-look-at! (-> self root quat) gp-3 *up-vector*) + ) + ) + ) + :code (behavior () + (until #f + (ja-channel-push! 1 (seconds 0.3)) + (let ((gp-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 9) 5))) + (dotimes (s5-0 gp-0) + (let ((s4-0 (-> self skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim wland-passenger-idle-wave-ja)) + (set! (-> s4-0 param 0) + (the float (+ (-> (the-as art-joint-anim wland-passenger-idle-wave-ja) frames num-frames) -1)) + ) + (let* ((f30-0 3.0) + (f28-0 0.0) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> s4-0 param 1) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-16))))) + ) + (set! (-> s4-0 frame-num) 0.0) + (joint-control-channel-group! s4-0 (the-as art-joint-anim wland-passenger-idle-wave-ja) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((s4-1 (-> self skel root-channel 0))) + (set! (-> s4-1 param 0) (the float (+ (-> s4-1 frame-group frames num-frames) -1))) + (let* ((f30-1 3.0) + (f28-1 0.0) + (v1-29 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-30 (the-as number (logior #x3f800000 v1-29))) + ) + (set! (-> s4-1 param 1) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-30))))) + ) + (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (ja-no-eval :group! wland-passenger-idle-wave-to-cover-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-1 (+ (logand (rand-uint31-gen *random-generator*) 3) 1))) + (dotimes (s5-1 (the-as int gp-1)) + (ja-no-eval :group! wland-passenger-idle-cover-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defbehavior wland-passenger-init-by-other wland-passenger ((arg0 wland-passenger-init-by-other-params)) + (set! (-> self start-pos quad) (-> arg0 position quad)) + (set! (-> self transport) (the-as handle #f)) + (set! (-> self is-dead?) (-> arg0 is-dead?)) + (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-0 pos quad) (-> arg0 position quad)) + (quaternion-identity! (-> s5-0 quat)) + (set! (-> s5-0 flags) (task-arrow-flags)) + (set! (-> s5-0 map-icon) (the-as uint 13)) + (logior! (-> s5-0 flags) (task-arrow-flags taf3)) + (set! (-> self task-arrow) (process->handle (task-arrow-spawn s5-0 self))) + ) + (set! (-> self level) (level-get *level* 'desresc)) + (set! (-> self task-man) (-> arg0 parent)) + (citizen-init-by-other arg0) + ) + +(define *wland-passenger-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim -1 + :hit-anim 3 + :knocked-anim 9 + :knocked-land-anim 10 + :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 + :sound-hit (static-sound-name "wland-passenger") + :sound-die (static-sound-name "wland-passenger") + :notice-distance-delta (meters 0.1) + :default-hit-points 12.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 61440.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim 3 + :run-anim 19 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 10) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *wland-passenger-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod init-enemy-collision! ((this wland-passenger)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak 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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 5324.8 0.0 5324.8) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-15 local-sphere) 0.0 9011.2 0.0 5324.8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this wland-passenger)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wland-passenger" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *wland-passenger-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this anim-shuffle) 4) + (set! (-> this anim-walk) 4) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 19) + (set! (-> this speed-run) 49152.0) + (set! (-> this water-anim) -1) + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer wland-passenger). +(defun spawn-wlander ((arg0 desert-passenger-info) (arg1 process)) + (let ((s5-0 (new 'stack-no-clear 'wland-passenger-init-by-other-params))) + (set! (-> s5-0 position quad) (-> arg0 passenger-pos quad)) + (quaternion-identity! (-> s5-0 rotation)) + (set! (-> s5-0 velocity quad) (the-as uint128 0)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 flags) (traffic-spawn-flags tsf0)) + (set! (-> s5-0 is-dead?) (-> arg0 is-final?)) + (set! (-> s5-0 parent) (process->handle arg1)) + (process-spawn wland-passenger s5-0 :name "wland-passenger" :to arg1) + ) + ) + +;; WARN: disable def twice: 20. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this wland-passenger) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('impact-impulse) + (when (= arg0 (send-event *target* 'get-vehicle)) + (let ((t9-1 (method-of-type enemy event-handler))) + (t9-1 this arg0 arg1 arg2 arg3) + ) + (let ((v0-1 (the-as object (logior (-> this root penetrated-by) (penetrate vehicle))))) + (set! (-> this root penetrated-by) (the-as penetrate v0-1)) + v0-1 + ) + ) + ) + (('set-nav-mesh) + (when (and (-> this next-state) (= (-> this next-state name) 'inactive)) + (let ((a0-8 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) + (when a0-8 + (change-to a0-8 this) + (if (not (-> this nav)) + (go-inactive this) + ) + (let ((v1-20 (-> this nav state))) + (set! (-> v1-20 current-poly) (the-as nav-poly #f)) + ) + 0 + (citizen-method-195 this) + (citizen-method-194 this) + (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (go (method-of-object this active)) + ) + ) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate inactive (wland-passenger) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-nav-mesh) + (event-handler self proc argc message block) + ) + ) + ) + ) + +(defmethod on-dying ((this wland-passenger)) + (call-parent-method this) + (none) + ) + +(defmethod go-die ((this wland-passenger)) + (send-event (handle->process (-> this task-man)) 'fail-delay) + (call-parent-method this) + ) + +(defmethod cleanup-for-death ((this wland-passenger)) + (send-event (handle->process (-> this task-man)) 'fail-delay) + (call-parent-method this) + (none) + ) + +(defmethod get-penetrated-by ((this wland-passenger)) + ((method-of-type enemy get-penetrated-by) this) + ) + +(defmethod citizen-method-194 ((this wland-passenger)) + (call-parent-method this) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (none) + ) + +(defmethod go-hostile ((this wland-passenger)) + (go (method-of-object this active)) + ) + +(defmethod get-inv-mass ((this wland-passenger)) + 0.5 + ) + +(defmethod lerp-damage ((this wland-passenger) (arg0 float)) + (lerp-scale 0.0 (* 0.3 (-> this enemy-info default-hit-points)) arg0 20480.0 122880.0) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc b/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc index 9001f57c85..0f11c6562f 100644 --- a/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc +++ b/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc @@ -151,7 +151,7 @@ ) (when (and v1-0 (!= s5-0 27) *vehicle-manager*) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 object-type) (traffic-type guard-a)) (set! (-> s4-0 behavior) (the-as uint 0)) (set! (-> s4-0 id) (the-as uint 0)) (set! (-> s4-0 nav-mesh) #f) diff --git a/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc b/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc index 152a2def1c..d246a25557 100644 --- a/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc +++ b/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc @@ -138,7 +138,7 @@ (let ((s3-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0))) (vector-z-quaternion! (-> s3-0 vec) arg1) (vector-float*! (-> s3-0 vec) (-> s3-0 vec) (-> this target-speed)) - (set! (-> s3-0 params object-type) (the-as uint 6)) + (set! (-> s3-0 params object-type) (traffic-type guard-a)) (set! (-> s3-0 params behavior) (the-as uint 3)) (set! (-> s3-0 params id) (the-as uint 0)) (set! (-> s3-0 params nav-mesh) (-> this nav-mesh)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc index 3694ce949e..eb8bafc667 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc @@ -362,11 +362,11 @@ (none) ) +;; WARN: Return type mismatch int vs object. (defmethod rigid-body-object-method-30 ((this v-marauder)) ((method-of-type wvehicle rigid-body-object-method-30) this) (new 'stack-no-clear 'vector) 0 - (none) ) (defmethod setup-draw-masks ((this v-marauder) (arg0 int)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar.gc b/goal_src/jak3/levels/desert/wvehicle/wcar.gc index d855e60783..5cc1981bc9 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar.gc @@ -46,7 +46,7 @@ ) :name '*v-turtle-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-turtle) :engine (new 'static 'vehicle-engine-info @@ -323,7 +323,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -372,7 +372,7 @@ ) :name '*v-snake-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-snake) :engine (new 'static 'vehicle-engine-info @@ -648,7 +648,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -701,7 +701,7 @@ ) :name '*v-scorpion-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-scorpion) :engine (new 'static 'vehicle-engine-info @@ -978,7 +978,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -2730.6667 @@ -1090,7 +1090,7 @@ ) :name '*v-toad-constants* :flags #x386318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-toad) :engine (new 'static 'vehicle-engine-info @@ -1356,7 +1356,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -1407,7 +1407,7 @@ ) :name '*v-fox-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-fox) :engine (new 'static 'vehicle-engine-info @@ -1683,7 +1683,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -1734,7 +1734,7 @@ ) :name '*v-rhino-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-rhino) :engine (new 'static 'vehicle-engine-info @@ -2010,7 +2010,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -21845.334 :gun-yaw-max 21845.334 :gun-pitch-min -5461.3335 @@ -2122,7 +2122,7 @@ ) :name '*v-mirage-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-mirage) :engine (new 'static 'vehicle-engine-info @@ -2398,7 +2398,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 0.75 :y 0.9 :z 1.05 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 0.75 :y 0.9 :z 1.05 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -2451,7 +2451,7 @@ ) :name '*v-x-ride-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-x-ride) :engine (new 'static 'vehicle-engine-info @@ -2727,7 +2727,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 0.9 :y 1.1 :z 0.9 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 0.9 :y 1.1 :z 0.9 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -2778,7 +2778,7 @@ ) :name '*v-marauder-constants* :flags #x81310 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-marauder) :engine (new 'static 'vehicle-engine-info @@ -3054,7 +3054,7 @@ :shadow-bot-clip -32768.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -3106,7 +3106,7 @@ ) :name '*v-faccar-constants* :flags #x287318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-faccar) :engine (new 'static 'vehicle-engine-info @@ -3380,7 +3380,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -3430,7 +3430,7 @@ ) :name '*v-catapult-constants* :flags #x80010 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-catapult) :engine (new 'static 'vehicle-engine-info @@ -3704,7 +3704,7 @@ :shadow-bot-clip -32768.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc index 74c965eeab..772e1ec771 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc @@ -192,13 +192,13 @@ (none) ) +;; WARN: Return type mismatch int vs object. (defmethod rigid-body-object-method-30 ((this vehicle-wheel)) (ja-post) (if (logtest? (-> this rbody flags) (rigid-body-flag enable-collision)) (update-transforms (-> this root)) ) 0 - (none) ) (defmethod rbody-post ((this vehicle-wheel)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc index b0de05a383..783bbc7756 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc @@ -317,7 +317,7 @@ ) ) -;; WARN: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs object. (defmethod rigid-body-object-method-30 ((this wvehicle)) (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag sounds)))) (let ((f0-0 (-> this player-dist2)) @@ -343,7 +343,7 @@ (set! (-> a0-13 prev-flags) (-> a0-13 flags)) ) ) - (none) + #f ) (defmethod wvehicle-method-162 ((this wvehicle) (arg0 float)) diff --git a/goal_src/jak3/levels/factory/car/hvehicle-h.gc b/goal_src/jak3/levels/factory/car/hvehicle-h.gc index 8537300133..91b2e2af3e 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle-h.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle-h.gc @@ -5,7 +5,8 @@ ;; name in dgo: hvehicle-h ;; dgos: HGA, CWI, LFACTORY -(define-extern *ff-squad-control* squad-control) +(declare-type ff-squad-control squad-control) +(define-extern *ff-squad-control* ff-squad-control) (declare-type citizen-norm-rider process-focusable) (define-extern vehicle-rider-spawn (function vehicle type traffic-object-spawn-params process)) diff --git a/goal_src/jak3/levels/factory/car/hvehicle.gc b/goal_src/jak3/levels/factory/car/hvehicle.gc index 682bcba8ca..7960008eaf 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle.gc @@ -281,7 +281,6 @@ ) ) ((method-of-type vehicle rigid-body-object-method-30) this) - (none) ) (defmethod rigid-body-object-method-54 ((this hvehicle)) diff --git a/goal_src/jak3/levels/factory/h-warf.gc b/goal_src/jak3/levels/factory/h-warf.gc index 8b3edb541d..886cf871ef 100644 --- a/goal_src/jak3/levels/factory/h-warf.gc +++ b/goal_src/jak3/levels/factory/h-warf.gc @@ -46,7 +46,7 @@ ) :name '*h-warf-constants* :flags #x40408 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 vt27) :transmission (new 'static 'vehicle-transmission-info :gear-count 1) @@ -327,7 +327,7 @@ :shadow-bot-clip -40960.0 :shadow-locus-dist 409600.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 diff --git a/goal_src/jak3/levels/forest/foresta-obs.gc b/goal_src/jak3/levels/forest/foresta-obs.gc index d70bcdae49..139f16de22 100644 --- a/goal_src/jak3/levels/forest/foresta-obs.gc +++ b/goal_src/jak3/levels/forest/foresta-obs.gc @@ -338,7 +338,7 @@ (art-group-get-by-name *level* "skel-for-jump-pad" (the-as (pointer level) #f)) ) -(defmethod bouncer-method-24 ((this for-jump-pad)) +(defmethod init-collision! ((this for-jump-pad)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (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)) diff --git a/goal_src/jak3/levels/glider/h-glider.gc b/goal_src/jak3/levels/glider/h-glider.gc index 84779bed51..9aefd05241 100644 --- a/goal_src/jak3/levels/glider/h-glider.gc +++ b/goal_src/jak3/levels/glider/h-glider.gc @@ -34,7 +34,7 @@ ) :name '*h-glider-constants* :flags #x40428 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 vt27) :transmission (new 'static 'vehicle-transmission-info :gear-count 1) @@ -275,7 +275,7 @@ :shadow-bot-clip -40960.0 :shadow-locus-dist 409600.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -1286,7 +1286,7 @@ ) ) -;; WARN: Return type mismatch uint128 vs none. +;; WARN: Return type mismatch uint128 vs object. (defmethod rigid-body-object-method-30 ((this h-glider)) (let ((t9-0 (method-of-type hvehicle rigid-body-object-method-30))) (t9-0 this) @@ -1299,8 +1299,8 @@ ) (let ((v0-1 (-> this root trans quad))) (set! (-> this root trans-old quad) v0-1) + v0-1 ) - (none) ) (defmethod vehicle-method-94 ((this h-glider)) diff --git a/goal_src/jak3/levels/intro/intro-obs.gc b/goal_src/jak3/levels/intro/intro-obs.gc index c1cb75f25e..cef1ca7ae4 100644 --- a/goal_src/jak3/levels/intro/intro-obs.gc +++ b/goal_src/jak3/levels/intro/intro-obs.gc @@ -7,3 +7,42 @@ ;; DECOMP BEGINS +(deftype ctypal-ctyfarma (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defskelgroup skel-ctypal-ctyfarma ctypal-ctyfarma ctypal-ctyfarma-lod0-jg ctypal-ctyfarma-idle-ja + ((ctypal-ctyfarma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 640) + ) + +(defstate idle (ctypal-ctyfarma) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this ctypal-ctyfarma) (arg0 entity-actor)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctypal-ctyfarma" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/intro/intro-part.gc b/goal_src/jak3/levels/intro/intro-part.gc index a3919a8e8e..2e108a17c4 100644 --- a/goal_src/jak3/levels/intro/intro-part.gc +++ b/goal_src/jak3/levels/intro/intro-part.gc @@ -5,5 +5,2391 @@ ;; name in dgo: intro-part ;; dgos: INTROCST +(define-extern *range-intro-dust-color* curve-color-fast) +(define-extern *range-intro-dust-alpha* curve2d-fast) +(define-extern *range-intro-dust-scale-x* curve2d-fast) +(define-extern *range-intro-dust-scale-y* curve2d-fast) +(define-extern *curve-intro-dust-alpha* curve2d-fast) +(define-extern *curve-intro-dust-scale-x* curve2d-fast) +(define-extern *curve-intro-dust-scale-y* curve2d-fast) +(define-extern *curve-intro-dust-cloud-alpha* curve2d-fast) +(define-extern *curve-intro-dust-cloud-scale-x* curve2d-fast) +(define-extern *curve-intro-dust-cloud-scale-y* curve2d-fast) +(define-extern *range-intro-pecker-dust-scale-x* curve2d-fast) +(define-extern *range-intro-pecker-dust-scale-y* curve2d-fast) +(define-extern *curve-intro-pecker-dust-scale-x* curve2d-fast) +(define-extern *curve-intro-pecker-dust-scale-y* curve2d-fast) +(define-extern *range-color-desert-impact-dust* curve-color-fast) +(define-extern *range-alpha-desert-impact-dust* curve2d-fast) +(define-extern *range-scale-desert-impact-dust-x* curve2d-fast) +(define-extern *range-scale-desert-impact-dust-y* curve2d-fast) +(define-extern *curve-alpha-desert-impact-dust* curve2d-fast) +(define-extern *curve-desert-impact-dust-x* curve2d-fast) +(define-extern *curve-desert-impact-dust-y* curve2d-fast) +(define-extern *range-alpha-desert-impact-dust-blow* curve2d-fast) +(define-extern *range-scale-desert-impact-dust-blow-x* curve2d-fast) +(define-extern *range-scale-desert-impact-dust-blow-y* curve2d-fast) +(define-extern *curve-alpha-desert-impact-dust-blow* curve2d-fast) +(define-extern *curve-desert-impact-dust-blow-x* curve2d-fast) +(define-extern *curve-desert-impact-dust-blow-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-drop-shooting-dust + :id 1191 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4101 :flags (sp7) :period (seconds 10) :length (seconds 0.035))) + ) + +(defpart 4101 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 10.0) + (:scale-x (meters 5) (meters 10)) + (:scale-y :copy scale-x) + (:r 130.0) + (:g 110.0) + (:b 70.0) + (:a 64.0) + (:vel-z (meters -0.06666667) (meters -0.26666668)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 20)) + (:conerot-y (degrees -10) (degrees -32)) + ) + ) + +(defpartgroup group-drop-dust-trail + :id 1192 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4102 :flags (sp7))) + ) + +(defpart 4102 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 10.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters 0) (meters 0.00016666666)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-intro-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 140.0 :y 120.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 100.0 :y 80.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 100.0 :y 80.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 100.0 :y 80.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-intro-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 32.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 8.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-intro-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 3.3 :z 4.3 :w 5.3) + :one-over-x-deltas (new 'static 'vector :x 0.29999995 :y 1.0000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-intro-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 3.3 :z 4.3 :w 5.3) + :one-over-x-deltas (new 'static 'vector :x 0.29999995 :y 1.0000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-intro-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -0.5 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :z -2.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-intro-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 5.0 :z 6.0 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 16.666666 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-intro-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 5.0 :z 6.0 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 16.666666 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +(define *part-drop-dust-trail-curve-settings* + (new 'static 'particle-curve-settings :lifetime-offset (seconds 4) :flags (particle-curve-flags pcf0)) + ) + +(set! (-> *part-id-table* 4102 init-specs 15 initial-valuef) + (the-as float *part-drop-dust-trail-curve-settings*) + ) + +(set! (-> *part-drop-dust-trail-curve-settings* color-start) *range-intro-dust-color*) + +(set! (-> *part-drop-dust-trail-curve-settings* alpha-start) *range-intro-dust-alpha*) + +(set! (-> *part-drop-dust-trail-curve-settings* scale-x-start) *range-intro-dust-scale-x*) + +(set! (-> *part-drop-dust-trail-curve-settings* scale-y-start) *range-intro-dust-scale-y*) + +(set! (-> *part-drop-dust-trail-curve-settings* r-scalar) #f) + +(set! (-> *part-drop-dust-trail-curve-settings* g-scalar) #f) + +(set! (-> *part-drop-dust-trail-curve-settings* b-scalar) #f) + +(set! (-> *part-drop-dust-trail-curve-settings* a-scalar) *curve-intro-dust-alpha*) + +(set! (-> *part-drop-dust-trail-curve-settings* scale-x-scalar) *curve-intro-dust-scale-x*) + +(set! (-> *part-drop-dust-trail-curve-settings* scale-y-scalar) *curve-intro-dust-scale-y*) + +(defpartgroup group-drop-dust-landing + :id 1193 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4103 :flags (sp7))) + ) + +(defpart 4103 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters 0) (meters 0.00016666666)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(define *part-drop-dust-landing-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4103 init-specs 15 initial-valuef) + (the-as float *part-drop-dust-landing-curve-settings*) + ) + +(set! (-> *part-drop-dust-landing-curve-settings* color-start) *range-intro-dust-color*) + +(set! (-> *part-drop-dust-landing-curve-settings* alpha-start) *range-intro-dust-alpha*) + +(set! (-> *part-drop-dust-landing-curve-settings* scale-x-start) *range-intro-dust-scale-x*) + +(set! (-> *part-drop-dust-landing-curve-settings* scale-y-start) *range-intro-dust-scale-y*) + +(set! (-> *part-drop-dust-landing-curve-settings* r-scalar) #f) + +(set! (-> *part-drop-dust-landing-curve-settings* g-scalar) #f) + +(set! (-> *part-drop-dust-landing-curve-settings* b-scalar) #f) + +(set! (-> *part-drop-dust-landing-curve-settings* a-scalar) *curve-intro-dust-alpha*) + +(set! (-> *part-drop-dust-landing-curve-settings* scale-x-scalar) *curve-intro-dust-scale-x*) + +(set! (-> *part-drop-dust-landing-curve-settings* scale-y-scalar) *curve-intro-dust-scale-y*) + +(defpartgroup group-drop-dust-takeoff + :id 1194 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4104 :flags (sp7))) + ) + +(defpart 4104 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 5.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters 0) (meters 0.00016666666)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(define *part-drop-dust-takeoff-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 5) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4104 init-specs 15 initial-valuef) + (the-as float *part-drop-dust-takeoff-curve-settings*) + ) + +(set! (-> *part-drop-dust-takeoff-curve-settings* color-start) *range-intro-dust-color*) + +(set! (-> *part-drop-dust-takeoff-curve-settings* alpha-start) *range-intro-dust-alpha*) + +(set! (-> *part-drop-dust-takeoff-curve-settings* scale-x-start) *range-intro-dust-scale-x*) + +(set! (-> *part-drop-dust-takeoff-curve-settings* scale-y-start) *range-intro-dust-scale-y*) + +(set! (-> *part-drop-dust-takeoff-curve-settings* r-scalar) #f) + +(set! (-> *part-drop-dust-takeoff-curve-settings* g-scalar) #f) + +(set! (-> *part-drop-dust-takeoff-curve-settings* b-scalar) #f) + +(set! (-> *part-drop-dust-takeoff-curve-settings* a-scalar) *curve-intro-dust-alpha*) + +(set! (-> *part-drop-dust-takeoff-curve-settings* scale-x-scalar) *curve-intro-dust-scale-x*) + +(set! (-> *part-drop-dust-takeoff-curve-settings* scale-y-scalar) *curve-intro-dust-scale-y*) + +(defpartgroup group-drop-dust-cloud + :id 1195 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4105 :flags (sp7))) + ) + +(defpart 4105 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 20.0) + (:x (meters 0) (meters 2)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-x (meters 0) (meters 0.0033333334)) + (:accel-y (meters 0) (meters 0.00006666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *curve-intro-dust-cloud-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 2.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -2.2222223 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-intro-dust-cloud-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 2.0 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 3.3333333 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-intro-dust-cloud-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 2.0 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 3.3333333 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +(define *part-drop-dust-cloud-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 4) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4105 init-specs 15 initial-valuef) + (the-as float *part-drop-dust-cloud-curve-settings*) + ) + +(set! (-> *part-drop-dust-cloud-curve-settings* color-start) *range-intro-dust-color*) + +(set! (-> *part-drop-dust-cloud-curve-settings* alpha-start) *range-intro-dust-alpha*) + +(set! (-> *part-drop-dust-cloud-curve-settings* scale-x-start) *range-intro-dust-scale-x*) + +(set! (-> *part-drop-dust-cloud-curve-settings* scale-y-start) *range-intro-dust-scale-y*) + +(set! (-> *part-drop-dust-cloud-curve-settings* r-scalar) #f) + +(set! (-> *part-drop-dust-cloud-curve-settings* g-scalar) #f) + +(set! (-> *part-drop-dust-cloud-curve-settings* b-scalar) #f) + +(set! (-> *part-drop-dust-cloud-curve-settings* a-scalar) *curve-intro-dust-cloud-alpha*) + +(set! (-> *part-drop-dust-cloud-curve-settings* scale-x-scalar) *curve-intro-dust-cloud-scale-x*) + +(set! (-> *part-drop-dust-cloud-curve-settings* scale-y-scalar) *curve-intro-dust-cloud-scale-y*) + +(defpartgroup group-drop-pecker-dustoff + :id 1196 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4106 :flags (sp7))) + ) + +(defpart 4106 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 10.0) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-y (meters -0.006666667)) + (:friction 0.99) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees -40) (degrees 80)) + (:conerot-z (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-intro-pecker-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.1 :y 0.2 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 0.1 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-intro-pecker-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.1 :y 0.2 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 0.1 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-intro-pecker-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-intro-pecker-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-drop-pecker-dustoff-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.4) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4106 init-specs 14 initial-valuef) + (the-as float *part-drop-pecker-dustoff-curve-settings*) + ) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* color-start) *range-intro-dust-color*) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* alpha-start) *range-intro-dust-alpha*) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* scale-x-start) *range-intro-pecker-dust-scale-x*) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* scale-y-start) *range-intro-pecker-dust-scale-y*) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* r-scalar) #f) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* g-scalar) #f) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* b-scalar) #f) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* a-scalar) *curve-intro-dust-alpha*) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* scale-x-scalar) *curve-intro-pecker-dust-scale-x*) + +(set! (-> *part-drop-pecker-dustoff-curve-settings* scale-y-scalar) *curve-intro-pecker-dust-scale-y*) + +(defpartgroup group-drop-thrusters-powerdown + :id 1197 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4107 :flags (sp7)) (sp-item 4108 :flags (sp3 sp7)) (sp-item 4109 :flags (sp3 sp7))) + ) + +(defpart 4109 + :init-specs ((:texture (thrust-glob introcst-sprite)) + (:num 3.0) + (:scale-x (meters 2) (meters 2)) + (:rot-x (degrees 67.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 40.0 15.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees -60) 1 (degrees 120)) + (:fade-a -0.05) + (:timer (seconds 2.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:func 'sparticle-track-root) + (:next-time (seconds 2)) + (:next-launcher 4110) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4110 + :init-specs ((:fade-a 1.5) (:next-time (seconds 0.335)) (:next-launcher 4111)) + ) + +(defpart 4111 + :init-specs ((:fade-a -2.55)) + ) + +(defpart 4108 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x (degrees 67.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0 28.0) + (:b 0.0) + (:a 16.0 16.0) + (:omega (degrees 4511.25)) + (:vel-y (meters 0.1)) + (:timer (seconds 2.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:func 'sparticle-track-root) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-drop-thrusters + :id 1198 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4107 :flags (sp7)) + (sp-item 4112 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 4113 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +(defpart 4107 + :init-specs ((:num 1.0) + (:x (meters -2) (meters 4)) + (:y (meters -2) (meters 4)) + (:z (meters -2) (meters 4)) + (:rot-x 5) + (:r 20480.0) + (:g 10240.0) + (:b 8192.0 4096.0) + (:timer (seconds 0.5)) + (:flags (distort launch-along-z)) + ) + ) + +(defpart 4112 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 4.0) + (:scale-x (meters 2) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 40.0 10.0) + (:vel-y (meters 0.1)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4113 + :init-specs ((:texture (glow level-default-sprite)) + (:num 3.0) + (:scale-x (meters 6) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0 28.0) + (:b 0.0) + (:a 8.0 8.0) + (:vel-y (meters 0.1)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-drop-thruster-trail + :id 1199 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4114 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4115 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4116 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4117 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4118 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4119 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4120 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4121 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4122 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4123 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + ) + ) + +(defpart 4114 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters -0.33333334) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4115 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 0) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4116 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4117 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 0.6666667) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4118 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 1) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4119 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 1.3333334) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4120 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 1.6666666) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4121 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 2) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4122 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 2.3333333) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4123 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 2.6666667) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-drop-handcuff-light + :id 1200 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4124 :flags (sp7) :period (seconds 0.335) :length (seconds 0.035)) + (sp-item 4125 :flags (sp6 sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +(defpart 4124 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.03)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4125 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 30.0 20.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-drop-beacon-glow + :id 1201 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4126 :flags (sp3 sp7))) + ) + +(defpart 4126 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017)) + (:next-launcher 4127) + ) + ) + +(defpart 4127 + :init-specs ((:a 0.0) (:next-time (seconds 0.667)) (:next-launcher 4128)) + ) + +(defpart 4128 + :init-specs ((:a 64.0) (:next-time (seconds 0.667)) (:next-launcher 4127)) + ) + +(defpartgroup group-hellcat-thrusters + :id 1202 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4129 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 4130 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +(defpart 4129 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -1)) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 3) (meters 1)) + (:r 10.0 20.0) + (:g 200.0) + (:b 255.0) + (:a 40.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4130 + :init-specs ((:texture (glow level-default-sprite)) + (:num 3.0) + (:scale-x (meters 4) (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 8.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hellcat-thruster-trail + :id 1203 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4131 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4132 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + ) + ) + +(defpart 4131 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 30.0 10.0) + (:vel-y (meters 0) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.23333333 -0.46666667) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4132 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 30.0 10.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.13333334 -0.26666668) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hellcat-thruster-little-trail + :id 1204 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4133 :flags (sp7))) + ) + +(defpart 4133 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 2.0) + (:y (meters 0) (meters 5)) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 30.0 10.0) + (:vel-y (meters 0.016666668)) + (:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.06666667 -0.06666667) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hellcat-thruster-fire-trail + :id 1205 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4134 :flags (sp7))) + ) + +(defpart 4134 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 5)) + (:scale-x (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 20.0) + (:b 0.0) + (:a 100.0 30.0) + (:vel-y (meters 0.016666668)) + (:scalevel-x (meters 0.02) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21666667 -0.21666667) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hellcat-thruster-thick-trail + :id 1206 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4135 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4136 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + ) + ) + +(defpart 4135 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y (meters 1)) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 30.0 10.0) + (:vel-y (meters 0) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.13333334 -0.26666668) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4136 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y (meters 1)) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 60.0 10.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.23333333 -0.46666667) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-palace-hellcat-explode + :id 1207 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4137 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4138 :period (seconds 32) :length (seconds 0.167)) + (sp-item 4139 :period (seconds 32) :length (seconds 0.017)) + ) + ) + +(defpart 4137 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4138 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 10) (meters 5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.01) (meters 0.1)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9 0.09) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4139 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 5.0) + (:scale-x (meters 20) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-palace-missile + :id 1208 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4141 :binding 4140) + (sp-item 4140 :flags (sp2) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 4142) + ) + ) + +(defpart 4141 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 4140 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 90.0 30.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +(defpart 4142 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 2)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0 28.0) + (:b 0.0) + (:a 12.0 12.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-palace-missile-explode + :id 1209 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4143 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4144 :period (seconds 32) :length (seconds 0.167)) + (sp-item 4145 :period (seconds 32) :length (seconds 0.017)) + ) + ) + +(defpart 4143 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 300)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4144 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 30) (meters 20)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.033333335) (meters 0.26666668)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9 0.09) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4145 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 5.0) + (:scale-x (meters 60) (meters 20)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.2)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-palace-small-explode + :id 1210 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4146 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4147 :period (seconds 32) :length (seconds 0.167)) + (sp-item 4148 :period (seconds 32) :length (seconds 0.017)) + ) + ) + +(defpart 4146 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 300)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4147 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 3.0) + (:scale-x (meters 30) (meters 20)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.033333335) (meters 0.26666668)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9 0.09) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4148 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 3.0) + (:scale-x (meters 60) (meters 20)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.2)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-palace-huge-explosion + :id 1211 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4150 :flags (sp3)) + (sp-item 4151 :period (seconds 32) :length (seconds 0.167)) + (sp-item 4152 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + ) + ) + +(defpart 4150 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 100)) + (:scale-x (meters 800)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.035555556) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4151 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 60) (meters 40)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.06666667) (meters 0.53333336)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.044444446) + (:fade-b -0.016666668) + (:fade-a -0.14166667 -0.14166667) + (:friction 0.9 0.09) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4152 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 5.0) + (:scale-x (meters 120) (meters 80)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.6666667)) + (:scalevel-x (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.044444446) + (:fade-b -0.016666668) + (:fade-a -0.14166667 -0.14166667) + (:friction 0.93) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4153 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 1.0) + (:scale-x (meters 120)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 1.3333334)) + (:scalevel-x (meters -0.16666667) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0033333334)) + (:friction 0.991 0.008) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 90)) + (:rotate-y (degrees 70) (degrees 40)) + ) + ) + +(defpart 4149 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-dust-inherit-scaler) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 64.0) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.044444446) + (:fade-b -0.016666668) + (:accel-y (meters 0) (meters -0.001)) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-palace-smoke-plume :id 1212 :bounds (static-bspherem 0 0 0 640) :parts ((sp-item 4154))) + +(defpart 4154 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.2) + (:x (meters -6) (meters 12)) + (:scale-x (meters 30) (meters 30)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-x (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.1) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.021333333 -0.021333333) + (:accel-y (meters 0.0033333334)) + (:friction 0.99) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun birth-func-dust-inherit-scaler ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((v1-1 (-> arg4 sprite sprite))) + (set! (-> arg2 launchrot w) (* (-> v1-1 x-y-z-sx w) (-> arg2 launchrot w))) + (set! (-> arg2 conerot w) (* (-> v1-1 flag-rot-sy w) (-> arg2 conerot w))) + ) + 0 + (none) + ) + +(defpartgroup group-palace-dust-cloud-first + :id 1213 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4155 :period (seconds 32) :length (seconds 0.067)) + (sp-item 4156 :period (seconds 32) :length (seconds 0.067)) + ) + ) + +(defpart 4155 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:num 20.0) + (:x (meters 0)) + (:y (meters -10)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:rot-z (degrees -80) (degrees 20)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-x (meters 0.5) (meters 0.33333334)) + (:scalevel-x (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.955 0.005) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 4157) + (:conerot-z (degrees -8) (degrees 10)) + (:rotate-y (degrees 40) (degrees 180)) + ) + ) + +(defpart 4157 + :init-specs ((:fade-g -1.0) (:fade-b -2.0) (:next-time (seconds 0.017)) (:next-launcher 4158)) + ) + +(defpart 4158 + :init-specs ((:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.917)) (:next-launcher 4159)) + ) + +(defpart 4159 + :init-specs ((:scalevel-x (meters 0.016666668)) (:scalevel-y :copy scalevel-x) (:friction 0.0)) + ) + +(defpart 4156 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 20.0) + (:x (meters -60) (meters 120)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 2)) + (:r 200.0 55.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.16666667)) + (:scalevel-x (meters 0.06666667)) + (:rotvel-z (degrees -1.3333334) (degrees 2.6666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 5)) + (:flags (aux-list sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x408b00 #x40a200 #x40a600 #x40aa00 #x400600)) + (:next-time (seconds 0.017)) + (:next-launcher 4160) + (:conerot-x (degrees -30) (degrees 60)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4160 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.0) + (:fade-b -2.0) + (:next-time (seconds 0.017)) + (:next-launcher 4161) + ) + ) + +(defpart 4161 + :init-specs ((:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpartgroup group-palace-dust-cloud-big + :id 1214 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4162 :period (seconds 32) :length (seconds 0.5))) + ) + +(defpart 4162 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:num 0.5) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.33333334) (meters 0.6666667)) + (:scalevel-x (meters 1) (meters 1)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64 1.28) + (:friction 0.97) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.017)) + (:next-launcher 4163) + (:conerot-x (degrees -30) (degrees 60)) + ) + ) + +(defpart 4163 + :init-specs ((:fade-g -1.0) (:fade-b -2.0) (:next-time (seconds 0.017)) (:next-launcher 4164)) + ) + +(defpart 4164 + :init-specs ((:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.167)) (:next-launcher 4165)) + ) + +(defpart 4165 + :init-specs ((:scalevel-x (meters 0.06666667)) (:scalevel-y :copy scalevel-x) (:fade-a -0.021333333 -0.021333333)) + ) + +(defpartgroup group-palace-flak + :id 1215 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4166 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4167 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4168 :period (seconds 32) :length (seconds 0.035)) + (sp-item 4169 :period (seconds 32) :length (seconds 0.017)) + ) + ) + +(defpart 4166 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 150.0) + (:a 255.0) + (:scalevel-x (meters -0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-a -8.5) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4167 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 60)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.64) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4168 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 10.0) + (:scale-x (meters 9) (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.6666667)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.14222223 -0.14222223) + (:accel-x (meters 0.016666668)) + (:friction 0.88) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 launch-along-z)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4170 + :init-specs ((:vel-x (meters 0.1)) (:friction 1.0)) + ) + +(defpart 4169 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:scale-x (meters 10) (meters 50)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 10.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0) (meters 0.33333334)) + (:scalevel-x (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.128) + (:accel-x (meters 0.016666668)) + (:friction 0.88) + (:timer (seconds 3.335)) + (:flags (launch-along-z)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-palace-tracer-fire + :id 1216 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4171 :flags (sp7) :period (seconds 5) :length (seconds 1))) + ) + +(defpart 4171 + :init-specs ((:texture (enemy-tracer intpfall-sprite)) + (:num 0.0 0.3) + (:scale-x (meters 50)) + (:rot-x 4) + (:scale-y (meters 5) (meters 5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 60.0) + (:omega (degrees 0.7875) (degrees 0.1125)) + (:vel-y (meters 0.2) (meters 0.06666667)) + (:timer (seconds 3) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -30) (degrees 60)) + ) + ) + +(defpartgroup group-ctypal-palace-break-explode-small + :id 1217 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 249)) + ) + +(defpartgroup group-ctypal-palace-break-explode-fountain + :id 1218 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 249)) + ) + +(defpartgroup group-ctypal-palace-break-explode-medium + :id 1219 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 249)) + ) + +(defpartgroup group-ctypal-palace-break-explode-large + :id 1220 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 249)) + ) + +(defpartgroup group-ctypal-support-break-trailer + :id 1221 + :duration (seconds 1) + :linger-duration (seconds 3) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 4172 :flags (sp7))) + ) + +(defpart 4172 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:y (meters -40) (meters 80)) + (:scale-x (meters 20) (meters 20)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:scalevel-x (meters 0.026666667) (meters 0.04)) + (:scalevel-y :copy scalevel-x) + (:fade-a 1.28) + (:accel-y (meters -0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4173) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4173 + :init-specs ((:fade-a -0.11636364 -0.11636364)) + ) + +(defpartgroup group-ctypal-palace-break-trailer-small + :id 1222 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4174)) + ) + +(defpart 4174 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.3) + (:y (meters 0) (meters -10)) + (:scale-x (meters 12) (meters 12)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-y (meters 0) (meters 0.05)) + (:scalevel-x (meters 0.026666667) (meters 0.04)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16 0.16) + (:accel-y (meters -0.00025) (meters -0.0001)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.5)) + (:next-launcher 4175) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 16)) + ) + ) + +(defpart 4176 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +(defpartgroup group-ctypal-palace-break-trailer-medium + :id 1223 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 249)) + ) + +(defpart 4177 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.6) + (:y (meters 0) (meters -10)) + (:scale-x (meters 24) (meters 24)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-y (meters 0) (meters 0.05)) + (:scalevel-x (meters 0.053333335) (meters 0.08)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16 0.16) + (:accel-y (meters -0.00025) (meters -0.0001)) + (:friction 0.98) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.5)) + (:next-launcher 4175) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 16)) + ) + ) + +(defpart 4178 + :init-specs ((:fade-a -0.04 -0.04)) + ) + +(defpartgroup group-ctypal-palace-break-trailer-large + :id 1224 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 249)) + ) + +(defpart 4179 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.6) + (:scale-x (meters 80) (meters 80)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.06666667)) + (:scalevel-x (meters 0.12) (meters 0.16)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16 0.16) + (:accel-y (meters -0.00025) (meters -0.0001)) + (:friction 0.98) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.5)) + (:next-launcher 4175) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 16)) + ) + ) + +(defpart 4175 + :init-specs ((:fade-a -0.053333335 -0.053333335)) + ) + +(defpartgroup group-drop-desert-heathaze + :id 1225 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 4180 :falloff-to (meters 50) :flags (sp7))) + ) + +(defpart 4180 + :init-specs ((:num 1.0 1.0) + (:x (meters -12) (meters 24)) + (:y (meters -2) (meters 2)) + (:z (meters -20)) + (:rot-x 8) + (:r 24576.0) + (:g 12288.0) + (:b 12288.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:fade-b 3.4133334) + (:timer (seconds 2)) + (:flags (distort launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 4181) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-lost-desert-heathaze + :id 1226 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 4182 :falloff-to (meters 50) :flags (sp7))) + ) + +(defpart 4182 + :init-specs ((:num 2.0) + (:x (meters -2) (meters 4)) + (:y (meters 0) (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:accel-y (meters 0.00066666666)) + (:friction 0.75) + (:timer (seconds 1.5) (seconds 1.497)) + ) + ) + +(defpartgroup group-tired-desert-heathaze + :id 1227 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4183 :flags (sp7))) + ) + +(defpart 4183 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -70) (meters 140)) + (:rot-x 8) + (:r 24576.0) + (:g 12288.0) + (:b 12288.0) + (:fade-b 3.4133334) + (:accel-y (meters 0.005) (meters 0.006666667)) + (:accel-z (meters -0.0026666666) (meters 0.0053333333)) + (:friction 0.8) + (:timer (seconds 2)) + (:flags (distort launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 4181) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4181 + :init-specs ((:fade-b -3.4133334)) + ) + +(defpartgroup group-desert-impact-dust :id 1228 :bounds (static-bspherem 0 0 0 10) :parts ((sp-item 4184))) + +(defpart 4184 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 6.0) + (:scale-x (meters 1)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.026666667) (meters 0.01)) + (:rotvel-z (degrees -0.06666667) (degrees 0.13333334)) + (:accel-y (meters 0.00016666666)) + (:friction 0.8) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-color-desert-impact-dust* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 190.0 :y 140.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 130.0 :y 100.0 :z 60.0 :w 128.0) + (new 'static 'vector :x 130.0 :y 100.0 :z 60.0 :w 128.0) + (new 'static 'vector :x 130.0 :y 100.0 :z 60.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-alpha-desert-impact-dust* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-desert-impact-dust-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 1.4 :w 2.4) + :one-over-x-deltas (new 'static 'vector :x 0.2 :y 1.0 :z 1.0000001 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-desert-impact-dust-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 1.4 :w 2.4) + :one-over-x-deltas (new 'static 'vector :x 0.2 :y 1.0 :z 1.0000001 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-alpha-desert-impact-dust* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-desert-impact-dust-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 2.5 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-desert-impact-dust-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 2.5 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-desert-impact-dust-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4184 init-specs 16 initial-valuef) + (the-as float *part-desert-impact-dust-curve-settings*) + ) + +(set! (-> *part-desert-impact-dust-curve-settings* color-start) *range-color-desert-impact-dust*) + +(set! (-> *part-desert-impact-dust-curve-settings* alpha-start) *range-alpha-desert-impact-dust*) + +(set! (-> *part-desert-impact-dust-curve-settings* scale-x-start) *range-scale-desert-impact-dust-x*) + +(set! (-> *part-desert-impact-dust-curve-settings* scale-y-start) *range-scale-desert-impact-dust-y*) + +(set! (-> *part-desert-impact-dust-curve-settings* r-scalar) #f) + +(set! (-> *part-desert-impact-dust-curve-settings* g-scalar) #f) + +(set! (-> *part-desert-impact-dust-curve-settings* b-scalar) #f) + +(set! (-> *part-desert-impact-dust-curve-settings* a-scalar) *curve-alpha-desert-impact-dust*) + +(set! (-> *part-desert-impact-dust-curve-settings* scale-x-scalar) *curve-desert-impact-dust-x*) + +(set! (-> *part-desert-impact-dust-curve-settings* scale-y-scalar) *curve-desert-impact-dust-y*) + +(defpartgroup group-desert-impact-dust-blow + :id 1229 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4185)) + ) + +(defpart 4185 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 6.0) + (:y (meters 0.2)) + (:scale-x (meters 1)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.026666667) (meters 0.06666667)) + (:rotvel-z (degrees -0.06666667) (degrees 0.13333334)) + (:accel-z (meters -0.006666667)) + (:friction 0.8) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-alpha-desert-impact-dust-blow* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 32.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x 32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-desert-impact-dust-blow-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.8 :w 2.8) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y 0.99999994 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-desert-impact-dust-blow-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.8 :w 2.8) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y 0.99999994 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-alpha-desert-impact-dust-blow* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-desert-impact-dust-blow-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 2.5 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-desert-impact-dust-blow-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 2.5 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-desert-impact-dust-blow-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4185 init-specs 17 initial-valuef) + (the-as float *part-desert-impact-dust-blow-curve-settings*) + ) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* color-start) *range-color-desert-impact-dust*) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* alpha-start) *range-alpha-desert-impact-dust-blow*) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* scale-x-start) + *range-scale-desert-impact-dust-blow-x* + ) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* scale-y-start) + *range-scale-desert-impact-dust-blow-y* + ) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* r-scalar) #f) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* g-scalar) #f) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* b-scalar) #f) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* a-scalar) *curve-alpha-desert-impact-dust-blow*) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* scale-x-scalar) *curve-desert-impact-dust-blow-x*) + +(set! (-> *part-desert-impact-dust-blow-curve-settings* scale-y-scalar) *curve-desert-impact-dust-blow-y*) + +(defpartgroup group-desert-blowing-dust + :id 1230 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4186 :flags (sp7))) + ) + +(defpart 4186 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.5) + (:x (meters 0)) + (:z (meters 20) (meters 20)) + (:scale-x (meters 10) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 80.0) + (:b 50.0) + (:a 0.0) + (:vel-z (meters -0.06666667) (meters -0.06666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:fade-a 0.033333335 0.033333335) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 4187) + ) + ) + +(defpart 4187 + :init-specs ((:fade-a -0.033333335 -0.033333335)) + ) diff --git a/goal_src/jak3/levels/intro/intro-scenes.gc b/goal_src/jak3/levels/intro/intro-scenes.gc index b227eabf8a..59d88f73c8 100644 --- a/goal_src/jak3/levels/intro/intro-scenes.gc +++ b/goal_src/jak3/levels/intro/intro-scenes.gc @@ -7,3 +7,6168 @@ ;; DECOMP BEGINS +(defskelgroup skel-air-train-fma air-train-fma air-train-fma-lod0-jg air-train-fma-idle-ja + ((air-train-fma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 -2 12.5) + :shadow air-train-fma-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + ) + +(defskelgroup skel-beacon beacon beacon-lod0-jg beacon-idle-ja + ((beacon-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :origin-joint-index 3 + ) + +(defskelgroup skel-handcuffs handcuffs handcuffs-lod0-jg handcuffs-idle-ja + ((handcuffs-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :origin-joint-index 3 + ) + +(defskelgroup skel-hellcat-lowres-fma hellcat-lowres-fma hellcat-lowres-fma-lod0-jg hellcat-lowres-fma-idle-ja + ((hellcat-lowres-fma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-palace-break ctypal-palace-break ctypal-palace-break-lod0-jg ctypal-palace-break-idle-ja + ((ctypal-palace-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 500) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-palace-break-a ctypal-palace-break ctypal-palace-break-a-lod0-jg ctypal-palace-break-a-idle-ja + ((ctypal-palace-break-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 750) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-palace-break-b ctypal-palace-break ctypal-palace-break-b-lod0-jg ctypal-palace-break-b-idle-ja + ((ctypal-palace-break-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1000) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-palace-break-c ctypal-palace-break ctypal-palace-break-c-lod0-jg ctypal-palace-break-c-idle-ja + ((ctypal-palace-break-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 640) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-palace-break-d ctypal-palace-break ctypal-palace-break-d-lod0-jg ctypal-palace-break-d-idle-ja + ((ctypal-palace-break-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 640) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-palace-break-e ctypal-palace-break ctypal-palace-break-e-lod0-jg ctypal-palace-break-e-idle-ja + ((ctypal-palace-break-e-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 640) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-cable-break ctypal-cable-break ctypal-cable-break-lod0-jg ctypal-cable-break-idle-ja + ((ctypal-cable-break-lod0-mg (meters 999999))) + :bounds (static-spherem 200 0 0 640) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-support-break ctypal-support-break ctypal-support-break-lod0-jg ctypal-support-break-idle-ja + ((ctypal-support-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -150 0 300) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-rail ctypal-rail ctypal-rail-lod0-jg ctypal-rail-idle-ja + ((ctypal-rail-lod0-mg (meters 999999))) + :bounds (static-spherem -40 0 35 75) + :origin-joint-index 3 + ) + +(defskelgroup skel-ctypal-base-break ctypal-base-break ctypal-base-break-lod0-jg ctypal-base-break-idle-ja + ((ctypal-base-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 500) + :origin-joint-index 3 + ) + +(load-scene + (new 'static 'scene + :name "intro-drop" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-110" + :art-group "scenecamera" + :anim "intro-drop" + :parts 59 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float 0)) + (send-event *time-of-day* 'change 'hour (int 18)) + (apply ,(lambda :behavior scene-player + () + (let ((v1-1 (level-get *level* 'wasintro))) + (if v1-1 + (set! (-> v1-1 info fog-mult) 100.0) + ) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (none) + ) + ) + (send-event + "air-train-fma" + 'shadow-bot-plane + (float (new 'static 'bfloat)) + (float (new 'static 'bfloat :data 1.0)) + (float (new 'static 'bfloat)) + (meters (new 'static 'bfloat :data 50.0)) + ) + (send-event "air-train-fma" 'shadow-fade-dist (meters (new 'static 'bfloat :data 200.0))) + (fadein (frame-time-30 60)) + (part-tracker + "group-drop-dust-trail" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 0 360) + ) + (part-tracker + "group-drop-thrusters" + entity + "air-train-fma" + joint + "thruster_l" + track + #t + duration + (frame-range 0 720) + ) + (part-tracker + "group-drop-thruster-trail" + entity + "air-train-fma" + joint + "thruster_l" + track + #t + duration + (frame-range 0 720) + ) + (part-tracker + "group-drop-thrusters" + entity + "air-train-fma" + joint + "thruster_r" + track + #t + duration + (frame-range 0 720) + ) + (part-tracker + "group-drop-thruster-trail" + entity + "air-train-fma" + joint + "thruster_r" + track + #t + duration + (frame-range 0 720) + ) + ) + (20 (apply ,(lambda :behavior scene-player + () + (case (scf-get-territory) + ((1) + (talker-spawn-func (-> *talker-speech* 58) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((3) + (talker-spawn-func (-> *talker-speech* 60) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (else + (talker-spawn-func (-> *talker-speech* 57) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (none) + ) + ) + ) + (245 + (apply + ,(lambda :behavior scene-player + () + (process-spawn-function + process + (lambda :behavior scene-player + () + (logclear! (-> self mask) (process-mask pause)) + (let ((gp-0 (new 'stack 'hud-sprite)) + (s5-0 (level-get *level* 'inttitle)) + (f30-0 0.0) + ) + (set! (-> gp-0 flags) (hud-sprite-flags hsf3)) + (set! (-> gp-0 tid) (the-as texture-id (get-texture NaughtyDog inttitle-minimap))) + (set-vector! (-> gp-0 pos) 256 180 #xffffff 0) + (let ((v1-6 (-> gp-0 color-ptr))) + (set! (-> v1-6 0) 128) + (set! (-> v1-6 1) 128) + (set! (-> v1-6 2) 128) + (set! (-> v1-6 3) 128) + ) + (set! (-> gp-0 scale-x) 1.0) + (set! (-> gp-0 scale-y) 1.0) + (when (and s5-0 (-> gp-0 tid)) + (let ((s4-0 (current-time))) + (until (time-elapsed? s4-0 (seconds 3)) + (let ((f0-2 1.0)) + (cond + ((< f30-0 1.0) + (set! f0-2 f30-0) + ) + ((< 2.0 f30-0) + (set! f0-2 (- 3.0 f30-0)) + ) + ) + (set! (-> gp-0 color w) (the int (* 128.0 f0-2))) + ) + (with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-pris2) + ) + (draw gp-0 s2-0 s5-0 #f) + ) + (if (not (paused?)) + (+! f30-0 (seconds-per-frame)) + ) + (suspend) + ) + ) + ) + ) + (none) + ) + :name "logo-naughtydog" + :to self + ) + (none) + ) + ) + ) + (496 + (part-tracker + "group-drop-dust-trail" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 496 540) + ) + ) + (520 + (apply + ,(lambda :behavior scene-player + () + (process-spawn-function + process + (lambda :behavior scene-player + () + (logclear! (-> self mask) (process-mask pause)) + (let ((gp-0 (new 'stack 'hud-sprite)) + (s5-0 (new 'stack 'hud-sprite)) + (s4-0 (level-get *level* 'inttitle)) + (f30-0 0.0) + ) + (set! (-> gp-0 flags) (hud-sprite-flags hsf3)) + (set! (-> gp-0 scale-x) 0.85) + (set! (-> gp-0 scale-y) 0.85) + (let ((v1-8 (-> gp-0 color-ptr))) + (set! (-> v1-8 0) 128) + (set! (-> v1-8 1) 128) + (set! (-> v1-8 2) 128) + (set! (-> v1-8 3) 128) + ) + (scf-get-territory) + (set-vector! (-> gp-0 pos) 256 188 #xffffff 0) + (set! (-> gp-0 tid) (the-as texture-id (get-texture JakIII inttitle-minimap))) + (set! (-> s5-0 tid) (the-as texture-id #f)) + (when (and s4-0 (-> gp-0 tid)) + (let ((s3-0 (current-time))) + (until (time-elapsed? s3-0 (seconds 4.33)) + (let ((f0-2 1.0)) + (cond + ((< f30-0 0.5) + (set! f0-2 (* 2.0 f30-0)) + ) + ((< 3.83 f30-0) + (set! f0-2 (* 2.0 (- 4.33 f30-0))) + ) + ) + (set! (-> gp-0 color w) (the int (* 128.0 f0-2))) + (set! (-> s5-0 color w) (the int (* 128.0 f0-2))) + ) + (with-dma-buffer-add-bucket ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-pris2) + ) + (draw gp-0 s1-0 s4-0 #f) + (if (-> s5-0 tid) + (draw s5-0 s1-0 s4-0 #f) + ) + ) + (if (not (paused?)) + (+! f30-0 (seconds-per-frame)) + ) + (suspend) + ) + ) + ) + ) + (none) + ) + :name "logo-title" + :to self + ) + (none) + ) + ) + ) + (650 (apply ,(lambda :behavior scene-player + () + (if (not (-> *setting-control* user-current subtitle)) + (process-spawn-function + process + (lambda :behavior scene-player + () + (talker-spawn-func (-> *talker-speech* 61) self (target-pos 0) (the-as region #f)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 5)) + (if (cpad-pressed? 0 square) + (return #f) + ) + (suspend) + ) + ) + (none) + ) + :to self + ) + ) + (none) + ) + ) + ) + (651 + (part-tracker + "group-drop-dust-landing" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 651 790) + ) + ) + (721 + (part-tracker + "group-drop-thrusters-powerdown" + entity + "air-train-fma" + joint + "thruster_l" + track + #t + duration + (frame-range 721 800) + ) + (part-tracker + "group-drop-thrusters-powerdown" + entity + "air-train-fma" + joint + "thruster_r" + track + #t + duration + (frame-range 721 800) + ) + ) + (822 + (part-tracker + "group-drop-handcuff-light" + entity + "handcuffs" + joint + "light" + track + #t + duration + (frame-range 0 2248) + ) + ) + (2360 + (part-tracker + "group-drop-beacon-glow" + entity + "beacon" + joint + "glow" + track + #t + duration + (seconds (new 'static 'bfloat :data 49.2)) + ) + ) + (2497 + (part-tracker + "group-drop-thrusters" + entity + "air-train-fma" + joint + "thruster_l" + track + #t + duration + (frame-range 2497 2690) + ) + (part-tracker + "group-drop-thrusters" + entity + "air-train-fma" + joint + "thruster_r" + track + #t + duration + (frame-range 2497 2690) + ) + ) + (2600 + (part-tracker + "group-drop-dust-takeoff" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 2600 2760) + ) + ) + (2700 + (part-tracker + "group-drop-dust-cloud" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 2700 2701) + ) + ) + (2812 + (part-tracker + "group-drop-pecker-dustoff" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 2812 2813) + ) + ) + (2817 + (part-tracker + "group-drop-pecker-dustoff" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 2817 2818) + ) + ) + (2825 + (part-tracker + "group-drop-pecker-dustoff" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 2825 2826) + ) + ) + (2838 + (part-tracker + "group-drop-pecker-dustoff" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 2838 2839) + ) + ) + (3500 + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 1.4992504 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 + (send-event *time-of-day* 'change 'ratio (float 1)) + (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + (kill-current-talker '() '() 'die) + (kill-by-type talker *active-pool*) + (kill-current-talker '() '(daxter voicebox message) 'exit) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(151 + 201 + 361 + 496 + 651 + 721 + 821 + 891 + 1001 + 1096 + 1206 + 1291 + 1403 + 1481 + 1566 + 1676 + 1741 + 1866 + 1901 + 1936 + 2051 + 2111 + 2161 + 2221 + 2286 + 2341 + 2411 + 2451 + 2496 + 2546 + 2586 + 2641 + 2691 + 2771 + 2841 + 2936 + 3016 + 3126 + 3201 + 3258 + 3551 + 3436 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((821 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((821 max)) + :scissor-frames '() + :shadow-frames '((821 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'introcst + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((821 2411) (2451 2691)) + :scissor-frames '() + :shadow-frames '((821 2641)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "veger-highres" + :level 'introcst + :art-group "skel-veger-highres" + :prefix "" + :draw-frames '((821 2161) (2221 2691)) + :scissor-frames '() + :shadow-frames '((821 2641)) + :cloth-reset-frames '((1840 1950) 2200 2385) + :cloth-commands '(((2493 2499) set-flags local-space)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'introcst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((821 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "crimson-guard-highres" + :level 'introcst + :art-group "skel-crimson-guard-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((821 2641)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "crimson-guard-highres" + :level 'introcst + :art-group "skel-crimson-guard-highres" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((821 2641)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "air-train-fma" + :level 'introcst + :art-group "skel-air-train-fma" + :prefix "" + :draw-frames '((min 1480) (1566 1676) (1741 1901) (1936 2161) (2221 2691)) + :scissor-frames '((2586 2641)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "beacon" + :level 'introcst + :art-group "skel-beacon" + :prefix "" + :draw-frames '((2286 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "handcuffs" + :level 'introcst + :art-group "skel-handcuffs" + :prefix "" + :draw-frames '((821 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-start" + :end-point "title-restart" + :borrow '((wasintro 0 inttitle special)) + :sfx-volume 0.75 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "intro-lost" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-110" + :art-group "scenecamera" + :anim "intro-lost" + :parts 7 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 10)) + (apply + ,(lambda :behavior scene-player + () + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (set-filter-color! 1.25 1.25 1.25) + (none) + ) + ) + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'borrow '((wasintro 0 intpalrf special)) 0.0 0) + (apply-settings *setting-control*) + (none) + ) + ) + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 1.4992504 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (1 + (part-tracker + "group-lost-desert-heathaze" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 1 179) + ) + ) + (181 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 181 183) + ) + ) + (334 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 334 336) + ) + ) + (345 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 345 347) + ) + ) + (455 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 455 457) + ) + ) + (650 + (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (set! (-> *display* force-sync) (the-as uint 180)) + (persist-with-delay *setting-control* 'blur-a (seconds 4) 'blur-a 'abs 0.8 0) + (sound-play "trans1") + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + (want-display 'freehq 'special) + (save) + ) + (735 + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 + (send-event *time-of-day* 'change 'ratio (float 1)) + (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(71 208 274 354 444 497 559 641) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'introcst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-start" + :end-point "title-restart" + :borrow '((wasintro 0 intpalrf special)) + :sfx-volume 0.75 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(load-scene + (new 'static 'scene + :name "intro-ffhq" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "intro-ffhq" + :parts 8 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 19)) + (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + (want-display 'wasintro '#f) + (want-display 'freehq 'display) + ) + (900 + (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (set! (-> *display* force-sync) (the-as uint 150)) + (persist-with-delay *setting-control* 'blur-a (seconds 3) 'blur-a 'abs 0.8 0) + (sound-play "trans2") + ) + (none) + ) + ) + (want-display 'wasintro 'special) + (save) + ) + (955 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 (send-event *time-of-day* 'change 'ratio (float 1)) (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(126 216 291 401 476 546 611 706 771 861) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'ltorn + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'introcst + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'introcst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-intro" + :end-point "title-restart" + :borrow '((wasintro 0 intpalrf special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(load-scene + (new 'static 'scene + :name "intro-tired" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-110" + :art-group "scenecamera" + :anim "intro-tired" + :parts 7 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 8)) + (apply + ,(lambda :behavior scene-player + () + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (set-filter-color! 1.25 1.25 1.25) + (none) + ) + ) + (want-display 'freehq '#f) + (want-display 'wasintro 'display) + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (1 + (part-tracker + "group-tired-desert-heathaze" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 1 100) + ) + ) + (2 + (part-tracker + "group-tired-desert-heathaze" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-range 2 360) + ) + (want-load 'introcst 'wasintro 'intpfall) + (want-display 'wasintro 'display) + ) + (120 + (send-event *time-of-day* 'change 'hour (int 10)) + (apply ,(lambda :behavior scene-player () (set-filter-color! 1.0 1.0 1.0) (none))) + ) + (220 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 220 222) + ) + ) + (250 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 250 252) + ) + ) + (287 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 287 289) + ) + ) + (293 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 293 295) + ) + ) + (330 + (part-tracker + "group-tired-desert-heathaze" + entity + "particleman" + joint + "particleK" + track + #f + duration + (frame-range 330 450) + ) + ) + (400 + (part-tracker + "group-tired-desert-heathaze" + entity + "particleman" + joint + "particleL" + track + #f + duration + (frame-range 400 550) + ) + ) + (445 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 445 447) + ) + ) + (557 (want-display 'intpfall 'special) (save)) + (561 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleG" + track + #t + duration + (frame-range 561 563) + ) + ) + (563 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleH" + track + #t + duration + (frame-range 563 565) + ) + ) + (566 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 566 568) + ) + ) + (585 (send-event "jak-highres" 'shadow-mask 4) (send-event "jak-highres" 'shadow-values 2816)) + (625 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (set! (-> *display* force-sync) (the-as uint 215)) + (persist-with-delay *setting-control* 'blur-a (seconds 5.167) 'blur-a 'abs 0.8 0) + (sound-play "trans3") + ) + (none) + ) + ) + ) + (745 + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 + (send-event "jak-highres" 'shadow-mask 0) + (send-event "jak-highres" 'shadow-values 0) + (send-event *time-of-day* 'change 'ratio (float 1)) + (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(120 391 465 557 586) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'introcst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-tired" + :end-point "title-restart" + :borrow '((wasintro 0 intpalrf special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(load-scene + (new 'static 'scene + :name "intro-palace" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-103" + :art-group "scenecamera" + :anim "intro-palace" + :parts 34 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 18)) + (apply ,(lambda :behavior scene-player + () + (let ((v1-1 (level-get *level* 'wasintro))) + (if v1-1 + (set! (-> v1-1 info fog-mult) 1.0) + ) + ) + (none) + ) + ) + (want-display 'wasintro 'special) + (want-display 'intpfall 'display) + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'borrow '((wasintro 0 intpalrf display)) 0.0 0) + (apply-settings *setting-control*) + (none) + ) + ) + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (176 + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'borrow '((wasintro 0 #f #f)) 0.0 0) + (apply-settings *setting-control*) + (set! (-> ctyfarma memory-mode) (level-memory-mode small-center)) + (none) + ) + ) + (want-load 'introcst 'ctyfarma 'intpfall) + ) + (1 + (part-tracker + "group-hellcat-thruster-little-trail" + entity + "particleman" + joint + "particleX" + track + #t + duration + (frame-range 1 402) + ) + ) + (175 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 175 382) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 175 382) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 175 382) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 0 382) + ) + ) + (181 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (185 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (187 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (191 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (195 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (197 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (201 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (204 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (205 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (209 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (213 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (219 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (220 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (223 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (229 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (231 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (233 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (237 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (243 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (245 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (247 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (248 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (253 + (send-event "ashelin-highres" 'shadow-mask 16) + (send-event "ashelin-highres" 'shadow-values 655360) + (send-event "torn-highres" 'shadow-mask 16) + (send-event "torn-highres" 'shadow-values 655360) + (send-event "hellcat-movie" 'shadow-mask 16) + (send-event "hellcat-movie" 'shadow-values 655360) + ) + (291 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (321 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (327 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (344 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (328 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (333 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (349 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (351 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (361 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (365 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (367 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (368 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (371 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (372 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (380 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (382 + (send-event "ashelin-highres" 'shadow-mask 0) + (send-event "torn-highres" 'shadow-mask 0) + (send-event "hellcat-movie" 'shadow-mask 0) + ) + (383 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (387 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (395 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (399 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (401 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (403 + (part-tracker + "group-palace-hellcat-explode" + entity + "particleman" + joint + "particleX" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (406 + (part-tracker + "group-hellcat-thruster-fire-trail" + entity + "particleman" + joint + "particleX" + track + #t + duration + (frame-range 406 434) + ) + ) + (413 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (425 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (427 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (429 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (435 + (send-event "ashelin-highres" 'shadow-mask 16) + (send-event "torn-highres" 'shadow-mask 16) + (send-event "hellcat-movie" 'shadow-mask 16) + (part-tracker + "group-hellcat-thruster-little-trail" + entity + "particleman" + joint + "particleX" + track + #t + duration + (frame-range 435 850) + ) + ) + (501 + (send-event "ashelin-highres" 'shadow-mask 0) + (send-event "torn-highres" 'shadow-mask 0) + (send-event "hellcat-movie" 'shadow-mask 0) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 501 596) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 501 596) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 501 596) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 501 596) + ) + ) + (505 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (506 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (507 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (509 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (515 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (517 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (527 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (531 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (537 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (539 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (550 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (551 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (555 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (563 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (565 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (571 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (573 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (574 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (583 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (589 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (591 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (607 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (615 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (617 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (627 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (634 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (643 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (649 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (657 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (663 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (669 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (670 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (683 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (685 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (691 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (698 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (709 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (719 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (733 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (734 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (735 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (745 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (748 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (755 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (757 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (765 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (776 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (789 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (795 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (807 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (813 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (823 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (833 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (839 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (853 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (863 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (865 (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 865 962) + ) + ) + (869 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (871 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (876 (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 876 957) + ) + ) + (881 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (887 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (895 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (911 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (913 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (931 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (932 (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleK" + track + #t + duration + (frame-range 932 962) + ) + ) + (933 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (950 + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 950 963) + ) + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 950 965) + ) + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleL" + track + #t + duration + (frame-range 950 982) + ) + ) + (953 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (955 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (956 (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-c" + joint + "bd" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (957 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "ba" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bb" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bc" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bd" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bf" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "be" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bg" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (962 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (963 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (964 + (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-c" + joint + "bd" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (965 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "as" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "at" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "au" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "av" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "aw" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (967 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleD" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (971 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (979 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (982 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (985 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (987 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (991 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (994 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1000 + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 1000 1040) + ) + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 1000 1037) + ) + ) + (1009 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1011 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1021 (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-d" + joint + "bs" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1027 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1031 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1040 (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-b" + joint + "t" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1041 (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-c" + joint + "bd" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1042 + (part-tracker + "group-ctypal-palace-break-explode-small" + entity + "ctypal-palace-break-a" + joint + "r" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-a" + joint + "s" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "t" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "u" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "v" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "w" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "x" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "y" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "z" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "zz" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "aa" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "ab" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "ac" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "ad" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "ae" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "af" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1048 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1053 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 1053 1880) + ) + ) + (1057 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1068 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1075 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1081 (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 1081 1117) + ) + ) + (1083 + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 1083 1135) + ) + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleK" + track + #t + duration + (frame-range 1083 1162) + ) + ) + (1089 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1090 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleD" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1095 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1109 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1117 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1122 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1127 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1128 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1133 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1134 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleD" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1135 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "ax" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "ay" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "az" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-explode-small" + entity + "ctypal-palace-break-c" + joint + "ay" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1137 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1139 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleG" + track + #t + duration + (frame-range 1139 1880) + ) + ) + (1141 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1154 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 1154 1880) + ) + ) + (1155 + (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-d" + joint + "bp" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1156 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1157 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1160 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1162 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1163 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bk" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bl" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1169 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1174 (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bj" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1177 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1179 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bh" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bi" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1183 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1187 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1193 (part-tracker + "group-palace-small-explode" + entity + "particleman" + joint + "particleD" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1199 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1208 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1215 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1219 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1223 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1229 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1234 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1235 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1247 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1263 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1273 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1275 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1289 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1296 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1301 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1307 (part-tracker + "group-ctypal-palace-break-explode-dust" + entity + "ctypal-palace-break-d" + joint + "cc" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1310 (part-tracker + "group-palace-huge-explosion" + entity + "ctypal-palace-break-d" + joint + "bw" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1313 (part-tracker + "group-palace-small-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1325 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1345 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1345 1560) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1345 1560) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1345 1560) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1345 1560) + ) + ) + (1349 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1362 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1367 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1373 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 1373 1880) + ) + ) + (1377 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1389 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1396 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1401 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1409 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1423 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1441 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1461 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1487 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1535 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1551 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleD" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (kill "ctypal-ctyfarma-1") + (want-display 'ctyfarma 'display) + ) + (1552 + (part-tracker + "group-ctypal-support-break-trailer" + entity + "particleman" + joint + "particleT" + track + #t + duration + (frame-range 1552 1587) + ) + (part-tracker + "group-ctypal-support-break-trailer" + entity + "particleman" + joint + "particleU" + track + #t + duration + (frame-range 1552 1587) + ) + (part-tracker + "group-ctypal-support-break-trailer" + entity + "particleman" + joint + "particleV" + track + #t + duration + (frame-range 1552 1587) + ) + ) + (1576 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1585 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1586) + (1587 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleS" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1593 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1597 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1603 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1608 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1619 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1626 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1630 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1638 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1642 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1648 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1655 + (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 1655 2000) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1655 1710) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1655 1710) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1655 1710) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1655 1710) + ) + ) + (1665 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1670 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 1670 2000) + ) + ) + (1674 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1683 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1684 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1705 (set! *artist-all-visible* #f)) + (1710 + (want-load 'introcst 'wasintro 'intpfall) + (want-display 'wasintro 'special) + (apply ,(lambda :behavior scene-player + () + (set-setting! 'borrow '((introcst 0 lwlandm special)) 0.0 0) + (apply-settings *setting-control*) + (none) + ) + ) + (save) + ) + (1784 + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1784 1933) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1784 1880) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1784 1933) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1784 1880) + ) + ) + (1940 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (set! (-> *display* force-sync) (the-as uint 150)) + (persist-with-delay *setting-control* 'blur-a (seconds 3) 'blur-a 'abs 0.8 0) + (sound-play "trans4") + ) + (none) + ) + ) + ) + (1990 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 3.003003 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 (apply ,(lambda :behavior scene-player + () + (let ((v1-1 (level-get *level* 'wasintro))) + (if v1-1 + (set! (-> v1-1 info fog-mult) 100.0) + ) + ) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + (set! (-> ctyfarma memory-mode) (level-memory-mode small-edge)) + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(175 253 382 434 501 596 670 715 787 952 1000 1037 1086 1239 1308 1344 1411 1551 1705 1875) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((175 434) (501 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min 1551) (1705 max)) + :scissor-frames '() + :shadow-frames '((175 434) (501 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'ltorn + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'introcst + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min 1551) (1705 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'introcst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min 1551) (1705 max)) + :scissor-frames '() + :shadow-frames '((175 434) (501 715) (787 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hellcat-movie" + :level 'intpfall + :art-group "skel-hellcat-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hellcat-lowres-fma" + :level 'intpfall + :art-group "skel-hellcat-lowres-fma" + :prefix "" + :draw-frames '((min 952)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "palmpilot" + :level 'intpfall + :art-group "skel-palmpilot" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break" + :level 'intpfall + :art-group "skel-ctypal-palace-break" + :prefix "" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1551 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-a" + :level 'intpfall + :art-group "skel-ctypal-palace-break-a" + :prefix "a-" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1551 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-b" + :level 'intpfall + :art-group "skel-ctypal-palace-break-b" + :prefix "b-" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1705 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-c" + :level 'intpfall + :art-group "skel-ctypal-palace-break-c" + :prefix "c-" + :draw-frames '((501 596) (952 1000) (1037 1239)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-d" + :level 'intpfall + :art-group "skel-ctypal-palace-break-d" + :prefix "d-" + :draw-frames '((501 596) (952 1000) (1020 1239) (1308 1411) (1705 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-e" + :level 'intpfall + :art-group "skel-ctypal-palace-break-e" + :prefix "e-" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1551 1600) (1705 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "a-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "d-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "e-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "a-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "d-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "e-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-rail" + :level 'intpfall + :art-group "skel-ctypal-rail" + :prefix "" + :draw-frames '((175 253) (382 434) (596 670) (715 952) (1000 1037) (1239 1308) (1411 1551)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-base-break" + :level 'intpfall + :art-group "skel-ctypal-base-break" + :prefix "" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1620 1705)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-palace" + :end-point "title-restart" + :borrow '((wasintro 0 intpalrf special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(load-scene + (new 'static 'scene + :name "intro-rescue" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-110" + :art-group "scenecamera" + :anim "intro-rescue" + :parts 8 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 18)) + (apply + ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity 0) + (set-filter-color! 1.125 1.125 1.125) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (none) + ) + ) + (want-display 'wasintro 'display) + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'ambient-volume 'rel 1.0 0) + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 3.003003 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + (set-cloth-ground-height "damus-highres" 98304) + ) + (1 + (part-tracker + "group-desert-blowing-dust" + entity + "particleman" + joint + "particleI" + track + #f + duration + (frame-range 1 550) + ) + (part-tracker + "group-desert-blowing-dust" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-range 1 550) + ) + ) + (2 (want-load 'introcst 'wasintro 'title) (want-display 'wasintro 'display)) + (270 + (part-tracker "group-drop-beacon-glow" entity "beacon" joint "glow" track #t duration (frame-range 270 432)) + ) + (448 + (part-tracker + "group-desert-impact-dust-blow" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 448 449) + ) + ) + (473 + (part-tracker + "group-desert-impact-dust-blow" + entity + "particleman" + joint + "particleE" + track + #f + duration + (frame-range 473 474) + ) + (want-display 'title 'display) + (save) + ) + (500 + (setting-reset sfx-volume mode 'abs value (new 'static 'bfloat :data 1.0)) + (send-event *time-of-day* 'change 'ratio (float 1)) + (apply + ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intro #t) + (set-setting! 'fog-special-interp-targ #f 1.0 0) + (set-setting! 'fog-special-interp-rate #f 0.21 0) + (apply-settings *setting-control*) + (none) + ) + ) + ) + (600 + (setting-reset letterbox-speed mode 'abs value (new 'static 'bfloat :data 0.5)) + (setting-reset letterbox mode 'abs value (new 'static 'bfloat)) + ) + (680 + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'fog-special-interp-targ #f 2.0 0) + (set-setting! 'fog-special-interp-rate #f 4.0 0) + (persist-with-delay + *setting-control* + 'fog-special-interp-targ + (seconds 1000) + 'fog-special-interp-targ + #f + 2.0 + 0 + ) + (apply-settings *setting-control*) + (none) + ) + ) + ) + (678 (apply ,(lambda :behavior scene-player + () + (if (not (-> self aborted?)) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 + (send-event *time-of-day* 'change 'ratio (float 1)) + (task-close! "city-start-introduction") + (apply + ,(lambda :behavior scene-player + () + (cond + ((scene-select?) + (persist-with-delay *setting-control* 'fog-special-interp-targ 0 'fog-special-interp-targ #f 2.0 0) + (remove-setting! 'fog-special-interp-targ) + (remove-setting! 'fog-special-interp-rate) + ) + ((-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (else + (set! (-> self end-point) "title-from-intro") + (set! (-> self blackout-end) #f) + ) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(251 296 347 431 498) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "damus-highres" + :level 'introcst + :art-group "skel-damus-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((296 347)) + :shadow-frames '((min max)) + :cloth-reset-frames '((0 5)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kleever-highres" + :level 'introcst + :art-group "skel-kleever-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '((0 5)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "wlander-male" + :level 'lwlandm + :art-group "skel-wlander-male" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :draw-seg #x3fe0000 + :no-draw-seg #xffffffffffffffff + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'introcst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "beacon" + :level 'introcst + :art-group "skel-beacon" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-rescue" + :end-point "title-restart" + :borrow '((introcst 0 lwlandm display)) + :sfx-volume -1.0 + :ambient-volume 1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) diff --git a/goal_src/jak3/levels/nest/egg-spider.gc b/goal_src/jak3/levels/nest/egg-spider.gc index b4faaecc28..0f5e8fd4d7 100644 --- a/goal_src/jak3/levels/nest/egg-spider.gc +++ b/goal_src/jak3/levels/nest/egg-spider.gc @@ -1390,8 +1390,9 @@ (enemy-init-by-other arg0 arg1) ) -(defmethod init-enemy-defaults! ((this egg-spider) (arg0 enemy-info)) - (set! (-> (the-as nav-enemy-info arg0) nav-mesh) *default-nav-mesh*) +;; WARN: Return type mismatch int vs object. +(defmethod init-enemy-defaults! ((this egg-spider) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) (t9-0 this arg0) ) @@ -1417,7 +1418,6 @@ (set! (-> this enemy-info callback-info) *physics-nav-callback-info*) (nav-enemy-method-181 this) 0 - (none) ) (defmethod init-enemy-collision! ((this egg-spider)) diff --git a/goal_src/jak3/levels/palace/cable/palcab-part.gc b/goal_src/jak3/levels/palace/cable/palcab-part.gc index deb47362b2..ad318b7465 100644 --- a/goal_src/jak3/levels/palace/cable/palcab-part.gc +++ b/goal_src/jak3/levels/palace/cable/palcab-part.gc @@ -7,3 +7,1010 @@ ;; DECOMP BEGINS +(defpartgroup group-palcab-lights + :id 1153 + :flags (sp8) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4064 :fade-after (meters 80) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 4065 :fade-after (meters 100) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 4064 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 20.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 5120.0) + ) + ) + +(defpart 4065 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 8.0) + (:omega (degrees 2261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 5120.0) + ) + ) + +(defpartgroup group-palcab-spark-rain-1 + :id 1154 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 350 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-2 + :id 1155 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 405 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-3 + :id 1156 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 485 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-4 + :id 1157 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 825 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-5 + :id 1158 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 255 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-6 + :id 1159 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 640 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-7 + :id 1160 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 750 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-8 + :id 1161 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 60 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-9 + :id 1162 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 885 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-10 + :id 1163 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 465 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-11 + :id 1164 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 595 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-12 + :id 1165 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 90 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-13 + :id 1166 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 690 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-14 + :id 1167 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 165 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-15 + :id 1168 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 535 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpartgroup group-palcab-spark-rain-16 + :id 1169 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 325 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +(defpart 4066 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 2.0 4.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.06) (meters 0.03)) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0 128.0) + (:a 128.0) + (:omega (degrees 0.018) (degrees 0.01125)) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:fade-g -2.55 -2.55) + (:fade-b -8.0) + (:fade-a -0.32 -0.64) + (:friction 0.8 0.02) + (:timer (seconds 0.335) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 80)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4067 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -2) (meters 4)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 0.25)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 128.0) + (:b 128.0 64.0) + (:a 96.0 16.0) + (:omega (degrees 3608.9998)) + (:scalevel-x (meters 0.08)) + (:scalevel-y :copy scalevel-x) + (:fade-g -6.375) + (:fade-b -13.066667) + (:fade-a -2.8) + (:timer (seconds 0.05) (seconds 0.03)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-palcab-birds + :id 1170 + :bounds (static-bspherem 0 8 0 128) + :parts ((sp-item 4070 :fade-after (meters 600) :flags (sp1 sp3) :binding 4068) + (sp-item 4070 :fade-after (meters 600) :flags (sp1 sp3) :binding 4068) + (sp-item 4070 :fade-after (meters 600) :flags (sp1 sp3) :binding 4068) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + ) + ) + +(defun palcab-bird-bob-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (set! (-> arg2 y) + (+ (-> arg1 key proc root trans y) (* -2048.0 (sin (* 218.45334 (the float (mod (current-time) 300)))))) + ) + 0 + (none) + ) + +(defpart 4070 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-random-next-time) + (:num 1.0) + (:x (meters -15) (meters 30)) + (:y (meters 0) (meters 16)) + (:z (meters -15) (meters 30)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 199.98) + (:func 'palcab-bird-bob-func) + ) + ) + +(defun sparticle-palcab-bird-moon ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (set! (-> arg2 conerot z) (the float (sar (shl (the int (+ -16384.0 (-> arg1 omega))) 48) 48))) + 0 + (none) + ) + +(defpart 4068 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-copy-omega-to-z) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 60) (meters 60)) + (:scale-x (meters 0)) + (:rot-z (degrees 0)) + (:r 32.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.00074074074) (meters 0.00074074074)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.04)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch)) + (:func 'sparticle-palcab-bird-moon) + (:next-time (seconds 0.665)) + (:next-launcher 4071) + ) + ) + +(defpart 4071 + :init-specs ((:scale-x (meters 8)) + (:scalevel-x (meters -0.08)) + (:timer (seconds 2)) + (:next-time (seconds 0.335)) + (:next-launcher 4072) + ) + ) + +(defpart 4072 + :init-specs ((:scale-x (meters 0)) + (:scalevel-x (meters -0.04)) + (:timer (seconds 2)) + (:next-time (seconds 0.665)) + (:next-launcher 4071) + ) + ) + +(defpart 4069 + :init-specs ((:texture (seagull-wing intpfall-sprite)) + (:birth-func 'birth-func-copy2-rot-color) + (:num 2.0) + (:scale-x (meters 5)) + (:scale-y (meters 2)) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13)) + ) + ) + +(defpartgroup group-palcab-stadium-lights + :id 1171 + :flags (sp8) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4073 :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 4074 :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 4073 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 48.5) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +(defpart 4074 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 96) (meters 0.1)) + (:rot-x (degrees 78.75)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +(defpartgroup group-palcab-palace-fire + :id 1172 + :flags (sp8) + :bounds (static-bspherem 0 2 0 5) + :parts ((sp-item 4075 :fade-after (meters 1200) :falloff-to (meters 1200)) + (sp-item 4076 :fade-after (meters 800) :flags (sp6)) + ) + ) + +(defpart 4075 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 6) (meters 3)) + (:scale-y (meters 6) (meters 3)) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 32.0 32.0) + (:vel-x (meters 0) (meters -0.0033333334)) + (:scalevel-x (meters -0.009375)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -0.1 -0.1) + (:accel-y (meters 0.0016666667) (meters 0.0013333333)) + (:timer (seconds 0.535) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +(defpart 4076 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.5) + (:y (meters 4)) + (:scale-x (meters 24) (meters 0.5)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 20.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -1.2) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +(defpartgroup group-palcab-misc-citylights-red-1 + :id 1173 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4077 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +(defpartgroup group-palcab-misc-citylights-red-2 + :id 1174 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4077 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +(defpartgroup group-palcab-misc-citylights-red-3 + :id 1175 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4077 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800 :hour-mask #b111111111110000000) + ) + ) + +(defpart 4077 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 8)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 32.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.1)) + (:scalevel-y (meters 0.08)) + (:fade-a 0.16) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 4078) + ) + ) + +(defpart 4078 + :init-specs ((:scale-y (meters 16)) + (:a 32.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 4079) + ) + ) + +(defpart 4079 + :init-specs ((:scalevel-x (meters -0.1)) + (:scalevel-y (meters -0.08)) + (:fade-a -0.16) + (:next-time (seconds 0.335)) + (:next-launcher 4080) + ) + ) + +(defpart 4080 + :init-specs ((:scale-y (meters 8)) (:a 16.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +(defpartgroup group-palcab-misc-citylights-blue-1 + :id 1176 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4081 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +(defpartgroup group-palcab-misc-citylights-blue-2 + :id 1177 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4081 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +(defpart 4081 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 8)) + (:r 0.0) + (:g 128.0 32.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.1)) + (:scalevel-y (meters 0.08)) + (:fade-a 0.16) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 4078) + ) + ) + +(defpartgroup group-palcab-cable-lights + :id 1178 + :flags (sp8) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4082 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +(defpart 4082 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 12)) + (:rot-x (degrees 56.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 64.0) + (:b 64.0) + (:a 20.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-palcab-strip-glows + :id 1179 + :flags (sp8) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4083 :flags (sp6))) + ) + +(defpart 4083 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 48) (meters 4)) + (:rot-x (degrees 371.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 64.0) + (:b 64.0) + (:a 5.0 20.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 411648.0) + ) + ) + +(defpartgroup group-palcab-fiery-smokestack + :id 1180 + :flags (sp8) + :bounds (static-bspherem 0 0 -10 24) + :parts ((sp-item 4084 :fade-after (meters 1500) :falloff-to (meters 1500)) + (sp-item 4085 :fade-after (meters 2000) :flags (sp6)) + ) + ) + +(defpart 4085 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 8)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 8.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 6144.0) + ) + ) + +(defpart 4084 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 8) (meters 8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:accel-x (meters -0.0016666667) (meters -0.00083333335)) + (:accel-y (meters 0.00033333333) (meters 0.00016666666)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 4086) + ) + ) + +(defpart 4086 + :init-specs ((:fade-r -0.255 -0.255) (:fade-g :copy fade-r) (:fade-b :copy fade-g) (:fade-a -0.032 -0.032)) + ) + +(defpartgroup group-palcab-mountain-glows + :id 1181 + :flags (sp8) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4087 :fade-after (meters 3000) :flags (sp6))) + ) + +(defpart 4087 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 128)) + (:rot-x (degrees 56.25)) + (:scale-y (meters 96)) + (:r 128.0 32.0) + (:g 255.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-palcab-cable-blue-rotaters + :id 1182 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4088 :flags (is-3d sp1 sp7) :period (seconds 6) :length (seconds 0.017))) + ) + +(defpart 4088 + :init-specs ((:texture (palcab-blue-rotaters intpfall-sprite)) + (:num 1.0) + (:scale-x (meters 24)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:rotvel-y (degrees 0.2)) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 left-multiply-quat)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +(defpartgroup group-palcab-city-glows-1 + :id 1183 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4089 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +(defpart 4089 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 8) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 64.0) + (:b 64.0) + (:a 32.0 16.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-palcab-city-glows-2 + :id 1184 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4090 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +(defpart 4090 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 8) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0 64.0) + (:b 0.0) + (:a 32.0 16.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-palcab-city-glows-3 + :id 1185 + :flags (sp8) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4091 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +(defpart 4091 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 8) (meters 2)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 0.0 64.0) + (:b 128.0 64.0) + (:a 32.0 32.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-palcab-dest-smoke + :id 1186 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4092 :fade-after (meters 3000) :flags (sp7))) + ) + +(defpartgroup group-palcab-dest-fire + :id 1187 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4092 :fade-after (meters 600) :falloff-to (meters 800) :flags (sp7)) + (sp-item 4093 :fade-after (meters 600) :falloff-to (meters 800) :flags (sp7)) + (sp-item 4094 :fade-after (meters 600) :falloff-to (meters 800) :flags (sp7)) + (sp-item 4095 :fade-after (meters 600) :falloff-to (meters 800) :flags (sp6)) + ) + ) + +(defpart 4092 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 4)) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.042666666 -0.042666666) + (:accel-y (meters 0.0033333334)) + (:accel-z (meters 0) (meters 0.00066666666)) + (:friction 0.95) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4093 + :init-specs ((:texture (flame01 level-default-sprite)) + (:num 1.0 1.0) + (:y (meters -1)) + (:scale-x (meters 8) (meters 8)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:scalevel-x (meters -0.016666668)) + (:fade-r 0.33333334) + (:fade-g -0.083333336) + (:fade-b -1.875) + (:fade-a 0.42666668) + (:accel-y (meters 0.00033333333) (meters 0.0023333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 4096) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 1) (meters 10)) + ) + ) + +(defpart 4094 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:y (meters -1)) + (:scale-x (meters 7) (meters 7)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-y (meters -0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters -0.016666668)) + (:fade-r 0.33333334) + (:fade-g -0.083333336) + (:fade-b -1.875) + (:fade-a 0.42666668) + (:accel-y (meters 0.00033333333) (meters 0.005)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 4096) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 1) (meters 10)) + ) + ) + +(defpart 4096 + :init-specs ((:scalevel-x (meters -0.016666668)) (:fade-a -0.425 -0.425)) + ) + +(defpart 4095 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.4) + (:x (meters 1)) + (:y (meters 2)) + (:scale-x (meters 30) (meters 30)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 5.0 10.0) + (:omega (degrees 22520.25)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpartgroup group-palcab-dest-steam + :id 1188 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4097 :fade-after (meters 3000) :flags (sp7))) + ) + +(defpart 4097 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-z (meters 0.05)) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32 0.32) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.96 0.02) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 4098) + (:conerot-y (degrees -30) (degrees 60)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4098 + :init-specs ((:fade-a -0.053333335)) + ) + +(defpartgroup group-palcab-dest-fire-smoke + :id 1189 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4093 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 4094 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 4095 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 4092 :fade-after (meters 3000) :flags (sp7)) + ) + ) + +(defpartgroup group-palcab-dest-white-eco + :id 1190 + :flags (sp0) + :bounds (static-bspherem 0 0 0 150) + :parts ((sp-item 4099 :fade-after (meters 300) :flags (is-3d)) (sp-item 4100 :fade-after (meters 600))) + ) + +(defpart 4099 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:y (meters -10)) + (:scale-x (meters 100)) + (:rot-x (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 120.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4100 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.3) + (:y (meters 5)) + (:scale-x (meters 200)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:omega (degrees 22520.25)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) diff --git a/goal_src/jak3/levels/palace/roof/palroof-part.gc b/goal_src/jak3/levels/palace/roof/palroof-part.gc index f94f07c170..0d9497e965 100644 --- a/goal_src/jak3/levels/palace/roof/palroof-part.gc +++ b/goal_src/jak3/levels/palace/roof/palroof-part.gc @@ -7,3 +7,398 @@ ;; DECOMP BEGINS +(defpartgroup group-palroof-window-large + :id 1146 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4048 :fade-after (meters 300) :flags (sp6)) (sp-item 4049 :flags (is-3d sp6 sp7))) + ) + +(defpart 4048 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 12) (meters 0.1)) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 16.0 2.0) + (:omega (degrees 6763.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 4049 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 4)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 6)) + (:r 96.0 16.0) + (:g :copy r) + (:b :copy g) + (:a 48.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-palroof-window-small + :id 1147 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4050 :fade-after (meters 200) :flags (sp6)) (sp-item 4051 :flags (is-3d sp6 sp7))) + ) + +(defpart 4050 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 5) (meters 0.1)) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 16.0 2.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 4051 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 1.5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 3.5)) + (:r 96.0 16.0) + (:g :copy r) + (:b :copy g) + (:a 48.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-palroof-runoff-high + :id 1148 + :flags (sp4) + :bounds (static-bspherem 0 -12 0 24) + :parts ((sp-item 4052 :fade-after (meters 140) :falloff-to (meters 140) :flags (sp7)) + (sp-item 4053 :fade-after (meters 140) :falloff-to (meters 140) :flags (sp7)) + ) + ) + +(defpartgroup group-palroof-runoff-med + :id 1149 + :flags (sp4) + :bounds (static-bspherem 0 -12 0 24) + :parts ((sp-item 4054 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4055 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpartgroup group-palroof-runoff-low + :id 1150 + :flags (sp4) + :bounds (static-bspherem 0 -12 0 24) + :parts ((sp-item 4056 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4057 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 4058 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 4059)) + ) + +(defpart 4059 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 4058)) + ) + +(defpart 4060 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.08) (meters 0.03)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 64.0 64.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.005) (meters -0.00066666666)) + (:friction 0.98) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.33)) + (:next-launcher 41) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4061 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-omega-normal-orient) + (:num 0.5) + (:y (meters 0.2)) + (:scale-x (meters 0.75) (meters 0.25)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 64.0 32.0) + (:omega (degrees 0)) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.2) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 10 0 0 #x401800 #x403d00 #x400700 #x408200)) + (:func 'sparticle-texture-animate) + ) + ) + +(defun check-drop-level-palroof-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (when (< (-> arg2 rvec y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 rvec x) (-> arg1 user-float) (-> arg2 rvec z) 1.0) + (launch-particles (-> *part-id-table* 4060) s3-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 4061) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +(defpart 4052 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1712947.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + (:rotate-x (degrees -90)) + ) + ) + +(defpart 4053 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1712947.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + (:rotate-x (degrees -90)) + ) + ) + +(defpart 4054 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1698611.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + (:rotate-x (degrees -90)) + ) + ) + +(defpart 4055 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1698611.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + (:rotate-x (degrees -90)) + ) + ) + +(defpart 4056 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1671987.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + (:rotate-x (degrees -90)) + ) + ) + +(defpart 4057 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1671987.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + (:rotate-x (degrees -90)) + ) + ) + +(defpartgroup group-palroof-lightning-pole + :id 1151 + :bounds (static-bspherem 0 -3.5 0 4) + :parts ((sp-item 4062 :fade-after (meters 160) :flags (sp6) :period (seconds 0.1) :length (seconds 0.05)) + (sp-item 4063 :fade-after (meters 160) :flags (sp6)) + ) + ) + +(defpartgroup group-palroof-lightning-pole-off + :id 1152 + :bounds (static-bspherem 0 -3.5 0 4) + :parts ((sp-item 4062 :fade-after (meters 80) :flags (sp6) :period (seconds 2.667) :length (seconds 1))) + ) + +(defpart 4063 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 2.0) + (:y (meters -1.2) 6 (meters -1)) + (:scale-x (meters 1.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 3.6) (meters 0.1)) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 3615.75)) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4062 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 32.0 4.0) + (:omega (degrees 3615.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/sewer/jump-pad.gc b/goal_src/jak3/levels/sewer/jump-pad.gc index 2996542cc3..935e98cb47 100644 --- a/goal_src/jak3/levels/sewer/jump-pad.gc +++ b/goal_src/jak3/levels/sewer/jump-pad.gc @@ -130,7 +130,7 @@ (none) ) -(defmethod bouncer-method-23 ((this jump-pad)) +(defmethod init-skel! ((this jump-pad)) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) (quaternion-copy! (-> this fan-quat) (-> this root quat)) (let ((a0-6 (-> this node-list data (get-fan-joint-idx this)))) diff --git a/goal_src/jak3/levels/sewer/sewer-obs.gc b/goal_src/jak3/levels/sewer/sewer-obs.gc index 9dad4d80f0..24bf17519c 100644 --- a/goal_src/jak3/levels/sewer/sewer-obs.gc +++ b/goal_src/jak3/levels/sewer/sewer-obs.gc @@ -383,7 +383,7 @@ (art-group-get-by-name *level* "skel-sew-jump-pad" (the-as (pointer level) #f)) ) -(defmethod bouncer-method-24 ((this sew-jump-pad)) +(defmethod init-collision! ((this sew-jump-pad)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (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)) diff --git a/goal_src/jak3/levels/stadium/dm-mine-spider.gc b/goal_src/jak3/levels/stadium/dm-mine-spider.gc index 26aa9996de..fcb83fad16 100644 --- a/goal_src/jak3/levels/stadium/dm-mine-spider.gc +++ b/goal_src/jak3/levels/stadium/dm-mine-spider.gc @@ -1115,8 +1115,9 @@ (process-entity-status! this (entity-perm-status dead) #t) ) -(defmethod init-enemy-defaults! ((this dm-mine-spider) (arg0 enemy-info)) - (set! (-> (the-as nav-enemy-info arg0) nav-mesh) *default-nav-mesh*) +;; WARN: Return type mismatch int vs object. +(defmethod init-enemy-defaults! ((this dm-mine-spider) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) (t9-0 this arg0) ) @@ -1144,7 +1145,6 @@ (set! (-> this enemy-info callback-info) *physics-nav-callback-info*) (nav-enemy-method-181 this) 0 - (none) ) (defmethod init-enemy-collision! ((this dm-mine-spider)) diff --git a/goal_src/jak3/levels/stadium/rapid-gunner.gc b/goal_src/jak3/levels/stadium/rapid-gunner.gc index f78fb86668..7c005f0453 100644 --- a/goal_src/jak3/levels/stadium/rapid-gunner.gc +++ b/goal_src/jak3/levels/stadium/rapid-gunner.gc @@ -1065,8 +1065,11 @@ ) ) :exit (behavior () - (let ((v1-0 (-> self nav))) - (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ;; og:preserve-this fix potential use-after-free bug + (if (-> self nav) + (let ((v1-0 (-> self nav))) + (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ) ) 0 (logior! (-> self mask) (process-mask actor-pause)) diff --git a/goal_src/jak3/levels/temple/temple-obs.gc b/goal_src/jak3/levels/temple/temple-obs.gc index bc14ef356c..805b2640ed 100644 --- a/goal_src/jak3/levels/temple/temple-obs.gc +++ b/goal_src/jak3/levels/temple/temple-obs.gc @@ -177,7 +177,7 @@ :post ja-post ) -(defmethod bouncer-method-23 ((this tpl-bouncer)) +(defmethod init-skel! ((this tpl-bouncer)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-bouncer" (the-as (pointer level) #f))) @@ -187,7 +187,7 @@ (none) ) -(defmethod bouncer-method-24 ((this tpl-bouncer)) +(defmethod init-collision! ((this tpl-bouncer)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (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)) diff --git a/goal_src/jak3/levels/volcano/volcano-obs.gc b/goal_src/jak3/levels/volcano/volcano-obs.gc index 5989a7dd3a..5e2fb36691 100644 --- a/goal_src/jak3/levels/volcano/volcano-obs.gc +++ b/goal_src/jak3/levels/volcano/volcano-obs.gc @@ -1285,7 +1285,7 @@ :post transform-post ) -(defmethod bouncer-method-23 ((this vol-bouncer)) +(defmethod init-skel! ((this vol-bouncer)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-vol-bouncer" (the-as (pointer level) #f))) @@ -1295,7 +1295,7 @@ (none) ) -(defmethod bouncer-method-24 ((this vol-bouncer)) +(defmethod init-collision! ((this vol-bouncer)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) diff --git a/goal_src/jak3/levels/wascity/cty-attack-controller.gc b/goal_src/jak3/levels/wascity/cty-attack-controller.gc index 170496e3b8..44139c069a 100644 --- a/goal_src/jak3/levels/wascity/cty-attack-controller.gc +++ b/goal_src/jak3/levels/wascity/cty-attack-controller.gc @@ -5,10 +5,311 @@ ;; name in dgo: cty-attack-controller ;; dgos: DESRESC, WWD, CWI +;; +++city-target-type +(defenum city-target-type + (unk1 1) + (unk2 2) + (guard-tazer 3) + (guard-rifle 4) + (guard-grenade 5) + (grunt 6) + (flitter 7) + (unknown 8) + (roboguard 9) + (turret 10) + (spydroid 11) + (roboguard-giant 12) + ) +;; ---city-target-type + + +;; +++cty-faction +(defenum cty-faction + :type uint8 + (ff 0) + (kg 1) + (mh 2) + (invalid 128) + ) +;; ---cty-faction + + ;; DECOMP BEGINS -;; stub -(defun cty-attack-reset ((arg0 symbol) (arg1 symbol) (arg2 symbol)) - (format 0 "skipping (cty-attack-reset ~A ~A ~A)~%" arg0 arg1 arg2) +;; WARN: Return type mismatch int vs cty-faction. +(defun city-target-type->cty-faction ((arg0 city-target-type)) + (let ((v1-0 arg0)) + (the-as + cty-faction + (cond + ((or (= v1-0 (city-target-type guard-tazer)) + (= v1-0 (city-target-type guard-rifle)) + (= v1-0 (city-target-type guard-grenade)) + (= v1-0 (city-target-type unk1)) + (= v1-0 (city-target-type unk2)) + ) + (the-as cty-faction (cty-faction ff)) + ) + ((or (= v1-0 (city-target-type grunt)) (= v1-0 (city-target-type flitter)) (= v1-0 (city-target-type unknown))) + (the-as cty-faction (cty-faction mh)) + ) + ((or (= v1-0 (city-target-type roboguard)) + (= v1-0 (city-target-type turret)) + (= v1-0 (city-target-type spydroid)) + (= v1-0 (city-target-type roboguard-giant)) + ) + (the-as cty-faction (cty-faction kg)) + ) + (else + (the-as cty-faction (cty-faction invalid)) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs traffic-type. +(defun city-target-type->traffic-object-type ((arg0 city-target-type)) + (let ((v1-0 arg0)) + (the-as + traffic-type + (cond + ((or (= v1-0 (city-target-type guard-tazer)) + (= v1-0 (city-target-type guard-rifle)) + (= v1-0 (city-target-type guard-grenade)) + ) + (the-as traffic-type (traffic-type guard-a)) + ) + ((= v1-0 (city-target-type grunt)) + (the-as traffic-type (traffic-type metalhead-grunt)) + ) + ((= v1-0 (city-target-type flitter)) + (the-as traffic-type (traffic-type metalhead-flitter)) + ) + ((= v1-0 (city-target-type unknown)) + (the-as traffic-type (traffic-type metalhead-predator)) + ) + ((or (= v1-0 (city-target-type roboguard)) (= v1-0 (city-target-type roboguard-giant))) + (the-as traffic-type (traffic-type roboguard)) + ) + ((= v1-0 (city-target-type turret)) + (the-as traffic-type (traffic-type flying-turret)) + ) + ((= v1-0 (city-target-type spydroid)) + (the-as traffic-type (traffic-type spydroid)) + ) + (else + (the-as traffic-type (traffic-type invalid0)) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs city-target-type. +(defun symbol->city-target-type ((arg0 symbol)) + (let ((v1-0 arg0)) + (the-as city-target-type (cond + ((= v1-0 'roboguard) + (the-as city-target-type (city-target-type roboguard)) + ) + ((= v1-0 'roboguard-giant) + (the-as city-target-type (city-target-type roboguard-giant)) + ) + ((= v1-0 'guard-rifle) + (the-as city-target-type (city-target-type guard-rifle)) + ) + ((= v1-0 'guard-tazer) + (the-as city-target-type (city-target-type guard-tazer)) + ) + ((= v1-0 'guard-grenade) + (the-as city-target-type (city-target-type guard-grenade)) + ) + ((= v1-0 'turret) + (the-as city-target-type (city-target-type turret)) + ) + ((= v1-0 'spydroid) + (the-as city-target-type (city-target-type spydroid)) + ) + ((= v1-0 'flitter) + (the-as city-target-type (city-target-type flitter)) + ) + ((= v1-0 'grunt) + (the-as city-target-type (city-target-type grunt)) + ) + (else + (the-as city-target-type (city-target-type unknown)) + ) + ) + ) + ) + ) + +(deftype cty-attack-controller (mission-squad-control) + ((guard-angry-hatred-info-index int8) + ) + ) + + +(define-perm *cty-attack-controller* cty-attack-controller #f) + +(defun initialize-cty-attack-controller () + (set! *cty-attack-controller* (new 'loading-level 'cty-attack-controller)) + (init! *cty-attack-controller* 64 17 22) (none) - ) \ No newline at end of file + ) + +(defun cty-attack-reset ((arg0 symbol) (arg1 symbol) (arg2 symbol)) + (if arg0 + (init-attackers *cty-attack-controller*) + (reset-hatred *cty-attack-controller*) + ) + (init-attack-controller *cty-attack-controller*) + (none) + ) + +;; WARN: Function (method 15 cty-attack-controller) has a return type of none, but the expression builder found a return statement. +(defmethod init-attack-controller ((this cty-attack-controller)) + (if (< (-> this hatred-vals allocated-length) 17) + (return 0) + ) + (let ((s5-0 (push-back-hatred this))) + (set! (-> s5-0 hatred) 0.5) + (set! (-> s5-0 hatred-dist) 163840.0) + (set! (-> s5-0 dist-scale) 0.1) + (set! (-> s5-0 attacker-scale) 0.01) + (set! (-> s5-0 max-consider-dist) 409600.0) + (set-hatred-indices this s5-0 3 9) + (set-hatred-indices this s5-0 3 12) + (set-hatred-indices this s5-0 3 10) + (set-hatred-indices this s5-0 3 11) + (set-hatred-indices this s5-0 3 6) + (set-hatred-indices this s5-0 3 7) + (set-hatred-indices this s5-0 3 8) + ) + (let ((s5-1 (push-back-hatred this))) + (set! (-> s5-1 hatred) 0.5) + (set! (-> s5-1 hatred-dist) 245760.0) + (set! (-> s5-1 dist-scale) 0.25) + (set! (-> s5-1 attacker-scale) 0.01) + (set! (-> s5-1 max-consider-dist) 409600.0) + (set-hatred-indices this s5-1 5 6) + (set-hatred-indices this s5-1 5 7) + (set-hatred-indices this s5-1 5 8) + (set-hatred-indices this s5-1 5 11) + ) + (let ((s5-2 (push-back-hatred this))) + (set! (-> s5-2 hatred) 0.7) + (set! (-> s5-2 hatred-dist) 245760.0) + (set! (-> s5-2 dist-scale) 0.25) + (set! (-> s5-2 attacker-scale) 0.01) + (set! (-> s5-2 max-consider-dist) 409600.0) + (set-hatred-indices this s5-2 5 9) + (set-hatred-indices this s5-2 5 12) + ) + (let ((a1-13 (push-back-hatred this))) + (set! (-> a1-13 hatred) 0.2) + (set! (-> a1-13 hatred-dist) 245760.0) + (set! (-> a1-13 dist-scale) 0.25) + (set! (-> a1-13 attacker-scale) 0.01) + (set! (-> a1-13 max-consider-dist) 163840.0) + (set-hatred-indices this a1-13 5 10) + ) + (let ((a1-14 (push-back-hatred this))) + (set! (-> a1-14 hatred) 0.7) + (set! (-> a1-14 hatred-dist) 245760.0) + (set! (-> a1-14 dist-scale) 0.5) + (set! (-> a1-14 attacker-scale) 0.01) + (set! (-> a1-14 max-consider-dist) 409600.0) + (set-hatred-indices this a1-14 4 10) + ) + (let ((s5-3 (push-back-hatred this))) + (set! (-> s5-3 hatred) 0.5) + (set! (-> s5-3 hatred-dist) 245760.0) + (set! (-> s5-3 dist-scale) 0.5) + (set! (-> s5-3 attacker-scale) 0.01) + (set! (-> s5-3 max-consider-dist) 409600.0) + (set-hatred-indices this s5-3 4 9) + (set-hatred-indices this s5-3 4 12) + (set-hatred-indices this s5-3 4 11) + (set-hatred-indices this s5-3 4 6) + (set-hatred-indices this s5-3 4 7) + (set-hatred-indices this s5-3 4 8) + ) + (let ((s5-4 (push-back-hatred this))) + (set! (-> s5-4 hatred) 0.6) + (set! (-> s5-4 hatred-dist) 245760.0) + (set! (-> s5-4 dist-scale) 0.25) + (set! (-> s5-4 attacker-scale) 0.0) + (set! (-> s5-4 max-consider-dist) 409600.0) + (set-hatred-indices this s5-4 9 0) + (set-hatred-indices this s5-4 12 0) + (set-hatred-indices this s5-4 10 0) + (set-hatred-indices this s5-4 11 0) + (set-hatred-indices this s5-4 6 0) + (set-hatred-indices this s5-4 7 0) + (set-hatred-indices this s5-4 8 0) + ) + (let ((s5-5 (push-back-hatred this))) + (set! (-> s5-5 hatred) 0.5) + (set! (-> s5-5 hatred-dist) 245760.0) + (set! (-> s5-5 dist-scale) 0.25) + (set! (-> s5-5 attacker-scale) 0.01) + (set! (-> s5-5 max-consider-dist) 409600.0) + (set-hatred-indices this s5-5 9 5) + (set-hatred-indices this s5-5 12 5) + (set-hatred-indices this s5-5 10 5) + (set-hatred-indices this s5-5 11 5) + (set-hatred-indices this s5-5 6 5) + (set-hatred-indices this s5-5 7 5) + (set-hatred-indices this s5-5 8 5) + (set-hatred-indices this s5-5 9 4) + (set-hatred-indices this s5-5 12 4) + (set-hatred-indices this s5-5 10 4) + (set-hatred-indices this s5-5 11 4) + (set-hatred-indices this s5-5 6 4) + (set-hatred-indices this s5-5 7 4) + (set-hatred-indices this s5-5 8 4) + (set-hatred-indices this s5-5 12 3) + (set-hatred-indices this s5-5 9 3) + (set-hatred-indices this s5-5 10 3) + (set-hatred-indices this s5-5 11 3) + (set-hatred-indices this s5-5 6 3) + (set-hatred-indices this s5-5 7 3) + (set-hatred-indices this s5-5 8 3) + ) + (let ((s5-6 (push-back-hatred this))) + (set! (-> s5-6 hatred) 0.1) + (set! (-> s5-6 hatred-dist) 163840.0) + (set! (-> s5-6 dist-scale) 0.25) + (set! (-> s5-6 attacker-scale) 0.01) + (set! (-> s5-6 max-consider-dist) 163840.0) + (set-hatred-indices this s5-6 12 1) + (set-hatred-indices this s5-6 9 1) + (set-hatred-indices this s5-6 10 1) + (set-hatred-indices this s5-6 11 1) + (set-hatred-indices this s5-6 6 1) + (set-hatred-indices this s5-6 7 1) + (set-hatred-indices this s5-6 8 1) + ) + (let ((s5-7 (push-back-hatred this))) + (set! (-> s5-7 hatred) 0.05) + (set! (-> s5-7 hatred-dist) 163840.0) + (set! (-> s5-7 dist-scale) 0.25) + (set! (-> s5-7 attacker-scale) 0.01) + (set! (-> s5-7 max-consider-dist) 163840.0) + (set-hatred-indices this s5-7 12 2) + (set-hatred-indices this s5-7 9 2) + (set-hatred-indices this s5-7 10 2) + (set-hatred-indices this s5-7 8 2) + ) + (let ((v1-184 (push-back-hatred this))) + (set! (-> v1-184 hatred) 0.4) + (set! (-> v1-184 hatred-dist) 184320.0) + (set! (-> v1-184 dist-scale) 0.25) + (set! (-> v1-184 attacker-scale) 0.01) + (set! (-> v1-184 max-consider-dist) 327680.0) + (set! (-> this guard-angry-hatred-info-index) (the-as int (-> v1-184 index))) + ) + (none) + ) diff --git a/goal_src/jak3/levels/wascity/cty-faction.gc b/goal_src/jak3/levels/wascity/cty-faction.gc index eff871f52f..155315564d 100644 --- a/goal_src/jak3/levels/wascity/cty-faction.gc +++ b/goal_src/jak3/levels/wascity/cty-faction.gc @@ -5,15 +5,1024 @@ ;; name in dgo: cty-faction ;; dgos: DESRESC, WWD, CWI +;; +++exclusive-nav-info-mask +(defenum exclusive-nav-info-mask + :type uint8 + :bitfield #t + (eni0 0) + (eni1 1) + (eni2 2) + (eni3 3) + (eni4 4) + (eni5 5) + (eni6 6) + (eni7 7) + ) +;; ---exclusive-nav-info-mask + + ;; DECOMP BEGINS -;; stub +(define *territory-list* (new 'static 'boxed-array :type pair '(#f) '(#f) '(#f) '(#f) '(#f) '(#f))) + +(define *default-faction-info* + (new 'static 'boxed-array :type cty-faction-info :length 21 :allocated-length 30 + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 4 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 2 :kg-guard -2 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 2 :ff-ped -6 :kg-guard 1 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 1 :ff-ped -6 :kg-guard 2 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -2 :ff-ped -6 :kg-guard 4 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard 4 :kg-ped 4 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard 4 :kg-ped 4 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -2 :ff-ped -6 :kg-guard 4 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-ped -6 :kg-guard 2 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 2 :ff-ped -6 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :kg-guard -2 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 4 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 4 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 4 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 2 :kg-guard -4 :kg-ped -6 :mh-guard -2 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 2 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard 1 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -2 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard 2 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -2 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard 4 :mh-ped 2) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard 4 :mh-ped 4) + ) + ) + +(define *default-faction-mod* (new 'static 'cty-faction-info)) + +(define *default-faction-strength-mod* (new 'static 'cty-faction-strength)) + (defun setup-city-task-faction () - (format 0 "skipping setup-city-task-faction~%") + (cond + ((task-node-closed? (game-task-node city-power-game-resolution)) + (cty-faction-evaluate-commands '((faction-strength ff ind 5) + (faction-strength mh ind 5) + (faction-strength kg slum 5) + (faction-strength kg port 1) + (faction-strength mh port 1) + ) + ) + ) + ((task-node-closed? (game-task-node city-blow-barricade-resolution)) + (cty-faction-evaluate-commands '((faction-strength kg 1) (faction-strength kg slum 1))) + ) + ((task-node-closed? (game-task-node city-blow-barricade-resolution)) + (cty-faction-evaluate-commands '((faction-strength kg slum 1))) + ) + ((task-node-closed? (game-task-node city-destroy-grid-resolution)) + (cty-faction-evaluate-commands '((faction-strength kg slum -5) + (faction-strength mh port 0) + (faction-strength kg indb-kg-ff-border -5) + (faction-strength kg indb-kg -5) + (faction-strength kg indb-kg-deep -5) + (faction-strength kg sluma-ff-kg-border -5) + ) + ) + ) + ((task-node-closed? (game-task-node city-destroy-darkeco-resolution)) + (cty-faction-evaluate-commands '((faction-strength mh port -1))) + ) + ((task-node-closed? (game-task-node city-port-attack-resolution)) + (cty-faction-evaluate-commands + '((faction-strength mh -5) (faction-strength ff ind -5) (faction-spawn mh off)) + ) + ) + (else + (cty-faction-evaluate-commands '((faction-strength ff ind -5) + (faction-strength mh -5) + (faction-strength kg -5) + (faction-spawn kg off) + (faction-spawn mh off) + ) + ) + ) + ) + ) + +(defmethod restore-defaults ((this cty-faction-manager)) + (dotimes (s5-0 (-> *default-faction-info* allocated-length)) + (set! (-> this faction-array s5-0) (-> *default-faction-info* s5-0)) + (mem-copy! (the-as pointer (-> this faction-mod-array s5-0)) (the-as pointer *default-faction-mod*) 6) + ) + (mem-copy! + (the-as pointer (-> this global-faction-strength-mod)) + (the-as pointer *default-faction-strength-mod*) + 3 + ) + (dotimes (s5-1 4) + (mem-copy! + (the-as pointer (-> this territory-faction-strength-mod s5-1)) + (the-as pointer *default-faction-strength-mod*) + 3 + ) + ) + (set! (-> this last-requested-level) #f) + (dotimes (v1-13 3) + (set! (-> this territory-faction-flags data v1-13) (the-as uint 0)) + ) + (dotimes (v1-16 30) + (logior! (-> this territory-flags v1-16) 3) + ) + (set! (-> this last-active-territories) (the-as uint 0)) + (cty-faction-manager-method-19 this) + (dotimes (v1-21 7) + (set! (-> this faction-spawn v1-21 faction-type) (the-as uint v1-21)) + (set! (-> this faction-spawn v1-21 requested-level) (the-as uint 3)) + (set! (-> this faction-spawn v1-21 flags) (faction-spawn-flag)) + ) + (let ((v0-4 (logior (-> this update-flags) (cty-faction-update-flag cfu0)))) + (set! (-> this update-flags) v0-4) + v0-4 + ) + ) + +(defmethod cty-faction-manager-method-19 ((this cty-faction-manager)) + (dotimes (v1-0 30) + (set! (-> this permission-cache v1-0) (the-as uint 4)) + ) + #f + ) + +(defmethod cty-faction-manager-method-10 ((this cty-faction-manager) (arg0 int) (arg1 symbol)) + (-> this territory-faction-modes 0 data (+ (cty-faction-manager-method-18 this arg1) (* arg0 16))) + ) + +(defmethod cty-faction-manager-method-11 ((this cty-faction-manager) (arg0 int)) + (-> this territory-flags arg0) + ) + +(defmethod cty-faction-manager-method-14 ((this cty-faction-manager) (arg0 nav-territory-type) (arg1 int) (arg2 int)) + (local-vars (gp-0 int)) + (when (= arg0 (nav-territory-type invalid)) + (set! gp-0 0) + (goto cfg-14) + ) + (let ((v1-5 (-> this faction-array arg0))) + (set! gp-0 0) + (when (or (zero? v1-5) (not v1-5)) + (set! gp-0 gp-0) + (goto cfg-14) + ) + (let ((a0-5 (-> this faction-mod-array arg0)) + (s3-0 (-> this global-faction-strength-mod data arg2)) + (v1-7 (-> v1-5 data arg1)) + ) + -1 + (let* ((s2-0 (+ v1-7 (-> a0-5 data arg2))) + (v1-15 + (+ s3-0 + (-> this territory-faction-strength-mod 0 data (+ arg2 (* (cty-faction-manager-method-16 this arg0) 16))) + s2-0 + ) + ) + ) + (cond + ((zero? v1-15) + (set! gp-0 (logior gp-0 1)) + ) + ((> v1-15 0) + (set! gp-0 (logior gp-0 3)) + ) + ) + ) + ) + ) + (label cfg-14) + gp-0 + ) + +(defmethod cty-faction-manager-method-9 ((this cty-faction-manager) (arg0 int) (arg1 symbol)) + (local-vars (a1-2 int) (a1-4 int)) + (if (not arg1) + (return 0) + ) + (if (= arg1 'ctywide) + (return 3) + ) + (cond + ((= arg1 (-> this last-requested-level)) + (let ((v1-7 (-> this permission-cache arg0))) + (when (not (logtest? v1-7 4)) + (let ((v1-8 (logand -5 v1-7))) + (let ((a0-5 (-> *perf-stats* data 55))) + (b! (zero? (-> a0-5 ctrl)) cfg-10 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a1-2 pcr0) + (+! (-> a0-5 accum0) a1-2) + (.mfpc a1-4 pcr1) + (+! (-> a0-5 accum1) a1-4) + ) + (label cfg-10) + 0 + (return (the-as int v1-8)) + ) + ) + ) + ) + (else + (set! (-> this last-requested-level) arg1) + (cty-faction-manager-method-19 this) + ) + ) + (let* ((s3-0 (cty-faction-manager-method-17 this arg1)) + (a3-0 (cty-faction-manager-method-18 this arg1)) + (v0-0 (cty-faction-manager-method-14 this (the-as nav-territory-type arg0) s3-0 a3-0)) + ) + (set! (-> this permission-cache arg0) (the-as uint v0-0)) + v0-0 + ) + ) + +(defmethod cty-faction-manager-method-16 ((this cty-faction-manager) (arg0 nav-territory-type)) + (case arg0 + (((nav-territory-type port-ff-deep) + (nav-territory-type port-ff-near-kg) + (nav-territory-type port-ff-kg-border) + (nav-territory-type port-ff-near-mh) + (nav-territory-type port-ff-mh-border) + ) + 0 + ) + (((nav-territory-type inda-kg-ff-border) + (nav-territory-type inda-kg) + (nav-territory-type inda-kg-deep) + (nav-territory-type indb-kg-deep) + (nav-territory-type indb-kg) + (nav-territory-type indb-kg-ff-border) + ) + 1 + ) + (((nav-territory-type sluma-ff-kg-border) + (nav-territory-type sluma-ff) + (nav-territory-type sluma-ff-deep) + (nav-territory-type slumb-ff-deep) + (nav-territory-type slumc-ff-deep) + (nav-territory-type genc-border) + (nav-territory-type genc) + ) + 2 + ) + (((nav-territory-type mhcity-mh-ff-border) (nav-territory-type mhcity-mh) (nav-territory-type mhcity-mh-deep)) + 3 + ) + (else + (format 0 "Trying to use an unknown territory type ~d~%" arg0) + (break!) + 0 + ) + ) + ) + +(defmethod cty-faction-manager-method-17 ((this cty-faction-manager) (arg0 symbol)) + (case arg0 + (('ctypesa) + 0 + ) + (('ctycara 'ctycarb 'ctypepa) + 1 + ) + (('ctypesc) + 2 + ) + (('ctypepc 'ctycarkg 'lctyhijk) + 3 + ) + (('ctypesb 'ctygenb) + 4 + ) + (('ctypepb) + 5 + ) + (else + (break!) + 0 + ) + ) + ) + +(defmethod cty-faction-manager-method-18 ((this cty-faction-manager) (arg0 symbol)) + (case arg0 + (('ctycara 'ctycarb 'ctypesa 'ctypepa) + 0 + ) + (('ctypepc 'ctypesc) + 1 + ) + (('ctypepb 'ctypesb 'ctygenb) + 2 + ) + (else + (break!) + 0 + ) + ) + ) + +(deftype exclusive-nav-mesh-info (structure) + ((aid uint32) + (exclusive-mask exclusive-nav-info-mask) + ) + ) + + +(define *exclusive-nav-mesh-list* + (new 'static 'boxed-array :type exclusive-nav-mesh-info + (new 'static 'exclusive-nav-mesh-info :aid #xd0ae :exclusive-mask (exclusive-nav-info-mask eni0 eni1)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0a8 :exclusive-mask (exclusive-nav-info-mask eni0 eni1 eni2)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0a9 :exclusive-mask (exclusive-nav-info-mask eni1 eni2 eni3)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0aa :exclusive-mask (exclusive-nav-info-mask eni2 eni3 eni4)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0ad :exclusive-mask (exclusive-nav-info-mask eni3 eni4)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0af :exclusive-mask (exclusive-nav-info-mask eni5 eni6)) + (new 'static 'exclusive-nav-mesh-info :aid #xd2dc :exclusive-mask (exclusive-nav-info-mask eni1 eni2)) + (new 'static 'exclusive-nav-mesh-info :aid #xd2dd :exclusive-mask (exclusive-nav-info-mask eni0 eni1 eni2)) + (new 'static 'exclusive-nav-mesh-info :aid #xd22b :exclusive-mask (exclusive-nav-info-mask eni3 eni4)) + (new 'static 'exclusive-nav-mesh-info :aid #xd22c :exclusive-mask (exclusive-nav-info-mask eni0 eni3 eni4)) + (new 'static 'exclusive-nav-mesh-info :aid #xd2de :exclusive-mask (exclusive-nav-info-mask eni5 eni6 eni7)) + (new 'static 'exclusive-nav-mesh-info :aid #xd2df :exclusive-mask (exclusive-nav-info-mask eni0 eni6 eni7)) + (new 'static 'exclusive-nav-mesh-info + :aid #xd2e0 + :exclusive-mask (exclusive-nav-info-mask eni0 eni2 eni4 eni7) + ) + ) + ) + +(defmethod cty-faction-manager-method-23 ((this cty-faction-manager) (arg0 uint)) + (if (zero? (-> this target-exclusive-branch-index)) + (return #t) + ) + (logtest? (-> this target-exclusive-branch-index) arg0) + ) + +(defmethod cty-faction-manager-method-13 ((this cty-faction-manager)) + (local-vars (v1-9 int)) + (set! (-> this target-exclusive-branch-index) (the-as uint 0)) + (when *target* + (let ((v1-2 (find-nearest-nav-mesh (target-pos 0) (the-as float #x7f800000)))) + (cond + (v1-2 + (let ((v1-4 (-> v1-2 entity aid))) + (dotimes (a0-3 (-> *exclusive-nav-mesh-list* length)) + (when (= v1-4 (-> *exclusive-nav-mesh-list* a0-3 aid)) + (set! v1-9 (the-as int (-> *exclusive-nav-mesh-list* a0-3 exclusive-mask))) + (goto cfg-9) + ) + ) + ) + (set! v1-9 0) + (label cfg-9) + (set! (-> this target-exclusive-branch-index) (the-as uint v1-9)) + ) + (else + (set! (-> this target-exclusive-branch-index) (the-as uint 0)) + 0 + ) + ) + ) + ) + (when (logtest? (-> this update-flags) (cty-faction-update-flag cfu0)) + (dotimes (s5-1 30) + (when (logtest? (-> this territory-flags s5-1) 1) + (set! (-> this territory-faction-modes s5-1 kg-mode) (the-as uint 0)) + (set! (-> this territory-faction-modes s5-1 ff-mode) (the-as uint 0)) + (set! (-> this territory-faction-modes s5-1 mh-mode) (the-as uint 0)) + (let ((s2-0 (cty-faction-manager-method-14 this (the-as nav-territory-type s5-1) 1 0)) + (s4-0 (cty-faction-manager-method-14 this (the-as nav-territory-type s5-1) 0 0)) + (s3-0 (cty-faction-manager-method-14 this (the-as nav-territory-type s5-1) 2 1)) + (v1-31 (cty-faction-manager-method-14 this (the-as nav-territory-type s5-1) 4 2)) + ) + (when (or (logtest? s2-0 2) (logtest? s4-0 1)) + (let ((a0-13 #f)) + (when (logtest? s3-0 1) + (if (not (logtest? (-> this territory-faction-flags kg-mode) 1)) + (set! (-> this territory-faction-modes s5-1 kg-mode) (the-as uint 1)) + ) + (set! a0-13 #t) + ) + (when (logtest? v1-31 1) + (if (not (logtest? (-> this territory-faction-flags mh-mode) 1)) + (set! (-> this territory-faction-modes s5-1 mh-mode) (the-as uint 1)) + ) + (set! a0-13 #t) + ) + (when (and a0-13 (logtest? s4-0 1)) + (when (not (logtest? (-> this territory-faction-flags ff-mode) 1)) + (set! (-> this territory-faction-modes s5-1 ff-mode) (the-as uint 1)) + (if (logtest? (-> this last-active-territories) (ash 1 s5-1)) + #t + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((s5-2 #f)) + (when (-> *setting-control* user-current attack) + (dotimes (s4-1 30) + (when (logtest? (-> this last-active-territories) (ash 1 s4-1)) + (let ((s3-1 (cty-faction-manager-method-14 this (the-as nav-territory-type s4-1) 2 1))) + (if (or (logtest? (cty-faction-manager-method-14 this (the-as nav-territory-type s4-1) 4 2) 2) (logtest? s3-1 2)) + (set! s5-2 #t) + ) + ) + ) + ) + ) + (cond + (s5-2 + (when (or (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) + (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) + ) + (if (zero? (-> this start-fight-music-time)) + (set-time! (-> this start-fight-music-time)) + ) + (when (and (> (-> this start-fight-music-time) 0) (time-elapsed? (-> this start-fight-music-time) (seconds 5))) + (persist-with-delay *setting-control* 'cty-faction-music (seconds 1000) 'music 'fight1 0.0 0) + (set-time! (-> this last-change-music-time)) + ) + ) + ) + (else + (set! (-> this start-fight-music-time) 0) + (when (or (time-elapsed? (-> this last-change-music-time) (seconds 6)) + (not (-> *setting-control* user-current attack)) + ) + (persist-with-delay *setting-control* 'cty-faction-music 0 'music 'city1 0.0 0) + (set-time! (-> this last-change-music-time)) + ) + ) + ) + ) + (when (logtest? (-> this update-flags) (cty-faction-update-flag cfu0)) + (remove-setting! 'borrow-city) + (set-setting! 'borrow-city (-> *territory-list* 0) 0.0 0) + (add-borrow-levels *load-state*) + ) + (logclear! (-> this update-flags) (cty-faction-update-flag cfu0)) + (cty-faction-manager-method-24 this) + ) + +(defmethod cty-faction-manager-method-21 ((this cty-faction-manager) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 2) + 'ctypesb + ) + ((zero? v1-0) + 'ctypesa + ) + ((= v1-0 1) + 'ctypesc + ) + ) + ) + ) + +(defmethod cty-faction-manager-method-20 ((this cty-faction-manager) (arg0 uint)) + (local-vars (sv-16 int) (sv-17 int) (sv-18 int)) + (if (= arg0 (-> this last-active-territories)) + (return 0) + ) + (set! (-> this last-active-territories) arg0) + (let ((s4-0 (-> *territory-list* 0)) + (s3-0 1) + (s2-0 0) + ) + (set! (car s4-0) #f) + (set! (cdr s4-0) '()) + (dotimes (s1-0 30) + (let ((s0-0 s1-0)) + (when (and (logtest? (-> this territory-flags s0-0) 2) (logtest? arg0 (ash 1 s0-0))) + (set! sv-16 (cty-faction-manager-method-14 this (the-as nav-territory-type s0-0) 0 0)) + (set! sv-17 (cty-faction-manager-method-14 this (the-as nav-territory-type s0-0) 2 1)) + (set! sv-18 (cty-faction-manager-method-14 this (the-as nav-territory-type s0-0) 4 2)) + (when (and (logtest? sv-17 2) (not (logtest? s2-0 2))) + (when (!= (car s4-0) #f) + (set! (cdr s4-0) (-> *territory-list* s3-0)) + (+! s3-0 1) + (set! s4-0 (cdr s4-0)) + ) + (set! s2-0 (logior s2-0 2)) + (set! (car s4-0) (cty-faction-manager-method-21 this 1)) + (set! (cdr s4-0) '()) + ) + (when (and (logtest? sv-16 2) (not (logtest? s2-0 1))) + (when (!= (car s4-0) #f) + (set! (cdr s4-0) (-> *territory-list* s3-0)) + (+! s3-0 1) + (set! s4-0 (cdr s4-0)) + ) + (set! s2-0 (logior s2-0 1)) + (set! (car s4-0) (cty-faction-manager-method-21 this 0)) + (set! (cdr s4-0) '()) + ) + (when (and (logtest? sv-18 2) (not (logtest? s2-0 4))) + (when (!= (car s4-0) #f) + (set! (cdr s4-0) (-> *territory-list* s3-0)) + (+! s3-0 1) + (set! s4-0 (cdr s4-0)) + ) + (set! s2-0 (logior s2-0 4)) + (set! (car s4-0) (cty-faction-manager-method-21 this 2)) + (set! (cdr s4-0) '()) + ) + (logior! (-> this update-flags) (cty-faction-update-flag cfu0)) + ) + ) + ) + ) + (the-as int #f) + ) + +(defmethod cty-faction-manager-method-22 ((this cty-faction-manager)) + (set! (-> this last-active-territories) (the-as uint 0)) + (let ((v0-0 (logior (-> this update-flags) (cty-faction-update-flag cfu0)))) + (set! (-> this update-flags) v0-0) + v0-0 + ) + ) + +;; WARN: Return type mismatch int vs nav-territory-type. +(defun map-symbol-to-nav-territory-type ((arg0 symbol)) + (let ((v1-0 arg0)) + (the-as nav-territory-type (cond + ((= v1-0 'port-ff-deep) + (nav-territory-type port-ff-deep) + ) + ((= v1-0 'port-ff-near-kg) + (nav-territory-type port-ff-near-kg) + ) + ((= v1-0 'port-ff-kg-border) + (nav-territory-type port-ff-kg-border) + ) + ((= v1-0 'inda-kg-ff-border) + (nav-territory-type inda-kg-ff-border) + ) + ((= v1-0 'inda-kg) + (nav-territory-type inda-kg) + ) + ((= v1-0 'inda-kg-deep) + (nav-territory-type inda-kg-deep) + ) + ((= v1-0 'indb-kg-deep) + (nav-territory-type indb-kg-deep) + ) + ((= v1-0 'indb-kg) + (nav-territory-type indb-kg) + ) + ((= v1-0 'indb-kg-ff-border) + (nav-territory-type indb-kg-ff-border) + ) + ((= v1-0 'sluma-ff-kg-border) + (nav-territory-type sluma-ff-kg-border) + ) + ((= v1-0 'sluma-ff) + (nav-territory-type sluma-ff) + ) + ((= v1-0 'sluma-ff-deep) + (nav-territory-type sluma-ff-deep) + ) + ((= v1-0 'slumb-ff-deep) + (nav-territory-type slumb-ff-deep) + ) + ((= v1-0 'slumc-ff-deep) + (nav-territory-type slumc-ff-deep) + ) + ((= v1-0 'genc-border) + (nav-territory-type genc-border) + ) + ((= v1-0 'genc) + (nav-territory-type genc) + ) + ((= v1-0 'port-ff-near-mh) + (nav-territory-type port-ff-near-mh) + ) + ((= v1-0 'port-ff-mh-border) + (nav-territory-type port-ff-mh-border) + ) + ((= v1-0 'mhcity-mh-ff-border) + (nav-territory-type mhcity-mh-ff-border) + ) + ((= v1-0 'mhcity-mh) + (nav-territory-type mhcity-mh) + ) + ((= v1-0 'mhcity-mh-deep) + (nav-territory-type mhcity-mh-deep) + ) + ((= v1-0 'special0) + (nav-territory-type special0) + ) + ((= v1-0 'special1) + (nav-territory-type special1) + ) + ((= v1-0 'special2) + (nav-territory-type special2) + ) + ((= v1-0 'special3) + (nav-territory-type special3) + ) + ((= v1-0 'special4) + (nav-territory-type special4) + ) + ((= v1-0 'special5) + (nav-territory-type special5) + ) + ((= v1-0 'special6) + (nav-territory-type special6) + ) + ((= v1-0 'special7) + (nav-territory-type special7) + ) + ((= v1-0 'special8) + (nav-territory-type special8) + ) + (else + (break!) + (nav-territory-type genc) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs object. +(defun cty-faction-evaluate-commands ((arg0 pair)) + (local-vars (v1-23 object)) + (let ((s5-0 (car arg0))) + (while (not (null? arg0)) + (case (car s5-0) + (('restore-defaults) + (restore-defaults *cty-faction-manager*) + ) + (('faction-spawn) + (let* ((v1-3 (ref s5-0 1)) + (s4-0 (cond + ((= v1-3 'kg-guard) + 0 + ) + ((= v1-3 'mh-guard) + 1 + ) + ((= v1-3 'ff-guard) + 2 + ) + ((= v1-3 'ff-ped) + 3 + ) + ((= v1-3 'ff-vehicle) + 4 + ) + ((= v1-3 'kg-ambient) + 5 + ) + ((= v1-3 'mh-ambient) + 6 + ) + (else + 6 + ) + ) + ) + (v1-4 (ref s5-0 2)) + (a2-0 (cond + ((= v1-4 'off) + 0 + ) + ((= v1-4 'suppress-x) + 1 + ) + ((= v1-4 'suppress) + 2 + ) + ((= v1-4 'default) + 3 + ) + ((= v1-4 'war) + 4 + ) + ((= v1-4 'war3) + 3 + ) + ((= v1-4 'combat) + 7 + ) + ((= v1-4 'mission) + 7 + ) + ((= v1-4 'mission-hi) + 7 + ) + ((= v1-4 'mission-suppress) + 5 + ) + ((= v1-4 'mission-suppress-x) + 3 + ) + (else + 0 + ) + ) + ) + ) + (faction-spawn *cty-faction-manager* s4-0 a2-0 #t #f) + ) + ) + (('faction-set-flags) + (let* ((v1-7 (ref s5-0 1)) + (s4-1 (cond + ((= v1-7 'mh) + 2 + ) + ((= v1-7 'kg) + 1 + ) + ((= v1-7 'ff) + 0 + ) + (else + (break!) + 0 + ) + ) + ) + (v1-8 (ref s5-0 2)) + ) + 0 + (if (= v1-8 'no-war) + (logior! (-> *cty-faction-manager* territory-faction-flags data s4-1) 1) + ) + ) + ) + (('faction-strength) + (let ((s4-2 (ref s5-0 1)) + (s3-0 3) + (a0-40 s5-0) + ) + (cond + ((= ((method-of-type (rtype-of a0-40) length) a0-40) s3-0) + (let ((s4-3 (cond + ((= s4-2 'mh) + 2 + ) + ((= s4-2 'kg) + 1 + ) + ((= s4-2 'ff) + 0 + ) + (else + (break!) + 0 + ) + ) + ) + ) + (set! (-> *cty-faction-manager* global-faction-strength-mod data s4-3) + (the-as int (/ (the-as int (ref s5-0 2)) 8)) + ) + ) + ) + ((begin + (set! v1-23 (ref s5-0 2)) + (let ((a0-45 v1-23)) + (or (= a0-45 'port) (= a0-45 'ind) (= a0-45 'slum) (= a0-45 'mhcity) (= a0-45 'city)) + ) + ) + (let* ((s3-1 (cond + ((= v1-23 'port) + 0 + ) + ((= v1-23 'mhcity) + 3 + ) + ((= v1-23 'ind) + 1 + ) + ((= v1-23 'slum) + 2 + ) + ((= v1-23 'city) + -1 + ) + (else + (break!) + 2 + ) + ) + ) + (v1-24 s4-2) + (s4-4 (cond + ((= v1-24 'mh) + 2 + ) + ((= v1-24 'kg) + 1 + ) + ((= v1-24 'ff) + 0 + ) + (else + (break!) + 0 + ) + ) + ) + ) + (cond + ((< -1 s3-1) + (set! (-> *cty-faction-manager* territory-faction-strength-mod 0 data (+ (* s3-1 16) s4-4)) + (the-as int (/ (the-as int (ref s5-0 3)) 8)) + ) + ) + (else + (dotimes (s3-2 4) + (set! (-> *cty-faction-manager* territory-faction-strength-mod 0 data (+ (* s3-2 16) s4-4)) + (the-as int (/ (the-as int (ref s5-0 3)) 8)) + ) + ) + ) + ) + ) + ) + (else + (let* ((s3-4 (map-symbol-to-nav-territory-type (the-as symbol (ref s5-0 2)))) + (v1-30 s4-2) + (s4-5 (cond + ((or (= v1-30 'ff) (= v1-30 'ff-guard)) + 0 + ) + ((= v1-30 'ff-ped) + 1 + ) + ((or (= v1-30 'kg) (= v1-30 'kg-guard)) + 2 + ) + ((= v1-30 'kg-ped) + 3 + ) + ((or (= v1-30 'mh) (= v1-30 'mh-guard)) + 4 + ) + ((= v1-30 'mh-ped) + 5 + ) + (else + (break!) + 0 + ) + ) + ) + ) + (set! (-> *cty-faction-manager* territory-faction-strength-mod 0 data (+ (* s3-4 16) s4-5)) + (the-as int (/ (the-as int (ref s5-0 3)) 8)) + ) + ) + ) + ) + ) + ) + ) + (set! arg0 (cdr arg0)) + (set! s5-0 (car arg0)) + ) + ) + (cty-faction-manager-method-22 *cty-faction-manager*) 0 ) -(defun cty-faction-evaluate-commands ((arg0 pair)) - (format 0 "skipping (cty-faction-evaluate-commands ~A)~%" arg0) - 0 - ) \ No newline at end of file +(defun is-faction-level-loaded? ((arg0 cty-faction-level)) + (case arg0 + (((cty-faction-level pesc)) + (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) + ) + (((cty-faction-level pesb)) + (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) + ) + (((cty-faction-level pesa)) + (= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) + ) + (((cty-faction-level pepa)) + (= (status-of-level-and-borrows *level* 'ctypepa #f) 'active) + ) + (((cty-faction-level car)) + (or (= (status-of-level-and-borrows *level* 'ctycara #f) 'active) + (= (status-of-level-and-borrows *level* 'ctycarb #f) 'active) + ) + ) + (((cty-faction-level pepc)) + (= (status-of-level-and-borrows *level* 'ctypepc #f) 'active) + ) + (((cty-faction-level pepb)) + (= (status-of-level-and-borrows *level* 'ctypepb #f) 'active) + ) + ) + ) + +(defmethod faction-spawn ((this cty-faction-manager) (arg0 int) (arg1 int) (arg2 symbol) (arg3 symbol)) + (let ((v1-2 (-> this faction-spawn arg0))) + (when (or arg2 (not (logtest? (-> v1-2 flags) (faction-spawn-flag fs0 fs3)))) + (set! (-> v1-2 requested-level) (the-as uint arg1)) + (if arg2 + (logior! (-> v1-2 flags) (faction-spawn-flag fs0)) + ) + (when arg3 + (let ((v0-0 (logior (-> v1-2 flags) (faction-spawn-flag fs3)))) + (set! (-> v1-2 flags) v0-0) + v0-0 + ) + ) + ) + ) + ) + +(defmethod cty-faction-manager-method-24 ((this cty-faction-manager)) + (dotimes (s5-0 7) + (if (not (is-faction-level-loaded? (the-as cty-faction-level s5-0))) + (logior! (-> this faction-spawn s5-0 flags) (faction-spawn-flag fs2)) + ) + (set! (-> this faction-spawn s5-0 current-level) (the-as uint 0)) + (logclear! (-> this faction-spawn s5-0 flags) (faction-spawn-flag fs1)) + ) + (dotimes (s5-1 30) + (when (logtest? (-> this last-active-territories) (ash 1 s5-1)) + (if (= (-> this territory-faction-modes s5-1 ff-mode) 1) + (faction-spawn this 2 4 #f #f) + ) + (if (= (-> this territory-faction-modes s5-1 kg-mode) 1) + (faction-spawn this 0 4 #f #f) + ) + (if (= (-> this territory-faction-modes s5-1 mh-mode) 1) + (faction-spawn this 1 4 #f #f) + ) + ) + ) + (let ((s5-2 0)) + 0 + (let ((v1-30 (the int (lerp 20.0 0.0 (-> *setting-control* user-current city-heap-load))))) + (dotimes (a0-24 7) + (let ((a1-7 (-> this faction-spawn a0-24))) + (when (and (not (logtest? (-> a1-7 flags) (faction-spawn-flag fs1 fs2))) + (logtest? (-> a1-7 flags) (faction-spawn-flag fs0)) + ) + (set! (-> a1-7 current-level) (-> a1-7 requested-level)) + (logior! (-> a1-7 flags) (faction-spawn-flag fs1)) + (+! s5-2 (-> a1-7 current-level)) + ) + ) + ) + (countdown (a0-27 9) + (when (>= s5-2 v1-30) + 0 + (goto cfg-55) + ) + (let ((a1-10 0)) + (dotimes (a2-13 7) + (let ((a3-7 (-> this faction-spawn a2-13))) + (if (and (not (logtest? (-> a3-7 flags) (faction-spawn-flag fs1 fs2))) (= (-> a3-7 requested-level) a0-27)) + (+! a1-10 1) + ) + ) + ) + (when (> a1-10 0) + (let ((a3-12 (* (the-as uint a1-10) (the-as uint a0-27))) + (a2-17 (- v1-30 s5-2)) + ) + 0 + 0 + (let ((a1-11 (/ (min (the-as int a3-12) a2-17) a1-10))) + (if (zero? a1-11) + (set! a1-11 a2-17) + ) + (dotimes (a2-19 7) + (let ((a3-17 (-> this faction-spawn a2-19))) + (when (and (not (logtest? (-> a3-17 flags) (faction-spawn-flag fs1 fs2))) (= (-> a3-17 requested-level) a0-27)) + (set! (-> a3-17 current-level) (the-as uint a1-11)) + (logior! (-> a3-17 flags) (faction-spawn-flag fs1)) + (+! s5-2 a1-11) + ) + ) + (when (>= s5-2 v1-30) + 0 + (goto cfg-55) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (label cfg-55) + (dotimes (v1-35 7) + (logclear! (-> this faction-spawn v1-35 flags) (faction-spawn-flag fs3)) + ) + #f + ) diff --git a/goal_src/jak3/levels/wascity/ff-squad-control-h.gc b/goal_src/jak3/levels/wascity/ff-squad-control-h.gc index 1219ead426..98b7a48fbf 100644 --- a/goal_src/jak3/levels/wascity/ff-squad-control-h.gc +++ b/goal_src/jak3/levels/wascity/ff-squad-control-h.gc @@ -7,3 +7,72 @@ ;; DECOMP BEGINS +(deftype traffic-guard-type-info (structure) + ((object-type traffic-type) + (max-target-count int8) + (min-target-count int8) + (target-count int8) + (count int8) + (change-to-type traffic-type) + ) + :allow-misaligned + ) + + +(deftype traffic-guard-type-array (structure) + ((data traffic-guard-type-info 3 :inline) + (guard-info-normal traffic-guard-type-info :inline :overlay-at (-> data 0)) + (guard-info-war traffic-guard-type-info :inline :offset 16) + (guard-info-mission traffic-guard-type-info :inline :offset 32) + ) + :allow-misaligned + ) + + +(deftype squad-alert-state-settings (structure) + ((guard-settings-array squad-unit-settings 10 :inline) + (ped-tazer squad-unit-settings :inline :overlay-at (-> guard-settings-array 0)) + (ped-rifle squad-unit-settings :inline :offset 32) + (ped-grenade squad-unit-settings :inline :offset 64) + (ped-waster squad-unit-settings :inline :offset 96) + (bike-turret squad-unit-settings :inline :offset 128) + (hellcat-turret squad-unit-settings :inline :offset 160) + ) + :pack-me + ) + + +(deftype traffic-target-formation (structure) + ((circle-range float 16) + ) + :pack-me + ) + + +(deftype ff-squad-control (squad-control-city) + ((squad-settings squad-alert-state-settings 3 :inline :offset 824) + (settings squad-alert-state-settings :inline :overlay-at (-> squad-settings 0)) + (settings-war squad-alert-state-settings :inline :overlay-at (-> squad-settings 1)) + (settings-mission squad-alert-state-settings :inline :overlay-at (-> squad-settings 2)) + (guard-type-info-array traffic-guard-type-array 10 :inline) + (guard-type-mask-from-object-type uint32 29) + (target-formation-array traffic-target-formation 3 :inline) + ) + (:methods + (ff-squad-control-method-45 (_type_) none) + (ff-squad-control-method-46 (_type_) none) + (ff-squad-control-method-47 (_type_) none) + (ff-squad-control-method-48 (_type_) none) + (set-guard-target-level (_type_ float) none) + (get-focus (_type_) process-focusable) + (ff-squad-control-method-51 (_type_ process-focusable collide-spec) process-focusable) + (end-pursuit-for-all (_type_ int) none) + (get-unit-settings-by-idx (_type_ int) squad-unit-settings) + (ff-squad-control-method-54 (_type_ int) none) + (ff-squad-control-method-55 (_type_ int int) traffic-type) + (ff-squad-control-method-56 (_type_ int int int) none) + ) + ) + + +(define *ff-squad-control* (the-as ff-squad-control #f)) diff --git a/goal_src/jak3/levels/wascity/flee-info.gc b/goal_src/jak3/levels/wascity/flee-info.gc index 5cf3934715..caed831be4 100644 --- a/goal_src/jak3/levels/wascity/flee-info.gc +++ b/goal_src/jak3/levels/wascity/flee-info.gc @@ -7,3 +7,143 @@ ;; DECOMP BEGINS +(deftype flee-info (structure) + ((pad uint8 4) + ) + :pack-me + (:methods + (flee-info-method-9 (_type_ citizen nav-branch int vector float) float) + (flee-info-method-10 (_type_ citizen vector) nav-segment) + (flee-info-method-11 (_type_ citizen) none) + (flee-info-method-12 (_type_ citizen) none) + (flee-info-method-13 (_type_ citizen) none) + ) + ) + + +(defmethod flee-info-method-9 ((this flee-info) (arg0 citizen) (arg1 nav-branch) (arg2 int) (arg3 vector) (arg4 float)) + (local-vars (sv-32 int)) + (when (nonzero? arg2) + (-> arg1 src-node) + (let* ((s2-0 (-> arg1 dest-node)) + (t9-0 vector-vector-xz-distance) + (a0-1 arg3) + (a2-1 s2-0) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-1 position quad)) + (set! (-> a1-1 w) 1.0) + (let ((s0-0 (t9-0 a0-1 a1-1)) + (s1-0 (-> s2-0 branch-count)) + (f30-0 0.0) + ) + (set! sv-32 0) + (while (< sv-32 s1-0) + (+! f30-0 (flee-info-method-9 this arg0 (-> s2-0 branch-array sv-32) (+ arg2 -1) arg3 s0-0)) + (set! sv-32 (+ sv-32 1)) + ) + ;; og:preserve-this fix divide by zero + (set! arg4 (+ s0-0 (the float (/-signed-0-guard (the int f30-0) s1-0)))) + ) + ) + ) + arg4 + ) + +(defmethod flee-info-method-10 ((this flee-info) (arg0 citizen) (arg1 vector)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> arg0 root trans quad)) + (set! (-> a1-1 w) 81920.0) + (let ((s5-0 (find-segment arg0 a1-1 arg1))) + (if s5-0 + (citizen-method-199 arg0 s5-0) + ) + s5-0 + ) + ) + ) + +(defmethod flee-info-method-11 ((this flee-info) (arg0 citizen)) + (citizen-method-205 arg0) + (none) + ) + +(defmethod flee-info-method-12 ((this flee-info) (arg0 citizen)) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 root trans) (the-as vector (-> arg0 danger-pos))))) + (flee-info-method-10 this arg0 a2-1) + ) + (if (zero? (-> arg0 controller branch)) + (citizen-method-208 arg0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat))) + ) + (none) + ) + +(defmethod flee-info-method-13 ((this flee-info) (arg0 citizen)) + (local-vars (sv-80 nav-branch)) + (let* ((s5-0 (-> arg0 controller)) + (s2-0 (-> s5-0 branch dest-node)) + (s4-0 (the-as nav-branch #f)) + (s1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 dest-point) (-> arg0 controller path-prev-point))) + ) + 0.0 + (let ((s0-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 root trans) (-> arg0 dest-point)))) + (set! (-> s0-1 y) 0.0) + (set! (-> s1-1 y) 0.0) + (vector-xz-normalize! s1-1 1.0) + (let ((f0-4 (vector-dot s0-1 s1-1))) + (when (< -16384.0 f0-4) + (cond + ((zero? (-> s2-0 branch-count)) + ) + (else + (let ((s1-2 (-> s2-0 branch-count)) + (f30-0 0.0) + ) + (dotimes (s0-2 s1-2) + (set! sv-80 (-> s2-0 branch-array s0-2)) + (let ((f0-5 (flee-info-method-9 this arg0 sv-80 4 (-> arg0 danger-pos) 0.0))) + (when (< f30-0 f0-5) + (set! f30-0 f0-5) + (set! s4-0 sv-80) + ) + ) + ) + ) + ) + ) + (when s4-0 + (vehicle-controller-method-11 s5-0) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> s5-0 turn-exit-point quad)) + (vehicle-controller-method-10 s5-0 s4-0) + (set! (-> s5-0 path-prev-point quad) (-> s3-1 quad)) + ) + (set! (-> s5-0 branch) s4-0) + (let ((a1-4 (-> s4-0 dest-node)) + (v1-21 (-> s5-0 turn-exit-point)) + ) + (set! (-> v1-21 quad) (-> a1-4 position quad)) + (set! (-> v1-21 w) 1.0) + ) + ) + ) + ) + ) + ) + (when (< (-> arg0 cp-next-time) (current-time)) + (set! (-> arg0 cp-next-time) (+ (current-time) (set-reaction-time! arg0 (seconds 2) (seconds 4)))) + (citizen-method-203 arg0 (-> arg0 cp-force)) + ) + (add-offset-to-target! (-> arg0 nav state) (-> arg0 cp-force)) + (let ((a0-18 (-> arg0 nav state)) + (v1-32 (-> arg0 dest-point)) + ) + (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-18 target-pos quad) (-> v1-32 quad)) + ) + 0 + (set! (-> (new 'stack-no-clear 'vector) quad) (-> arg0 nav state target-pos quad)) + (nav-enemy-method-187 arg0) + (none) + ) diff --git a/goal_src/jak3/levels/wascity/formation-object.gc b/goal_src/jak3/levels/wascity/formation-object.gc index 8d0c0cc5cc..88ed604d0f 100644 --- a/goal_src/jak3/levels/wascity/formation-object.gc +++ b/goal_src/jak3/levels/wascity/formation-object.gc @@ -5,5 +5,482 @@ ;; name in dgo: formation-object ;; dgos: DESRESC, WWD, CWI +;; +++formation-object-flag +(defenum formation-object-flag + :type uint8 + :bitfield #t + (fo0) + ) +;; ---formation-object-flag + + +(define-extern traffic-entity-hack (function traffic-type none)) + ;; DECOMP BEGINS +(deftype handle-array (inline-array-class-uint64) + ((data0 handle :dynamic) + ) + ) + + +(set! (-> handle-array heap-base) (the-as uint 8)) + +(deftype formation-object (process-focusable) + ((object-list handle-array) + (num-objects int8) + (formation formation-layout) + (flags formation-object-flag) + (controller vehicle-controller :inline) + (alert-time-offset time-frame) + (dest-position vector :inline) + (formation-transform matrix :inline) + ) + (:state-methods + active + inactive + ) + (:methods + (formation-object-method-30 (_type_) symbol) + (formation-object-method-31 (_type_) float) + (formation-object-method-32 (_type_) float) + (formation-object-method-33 (_type_) float) + (formation-object-method-34 (_type_) float) + (formation-object-method-35 (_type_) symbol) + (get-leader-handle (_type_) handle) + (formation-object-method-37 (_type_) symbol) + (get-target-speed (_type_ process-focusable int) float) + (init-collision! (_type_) none) + (formation-object-method-40 (_type_ vector vector int) vector) + (formation-event-handler (_type_ process int symbol event-message-block) object) + (formation-object-method-42 (_type_ handle) symbol) + (formation-object-method-43 (_type_ int) none) + (formation-object-method-44 (_type_ int) object) + (formation-object-method-45 (_type_) symbol) + (clear-objects! (_type_) none) + (formation-object-method-47 (_type_ handle) object) + ) + ) + + +(deftype msg-get-num-inactive (structure) + ((obj-type traffic-type) + (num-inactive-out int32) + ) + ) + + +(defmethod formation-object-method-30 ((this formation-object)) + (let ((s5-0 (new 'stack-no-clear 'msg-get-num-inactive))) + (set! (-> s5-0 obj-type) (traffic-type guard-a)) + (send-event *traffic-manager* 'get-num-normal-available s5-0) + (>= (-> s5-0 num-inactive-out) (-> this formation num-formation-points)) + ) + ) + +(defmethod formation-object-method-40 ((this formation-object) (arg0 vector) (arg1 vector) (arg2 int)) + (when (and (>= arg2 0) (< arg2 (-> this num-objects))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-rotate*! s3-0 (-> this formation formation-points arg2) (-> this formation-transform)) + (vector+float*! arg0 arg1 s3-0 (-> this formation scale-factor)) + ) + ) + arg0 + ) + +;; WARN: Return type mismatch formation-object vs object. +(defmethod formation-event-handler ((this formation-object) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('member-attacked) + (dotimes (s5-1 (-> this num-objects)) + (let ((s4-0 (-> this object-list data0 s5-1))) + (if (formation-object-method-47 this s4-0) + (send-event (handle->process s4-0) 'member-attacked) + ) + ) + ) + ) + (('traffic-off) + (when (not (logtest? (-> this flags) (formation-object-flag fo0))) + ) + (set! this (the-as formation-object #f)) + (goto cfg-47) + ) + (('traffic-off-force) + (go (method-of-object this inactive)) + ) + (('get-leader-handle) + (-> arg3 param 0) + (get-leader-handle this) + ) + (('traffic-activate) + (cond + ((formation-object-method-45 this) + (matrix-identity! (-> this formation-transform)) + (let ((s5-2 (the-as traffic-object-spawn-params (-> arg3 param 0)))) + (let ((a1-3 (-> s5-2 nav-branch))) + (when a1-3 + (vehicle-controller-method-13 (-> this controller) a1-3 (-> this root trans)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (vector-! s4-1 (-> this controller turn-exit-point) (-> this root trans)) + (set! (-> s4-1 y) 0.0) + (vector-normalize! s4-1 1.0) + (forward-up->inv-matrix (-> this formation-transform) s4-1 *up-vector*) + ) + ) + ) + (set! (-> this root trans quad) (-> s5-2 position quad)) + (set! (-> s5-2 handle-parent) (process->handle this)) + (set! (-> s5-2 object-type) (traffic-type guard-a)) + (logior! (-> s5-2 flags) (traffic-spawn-flags tsf4)) + (dotimes (s4-2 (-> this num-objects)) + (set! (-> s5-2 handle) (-> this object-list data0 s4-2)) + (set! (-> s5-2 user-data) (the-as uint s4-2)) + (formation-object-method-40 this (-> s5-2 position) (-> this root trans) s4-2) + (send-event *traffic-manager* 'activate-specific-object s5-2) + (send-event (handle->process (-> s5-2 handle)) 'change-guard-type (-> this formation composition s4-2)) + ) + ) + (logclear! (-> this focus-status) (focus-status inactive)) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this inactive)) + (set! this (the-as formation-object #f)) + (goto cfg-47) + ) + ) + ) + ) + (label cfg-47) + this + ) + +(defmethod init-collision! ((this formation-object)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 0.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defbehavior formation-init-by-other formation-object ((arg0 traffic-object-spawn-params)) + (stack-size-set! (-> self main-thread) 128) + (init-collision! self) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 rotation)) + (traffic-entity-hack (-> arg0 object-type)) + (set! (-> self formation) (new 'process 'formation-layout)) + (init! (-> self formation) (-> *formation-list* (logand (rand-uint31-gen *random-generator*) 1))) + (set! (-> self formation scale-factor) 20480.0) + (set! (-> self formation leader-index) 1) + (set! (-> self object-list) (new 'process 'handle-array (-> self formation num-formation-points))) + (clear-1 (-> self object-list)) + (set! (-> self num-objects) 0) + (vehicle-controller-method-9 (-> self controller)) + (go-virtual inactive) + ) + +(defmethod formation-object-method-42 ((this formation-object) (arg0 handle)) + (!= (push-back (-> this object-list) arg0) -1) + ) + +(defmethod formation-object-method-44 ((this formation-object) (arg0 int)) + (let ((gp-0 (-> this object-list data0 arg0))) + (pop-front (-> this object-list) arg0) + (when (formation-object-method-47 this gp-0) + (let* ((gp-1 (handle->process gp-0)) + (a0-6 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (send-event a0-6 'formation-exit) + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod formation-object-method-43 ((this formation-object) (arg0 int)) + (let* ((gp-0 this) + (s5-0 (method-of-object gp-0 formation-object-method-44)) + ) + (dotimes (s2-0 arg0) + (case (-> this object-list data0 s2-0) + (((length (-> this object-list))) + (empty) + (goto cfg-7) + ) + ) + ) + (label cfg-7) + (s5-0 gp-0 -1) + ) + (none) + ) + +(deftype msg-get-inactive-objects (structure) + ((object-type-info-array (inline-array traffic-object-type-info)) + ) + ) + + +(define foo-hack #t) + +(defmethod formation-object-method-45 ((this formation-object)) + (if (not foo-hack) + (return #f) + ) + (clear-objects! this) + (let ((s5-0 (new 'stack-no-clear 'msg-get-inactive-objects))) + (send-event *traffic-manager* 'get-inactive-object-list s5-0) + (let ((s5-1 (-> s5-0 object-type-info-array 6))) + (when (>= (-> s5-1 inactive-count) (-> this formation num-formation-points)) + (set! (-> this num-objects) (-> this formation num-formation-points)) + (dotimes (s4-0 (-> this num-objects)) + (push-back (-> this object-list) (-> s5-1 array s4-0)) + ) + (return #t) + ) + ) + ) + #f + ) + +(defmethod clear-objects! ((this formation-object)) + (dotimes (s5-0 (-> this num-objects)) + (let ((s4-0 (-> this object-list data0 s5-0))) + (when (formation-object-method-47 this s4-0) + (let* ((s4-1 (handle->process s4-0)) + (a0-5 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (send-event a0-5 'formation-exit) + ) + ) + ) + ) + (clear-2 (-> this object-list)) + (set! (-> this num-objects) 0) + 0 + (none) + ) + +(defmethod formation-object-method-47 ((this formation-object) (arg0 handle)) + (let* ((s5-0 (handle->process arg0)) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (and v1-3 + (logtest? (-> (the-as citizen v1-3) flags) (citizen-flag in-formation)) + (= (-> (the-as citizen v1-3) vehicle) (process->handle this)) + ) + ) + ) + +(defbehavior formation-object-event-handler formation-object ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (formation-event-handler self arg0 arg1 arg2 arg3) + ) + +(defstate inactive (formation-object) + :virtual #t + :event formation-object-event-handler + :enter (behavior () + (logior! (-> self focus-status) (focus-status inactive)) + (clear-objects! self) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status inactive)) + ) + :code sleep-code + ) + +(define random-var 0) + +(defstate active (formation-object) + :virtual #t + :event formation-object-event-handler + :enter (behavior () + (logclear! (-> self focus-status) (focus-status inactive)) + (set-time! (-> self state-time)) + (set! (-> self alert-time-offset) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.9 1.3))))) + (formation-object-method-40 + self + (-> self dest-position) + (-> self controller turn-exit-point) + (-> self formation leader-index) + ) + (formation-object-method-37 self) + ) + :trans (behavior () + (if (not (formation-object-method-35 self)) + (go-virtual inactive) + ) + (formation-object-method-34 self) + (let ((f30-0 (formation-object-method-33 self))) + (when (and (nonzero? (-> self controller branch)) + (< (vector-vector-xz-distance-squared (-> self root trans) (-> self dest-position)) (* f30-0 f30-0)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self controller turn-exit-point quad)) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (vector-! gp-0 (-> self controller turn-exit-point) s5-0) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (forward-up->inv-matrix (-> self formation-transform) gp-0 *up-vector*) + ) + (formation-object-method-40 + self + (-> self dest-position) + (-> self controller turn-exit-point) + (-> self formation leader-index) + ) + (formation-object-method-37 self) + ) + ) + (when (time-elapsed? (-> self state-time) (-> self alert-time-offset)) + (set! (-> self alert-time-offset) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.9 1.3))))) + (set-time! (-> self state-time)) + (when *traffic-manager* + (let ((gp-1 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> gp-1 sphere quad) (-> self root trans quad)) + (set! (-> gp-1 sphere r) 40960.0) + (vector-reset! (-> gp-1 velocity)) + (set! (-> gp-1 notify-radius) (formation-object-method-32 self)) + (set! (-> gp-1 danger-level) 1.0) + (set! (-> gp-1 decay-rate) 0.0) + (set! (-> gp-1 flags) (the-as uint 1)) + (set! (-> gp-1 danger-type) (the-as uint 0)) + (set! (-> gp-1 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere gp-1) + ) + ) + ) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch process-focusable vs formation-object. +(defmethod relocate ((this formation-object) (offset int)) + (if (nonzero? (-> this formation)) + (&+! (-> this formation) offset) + ) + (if (nonzero? (-> this object-list)) + (&+! (-> this object-list) offset) + ) + (the-as formation-object ((method-of-type process-focusable relocate) this offset)) + ) + +(defmethod formation-object-method-31 ((this formation-object)) + (* (-> this formation scale-factor) (-> this formation estimated-radius)) + ) + +(defmethod formation-object-method-34 ((this formation-object)) + (let* ((s5-0 (handle->process (-> this object-list data0 (-> this formation leader-index)))) + (a0-6 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if a0-6 + (set! (-> this root trans quad) (-> (get-trans (the-as process-focusable a0-6) 0) quad)) + ) + ) + (set! (-> this root trans y) (+ 20480.0 (-> this root trans y))) + ) + +(defmethod formation-object-method-35 ((this formation-object)) + (let ((gp-0 0)) + (dotimes (s4-0 (-> this num-objects)) + (let ((a1-0 (-> this object-list data0 s4-0))) + (cond + ((formation-object-method-47 this a1-0) + (+! gp-0 1) + ) + ((= s4-0 (-> this formation leader-index)) + (return #f) + ) + ) + ) + ) + (when (< gp-0 2) + ) + (>= gp-0 2) + ) + ) + +(defmethod get-leader-handle ((this formation-object)) + (-> this object-list data0 (-> this formation leader-index)) + ) + +(defmethod formation-object-method-37 ((this formation-object)) + (dotimes (s5-0 (-> this num-objects)) + (let ((s4-0 (handle->process (-> this object-list data0 s5-0)))) + (send-event + s4-0 + 'formation-set-destination + (formation-object-method-40 this (new 'stack-no-clear 'vector) (-> this controller turn-exit-point) s5-0) + ) + ) + ) + #f + ) + +(defmethod formation-object-method-33 ((this formation-object)) + (* 2.0 (+ 10240.0 (formation-object-method-31 this))) + ) + +(defmethod formation-object-method-32 ((this formation-object)) + (* 2.3 (+ 10240.0 (formation-object-method-31 this))) + ) + +(defmethod get-target-speed ((this formation-object) (arg0 process-focusable) (arg1 int)) + (process->handle arg0) + (let* ((s4-0 (get-trans arg0 0)) + (v1-6 + (formation-object-method-40 this (new 'stack-no-clear 'vector) *zero-vector* (-> this formation leader-index)) + ) + (a2-3 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) v1-6)) + (s3-0 (formation-object-method-40 this (new 'stack-no-clear 'vector) a2-3 arg1)) + (s5-1 + (formation-object-method-40 this (new 'stack-no-clear 'vector) (-> this controller turn-exit-point) arg1) + ) + (f30-1 (- (vector-vector-xz-distance s4-0 s5-1) (vector-vector-xz-distance s3-0 s5-1))) + (f1-0 (formation-object-method-31 this)) + (f0-2 (fmax 0.0 (fmin 1.8 (/ (fabs f30-1) f1-0)))) + (f0-3 (* 0.5555556 f0-2)) + (f1-4 1.0) + ) + (if (>= f0-3 0.07) + (set! f1-4 (cond + ((< 0.0 f30-1) + (let ((f0-6 (- 1.0 (* (- 1.0 f0-3) (- 1.0 f0-3))))) + (- (+ 1.0 (* 1.8 f0-6)) f0-6) + ) + ) + (else + (- (+ 1.0 (* 0.75 f0-3)) f0-3) + ) + ) + ) + ) + f1-4 + ) + ) diff --git a/goal_src/jak3/levels/wascity/formations.gc b/goal_src/jak3/levels/wascity/formations.gc index 98c1644553..e1ec3cdd8f 100644 --- a/goal_src/jak3/levels/wascity/formations.gc +++ b/goal_src/jak3/levels/wascity/formations.gc @@ -7,3 +7,80 @@ ;; DECOMP BEGINS +(deftype formation-info (structure) + ((composition (array uint8)) + (layout (array vector)) + ) + ) + + +(deftype formation-layout (basic) + ((formation-points vector 10 :inline) + (num-formation-points int8) + (leader-index int8) + (__pad int16) + (scale-factor float) + (estimated-radius float) + (composition (array uint8)) + ) + (:methods + (init! (_type_ formation-info) none) + ) + ) + + +;; WARN: Return type mismatch (array uint8) vs none. +(defmethod init! ((this formation-layout) (arg0 formation-info)) + (let* ((s4-0 (-> arg0 layout)) + (v1-1 (length s4-0)) + (f0-0 0.0) + ) + (dotimes (a0-2 v1-1) + (set! (-> this formation-points a0-2 quad) (-> s4-0 a0-2 quad)) + (let* ((a1-6 (-> this formation-points a0-2)) + (f1-3 (+ (* (-> a1-6 x) (-> a1-6 x)) (* (-> a1-6 z) (-> a1-6 z)))) + ) + (if (< f0-0 f1-3) + (set! f0-0 f1-3) + ) + ) + ) + (set! (-> this num-formation-points) v1-1) + (if (> v1-1 0) + (set! (-> this estimated-radius) (sqrtf f0-0)) + ) + ) + (set! (-> this composition) (-> arg0 composition)) + (none) + ) + +(define *formation-layout-cross* (new 'static 'boxed-array :type vector + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + +(define *formation-composition-cross* (new 'static 'boxed-array :type uint8 #x1 #x2 #x1 #x1)) + +(define *formation-layout-wedge* (new 'static 'boxed-array :type vector + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + +(define *formation-composition-wedge* (new 'static 'boxed-array :type uint8 #x2 #x1 #x1)) + +(define *formation-list* + (new 'static 'inline-array formation-info 2 (new 'static 'formation-info) (new 'static 'formation-info)) + ) + +(set! (-> *formation-list* 0 composition) *formation-composition-cross*) + +(set! (-> *formation-list* 0 layout) *formation-layout-cross*) + +(set! (-> *formation-list* 1 composition) *formation-composition-wedge*) + +(set! (-> *formation-list* 1 layout) *formation-layout-wedge*) diff --git a/goal_src/jak3/levels/wascity/guard-h.gc b/goal_src/jak3/levels/wascity/guard-h.gc index 896fa8a92a..d454926a2e 100644 --- a/goal_src/jak3/levels/wascity/guard-h.gc +++ b/goal_src/jak3/levels/wascity/guard-h.gc @@ -7,3 +7,193 @@ ;; DECOMP BEGINS +(deftype guard-anim-info (structure) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) + ) + :pack-me + ) + + +(deftype guard-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (knocked-land int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim guard-anim-info 2 :inline) + (yellow-land-anim guard-anim-info 2 :inline) + (blue-hit-anim int32 1) + (pad uint8 4) + ) + ) + + +(deftype guard-shoot-info (structure) + ((anim-index int32) + (start float) + (end float) + ) + :pack-me + ) + + +(deftype range (structure) + ((start float) + (end float) + ) + ) + + +(deftype crimson-guard-collide-shape (collide-shape-moving) + () + ) + + +(deftype crimson-guard (citizen) + ((squad ff-squad-control :override) + (root crimson-guard-collide-shape :override) + (info guard-global-info) + (hit-face uint32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (small-hit int32) + (yellow-anim uint32) + (guard-type guard-type) + (settings squad-unit-settings) + (next-time time-frame) + (last-time-see-target time-frame) + (joint joint-mod) + (joint-enable symbol) + (already-shot symbol) + (miss-amount float) + (l-control lightning-control) + (next-shot time-frame) + (anim-shoot guard-shoot-info 3 :inline) + (transport handle) + (transport-side uint32) + (target-flags uint8) + (target-pos vector :inline) + (target-pos-predict vector :inline) + (target-pos-predict-miss vector :inline) + (los-status uint64) + (target-vel-vec vector :inline) + (target-vel float) + (target-self vector :inline) + (target-self-xz vector :inline) + (target-self-dist float) + (target-self-xz-dist float) + (grenade-guard-min-player-dist float) + (flee-behavior flee-info :inline) + (last-check-player-time time-frame) + (num-times-reloading-interrupted int32) + (total-flee-time time-frame) + (last-fire-time time-frame) + (ammo-count int8) + (urgent-fire symbol) + (last-onscreen-time time-frame) + (target-y-angle float) + (rand-state-time time-frame) + (pursuit-start-time time-frame) + (last-visible-target-pos vector :inline) + (lazer-sound sound-id) + (move-position vector :inline) + (move-index int32) + (reloading-ammo handle) + (guard-riot-shield handle) + (guard-shield-rotate-y-degrees float) + (attack-hit-shield-type uint64) + (current-shield-logic uint64) + (target-status squad-target-status :inline) + (minimap connection-minimap) + (other-side symbol) + (last-choose-new-enemy-time time-frame) + (last-quick-target-spot-angle float) + (next-update-target-time time-frame) + (last-player-attack-time time-frame) + (player-attack-count int32) + ) + (:state-methods + get-up-front + get-up-back + search + attack + arrest + gun-shoot + grenade-throw + grenade-throw-post-reloading + grenade-throw-post-retreating + exit-transport + waiting-ambush + close-attack + attack-tazer + knocked-off-vehicle + roll-right + roll-left + close-attack-active + flee-danger + grenade-hostile + rifle-hostile + tazer-hostile + undefined0 + undefined1 + undefined2 + undefined3 + undefined4 + undefined5 + undefined6 + undefined7 + undefined8 + undefined9 + undefined10 + undefined11 + undefined12 + rifle-reload + ) + (:methods + (crimson-guard-method-251 (_type_) none) + (crimson-guard-method-252 (_type_) none) + (crimson-guard-method-253 (_type_) none) + (crimson-guard-method-254 (_type_) none) + (crimson-guard-method-255 (_type_) none) + (crimson-guard-method-256 (_type_) symbol) + (crimson-guard-method-257 (_type_) symbol) + (crimson-guard-method-258 (_type_ vector vector vector) int) + (crimson-guard-method-259 (_type_ vector) none) + (crimson-guard-method-260 (_type_) none) + (crimson-guard-method-261 (_type_) none) + (crimson-guard-method-262 (_type_) none) + (crimson-guard-method-263 (_type_) none) + (crimson-guard-method-264 (_type_) none) + (crimson-guard-method-265 (_type_ float) none) + (crimson-guard-method-266 (_type_ vector) float) + (crimson-guard-method-267 (_type_ guard-type symbol) none) + (crimson-guard-method-268 (_type_) object) + (crimson-guard-method-269 (_type_ process-focusable) object) + (crimson-guard-method-270 (_type_) symbol) + (crimson-guard-method-271 (_type_) symbol) + (crimson-guard-method-272 (_type_) symbol) + (crimson-guard-method-273 (_type_) none) + (crimson-guard-method-274 (_type_) none) + (crimson-guard-method-275 (_type_) none) + (crimson-guard-method-276 (_type_) none) + (crimson-guard-method-277 (_type_) none) + (crimson-guard-method-278 (_type_) none) + (crimson-guard-method-279 (_type_) none) + (crimson-guard-method-280 (_type_) symbol) + (crimson-guard-method-281 (_type_) none) + (crimson-guard-method-282 (_type_ vector traffic-target-formation (pointer float) int) symbol) + (crimson-guard-method-283 (_type_) float) + (crimson-guard-method-284 (_type_ vector) vector) + (crimson-guard-method-285 (_type_ int) int) + (crimson-guard-method-286 (_type_) int) + (crimson-guard-method-287 (_type_ process-focusable) float) + (crimson-guard-method-288 (_type_ process-focusable) float) + (crimson-guard-method-289 (_type_ float) none) + (crimson-guard-method-290 (_type_) process) + ) + ) diff --git a/goal_src/jak3/levels/wascity/kg-squad-control-h.gc b/goal_src/jak3/levels/wascity/kg-squad-control-h.gc index 7d25190a98..6061a7ba4e 100644 --- a/goal_src/jak3/levels/wascity/kg-squad-control-h.gc +++ b/goal_src/jak3/levels/wascity/kg-squad-control-h.gc @@ -5,5 +5,89 @@ ;; name in dgo: kg-squad-control-h ;; dgos: DESRESC, WWD, CWI +;; +++kg-squad-used-guard-types +(defenum kg-squad-used-guard-types + :type uint32 + :bitfield #t + (kg0 0) + (kg1 1) + (kg2 2) + (kg3 3) + (kg4 4) + (kg5 5) + (kg6 6) + (kg7 7) + (kg8 8) + (kg9 9) + ) +;; ---kg-squad-used-guard-types + + ;; DECOMP BEGINS +(deftype handle-array (inline-array-class-uint64) + ((data0 handle :dynamic) + ) + ) + + +(set! (-> handle-array heap-base) (the-as uint 8)) + +(deftype kg-squad-member-settings (structure) + ((object-type traffic-type) + (max-target-count int8) + (min-target-count int8) + (target-count int8) + (enemy-type traffic-type) + (toggle-shield-percentage float) + (heat-shield-percentage float) + ) + ) + + +(deftype kg-squad-settings (structure) + ((roboguard-settings kg-squad-member-settings :inline) + (roboguard-giant-settings kg-squad-member-settings :inline) + (flying-turret-settings kg-squad-member-settings :inline) + (spydroid-settings kg-squad-member-settings :inline) + (kg-enemy-settings kg-squad-member-settings 4 :inline :overlay-at roboguard-settings) + ) + ) + + +(deftype kg-squad-control (squad-control-city) + ((guard-to-traffic-mapping traffic-type 10) + (guard-to-squad-setting-mapping uint8 10) + (used-guard-types kg-squad-used-guard-types) + (active-squad-member-list handle-array :offset 852) + (enemy-type-seek-to-list uint8 3) + (enemy-type-seek-from-list uint8 3) + (enemy-type-seek-to uint8 :overlay-at (-> enemy-type-seek-to-list 0)) + (enemy-type-seek-from uint8 :overlay-at (-> enemy-type-seek-from-list 0)) + (enemy-type-seek-to-war uint8 :overlay-at (-> enemy-type-seek-to-list 1)) + (enemy-type-seek-from-war uint8 :overlay-at (-> enemy-type-seek-from-list 1)) + (enemy-type-seek-to-mission uint8 :overlay-at (-> enemy-type-seek-to-list 2)) + (enemy-type-seek-from-mission uint8 :overlay-at (-> enemy-type-seek-from-list 2)) + (alert-level int8) + (squad-settings kg-squad-settings 3 :inline) + (squad-normal-settings kg-squad-settings :inline :overlay-at (-> squad-settings 0)) + (squad-war-settings kg-squad-settings :inline :overlay-at (-> squad-settings 1)) + (squad-mission-settings kg-squad-settings :inline :overlay-at (-> squad-settings 2)) + (current-target-attackers int8) + ) + (:methods + (increment-alert-level (_type_ int) int) + (set-alert-level1 (_type_ int) int) + (add-squad-member (_type_ process) int) + (pop-squad-member-from-list (_type_ process) int) + (get-alert-level1 (_type_) int) + (copy-squad-settings-to-idx (_type_ (inline-array kg-squad-member-settings) int) none) + (kg-squad-control-method-51 (_type_) symbol) + (kg-squad-control-method-52 (_type_ process process) int) + (kg-squad-control-method-53 (_type_) none) + (kg-squad-control-method-54 (_type_) float) + ) + ) + + +(define *kg-squad-control* (the-as kg-squad-control #f)) diff --git a/goal_src/jak3/levels/wascity/mh-squad-control-h.gc b/goal_src/jak3/levels/wascity/mh-squad-control-h.gc index fa6ca1b812..cb84f2ad66 100644 --- a/goal_src/jak3/levels/wascity/mh-squad-control-h.gc +++ b/goal_src/jak3/levels/wascity/mh-squad-control-h.gc @@ -7,3 +7,43 @@ ;; DECOMP BEGINS +(deftype mh-squad-member-settings (structure) + ((object-type traffic-type) + (max-target-count int8) + (min-target-count int8) + (target-count int8) + (toggle-shield-percentage float) + (heat-shield-percentage float) + ) + ) + + +(deftype mh-squad-settings (structure) + ((mh-enemy-settings mh-squad-member-settings 3 :inline) + (grunt-settings mh-squad-member-settings :inline :overlay-at (-> mh-enemy-settings 0)) + (flitter-settings mh-squad-member-settings :inline :offset 16) + (predator-settings mh-squad-member-settings :inline :offset 32) + ) + ) + + +(deftype mh-squad-control (squad-control-city) + ((active-squad-member-list handle-array :offset 828) + (squad-settings mh-squad-settings 3 :inline) + (squad-normal-settings mh-squad-settings :inline :overlay-at (-> squad-settings 0)) + (squad-war-settings mh-squad-settings :inline :overlay-at (-> squad-settings 1)) + (squad-mission-settings mh-squad-settings :inline :overlay-at (-> squad-settings 2)) + (alert-level int8) + (map-traffic-object-type-to-squad traffic-type 29) + (current-target-attackers int8) + ) + (:methods + (add-squad-member (_type_ process) int) + (pop-squad-member-from-list (_type_ process) int) + (copy-squad-settings-to-idx (_type_ (inline-array mh-squad-member-settings) int) none) + (mh-squad-control-method-48 (_type_) symbol) + ) + ) + + +(define *mh-squad-control* (the-as mh-squad-control #f)) diff --git a/goal_src/jak3/levels/wascity/mission-squad-control-h.gc b/goal_src/jak3/levels/wascity/mission-squad-control-h.gc index 92e65cbe49..0071bf19aa 100644 --- a/goal_src/jak3/levels/wascity/mission-squad-control-h.gc +++ b/goal_src/jak3/levels/wascity/mission-squad-control-h.gc @@ -13,6 +13,8 @@ (cai1 1) (cai2 2) (cai3 3) + (cai4 4) + (cai5 5) ) ;; ---city-attacker-info-flag @@ -21,6 +23,8 @@ (defenum city-hatred-info-flag :type uint16 :bitfield #t + (chi0 0) + (chi1 1) ) ;; ---city-hatred-info-flag @@ -38,21 +42,22 @@ (enemy-type int16) (self-index int16) (enemy-index int16) - (callback function) - (hatred-map-callback function) + (callback (function process city-attacker-info int)) + (hatred-map-callback (function process city-attacker-info int)) ) (:methods - (city-attacker-info-method-9 () none) - (city-attacker-info-method-10 () none) + (init! (_type_ process int) none) + (reset! (_type_) none) ) ) (deftype city-attacker-cache (structure) ((pos vector) - (proc basic) + (proc process) (attackable? symbol) ) + :pack-me ) @@ -66,6 +71,7 @@ (index uint8) (pad uint8) ) + :pack-me ) @@ -95,28 +101,28 @@ (deftype mission-squad-control (basic) ((attackers city-attacker-array) - (unused-list basic) - (hatred-vals basic) - (hatred-indices basic) + (unused-list (array int16)) + (hatred-vals city-hatred-array) + (hatred-indices (array uint8)) (attacker-cache city-attacker-cache-array) (target-attacker city-attacker-info) (max-num-object-types int32) ) (:methods - (mission-squad-control-method-9 () none) - (mission-squad-control-method-10 () none) - (mission-squad-control-method-11 () none) - (mission-squad-control-method-12 () none) - (mission-squad-control-method-13 () none) - (mission-squad-control-method-14 () none) - (mission-squad-control-method-15 () none) - (mission-squad-control-method-16 () none) - (mission-squad-control-method-17 () none) - (mission-squad-control-method-18 () none) - (mission-squad-control-method-19 () none) - (mission-squad-control-method-20 () none) - (mission-squad-control-method-21 () none) - (mission-squad-control-method-22 () none) - (mission-squad-control-method-23 () none) + (init! (_type_ int int int) none) + (allocate-attacker (_type_) city-attacker-info) + (remove-attacker (_type_ city-attacker-info) none) + (mission-squad-control-method-12 (_type_) symbol) + (mission-squad-control-method-13 (_type_ city-attacker-info) int) + (init-attackers (_type_) none) + (init-attack-controller (_type_) none) + (mission-squad-control-method-16 (_type_) none) + (set-hatred-indices-for-all (_type_ int city-hatred-info city-hatred-info int) symbol) + (get-attacker-at-idx (_type_ int) city-attacker-info) + (push-back-hatred (_type_) city-hatred-info) + (set-hatred-indices (_type_ city-hatred-info int int) uint) + (get-hatred-at-idx (_type_ int int) city-hatred-info) + (update-attack-target (_type_) none) + (reset-hatred (_type_) none) ) ) diff --git a/goal_src/jak3/levels/wascity/mission-squad-control.gc b/goal_src/jak3/levels/wascity/mission-squad-control.gc index f7578bd813..c285749099 100644 --- a/goal_src/jak3/levels/wascity/mission-squad-control.gc +++ b/goal_src/jak3/levels/wascity/mission-squad-control.gc @@ -7,3 +7,371 @@ ;; DECOMP BEGINS +(defmethod init! ((this mission-squad-control) (arg0 int) (arg1 int) (arg2 int)) + (set! (-> this attackers) (new 'loading-level 'city-attacker-array arg0)) + (set! (-> this attacker-cache) (new 'loading-level 'city-attacker-cache-array arg0)) + (set! (-> this unused-list) (new 'loading-level 'boxed-array int16 arg0)) + (set! (-> this hatred-vals) (new 'loading-level 'city-hatred-array arg2)) + (set! (-> this hatred-indices) (new 'loading-level 'boxed-array uint8 (* arg1 arg1))) + (set! (-> this max-num-object-types) arg1) + (init-attackers this) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod reset! ((this city-attacker-info)) + (set! (-> this proc) (the-as handle #f)) + (set! (-> this enemy) (the-as handle #f)) + (set! (-> this next-update-target-time) 0) + (set! (-> this flags) (city-attacker-info-flag)) + (set! (-> this num-current-attackers) (the-as uint 0)) + (set! (-> this self-type) -1) + (set! (-> this enemy-type) -1) + (set! (-> this enemy-index) -1) + (set! (-> this callback) #f) + (set! (-> this hatred-map-callback) #f) + (none) + ) + +(defmethod init-attackers ((this mission-squad-control)) + (set! (-> this attackers length) (-> this attackers allocated-length)) + (dotimes (s5-0 (-> this attackers length)) + (reset! (-> this attackers data s5-0)) + (set! (-> this attackers data s5-0 self-index) s5-0) + (set! (-> this unused-list s5-0) s5-0) + ) + (set! (-> this unused-list length) (-> this unused-list allocated-length)) + (set! (-> this target-attacker) (allocate-attacker this)) + (set! (-> this target-attacker flags) (city-attacker-info-flag)) + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai1)) + (set! (-> this target-attacker max-num-attackers) (the-as uint 4)) + (reset-hatred this) + (none) + ) + +;; WARN: Return type mismatch city-hatred-info-flag vs none. +(defmethod reset-hatred ((this mission-squad-control)) + (set! (-> this hatred-vals length) 1) + (dotimes (v1-1 (-> this hatred-indices length)) + (set! (-> this hatred-indices v1-1) (the-as uint 0)) + ) + (set! (-> this target-attacker flags) (city-attacker-info-flag)) + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai1)) + (logior! (-> this hatred-vals data 0 flags) (city-hatred-info-flag chi0)) + (none) + ) + +(defmethod allocate-attacker ((this mission-squad-control)) + (let ((gp-0 (the-as city-attacker-info #f))) + (cond + ((> (-> this unused-list length) 0) + (let ((v1-7 (-> this unused-list (+ (-> this unused-list length) -1)))) + (set! gp-0 (-> this attackers data v1-7)) + ) + (+! (-> this unused-list length) -1) + ) + (else + (format 0 "!!!! Unable to allocate new attacker for mission squad!~%") + ) + ) + gp-0 + ) + ) + +(defmethod remove-attacker ((this mission-squad-control) (arg0 city-attacker-info)) + (let ((s5-0 (-> arg0 self-index))) + (when (and (>= s5-0 0) (< s5-0 (-> this attackers length))) + (dotimes (v1-3 (-> this attackers length)) + (let ((a0-5 (-> this attackers data v1-3))) + (when (= (-> a0-5 enemy-index) s5-0) + (set! (-> a0-5 enemy-index) -1) + (set! (-> a0-5 enemy) (the-as handle #f)) + (logior! (-> a0-5 flags) (city-attacker-info-flag cai2)) + ) + ) + ) + (let ((v1-6 (-> arg0 enemy-index))) + (when (and (>= v1-6 0) (< v1-6 (-> this attackers length))) + (let ((v1-9 (-> this attackers data v1-6))) + (+! (-> v1-9 num-current-attackers) -1) + ) + ) + ) + (reset! arg0) + (set! (-> this unused-list (-> this unused-list length)) s5-0) + (+! (-> this unused-list length) 1) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this city-attacker-info) (arg0 process) (arg1 int)) + (set! (-> this proc) (process->handle arg0)) + (set! (-> this self-type) arg1) + (set! (-> this enemy) (the-as handle #f)) + (logior! (-> this flags) (city-attacker-info-flag cai0)) + (set! (-> this next-update-target-time) 0) + (set! (-> this num-current-attackers) (the-as uint 0)) + (set! (-> this max-num-attackers) (the-as uint 127)) + (set! (-> this enemy-index) -1) + (set! (-> this callback) #f) + (none) + ) + +(defmethod mission-squad-control-method-13 ((this mission-squad-control) (arg0 city-attacker-info)) + (local-vars (v0-3 int)) + (let ((f30-0 0.0) + (gp-0 -1) + ) + (dotimes (s3-0 (-> this attackers length)) + (let ((s2-0 (-> this attackers data s3-0))) + (when (and (!= (-> arg0 self-index) s3-0) + (logtest? (-> s2-0 flags) (city-attacker-info-flag cai0)) + (not (logtest? (-> s2-0 flags) (city-attacker-info-flag cai3))) + (-> this attacker-cache data s3-0 attackable?) + ) + (let ((v1-11 -1)) + (if (-> arg0 hatred-map-callback) + (set! v1-11 ((-> arg0 hatred-map-callback) (handle->process (-> arg0 proc)) s2-0)) + ) + (if (< v1-11 0) + (set! v1-11 + (the-as + int + (-> this hatred-indices (+ (* (-> arg0 self-type) (-> this max-num-object-types)) (-> s2-0 self-type))) + ) + ) + ) + (when (> v1-11 0) + (let ((s1-0 (-> this hatred-vals data v1-11))) + (when (and (not (logtest? (-> s1-0 flags) (city-hatred-info-flag chi0))) + (or (not (-> arg0 callback)) ((-> arg0 callback) (handle->process (-> arg0 proc)) s2-0)) + ) + (let ((f28-0 (-> s1-0 hatred))) + 1.0 + (let ((f0-1 1.0) + (v1-30 (-> s2-0 num-current-attackers)) + ) + (if (= (-> arg0 enemy-index) s3-0) + (+! v1-30 -1) + ) + (let* ((f1-2 (/ (the float v1-30) (the float (-> s2-0 max-num-attackers)))) + (f2-3 (fmin 1.0 f1-2)) + (f1-3 1.0) + (f26-0 (+ f1-3 (* f2-3 (- (-> s1-0 attacker-scale) f1-3)))) + ) + (when (< (-> s1-0 dist-scale) 1.0) + (let* ((f1-6 (vector-vector-xz-distance + (-> this attacker-cache data (-> arg0 self-index) pos) + (-> this attacker-cache data s3-0 pos) + ) + ) + (f0-3 (/ f1-6 (-> s1-0 hatred-dist))) + ) + (set! f0-1 (cond + ((>= f1-6 (-> s1-0 max-consider-dist)) + 0.0 + ) + (else + (let ((f1-8 (fmin 1.0 f0-3)) + (f0-4 1.0) + ) + (+ f0-4 (* f1-8 (- (-> s1-0 dist-scale) f0-4))) + ) + ) + ) + ) + ) + ) + (let ((f0-7 (* f28-0 (* f26-0 f0-1)))) + (if (= s3-0 (-> arg0 enemy-index)) + (set! f0-7 (* 2.0 f0-7)) + ) + (when (< f30-0 f0-7) + (set! f30-0 f0-7) + (set! gp-0 s3-0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (when #t + (when (!= gp-0 (-> arg0 enemy-index)) + (when (and (>= (-> arg0 enemy-index) 0) (< gp-0 0)) + (if (logtest? (-> this attackers data (-> arg0 enemy-index) flags) (city-attacker-info-flag cai5)) + (return 0) + ) + ) + (if (>= (-> arg0 enemy-index) 0) + (+! (-> this attackers data (-> arg0 enemy-index) num-current-attackers) -1) + ) + (logior! (-> arg0 flags) (city-attacker-info-flag cai2)) + (set! (-> arg0 enemy-index) gp-0) + (cond + ((>= gp-0 0) + (set! (-> arg0 enemy) (-> this attackers data gp-0 proc)) + (set! (-> arg0 enemy-type) (-> this attackers data gp-0 self-type)) + (set! v0-3 (the-as int (+ (-> this attackers data gp-0 num-current-attackers) 1))) + (set! (-> this attackers data gp-0 num-current-attackers) (the-as uint v0-3)) + ) + (else + (set! (-> arg0 enemy) (the-as handle #f)) + (set! v0-3 -1) + (set! (-> arg0 enemy-type) v0-3) + ) + ) + v0-3 + ) + ) + ) + ) + +(defmethod mission-squad-control-method-12 ((this mission-squad-control)) + (dotimes (s5-0 (-> this attackers length)) + (let ((a1-0 (-> this attackers data s5-0))) + (when (logtest? (-> a1-0 flags) (city-attacker-info-flag cai0)) + (let ((v1-6 (handle->process (-> a1-0 proc)))) + (cond + (v1-6 + (set! (-> this attacker-cache data s5-0 proc) v1-6) + (set! (-> this attacker-cache data s5-0 pos) (-> (the-as process-drawable v1-6) root trans)) + (set! (-> this attacker-cache data s5-0 attackable?) + (or (= (-> v1-6 type) target) + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead inactive))) + ) + ) + ) + ((!= (-> a1-0 self-index) (-> this target-attacker self-index)) + (remove-attacker this a1-0) + ) + ) + ) + ) + ) + ) + (dotimes (s5-1 (-> this attackers length)) + (let ((a1-9 (-> this attackers data s5-1))) + (when (logtest? (-> a1-9 flags) (city-attacker-info-flag cai0)) + (if (and (not (logtest? (-> a1-9 flags) (city-attacker-info-flag cai1))) + (or (< (-> a1-9 enemy-index) 0) + (not (logtest? (-> this attackers data (-> a1-9 enemy-index) flags) (city-attacker-info-flag cai0))) + (and (< (-> a1-9 next-update-target-time) (current-time)) + (let ((a0-29 + (-> this hatred-indices (+ (* (-> a1-9 self-type) (-> this max-num-object-types)) (-> a1-9 enemy-type))) + ) + ) + (or (when (> a0-29 0) + (let ((a0-31 (-> this hatred-vals data a0-29))) + (not (logtest? (-> a0-31 flags) (city-hatred-info-flag chi1))) + ) + ) + (-> a1-9 hatred-map-callback) + ) + ) + ) + ) + ) + (mission-squad-control-method-13 this a1-9) + ) + ) + ) + ) + #f + ) + +(defmethod update-attack-target ((this mission-squad-control)) + (cond + ((or (not *target*) (focus-test? *target* disable dead inactive)) + (logclear! (-> this target-attacker flags) (city-attacker-info-flag cai0)) + (logclear! (-> this target-attacker flags) (city-attacker-info-flag cai5)) + ) + ((or (not *target*) (focus-test? *target* ignore)) + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai0)) + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai5)) + ) + (else + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai0 cai1 cai4)) + (logclear! (-> this target-attacker flags) (city-attacker-info-flag cai5)) + (set! (-> this target-attacker self-type) 0) + (set! (-> this target-attacker proc) (process->handle *target*)) + ) + ) + (none) + ) + +(defmethod mission-squad-control-method-16 ((this mission-squad-control)) + (update-attack-target this) + (mission-squad-control-method-12 this) + 0 + (none) + ) + +(defmethod get-hatred-at-idx ((this mission-squad-control) (arg0 int) (arg1 int)) + (-> this hatred-vals data (-> this hatred-indices (+ (* arg0 (-> this max-num-object-types)) arg1))) + ) + +;; WARN: Return type mismatch object vs city-hatred-info. +(defmethod push-back-hatred ((this mission-squad-control)) + (the-as city-hatred-info (cond + ((= (-> this hatred-vals length) (-> this hatred-vals allocated-length)) + (break!) + (-> this hatred-vals data) + ) + (else + (let ((v1-4 (-> this hatred-vals length))) + (set! (-> this hatred-vals data v1-4 index) (the-as uint v1-4)) + (+! (-> this hatred-vals length) 1) + (-> this hatred-vals data v1-4) + ) + ) + ) + ) + ) + +(defmethod set-hatred-indices ((this mission-squad-control) (arg0 city-hatred-info) (arg1 int) (arg2 int)) + (let ((v0-0 (-> arg0 index))) + (set! (-> this hatred-indices (+ (* arg1 (-> this max-num-object-types)) arg2)) v0-0) + v0-0 + ) + ) + +(defmethod init-attack-controller ((this mission-squad-control)) + 0 + (none) + ) + +(defmethod set-hatred-indices-for-all ((this mission-squad-control) (arg0 int) (arg1 city-hatred-info) (arg2 city-hatred-info) (arg3 int)) + (dotimes (s1-0 (-> this max-num-object-types)) + (let ((a0-2 (get-hatred-at-idx this s1-0 arg0))) + (if (= (-> a0-2 index) (-> arg1 index)) + (set-hatred-indices this arg2 s1-0 arg3) + ) + ) + ) + #f + ) + +(defmethod get-attacker-at-idx ((this mission-squad-control) (arg0 int)) + (if (or (< arg0 0) (>= arg0 (-> this attackers length))) + (return (the-as city-attacker-info #f)) + ) + (let ((v0-0 (-> this attackers data arg0))) + (cond + ((= (-> v0-0 self-type) -1) + (the-as city-attacker-info #f) + ) + (else + (empty) + v0-0 + ) + ) + ) + ) diff --git a/goal_src/jak3/levels/wascity/squad-control-city-h.gc b/goal_src/jak3/levels/wascity/squad-control-city-h.gc index e6ed2ef12f..7077a2f954 100644 --- a/goal_src/jak3/levels/wascity/squad-control-city-h.gc +++ b/goal_src/jak3/levels/wascity/squad-control-city-h.gc @@ -5,5 +5,33 @@ ;; name in dgo: squad-control-city-h ;; dgos: DESRESC, WWD, CWI +;; +++squad-city-mode +(defenum squad-city-mode + :type uint32 + (zero) + (one) + (two) + ) +;; ---squad-city-mode + + ;; DECOMP BEGINS +(deftype squad-control-city (squad-control) + ((traffic traffic-engine) + (city-mode squad-city-mode) + ) + (:methods + (squad-control-city-method-34 (_type_) symbol) + (squad-control-city-method-35 (_type_ citizen handle) process-focusable) + (get-city-mode (_type_) squad-city-mode) + (squad-control-city-method-37 (_type_) none) + (squad-control-city-method-38 (_type_ process-focusable process-focusable) symbol) + (squad-control-city-method-39 (_type_ process-focusable process-focusable) float) + (squad-control-city-method-40 (_type_ process-focusable process-focusable) none) + (squad-control-city-method-41 (_type_ process-focusable process-focusable) symbol) + (squad-control-city-method-42 (_type_) float) + (squad-control-city-method-43 (_type_ process-focusable) symbol) + (add-squad-to-traffic-engine (_type_ traffic-engine) none) + ) + ) diff --git a/goal_src/jak3/levels/wascity/squad-control-city.gc b/goal_src/jak3/levels/wascity/squad-control-city.gc index 50697a3481..c201887366 100644 --- a/goal_src/jak3/levels/wascity/squad-control-city.gc +++ b/goal_src/jak3/levels/wascity/squad-control-city.gc @@ -7,3 +7,369 @@ ;; DECOMP BEGINS +(defmethod squad-control-method-10 ((this squad-control-city)) + (init! (-> this alert-state)) + (set! (-> this city-mode) (squad-city-mode zero)) + (call-parent-method this) + (none) + ) + +(defmethod add-squad-to-traffic-engine ((this squad-control-city) (arg0 traffic-engine)) + (set! (-> this traffic) arg0) + (add-squad-ctrl arg0 this) + (none) + ) + +(defmethod squad-control-city-method-34 ((this squad-control-city)) + (dotimes (s5-0 (the-as int (-> this traffic tracker0 active-object-count))) + (let ((a0-1 (-> this traffic tracker0 active-object-type-list s5-0))) + (when (logtest? (-> this traffic object-type-info-array a0-1 flags) (traffic-type-flag ttf4)) + (let ((a0-5 (handle->process (-> this traffic tracker0 active-object-list s5-0)))) + (if (and (the-as vehicle a0-5) + (not (logtest? (-> (the-as vehicle a0-5) v-flags) (vehicle-flag persistent))) + (not (focus-test? (the-as vehicle a0-5) dead inactive)) + (or (zero? (-> (the-as vehicle a0-5) draw)) + (not (logtest? (-> (the-as vehicle a0-5) draw status) (draw-control-status on-screen))) + ) + ) + (send-event a0-5 'traffic-off-force) + ) + ) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> this traffic tracker1 active-object-count))) + (let ((a0-8 (-> this traffic tracker1 active-object-type-list s5-1))) + (when (logtest? (-> this traffic object-type-info-array a0-8 flags) (traffic-type-flag ttf4)) + (let ((a0-12 (handle->process (-> this traffic tracker1 active-object-list s5-1)))) + (if (and (the-as process-focusable a0-12) + (not (focus-test? (the-as process-focusable a0-12) dead inactive)) + (or (zero? (-> (the-as process-focusable a0-12) draw)) + (not (logtest? (-> (the-as process-focusable a0-12) draw status) (draw-control-status on-screen))) + ) + ) + (send-event a0-12 'traffic-off-force) + ) + ) + ) + ) + ) + #f + ) + +(defmethod update ((this squad-control-city)) + (call-parent-method this) + (squad-control-city-method-34 this) + (squad-control-method-24 this) + 0 + (none) + ) + +(defmethod squad-control-city-method-38 ((this squad-control-city) (arg0 process-focusable) (arg1 process-focusable)) + (let* ((s5-0 (get-trans arg1 0)) + (f0-0 (vector-vector-xz-distance-squared (-> arg0 root trans) s5-0)) + (f1-0 245760.0) + ) + (or (< f0-0 (* f1-0 f1-0)) (< (fabs (- (-> s5-0 y) (-> arg0 root trans y))) 61440.0)) + ) + ) + +(defmethod squad-control-city-method-39 ((this squad-control-city) (arg0 process-focusable) (arg1 process-focusable)) + 0.0 + ) + +(defmethod squad-control-city-method-41 ((this squad-control-city) (arg0 process-focusable) (arg1 process-focusable)) + #t + ) + +(defmethod squad-control-city-method-40 ((this squad-control-city) (arg0 process-focusable) (arg1 process-focusable)) + 0 + (none) + ) + +(defmethod squad-control-city-method-42 ((this squad-control-city)) + 1.0 + ) + +(defmethod squad-control-city-method-43 ((this squad-control-city) (arg0 process-focusable)) + #t + ) + +;; WARN: Return type mismatch process-drawable vs process-focusable. +(defmethod squad-control-city-method-35 ((this squad-control-city) (arg0 citizen) (arg1 handle)) + (local-vars (sv-16 vector) (sv-32 vector) (sv-48 vector)) + (let* ((s4-0 (handle->process arg1)) + (s2-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + (s1-0 #f) + (s4-1 arg0) + ) + (let ((s3-0 (the-as process-drawable #f))) + (let ((v1-5 #f)) + (if (or (not s2-0) (focus-test? s2-0 disable dead inactive)) + (set! s1-0 #t) + (set! v1-5 (squad-control-city-method-38 this s4-1 s2-0)) + ) + (if (and (not s1-0) (or v1-5 (logtest? (-> s4-1 flags) (citizen-flag in-pursuit)))) + (set! s3-0 s2-0) + ) + (when (or s1-0 (and (not (logtest? (enemy-flag lock-focus) (-> s4-1 enemy-flags))) + (or (not v1-5) (squad-control-city-method-43 this arg0)) + ) + ) + (when (= (-> s4-1 level name) 'ctypesb) + (nop!) + 0 + ) + (when (!= (-> s4-1 faction-mode) 1) + (set! s3-0 (get-focus-in-range this s4-1)) + (goto cfg-121) + ) + (let* ((f30-0 0.0) + (f0-0 40960000.0) + (f28-0 (* f0-0 f0-0)) + ) + (when #t + (let ((v1-22 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((s2-1 (-> v1-22 next0))) + (while (!= v1-22 (-> *collide-player-list* alive-list-end)) + (let* ((v1-23 (the-as collide-shape (-> (the-as connection v1-22) param1))) + (a0-21 (-> v1-23 root-prim)) + ) + (when (logtest? (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list bot-targetable jak-vehicle) + (-> a0-21 prim-core collide-as) + ) + (let* ((s0-0 (-> v1-23 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (not (focus-test? (the-as process-focusable s1-1) disable dead inactive)) + (!= arg0 s1-1) + (squad-control-city-method-38 this s4-1 (the-as process-focusable s1-1)) + ) + (squad-control-city-method-40 this s4-1 (the-as process-focusable s1-1)) + (when (squad-control-city-method-41 this s4-1 (the-as process-focusable s1-1)) + (let ((f26-0 (squad-control-city-method-39 this s4-1 (the-as process-focusable s1-1)))) + (let ((v1-36 (get-idx-in-status-arr this (process->handle s1-1)))) + (if (>= v1-36 0) + (+! f26-0 (-> this alert-state target-status-array v1-36 threat-level)) + ) + ) + (cond + ((< f30-0 f26-0) + (set! f30-0 f26-0) + (set! f28-0 + (vector-vector-xz-distance-squared (-> arg0 root trans) (get-trans (the-as process-focusable s1-1) 3)) + ) + (set! s3-0 s1-1) + ) + ((= f26-0 f30-0) + (let ((s0-2 vector-vector-xz-distance-squared)) + (set! sv-16 (-> arg0 root trans)) + (let* ((a1-25 (get-trans (the-as process-focusable s1-1) 3)) + (f0-4 (* (s0-2 sv-16 a1-25) (squad-control-city-method-42 this))) + ) + (when (< f0-4 f28-0) + (set! f28-0 f0-4) + (set! s3-0 s1-1) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! v1-22 s2-1) + *collide-player-list* + (set! s2-1 (-> s2-1 next0)) + ) + ) + ) + ) + (when #t + (when #f + (let ((v1-56 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((s2-2 (-> v1-56 next0))) + (while (!= v1-56 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((v1-57 (the-as collide-shape (-> (the-as connection v1-56) param1))) + (a0-46 (-> v1-57 root-prim)) + ) + (when (logtest? (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list bot-targetable jak-vehicle) + (-> a0-46 prim-core collide-as) + ) + (let* ((s0-3 (-> v1-57 process)) + (s1-2 (if (type? s0-3 process-focusable) + s0-3 + ) + ) + ) + (when (and s1-2 + (not (focus-test? (the-as process-focusable s1-2) disable dead inactive)) + (!= arg0 s1-2) + (squad-control-city-method-38 this s4-1 (the-as process-focusable s1-2)) + ) + (squad-control-city-method-40 this s4-1 (the-as process-focusable s1-2)) + (when (squad-control-city-method-41 this s4-1 (the-as process-focusable s1-2)) + (let ((f26-2 (squad-control-city-method-39 this s4-1 (the-as process-focusable s1-2)))) + (let ((v1-70 (get-idx-in-status-arr this (process->handle s1-2)))) + (if (>= v1-70 0) + (+! f26-2 (-> this alert-state target-status-array v1-70 threat-level)) + ) + ) + (cond + ((< f30-0 f26-2) + (set! f30-0 f26-2) + (set! f28-0 + (vector-vector-xz-distance-squared (-> arg0 root trans) (get-trans (the-as process-focusable s1-2) 3)) + ) + (set! s3-0 s1-2) + ) + ((= f26-2 f30-0) + (let ((s0-5 vector-vector-xz-distance-squared)) + (set! sv-32 (-> arg0 root trans)) + (let* ((a1-41 (get-trans (the-as process-focusable s1-2) 3)) + (f0-7 (* (s0-5 sv-32 a1-41) (squad-control-city-method-42 this))) + ) + (when (< f0-7 f28-0) + (set! f28-0 f0-7) + (set! s3-0 s1-2) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! v1-56 s2-2) + *collide-hit-by-player-list* + (set! s2-2 (-> s2-2 next0)) + ) + ) + ) + ) + (when #t + (let ((v1-89 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((s2-3 (-> v1-89 next0))) + (while (!= v1-89 (-> *collide-hit-by-others-list* alive-list-end)) + (let* ((v1-90 (the-as collide-shape (-> (the-as connection v1-89) param1))) + (a0-71 (-> v1-90 root-prim)) + ) + (when (logtest? (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list bot-targetable jak-vehicle) + (-> a0-71 prim-core collide-as) + ) + (let* ((s0-6 (-> v1-90 process)) + (s1-3 (if (type? s0-6 process-focusable) + s0-6 + ) + ) + ) + (when (and s1-3 + (not (focus-test? (the-as process-focusable s1-3) disable dead inactive)) + (!= arg0 s1-3) + (squad-control-city-method-38 this s4-1 (the-as process-focusable s1-3)) + ) + (squad-control-city-method-40 this s4-1 (the-as process-focusable s1-3)) + (when (squad-control-city-method-41 this s4-1 (the-as process-focusable s1-3)) + (let ((f26-4 (squad-control-city-method-39 this s4-1 (the-as process-focusable s1-3)))) + (let ((v1-103 (get-idx-in-status-arr this (process->handle s1-3)))) + (if (>= v1-103 0) + (+! f26-4 (-> this alert-state target-status-array v1-103 threat-level)) + ) + ) + (cond + ((< f30-0 f26-4) + (set! f30-0 f26-4) + (set! f28-0 + (vector-vector-xz-distance-squared (-> arg0 root trans) (get-trans (the-as process-focusable s1-3) 3)) + ) + (set! s3-0 s1-3) + ) + ((= f26-4 f30-0) + (let ((s0-8 vector-vector-xz-distance-squared)) + (set! sv-48 (-> arg0 root trans)) + (let* ((a1-57 (get-trans (the-as process-focusable s1-3) 3)) + (f0-10 (* (s0-8 sv-48 a1-57) (squad-control-city-method-42 this))) + ) + (when (< f0-10 f28-0) + (set! f28-0 f0-10) + (set! s3-0 s1-3) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! v1-89 s2-3) + *collide-hit-by-others-list* + (set! s2-3 (-> s2-3 next0)) + ) + ) + ) + ) + ) + ) + ) + ) + (label cfg-121) + (the-as process-focusable s3-0) + ) + ) + ) + +(defmethod get-handle-pos ((this squad-control-city) (arg0 handle) (arg1 vector)) + (let* ((s5-0 (handle->process arg0)) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (when s4-0 + (cond + ((valid-target-handle? this arg0) + (set! (-> s5-1 quad) (the-as uint128 0)) + (dotimes (v1-7 16) + (vector+! s5-1 s5-1 (the-as vector (+ (the-as uint (-> this primary-target-history 0 velocity)) (* v1-7 32)))) + ) + (vector-float*! s5-1 s5-1 0.0625) + ) + (else + (set! (-> s5-1 quad) (-> (the-as process-focusable s4-0) root transv quad)) + ) + ) + (set! (-> s5-1 y) 0.0) + (vector+float*! arg1 (-> (the-as process-focusable s4-0) root trans) s5-1 1.5) + ) + ) + arg1 + ) + +(defmethod get-city-mode ((this squad-control-city)) + (-> this city-mode) + ) + +(defmethod squad-control-city-method-37 ((this squad-control-city)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/wascity/traffic-util.gc b/goal_src/jak3/levels/wascity/traffic-util.gc index 3339c68ad8..7ad0140116 100644 --- a/goal_src/jak3/levels/wascity/traffic-util.gc +++ b/goal_src/jak3/levels/wascity/traffic-util.gc @@ -7,3 +7,1139 @@ ;; DECOMP BEGINS +(defun-debug add-debug-line-arrow () + 0 + (none) + ) + +(defmethod debug-draw ((this vis-cell)) + (local-vars (sv-48 (function _varargs_ object))) + (dotimes (s5-0 (-> this segment-count)) + (let ((s4-0 (-> this segment-array s5-0))) + (add-debug-line + #t + (bucket-id debug) + (the-as vector (-> s4-0 vertex)) + (-> s4-0 vertex 1) + *color-white* + #f + *color-black* + ) + (let ((s3-1 (vector-float*! + (new 'stack-no-clear 'vector) + (vector+! (new 'stack-no-clear 'vector) (the-as vector (-> s4-0 vertex)) (-> s4-0 vertex 1)) + 0.5 + ) + ) + (s2-0 add-debug-text-3d) + (s1-0 #t) + (s0-0 583) + ) + (set! sv-48 format) + (let ((a0-7 (clear *temp-string*)) + (a1-2 "~d") + (a2-1 (-> s4-0 branch clock-type)) + ) + (sv-48 a0-7 a1-2 a2-1) + ) + (s2-0 s1-0 (the-as bucket-id s0-0) *temp-string* s3-1 (font-color red) (the-as vector2h #f)) + ) + (add-debug-x #t (bucket-id debug) (-> s4-0 vertex 1) *color-red*) + ) + ) + 0 + (none) + ) + +(defmethod reset-segment-counts ((this vis-cell)) + (set! (-> this incoming-segment-count) 0) + (set! (-> this segment-count) 0) + 0 + (none) + ) + +(defmethod setup-grid-from-bounding-box ((this grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) + (mem-copy! (the-as pointer (-> this box)) arg0 32) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (dotimes (a0-2 3) + (set! (-> v1-0 data a0-2) (- (-> this box max data a0-2) (-> this box min data a0-2))) + ) + (let ((f0-5 (sqrtf (/ (the float arg1) (* (-> v1-0 x) (-> v1-0 z) (the float arg2)))))) + (let ((a0-6 (min 126 (+ arg1 -1)))) + (set! (-> this dimension-array 0) (max 1 (min (the int (* f0-5 (-> v1-0 x))) a0-6))) + (set! (-> this dimension-array 1) arg2) + (set! (-> this dimension-array 2) (max 1 (min (the int (* f0-5 (-> v1-0 z))) a0-6))) + ) + (let* ((f1-11 (* f0-5 (-> v1-0 z))) + (f1-13 (- f1-11 (the float (the int f1-11)))) + (f0-6 (* f0-5 (-> v1-0 x))) + ) + (cond + ((< f1-13 (- f0-6 (the float (the int f0-6)))) + (if (>= arg1 (* (* (+ (-> this dimension-array 0) 1) (-> this dimension-array 1)) (-> this dimension-array 2))) + (+! (-> this dimension-array 0) 1) + ) + ) + (else + (if (>= arg1 (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (+ (-> this dimension-array 2) 1))) + (+! (-> this dimension-array 2) 1) + ) + ) + ) + ) + ) + (dotimes (a0-24 3) + (set! (-> this axis-scale a0-24) (/ (the float (-> this dimension-array a0-24)) (-> v1-0 data a0-24))) + (set! (-> this cell-size data a0-24) (/ (-> v1-0 data a0-24) (the float (-> this dimension-array a0-24)))) + ) + ) + 0 + (none) + ) + +(defmethod lookup-cell-for-point ((this grid-info) (arg0 vis-grid-pos) (arg1 vector)) + (set! (-> arg0 x) (max 0 (min + (the int (* (- (-> arg1 x) (-> this box min x)) (-> this axis-scale 0))) + (+ (-> this dimension-array 0) -1) + ) + ) + ) + (set! (-> arg0 y) (max 0 (min + (the int (* (- (-> arg1 y) (-> this box min y)) (-> this axis-scale 1))) + (+ (-> this dimension-array 1) -1) + ) + ) + ) + (set! (-> arg0 z) (max 0 (min + (the int (* (- (-> arg1 z) (-> this box min z)) (-> this axis-scale 2))) + (+ (-> this dimension-array 2) -1) + ) + ) + ) + 0 + (none) + ) + +(defmethod lookup-box-for-sphere ((this grid-info) (arg0 vis-grid-box) (arg1 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'bounding-box))) + (let ((a0-1 (-> s5-0 min))) + (let ((v1-0 arg1)) + (let ((a1-1 (- (-> arg1 w)))) + (.mov vf6 a1-1) + ) + (.lvf vf4 (&-> v1-0 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-1 quad) vf5) + ) + (let ((a0-2 (-> s5-0 max))) + (let ((v1-1 arg1)) + (let ((a1-2 (-> arg1 w))) + (.mov vf6 a1-2) + ) + (.lvf vf4 (&-> v1-1 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-2 quad) vf5) + ) + (lookup-cell-for-point this (-> arg0 min) (-> s5-0 min)) + (lookup-cell-for-point this (-> arg0 max) (-> s5-0 max)) + ) + 0 + (none) + ) + ) + +(defmethod debug-draw-cell ((this grid-info) (arg0 vis-grid-pos) (arg1 rgba)) + (let ((v1-0 (new 'stack-no-clear 'bounding-box))) + (dotimes (a3-0 3) + (set! (-> v1-0 min data a3-0) + (+ (-> this box min data a3-0) (* (the float (-> arg0 data a3-0)) (-> this cell-size data a3-0))) + ) + ) + (vector+! (-> v1-0 max) (-> v1-0 min) (-> this cell-size)) + (add-debug-box #t (bucket-id debug) (-> v1-0 min) (-> v1-0 max) arg1) + ) + 0 + (none) + ) + +(defmethod debug-draw-grid ((this grid-info) (arg0 rgba)) + (draw-grid (the-as vector (-> this box)) (-> this box max) (-> this dimension-array) arg0) + 0 + (none) + ) + +(defmethod try-creating-new-suppression-box ((this traffic-suppression-params)) + (cond + ((= (-> this id) -1) + (send-event *traffic-manager* 'new-suppression-box this) + (!= (-> this id) -1) + ) + (else + #t + ) + ) + ) + +(defmethod create-or-update-suppression-box ((this traffic-suppression-params)) + (cond + ((= (-> this id) -1) + (send-event *traffic-manager* 'new-suppression-box this) + (!= (-> this id) -1) + ) + (else + (send-event *traffic-manager* 'update-suppression-box this) + #t + ) + ) + ) + +(defmethod kill-suppression-box ((this traffic-suppression-params)) + (when (!= (-> this id) -1) + (let ((s5-0 (-> this duration))) + (set! (-> this duration) 0) + (send-event *traffic-manager* 'update-suppression-box this) + (set! (-> this duration) s5-0) + ) + (set! (-> this id) -1) + ) + (none) + ) + +(defmethod reset-boxes ((this traffic-suppressor)) + (logclear! (-> this flags) (traffic-suppressor-flag tfs0 needs-update)) + (dotimes (v1-2 16) + (let ((a1-3 (-> this array v1-2))) + (logclear! (-> a1-3 flags) (traffic-suppression-box-flag in-use tfsb1)) + ) + ) + 0 + (none) + ) + +(defmethod add-new-supression-box ((this traffic-suppressor) (arg0 traffic-suppression-params)) + (set! (-> arg0 id) -1) + (let ((v1-1 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (let ((a2-2 (-> this array v1-1))) + (b! (logtest? (-> a2-2 flags) (traffic-suppression-box-flag in-use)) cfg-3 :delay (empty-form)) + (set! (-> arg0 id) v1-1) + (set! (-> a2-2 flags) (traffic-suppression-box-flag in-use)) + ) + (update-box-from-params this arg0) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + (+! v1-1 1) + (label cfg-4) + (b! (< v1-1 16) cfg-1) + ) + (label cfg-6) + 0 + (none) + ) + +(defmethod remove-box-by-id ((this traffic-suppressor) (arg0 int)) + (when (!= arg0 -1) + (logior! (-> this flags) (traffic-suppressor-flag needs-update)) + (let ((v1-6 (-> this array arg0))) + (logclear! (-> v1-6 flags) (traffic-suppression-box-flag in-use)) + ) + ) + 0 + (none) + ) + +(defmethod update-box-from-params ((this traffic-suppressor) (arg0 traffic-suppression-params)) + (let ((v1-0 (-> arg0 id))) + (when (!= v1-0 -1) + (logior! (-> this flags) (traffic-suppressor-flag needs-update)) + (let* ((s5-0 (-> this array v1-0)) + (s4-1 (logior (-> s5-0 flags) (traffic-suppression-box-flag tfsb1))) + ) + (mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32) + (set! (-> s5-0 duration) (the-as uint (-> arg0 duration))) + (set! (-> s5-0 flags) s4-1) + ) + ) + ) + 0 + (none) + ) + +(defmethod debug-draw ((this traffic-suppressor)) + (let ((s5-0 (new 'stack-no-clear 'bounding-box))) + (new 'stack-no-clear 'vector4w) + (let ((s4-0 *color-red*)) + (dotimes (s3-0 16) + (let ((v1-3 (-> this array s3-0))) + (when (logtest? (-> v1-3 flags) (traffic-suppression-box-flag in-use)) + (set! (-> s5-0 min quad) (-> v1-3 bbox min quad)) + (set! (-> s5-0 max quad) (-> v1-3 bbox max quad)) + (set! (-> s5-0 min w) 1.0) + (set! (-> s5-0 max w) 1.0) + (add-debug-box #t (bucket-id debug-no-zbuf1) (-> s5-0 min) (-> s5-0 max) s4-0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod get-first-cell-in-box ((this city-level-info) (arg0 vis-grid-box)) + (-> this + cell-array + (+ (-> arg0 min x) + (* (-> arg0 min z) (-> this grid-info dimension-array 0)) + (* (* (-> arg0 min y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) + ) + ) + ) + +(defmethod sphere-in-grid? ((this city-level-info) (arg0 vector) (arg1 int)) + (let ((gp-0 #f)) + (let ((s3-0 (new 'stack-no-clear 'vis-grid-box)) + (s2-0 (new 'stack-no-clear 'vis-grid-box)) + ) + (lookup-box-for-sphere (-> this grid-info) s2-0 arg0) + (set! (-> s3-0 min y) (-> s2-0 min y)) + (let ((v1-6 (+ (- 1 (-> s2-0 min y)) (-> s2-0 max y)))) + (b! #t cfg-13 :delay (nop!)) + (label cfg-1) + (+! v1-6 -1) + (set! (-> s3-0 min z) (-> s2-0 min z)) + (let ((a0-7 (+ (- 1 (-> s2-0 min z)) (-> s2-0 max z)))) + (b! #t cfg-11 :delay (nop!)) + (label cfg-2) + (+! a0-7 -1) + (set! (-> s3-0 min x) (-> s2-0 min x)) + (let ((a1-7 (+ (- 1 (-> s2-0 min x)) (-> s2-0 max x)))) + (b! #t cfg-9 :delay (nop!)) + (label cfg-3) + (+! a1-7 -1) + (let ((a3-0 this) + (t1-0 s3-0) + ) + (b! + (not (logtest? (-> a3-0 + cell-array + (+ (-> t1-0 min x) + (* (-> t1-0 min z) (-> a3-0 grid-info dimension-array 0)) + (* (* (-> t1-0 min y) (-> a3-0 grid-info dimension-array 0)) (-> a3-0 grid-info dimension-array 2)) + ) + flags + ) + (ash 1 arg1) + ) + ) + cfg-8 + :delay (empty-form) + ) + ) + (set! gp-0 #t) + (b! #t cfg-15 :delay (nop!)) + (label cfg-8) + (+! (-> s3-0 min x) 1) + (label cfg-9) + (b! (nonzero? a1-7) cfg-3 :delay (nop!)) + ) + (+! (-> s3-0 min z) 1) + (label cfg-11) + (b! (nonzero? a0-7) cfg-2 :delay (nop!)) + ) + (+! (-> s3-0 min y) 1) + (label cfg-13) + (b! (nonzero? v1-6) cfg-1 :delay (nop!)) + ) + ) + (label cfg-15) + gp-0 + ) + ) + +(defmethod callback-on-nav-segments-in-sphere ((this city-level-info) + (arg0 vector) + (arg1 int) + (arg2 traffic-find-segment-struct) + (arg3 (function traffic-find-segment-struct nav-segment none)) + ) + (local-vars + (sv-16 city-level-info) + (sv-20 vector) + (sv-24 int) + (sv-28 traffic-find-segment-struct) + (sv-32 (function traffic-find-segment-struct nav-segment none)) + (sv-80 vis-grid-box) + (sv-84 vis-grid-box) + ) + (set! sv-16 this) + (set! sv-20 arg0) + (set! sv-24 arg1) + (set! sv-28 arg2) + (set! sv-32 arg3) + (set! sv-80 (new 'stack-no-clear 'vis-grid-box)) + (set! sv-84 (new 'stack-no-clear 'vis-grid-box)) + (lookup-box-for-sphere (-> sv-16 grid-info) sv-80 sv-20) + (set! (-> sv-84 min y) (-> sv-80 min y)) + (countdown (gp-0 (+ (- 1 (-> sv-80 min y)) (-> sv-80 max y))) + (set! (-> sv-84 min z) (-> sv-80 min z)) + (countdown (s5-0 (+ (- 1 (-> sv-80 min z)) (-> sv-80 max z))) + (set! (-> sv-84 min x) (-> sv-80 min x)) + (countdown (s4-0 (+ (- 1 (-> sv-80 min x)) (-> sv-80 max x))) + (let* ((a0-17 sv-16) + (a2-2 sv-84) + (v1-18 + (-> a0-17 + cell-array + (+ (-> a2-2 min x) + (* (-> a2-2 min z) (-> a0-17 grid-info dimension-array 0)) + (* (* (-> a2-2 min y) (-> a0-17 grid-info dimension-array 0)) (-> a0-17 grid-info dimension-array 2)) + ) + ) + ) + (s3-0 (-> v1-18 segment-array 0)) + ) + (countdown (s2-0 (-> v1-18 segment-count)) + (if (and (= (-> s3-0 tracker-id) sv-24) + (line-sphere-intersection? sv-20 (the-as vector (-> s3-0 vertex)) (-> s3-0 vertex 1)) + ) + (sv-32 sv-28 s3-0) + ) + (&+! s3-0 48) + ) + ) + (+! (-> sv-84 min x) 1) + ) + (+! (-> sv-84 min z) 1) + ) + (+! (-> sv-84 min y) 1) + ) + 0 + (none) + ) + +(defmethod update-suppressions-from-traffic-engine ((this city-level-info) (arg0 traffic-engine)) + (let ((v1-0 (-> this cell-count))) + (dotimes (a0-1 (the-as int v1-0)) + (let ((a1-2 (-> this cell-array a0-1))) + (logclear! (-> a1-2 flags) (vis-cell-flag suppress)) + ) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'vis-grid-pos 2))) + (dotimes (s3-0 16) + (let ((s2-0 (-> arg0 suppressor array s3-0))) + (when (logtest? (-> s2-0 flags) (traffic-suppression-box-flag in-use)) + (lookup-cell-for-point (-> this grid-info) (-> s4-0 1) (the-as vector (-> s2-0 bbox))) + (lookup-cell-for-point (-> this grid-info) (-> s4-0 2) (-> s2-0 bbox max)) + (set! (-> s4-0 0 y) (-> s4-0 1 y)) + (countdown (v1-15 (+ (- 1 (-> s4-0 1 y)) (-> s4-0 2 y))) + (set! (-> s4-0 0 z) (-> s4-0 1 z)) + (countdown (a0-9 (+ (- 1 (-> s4-0 1 z)) (-> s4-0 2 z))) + (set! (-> s4-0 0 x) (-> s4-0 1 x)) + (countdown (a1-10 (+ (- 1 (-> s4-0 1 x)) (-> s4-0 2 x))) + (let* ((a3-1 this) + (t1-0 (-> s4-0 0)) + (a2-8 (-> a3-1 + cell-array + (+ (-> t1-0 x) + (* (-> t1-0 z) (-> a3-1 grid-info dimension-array 0)) + (* (* (-> t1-0 y) (-> a3-1 grid-info dimension-array 0)) (-> a3-1 grid-info dimension-array 2)) + ) + ) + ) + ) + (logior! (-> a2-8 flags) (vis-cell-flag suppress)) + ) + (+! (-> s4-0 0 x) 1) + ) + (+! (-> s4-0 0 z) 1) + ) + (+! (-> s4-0 0 y) 1) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod lookup-cell-by-position ((this city-level-info) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'vis-grid-pos))) + (lookup-cell-for-point (-> this grid-info) s5-0 arg0) + (-> this + cell-array + (+ (-> s5-0 x) + (* (-> s5-0 z) (-> this grid-info dimension-array 0)) + (* (* (-> s5-0 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) + ) + ) + ) + ) + +(defmethod init-vis-ray ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) + (set! (-> arg0 pos quad) (-> arg1 quad)) + (set! (-> arg0 dest-pos quad) (-> arg2 quad)) + (let ((v1-2 (new 'stack-no-clear 'vector))) + (vector-! v1-2 arg2 arg1) + (set! (-> arg0 len) (vector-length v1-2)) + (let ((a0-9 (-> arg0 dir)) + (f0-1 (-> arg0 len)) + ) + (vector-float*! a0-9 v1-2 (/ 1.0 f0-1)) + ) + ) + (lookup-cell-for-point (-> this grid-info) (-> arg0 grid-pos) arg1) + (set! (-> arg0 cell) (lookup-cell-by-position this arg1)) + 0 + (none) + ) + +(defmethod city-level-info-method-11 ((this city-level-info) (arg0 vis-ray)) + (local-vars (a3-3 int)) + (let ((f0-0 (-> arg0 len)) + (s4-0 -1) + ) + (dotimes (v1-0 2) + (let ((a0-1 (* v1-0 2)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (the-as uint128 0)) + (set! (-> a1-1 data a0-1) -1.0) + (let ((f1-1 (-> this grid-info box min data a0-1)) + (a2-6 1) + ) + (let ((a3-2 (-> arg0 dir data a0-1))) + (shift-arith-right-32 a3-3 a3-2 31) + ) + (set! (-> a1-1 w) + (+ f1-1 + (* (the float (+ (- a2-6 (logand a3-3 1)) (-> (the-as (pointer int8) (+ a0-1 (the-as int arg0))) 64))) + (-> this grid-info cell-size data a0-1) + ) + ) + ) + ) + (when (!= (-> arg0 dir data a0-1) 0.0) + (let ((f1-6 (/ (- (-> a1-1 w) (-> arg0 pos data a0-1)) (-> arg0 dir data a0-1)))) + (when (< f1-6 f0-0) + (set! f0-0 f1-6) + (set! s4-0 a0-1) + (set! (-> arg0 plane quad) (-> a1-1 quad)) + ) + ) + ) + ) + ) + (cond + ((= s4-0 -1) + (set! (-> arg0 pos quad) (-> arg0 dest-pos quad)) + (set! (-> arg0 len) 0.0) + ) + (else + (vector+float*! (-> arg0 pos) (-> arg0 pos) (-> arg0 dir) f0-0) + (set! (-> arg0 len) (vector-vector-distance (-> arg0 pos) (-> arg0 dest-pos))) + (+! (-> arg0 grid-pos data s4-0) (if (>= (-> arg0 dir data s4-0) 0.0) + 1 + -1 + ) + ) + (let ((a1-4 (-> arg0 grid-pos))) + (set! (-> arg0 cell) + (-> this + cell-array + (+ (-> a1-4 x) + (* (-> a1-4 z) (-> this grid-info dimension-array 0)) + (* (* (-> a1-4 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod city-level-info-method-12 ((this city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s2-0 (-> arg1 dest-node)) + (s3-0 #t) + (s5-0 (new 'stack-no-clear 'inline-array 'vector 7)) + ) + (let ((a1-1 s2-0) + (v1-0 (-> s5-0 2)) + ) + (set! (-> v1-0 quad) (-> a1-1 position quad)) + (set! (-> v1-0 w) 1.0) + ) + (let ((v1-1 s2-0) + (s1-0 (-> s5-0 3)) + ) + (let ((f0-2 (the float (-> v1-1 angle))) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (sincos! s0-0 f0-2) + (set! (-> s1-0 x) (-> s0-0 y)) + (set! (-> s1-0 y) 0.0) + (set! (-> s1-0 z) (- (-> s0-0 x))) + ) + (set! (-> s1-0 w) 1.0) + ) + (vector-! (-> s5-0 5) (-> s5-0 2) arg0) + (set! (-> s5-0 4 quad) (-> s5-0 3 quad)) + (set! (-> s5-0 4 x) (-> s5-0 3 z)) + (set! (-> s5-0 4 z) (- (-> s5-0 3 x))) + (when (< 0.0 (vector-dot (-> s5-0 5) (-> s5-0 4))) + (set! s3-0 #f) + (vector-float*! (-> s5-0 4) (-> s5-0 4) -1.0) + ) + (let ((a1-8 (-> s5-0 6))) + (let ((v1-12 (-> s5-0 2))) + (let ((a0-9 (-> s5-0 4))) + (let* ((a2-1 s2-0) + (a2-4 (* 1024.0 (the float (-> a2-1 radius)))) + ) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> a1-8 quad) vf6) + ) + (set! (-> s5-0 6 w) (* 1024.0 (the float (-> s2-0 radius)))) + (vector-! (-> s5-0 0) (-> s5-0 6) arg0) + (set! (-> s5-0 0 y) 0.0) + (let* ((v1-17 (-> s5-0 0)) + (f30-0 (sqrtf (+ (* (-> v1-17 x) (-> v1-17 x)) (* (-> v1-17 z) (-> v1-17 z))))) + (f28-0 (-> s5-0 6 w)) + ) + (vector-xz-normalize! (-> s5-0 0) 1.0) + (set! (-> s5-0 1 x) (-> s5-0 0 z)) + (set! (-> s5-0 1 y) 0.0) + (set! (-> s5-0 1 z) (- (-> s5-0 0 x))) + (if s3-0 + (vector-float*! (-> s5-0 1) (-> s5-0 1) -1.0) + ) + (let* ((f0-29 f30-0) + (f0-31 (* f0-29 f0-29)) + (f1-9 f28-0) + (f1-12 (sqrtf (fabs (- f0-31 (* f1-9 f1-9))))) + (f0-35 (/ (* f28-0 f1-12) f30-0)) + ) + (let ((f1-15 (/ (* f1-12 f1-12) f30-0))) + (set! (-> arg2 quad) (-> arg0 quad)) + (let ((a1-13 arg2)) + (let ((v1-26 arg2)) + (let ((a0-14 (-> s5-0 0))) + (let ((a2-5 f1-15)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-26 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 (&-> a1-13 quad) vf6) + ) + ) + (let ((a1-14 arg2)) + (let ((v1-27 arg2)) + (let ((a0-15 (-> s5-0 1))) + (let ((a2-6 f0-35)) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-15 quad)) + ) + (.lvf vf4 (&-> v1-27 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 (&-> a1-14 quad) vf6) + ) + ) + ) + (set! (-> arg2 y) (-> s5-0 2 y)) + ) + arg2 + ) + ) + +(defmethod city-level-info-method-18 ((this city-level-info)) + (local-vars (sv-48 int)) + (let ((gp-0 (new 'stack-no-clear 'bounding-box)) + (s5-0 (-> this nav-graph)) + ) + (set! sv-48 (-> s5-0 node-count)) + (dotimes (s4-0 sv-48) + (let ((s3-0 (-> s5-0 node-array s4-0))) + (set-id-and-link-branches-back s3-0 (the-as uint s4-0)) + (let ((a1-1 s3-0) + (v1-4 (-> gp-0 min)) + ) + (set! (-> v1-4 quad) (-> a1-1 position quad)) + (set! (-> v1-4 w) 1.0) + ) + (dotimes (s2-0 (-> s3-0 branch-count)) + (let ((s1-0 (-> s3-0 branch-array s2-0))) + (let ((a1-4 (-> s1-0 dest-node)) + (v1-6 (-> gp-0 max)) + ) + (set! (-> v1-6 quad) (-> a1-4 position quad)) + (set! (-> v1-6 w) 1.0) + ) + (set! (-> s1-0 max-user-count) + (the-as uint (max 1 (the int (/ (vector-vector-distance (-> gp-0 min) (-> gp-0 max)) + (if (logtest? (-> s3-0 flags) (nav-node-flag-byte pedestrian)) + 24576.0 + 49152.0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod city-level-info-method-9 ((this city-level-info)) + (local-vars + (sv-96 (inline-array nav-node)) + (sv-100 int) + (sv-104 vis-ray) + (sv-112 int) + (sv-160 nav-node) + (sv-164 vector) + (sv-168 vector) + (sv-172 vis-cell) + (sv-176 int) + (sv-184 nav-branch) + (sv-240 nav-node) + (sv-244 vector) + (sv-248 vector) + (sv-252 vector) + (sv-256 nav-segment) + (sv-260 vis-cell) + (sv-264 int) + ) + (set! (-> this cell-count) + (the-as uint (* (* (-> this grid-info dimension-array 0) (-> this grid-info dimension-array 1)) + (-> this grid-info dimension-array 2) + ) + ) + ) + (let ((s5-0 (-> this cell-count))) + (dotimes (s4-0 (the-as int s5-0)) + (reset-segment-counts (-> this cell-array s4-0)) + ) + (when (< 0.01 (-> this grid-info axis-scale 0)) + (format 0 "segments not generates~%") + (return #t) + ) + (set! sv-96 (-> this nav-graph node-array)) + (set! sv-100 (-> this nav-graph node-count)) + (set! sv-104 (new 'stack-no-clear 'vis-ray)) + (set! sv-112 0) + (dotimes (s4-1 sv-100) + (let ((s3-0 (-> sv-96 s4-1))) + (dotimes (s2-0 (-> s3-0 branch-count)) + (let* ((a2-0 (-> s3-0 branch-array s2-0)) + (f0-1 0.0) + (v1-19 a2-0) + ) + (when (< f0-1 (* 0.0078125 (the float (-> v1-19 density)))) + (set! sv-160 (-> a2-0 dest-node)) + (set! sv-164 (new 'stack-no-clear 'vector)) + (set! sv-168 (new 'stack-no-clear 'vector)) + (set! sv-172 (the-as vis-cell #f)) + (set! sv-176 0) + (let ((a1-1 s3-0) + (v1-26 sv-168) + ) + (set! (-> v1-26 quad) (-> a1-1 position quad)) + (set! (-> v1-26 w) 1.0) + ) + (cond + ((logtest? (-> s3-0 flags) (nav-node-flag-byte pedestrian)) + (let ((a1-4 (-> a2-0 dest-node)) + (v1-29 sv-164) + ) + (set! (-> v1-29 quad) (-> a1-4 position quad)) + (set! (-> v1-29 w) 1.0) + ) + ) + (else + (city-level-info-method-12 this sv-168 a2-0 sv-164) + ) + ) + (init-vis-ray this sv-104 sv-168 sv-164) + (while (< 0.0 (-> sv-104 len)) + (set! sv-172 (-> sv-104 cell)) + (city-level-info-method-11 this sv-104) + (+! (-> sv-172 segment-count) 1) + (set! sv-112 (+ sv-112 1)) + (if (> sv-176 0) + (+! (-> sv-172 incoming-segment-count) 1) + ) + (set! sv-176 (+ sv-176 1)) + ) + ) + ) + ) + ) + ) + (format 0 "~d segments were generated~%" sv-112) + (set! (-> this segment-array) (the-as (inline-array nav-segment) (malloc 'debug (* 48 sv-112)))) + (let ((v1-59 0)) + (dotimes (a0-20 (the-as int s5-0)) + (let ((a1-14 (-> this cell-array a0-20))) + (set! (-> a1-14 id) (the-as uint a0-20)) + (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) #f)) + (when (> (-> a1-14 segment-count) 0) + (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) (-> this segment-array v1-59))) + (dotimes (a2-8 (-> a1-14 segment-count)) + (let ((a3-5 (-> a1-14 segment-array a2-8))) + (set! (-> a3-5 id) (the-as uint v1-59)) + (set! (-> a3-5 cell-id) (the-as uint #xffff)) + ) + (+! v1-59 1) + ) + ) + (set! (-> a1-14 flags) (the-as vis-cell-flag (-> a1-14 segment-count))) + (set! (-> a1-14 segment-count) 0) + (set! (-> a1-14 incoming-segment-count) 0) + ) + 0 + ) + (set! (-> this segment-count) v1-59) + ) + ) + (dotimes (s5-1 sv-100) + (let ((s4-2 (-> sv-96 s5-1))) + (dotimes (s3-1 (-> s4-2 branch-count)) + (set! sv-184 (-> s4-2 branch-array s3-1)) + (let ((f0-5 0.0) + (v1-63 sv-184) + ) + (when (< f0-5 (* 0.0078125 (the float (-> v1-63 density)))) + (set! sv-240 (-> sv-184 dest-node)) + (set! sv-244 (new 'stack-no-clear 'vector)) + (set! sv-248 (new 'stack-no-clear 'vector)) + (set! sv-252 (new 'stack-no-clear 'vector)) + (set! sv-256 (the-as nav-segment #f)) + (set! sv-260 (the-as vis-cell #f)) + (set! sv-264 0) + (let ((a1-16 s4-2) + (v1-72 sv-244) + ) + (set! (-> v1-72 quad) (-> a1-16 position quad)) + (set! (-> v1-72 w) 1.0) + ) + (cond + ((logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian)) + (let ((a1-19 (-> sv-184 dest-node)) + (v1-76 sv-252) + ) + (set! (-> v1-76 quad) (-> a1-19 position quad)) + (set! (-> v1-76 w) 1.0) + ) + ) + (else + (city-level-info-method-12 this sv-244 sv-184 sv-252) + ) + ) + (init-vis-ray this sv-104 sv-244 sv-252) + (while (< 0.0 (-> sv-104 len)) + (set! (-> sv-248 quad) (-> sv-104 pos quad)) + (set! sv-260 (-> sv-104 cell)) + (city-level-info-method-11 this sv-104) + (let ((a2-14 (-> sv-260 incoming-segment-count))) + (if (zero? sv-264) + (set! a2-14 + (+ (- -1 (-> sv-260 segment-count)) (-> sv-260 incoming-segment-count) (-> sv-260 alloc-segment-count)) + ) + ) + (when (or (< a2-14 0) (>= a2-14 (-> sv-260 alloc-segment-count))) + (format + 0 + "******************************************************** bad i-seg ~d ************************************************~%" + a2-14 + ) + (return #f) + ) + (let ((s2-1 (-> sv-260 segment-array a2-14))) + (set! (-> s2-1 vertex 0 quad) (-> sv-248 quad)) + (set! (-> s2-1 vertex 1 quad) (-> sv-104 pos quad)) + (set! (-> s2-1 length) (vector-vector-distance (the-as vector (-> s2-1 vertex)) (-> s2-1 vertex 1))) + (let* ((f0-9 (if (logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian)) + 24576.0 + 49152.0 + ) + ) + (f1-8 -1.0) + (f2-4 0.0001) + (v1-107 sv-184) + (f2-5 (fmax f2-4 (* 0.0078125 (the float (-> v1-107 density))))) + ) + (set! (-> s2-1 spawn-spacing) (* f0-9 (+ f1-8 (/ 1.0 f2-5)))) + ) + (set! (-> s2-1 cell-id) (-> sv-260 id)) + (set! (-> s2-1 branch) sv-184) + (set! (-> s2-1 from-cell-id) (the-as uint #xffff)) + (set! (-> s2-1 nav-mesh-id) (-> s4-2 nav-mesh-id)) + (set! (-> s2-1 tracker-id) 0) + (if (logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian)) + (set! (-> s2-1 tracker-id) 1) + ) + (if sv-256 + (set! (-> s2-1 from-cell-id) (-> (the-as nav-segment sv-256) cell-id)) + ) + (set! sv-256 s2-1) + ) + ) + 0 + (+! (-> sv-260 segment-count) 1) + (if (> sv-264 0) + (+! (-> sv-260 incoming-segment-count) 1) + ) + (set! sv-264 (+ sv-264 1)) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defmethod reset! ((this traffic-level-data)) + (set! (-> this city-info) (the-as city-level-info 0)) + (set! (-> this active-cell-count) (the-as uint 0)) + (set! (-> this newly-active-cell-count) (the-as uint 0)) + 0 + (none) + ) + +(defmethod add-active-cell ((this traffic-level-data) (arg0 vis-cell)) + (let ((v1-0 (-> this active-cell-count))) + (when (< v1-0 (the-as uint 255)) + (set! (-> this active-cell-list v1-0) arg0) + (+! (-> this active-cell-count) 1) + ) + ) + 0 + (none) + ) + +(defmethod remove-active-cell ((this traffic-level-data) (arg0 int)) + (let ((v1-1 (+ (-> this active-cell-count) -1))) + (when (>= v1-1 0) + (set! (-> this active-cell-list arg0) (-> this active-cell-list v1-1)) + (+! (-> this active-cell-count) -1) + ) + ) + 0 + (none) + ) + +(defmethod add-newly-active-cell ((this traffic-level-data) (arg0 vis-cell)) + (let ((v1-0 (-> this newly-active-cell-count))) + (when (< v1-0 (the-as uint 255)) + (set! (-> this newly-active-cell-list v1-0) arg0) + (+! (-> this newly-active-cell-count) 1) + ) + ) + 0 + (none) + ) + +(defmethod per-frame-cell-update ((this traffic-level-data)) + (set! (-> this newly-active-cell-count) (the-as uint 0)) + (dotimes (v1-0 (the-as int (-> this active-cell-count))) + (let ((a0-3 (-> this active-cell-list v1-0))) + (set! (-> a0-3 prev-flags) (-> a0-3 flags)) + ) + ) + (let ((s5-0 (math-camera-pos)) + (f30-0 81920.0) + (f28-0 819200.0) + (f26-0 491520.0) + ) + (dotimes (s4-0 (the-as int (-> this city-info cell-count))) + (let ((s3-0 (-> this city-info cell-array s4-0))) + (let ((f24-0 (vector-vector-distance-squared (-> s3-0 sphere) s5-0)) + (f0-1 (+ (-> s3-0 sphere r) f28-0)) + ) + (cond + ((or (< (* f0-1 f0-1) f24-0) (let ((f0-5 (+ (-> s3-0 sphere r) f30-0))) + (and (< (* f0-5 f0-5) f24-0) (not (sphere-in-view-frustum? (-> s3-0 sphere)))) + ) + ) + (logclear! (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian)) + ) + ((let ((f0-9 (+ (-> s3-0 sphere r) f26-0))) + (< (* f0-9 f0-9) f24-0) + ) + (let ((v1-17 (logior (-> s3-0 flags) (vis-cell-flag active-vehicle)))) + (set! (-> s3-0 flags) (logclear v1-17 (vis-cell-flag active-pedestrian))) + ) + ) + (else + (logior! (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian)) + ) + ) + ) + (if (< (the-as uint (logand (-> s3-0 prev-flags) (vis-cell-flag active-vehicle active-pedestrian))) + (the-as uint (logand (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian))) + ) + (add-newly-active-cell this s3-0) + ) + ) + ) + ) + (countdown (s5-1 (-> this active-cell-count)) + (let ((v1-32 (-> this active-cell-list s5-1))) + (when (not (logtest? (-> v1-32 flags) (vis-cell-flag active-vehicle active-pedestrian))) + (logclear! (-> v1-32 prev-flags) (vis-cell-flag active-vehicle active-pedestrian)) + (remove-active-cell this (the-as int s5-1)) + ) + ) + ) + (dotimes (s5-2 (the-as int (-> this newly-active-cell-count))) + (let ((a1-5 (-> this newly-active-cell-list s5-2))) + (add-active-cell this a1-5) + ) + ) + (let ((v1-43 (-> this active-cell-box))) + (set-vector! + (-> v1-43 min) + 10000000000000000000000000000000000000.0 + 10000000000000000000000000000000000000.0 + 10000000000000000000000000000000000000.0 + 1.0 + ) + (set-vector! + (-> v1-43 max) + -10000000000000000000000000000000000000.0 + -10000000000000000000000000000000000000.0 + -10000000000000000000000000000000000000.0 + 1.0 + ) + (countdown (a0-23 (-> this active-cell-count)) + (let ((a1-16 (-> this active-cell-list a0-23))) + (set! (-> v1-43 min x) (fmin (-> v1-43 min x) (- (-> a1-16 sphere x) (-> a1-16 sphere r)))) + (set! (-> v1-43 min y) (fmin (-> v1-43 min y) (- (-> a1-16 sphere y) (-> a1-16 sphere r)))) + (set! (-> v1-43 min z) (fmin (-> v1-43 min z) (- (-> a1-16 sphere z) (-> a1-16 sphere r)))) + (set! (-> v1-43 max x) (fmax (-> v1-43 max x) (+ (-> a1-16 sphere x) (-> a1-16 sphere r)))) + (set! (-> v1-43 max y) (fmax (-> v1-43 max y) (+ (-> a1-16 sphere y) (-> a1-16 sphere r)))) + (set! (-> v1-43 max z) (fmax (-> v1-43 max z) (+ (-> a1-16 sphere z) (-> a1-16 sphere r)))) + ) + ) + ) + 0 + (none) + ) + +(defmethod debug-draw ((this traffic-level-data)) + (local-vars (sv-16 nav-node) (sv-20 nav-branch) (sv-80 nav-node) (sv-84 vector) (sv-88 vector) (sv-92 vector)) + (when (and (nonzero? (-> this city-info)) (nonzero? (-> this city-info nav-graph))) + (let ((s5-0 (-> this city-info nav-graph))) + (let ((v1-6 (-> s5-0 node-array 0))) + (countdown (a0-3 (-> s5-0 node-count)) + (logclear! (-> v1-6 flags) (nav-node-flag-byte visited)) + (&+! v1-6 32) + ) + ) + (dotimes (s4-0 (the-as int (-> this active-cell-count))) + (let ((a0-4 (-> this active-cell-list s4-0))) + (dotimes (v1-11 (-> a0-4 segment-count)) + (let ((a1-5 (-> a0-4 segment-array v1-11 branch src-node))) + (logior! (-> a1-5 flags) (nav-node-flag-byte visited)) + ) + ) + (debug-draw a0-4) + ) + ) + (set! sv-16 (-> s5-0 node-array 0)) + (countdown (gp-1 (-> s5-0 node-count)) + (when (logtest? (-> sv-16 flags) (nav-node-flag-byte visited)) + (debug-draw sv-16) + (dotimes (s5-1 (-> sv-16 branch-count)) + (set! sv-20 (-> sv-16 branch-array s5-1)) + (set! sv-80 (-> sv-20 dest-node)) + (set! sv-84 (new 'stack-no-clear 'vector)) + (set! sv-88 (new 'stack-no-clear 'vector)) + (set! sv-92 (new 'stack-no-clear 'vector)) + (let ((a1-7 sv-16) + (v1-35 sv-88) + ) + (set! (-> v1-35 quad) (-> a1-7 position quad)) + (set! (-> v1-35 w) 1.0) + ) + (let ((a1-10 sv-80) + (v1-36 sv-92) + ) + (set! (-> v1-36 quad) (-> a1-10 position quad)) + (set! (-> v1-36 w) 1.0) + ) + (vector-! sv-84 sv-92 sv-88) + (vector+float*! sv-84 sv-88 sv-84 0.5) + (let ((s4-1 add-debug-text-3d) + (s3-0 #t) + (s2-0 583) + ) + (format (clear *temp-string*) "~D" (-> sv-20 user-count)) + (s4-1 + s3-0 + (the-as bucket-id s2-0) + *temp-string* + sv-84 + (if (< (-> sv-20 user-count) (-> sv-20 max-user-count)) + (font-color yellow) + (font-color red) + ) + (the-as vector2h #f) + ) + ) + ) + ) + (set! sv-16 (&+ sv-16 32)) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/wascity/waswide-obs.gc b/goal_src/jak3/levels/wascity/waswide-obs.gc index 5355fe30ec..94e1896ffe 100644 --- a/goal_src/jak3/levels/wascity/waswide-obs.gc +++ b/goal_src/jak3/levels/wascity/waswide-obs.gc @@ -683,7 +683,7 @@ (none) ) -(defmethod bouncer-method-23 ((this wascity-awning-a)) +(defmethod init-skel! ((this wascity-awning-a)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-awning-a" (the-as (pointer level) #f))) @@ -693,7 +693,7 @@ (none) ) -(defmethod bouncer-method-24 ((this wascity-awning-a)) +(defmethod init-collision! ((this wascity-awning-a)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) @@ -737,7 +737,7 @@ (none) ) -(defmethod bouncer-method-23 ((this wascity-awning-b)) +(defmethod init-skel! ((this wascity-awning-b)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-awning-b" (the-as (pointer level) #f))) @@ -747,7 +747,7 @@ (none) ) -(defmethod bouncer-method-24 ((this wascity-awning-b)) +(defmethod init-collision! ((this wascity-awning-b)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) diff --git a/goal_src/jak3/levels/wascity/wlander-female.gc b/goal_src/jak3/levels/wascity/wlander-female.gc index 8168d90c82..663f82b69c 100644 --- a/goal_src/jak3/levels/wascity/wlander-female.gc +++ b/goal_src/jak3/levels/wascity/wlander-female.gc @@ -7,3 +7,1020 @@ ;; DECOMP BEGINS +(defskelgroup skel-waster-b waster-b 0 -1 + ((1 (meters 20)) (2 (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow 3 + ) + +(define *waster-b-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 20 22) + :knocked-land (new 'static 'array int32 2 21 23) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 20 22)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + ) + :anim-cover-head-start 28 + :anim-cover-head-loop 29 + :anim-cover-head-end 30 + :speech-ambient 19 + :speech-alert 20 + :speech-cower 21 + :speech-touched-by-player 22 + :speech-shot-by-player 23 + :speech-avoiding-player-vehicle 24 + :speech-hit-by-player-vehicle 25 + ) + ) + +(deftype waster-b (civilian) + () + ) + + +(define *waster-b-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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 20 + :knocked-land-anim 21 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 11 + :jump-in-air-anim 11 + :jump-land-anim 11 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance-delta (meters 0.1) + :default-hit-points 1.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 20480.0 + :knocked-soft-vy-hi 40960.0 + :knocked-medium-vxz-lo 40960.0 + :knocked-medium-vxz-hi 73728.0 + :knocked-medium-vy-lo 24576.0 + :knocked-medium-vy-hi 53248.0 + :knocked-hard-vxz-lo 53248.0 + :knocked-hard-vxz-hi 102400.0 + :knocked-hard-vy-lo 40960.0 + :knocked-hard-vy-hi 81920.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 8192.0 + :knocked-yellow-vxz-hi 16384.0 + :knocked-yellow-vy-lo 12288.0 + :knocked-yellow-vy-hi 24576.0 + :knocked-red-vxz-lo 12288.0 + :knocked-red-vxz-hi 24576.0 + :knocked-red-vy-lo 20480.0 + :knocked-red-vy-hi 36864.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 32768.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9956 :y 0.0755 :z -0.0549 :w 34275.477) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :y -0.1262 :z -0.9919 :w 14.399715) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1925.12 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9223 :y -0.0007 :z -0.3862 :w 32775.19) + :geo-tform (new 'static 'vector :x 0.9203 :y -0.1312 :z -0.3683 :w 34427.207) + :axial-slop 965.27246 + :max-angle 5853.9307 + :coll-rad 2340.4543 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2005 :z -0.9796 :w 2271.4595) + :geo-tform (new 'static 'vector :x 0.1581 :y 0.9865 :z -0.0421 :w 8845.103) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1692.0576 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7243 :z -0.6893 :w 2846.8657) + :geo-tform (new 'static 'vector :x -0.1479 :y 0.9867 :z 0.066 :w 8858.61) + :axial-slop 965.27246 + :max-angle 4573.776 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.8955 :z -0.445 :w 13969.198) + :geo-tform (new 'static 'vector :x -0.7036 :y -0.676 :z 0.2186 :w 20755.123) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1223.8848 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8754 :z -0.4832 :w 13897.382) + :geo-tform (new 'static 'vector :x -0.3584 :y -0.8556 :z -0.3732 :w 18419.002) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 901.5296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.0404 :z -0.9991 :w 8581.703) + :geo-tform (new 'static 'vector :x 0.2116 :y -0.9532 :z 0.2155 :w 17374.959) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 949.0432 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0279 :z 0.9996 :w 3558.259) + :geo-tform (new 'static 'vector :x -0.9963 :y -0.085 :z -0.0097 :w 9371.43) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1292.6976 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4821 :z 0.876 :w 10845.134) + :geo-tform (new 'static 'vector :x -0.5782 :y 0.7328 :z 0.3585 :w 34858.27) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1266.0736 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6376 :z 0.7703 :w 15514.556) + :geo-tform (new 'static 'vector :x 0.0502 :y 0.9291 :z 0.3662 :w 35412.96) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1164.9023 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.963 :z -0.2693 :w 7833.773) + :geo-tform (new 'static 'vector :x -0.0243 :y 0.0434 :z 0.9987 :w 31253.5) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1002.7008 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2155 :z -0.9764 :w 1509.913) + :geo-tform (new 'static 'vector :x -0.2514 :y 0.9548 :z 0.1584 :w 16456.654) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1101.0048 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.9221 :y -0.0002 :z -0.3868 :w 16.09273) + :geo-tform (new 'static 'vector :x -0.9217 :y 0.0096 :z 0.3876 :w 10.176285) + :axial-slop 965.27246 + :max-angle 2330.5146 + :coll-rad 1939.456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :z -1.0 :w 12461.907) + :geo-tform (new 'static 'vector :x -0.3106 :y -0.4242 :z 0.8505 :w 16421.393) + :axial-slop 965.27246 + :max-angle 2253.4373 + :coll-rad 983.8592 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6836 :z 0.7298 :w 14527.329) + :geo-tform (new 'static 'vector :x 0.6717 :y -0.6833 :z 0.286 :w 11624.775) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1144.4224 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.693 :z 0.7208 :w 8269.915) + :geo-tform (new 'static 'vector :x -0.693 :y -0.5965 :z -0.4047 :w 14961.978) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1106.3296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5333 :z -0.8459 :w 11592.299) + :geo-tform (new 'static 'vector :x -0.6362 :y -0.6968 :z -0.331 :w 13379.302) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1120.6656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint 13 + :pre-tform (new 'static 'vector :z 1.0 :w 12451.658) + :geo-tform (new 'static 'vector :x -0.5073 :y 0.5962 :z -0.6221 :w 12900.307) + :axial-slop 965.27246 + :max-angle 2242.4417 + :coll-rad 829.44 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8844 :z -0.4666 :w 10098.569) + :geo-tform (new 'static 'vector :x 0.7665 :y 0.5537 :z -0.3251 :w 13637.15) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 889.6512 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6949 :z -0.719 :w 11076.858) + :geo-tform (new 'static 'vector :x -0.8013 :y 0.5535 :z 0.2267 :w 15242.5625) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1168.1792 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7409 :z 0.6715 :w 12293.717) + :geo-tform (new 'static 'vector :x -0.6542 :y 0.6831 :z 0.3245 :w 13102.194) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1168.1792 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 11 + :turn-anim 11 + :run-anim 15 + :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 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *waster-b-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod coin-flip? ((this waster-b)) + #f + ) + +(defmethod get-inv-mass ((this waster-b)) + 0.5 + ) + +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this waster-b)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-5 (handle->process (-> this focus handle)))) + (when a0-5 + (get-trans (the-as process-focusable a0-5) 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f30-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) + (vector-negate-in-place! s5-1) + ) + (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f1-2 (deg- f30-0 f28-0)) + (f2-0 (fabs f1-2)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) + ) + (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) + (set! f30-0 (+ (cond + ((< f2-0 16384.0) + (if (>= f1-2 0.0) + f0-8 + (- f0-8) + ) + ) + ((>= f1-2 0.0) + (- 32768.0 f0-8) + ) + (else + (+ -32768.0 f0-8) + ) + ) + f28-0 + ) + ) + (if (< f30-0 0.0) + (set! f30-0 (+ 65536.0 f30-0)) + ) + ) + ) + ) + ) + ) + (the-as degrees f30-0) + ) + ) + +(defmethod knocked-anim-handler ((this waster-b) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-0 (ja-done? 0))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + (when s5-0 + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + ) + (set! (-> a0-6 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-6 param 1) (-> arg1 anim-speed)) + (set! (-> a0-6 frame-num) 3.0) + (joint-control-channel-group! + a0-6 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + num-func-seek! + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +(defmethod knocked-anim ((this waster-b) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-131 this 1 a2-0)) + (a1-7 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) + yellow-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) + (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) + (set! (-> a0-15 param 1) (-> arg0 anim-speed)) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim a1-7) num-func-seek!) + ) + ) + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-131 this 3 a2-2)) + (a1-14 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) + blue-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) + (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) + (set! (-> a0-30 param 1) 1.0) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim a1-14) num-func-seek!) + ) + ) + ) + (else + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-39 (-> this skel root-channel 0))) + (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-39 param 1) (-> arg0 anim-speed)) + (set! (-> a0-39 frame-num) 0.0) + (joint-control-channel-group! a0-39 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this waster-b) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + ) + (set! (-> a0-2 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! + a0-2 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + num-func-seek! + ) + ) + #t + ) + +(defstate knocked (waster-b) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (the-as collide-shape-prim-group (-> self root root-prim)))) + (logior! (-> v1-5 child 0 prim-core action) (collide-action no-standon)) + (logclear! (-> v1-5 child 1 prim-core action) (collide-action no-standon)) + (set! (-> v1-5 child 1 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + +(defstate get-up-front (waster-b) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-front) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +(defstate get-up-back (waster-b) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-back) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +(defstate wait (waster-b) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (until #f + (let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0))) + (gp-0 (rand-vu-int-range 1 5)) + (s5-0 (rand-vu-int-count 2)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (if (zero? s5-0) + (ja-no-eval :group! (-> self draw art-group data 5) :num! min) + (ja-no-eval :group! (-> self draw art-group data 7) :num! min) + ) + (let ((f28-0 0.0)) + (while (< f28-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f28-0 f28-0 f28-0) (* 3.0 f28-0 f28-0)) 0.0 1.0) + ) + (suspend) + (+! f28-0 (seconds-per-frame)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (while (> gp-0 0) + (+! gp-0 -1) + (cond + ((zero? s5-0) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + ) + ) + (if (-> self wait-return-state) + (go (-> self wait-return-state)) + ) + ) + #f + ) + ) + +(defmethod init-enemy-collision! ((this waster-b)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 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 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 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) 4096.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this waster-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-waster-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *waster-b-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *waster-b-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 12) + (let ((v1-18 (rnd-int this 3))) + (cond + ((zero? v1-18) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 1) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 2) + (set! (-> this anim-walk) 14) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ) + ) + (let ((v1-33 (rnd-int this 3))) + (cond + ((zero? v1-33) + (set! (-> this anim-panic-run) 17) + ) + ((= v1-33 1) + (set! (-> this anim-panic-run) 17) + ) + ((= v1-33 2) + (set! (-> this anim-panic-run) 15) + ) + ) + ) + (set! (-> this dist-run-anim) 20480.0) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (set! (-> this anim-run) 15) + ) + ((= v1-40 1) + (set! (-> this anim-run) 16) + ) + ((= v1-40 2) + (set! (-> this anim-run) 16) + ) + ) + ) + (set! (-> this speed-run) 32768.0) + (set! (-> this anim-on-ground) 19) + (set! (-> this anim-dive) 18) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (rnd-float-range this 1.0 1.25)) + (f0-15 (rnd-float-range this 1.0 1.25)) + ) + (set-vector! (-> this root scale) f0-15 f30-0 f0-15 1.0) + ) + (let ((f0-17 (rnd-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-17 f0-17 f0-17 1.0) + ) + (set! (-> this water-anim) 32) + 0 + (none) + ) + +(defmethod citizen-method-194 ((this waster-b)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (let ((v1-7 (rnd-int this 2))) + (cond + ((zero? v1-7) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (rnd-int this 3))) + (cond + ((zero? v1-11) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-11 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-11 2) + (setup-masks (-> this draw) #x8000 0) + ) + ) + ) + (let ((v1-20 (rnd-int this 4))) + (cond + ((zero? v1-20) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-20 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-20 2) + (setup-masks (-> this draw) 130 0) + ) + ) + ) + (setup-masks (-> this draw) 512 0) + (let ((v1-31 (rnd-int this 3))) + (cond + ((zero? v1-31) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-31 1) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-31 2) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (setup-masks (-> this draw) 32 0) + ) + ((= v1-40 1) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-40 2) + (setup-masks (-> this draw) #x20000 0) + ) + ) + ) + (let ((v1-49 (rnd-int this 3))) + (cond + ((zero? v1-49) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-49 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-49 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ((= v1-7 1) + (setup-masks (-> this draw) #x400000 0) + (setup-masks (-> this draw) #x200000 0) + (let ((v1-63 (rnd-int this 2))) + (cond + ((zero? v1-63) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-63 1) + (setup-masks (-> this draw) #x80000 0) + ) + ) + ) + (let ((v1-70 (rnd-int this 2))) + (cond + ((zero? v1-70) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-70 1) + (setup-masks (-> this draw) #x100000 0) + ) + ) + ) + (let ((v1-77 (rnd-int this 4))) + (cond + ((zero? v1-77) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-77 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-77 2) + (setup-masks (-> this draw) 130 0) + ) + ) + ) + (if (zero? (rnd-int this 1)) + (setup-masks (-> this draw) #x20000 0) + ) + (let ((v1-91 (rnd-int this 3))) + (cond + ((zero? v1-91) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-91 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-91 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/wascity/wlander-h.gc b/goal_src/jak3/levels/wascity/wlander-h.gc index ad0ce7a8c8..1e32c62d32 100644 --- a/goal_src/jak3/levels/wascity/wlander-h.gc +++ b/goal_src/jak3/levels/wascity/wlander-h.gc @@ -7,3 +7,26 @@ ;; DECOMP BEGINS +(deftype wlander-anim-info (structure) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) + ) + :pack-me + ) + + +(deftype wlander-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (knocked-land int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim wlander-anim-info 2 :inline) + (yellow-land-anim wlander-anim-info 2 :inline) + (blue-hit-anim wlander-anim-info 1 :inline) + ) + ) diff --git a/goal_src/jak3/levels/wascity/wlander-male.gc b/goal_src/jak3/levels/wascity/wlander-male.gc index e1d7eae107..149f8ab576 100644 --- a/goal_src/jak3/levels/wascity/wlander-male.gc +++ b/goal_src/jak3/levels/wascity/wlander-male.gc @@ -7,3 +7,2732 @@ ;; DECOMP BEGINS +(deftype wlander (civilian) + ((mad-level float :offset 1128) + (los los-control :inline) + (target-pos vector :inline) + (gun-joint int32) + (gun-axis int32) + (gun-length float) + (shoot-time time-frame) + (last-time-far time-frame) + (last-time-los time-frame) + (shot-sound int32) + (knocked-collide basic) + (knocked-speed-scale float :offset 1384) + (male symbol) + ) + (:state-methods + gun-shoot + close-attack + standing + panic + ) + (:methods + (call-for-help (_type_ float) none) + (fire-shot (_type_) none) + (toggle-cspec (_type_ symbol int) none) + (search-for-focus (_type_) none) + (try-activate (_type_) symbol) + ) + ) + + +;; WARN: Return type mismatch citizen-flag vs none. +(defmethod citizen-method-194 ((this wlander)) + (let ((t9-0 (method-of-type citizen citizen-method-194))) + (t9-0 this) + ) + (set! (-> this knocked-speed-scale) 1.0) + (set! (-> this anim-get-up-front) -1) + (set! (-> this anim-get-up-back) -1) + (set! (-> this ragdoll-proc) (the-as handle #f)) + (cond + ((rand-vu-percent? 0.5) + ) + (else + (logclear! (-> this flags) (citizen-flag talking)) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod enemy-method-123 ((this wlander)) + (the-as + symbol + (or (and (>= (-> this incoming blue-juggle-count) (the-as uint 2)) (-> this incoming knocked-type) 6) + (or (= (-> this hit-points) 0.0) (nonzero? (-> this fated-time))) + ) + ) + ) + +;; og:preserve-this duplicate +; (defmethod ragdoll-settled? ((this wlander)) +; (let ((s5-0 (handle->process (-> this ragdoll-proc)))) +; (or (not s5-0) +; (or (ragdoll-proc-method-19 (the-as ragdoll-proc s5-0)) +; (and (time-elapsed? (-> this state-time) (seconds 0.1)) +; (< (vector-length (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-joints 0 velocity)) +; (* 4096.0 (seconds-per-frame)) +; ) +; (< (cos (* 182.04445 (seconds-per-frame))) (-> (the-as ragdoll-proc s5-0) ragdoll rotate-vel w)) +; (not (enemy-method-109 this)) +; (not (within-gspot-range? this)) +; ) +; ) +; ) +; ) +; ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this wlander)) + (let ((v1-1 (handle->process (-> this focus handle)))) + (the-as search-info-flag (if (if v1-1 + (= (-> v1-1 type) target) + ) + 16 + (the-as int (call-parent-method this)) + ) + ) + ) + ) + +;; WARN: Return type mismatch float vs vector. +(defmethod ragdoll-spawn! ((this wlander) (arg0 symbol) (arg1 symbol)) + (let ((t9-0 (method-of-type nav-enemy ragdoll-spawn!))) + (t9-0 this arg0 arg1) + ) + (let ((v1-2 (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))))) + (the-as vector (when v1-2 + (set! (-> v1-2 ragdoll stretch-vel) 1.1) + (set! (-> v1-2 ragdoll stretch-vel-parallel) 1.1) + ) + ) + ) + ) + +(defmethod ragdoll-settled? ((this wlander)) + (let ((s5-0 (handle->process (-> this ragdoll-proc)))) + (if s5-0 + (seek! (-> (the-as ragdoll-proc s5-0) ragdoll momentum) 0.7 (seconds-per-frame)) + ) + ) + ((method-of-type nav-enemy ragdoll-settled?) this) + ) + +(defmethod set-squad ((this wlander)) + (set! (-> this squad) *waswide-squad-control*) + 0 + (none) + ) + +;; WARN: disable def twice: 165. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this wlander) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('help) + (let ((v1-1 (-> arg3 param 0)) + (f0-0 (the-as float (-> arg3 param 1))) + ) + (cond + ((and (zero? (-> this focus handle)) + (!= (-> this focus handle) (the-as handle v1-1)) + (!= this (handle->process (the-as handle v1-1))) + (< 0.0 f0-0) + ) + (+! (-> this mad-level) 1.0) + (set! (-> this focus handle) (the-as handle v1-1)) + #t + ) + (else + #f + ) + ) + ) + ) + (('event-shoot) + (fire-shot this) + ) + (('hit 'hit-flinch 'hit-knocked) + (+! (-> this mad-level) 1.0) + (speech-control-method-14 *speech-control* (the-as handle this)) + (logior! (-> this flags) (citizen-flag hostile)) + (let* ((s1-0 (handle->process (-> this incoming attacker-handle))) + (a1-12 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when a1-12 + (enemy-method-70 this (the-as process-focusable a1-12) (the-as enemy-aware #f)) + (call-for-help this (* 4096.0 (* 10.0 (-> this mad-level)))) + (if (-> this male) + (speech-control-method-12 *speech-control* this (speech-type civ-m-shot-by-player)) + (speech-control-method-12 *speech-control* this (speech-type civ-f-shot-by-player)) + ) + ) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('event-death) + (if (= (-> this hit-points) 0.0) + (do-effect (-> this skel effect) "death-default" 0.0 -1) + ) + ) + (('combo) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (!= (-> this hit-points) 0.0)) + ) + ) + (('notify) + (let ((a0-32 (-> arg3 param 0)) + (v1-32 (the-as object (-> arg3 param 1))) + ) + (when (= a0-32 'attack) + (when (logtest? (-> (the-as process-focusable v1-32) mask) (process-mask target)) + (if (focus-test? (the-as process-focusable v1-32) dead) + (format #t "guard killed player~%") + ) + ) + ) + ) + ) + (('clear-path) + (set-time! (-> this last-danger-time)) + (let ((v1-37 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-37 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-37 velocity quad)) + (when (= (-> v1-37 danger-type) 8) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 50.0) + (let ((s5-1 (-> this cp-plane))) + (set! (-> s5-1 quad) (-> this cp-vec quad)) + (set! (-> s5-1 y) 0.0) + (vector-rotate90-around-y! s5-1 s5-1) + (vector-normalize! s5-1 1.0) + (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> this cp-sphere))))) + ) + (set! (-> this cp-exit-time) (+ (current-time) (seconds 4))) + (if (and (-> this next-state) (let ((v1-50 (-> this next-state name))) + (or (= v1-50 'active) (= v1-50 'wait) (= v1-50 'avoid-danger)) + ) + ) + (go (method-of-object this clear-path)) + ) + ) + ) + ) + (else + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate knocked-recover (wlander) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (nav-enemy-method-184 self) + (let ((a0-2 (-> self nav state)) + (v1-5 *null-vector*) + ) + (logior! (-> a0-2 flags) (nav-state-flag directional-mode)) + (set! (-> a0-2 travel quad) (-> v1-5 quad)) + ) + 0 + (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (vector-reset! (-> self root transv)) + ) + :exit (behavior () + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (let ((s5-0 (if (zero? (-> self hit-face)) + (-> self anim-get-up-front) + (-> self anim-get-up-back) + ) + ) + ) + (when (!= s5-0 -1) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data s5-0) :num! min) + (ja-no-eval :num! (seek! max (-> self speed-scale))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (go-virtual active) + ) + ) + +(defstate knocked (wlander) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type citizen knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self hit-face) + (the-as + uint + (if (< (vector-dot (-> self root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + 0.0 + ) + 1 + 0 + ) + ) + ) + (set! (-> self knocked-collide) #f) + ) + :post (behavior () + (let ((gp-0 (-> self root))) + (cond + ((focus-test? self under-water) + (accelerate-fall! self (-> gp-0 transv)) + ) + (else + (if (logtest? (-> gp-0 status) (collide-status touch-surface)) + (set! (-> self knocked-collide) (the-as basic #t)) + ) + (when (and (not (-> self knocked-collide)) (!= (-> self incoming knocked-type) 4)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-orient-by-quat! s5-0 s5-0 (-> gp-0 quat)) + (vector-xz-normalize! + (-> gp-0 transv) + (* (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))) (-> self knocked-speed-scale)) + ) + ) + ) + (let ((a1-3 (new-stack-vector0))) + (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 a1-3 (-> self enemy-info slip-factor))) + ) + ) + ) + (let ((a2-2 (new 'stack-no-clear 'collide-query))) + (set! (-> a2-2 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> a2-2 ignore-process0) self) + (set! (-> a2-2 ignore-process1) #f) + (set! (-> a2-2 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> gp-0 pat-ignore-mask))) + (set! (-> a2-2 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide gp-0 (-> gp-0 transv) a2-2 (meters 0)) + ) + ) + (apply-friction self) + (enemy-common-post self) + ) + ) + +(defmethod get-inv-mass ((this wlander)) + 0.5 + ) + +(defmethod toggle-cspec ((this wlander) (arg0 symbol) (arg1 int)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a3-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) + (cond + ((and arg0 (= (-> a3-1 prim-id) arg1)) + (logior! (-> a3-1 prim-core action) (collide-action deadly)) + (when (nonzero? (-> a3-1 prim-id)) + (set! (-> a3-1 prim-core collide-as) (collide-spec civilian)) + (set! (-> a3-1 prim-core collide-with) (collide-spec jak bot player-list)) + ) + ) + (else + (logclear! (-> a3-1 prim-core action) (collide-action deadly)) + (when (nonzero? (-> a3-1 prim-id)) + (set! (-> a3-1 prim-core collide-as) (collide-spec)) + (set! (-> a3-1 prim-core collide-with) (collide-spec)) + 0 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod citizen-method-214 ((this wlander) (arg0 nav-control) (arg1 vector)) + (set! (-> arg1 y) 0.0) + (vector-normalize! arg1 1.0) + (let ((gp-0 (new 'stack-no-clear 'quaternion)) + (s5-0 (-> this root quat)) + ) + (quaternion-set! gp-0 0.0 (-> arg1 x) 0.0 (+ 1.0 (-> arg1 z))) + (quaternion-normalize! gp-0) + (quaternion-smooth-seek! + s5-0 + s5-0 + gp-0 + (* (+ 1.0 (* 0.00024414062 (-> this nav state speed))) (seconds-per-frame)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior wlander-travel-anim wlander ((arg0 object) (arg1 time-frame)) + (logclear! (-> self flags) (citizen-flag run-mode)) + (let ((v1-4 (ja-group))) + (when (not (and v1-4 (= v1-4 (-> self draw art-group data (-> self anim-walk))))) + (ja-channel-push! 2 arg1) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-walk)) + :num! (loop!) + :dist (-> self dist-walk-anim) + :frame-num (ja-aframe 4.0 0) + ) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-3 (-> self interp))) + (set! (-> gp-1 frame-interp 1) f0-3) + (set! (-> gp-1 frame-interp 0) f0-3) + ) + (set! (-> gp-1 dist) (-> self dist-run-anim)) + (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data (get-run-anim self)))) + (set! (-> gp-1 param 0) 0.0) + (joint-control-channel-group! + gp-1 + (the-as art-joint-anim (-> self draw art-group data (get-run-anim self))) + num-func-chan + ) + ) + ) + ) + (until #f + (let* ((f28-0 (-> self nav state speed)) + (f30-0 (lerp-scale 0.0 1.0 f28-0 (-> self speed-walk) (-> self speed-run))) + ) + (seek! (-> self interp) f30-0 (* 4.0 (seconds-per-frame))) + (let ((v1-38 (-> self skel root-channel 1)) + (f0-13 (-> self interp)) + ) + (set! (-> v1-38 frame-interp 1) f0-13) + (set! (-> v1-38 frame-interp 0) f0-13) + ) + (cond + ((< (-> self speed-walk) f28-0) + (ja :num! (loop! (+ 1.0 (* 0.4 f30-0)))) + ) + (else + (let ((f0-18 (lerp-scale 0.1 1.0 f28-0 4096.0 (-> self speed-walk)))) + (ja :num! (loop! f0-18)) + ) + ) + ) + ) + (ja :chan 1 :num! (chan 0)) + (suspend) + ) + #f + (none) + ) + +(defmethod go-hostile ((this wlander)) + (go (method-of-object this hostile)) + ) + +(defmethod go-from-behavior ((this wlander) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((12) + (go (method-of-object this standing)) + ) + ((2) + (go (method-of-object this active)) + ) + ((3) + (go (method-of-object this hostile)) + ) + (else + (go-inactive this) + ) + ) + 0 + (none) + ) + +(defmethod fire-shot ((this wlander)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((s5-0 (handle->process (-> this focus handle))) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (when s4-0 + (vector-! s5-1 (-> this root trans) (get-trans (the-as process-focusable s4-0) 0)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-rotate90-around-y! s5-1 s5-1) + (if (< 0.0 (vector-dot s5-1 (get-transv (the-as process-focusable s4-0)))) + (vector-negate-in-place! s5-1) + ) + (cond + ((= (-> s4-0 type) target) + (let ((s3-4 (-> this target-pos))) + (let ((s2-1 (get-trans (the-as process-focusable s4-0) 3))) + (let ((v1-17 (* 0.2 (vector-length (get-transv (the-as process-focusable s4-0)))))) + (.mov vf7 v1-17) + ) + (.lvf vf5 (&-> s5-1 quad)) + (.lvf vf4 (&-> s2-1 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 (&-> s3-4 quad) vf6) + ) + ) + (else + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + ) + ) + ) + ) + (let ((t0-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this gun-joint))))) + (new 'stack-no-clear 'vector) + (let ((a0-15 t0-0)) + (let ((v1-25 t0-0)) + (let ((a1-12 (&-> (-> this node-list data (-> this gun-joint) bone) transform quad (-> this gun-axis)))) + (let ((a2-3 (-> this gun-length))) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-12 0)) + ) + (.lvf vf4 (&-> v1-25 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 (&-> a0-15 quad) vf6) + ) + (spawn-guard-projectile this t0-0 (-> this target-pos) 819200.0 t0-0) + ) + (let ((s5-2 sound-play-by-spec) + (s4-1 (static-sound-spec "wlander-fire" :group 0)) + ) + (set! (-> s4-1 volume) 1024) + (set! (-> s4-1 pitch-mod) 0) + (set! (-> s4-1 reg 0) (the-as uint (-> this shot-sound))) + (s5-2 s4-1 (new-sound-id) (-> this root trans)) + ) + 0 + (none) + ) + ) + +(defmethod try-activate ((this wlander)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (new 'stack-no-clear 'vector) + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 object-type) (traffic-type wlander-male)) + (set! (-> gp-0 behavior) (the-as uint 12)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 nav-mesh) (-> this nav state mesh)) + (set! (-> gp-0 nav-branch) #f) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 handle) (process->handle this)) + (set! (-> gp-0 user-data) (the-as uint 0)) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (set! (-> gp-0 guard-type) (the-as uint 11)) + (set! (-> gp-0 entity) #f) + (vector-reset! (-> gp-0 velocity)) + (let ((v1-12 (-> gp-0 position))) + (let ((a0-8 (-> this root trans))) + (let ((a1-3 16384.0)) + (.mov vf7 a1-3) + ) + (.lvf vf5 (&-> s4-0 quad)) + (.lvf vf4 (&-> a0-8 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 (&-> v1-12 quad) vf6) + ) + (quaternion-rotate-local-y! (-> gp-0 rotation) (-> this root quat) 32768.0) + (send-event *traffic-manager* 'activate-object gp-0) + (if (-> gp-0 proc) + (return #t) + ) + ) + ) + #f + ) + ) + +(defstate standing (wlander) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self root transv quad) (the-as uint128 0)) + (logclear! (-> self flags) (citizen-flag talking)) + ) + :trans (behavior () + '() + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +(defstate active (wlander) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type citizen active) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + (if (task-node-open? (game-task-node wascity-defend-get-to)) + (go-virtual panic) + ) + (when (logtest? (-> self flags) (citizen-flag talking)) + (do-navigation-to-destination (-> self nav state) (-> self root trans)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s5-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((s4-0 (-> self nav state current-poly)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (vector-rotate90-around-y! gp-0 gp-0) + (set! (-> gp-0 y) 0.0) + (vector-xz-normalize-copy! s3-0 gp-0 (* 4096.0 (rnd-float-range self 10.0 40.0))) + (clamp-vector-to-mesh-no-gaps (-> self nav) (-> self root trans) s4-0 s3-0 s5-0) + ) + (if (-> s5-0 found-boundary) + (set! (-> self root trans quad) (-> s5-0 intersection quad)) + (vector+! (-> self root trans) (-> self root trans) gp-0) + ) + ) + (if (try-activate self) + (go-virtual standing) + (logclear! (-> self flags) (citizen-flag talking)) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type citizen active) exit))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self flags) (citizen-flag talking)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type citizen active) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (handle->process (-> self focus handle)) + (go-virtual hostile) + ) + ) + ) + +(defstate hostile (wlander) + :virtual #t + :enter (behavior () + (nav-enemy-method-177 self) + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (init-los! (-> self los) self (seconds 0.2) 327680.0 (collide-spec backgnd hit-by-others-list los-blocker)) + (set-time! (-> self state-time)) + (when (and (handle->process (-> self focus handle)) (= (-> (handle->process (-> self focus handle)) type) target)) + (let ((v1-19 (-> self nav))) + (set! (-> v1-19 sphere-mask) (the-as uint #x1000fc)) + ) + 0 + ) + (set-time! (-> self last-time-far)) + (set-time! (-> self last-time-los)) + (logior! (-> self flags) (citizen-flag persistent)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (cond + ((< (-> self mad-level) 0.0) + ) + (else + (set! (-> self mad-level) (- (-> self mad-level) (* 0.1 (seconds-per-frame)))) + ) + ) + (let* ((s5-0 (handle->process (-> self focus handle))) + (gp-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when (or (not gp-0) (focus-test? gp-0 inactive) (focus-test? gp-0 disable) (focus-test? gp-0 dead)) + (clear-focused (-> self focus)) + (set! (-> self mad-level) 0.0) + (logclear! (-> self flags) (citizen-flag persistent)) + (go-virtual active) + ) + (cond + (gp-0 + (los-control-method-9 (-> self los) gp-0 (get-trans gp-0 3) 819.2 4096.0) + (let* ((v1-25 (get-trans gp-0 0)) + (f30-0 (vector-length (vector-! (new 'stack-no-clear 'vector) v1-25 (-> self root trans)))) + ) + (if (< 32768.0 f30-0) + (set-time! (-> self last-time-far)) + ) + (cond + ((should-check-los? (-> self los) 0) + (set! (-> self target-pos quad) (-> (get-trans gp-0 3) quad)) + (if (and (enemy-method-105 self 6371.5557 #t) (>= 12288.0 f30-0)) + (go-virtual close-attack) + ) + (if (or (< f30-0 204800.0) + (and (enemy-method-105 self 910.2222 #t) (< (seconds 4) (- (current-time) (-> self last-time-far)))) + ) + (go-virtual gun-shoot) + ) + (set-time! (-> self last-time-los)) + ) + (else + (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) + (time-elapsed? (-> self last-time-los) (seconds 5)) + ) + (clear-focused (-> self focus)) + (set! (-> self mad-level) 0.0) + (logclear! (-> self flags) (citizen-flag persistent)) + (go-virtual active) + ) + ) + ) + ) + ) + (else + ) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) + ) + :post (behavior () + (when (handle->process (-> self focus handle)) + ) + (nav-enemy-method-187 self) + ) + ) + +(defstate panic (wlander) + :virtual #t + :parent (wlander active) + :enter (behavior () + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (search-for-focus self) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (if (handle->process (-> self focus handle)) + (go-virtual hostile) + ) + ) + ) + ) + +(defstate close-attack (wlander) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-4 *game-info*) + (v0-0 (+ (-> v1-4 attack-id) 1)) + ) + (set! (-> v1-4 attack-id) v0-0) + (set! (-> self attack-id) v0-0) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (toggle-cspec self #f -1) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + '() + ) + :code sleep-code + :post nav-enemy-chase-post + ) + +(defstate gun-shoot (wlander) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let* ((v1-2 *game-info*) + (a0-2 (+ (-> v1-2 attack-id) 1)) + ) + (set! (-> v1-2 attack-id) a0-2) + (set! (-> self attack-id) a0-2) + ) + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (set! (-> self root transv quad) (the-as uint128 0)) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (let* ((s5-0 (handle->process (-> self focus handle))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when (or (not gp-0) + (focus-test? (the-as process-focusable gp-0) inactive) + (focus-test? (the-as process-focusable gp-0) disable) + (focus-test? (the-as process-focusable gp-0) dead) + (not (-> *setting-control* user-current citizen-fights)) + ) + (clear-focused (-> self focus)) + (set! (-> self mad-level) 0.0) + (logclear! (-> self flags) (citizen-flag persistent)) + (go-virtual active) + ) + (when gp-0 + (los-control-method-9 + (-> self los) + (the-as process-focusable gp-0) + (get-trans (the-as process-focusable gp-0) 3) + 819.2 + 4096.0 + ) + (let* ((v1-24 (get-trans (the-as process-focusable gp-0) 0)) + (f30-0 (vector-length (vector-! (new 'stack-no-clear 'vector) v1-24 (-> self root trans)))) + ) + (cond + ((should-check-los? (-> self los) 0) + (set! (-> self target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (if (and (enemy-method-105 self 6371.5557 #t) (>= 12288.0 f30-0)) + (go-virtual close-attack) + ) + (set-time! (-> self last-time-los)) + ) + (else + (if (or (< 245760.0 f30-0) (time-elapsed? (-> self last-time-los) (seconds 0.1))) + (go-virtual hostile) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +(defmethod call-for-help ((this wlander) (arg0 float)) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (set! (-> v1-0 quad) (-> this root trans quad)) + (set! (-> v1-0 w) arg0) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* v1-0 s5-0 64)) + (let* ((s3-0 (-> s5-0 s4-0)) + (v1-3 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-3 + (let* ((s3-1 (-> v1-3 process)) + (a0-5 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (new 'stack-no-clear 'vector) + (when (and a0-5 (!= this a0-5)) + (when (send-event a0-5 'help (-> this focus handle) (-> this mad-level)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Function (method 241 wlander) has a return type of none, but the expression builder found a return statement. +(defmethod search-for-focus ((this wlander)) + (let ((a1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (set! (-> a1-0 quad) (-> this root trans quad)) + (set! (-> a1-0 w) 245760.0) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* a1-0 s5-0 64)) + (let* ((s3-0 (-> s5-0 s4-0)) + (v1-5 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-5 + (let* ((s3-1 (-> v1-5 process)) + (a1-3 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (new 'stack-no-clear 'vector) + (when (and a1-3 + (!= this a1-3) + (not (focus-test? (the-as process-focusable a1-3) inactive)) + (not (focus-test? (the-as process-focusable a1-3) disable)) + (not (focus-test? (the-as process-focusable a1-3) dead)) + (logtest? (process-mask enemy) (-> a1-3 mask)) + ) + (try-update-focus (-> this focus) (the-as process-focusable a1-3) this) + (return #f) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(define *wlander-male-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 15 + :knocked-land-anim 16 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint 6 + :look-at-joint 5 + :bullseye-joint 4 + :sound-hit (static-sound-name "wlander-male-hi") + :sound-die (static-sound-name "wlander-male-di") + :notice-distance-delta (meters 0.1) + :default-hit-points 8.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 49152.0 + :knocked-medium-vy-hi 102400.0 + :knocked-hard-vxz-lo 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 24576.0 + :knocked-yellow-vy-lo 32768.0 + :knocked-yellow-vy-hi 49152.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 32768.0 + :knocked-red-vy-hi 49152.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 32768.0 + :knocked-blue-vy-hi 49152.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9955 :y 0.0573 :z 0.0754 :w 35528.34) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0 :w 10.176285) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 32189.08) + :geo-tform (new 'static 'vector :x 1.0 :w 42486.152) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8098.6113) + :geo-tform (new 'static 'vector :x 1.0 :w 5056.958) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 4998.831) + :geo-tform (new 'static 'vector :x 1.0 :w 3216.9983) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5593 :z -0.8289 :w 9863.859) + :geo-tform (new 'static 'vector :x 0.6544 :y 0.7366 :z -0.1703 :w 39376.05) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6236 :z -0.7817 :w 14559.55) + :geo-tform (new 'static 'vector :x 0.3033 :y 0.6659 :z 0.6815 :w 38777.812) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6694 :z -0.7428 :w 16626.646) + :geo-tform (new 'static 'vector :x 0.0788 :y 0.9815 :z -0.1741 :w 41031.305) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5579 :z 0.8298 :w 9863.077) + :geo-tform (new 'static 'vector :x -0.654 :y 0.737 :z -0.1703 :w 26147.9) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6241 :z 0.7813 :w 14545.569) + :geo-tform (new 'static 'vector :x -0.3037 :y 0.6658 :z 0.6814 :w 26750.775) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6686 :z 0.7436 :w 16626.646) + :geo-tform (new 'static 'vector :x -0.3897 :y 0.1538 :z 0.9079 :w 33939.582) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 13.471289) + :geo-tform (new 'static 'vector :x -1.0 :w 7430.3623) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1647 :z -0.9863 :w 14417.501) + :geo-tform (new 'static 'vector :x -0.5111 :y -0.6757 :z 0.5311 :w 14693.463) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9601 :z 0.2795 :w 10381.085) + :geo-tform (new 'static 'vector :x 0.8079 :y -0.3633 :z 0.4639 :w 20998.17) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5041 :z 0.8636 :w 18906.99) + :geo-tform (new 'static 'vector :x -0.6128 :y -0.7075 :z -0.3518 :w 14221.239) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 13 + :pre-tform (new 'static 'vector :x -0.1655 :z 0.9862 :w 14409.09) + :geo-tform (new 'static 'vector :x -0.5112 :y 0.6757 :z -0.5309 :w 14680.92) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.96 :z -0.2797 :w 10371.873) + :geo-tform (new 'static 'vector :x 0.8082 :y 0.3631 :z -0.4635 :w 20994.604) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5049 :z -0.8631 :w 18906.973) + :geo-tform (new 'static 'vector :x -0.6132 :y 0.7072 :z 0.3517 :w 14214.285) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 14663.753) + :geo-tform (new 'static 'vector :x -1.0 :w 14663.753) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.9984 :z -0.0551 :w 3427.2053) + :geo-tform (new 'static 'vector :x -0.0071 :y 0.9998 :z -0.018 :w 7926.0513) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6866 :z -0.727 :w 150.04103) + :geo-tform (new 'static 'vector :y 1.0 :w 7924.704) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.7852 :z -0.6191 :w 11466.542) + :geo-tform (new 'static 'vector :x 0.2589 :y 0.5886 :z 0.7657 :w 10875.99) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6068 :z 0.7947 :w 8644.234) + :geo-tform (new 'static 'vector :y 1.0 :w 6801.344) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9701 :y -0.2425 :w 10.176285) + :geo-tform (new 'static 'vector :y 1.0 :w 6801.344) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.504 :z -0.8636 :w 9627.074) + :geo-tform (new 'static 'vector :x -0.5806 :y -0.7427 :z -0.3334 :w 13728.991) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.5049 :z 0.8631 :w 9627.057) + :geo-tform (new 'static 'vector :x -0.5811 :y 0.7424 :z 0.3333 :w 13721.71) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim 4 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 12) + :walk-travel-speed (meters 3) + :maximum-rotation-rate (degrees 720) + :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! (-> *wlander-male-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(deftype wlander-male (wlander) + () + ) + + +(defun wlander-male-joint-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control)) + (-> arg0 process) + (let ((gp-0 (-> arg1 data 9)) + (s5-0 (-> arg1 data 20)) + (a1-2 (matrix-translate! (new 'stack-no-clear 'matrix) (new 'static 'vector :y -819.2 :z -8192.0 :w 1.0))) + ) + (matrix*! (-> s5-0 bone transform) a1-2 (-> gp-0 bone transform)) + ) + 0 + (none) + ) + +(defmethod enemy-method-123 ((this wlander-male)) + (when (call-parent-method this) + (set! (-> this skel postbind-function) wlander-male-joint-callback) + #t + ) + ) + +(defmethod knocked-anim ((this wlander-male) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.01)) + (cond + ((zero? (-> this hit-face)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 17))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 17)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 17)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this wlander-male) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.01)) + (cond + ((zero? (-> this hit-face)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + ) + ) + #t + ) + +(defstate gun-shoot (wlander-male) + :virtual #t + :code (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! wlander-male-idle-to-shoot-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (while (not (enemy-method-105 self 4187.0225 #t)) + (let* ((gp-0 (handle->process (-> self focus handle))) + (s5-0 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when s5-0 + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-2 + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s5-0) 0) (-> self root trans)) + ) + (s5-1 (new 'stack-no-clear 'vector)) + (f30-0 1.2) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (set! (-> gp-2 y) 0.0) + (vector-normalize! gp-2 1.0) + (vector-cross! s5-1 s4-0 gp-2) + (cond + ((< (vector-dot gp-2 s4-0) (cos 4187.0225)) + (ja-no-eval :group! wlander-male-shoot-turn1-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wlander-male-shoot-turn1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) gp-2 65536.0 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wlander-male-shoot-turn1-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((< (-> s5-1 y) 0.0) + (ja-no-eval :group! wlander-male-shoot-turn0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* -10240.0 (seconds-per-frame) f30-0)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! wlander-male-shoot-turn0-ja :num! (seek! 0.0 f30-0) :frame-num max) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 10240.0 (seconds-per-frame) f30-0)) + (suspend) + (ja :num! (seek! 0.0 f30-0)) + ) + ) + ) + ) + ) + ) + ) + (let* ((gp-3 (handle->process (-> self focus handle))) + (v1-167 (if (type? gp-3 process-focusable) + gp-3 + ) + ) + ) + (when v1-167 + (cond + ((focus-test? (the-as process-focusable v1-167) ignore) + (ja-no-eval :group! wlander-male-shoot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! wlander-male-shoot0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + #f + (go-hostile self) + ) + :post nav-enemy-simple-post + ) + +(defstate standing (wlander-male) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.4 0.6))) + (until #f + (ja-no-eval :group! wlander-male-idle0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defstate close-attack (wlander-male) + :virtual #t + :code (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! wlander-male-attack-rifle-butt-ja :num! (seek! 3.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 3.0)) + ) + (toggle-cspec self #t 1) + (ja-no-eval :group! wlander-male-attack-rifle-butt-ja :num! (seek! 8.0) :frame-num 3.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 8.0)) + ) + (toggle-cspec self #f -1) + (ja-no-eval :group! wlander-male-attack-rifle-butt-ja :num! (seek!) :frame-num 8.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + ) + +(defmethod init-enemy-collision! ((this wlander-male)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec civilian)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly 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 crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 5324.8 0.0 5324.8) + ) + (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 crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-15 local-sphere) 0.0 10649.6 0.0 5324.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec civilian)) + (set! (-> v1-17 prim-core collide-with) + (collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-17 prim-core action) (collide-action deadly)) + (set! (-> v1-17 transform-index) 2) + (set-vector! (-> v1-17 local-sphere) 0.0 8192.0 2867.2 8192.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set-vector! (-> v1-19 local-sphere) 0.0 8192.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod relocate ((this wlander-male) (offset int)) + (call-parent-method this offset) + ) + +(defmethod init-enemy! ((this wlander-male)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wlander-male" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *wlander-male-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this anim-shuffle) 5) + (set! (-> this anim-walk) 5) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) + (set! (-> this speed-run) 49152.0) + (set! (-> this gun-joint) 21) + (set! (-> this gun-axis) 2) + (set! (-> this gun-length) 0.0) + (set! (-> this water-anim) -1) + 0 + (none) + ) + +(defmethod citizen-method-194 ((this wlander-male)) + (let ((t9-0 (method-of-type wlander citizen-method-194))) + (t9-0 this) + ) + (set! (-> this knocked-speed-scale) 0.5) + (set! (-> this skel postbind-function) #f) + (logior! (-> this mask) (process-mask guard)) + (logclear! (-> this mask) (process-mask enemy)) + (set! (-> this fact pickup-type) (pickup-type ammo-light-random)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list bot-targetable jak-vehicle)) + (let ((f30-0 (rnd-float-range this 1.2 1.5)) + (f0-3 (rnd-float-range this 1.2 1.5)) + ) + (set-vector! (-> this root scale) f0-3 f30-0 f0-3 1.0) + ) + (setup-masks (-> this draw) 0 -1) + (let ((v1-23 (rnd-int this 3))) + (cond + ((zero? v1-23) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-23 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-23 2) + (setup-masks (-> this draw) #x200000 0) + ) + ) + ) + (let ((v1-32 (rnd-int this 3))) + (cond + ((zero? v1-32) + (setup-masks (-> this draw) 4 0) + (if (zero? (rnd-int this 3)) + (setup-masks (-> this draw) 32 0) + ) + ) + ((= v1-32 1) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-32 2) + (setup-masks (-> this draw) #x40000 0) + ) + ) + ) + (let ((v1-46 (rnd-int this 2))) + (cond + ((zero? v1-46) + (setup-masks (-> this draw) 2 0) + (let ((v1-50 (rnd-int this 4))) + (cond + ((zero? v1-50) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-50 1) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ((= v1-46 1) + (setup-masks (-> this draw) #x20000 0) + ) + ) + ) + (let ((v1-60 (rnd-int this 3))) + (cond + ((zero? v1-60) + (setup-masks (-> this draw) 8 0) + ) + ((= v1-60 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-60 2) + (setup-masks (-> this draw) #x100000 0) + ) + ) + ) + (let ((v1-69 (rnd-int this 3))) + (cond + ((zero? v1-69) + (setup-masks (-> this draw) 512 0) + ) + ((= v1-69 1) + (setup-masks (-> this draw) #x4000 0) + ) + ((= v1-69 2) + (setup-masks (-> this draw) #x400000 0) + ) + ) + ) + (let ((v1-78 (rnd-int this 5))) + (cond + ((zero? v1-78) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-78 1) + (setup-masks (-> this draw) #x8000 0) + ) + ((= v1-78 2) + (setup-masks (-> this draw) #x1000000 0) + ) + ) + ) + (if (zero? (rnd-int this 6)) + (setup-masks (-> this draw) #x800000 0) + ) + (let ((v1-92 (rnd-int this 6))) + (cond + ((zero? v1-92) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-92 1) + (setup-masks (-> this draw) #x80000 0) + ) + ) + ) + (let ((v1-99 (rnd-int this 2))) + (cond + ((zero? v1-99) + (setup-masks (-> this draw) #x2000000 0) + ) + ((= v1-99 1) + (setup-masks (-> this draw) #x4000000 0) + ) + ) + ) + (set! (-> this shoot-time) (set-reaction-time! this (seconds 1) (seconds 3))) + (set! (-> this shot-sound) (rnd-int this 7)) + (toggle-cspec this #f -1) + (ja-channel-set! 0) + (set! (-> this male) #t) + 0 + (none) + ) + +(defskelgroup skel-wlander-female wlander-female wlander-female-lod0-jg -1 + ((wlander-female-lod0-mg (meters 20)) (wlander-female-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow wlander-female-shadow-mg + :origin-joint-index 3 + ) + +(define *wlander-female-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 12 + :knocked-land-anim 13 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-hit (static-sound-name "wlander-female-") + :sound-die (static-sound-name "wlander-female-") + :notice-distance-delta (meters 0.1) + :default-hit-points 4.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 61440.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 1.0 :w 37977.51) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0 :w 10.176285) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 32774.715) + :geo-tform (new 'static 'vector :x 1.0 :w 38578.75) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 4662.0854) + :geo-tform (new 'static 'vector :x 1.0 :w 40129.113) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.2436 :z -0.9698 :w 9509.766) + :geo-tform (new 'static 'vector :x 0.6346 :y 0.7642 :z -0.1145 :w 37720.082) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4663 :z -0.8845 :w 14131.728) + :geo-tform (new 'static 'vector :x 0.205 :y 0.7336 :z 0.6478 :w 37528.734) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8178 :z -0.5754 :w 15088.99) + :geo-tform (new 'static 'vector :x -0.0167 :y 0.9984 :z -0.0528 :w 39154.445) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.2443 :z 0.9696 :w 9496.33) + :geo-tform (new 'static 'vector :x -0.6351 :y 0.7638 :z -0.1144 :w 27817.902) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.466 :z 0.8847 :w 14144.853) + :geo-tform (new 'static 'vector :x -0.2051 :y 0.7336 :z 0.6478 :w 28006.684) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8177 :z 0.5755 :w 15089.009) + :geo-tform (new 'static 'vector :x -0.3014 :y 0.0503 :z 0.9521 :w 32435.35) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 14.399715) + :geo-tform (new 'static 'vector :x -1.0 :w 3963.9268) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0762 :z -0.997 :w 14415.736) + :geo-tform (new 'static 'vector :x 0.0071 :y -0.2818 :z 0.9594 :w 8815.866) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1183 :z 0.9929 :w 8437.05) + :geo-tform (new 'static 'vector :x 0.9832 :y -0.1333 :z 0.1246 :w 15858.384) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9683 :z 0.2494 :w 15682.073) + :geo-tform (new 'static 'vector :x -0.9494 :y -0.2899 :z -0.1203 :w 8596.775) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9683 :z -0.2494 :w 8206.545) + :geo-tform (new 'static 'vector :x -0.9768 :y -0.1649 :z 0.1359 :w 10236.323) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.0767 :z 0.997 :w 14403.721) + :geo-tform (new 'static 'vector :x 0.0076 :y 0.282 :z -0.9593 :w 8802.541) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1177 :z -0.993 :w 8423.779) + :geo-tform (new 'static 'vector :x 0.9832 :y 0.1331 :z -0.1245 :w 15858.056) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9684 :z -0.2492 :w 15682.054) + :geo-tform (new 'static 'vector :x -0.9495 :y 0.2897 :z 0.1202 :w 8596.066) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9684 :z 0.2492 :w 8206.509) + :geo-tform (new 'static 'vector :x -0.5046 :y 0.6751 :z -0.538 :w 14914.9375) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 29632.375) + :geo-tform (new 'static 'vector :x 1.0 :w 8945.792) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7799 :z 0.6258 :w 42961.58) + :geo-tform (new 'static 'vector :x 0.6487 :y 0.6492 :z 0.3968 :w 24880.27) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.3452 :z 0.9384 :w 2537.481) + :geo-tform (new 'static 'vector :x -0.2538 :y 0.6802 :z -0.6875 :w 9158.073) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6167 :z -0.7871 :w 6379.8203) + :geo-tform (new 'static 'vector :x -0.2203 :y 0.6902 :z -0.6892 :w 9046.754) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 11 + :pre-tform (new 'static 'vector :x 0.3643 :z -0.9312 :w 2476.6965) + :geo-tform (new 'static 'vector :x -0.3016 :y 0.115 :z 0.9464 :w 38890.977) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6244 :z 0.781 :w 6334.437) + :geo-tform (new 'static 'vector :x -0.3023 :y 0.0965 :z 0.9482 :w 38902.08) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint 5 + :pre-tform (new 'static 'vector :x 1.0 :w 4039.5845) + :geo-tform (new 'static 'vector :x 1.0 :w 38742.496) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 39209.86) + :geo-tform (new 'static 'vector :x 1.0 :w 112.50346) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim 4 + :run-anim 6 + :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 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *wlander-female-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(deftype wlander-female (wlander) + ((gunout symbol) + ) + ) + + +(defun wlander-female-joint-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control)) + (-> arg0 process) + (let ((gp-0 (-> arg1 data 4)) + (s5-0 (-> arg1 data 21)) + (a1-2 (matrix-translate! (new 'stack-no-clear 'matrix) (new 'static 'vector :y -544.768 :z 1114.112 :w 1.0))) + ) + (matrix*! (-> s5-0 bone transform) a1-2 (-> gp-0 bone transform)) + ) + 0 + (none) + ) + +(defmethod event-handler ((this wlander-female) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('event-gunout) + (set! (-> this skel postbind-function) #f) + (set! v0-0 23) + (set! (-> this anim-walk) (the-as int v0-0)) + v0-0 + ) + (('event-gunaway) + (set! (-> this skel postbind-function) wlander-female-joint-callback) + (set! v0-0 5) + (set! (-> this anim-walk) (the-as int v0-0)) + v0-0 + ) + (else + ((method-of-type wlander event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod knocked-anim ((this wlander-female) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.01)) + (cond + ((zero? (-> this hit-face)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this wlander-female) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.01)) + (cond + ((zero? (-> this hit-face)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) + ) + ) + ) + #t + ) + +(defstate wait (wlander-female) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (cond + ((-> self gunout) + (ja-no-eval :group! wlander-female-gun-out-idle-ja :num! (seek! max (-> self speed-scale)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + ) + (else + (ja-no-eval :group! wlander-female-idle0-ja :num! (seek! max (-> self speed-scale)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + ) + ) + ) + #f + ) + ) + +(defstate close-attack (wlander-female) + :virtual #t + :code (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! wlander-female-attack-kick-spin0-ja :num! (seek! 7.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 7.0)) + ) + (toggle-cspec self #t 1) + (ja-no-eval :group! wlander-female-attack-kick-spin0-ja :num! (seek! 10.0) :frame-num 7.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0)) + ) + (toggle-cspec self #f -1) + (ja-no-eval :group! wlander-female-attack-kick-spin0-ja :num! (seek!) :frame-num 10.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + ) + +(defstate gun-shoot (wlander-female) + :virtual #t + :code (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.1)) + (when (-> self skel postbind-function) + (ja-no-eval :group! wlander-female-gun-takeout-ja :num! (seek! max 1.6) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.6)) + ) + ) + (ja-no-eval :group! wlander-female-gun-out-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (while (not (enemy-method-105 self 4187.0225 #t)) + (let* ((gp-0 (handle->process (-> self focus handle))) + (s5-0 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when s5-0 + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-2 + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s5-0) 0) (-> self root trans)) + ) + (s5-1 (new 'stack-no-clear 'vector)) + (f30-0 1.2) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (set! (-> gp-2 y) 0.0) + (vector-normalize! gp-2 1.0) + (vector-cross! s5-1 s4-0 gp-2) + (cond + ((< (vector-dot gp-2 s4-0) (cos 4187.0225)) + (ja-no-eval :group! wlander-female-shoot-turn1-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wlander-female-shoot-turn1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) gp-2 65536.0 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wlander-female-shoot-turn1-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((< (-> s5-1 y) 0.0) + (ja-no-eval :group! wlander-female-shoot-turn0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* -10240.0 (seconds-per-frame) f30-0)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! wlander-female-shoot-turn0-ja :num! (seek! 0.0 f30-0) :frame-num max) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 10240.0 (seconds-per-frame) f30-0)) + (suspend) + (ja :num! (seek! 0.0 f30-0)) + ) + ) + ) + ) + ) + ) + ) + (let* ((gp-3 (handle->process (-> self focus handle))) + (v1-194 (if (type? gp-3 process-focusable) + gp-3 + ) + ) + ) + (when v1-194 + (cond + ((focus-test? (the-as process-focusable v1-194) ignore) + (ja-no-eval :group! wlander-female-shoot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! wlander-female-shoot0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + #f + (go-hostile self) + ) + :post nav-enemy-simple-post + ) + +(defmethod init-enemy-collision! ((this wlander-female)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec civilian)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak 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 player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 5324.8 0.0 5324.8) + ) + (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 player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-15 local-sphere) 0.0 9011.2 0.0 5324.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec civilian)) + (set! (-> v1-17 prim-core collide-with) + (collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-17 prim-core action) (collide-action deadly)) + (set! (-> v1-17 transform-index) 2) + (set-vector! (-> v1-17 local-sphere) 0.0 8192.0 2867.2 8192.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set-vector! (-> v1-19 local-sphere) 0.0 8192.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) 6144.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod relocate ((this wlander-female) (offset int)) + (call-parent-method this offset) + ) + +(defmethod init-enemy! ((this wlander-female)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wlander-female" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this skel postbind-function) wlander-female-joint-callback) + (init-enemy-defaults! this *wlander-female-nav-enemy-info*) + (let ((v1-6 (-> this nav))) + (set! (-> v1-6 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this anim-shuffle) 5) + (set! (-> this anim-walk) 5) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 12288.0) + (set! (-> this dist-run-anim) 19660.8) + (set! (-> this anim-run) 6) + (set! (-> this speed-run) 49152.0) + (set! (-> this gun-joint) 22) + (set! (-> this gun-axis) 1) + (set! (-> this gun-length) 0.0) + (set! (-> this water-anim) -1) + 0 + (none) + ) + +(defmethod citizen-method-194 ((this wlander-female)) + (let ((t9-0 (method-of-type wlander citizen-method-194))) + (t9-0 this) + ) + (logior! (-> this mask) (process-mask guard)) + (logclear! (-> this mask) (process-mask enemy)) + (set! (-> this fact pickup-type) (pickup-type ammo-light-random)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list bot-targetable jak-vehicle)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 288 0) + (let ((v1-17 (rnd-int this 2))) + (cond + ((zero? v1-17) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-17 1) + (setup-masks (-> this draw) 512 0) + ) + ) + ) + (let ((v1-24 (rnd-int this 2))) + (cond + ((zero? v1-24) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-24 1) + (setup-masks (-> this draw) 1024 0) + ) + ) + ) + (let ((v1-31 (rnd-int this 2))) + (cond + ((zero? v1-31) + (setup-masks (-> this draw) 8 0) + ) + ((= v1-31 1) + (setup-masks (-> this draw) 2048 0) + ) + ) + ) + (let ((v1-38 (rnd-int this 2))) + (cond + ((zero? v1-38) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-38 1) + (setup-masks (-> this draw) 4096 0) + ) + ) + ) + (let ((v1-45 (rnd-int this 2))) + (cond + ((zero? v1-45) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-45 1) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + (let ((v1-52 (rnd-int this 2))) + (cond + ((zero? v1-52) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-52 1) + (setup-masks (-> this draw) #x4000 0) + ) + ) + ) + (let ((v1-59 (rnd-int this 2))) + (cond + ((zero? v1-59) + (setup-masks (-> this draw) #x8000 0) + ) + ((= v1-59 1) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + (set! (-> this anim-get-up-front) 17) + (set! (-> this shoot-time) (set-reaction-time! this (seconds 1) (seconds 3))) + (set! (-> this shot-sound) (rnd-int this 7)) + (set! (-> this gunout) (if (rnd-int this 2) + #f + #t + ) + ) + (toggle-cspec this #f -1) + (ja-channel-set! 0) + (set! (-> this male) #f) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc b/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc index f633662045..93fbffb0fa 100644 --- a/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc @@ -440,7 +440,7 @@ (get-damage-from-attack (_type_ object event-message-block) float) (enemy-method-63 (_type_ float) float) (update-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware) - (penetrate->next-state (_type_) symbol) + (penetrate->next-state (_type_ process event-message-block float) symbol) (get-penetrated-by (_type_) penetrate) (coin-flip? (_type_) symbol) (get-enemy-aware (_type_ enemy-aware) enemy-aware) diff --git a/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc index 019e0becb8..34a0740225 100644 --- a/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc @@ -1775,28 +1775,28 @@ ) ) (send-event (ppointer->process (-> this parent)) 'child-hit) - (let ((f0-1 (the-as number 0.0))) + (let ((f0-1 0.0)) (if (not *debug-unkillable*) (set! f0-1 (damage-enemy! this proc block)) ) - ) - (let ((s2-2 (penetrate->next-state this))) - (when s2-2 - (logclear! (-> this enemy-flags) (enemy-flag use-trigger)) - (send-attack-to-all-tshapes this (the-as process-focusable proc) block) - (let ((a1-17 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-17 from) (process->ppointer proc)) - (set! (-> a1-17 num-params) argc) - (set! (-> a1-17 message) s2-2) - (set! (-> a1-17 param 0) (-> block param 0)) - (set! (-> a1-17 param 1) (-> block param 1)) - (set! (-> a1-17 param 2) (-> block param 2)) - (set! (-> a1-17 param 3) (-> block param 3)) - (set! (-> a1-17 param 4) (-> block param 4)) - (set! (-> a1-17 param 5) (-> block param 5)) - (send-event-function this a1-17) + (let ((s2-2 (penetrate->next-state this proc block f0-1))) + (when s2-2 + (logclear! (-> this enemy-flags) (enemy-flag use-trigger)) + (send-attack-to-all-tshapes this (the-as process-focusable proc) block) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) (process->ppointer proc)) + (set! (-> a1-17 num-params) argc) + (set! (-> a1-17 message) s2-2) + (set! (-> a1-17 param 0) (-> block param 0)) + (set! (-> a1-17 param 1) (-> block param 1)) + (set! (-> a1-17 param 2) (-> block param 2)) + (set! (-> a1-17 param 3) (-> block param 3)) + (set! (-> a1-17 param 4) (-> block param 4)) + (set! (-> a1-17 param 5) (-> block param 5)) + (send-event-function this a1-17) + ) + #t ) - #t ) ) ) @@ -2196,7 +2196,7 @@ ) ;; definition for method 65 of type enemy -(defmethod penetrate->next-state ((this enemy)) +(defmethod penetrate->next-state ((this enemy) (arg0 process) (arg1 event-message-block) (arg2 float)) (let ((gp-0 (-> this incoming penetrate-using))) (cond ((and (logtest? (penetrate jak-dark-blackhole) gp-0) #t) diff --git a/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc b/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc index 35984a2d05..c3ac66ec33 100644 --- a/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc @@ -74,7 +74,7 @@ ;; definition of type traffic-object-spawn-params (deftype traffic-object-spawn-params (structure) - ((object-type uint8) + ((object-type traffic-type) (behavior uint64) (id uint32) (nav-mesh nav-mesh) @@ -83,10 +83,10 @@ (rotation quaternion :inline) (velocity vector :inline) (handle handle) - (handle-parent uint64) + (handle-parent handle) (guard-type uint8) (user-data uint32) - (entity basic) + (entity entity) (flags traffic-spawn-flags) (proc process) ) @@ -183,7 +183,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/bouncer_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/bouncer_REF.gc index be7b2d0b7c..159073ebd1 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/bouncer_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/bouncer_REF.gc @@ -15,8 +15,8 @@ smush ) (:methods - (bouncer-method-23 (_type_) none) - (bouncer-method-24 (_type_) none) + (init-skel! (_type_) none) + (init-collision! (_type_) none) (play-sound (_type_) none) (bouncer-method-26 (_type_) none) ) @@ -230,7 +230,7 @@ ;; definition for method 23 of type bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-23 ((this bouncer)) +(defmethod init-skel! ((this bouncer)) (break!) 0 (none) @@ -238,7 +238,7 @@ ;; definition for method 24 of type bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 ((this bouncer)) +(defmethod init-collision! ((this bouncer)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) @@ -263,15 +263,11 @@ ;; definition for method 11 of type bouncer (defmethod init-from-entity! ((this bouncer) (arg0 entity-actor)) (set! (-> this mods) #f) - (bouncer-method-24 this) + (init-collision! this) (process-drawable-from-entity! this arg0) - (bouncer-method-23 this) + (init-skel! this) (nav-mesh-connect-from-ent this) (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) (set! (-> this use-alternate-jump?) (= (res-lump-value arg0 'behavior-type uint128 :time -1000000000.0) 1)) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc index c18ca54f44..dbda587fdb 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc @@ -119,13 +119,14 @@ ;; definition of type part-tracker (deftype part-tracker (process) - ((root trsqv) - (mat matrix :inline) - (offset vector :inline) + ((parent (pointer process) :override) + (root trsqv) + (mat matrix :inline) + (offset vector :inline) (userdata uint64) - (user-time time-frame 2) - (user-vector vector :inline) - (user-handle uint32 2 :offset 288) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle uint32 2 :offset 288) (part sparticle-launch-control) (callback (function part-tracker vector)) (linger-callback (function part-tracker vector)) diff --git a/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc index eb4c7d6ad8..fbb7f03ec4 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc @@ -662,3 +662,7 @@ (the-as (pointer guard-shot) (spawn-projectile guard-shot gp-0 arg0 *default-dead-pool*)) ) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/speech-manager_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/speech-manager_REF.gc new file mode 100644 index 0000000000..d54e7a1454 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/speech-manager_REF.gc @@ -0,0 +1,139 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type speech-instance +(deftype speech-instance (structure) + ((speech uint16) + (num-play-times int8) + (probability float) + ) + ) + +;; definition for method 3 of type speech-instance +(defmethod inspect ((this speech-instance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'speech-instance) + (format #t "~1Tspeech: ~D~%" (-> this speech)) + (format #t "~1Tnum-play-times: ~D~%" (-> this num-play-times)) + (format #t "~1Tprobability: ~f~%" (-> this probability)) + (label cfg-4) + this + ) + +;; definition of type speech-info +(deftype speech-info (structure) + ((speeches (array speech-instance)) + (flags speech-info-flag) + (play-time time-frame) + ) + ) + +;; definition for method 3 of type speech-info +(defmethod inspect ((this speech-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'speech-info) + (format #t "~1Tspeeches: ~A~%" (-> this speeches)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tplay-time: ~D~%" (-> this play-time)) + (label cfg-4) + this + ) + +;; definition for function mark-speech-played +(defun mark-speech-played ((arg0 speech-info) (arg1 int)) + (logior! (-> arg0 flags) (speech-info-flag si6 si7)) + (+! (-> arg0 speeches arg1 num-play-times) 1) + (let ((v0-0 (current-time))) + (set! (-> arg0 play-time) v0-0) + v0-0 + ) + ) + +;; definition for function speech-play +(defun speech-play ((arg0 (array speech-info)) (arg1 int) (arg2 (inline-array talker-speech-class)) (arg3 vector)) + (local-vars (v0-0 int)) + (let ((s1-0 (-> arg0 arg1)) + (v1-2 #xf4240) + (a1-1 0) + (s2-0 #f) + ) + (if (and (logtest? (-> s1-0 flags) (speech-info-flag si0)) (logtest? (-> s1-0 flags) (speech-info-flag si6))) + (return -1) + ) + (when (and (logtest? (-> s1-0 flags) (speech-info-flag si3)) (logtest? (-> s1-0 flags) (speech-info-flag si7))) + (set! s2-0 #t) + (set! s1-0 (-> arg0 (+ arg1 1))) + ) + (if (and (logtest? (-> s1-0 flags) (speech-info-flag si0)) (logtest? (-> s1-0 flags) (speech-info-flag si6))) + (return -1) + ) + (dotimes (a0-20 (-> s1-0 speeches length)) + (set! v1-2 (min (-> s1-0 speeches a0-20 num-play-times) v1-2)) + ) + (if (and (> v1-2 0) (logtest? (-> s1-0 flags) (speech-info-flag si4))) + (return -1) + ) + (dotimes (a0-26 (-> s1-0 speeches length)) + (if (< v1-2 (-> s1-0 speeches a0-26 num-play-times)) + (set! a1-1 (logior a1-1 (ash 1 a0-26))) + ) + ) + (let ((s0-0 0)) + (set! s0-0 (cond + ((logtest? (-> s1-0 flags) (speech-info-flag si5)) + (dotimes (v1-7 (-> s1-0 speeches length)) + (when (not (logtest? a1-1 (ash 1 v1-7))) + (set! s0-0 v1-7) + 0 + (goto cfg-45) + ) + ) + (label cfg-45) + s0-0 + ) + (else + (rand-vu-int-count-excluding (-> s1-0 speeches length) a1-1) + ) + ) + ) + (if (logtest? (-> s1-0 flags) (speech-info-flag si8)) + (set! arg2 *talker-speech*) + ) + (mark-speech-played s1-0 s0-0) + (talker-spawn-func (-> arg2 (-> s1-0 speeches s0-0 speech)) *entity-pool* arg3 (the-as region #f)) + (if s2-0 + (set-time! (-> arg0 arg1 play-time)) + ) + (return s0-0) + ) + ) + v0-0 + ) + +;; definition for function speeches-reset +(defun speeches-reset ((arg0 (array speech-info))) + (dotimes (v1-0 (-> arg0 length)) + (logclear! (-> arg0 v1-0 flags) (speech-info-flag si6)) + (set! (-> arg0 v1-0 play-time) 0) + ) + #f + ) + +;; definition for function speeches-debug-reset +(defun speeches-debug-reset ((arg0 (array speech-info))) + (dotimes (v1-0 (-> arg0 length)) + (logclear! (-> arg0 v1-0 flags) (speech-info-flag si6 si7)) + (set! (-> arg0 0 play-time) 0) + ) + #f + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc index bf62c018eb..ac7e7b1ca7 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc @@ -1927,7 +1927,7 @@ ;; definition for method 9 of type cpad-info (defmethod adjust-to-screen-flip ((this cpad-info)) (if (and (not (paused?)) (zero? (-> this number)) (-> *setting-control* user-current player-control-override)) - (override-player-controls) + (override-player-controls this) ) (when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! (-> this leftx) (- 255 (the-as int (-> this leftx)))) @@ -2226,3 +2226,7 @@ ;; failed to figure out what this is: (kmemclose) + + + + diff --git a/test/decompiler/reference/jak3/engine/game/settings-h_REF.gc b/test/decompiler/reference/jak3/engine/game/settings-h_REF.gc index a8ea297ae3..90592d09a4 100644 --- a/test/decompiler/reference/jak3/engine/game/settings-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/settings-h_REF.gc @@ -161,7 +161,7 @@ (borrow-hold-count uint32) (borrow-hold pair 3) (cloth symbol) - (player-control-override symbol) + (player-control-override cpad-info) (player-control-mask uint32) (gun-special-mode symbol) (airlock-command pair) diff --git a/test/decompiler/reference/jak3/engine/game/settings_REF.gc b/test/decompiler/reference/jak3/engine/game/settings_REF.gc index 5e0f503e4c..4a5bd3a0c2 100644 --- a/test/decompiler/reference/jak3/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/settings_REF.gc @@ -156,7 +156,7 @@ (set! (-> this mh-enemy-settings) (the-as symbol arg3)) ) (('player-control-override) - (set! (-> this player-control-override) (the-as symbol arg3)) + (set! (-> this player-control-override) (the-as cpad-info arg3)) ) (('player-control-mask) (set! (-> this player-control-mask) arg3) diff --git a/test/decompiler/reference/jak3/engine/gfx/mood/mood-funcs_REF.gc b/test/decompiler/reference/jak3/engine/gfx/mood/mood-funcs_REF.gc new file mode 100644 index 0000000000..3fd4aecd8e --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/mood/mood-funcs_REF.gc @@ -0,0 +1,1074 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function update-mood-default +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-default time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + 0 + (none) + ) + +;; definition for function update-mood-copy-parent +;; WARN: Return type mismatch int vs none. +(defun update-mood-copy-parent ((arg0 mood-context) (arg1 object) (arg2 int)) + (let* ((v1-3 (-> *level* level arg2)) + (a1-3 (-> v1-3 info memory-mode)) + ) + (when (or (or (= a1-3 (level-memory-mode borrow)) + (= a1-3 (level-memory-mode borrow0)) + (= a1-3 (level-memory-mode borrow1)) + (= a1-3 (level-memory-mode borrow2)) + (= a1-3 (level-memory-mode borrow3)) + (= a1-3 (level-memory-mode borrow4)) + (= a1-3 (level-memory-mode micro)) + (= a1-3 (level-memory-mode borrow-city-small)) + ) + (-> v1-3 borrow-from-level) + ) + (let ((v1-4 (-> v1-3 borrow-from-level))) + (if (and v1-4 (= (-> v1-4 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-4 mood-context)) 1968) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function get-sphere-interp +;; INFO: Used lq/sq +(defun get-sphere-interp ((arg0 sphere) (arg1 vector) (arg2 float) (arg3 float)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + 0.0 + (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-! v1-0 arg1 v1-0) + (let ((f1-0 (vector-length v1-0))) + (/ (fmax 0.0 (fmin (- f1-0 arg2) arg3)) arg3) + ) + ) + ) + +;; definition of type ctywide-states +(deftype ctywide-states (structure) + ((light light-state :inline) + (flame flames-state :inline) + ) + ) + +;; definition for method 3 of type ctywide-states +(defmethod inspect ((this ctywide-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctywide-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflame: #~%" (-> this flame)) + (label cfg-4) + this + ) + +;; definition for function update-mood-ctywide +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctywide time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 1 8 1.0 0.000390625 1.5) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-ctywide +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-ctywide time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((v1-1 (level-get *level* 'ctywide))) + (cond + ((and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + (else + (update-mood-ctywide arg0 arg1 arg2) + (if (or (>= arg1 18.0) (>= 6.0 arg1)) + (set! (-> arg0 times 5 w) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctysluma-states +(deftype ctysluma-states (structure) + ((light light-state :inline) + (flame flames-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) + (flicker float) + ) + ) + +;; definition for method 3 of type ctysluma-states +(defmethod inspect ((this ctysluma-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctysluma-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflame: #~%" (-> this flame)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) + (format #t "~1Tflicker: ~f~%" (-> this flicker)) + (label cfg-4) + this + ) + +;; definition for function init-mood-ctysluma +;; WARN: Return type mismatch sp-field-init-spec vs float. +(defun init-mood-ctysluma ((arg0 mood-context)) + (let ((gp-0 (-> arg0 state))) + (let ((a0-1 (-> *part-id-table* 2))) + (set! (-> gp-0 4) (the-as uint 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 4) (the-as uint (get-field-spec-by-id a0-1 (sp-field-id spt-a)))) + ) + ) + (let ((a0-2 (-> *part-id-table* 3))) + (set! (-> gp-0 5) (the-as uint 0)) + (the-as float (when (nonzero? a0-2) + (let ((v0-1 (get-field-spec-by-id a0-2 (sp-field-id spt-a)))) + (set! (-> gp-0 5) (the-as uint v0-1)) + v0-1 + ) + ) + ) + ) + ) + ) + +;; definition for function update-mood-ctysluma +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctysluma time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as ctysluma-states (-> arg0 state)))) + (update-mood-flames arg0 6 1 8 1.0 0.000390625 1.5) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> s5-1 spec-0)) + (set! (-> s5-1 spec-0 initial-valuef) (* 32.0 (-> s5-1 light fade))) + ) + (if (nonzero? (-> s5-1 spec-1)) + (set! (-> s5-1 spec-1 initial-valuef) (* 8.0 (-> s5-1 light fade))) + ) + (set! (-> arg0 times 7 w) (-> s5-1 flicker)) + (if (not (paused?)) + (set! (-> s5-1 flicker) (rand-vu-float-range 0.8 1.0)) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctyslumb-states +(deftype ctyslumb-states (structure) + ((light light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) + (flicker float) + ) + ) + +;; definition for method 3 of type ctyslumb-states +(defmethod inspect ((this ctyslumb-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctyslumb-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) + (format #t "~1Tflicker: ~f~%" (-> this flicker)) + (label cfg-4) + this + ) + +;; definition for function init-mood-ctyslumb +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-ctyslumb ((arg0 mood-context)) + (let ((gp-0 (-> arg0 state))) + (let ((a0-1 (-> *part-id-table* 4))) + (set! (-> gp-0 2) (the-as uint 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 2) (the-as uint (get-field-spec-by-id a0-1 (sp-field-id spt-a)))) + ) + ) + (let ((a0-2 (-> *part-id-table* 5))) + (set! (-> gp-0 3) (the-as uint 0)) + (the-as uint (when (nonzero? a0-2) + (let ((v0-1 (get-field-spec-by-id a0-2 (sp-field-id spt-a)))) + (set! (-> gp-0 3) (the-as uint v0-1)) + v0-1 + ) + ) + ) + ) + ) + ) + +;; definition for function update-mood-ctyslumb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyslumb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> (the-as ctyslumb-states s5-1) spec-0)) + (set! (-> (the-as ctyslumb-states s5-1) spec-0 initial-valuef) + (* 32.0 (-> (the-as ctyslumb-states s5-1) light fade)) + ) + ) + (if (nonzero? (-> (the-as ctyslumb-states s5-1) spec-1)) + (set! (-> (the-as ctyslumb-states s5-1) spec-1 initial-valuef) + (* 8.0 (-> (the-as ctyslumb-states s5-1) light fade)) + ) + ) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) (-> (the-as ctyslumb-states s5-1) flicker)) + (if (not (paused?)) + (set! (-> (the-as ctyslumb-states s5-1) flicker) (rand-vu-float-range 0.8 1.0)) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctyslumc-states +(deftype ctyslumc-states (structure) + ((light light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) + (flicker float) + ) + ) + +;; definition for method 3 of type ctyslumc-states +(defmethod inspect ((this ctyslumc-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctyslumc-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) + (format #t "~1Tflicker: ~f~%" (-> this flicker)) + (label cfg-4) + this + ) + +;; definition for function init-mood-ctyslumc +;; WARN: Return type mismatch sp-field-init-spec vs none. +(defun init-mood-ctyslumc ((arg0 mood-context)) + (let ((gp-0 (-> arg0 state))) + (let ((a0-1 (-> *part-id-table* 6))) + (set! (-> gp-0 2) (the-as uint 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 2) (the-as uint (get-field-spec-by-id a0-1 (sp-field-id spt-a)))) + ) + ) + (let ((a0-2 (-> *part-id-table* 7))) + (set! (-> gp-0 3) (the-as uint 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 3) (the-as uint (get-field-spec-by-id a0-2 (sp-field-id spt-a)))) + ) + ) + ) + (none) + ) + +;; definition for function update-mood-ctyslumc +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyslumc time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> (the-as ctyslumc-states s5-1) spec-0)) + (set! (-> (the-as ctyslumc-states s5-1) spec-0 initial-valuef) + (* 32.0 (-> (the-as ctyslumc-states s5-1) light fade)) + ) + ) + (if (nonzero? (-> (the-as ctyslumc-states s5-1) spec-1)) + (set! (-> (the-as ctyslumc-states s5-1) spec-1 initial-valuef) + (* 8.0 (-> (the-as ctyslumc-states s5-1) light fade)) + ) + ) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) (-> (the-as ctyslumc-states s5-1) flicker)) + (if (not (paused?)) + (set! (-> (the-as ctyslumc-states s5-1) flicker) (rand-vu-float-range 0.8 1.0)) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctygenb-states +(deftype ctygenb-states (structure) + ((light light-state :inline) + (flame flames-state :inline) + (flicker flicker-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) + (spec-2 sp-field-init-spec) + (spec-3 sp-field-init-spec) + (next-flicker float) + ) + ) + +;; definition for method 3 of type ctygenb-states +(defmethod inspect ((this ctygenb-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctygenb-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflame: #~%" (-> this flame)) + (format #t "~1Tflicker: #~%" (-> this flicker)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) + (format #t "~1Tspec-2: #~%" (-> this spec-2)) + (format #t "~1Tspec-3: #~%" (-> this spec-3)) + (format #t "~1Tnext-flicker: ~f~%" (-> this next-flicker)) + (label cfg-4) + this + ) + +;; definition for function init-mood-ctygenb +;; WARN: Return type mismatch sp-field-init-spec vs object. +(defun init-mood-ctygenb ((arg0 mood-context)) + (let ((gp-0 (-> arg0 state))) + (let ((a0-1 (-> *part-id-table* 8))) + (set! (-> gp-0 5) (the-as uint 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 5) (the-as uint (get-field-spec-by-id a0-1 (sp-field-id spt-a)))) + ) + ) + (let ((a0-2 (-> *part-id-table* 9))) + (set! (-> gp-0 6) (the-as uint 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 6) (the-as uint (get-field-spec-by-id a0-2 (sp-field-id spt-a)))) + ) + ) + (let ((a0-3 (-> *part-id-table* 10))) + (set! (-> gp-0 7) (the-as uint 0)) + (if (nonzero? a0-3) + (set! (-> gp-0 7) (the-as uint (get-field-spec-by-id a0-3 (sp-field-id spt-a)))) + ) + ) + (let ((a0-4 (-> *part-id-table* 11))) + (set! (-> gp-0 8) (the-as uint 0)) + (when (nonzero? a0-4) + (let ((v0-3 (get-field-spec-by-id a0-4 (sp-field-id spt-a)))) + (set! (-> gp-0 8) (the-as uint v0-3)) + v0-3 + ) + ) + ) + ) + ) + +;; definition for function update-mood-ctygenb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctygenb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 1 8 1.0 0.000390625 1.5) + (when (or (>= arg1 18.0) (>= 6.0 arg1)) + (update-mood-flicker arg0 7 15) + (let ((f1-2 (-> (the-as ctygenb-states gp-1) next-flicker)) + (f0-2 (-> arg0 times 7 w)) + ) + (set! (-> arg0 times 7 w) f1-2) + (if (nonzero? (-> (the-as ctygenb-states gp-1) spec-0)) + (set! (-> (the-as ctygenb-states gp-1) spec-0 initial-valuef) (* 40.0 f0-2)) + ) + (if (nonzero? (-> (the-as ctygenb-states gp-1) spec-1)) + (set! (-> (the-as ctygenb-states gp-1) spec-1 initial-valuef) (* 20.0 f0-2)) + ) + (if (nonzero? (-> (the-as ctygenb-states gp-1) spec-2)) + (set! (-> (the-as ctygenb-states gp-1) spec-2 initial-valuef) (* 20.0 f0-2)) + ) + (if (nonzero? (-> (the-as ctygenb-states gp-1) spec-3)) + (set! (-> (the-as ctygenb-states gp-1) spec-3 initial-valuef) (* 8.0 f0-2)) + ) + (set! (-> (the-as ctygenb-states gp-1) next-flicker) f0-2) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for symbol *mhcity-mood-fog-table*, type mood-fog-table +(define *mhcity-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 171.4687 :y 155.0 :z 58.125 :w 128.0) + :fog-dists (new 'static 'vector :y 819200.0 :z 240.0 :w 130.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 171.4687 :y 155.0 :z 58.125 :w 128.0) + :fog-dists (new 'static 'vector :y 819200.0 :z 240.0 :w 130.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 171.4687 :y 155.0 :z 58.125 :w 128.0) + :fog-dists (new 'static 'vector :y 819200.0 :z 240.0 :w 130.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 171.4687 :y 155.0 :z 58.125 :w 128.0) + :fog-dists (new 'static 'vector :y 819200.0 :z 240.0 :w 130.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 171.4687 :y 155.0 :z 58.125 :w 128.0) + :fog-dists (new 'static 'vector :y 819200.0 :z 240.0 :w 130.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 180.0 :y 179.0 :z 40.0 :w 128.0) + :fog-dists (new 'static 'vector :x 40960.0 :y 819200.0 :z 240.0 :w 165.5) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 180.0 :y 159.0 :z 50.0 :w 128.0) + :fog-dists (new 'static 'vector :x 40960.0 :y 819200.0 :z 240.0 :w 175.5) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 180.0 :y 179.0 :z 40.0 :w 128.0) + :fog-dists (new 'static 'vector :x 40960.0 :y 819200.0 :z 230.0 :w 165.5) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for function overide-mhcity-fog +(defun overide-mhcity-fog ((arg0 mood-context) (arg1 float) (arg2 int)) + (when (not (-> *time-of-day-context* overide-enable)) + (let* ((f30-0 (vector-vector-distance (target-pos 0) (new 'static 'vector :x -1072496.6 :y -22159.36 :z 4246978.5))) + (f0-0 (vector-vector-distance (target-pos 0) (new 'static 'vector :x -1118986.2 :y -30474.24 :z 3107348.5))) + (f0-5 (fmin + (fmax 0.0 (fmin 1.0 (* 0.0000032552084 (+ -1228800.0 f30-0)))) + (fmax 0.0 (fmin 1.0 (* 0.0000032552084 (+ -737280.0 f0-0)))) + ) + ) + ) + (overide-mood-fog arg0 arg1 (the-as int *mhcity-mood-fog-table*) f0-5) + ) + ) + (none) + ) + +;; definition of type mhcitya-states +(deftype mhcitya-states (structure) + ((pulse pulse-state :inline) + ) + ) + +;; definition for method 3 of type mhcitya-states +(defmethod inspect ((this mhcitya-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mhcitya-states) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (label cfg-4) + this + ) + +;; definition for function init-mood-mhcitya +;; WARN: Return type mismatch float vs object. +(defun init-mood-mhcitya ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 2) (the-as uint 1.0)) + (let ((f0-1 1.0)) + (set! (-> v1-0 1) (the-as uint f0-1)) + f0-1 + ) + ) + ) + +;; definition for function update-mood-mhcitya +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-mhcitya time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((s5-0 arg2)) + (copy-mood-exterior arg0) + (overide-mhcity-fog arg0 arg1 arg2) + (when (and (= (-> *level* level s5-0 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (set! (-> arg0 times 5 w) 1.0) + (update-mood-pulse arg0 6 0 0.75 0.25 (* 32768.0 (seconds-per-frame)) 0.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; definition of type mhcityb-states +(deftype mhcityb-states (structure) + ((pulse pulse-state :inline) + ) + ) + +;; definition for method 3 of type mhcityb-states +(defmethod inspect ((this mhcityb-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mhcityb-states) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (label cfg-4) + this + ) + +;; definition for function init-mood-mhcityb +;; WARN: Return type mismatch float vs object. +(defun init-mood-mhcityb ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 2) (the-as uint 1.0)) + (let ((f0-1 1.0)) + (set! (-> v1-0 1) (the-as uint f0-1)) + f0-1 + ) + ) + ) + +;; definition for function update-mood-mhcityb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-mhcityb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((s5-0 arg2)) + (copy-mood-exterior arg0) + (overide-mhcity-fog arg0 arg1 arg2) + (when (and (= (-> *level* level s5-0 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (set! (-> arg0 times 5 w) 1.0) + (update-mood-pulse arg0 6 0 0.75 0.25 (* 32768.0 (seconds-per-frame)) 0.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; definition for function calc-lmhcity-palettes +(defun calc-lmhcity-palettes ((arg0 mood-context)) + (let ((v1-3 (mod (-> *display* part-clock frame-counter) 4800))) + (dotimes (a1-1 8) + (let* ((a2-1 (* 600 a1-1)) + (a3-0 (+ a2-1 1200)) + ) + (cond + ((= a1-1 7) + (if (< v1-3 (mod a3-0 4800)) + (set! (-> arg0 times a1-1 w) (- 1.0 (* 0.0016666667 (the float v1-3)))) + ) + (if (< a2-1 v1-3) + (set! (-> arg0 times a1-1 w) (* 0.0016666667 (the float (- v1-3 a2-1)))) + ) + ) + (else + (when (and (< v1-3 a3-0) (< a2-1 v1-3)) + (let ((f0-5 (* 0.0016666667 (the float (- v1-3 a2-1))))) + (if (< 1.0 f0-5) + (set! (-> arg0 times a1-1 w) (- 2.0 f0-5)) + (set! (-> arg0 times a1-1 w) f0-5) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +;; definition for function update-mood-lmhcitya +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-lmhcitya time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (overide-mhcity-fog arg0 arg1 arg2) + (if (< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + (calc-lmhcity-palettes arg0) + ) + 0 + (none) + ) + +;; definition for function update-mood-lmhcityb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-lmhcityb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (overide-mhcity-fog arg0 arg1 arg2) + (if (< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + (calc-lmhcity-palettes arg0) + ) + 0 + (none) + ) + +;; definition of type ctyport-states +(deftype ctyport-states (structure) + ((light light-state :inline) + (spec-0 sp-field-init-spec) + (neon-min-bright float) + ) + ) + +;; definition for method 3 of type ctyport-states +(defmethod inspect ((this ctyport-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctyport-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tneon-min-bright: ~f~%" (-> this neon-min-bright)) + (label cfg-4) + this + ) + +;; definition for symbol *ctyport-level*, type level +(define *ctyport-level* (the-as level #f)) + +;; definition for function update-mood-ctyport +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyport time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((s4-0 arg2)) + (copy-mood-exterior arg0) + (overide-mhcity-fog arg0 arg1 arg2) + (when (and (!= s4-0 -1) + (= (-> *level* level s4-0 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; definition for function reset-marquee-color! +;; WARN: Return type mismatch vector vs none. +(defun reset-marquee-color! () + (set! *ctyport-level* (level-get *level* 'ctyport)) + (if *ctyport-level* + (set-vector! (-> *ctyport-level* mood-context times 6) 0.0 0.0 0.0 1.0) + ) + (none) + ) + +;; definition for function add-marquee-color! +;; WARN: Return type mismatch float vs none. +(defun add-marquee-color! ((arg0 float) (arg1 float) (arg2 float)) + (when *ctyport-level* + (let ((v1-2 (-> *ctyport-level* mood-context))) + (+! (-> v1-2 times 6 x) arg0) + (+! (-> v1-2 times 6 y) arg1) + (+! (-> v1-2 times 6 z) arg2) + ) + ) + (none) + ) + +;; definition of type ctymarka-states +(deftype ctymarka-states (structure) + ((light light-state :inline) + (blink float) + ) + ) + +;; definition for method 3 of type ctymarka-states +(defmethod inspect ((this ctymarka-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctymarka-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tblink: ~f~%" (-> this blink)) + (label cfg-4) + this + ) + +;; definition for function update-mood-ctymarka +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctymarka time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (-> arg0 state))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (the-as float (-> gp-1 2))) + (set! (-> arg0 times 7 w) 0.75) + (when (not (paused?)) + (let ((v1-11 (-> *display* part-clock frame-counter))) + (if (< (* 0.2 (the float (mod v1-11 600))) 60.0) + (set! (-> gp-1 2) (the-as uint 0.0)) + (set! (-> gp-1 2) (the-as uint 1.0)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type mountain-states +(deftype mountain-states (structure) + ((light0 light-state :inline) + (light1 light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) + (spec-2 sp-field-init-spec) + (spec-3 sp-field-init-spec) + (spec-4 sp-field-init-spec) + (spec-5 sp-field-init-spec) + (spec-6 sp-field-init-spec) + ) + ) + +;; definition for method 3 of type mountain-states +(defmethod inspect ((this mountain-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mountain-states) + (format #t "~1Tlight0: #~%" (-> this light0)) + (format #t "~1Tlight1: #~%" (-> this light1)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) + (format #t "~1Tspec-2: #~%" (-> this spec-2)) + (format #t "~1Tspec-3: #~%" (-> this spec-3)) + (format #t "~1Tspec-4: #~%" (-> this spec-4)) + (format #t "~1Tspec-5: #~%" (-> this spec-5)) + (format #t "~1Tspec-6: #~%" (-> this spec-6)) + (label cfg-4) + this + ) + +;; definition for function init-mood-mountain +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-mountain ((arg0 mood-context)) + (let ((gp-0 (-> arg0 state))) + (let ((a0-1 (-> *part-id-table* 12))) + (set! (-> gp-0 4) (the-as uint 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 4) (the-as uint (get-field-spec-by-id a0-1 (sp-field-id spt-a)))) + ) + ) + (let ((a0-2 (-> *part-id-table* 13))) + (set! (-> gp-0 5) (the-as uint 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 5) (the-as uint (get-field-spec-by-id a0-2 (sp-field-id spt-a)))) + ) + ) + (let ((a0-3 (-> *part-id-table* 14))) + (set! (-> gp-0 6) (the-as uint 0)) + (if (nonzero? a0-3) + (set! (-> gp-0 6) (the-as uint (get-field-spec-by-id a0-3 (sp-field-id spt-a)))) + ) + ) + (let ((a0-4 (-> *part-id-table* 15))) + (set! (-> gp-0 7) (the-as uint 0)) + (if (nonzero? a0-4) + (set! (-> gp-0 7) (the-as uint (get-field-spec-by-id a0-4 (sp-field-id spt-a)))) + ) + ) + (let ((a0-5 (-> *part-id-table* 16))) + (set! (-> gp-0 8) (the-as uint 0)) + (if (nonzero? a0-5) + (set! (-> gp-0 8) (the-as uint (get-field-spec-by-id a0-5 (sp-field-id spt-a)))) + ) + ) + (let ((a0-6 (-> *part-id-table* 17))) + (set! (-> gp-0 9) (the-as uint 0)) + (if (nonzero? a0-6) + (set! (-> gp-0 9) (the-as uint (get-field-spec-by-id a0-6 (sp-field-id spt-a)))) + ) + ) + (let ((a0-7 (-> *part-id-table* 18))) + (set! (-> gp-0 10) (the-as uint 0)) + (the-as uint (when (nonzero? a0-7) + (let ((v0-6 (get-field-spec-by-id a0-7 (sp-field-id spt-a)))) + (set! (-> gp-0 10) (the-as uint v0-6)) + v0-6 + ) + ) + ) + ) + ) + ) + +;; definition for function update-mood-mountain +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-mountain time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 0.875 0.25 2.0 0.0 1.0) + (update-mood-light arg0 6 8 1.0 0.0 arg1 0.0 1.0) + (set! (-> arg0 times 7 w) 1.0) + (let* ((f0-1 (-> arg0 times 5 w)) + (f1-1 (* 24.0 f0-1)) + (f0-2 (* 20.0 f0-1)) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-0)) + (set! (-> (the-as mountain-states gp-1) spec-0 initial-valuef) f1-1) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-1)) + (set! (-> (the-as mountain-states gp-1) spec-1 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-2)) + (set! (-> (the-as mountain-states gp-1) spec-2 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-3)) + (set! (-> (the-as mountain-states gp-1) spec-3 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-4)) + (set! (-> (the-as mountain-states gp-1) spec-4 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-5)) + (set! (-> (the-as mountain-states gp-1) spec-5 initial-valuef) f0-2) + ) + (if (nonzero? (-> (the-as mountain-states gp-1) spec-6)) + (set! (-> (the-as mountain-states gp-1) spec-6 initial-valuef) f0-2) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctyinda-states +(deftype ctyinda-states (structure) + ((light light-state :inline) + ) + ) + +;; definition for method 3 of type ctyinda-states +(defmethod inspect ((this ctyinda-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctyinda-states) + (format #t "~1Tlight: #~%" (-> this light)) + (label cfg-4) + this + ) + +;; definition for function update-mood-ctyinda +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyinda time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (set! (-> arg0 times 6 w) 1.0) + (let ((f0-1 0.5)) + (let ((f1-0 1.0)) + (cond + ((or (>= 6.0 arg1) (>= arg1 18.0)) + (set! f0-1 f1-0) + ) + ((and (< 6.0 arg1) (< arg1 7.0)) + (+! f0-1 (* (- f1-0 f0-1) (- 7.0 arg1))) + ) + ((and (< 17.0 arg1) (< arg1 18.0)) + (+! f0-1 (* (- f1-0 f0-1) (+ -17.0 arg1))) + ) + ) + ) + (set! (-> arg0 times 7 w) f0-1) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + ) + 0 + (none) + ) + +;; definition of type ctyindb-states +(deftype ctyindb-states (structure) + ((light light-state :inline) + (flicker float) + ) + ) + +;; definition for method 3 of type ctyindb-states +(defmethod inspect ((this ctyindb-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctyindb-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflicker: ~f~%" (-> this flicker)) + (label cfg-4) + this + ) + +;; definition for function update-mood-ctyindb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyindb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (-> arg0 state))) + (set! (-> arg0 times 6 w) 1.0) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 7 w) (the-as float (-> s4-1 2))) + (if (not (paused?)) + (set! (-> s4-1 2) (the-as uint (rand-vu-float-range 0.8 1.0))) + ) + ) + ) + 0 + (none) + ) + +;; definition of type atoll-states +(deftype atoll-states (structure) + ((light light-state :inline) + (explosion float) + ) + ) + +;; definition for method 3 of type atoll-states +(defmethod inspect ((this atoll-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'atoll-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Texplosion: ~f~%" (-> this explosion)) + (label cfg-4) + this + ) + +;; definition for function init-mood-atoll +(defun init-mood-atoll ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state)) + (f0-0 0.0) + ) + (set! (-> v1-0 2) (the-as uint f0-0)) + f0-0 + ) + ) + +;; definition for function update-mood-atoll +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-atoll time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 7 w) (-> (the-as atoll-states s4-1) explosion)) + (if (not (paused?)) + (seek! (-> (the-as atoll-states s4-1) explosion) 0.0 (* 2.0 (seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-atoll-explosion! +(defun set-atoll-explosion! ((arg0 float)) + (let ((v1-1 (level-get *level* 'atoll))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state)) + (f0-0 arg0) + ) + (set! (-> v1-2 2) (the-as uint f0-0)) + f0-0 + ) + ) + ) + ) + +;; definition for function update-mood-atollext +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-atollext time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior-ambi arg0 #t) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (set-vector! (-> arg0 times 1) 1.0 1.0 1.0 1.0) + (set! (-> arg0 times 2 w) 0.0) + (set! (-> arg0 times 3 w) 0.0) + (set! (-> arg0 times 4 w) 0.0) + (set! (-> arg0 times 5 w) 0.0) + (set! (-> arg0 times 6 w) 0.0) + (set! (-> arg0 times 7 w) 0.0) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc b/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc index 594dfef8e8..71cd9bb716 100644 --- a/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc @@ -69,7 +69,7 @@ ;; definition for function matrix-u-r-compose ;; INFO: Used lq/sq -(defun matrix-u-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) +(defun matrix-u-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) (set! (-> arg0 uvec quad) (-> arg1 quad)) (vector-cross! (-> arg0 fvec) arg2 arg1) (vector-normalize! (-> arg0 fvec) 1.0) @@ -126,3 +126,7 @@ ) arg0 ) + + + + diff --git a/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc index 96446c8e7d..28489aeb66 100644 --- a/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc @@ -789,16 +789,16 @@ ;; definition for function quaternion-smooth-seek! (defun quaternion-smooth-seek! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) "Another hacky rotation interpolation." - (let ((gp-0 (new 'stack-no-clear 'quaternion))) - (quaternion-copy! (the-as quaternion (&-> gp-0 x)) arg2) - (if (< (quaternion-dot (the-as quaternion (&-> gp-0 x)) arg1) 0.0) - (quaternion-negate! (the-as quaternion (&-> gp-0 x)) (the-as quaternion (&-> gp-0 x))) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (quaternion-copy! (-> gp-0 0) arg2) + (if (< (quaternion-dot (-> gp-0 0) arg1) 0.0) + (quaternion-negate! (-> gp-0 0) (-> gp-0 0)) ) - (quaternion-! (&+ gp-0 16) (the-as quaternion (&-> gp-0 x)) arg1) - (quaternion-float*! (&+ gp-0 16) (&+ gp-0 16) (fmin 1.0 arg3)) - (quaternion+! (the-as quaternion (&-> gp-0 x)) arg1 (&+ gp-0 16)) - (quaternion-normalize! (the-as quaternion (&-> gp-0 x))) - (quaternion-copy! arg0 (the-as quaternion (&-> gp-0 x))) + (quaternion-! (-> gp-0 1) (-> gp-0 0) arg1) + (quaternion-float*! (-> gp-0 1) (-> gp-0 1) (fmin 1.0 arg3)) + (quaternion+! (-> gp-0 0) arg1 (-> gp-0 1)) + (quaternion-normalize! (-> gp-0 0)) + (quaternion-copy! arg0 (-> gp-0 0)) ) ) @@ -1086,3 +1086,7 @@ (vector-y-angle s5-0) ) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc index 8474f68ee8..3ba24b2d54 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc @@ -175,6 +175,8 @@ debug-control ) (:methods + (init-enemy-info! (_type_ nav-enemy-info) none :replace) + (init-enemy-defaults! (_type_ nav-enemy-info) object :replace) (normalize-heading! (_type_ nav-control) none) (nav-enemy-method-161 (_type_ nav-control) none) (nav-enemy-method-162 (_type_) none) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc index de8b519df4..2e4966cccd 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc @@ -668,9 +668,9 @@ ;; definition for method 118 of type nav-enemy ;; WARN: Return type mismatch float vs none. -(defmethod init-enemy-info! ((this nav-enemy) (arg0 enemy-info)) - (set! (-> this enemy-info) (the-as nav-enemy-info arg0)) - (set! (-> (the-as nav-enemy-info arg0) callback-info) *default-nav-callback-info*) +(defmethod init-enemy-info! ((this nav-enemy) (arg0 nav-enemy-info)) + (set! (-> this enemy-info) arg0) + (set! (-> arg0 callback-info) *default-nav-callback-info*) (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) (set! (-> this neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) this (-> this enemy-info neck-joint)) @@ -687,8 +687,8 @@ ;; definition for method 119 of type nav-enemy ;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-defaults! ((this nav-enemy) (arg0 enemy-info)) +;; WARN: Return type mismatch int vs object. +(defmethod init-enemy-defaults! ((this nav-enemy) (arg0 nav-enemy-info)) (local-vars (sv-16 res-tag)) (rlet ((acc :class vf) (vf0 :class vf) @@ -732,7 +732,7 @@ ) (set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) ) - (get-nav-control this (-> (the-as nav-enemy-info arg0) nav-mesh)) + (get-nav-control this (-> arg0 nav-mesh)) (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) (let ((v1-32 this)) (set! (-> v1-32 enemy-flags) (the-as enemy-flag (logclear (-> v1-32 enemy-flags) (enemy-flag ef37)))) @@ -906,7 +906,6 @@ (set! (-> this draw light-index) (the-as uint 10)) ) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak3/engine/physics/rigid-body-h_REF.gc b/test/decompiler/reference/jak3/engine/physics/rigid-body-h_REF.gc index 656bab19ec..3e62544f20 100644 --- a/test/decompiler/reference/jak3/engine/physics/rigid-body-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/rigid-body-h_REF.gc @@ -194,7 +194,7 @@ (rigid-body-control-method-22 (_type_ vector vector) none) (rigid-body-control-method-23 (_type_ vector vector) none) (rigid-body-control-method-24 (_type_ vector vector) none) - (rigid-body-control-method-25 (_type_ vector) none) + (rigid-body-control-method-25 (_type_ vector) vector) (rigid-body-control-method-26 (_type_) none) (init! (_type_ rigid-body-info vector quaternion (function rigid-body-object float)) none) (rigid-body-control-method-28 (_type_ vector quaternion) none) @@ -277,7 +277,7 @@ active ) (:methods - (rigid-body-object-method-30 (_type_) none) + (rigid-body-object-method-30 (_type_) object) (apply-gravity! (_type_ float) none) (rigid-body-object-method-32 (_type_) none) (alloc-rbody-control! (_type_ rigid-body-object-constants) none) diff --git a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc index 60597c39b0..e7293aec4a 100644 --- a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc @@ -863,13 +863,12 @@ ) ;; definition for method 25 of type rigid-body-control -;; WARN: Return type mismatch vector vs none. (defmethod rigid-body-control-method-25 ((this rigid-body-control) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-rotate*! gp-0 (-> this info cm-offset-joint) (-> this matrix)) (vector-! arg0 (-> this position) gp-0) ) - (none) + arg0 ) ;; definition for method 30 of type rigid-body-control @@ -1140,11 +1139,10 @@ ) ;; definition for method 30 of type rigid-body-object -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod rigid-body-object-method-30 ((this rigid-body-object)) (ja-post) 0 - (none) ) ;; definition for method 39 of type rigid-body-object diff --git a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc index af84e34855..ed00ac5d44 100644 --- a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc @@ -145,7 +145,7 @@ O(n^2) 'check everybody against everybody' collision loop." (update-from-spheres (_type_) none) (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none) (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol) - (add-sphere-with-mask-and-id (_type_ vector int int) symbol) + (add-sphere-with-mask-and-id (_type_ vector vector float int) symbol) (sphere-hash-method-32 (_type_ sphere int) symbol) ) ) @@ -215,7 +215,7 @@ O(n^2) 'check everybody against everybody' collision loop." (fill-actor-list-for-box (_type_ vector (pointer collide-shape) int) int) (fill-actor-list-for-sphere (_type_ vector vector float (pointer collide-shape) int int) int) (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int) - (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int) + (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape)) int) (spatial-hash-method-39 (_type_ object hash-object-info) int) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc index 5c3851522f..7fbcaab61c 100644 --- a/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc @@ -1344,7 +1344,7 @@ (let ((s5-1 (the-as object (-> arg3 param 1)))) (when (not (the-as uint s5-1)) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 object-type) (traffic-type guard-a)) (set! (-> s4-0 behavior) (the-as uint 4)) (set! (-> s4-0 id) (the-as uint 0)) (set! (-> s4-0 nav-mesh) #f) diff --git a/test/decompiler/reference/jak3/levels/city/bombbot/bombbot-h_REF.gc b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot-h_REF.gc new file mode 100644 index 0000000000..33a8419e72 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot-h_REF.gc @@ -0,0 +1,55 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bombbot-node +(deftype bombbot-node (structure) + ((position vector :inline) + (nav-mesh-id uint32) + (pos-x float :overlay-at (-> position data 0)) + (pos-y float :overlay-at (-> position data 1)) + (pos-z float :overlay-at (-> position data 2)) + ) + ) + +;; definition for method 3 of type bombbot-node +(defmethod inspect ((this bombbot-node)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bombbot-node) + (format #t "~1Tposition: ~`vector`P~%" (-> this position)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> this nav-mesh-id)) + (format #t "~1Tpos-x: ~f~%" (-> this position x)) + (format #t "~1Tpos-y: ~f~%" (-> this position y)) + (format #t "~1Tpos-z: ~f~%" (-> this position z)) + (label cfg-4) + this + ) + +;; definition of type bombbot-path +(deftype bombbot-path (structure) + ((node-count uint16) + (node (inline-array bombbot-node)) + ) + ) + +;; definition for method 3 of type bombbot-path +(defmethod inspect ((this bombbot-path)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bombbot-path) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tnode: #x~X~%" (-> this node)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/city/bombbot/bombbot-path_REF.gc b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot-path_REF.gc new file mode 100644 index 0000000000..8c01e3d706 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot-path_REF.gc @@ -0,0 +1,330 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *bombbot-path-1*, type bombbot-path +(define *bombbot-path-1* (new 'static 'bombbot-path + :node-count #x1a + :node (new 'static 'inline-array bombbot-node 26 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3188752.0 :y 36837.375 :z 4562738.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3368644.2 :y 38390.58 :z 4564130.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3344854.8 :y 37134.336 :z 4787486.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3156208.8 :y 36825.906 :z 4910489.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3129548.5 :y 21854.617 :z 4974263.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3042602.5 :y 21854.617 :z 5196430.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3041685.0 :y 23431.578 :z 5524438.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2993126.5 :y 37686.887 :z 5613157.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2495119.0 :y 35662.645 :z 5980937.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2339598.0 :y 21355.725 :z 6003916.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2262150.2 :y 59038.105 :z 5923388.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2180239.0 :y 35246.08 :z 5821602.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1952091.8 :y 35853.516 :z 5631917.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1751604.9 :y 35736.37 :z 5485034.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1448083.0 :y 35713.023 :z 5357034.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1314705.0 :y 35742.105 :z 5355600.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1213759.1 :y 35739.24 :z 5574696.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1029807.7 :y 21646.541 :z 5602098.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 859164.25 :y 35728.18 :z 5558681.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 599088.75 :y 35690.496 :z 5614919.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 425897.56 :y 21671.936 :z 5574573.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 319768.56 :y 35787.57 :z 5516492.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 198957.06 :y 35702.375 :z 5363874.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -16781.72 :y 35688.86 :z 5447925.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -171277.92 :y 35687.63 :z 5526486.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -245257.83 :y 35740.47 :z 5498510.0) + :nav-mesh-id #x48cc + ) + ) + ) + ) + +;; definition for symbol *bombbot-path-2*, type bombbot-path +(define *bombbot-path-2* (new 'static 'bombbot-path + :node-count #x13 + :node (new 'static 'inline-array bombbot-node 19 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 678289.0 :y 75894.375 :z 7158250.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 456621.66 :y 38754.305 :z 7149895.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 306988.66 :y 35926.426 :z 7006288.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 90236.11 :y 35590.965 :z 6990314.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -12922.471 :y 37856.05 :z 7003176.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -181574.86 :y 38684.67 :z 6889676.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -353365.2 :y 38691.227 :z 6788505.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -536272.5 :y 38694.91 :z 6712606.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -716230.25 :y 38694.91 :z 6647766.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -971501.2 :y 35638.887 :z 6573997.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -944987.75 :y 39357.234 :z 6461029.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -891641.44 :y 35729.0 :z 6265159.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -728891.0 :y 22151.578 :z 6013049.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -691502.7 :y 58701.414 :z 5967584.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -663629.44 :y 59321.14 :z 5927321.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -627445.4 :y 36782.9 :z 5872270.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -499105.38 :y 39462.91 :z 5756435.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -312820.12 :y 39460.863 :z 5599559.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -285647.66 :y 35911.68 :z 5513133.5) + :nav-mesh-id #x48cc + ) + ) + ) + ) + +;; definition for symbol *bombbot-path-3*, type bombbot-path +(define *bombbot-path-3* (new 'static 'bombbot-path + :node-count #x1e + :node (new 'static 'inline-array bombbot-node 30 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 898383.44 :y 75904.2 :z 7154400.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1118834.2 :y 37430.066 :z 7158537.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1231044.2 :y 35595.06 :z 7033977.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1379135.1 :y 35604.89 :z 6973930.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1589264.0 :y 38142.363 :z 7005346.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1762479.8 :y 38840.32 :z 6881197.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1929727.6 :y 38840.32 :z 6786538.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2108796.0 :y 38839.91 :z 6696426.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2299584.0 :y 38838.68 :z 6626221.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2481209.0 :y 38954.598 :z 6580919.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2566069.8 :y 35751.527 :z 6524190.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2466766.5 :y 35799.86 :z 6277282.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2411699.5 :y 21411.84 :z 6167714.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2305486.5 :y 27477.197 :z 5986835.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2269335.2 :y 58792.754 :z 5942926.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2240413.0 :y 59187.2 :z 5908069.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2206146.2 :y 38379.52 :z 5861088.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2025377.4 :y 35845.734 :z 5707038.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1818201.8 :y 35773.234 :z 5546884.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1670160.0 :y 35714.664 :z 5444770.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1417973.4 :y 35841.23 :z 5324144.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1311366.8 :y 35716.71 :z 5391236.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1236283.0 :y 39460.863 :z 5595545.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 915504.75 :y 39461.273 :z 5583134.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 672419.44 :y 39462.504 :z 5586779.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 337580.03 :y 39460.863 :z 5599272.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 211252.02 :y 39461.273 :z 5322137.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -17915.904 :y 39462.504 :z 5413191.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -151299.28 :y 35697.05 :z 5497281.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -220205.47 :y 35749.477 :z 5472501.0) + :nav-mesh-id #x48cc + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc new file mode 100644 index 0000000000..1f9533116a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc @@ -0,0 +1,5543 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *bombbot-hint*, type sound-id +(define *bombbot-hint* (the-as sound-id 1)) + +;; definition for symbol *bombbot-hint-time*, type float +(define *bombbot-hint-time* 0.0) + +;; definition of type bombbot-hud +(deftype bombbot-hud (hud) + () + ) + +;; definition for method 3 of type bombbot-hud +(defmethod inspect ((this bombbot-hud)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type bombbot-hud +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this bombbot-hud)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + 256 + (+ (the int (* 50.0 (-> this offset))) 376) + ) + (set! (-> this sprites 0 pos z) #xfffff0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 62 -9) + (set! (-> this sprites 1 pos z) #xfffff0) + (let ((f0-4 (* 0.01 (the float (-> this values 0 current))))) + (set! (-> this sprites 1 color x) 0) + (set! (-> this sprites 1 color y) 0) + (set! (-> this sprites 1 color z) 0) + (set! (-> this sprites 1 scale-x) (* -30.5 (- 1.0 f0-4))) + ) + (set! (-> this sprites 1 scale-y) 4.8) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type bombbot-hud +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this bombbot-hud)) + (set! (-> this values 0 target) (the int (-> *game-info* health-bar))) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type bombbot-hud +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this bombbot-hud)) + (set! (-> this level) (level-get *level* 'lbombbot)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #x950))) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture common-white common))) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 5.0) + 0 + (none) + ) + +;; definition for symbol *bombbot-body-constants*, type rigid-body-object-constants +(define *bombbot-body-constants* (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.8 + :angular-damping 0.8 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2) (meters 2) (meters 2)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.02 + :gravity (meters 10) + :idle-distance (meters 200) + :attack-force-scale 2.0 + ) + :name '*bombbot-body-constants* + ) + ) + +;; failed to figure out what this is: +(defpart 2055 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y :copy scale-x) + (:r 196.0 128.0) + (:g 196.0 128.0) + (:b 196.0 128.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2056 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 40)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 2057 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2058 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2059 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:birth-func 'birth-func-laser-pointer) + (:num 1.0) + (:scale-x (meters 0.15) (meters 0.1)) + (:scale-y (meters 40)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 64.0 32.0) + (:fade-a -4.266667) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x401a00 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + #x403900 + ) + ) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpart 2060 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.05)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 100.0 28.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2061 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b 32.0 32.0) + (:a 32.0 32.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2062 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g :copy r) + (:b 128.0 64.0) + (:a 96.0 32.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-bombbot-bomb-warning-glow + :id 525 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2063 :flags (sp6)) (sp-item 2064 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2063 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 1361.25)) + (:fade-a -0.32) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 2064 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 32.0) + (:omega (degrees 1361.25)) + (:fade-a -0.64) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-bombbot-bomb bombbot-bomb bombbot-bomb-lod0-jg bombbot-bomb-idle-ja + ((bombbot-bomb-lod0-mg (meters 20)) (bombbot-bomb-lod1-mg (meters 40)) (bombbot-bomb-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :shadow bombbot-bomb-shadow-mg + ) + +;; definition of type bombbot-bomb +(deftype bombbot-bomb (process-focusable) + ((parent (pointer process-focusable) :override) + (root collide-shape-moving :override) + (explode-part sparticle-launch-control) + (rot-axis vector :inline) + (rot-angle float) + (warning-glow-part sparticle-launch-control) + (next-countdown-tick time-frame) + (fizzle-timer time-frame) + ) + (:state-methods + idle + smoke + explode + back + ) + (:methods + (bombbot-bomb-method-32 (_type_) none) + (bombbot-bomb-method-33 (_type_) none) + ) + ) + +;; definition for method 3 of type bombbot-bomb +(defmethod inspect ((this bombbot-bomb)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Texplode-part: ~A~%" (-> this explode-part)) + (format #t "~2Trot-axis: #~%" (-> this rot-axis)) + (format #t "~2Trot-angle: ~f~%" (-> this rot-angle)) + (format #t "~2Twarning-glow-part: ~A~%" (-> this warning-glow-part)) + (format #t "~2Tnext-countdown-tick: ~D~%" (-> this next-countdown-tick)) + (format #t "~2Tfizzle-timer: ~D~%" (-> this fizzle-timer)) + (label cfg-4) + this + ) + +;; definition for method 32 of type bombbot-bomb +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-bomb-method-32 ((this bombbot-bomb)) + (local-vars (at-0 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> this root))) + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-0 (-> s5-0 root-prim))) + (set! (-> a1-0 start-pos quad) (-> s5-0 trans quad)) + (let ((a0-2 (-> a1-0 move-dist))) + (.lvf vf1 (&-> (-> s5-0 transv) quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-2 quad) vf1) + ) + (let ((a0-3 a1-0)) + (set! (-> a0-3 radius) (-> v1-0 prim-core world-sphere w)) + (set! (-> a0-3 collide-with) (-> v1-0 prim-core collide-with)) + (set! (-> a0-3 ignore-process0) this) + (set! (-> a0-3 ignore-process1) #f) + (set! (-> a0-3 ignore-pat) (-> s5-0 pat-ignore-mask)) + (set! (-> a0-3 action-mask) (collide-action solid)) + ) + ) + (fill-using-line-sphere *collide-cache* a1-0) + ) + (integrate-and-collide! s5-0 (-> s5-0 transv)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector-cross! s5-1 (-> this root transv) *y-vector*) + (vector-normalize! s5-1 1.0) + (set! (-> this rot-axis quad) (-> s5-1 quad)) + ) + (let ((s5-2 (new 'stack-no-clear 'quaternion))) + (new 'stack-no-clear 'vector) + (quaternion-vector-angle! s5-2 (-> this rot-axis) (* (-> this rot-angle) (seconds-per-frame))) + (quaternion-normalize! s5-2) + (quaternion*! (-> this root quat) s5-2 (-> this root quat)) + ) + (quaternion-normalize! (-> this root quat)) + (let ((a1-6 (-> this root))) + (when (logtest? (-> a1-6 status) (collide-status touch-surface)) + (let ((a0-14 (-> a1-6 transv))) + (let ((v1-20 (-> a1-6 transv))) + (let ((a1-7 (-> a1-6 transv))) + (let ((a2-8 (* -15.0 (seconds-per-frame)))) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-7 quad)) + ) + (.lvf vf4 (&-> v1-20 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 (&-> a0-14 quad) vf6) + ) + (set! (-> this rot-angle) (* -4.0 (vector-length (-> this root transv)))) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 33 of type bombbot-bomb +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-bomb-method-33 ((this bombbot-bomb)) + (let ((s5-0 (- (current-time) (-> this state-time)))) + (when (< (seconds 7) s5-0) + (let ((f0-0 (rand-vu-float-range 0.5 0.8))) + (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) + ) + ) + (if (< (seconds 9) s5-0) + (go (method-of-object this explode)) + ) + (let* ((v1-11 (* s5-0 s5-0)) + (a0-4 2700) + (v1-12 (- (* a0-4 a0-4) v1-11)) + ) + (when (< v1-12 (-> this next-countdown-tick)) + (let ((a0-8 540)) + (set! (-> this next-countdown-tick) (the-as time-frame (- v1-12 (mod v1-12 (* a0-8 a0-8))))) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector<-cspace! s5-1 (-> this node-list data 7)) + (spawn (-> this warning-glow-part) s5-1) + (vector<-cspace! s5-1 (-> this node-list data 6)) + (spawn (-> this warning-glow-part) s5-1) + (vector<-cspace! s5-1 (-> this node-list data 5)) + (spawn (-> this warning-glow-part) s5-1) + (vector<-cspace! s5-1 (-> this node-list data 4)) + (spawn (-> this warning-glow-part) s5-1) + ) + (sound-play "grenade-timer") + ) + ) + ) + 0 + (none) + ) + +;; definition for function bombbot-bomb-handler +;; INFO: Used lq/sq +(defbehavior bombbot-bomb-handler bombbot-bomb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case arg2 + (('attack) + (cond + ((= (-> arg0 type) target) + (let* ((gp-0 (ppointer->process (-> self parent))) + (s3-0 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + (s5-0 (new 'stack-no-clear 'traj3d-params)) + (gp-1 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (when s3-0 + (vector-rotate-around-y! gp-1 *x-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (let ((s2-1 (-> s5-0 dest))) + (let ((v1-6 (get-trans s3-0 3))) + (let ((a0-6 gp-1)) + (let ((a1-7 8192.0)) + (.mov vf7 a1-7) + ) + (.lvf vf5 (&-> a0-6 quad)) + ) + (.lvf vf4 (&-> v1-6 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-1 quad) vf6) + ) + (let ((s1-1 (-> s5-0 dest))) + (let ((s2-2 (-> s5-0 dest))) + (let ((v1-8 (get-transv s3-0))) + (let ((a0-9 2.0)) + (.mov vf7 a0-9) + ) + (.lvf vf5 (&-> v1-8 quad)) + ) + (.lvf vf4 (&-> s2-2 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 (&-> s1-1 quad) vf6) + ) + (set! (-> s5-0 src quad) (-> self root trans quad)) + (set! (-> s5-0 initial-tilt) (* 182.04445 (rand-vu-float-range 30.0 50.0))) + (set! (-> s5-0 gravity) 184320.0) + (when (traj3d-calc-initial-velocity-using-tilt s5-0) + (vector-! gp-1 (-> self root trans) (target-pos 0)) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (set! (-> s4-0 quad) (-> s5-0 initial-velocity quad)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (cond + ((< 0.7 (vector-dot gp-1 s4-0)) + (set! (-> self root transv quad) (-> s5-0 initial-velocity quad)) + ) + (else + (let ((t9-10 vector-normalize!) + (a0-22 gp-1) + (v1-20 (-> s5-0 initial-velocity)) + ) + (t9-10 a0-22 (sqrtf (+ (* (-> v1-20 x) (-> v1-20 x)) (* (-> v1-20 z) (-> v1-20 z))))) + ) + (set! (-> gp-1 y) (-> s5-0 initial-velocity y)) + (set! (-> self root transv quad) (-> gp-1 quad)) + ) + ) + (go-virtual back) + ) + ) + ) + ) + (else + #f + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate back (bombbot-bomb) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (let* ((s4-0 proc) + (s3-0 (if (type? s4-0 process-drawable) + s4-0 + ) + ) + ) + (when s3-0 + (let ((a0-3 (-> (the-as process-focusable s3-0) root)) + (a1-2 (new 'stack-no-clear 'collide-query)) + ) + (let ((v1-4 (-> self root root-prim prim-core)) + (a0-5 (-> a0-3 root-prim prim-core)) + ) + 0.0 + (set! (-> a1-2 start-pos quad) (-> v1-4 world-sphere quad)) + (vector-! (-> a1-2 move-dist) (the-as vector a0-5) (the-as vector v1-4)) + ) + (let ((v1-5 a1-2)) + (set! (-> v1-5 radius) 40.96) + (set! (-> v1-5 collide-with) (collide-spec backgnd)) + (set! (-> v1-5 ignore-process0) #f) + (set! (-> v1-5 ignore-process1) #f) + (set! (-> v1-5 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-5 action-mask) (collide-action solid)) + ) + (when (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0) + (cond + ((logtest? (process-mask vehicle) (-> (the-as process-focusable s3-0) mask)) + (let ((s4-2 + (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-focusable s3-0) root trans) (-> self root trans)) + ) + ) + 0.0 + (let ((f30-0 (-> self root root-prim local-sphere w))) + (vector-normalize! s4-2 1.0) + (+! (-> s4-2 y) 0.25) + (if (< 0.0 f30-0) + (send-event + proc + 'attack + (-> block param 0) + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 20.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor (* 0.000012207031 f30-0)) + (attacker-velocity s4-2) + ) + ) + ) + ) + ) + ) + ) + (else + (send-event + proc + 'attack + (-> block param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'explode)) + ) + ) + ) + ) + ) + ) + ) + ) + (go-virtual explode) + ) + (else + #f + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-3 (-> self root root-prim))) + (logior! (-> v1-3 prim-core collide-with) (collide-spec enemy)) + (logclear! (-> v1-3 prim-core collide-with) (collide-spec jak)) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (set! (-> self root transv y) (- (-> self root transv y) (* 184320.0 (seconds-per-frame)))) + (bombbot-bomb-method-32 self) + (if (time-elapsed? (-> self state-time) (seconds 5)) + (go-virtual explode) + ) + (ja :num! (loop!)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (if (logtest? (-> self root status) (collide-status touch-surface)) + (go-virtual explode) + ) + ) + ) + +;; failed to figure out what this is: +(defstate explode (bombbot-bomb) + :virtual #t + :enter (behavior () + (ja-channel-set! 0) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "grenade-explode") + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 12288.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 219)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 self) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (cond + ((not (time-elapsed? (-> self state-time) (seconds 2))) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (+! (-> a1-0 y) 2048.0) + (spawn (-> self explode-part) a1-0) + ) + ) + ((not (-> self child)) + (deactivate self) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; definition for symbol *daxter-speech*, type int +(define *daxter-speech* 0) + +;; failed to figure out what this is: +(defstate smoke (bombbot-bomb) + :virtual #t + :event bombbot-bomb-handler + :enter (behavior () + (let* ((v1-0 2700) + (v1-1 (* v1-0 v1-0)) + (a0-0 540) + ) + (set! (-> self next-countdown-tick) (the-as time-frame (- v1-1 (mod v1-1 (* a0-0 a0-0))))) + ) + (set-time! (-> self state-time)) + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (= *bombbot-hint* 1) + (< (the int *bombbot-hint-time*) (current-time)) + (< (vector-vector-distance (-> self root trans) (camera-pos)) 204800.0) + ) + (set! *bombbot-hint-time* (the float (+ (current-time) (seconds 40)))) + (let ((v1-18 *daxter-speech*)) + (cond + ((zero? v1-18) + (talker-spawn-func (-> *talker-speech* 168) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-18 1) + (talker-spawn-func (-> *talker-speech* 166) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-18 2) + (talker-spawn-func (-> *talker-speech* 167) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! *daxter-speech* (+ *daxter-speech* 1)) + (when (= *daxter-speech* 3) + (set! *daxter-speech* 0) + 0 + ) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (bombbot-bomb-method-33 self) + (ja :num! (loop!)) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate idle (bombbot-bomb) + :virtual #t + :event bombbot-bomb-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (set! (-> self root transv y) (- (-> self root transv y) (* 184320.0 (seconds-per-frame)))) + (bombbot-bomb-method-32 self) + (if (time-elapsed? (-> self state-time) (seconds 5)) + (go-virtual explode) + ) + (if (< (vector-length (-> self root transv)) 2048.0) + (go-virtual smoke) + ) + (ja :num! (loop!)) + ) + :code sleep-code + :post (behavior () + (transform-post) + ) + ) + +;; definition for method 10 of type bombbot-bomb +(defmethod deactivate ((this bombbot-bomb)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this explode-part)) + (kill-particles (-> this explode-part)) + ) + (if (nonzero? (-> this warning-glow-part)) + (kill-particles (-> this warning-glow-part)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 7 of type bombbot-bomb +;; WARN: Return type mismatch process-focusable vs bombbot-bomb. +(defmethod relocate ((this bombbot-bomb) (offset int)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) offset) + ) + (if (nonzero? (-> this warning-glow-part)) + (&+! (-> this warning-glow-part) offset) + ) + (the-as bombbot-bomb ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for function bombbot-bomb-reaction +(defun bombbot-bomb-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((f0-0 (rand-vu-float-range 1.2 1.4))) + (vector--float*! arg2 arg3 (-> arg0 surface-normal) (* (vector-dot arg3 (-> arg0 surface-normal)) f0-0)) + ) + (-> arg0 status) + ) + +;; definition for function bombbot-bomb-init-by-other +;; INFO: Used lq/sq +(defbehavior bombbot-bomb-init-by-other bombbot-bomb ((arg0 vector) (arg1 vector)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) bombbot-bomb-reaction) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec backgnd jak bot enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 2048.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-9 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s4-0 max-iteration-count) (the-as uint 8)) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot-bomb" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> self root scale) 0.5 0.5 0.5 1.0) + (quaternion-set! (-> self root quat) 0.0 0.0 0.0 1.0) + (set! (-> self root transv quad) (-> arg1 quad)) + (set! (-> self draw light-index) (the-as uint 10)) + (set! (-> self root dynam gravity y) 184320.0) + (set! (-> self root dynam gravity-length) 184320.0) + (set! (-> self root dynam gravity-max) 184320.0) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (vector-cross! s5-2 arg1 *z-vector*) + (vector-normalize! s5-2 1.0) + (set! (-> self rot-axis quad) (-> s5-2 quad)) + ) + (set! (-> self rot-angle) 65536.0) + (set! (-> self explode-part) (create-launch-control (-> *part-group-id-table* 219) self)) + (set! (-> self warning-glow-part) (create-launch-control (-> *part-group-id-table* 525) self)) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defskelgroup skel-bombbot bombbot bombbot-lod0-jg bombbot-idle-ja + ((bombbot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :shadow bombbot-shadow-mg + ) + +;; definition of type bombbot-foot +(deftype bombbot-foot (structure) + ((pos-offset vector :inline) + (joint-index uint32) + (offset float) + (position vector :inline) + (next-position vector :inline) + (real-position vector :inline) + (speed vector :inline) + (moving symbol) + (main-y float) + (delta-y float) + ) + ) + +;; definition for method 3 of type bombbot-foot +(defmethod inspect ((this bombbot-foot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bombbot-foot) + (format #t "~1Tpos-offset: #~%" (-> this pos-offset)) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tnext-position: #~%" (-> this next-position)) + (format #t "~1Treal-position: #~%" (-> this real-position)) + (format #t "~1Tspeed: #~%" (-> this speed)) + (format #t "~1Tmoving: ~A~%" (-> this moving)) + (format #t "~1Tmain-y: ~f~%" (-> this main-y)) + (format #t "~1Tdelta-y: ~f~%" (-> this delta-y)) + (label cfg-4) + this + ) + +;; definition of type bombbot +(deftype bombbot (nav-enemy) + ((joint-ik joint-mod-ik 4) + (feet bombbot-foot 4 :inline) + (legs-strength float 4) + (last-trans vector :inline) + (linear-speed vector :inline) + (last-quat quaternion :inline) + (y-angular-velocity float) + (main-quat quaternion :inline) + (main-spd-y float) + (main-pos-y float) + (main-pos vector :inline) + (city-path bombbot-path) + (current-node uint32) + (shot-count uint32) + (next-shoot time-frame) + (stop-shoot time-frame) + (next-target time-frame) + (start-target time-frame) + (beep-time time-frame) + (target-pos vector :inline) + (start-target-pos vector :inline) + (start-target-vel vector :inline) + (target-delta vector :inline) + (top-quat quaternion :inline) + (gun-swivel-quat quaternion :inline) + (gun-quat quaternion :inline) + (angle-turret float) + (angle-gun float) + (extra-angle-gun float) + (drop-angle float) + (drop-num uint32) + (hit-axis vector :inline) + (rigidbody rigid-body-control) + (info rigid-body-object-constants) + (explosing symbol) + (minimap connection-minimap) + (head-sound sound-id) + (cannon-sound sound-id) + (last-head-roty-speed float) + (head-roty-speed float) + (last-cannon-roty-speed float) + (cannon-roty-speed float) + (shoot-duration float) + (y-angle float) + (gun-rotation-speed float) + (gun-type uint32) + (drop-mask uint32) + (attacker-info city-attacker-info) + (mission-squad mission-squad-control) + (max-hit-points float) + ) + (:state-methods + explode + blow-wall + undefined + drop-bombs + ) + (:methods + (bombbot-method-194 (_type_) none) + (bombbot-method-195 (_type_) none) + (bombbot-method-196 (_type_ vector) none) + (bombbot-method-197 (_type_) none) + (bombbot-method-198 (_type_) none) + (bombbot-method-199 (_type_) none) + (toggle-cspec-deadly (_type_ symbol int) none) + (valid-target? (_type_ process-focusable) object) + (bombbot-method-202 (_type_) none) + (bombbot-method-203 (_type_) none) + (bombbot-method-204 (_type_) none) + (bombbot-method-205 (_type_) none) + (fire-shot (_type_ vector vector) (pointer projectile)) + (bombbot-method-207 (_type_) symbol) + (bombbot-method-208 (_type_ vector vector) vector) + ) + ) + +;; definition for method 3 of type bombbot +(defmethod inspect ((this bombbot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> this joint-ik)) + (format #t "~2Tfeet[4] @ #x~X~%" (-> this feet)) + (format #t "~2Tlegs-strength[4] @ #x~X~%" (-> this legs-strength)) + (format #t "~2Tlast-trans: #~%" (-> this last-trans)) + (format #t "~2Tlinear-speed: #~%" (-> this linear-speed)) + (format #t "~2Tlast-quat: #~%" (-> this last-quat)) + (format #t "~2Ty-angular-velocity: ~f~%" (-> this y-angular-velocity)) + (format #t "~2Tmain-quat: #~%" (-> this main-quat)) + (format #t "~2Tmain-spd-y: ~f~%" (-> this main-spd-y)) + (format #t "~2Tmain-pos-y: ~f~%" (-> this main-pos-y)) + (format #t "~2Tmain-pos: #~%" (-> this main-pos)) + (format #t "~2Tcity-path: #~%" (-> this city-path)) + (format #t "~2Tcurrent-node: ~D~%" (-> this current-node)) + (format #t "~2Tshot-count: ~D~%" (-> this shot-count)) + (format #t "~2Tnext-shoot: ~D~%" (-> this next-shoot)) + (format #t "~2Tstop-shoot: ~D~%" (-> this stop-shoot)) + (format #t "~2Tnext-target: ~D~%" (-> this next-target)) + (format #t "~2Tstart-target: ~D~%" (-> this start-target)) + (format #t "~2Tbeep-time: ~D~%" (-> this beep-time)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tstart-target-pos: #~%" (-> this start-target-pos)) + (format #t "~2Tstart-target-vel: #~%" (-> this start-target-vel)) + (format #t "~2Ttarget-delta: #~%" (-> this target-delta)) + (format #t "~2Ttop-quat: #~%" (-> this top-quat)) + (format #t "~2Tgun-swivel-quat: #~%" (-> this gun-swivel-quat)) + (format #t "~2Tgun-quat: #~%" (-> this gun-quat)) + (format #t "~2Tangle-turret: ~f~%" (-> this angle-turret)) + (format #t "~2Tangle-gun: ~f~%" (-> this angle-gun)) + (format #t "~2Textra-angle-gun: ~f~%" (-> this extra-angle-gun)) + (format #t "~2Tdrop-angle: ~f~%" (-> this drop-angle)) + (format #t "~2Tdrop-num: ~D~%" (-> this drop-num)) + (format #t "~2Thit-axis: #~%" (-> this hit-axis)) + (format #t "~2Trigidbody: ~A~%" (-> this rigidbody)) + (format #t "~2Tinfo: #~%" (-> this info)) + (format #t "~2Texplosing: ~A~%" (-> this explosing)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Thead-sound: ~D~%" (-> this head-sound)) + (format #t "~2Tcannon-sound: ~D~%" (-> this cannon-sound)) + (format #t "~2Tlast-head-roty-speed: ~f~%" (-> this last-head-roty-speed)) + (format #t "~2Thead-roty-speed: ~f~%" (-> this head-roty-speed)) + (format #t "~2Tlast-cannon-roty-speed: ~f~%" (-> this last-cannon-roty-speed)) + (format #t "~2Tcannon-roty-speed: ~f~%" (-> this cannon-roty-speed)) + (format #t "~2Tshoot-duration: ~f~%" (-> this shoot-duration)) + (format #t "~2Ty-angle: ~f~%" (-> this y-angle)) + (format #t "~2Tgun-rotation-speed: ~f~%" (-> this gun-rotation-speed)) + (format #t "~2Tgun-type: ~D~%" (-> this gun-type)) + (format #t "~2Tdrop-mask: ~D~%" (-> this drop-mask)) + (format #t "~2Tattacker-info: #~%" (-> this attacker-info)) + (format #t "~2Tmission-squad: ~A~%" (-> this mission-squad)) + (format #t "~2Tmax-hit-points: ~f~%" (-> this max-hit-points)) + (label cfg-4) + this + ) + +;; definition for symbol *bombbot-nav-enemy-info*, type nav-enemy-info +(define *bombbot-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim 3 + :knocked-land-anim 3 + :die-anim 3 + :die-falling-anim 3 + :victory-anim -1 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint -1 + :look-at-joint 4 + :bullseye-joint 4 + :sound-hit (static-sound-name "bb-impact") + :sound-die (static-sound-name "bombbot-die") + :notice-distance (meters 20) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 100.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 400) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 400) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 2) + :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! (-> *bombbot-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; failed to figure out what this is: +(set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + +;; definition for symbol *bombbot-ik-limb-setup*, type (array ik-limb-setup) +(define *bombbot-ik-limb-setup* (new 'static 'boxed-array :type ik-limb-setup + (new 'static 'ik-limb-setup :elbow-index 19 :hand-dist 14880.768) + (new 'static 'ik-limb-setup :elbow-index 13 :hand-dist -14880.768) + (new 'static 'ik-limb-setup :elbow-index 15 :hand-dist 14880.768) + (new 'static 'ik-limb-setup :elbow-index 17 :hand-dist -14880.768) + ) + ) + +;; definition for function bombbot-do-spline +(defun bombbot-do-spline ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +;; definition for method 200 of type bombbot +;; WARN: Return type mismatch int vs none. +(defmethod toggle-cspec-deadly ((this bombbot) (arg0 symbol) (arg1 int)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a3-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) + (when (= (-> a3-1 prim-id) arg1) + (cond + (arg0 + (logior! (-> a3-1 prim-core action) (collide-action deadly)) + (set! (-> a3-1 prim-core collide-as) (collide-spec enemy)) + (set! (-> a3-1 prim-core collide-with) + (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + ) + (else + (logclear! (-> a3-1 prim-core action) (collide-action deadly)) + (set! (-> a3-1 prim-core collide-as) (collide-spec enemy)) + (set! (-> a3-1 prim-core collide-with) + (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 204 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-204 ((this bombbot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s1-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> this node-list data 6 bone transform)) + (v1-2 (-> a2-0 rvec quad)) + (a0-1 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s1-0 rvec quad) v1-2) + (set! (-> s1-0 uvec quad) a0-1) + (set! (-> s1-0 fvec quad) a1-0) + (set! (-> s1-0 trans quad) a2-1) + ) + (new 'stack-no-clear 'vector) + (let ((s3-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (f30-0 (lerp-scale 1.0 0.0 (* 0.0033333334 (the float (- (-> this next-target) (current-time)))) 2.5 3.5)) + ) + (if (= (-> this focus handle) #f) + (set! f30-0 0.0) + ) + (matrix->trans s1-0 gp-0) + (let ((a1-3 gp-0)) + (let ((v1-10 gp-0)) + (let ((a0-4 (-> s1-0 fvec))) + (let ((a2-6 8192.0)) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> a1-3 quad) vf6) + ) + (vector-normalize-copy! s5-0 (-> s1-0 fvec) 819200.0) + (set! (-> s3-0 start-pos quad) (-> gp-0 quad)) + (set! (-> s3-0 move-dist quad) (-> s5-0 quad)) + (let ((v1-13 s3-0)) + (set! (-> v1-13 radius) 40.96) + (set! (-> v1-13 collide-with) (collide-spec backgnd enemy hit-by-others-list)) + (set! (-> v1-13 ignore-process0) this) + (set! (-> v1-13 ignore-process1) #f) + (set! (-> v1-13 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-13 action-mask) (collide-action solid)) + ) + (let ((f0-4 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) + (when (>= f0-4 0.0) + (vector+float*! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist) f0-4) + (vector-float*! s5-0 s5-0 f0-4) + (let* ((s1-1 (-> s3-0 best-other-tri collide-ptr)) + (s2-1 (if (type? s1-1 collide-shape-prim) + s1-1 + ) + ) + (v1-22 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s3-0 start-pos) s4-0) 1638.4)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> s4-0 quad)) + (vector+! s3-1 s3-1 v1-22) + (cond + (s2-1 + (launch-particles (-> *part-id-table* 2061) s3-1) + (launch-particles (-> *part-id-table* 2060) s3-1) + ) + (else + (launch-particles (-> *part-id-table* 2062) s3-1) + ) + ) + ) + ) + ) + (set! (-> *part-id-table* 2059 init-specs 5 initial-valuef) (* 255.0 f30-0)) + (set! (-> *part-id-table* 2059 init-specs 7 initial-valuef) (* 255.0 (- 1.0 f30-0))) + ) + (draw-beam (-> *part-id-table* 2059) gp-0 s5-0 #t) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 201 of type bombbot +(defmethod valid-target? ((this bombbot) (arg0 process-focusable)) + (and arg0 + (!= this arg0) + (not (focus-test? arg0 inactive)) + (not (focus-test? arg0 disable)) + (not (focus-test? arg0 dead)) + (not (logtest? (process-mask crate) (-> arg0 mask))) + arg0 + (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + +;; definition for method 207 of type bombbot +(defmethod bombbot-method-207 ((this bombbot)) + #t + ) + +;; definition for method 202 of type bombbot +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-202 ((this bombbot)) + (set! (-> this last-head-roty-speed) (-> this head-roty-speed)) + (set! (-> this head-roty-speed) (vector-y-angle (-> this node-list data 4 bone transform fvec))) + (set! (-> this last-cannon-roty-speed) (-> this cannon-roty-speed)) + (set! (-> this cannon-roty-speed) (vector-y-angle (-> this node-list data 6 bone transform fvec))) + (let ((f0-6 (deg- (-> this last-head-roty-speed) (-> this head-roty-speed)))) + (cond + ((< 364.0889 (fabs f0-6)) + (when (zero? (-> this head-sound)) + (let ((s5-0 sound-play-by-spec) + (s4-0 (static-sound-spec "bb-turret-loop" :group 0 :volume 0.0 :mask (pitch))) + ) + (set! (-> s4-0 volume) 1024) + (set! (-> s4-0 pitch-mod) 0) + (set! (-> this head-sound) (s5-0 s4-0 (new-sound-id) (-> this root trans))) + ) + ) + ) + (else + (when (nonzero? (-> this head-sound)) + (sound-play "bb-turret-end") + (sound-stop (-> this head-sound)) + (set! (-> this head-sound) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + (let ((f0-10 (deg- (-> this last-cannon-roty-speed) (-> this cannon-roty-speed)))) + (cond + ((< 364.0889 (fabs f0-10)) + (when (zero? (-> this cannon-sound)) + (let ((s5-2 sound-play-by-spec) + (s4-2 (static-sound-spec "bb-laser-loop" :group 0 :volume 0.0 :mask (pitch))) + ) + (set! (-> s4-2 volume) 1024) + (set! (-> s4-2 pitch-mod) 0) + (set! (-> this cannon-sound) (s5-2 s4-2 (new-sound-id) (-> this root trans))) + ) + ) + ) + (else + (when (nonzero? (-> this cannon-sound)) + (sound-stop (-> this cannon-sound)) + (sound-play "bb-laser-end") + (set! (-> this cannon-sound) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + (none) + ) + +;; definition for method 195 of type bombbot +;; INFO: Used lq/sq +(defmethod bombbot-method-195 ((this bombbot)) + (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) + (set! (-> a1-0 sphere r) 40960.0) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (vector-reset! (-> a1-0 velocity)) + (set! (-> a1-0 notify-radius) 122880.0) + (set! (-> a1-0 danger-level) 1.0) + (set! (-> a1-0 decay-rate) 0.0) + (set! (-> a1-0 flags) (the-as uint 1)) + (set! (-> a1-0 danger-type) (the-as uint 0)) + (add-danger *traffic-engine* a1-0) + ) + (none) + ) + +;; definition for method 194 of type bombbot +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-194 ((this bombbot)) + (local-vars + (at-0 int) + (sv-864 vector) + (sv-880 vector) + (sv-896 float) + (sv-912 float) + (sv-928 (function vector vector float)) + (sv-944 uint) + (sv-960 uint) + ) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-0 (-> s5-0 bbox)) + (a0-2 (-> this root trans)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 24576.0) + (set! (-> a1-0 y) 22528.0) + (set! (-> a1-0 z) 24576.0) + (set! (-> a1-0 w) 1.0) + (vector-! (the-as vector v1-0) a0-2 a1-0) + ) + (let ((v1-2 (-> s5-0 bbox max)) + (a0-4 (-> this root trans)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 24576.0) + (set! (-> a1-1 y) 22528.0) + (set! (-> a1-1 z) 24576.0) + (set! (-> a1-1 w) 1.0) + (vector+! v1-2 a0-4 a1-1) + ) + (set! (-> s5-0 collide-with) (collide-spec backgnd)) + (set! (-> s5-0 ignore-process0) #f) + (set! (-> s5-0 ignore-process1) #f) + (set! (-> s5-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (fill-using-bounding-box *collide-cache* s5-0) + (dotimes (s4-0 4) + (-> this joint-ik s4-0 shoulder-matrix-no-ik) + (-> this joint-ik s4-0 elbow-matrix-no-ik) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> this node-list data 3 bone transform uvec quad)) + (new 'stack-no-clear 'vector) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((f30-0 0.4)) + (vector-normalize! s2-0 1.0) + (let ((s1-0 (-> this feet s4-0))) + (let* ((f0-10 (+ (* 0.004166667 (the float (mod (current-time) 240))) (-> s1-0 offset))) + (f28-0 (- f0-10 (* (the float (the int (/ f0-10 1.0))) 1.0))) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((>= f30-0 f28-0) + (toggle-cspec-deadly this #t (+ s4-0 1)) + (vector-orient-by-quat! s3-0 (-> s1-0 pos-offset) (-> this root quat)) + (let ((f26-0 (- f30-0 f28-0))) + (set! sv-880 s0-0) + (set! sv-864 (new 'stack-no-clear 'vector)) + (set! (-> sv-864 x) 0.0) + (set! (-> sv-864 y) (sin (* (-> this y-angular-velocity) (-> pp clock frames-per-second)))) + (set! (-> sv-864 z) 0.0) + (set! (-> sv-864 w) 1.0) + (let ((v1-40 s3-0)) + (.lvf vf1 (&-> sv-864 quad)) + (.lvf vf2 (&-> v1-40 quad)) + ) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> sv-880 quad) vf3) + (let ((a1-6 s0-0) + (v1-42 s0-0) + (a0-12 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> (-> this linear-speed) quad)) + (let ((f0-17 (-> pp clock frames-per-second))) + (.mov at-0 f0-17) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-12 quad) vf1) + (vector+! a1-6 v1-42 a0-12) + ) + (let ((a1-8 (-> s1-0 speed))) + (let ((v1-43 (-> s1-0 speed))) + (let ((a0-14 (vector-! (new 'stack-no-clear 'vector) s0-0 (-> s1-0 speed)))) + (let ((a2-15 (* 4.0 (seconds-per-frame)))) + (.mov vf7 a2-15) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-43 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 (&-> a1-8 quad) vf6) + ) + (let ((a1-9 s3-0)) + (let ((v1-44 s3-0)) + (let ((a0-15 (-> s1-0 speed))) + (let ((a2-17 (+ 0.2 f26-0))) + (.mov vf7 a2-17) + ) + (.lvf vf5 (&-> a0-15 quad)) + ) + (.lvf vf4 (&-> v1-44 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 (&-> a1-9 quad) vf6) + ) + ) + (vector+! s3-0 s3-0 (-> this root trans)) + (let ((a1-12 (-> s5-0 start-pos))) + (let ((v1-46 s3-0)) + (let ((a0-18 s2-0)) + (let ((a2-19 24576.0)) + (.mov vf7 a2-19) + ) + (.lvf vf5 (&-> a0-18 quad)) + ) + (.lvf vf4 (&-> v1-46 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 (&-> a1-12 quad) vf6) + ) + (vector-float*! (-> s5-0 move-dist) s2-0 -49152.0) + (let ((v1-49 s5-0)) + (set! (-> v1-49 radius) 40.96) + (set! (-> v1-49 collide-with) (collide-spec backgnd)) + (set! (-> v1-49 ignore-process0) #f) + (set! (-> v1-49 ignore-process1) #f) + (set! (-> v1-49 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-49 action-mask) (collide-action solid)) + ) + (let ((f0-25 (probe-using-line-sphere *collide-cache* s5-0))) + (when (>= f0-25 0.0) + (let ((v1-51 (new 'stack-no-clear 'vector))) + (let ((a0-26 (-> s5-0 start-pos))) + (let ((a1-15 (-> s5-0 move-dist))) + (let ((a2-20 f0-25)) + (.mov vf7 a2-20) + ) + (.lvf vf5 (&-> a1-15 quad)) + ) + (.lvf vf4 (&-> a0-26 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 (&-> v1-51 quad) vf6) + (- (-> s3-0 y) (-> v1-51 y)) + (set! (-> s3-0 quad) (-> v1-51 quad)) + ) + ) + ) + (set! (-> s1-0 next-position quad) (-> s3-0 quad)) + (set! (-> s1-0 moving) #t) + (let ((a1-16 s3-0)) + (let ((v1-55 (-> s1-0 position))) + (let ((a0-31 (vector-! (new 'stack-no-clear 'vector) (-> s1-0 next-position) (-> s1-0 position)))) + (let ((a2-22 (/ f28-0 f30-0))) + (.mov vf7 a2-22) + ) + (.lvf vf5 (&-> a0-31 quad)) + ) + (.lvf vf4 (&-> v1-55 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 (&-> a1-16 quad) vf6) + ) + (let ((t9-6 bombbot-do-spline) + (a0-32 (new 'stack-no-clear 'vector)) + (a1-17 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-17 x) 0.0) + (set! (-> a1-17 y) 0.0) + (set! (-> a1-17 z) 0.0) + (set! (-> a1-17 w) 1.0) + (let ((a2-23 (new 'stack-no-clear 'vector))) + (set! (-> a2-23 x) 0.0) + (set! (-> a2-23 y) 0.0) + (set! (-> a2-23 z) 0.5) + (set! (-> a2-23 w) 1.0) + (let ((a3-1 (new 'stack-no-clear 'vector))) + (set! (-> a3-1 x) 0.0) + (set! (-> a3-1 y) 0.0) + (set! (-> a3-1 z) 1.0) + (set! (-> a3-1 w) 1.0) + (let ((t0-0 (new 'stack-no-clear 'vector))) + (set! (-> t0-0 x) 0.0) + (set! (-> t0-0 y) 4.0) + (set! (-> t0-0 z) 0.0) + (set! (-> t0-0 w) 1.0) + (let ((v0-6 (t9-6 a0-32 a1-17 a2-23 a3-1 t0-0 (/ f28-0 f30-0)))) + (set! (-> s1-0 delta-y) (* 0.05 (-> v0-6 y) (vector-length (-> s1-0 speed)))) + ) + ) + ) + ) + ) + (+! (-> s3-0 y) (-> s1-0 delta-y)) + ) + (else + (toggle-cspec-deadly this #f (+ s4-0 1)) + (when (-> s1-0 moving) + (set! (-> s1-0 position quad) (-> s1-0 next-position quad)) + (set! (-> s1-0 moving) #f) + (let ((s0-1 lerp-scale)) + (set! sv-896 (the-as float 819.2)) + (set! sv-912 (the-as float 0.0)) + (set! sv-928 vector-vector-distance) + (let* ((a0-36 (camera-pos)) + (a1-19 (-> s1-0 position)) + (a2-25 (sv-928 a0-36 a1-19)) + (a3-2 40960.0) + (t0-1 409600.0) + (f30-1 (s0-1 sv-896 sv-912 a2-25 a3-2 t0-1)) + ) + (when (and (!= f30-1 0.0) (< 16384.0 (vector-length (-> s1-0 speed)))) + (if (bombbot-method-207 this) + (activate! *camera-smush-control* f30-1 37 600 1.0 0.1 (-> pp clock)) + ) + (cond + ((logtest? (-> *part-group-id-table* 23 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s1-0 position quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 23)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s1-0 position quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 23)) + ) + ) + (when (or (zero? s4-0) (= s4-0 1)) + (cond + ((and *target* (focus-test? *target* grabbed)) + (let ((s0-4 sound-play-by-name)) + (set! sv-944 (make-u128 #x6d6163 (the-as uint #x2d6b6c61772d6262))) + (let ((a1-28 (new-sound-id)) + (a2-37 1024) + (a3-8 0) + (t0-3 0) + (t1-2 0) + (t2-1 (-> s1-0 position)) + ) + (s0-4 (the-as sound-name sv-944) a1-28 a2-37 a3-8 t0-3 (the-as sound-group t1-2) t2-1) + ) + ) + ) + (else + (let ((s0-5 sound-play-by-name)) + (set! sv-960 (make-u128 0 (the-as uint #x6b6c61772d6262))) + (let ((a1-29 (new-sound-id)) + (a2-38 1024) + (a3-9 0) + (t0-4 0) + (t1-3 0) + (t2-2 (-> s1-0 position)) + ) + (s0-5 (the-as sound-name sv-960) a1-29 a2-38 a3-9 t0-4 (the-as sound-group t1-3) t2-2) + ) + ) + ) + ) + (if (bombbot-method-207 this) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (* 0.00061035156 f30-1))) (seconds 0.2)) + ) + ) + ) + ) + ) + ) + (set! (-> s1-0 delta-y) 0.0) + (set! (-> s3-0 quad) (-> s1-0 position quad)) + ) + ) + ) + (let ((a1-31 (-> s5-0 start-pos))) + (let ((v1-133 s3-0)) + (let ((a0-62 s2-0)) + (let ((a2-41 12288.0)) + (.mov vf7 a2-41) + ) + (.lvf vf5 (&-> a0-62 quad)) + ) + (.lvf vf4 (&-> v1-133 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 (&-> a1-31 quad) vf6) + ) + (vector-float*! (-> s5-0 move-dist) s2-0 -24576.0) + (let ((v1-136 s5-0)) + (set! (-> v1-136 radius) 40.96) + (set! (-> v1-136 collide-with) (collide-spec backgnd)) + (set! (-> v1-136 ignore-process0) #f) + (set! (-> v1-136 ignore-process1) #f) + (set! (-> v1-136 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-136 action-mask) (collide-action solid)) + ) + (let ((f0-63 (probe-using-line-sphere *collide-cache* s5-0))) + (when (>= f0-63 0.0) + (let ((s0-6 (new 'stack-no-clear 'vector))) + (let ((v1-139 (-> s5-0 start-pos))) + (let ((a0-69 (-> s5-0 move-dist))) + (let ((a1-34 f0-63)) + (.mov vf7 a1-34) + ) + (.lvf vf5 (&-> a0-69 quad)) + ) + (.lvf vf4 (&-> v1-139 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 (&-> s0-6 quad) vf6) + (let ((f0-65 (- (-> s3-0 y) (-> s0-6 y)))) + (lerp-scale 1.0 0.0 f0-65 0.0 8192.0) + ) + (- (-> s0-6 y) (-> this root trans y)) + (vector-dot s2-0 (vector-! (new 'stack-no-clear 'vector) s0-6 (-> this root trans))) + ) + ) + ) + (set! (-> s1-0 real-position quad) (-> s3-0 quad)) + ) + ) + (set-ik-target! (-> this joint-ik s4-0) s3-0) + ) + ) + ) + ) + 0 + (none) + ) + ) + ) + +;; definition for method 59 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod enemy-common-post ((this bombbot)) + (local-vars (sv-48 sparticle-launcher) (sv-52 sparticle-launcher)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) + (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + (cond + ((= (-> this nav state mesh) *default-nav-mesh*) + (dotimes (s5-0 4) + (enable-set! (-> this joint-ik s5-0) #f) + ) + ) + (else + (bombbot-method-194 this) + (dotimes (s5-1 4) + (enable-set! (-> this joint-ik s5-1) #t) + ) + ) + ) + (vector-! (-> this linear-speed) (-> this root trans) (-> this last-trans)) + (set! (-> this last-trans quad) (-> this root trans quad)) + (set! (-> this y-angular-velocity) + (deg- (quaternion-y-angle (-> this root quat)) (quaternion-y-angle (-> this last-quat))) + ) + (quaternion-copy! (-> this last-quat) (-> this root quat)) + (set! (-> this rigidbody force-callback) + (the-as (function rigid-body-object float none) (method-of-object this bombbot-method-198)) + ) + (bombbot-method-199 this) + (set! sv-48 (the-as sparticle-launcher #f)) + (set! sv-52 (the-as sparticle-launcher #f)) + (cond + ((< (-> this hit-points) (* 0.33 (-> this max-hit-points))) + (set! sv-48 (-> *part-id-table* 925)) + (set! sv-52 (-> *part-id-table* 921)) + ) + ((< (-> this hit-points) (* 0.66 (-> this max-hit-points))) + (set! sv-48 (-> *part-id-table* 928)) + ) + (else + (if (< (rand-vu) 0.05) + (set! sv-48 (-> *part-id-table* 930)) + ) + ) + ) + (when sv-48 + (let ((gp-1 (-> this node-list data 4 bone transform)) + (s5-3 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-1 2) + (vector-matrix*! + s5-3 + (vector-rotate-around-y! (new 'stack-no-clear 'vector) (new 'static 'vector :z 6144.0 :w 1.0) (if (< s4-1 1) + 5461.3335 + 38229.332 + ) + ) + gp-1 + ) + (vector-! *particle-vel* s5-3 (matrix->trans gp-1 (new 'stack-no-clear 'vector))) + (+! (-> *particle-vel* y) 4096.0) + (vector-float*! *particle-vel* *particle-vel* 0.0033333334) + (when (and sv-52 (< (rand-vu) 0.005)) + (let ((t9-15 sp-launch-particles-var) + (a0-23 *sp-particle-system-2d*) + (a1-10 sv-48) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> s5-3 quad)) + (t9-15 a0-23 a1-10 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (let ((t9-16 sp-launch-particles-var) + (a0-24 *sp-particle-system-2d*) + (a1-11 sv-48) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s5-3 quad)) + (t9-16 a0-24 a1-11 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type bombbot +(defmethod run-logic? ((this bombbot)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 21 of type bombbot +(defmethod get-trans ((this bombbot) (arg0 int)) + "Get the `trans` for this process." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (cond + ((= arg0 4) + (let ((v0-0 (new 'static 'vector))) + (let ((v1-2 (-> this root trans))) + (let ((a0-1 *y-vector*)) + (let ((a1-2 12288.0)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-2 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + (else + ((method-of-type nav-enemy get-trans) this arg0) + ) + ) + ) + ) + +;; definition for method 65 of type bombbot +(defmethod penetrate->next-state ((this bombbot) (arg0 process) (arg1 event-message-block) (arg2 float)) + ((method-of-type nav-enemy penetrate->next-state) this arg0 arg1 arg2) + 'hit-flinch + ) + +;; definition for method 62 of type bombbot +(defmethod get-damage-from-attack ((this bombbot) (arg0 object) (arg1 event-message-block)) + (-> arg1 param 1) + (let* ((t9-0 (method-of-type nav-enemy get-damage-from-attack)) + (f30-0 (t9-0 this arg0 arg1)) + ) + (cond + ((if (type? arg0 bombbot-bomb) + arg0 + ) + (set! *bombbot-hint* (new 'static 'sound-id)) + (if (rand-vu-percent? 0.1) + (talker-spawn-func (-> *talker-speech* 169) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (* 15.0 f30-0) + ) + ((logtest? (penetrate dark-punch) (-> this incoming penetrate-using)) + (* 2.0 f30-0) + ) + (else + f30-0 + ) + ) + ) + ) + +;; definition for method 82 of type bombbot +;; INFO: Used lq/sq +(defmethod event-handler ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('nav-mesh-kill) + (change-to *default-nav-mesh* this) + #t + ) + (('hit-flinch) + (cond + ((= (-> this hit-points) 0.0) + (if (not (and (-> this next-state) (= (-> this next-state name) 'die))) + (go-die this) + ) + ) + (else + (let ((a1-2 (-> arg3 param 1))) + (when arg0 + (let ((v1-8 (find-offending-process-focusable arg0 (the-as attack-info a1-2)))) + (when v1-8 + (let ((s5-1 (new 'stack-no-clear 'vector))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> v1-8 root trans quad)) + (let ((s3-1 (matrix->trans (-> this node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) + (+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> s4-1 z) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (vector-! s5-1 s3-1 s4-1) + ) + ) + (vector-normalize! s5-1 4096000.0) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) + (apply-impact! + (-> this rigidbody) + (rigid-body-control-method-25 (-> this rigidbody) (new 'stack-no-clear 'vector)) + s5-1 + ) + ) + ) + ) + ) + ) + (play-damage-sound this 0) + 'back + ) + ) + ) + (('explode) + (if (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + (go (method-of-object this explode)) + ) + ) + (('blow-wall) + (go (method-of-object this blow-wall)) + ) + (('touched 'touch 'attack) + (if (logtest? (process-mask vehicle) (-> arg0 mask)) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'mine)) + ) + ) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate notice (bombbot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-best-state self) + ) + ) + +;; definition for method 196 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-196 ((this bombbot) (arg0 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as process-drawable #f))) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (countdown (s2-0 (fill-actor-list-for-box *actor-hash* arg0 s3-0 64)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-3 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-3 + (let* ((s0-0 (-> a0-3 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (!= this s1-1) + (not (focus-test? this inactive)) + (not (focus-test? this disable)) + (not (focus-test? this dead)) + (not (logtest? (process-mask guard) (-> s1-1 mask))) + (not (logtest? (process-mask crate) (-> s1-1 mask))) + (logtest? (process-mask guard vehicle) (-> s1-1 mask)) + s1-1 + (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> (the-as process-focusable s1-1) root trans)))) + (when (or (not gp-0) (< f0-0 f30-0)) + (set! gp-0 s1-1) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + ) + ) + (if (and *target* (< (vector-vector-distance (target-pos 0) arg0) (-> arg0 w))) + (set! gp-0 *target*) + ) + (cond + (gp-0 + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (let ((v1-34 (-> this target-pos))) + (let ((a0-16 (-> gp-0 root trans))) + (let ((a1-8 (-> gp-0 root transv))) + (let ((a2-1 0.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-8 quad)) + ) + (.lvf vf4 (&-> a0-16 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 (&-> v1-34 quad) vf6) + ) + (set! (-> this start-target-pos quad) (-> gp-0 root trans quad)) + (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) + (try-update-focus (-> this focus) (the-as process-focusable gp-0) this) + ) + (else + (clear-focused (-> this focus)) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 208 of type bombbot +;; INFO: Used lq/sq +(defmethod bombbot-method-208 ((this bombbot) (arg0 vector) (arg1 vector)) + (set! (-> arg1 quad) (-> this target-pos quad)) + arg1 + ) + +;; definition for method 203 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-203 ((this bombbot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> this node-list data 6 bone transform)) + (v1-2 (-> a2-0 rvec quad)) + (a0-1 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s4-0 rvec quad) v1-2) + (set! (-> s4-0 uvec quad) a0-1) + (set! (-> s4-0 fvec quad) a1-0) + (set! (-> s4-0 trans quad) a2-1) + ) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) + (matrix->trans s4-0 s3-0) + (let ((a1-2 s3-0)) + (let ((v1-5 s3-0)) + (let ((a0-3 (-> s4-0 fvec))) + (let ((a2-3 8192.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.lvf vf4 (&-> v1-5 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 (&-> a1-2 quad) vf6) + ) + (vector-normalize-copy! s2-0 (-> s4-0 fvec) 819200.0) + (set! (-> s5-0 dest quad) (-> (bombbot-method-208 this s3-0 (new 'stack-no-clear 'vector)) quad)) + (set! (-> s5-0 src quad) (-> s3-0 quad)) + (set! (-> s5-0 initial-tilt) (+ 3640.889 (-> this angle-gun))) + (set! (-> s5-0 gravity) 184320.0) + (when (traj3d-calc-initial-velocity-using-tilt s5-0) + (new 'stack-no-clear 'vector) + (sound-play "bb-fire-grenade") + (process-spawn bombbot-bomb (-> s5-0 src) (-> s5-0 initial-velocity) :name "bombbot-bomb" :to this) + (let ((s4-4 (new 'stack-no-clear 'vector))) + (set! (-> s4-4 quad) (-> s5-0 initial-velocity quad)) + (vector-normalize! s4-4 -2048000.0) + (vector-inv-orient-by-quat! s4-4 s4-4 (-> this root quat)) + (apply-impact! + (-> this rigidbody) + (rigid-body-control-method-25 (-> this rigidbody) (new 'stack-no-clear 'vector)) + s4-4 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition of type bombbot-shot +(deftype bombbot-shot (guard-shot) + () + ) + +;; definition for method 3 of type bombbot-shot +(defmethod inspect ((this bombbot-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type guard-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 24 of type bombbot-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this bombbot-shot)) + 0 + (none) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 24) (new 'static 'lightning-spec + :name "bombbot-lightning-shock" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :b #x40 :a #x80) + :end-color (new 'static 'rgba :r #x80 :b #x40 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +;; definition for method 25 of type bombbot-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this bombbot-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((v1-1 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (a2-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) + ) + (vector-length a2-1) + (let ((a3-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 a2-1)) + (let ((t0-1 0.8)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> a3-0 quad) vf6) + ) + (let ((f30-0 (-> *part-id-table* 2056 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2056 init-specs 4 initial-valuef) (* 2.0 (vector-length a2-1))) + (draw-beam (-> *part-id-table* 2056) a1-0 a2-1 #f) + (set! (-> *part-id-table* 2056 init-specs 4 initial-valuef) f30-0) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type bombbot-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this bombbot-shot)) + (dotimes (s5-0 5) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 256 + 0 + 40960.0 + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate impact (bombbot-shot) + :virtual #t + :code (behavior () + (while (-> self child) + (suspend) + ) + (go-virtual die) + ) + ) + +;; definition for method 28 of type bombbot-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this bombbot-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "bb-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "bb-shot-hit") + ) + ) + ) + 0 + (none) + ) + +;; definition for method 31 of type bombbot-shot +;; INFO: Used lq/sq +(defmethod init-proj-settings! ((this bombbot-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'guard-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) guard-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + (none) + ) + +;; definition for function spawn-bombbot-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer bombbot-shot). +(defun spawn-bombbot-projectile ((arg0 bombbot) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector) (arg5 float)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) arg5) + (logior! (-> gp-0 options) (projectile-options po14)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 1.0) + ) + (the-as (pointer bombbot-shot) (spawn-projectile bombbot-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; definition for method 206 of type bombbot +;; WARN: Return type mismatch (pointer bombbot-shot) vs (pointer projectile). +(defmethod fire-shot ((this bombbot) (arg0 vector) (arg1 vector)) + (the-as (pointer projectile) (spawn-bombbot-projectile this arg0 arg1 819200.0 (the-as vector #f) 2.0)) + ) + +;; definition for method 197 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-197 ((this bombbot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (handle->process (-> this focus handle)) + (cond + ((nonzero? (-> this gun-type)) + (when (>= (+ (current-time) (seconds -1)) (-> this next-shoot)) + (set-time! (-> this next-shoot)) + (bombbot-method-203 this) + ) + ) + (else + (when (>= (+ (current-time) (seconds -0.2)) (-> this next-shoot)) + (set-time! (-> this next-shoot)) + (handle->process (-> this focus handle)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> this node-list data 6 bone transform)) + (v1-27 (-> a2-0 rvec quad)) + (a0-12 (-> a2-0 uvec quad)) + (a1-2 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 rvec quad) v1-27) + (set! (-> s5-0 uvec quad) a0-12) + (set! (-> s5-0 fvec quad) a1-2) + (set! (-> s5-0 trans quad) a2-1) + ) + (new 'stack-no-clear 'matrix) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (matrix->trans s5-0 s3-0) + (let ((a1-4 s3-0)) + (let ((v1-32 s3-0)) + (let ((a0-14 (-> s5-0 fvec))) + (let ((a2-3 8192.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-32 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 (&-> a1-4 quad) vf6) + ) + (vector-normalize-copy! s4-0 (-> s5-0 fvec) 819200.0) + (fire-shot this s3-0 (vector+! (new 'stack-no-clear 'vector) s3-0 s4-0)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> s4-0 quad)) + (vector-normalize! s5-1 -2048000.0) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) + (apply-impact! + (-> this rigidbody) + (rigid-body-control-method-25 (-> this rigidbody) (new 'stack-no-clear 'vector)) + s5-1 + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 160 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod normalize-heading! ((this bombbot) (arg0 nav-control)) + (let ((a0-1 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((a2-0 (-> this nav state))) + (set! (-> a0-1 quad) (-> a2-0 heading quad)) + ) + (let ((f0-1 (deg-diff (-> this y-angle) (vector-y-angle a0-1)))) + (let ((f1-0 7281.778)) + (while (< 8192.0 f0-1) + (set! f0-1 (+ -16384.0 f0-1)) + ) + (while (< f0-1 -8192.0) + (set! f0-1 (+ 16384.0 f0-1)) + ) + (cond + ((< f1-0 f0-1) + (set! f0-1 f1-0) + ) + ((< f0-1 (- f1-0)) + (set! f0-1 (- f1-0)) + ) + ) + ) + (+! (-> this y-angle) (* f0-1 (seconds-per-frame))) + ) + ) + (quaternion-vector-angle! (-> this root quat) *y-vector* (-> this y-angle)) + 0 + (none) + ) + +;; definition for method 176 of type bombbot +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-176 ((this bombbot)) + (let ((t9-0 (method-of-type nav-enemy nav-enemy-method-176))) + (t9-0 this) + ) + (logclear! (-> this nav state nav flags) (nav-control-flag update-heading-from-facing)) + 0 + (none) + ) + +;; definition for method 177 of type bombbot +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-177 ((this bombbot)) + (let ((t9-0 (method-of-type nav-enemy nav-enemy-method-177))) + (t9-0 this) + ) + (logclear! (-> this nav state nav flags) (nav-control-flag update-heading-from-facing)) + 0 + (none) + ) + +;; definition for method 205 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-205 ((this bombbot)) + (when (= (-> this nav state mesh) *default-nav-mesh*) + (let ((a0-4 (find-nearest-nav-mesh (-> this root trans) 0.0))) + (when a0-4 + (change-to a0-4 this) + (dotimes (s5-0 4) + (let ((s4-0 (-> this feet s5-0))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s3-0 (-> s4-0 pos-offset) (-> this root quat)) + (vector+! s3-0 s3-0 (-> this root trans)) + (set! (-> s4-0 next-position quad) (-> s3-0 quad)) + (set! (-> s4-0 position quad) (-> s3-0 quad)) + ) + (set! (-> s4-0 delta-y) 0.0) + ) + (set! (-> this legs-strength s5-0) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate hostile (bombbot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-11 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 0))) + (set! (-> v1-11 prim-core collide-as) (collide-spec)) + (set! (-> v1-11 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self next-shoot) 0) + 0 + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (if (>= (+ (current-time) (seconds -13)) (-> self stop-shoot)) + (go-virtual drop-bombs) + ) + (when (< (-> self next-target) (current-time)) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (set! (-> a1-0 w) 204800.0) + (bombbot-method-196 self a1-0) + ) + (set! (-> self next-target) (+ (current-time) (seconds 5))) + (set! (-> self gun-type) (the-as uint 0)) + 0 + ) + (let ((v1-19 (the-as process-focusable (handle->process (-> self focus handle))))) + (when v1-19 + (when (< (current-time) (+ (-> self next-target) (seconds -3.5))) + (set-time! (-> self start-target)) + (set! (-> self start-target-pos quad) (-> v1-19 root trans quad)) + (set! (-> self start-target-vel quad) (-> v1-19 root transv quad)) + (vector-! (-> self target-delta) (-> v1-19 root trans) (-> self root trans)) + ) + (let ((a2-2 (-> self target-pos))) + (let ((a0-21 (-> self start-target-pos))) + (let ((a1-12 (-> self start-target-vel))) + (let ((a3-4 (* 0.0033333334 (the float (- (current-time) (-> self start-target)))))) + (.mov vf7 a3-4) + ) + (.lvf vf5 (&-> a1-12 quad)) + ) + (.lvf vf4 (&-> a0-21 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 (&-> a2-2 quad) vf6) + ) + (if (= (-> v1-19 type) target) + (set! (-> self target-pos quad) (-> self start-target-pos quad)) + ) + (if (< (+ (-> self next-target) (seconds -1)) (current-time)) + (bombbot-method-197 self) + (bombbot-method-204 self) + ) + ) + ) + (bombbot-method-205 self) + (new 'stack-no-clear 'vector) + (let ((f0-4 (* 0.25 (+ (-> self feet 0 next-position y) + (-> self feet 1 next-position y) + (-> self feet 2 next-position y) + (-> self feet 3 next-position y) + ) + ) + ) + ) + (if (!= (-> self nav state mesh) *default-nav-mesh*) + (+! (-> self root trans y) (* 4.0 (seconds-per-frame) (- f0-4 (-> self root trans y)))) + ) + ) + (if (= (vector-length (-> self root transv)) 0.0) + (set-time! (-> self state-time)) + ) + (bombbot-method-202 self) + (bombbot-method-195 self) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! bombbot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (-> self current-node) + (let ((gp-1 (min (the-as int (+ (-> self current-node) 1)) (the-as int (+ (-> self city-path node-count) -1))))) + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (vector-v+! + (-> self root trans) + (-> self root trans) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self city-path node gp-1)) (-> self root trans)) + (-> *bombbot-nav-enemy-info* run-travel-speed) + ) + ) + (seek! (-> self root trans y) (-> self city-path node gp-1 position y) (* 16384.0 (seconds-per-frame))) + (enemy-common-post self) + (update-transforms (-> self root)) + ) + (else + (let ((v1-25 (-> self nav state)) + (a0-10 (-> self city-path node gp-1)) + ) + (logclear! (-> v1-25 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-25 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-25 target-pos quad) (-> a0-10 position quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (the-as vector (-> self city-path node gp-1))) 32768.0) + (set! (-> self current-node) + (the-as + uint + (min (the-as int (+ (-> self current-node) 1)) (the-as int (+ (-> self city-path node-count) -1))) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate drop-bombs (bombbot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self start-target)) + (set! (-> self next-target) 0) + (nav-enemy-method-178 self) + (set! (-> self drop-mask) (the-as uint 0)) + (set! (-> self drop-angle) (rotate-y<-vector+vector + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)) + *x-vector* + ) + ) + (set! (-> self drop-num) (the-as uint 5)) + ) + :exit (behavior () + (set-time! (-> self stop-shoot)) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (and (nonzero? (-> self drop-num)) (< (-> self next-target) (current-time))) + (let ((v1-5 (enemy-method-131 self 5 (the-as int (-> self drop-mask))))) + (logior! (-> self drop-mask) (ash 1 v1-5)) + (set! (-> self next-shoot) (+ (current-time) (seconds 0.8))) + (set! (-> self next-target) (+ (current-time) (seconds 1))) + (set! (-> self gun-type) (the-as uint 1)) + (let ((gp-0 (-> self target-pos))) + (let ((s5-0 (-> self root trans))) + (let ((v1-7 (vector-rotate-around-y! + (new 'stack-no-clear 'vector) + *x-vector* + (+ 16384.0 (* 3640.889 (the float (+ v1-5 -2))) (-> self drop-angle)) + ) + ) + ) + (let ((a0-15 61440.0)) + (.mov vf7 a0-15) + ) + (.lvf vf5 (&-> v1-7 quad)) + ) + (.lvf vf4 (&-> s5-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 (&-> gp-0 quad) vf6) + ) + ) + (+! (-> self drop-num) -1) + ) + (when (< (-> self next-shoot) (current-time)) + (set! (-> self next-shoot) (+ (current-time) (seconds 10))) + (bombbot-method-203 self) + ) + (if (>= (+ (current-time) (seconds -12)) (-> self start-target)) + (go-virtual hostile) + ) + (bombbot-method-205 self) + (new 'stack-no-clear 'vector) + (let ((f0-5 (* 0.25 (+ (-> self feet 0 next-position y) + (-> self feet 1 next-position y) + (-> self feet 2 next-position y) + (-> self feet 3 next-position y) + ) + ) + ) + ) + (if (!= (-> self nav state mesh) *default-nav-mesh*) + (+! (-> self root trans y) (* 4.0 (seconds-per-frame) (- f0-5 (-> self root trans y)))) + ) + ) + (if (= (vector-length (-> self root transv)) 0.0) + (set-time! (-> self state-time)) + ) + (bombbot-method-202 self) + (bombbot-method-195 self) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! bombbot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (enemy-common-post self) + (update-transforms (-> self root)) + ) + (else + (nav-enemy-method-187 self) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate blow-wall (bombbot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((a1-0 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-0 9) #f) + (set! (-> a1-0 8) #f) + (set! (-> a1-0 7) #f) + (set! (-> a1-0 6) #f) + (set! (-> a1-0 5) #f) + (set! (-> a1-0 4) #f) + (set! (-> a1-0 3) #f) + (set! (-> a1-0 2) 'hiphog) + (set! (-> a1-0 1) 'ctyindb) + (set! (-> a1-0 0) 'ctywide-kg) + (want-levels *load-state* a1-0) + ) + ) + :exit (behavior () + (sound-stop (-> self head-sound)) + (sound-stop (-> self cannon-sound)) + ) + :trans (behavior () + (bombbot-method-202 self) + ) + :code (behavior () + (until #f + (ja-no-eval :group! bombbot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (set! (-> self root transv y) 0.0) + (let ((v1-2 (-> self nav state)) + (a0-0 (new 'static 'vector :x 4290273.5 :y 29286.4 :z 1817763.9 :w 1.0)) + ) + (logclear! (-> v1-2 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-2 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-2 target-pos quad) (-> a0-0 quad)) + ) + 0 + (when (logtest? (-> self nav state flags) (nav-state-flag at-target)) + (sound-play "bb-explode") + (go-virtual explode) + ) + (let ((v1-13 (-> self nav))) + (set! (-> v1-13 target-speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate die (bombbot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (set! (-> self explosing) #f) + (set! (-> self beep-time) 0) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((v1-0 (-> self nav))) + (set! (-> v1-0 target-speed) + (- (-> self nav target-speed) (* 0.4 (seconds-per-frame) (-> self nav target-speed))) + ) + ) + 0 + (if (>= (- (current-time) (-> self state-time)) 0) + (seek! (-> self legs-strength 0) 0.8 (* 10.0 (seconds-per-frame))) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.8)) + (seek! (-> self legs-strength 3) 0.4 (* 10.0 (seconds-per-frame))) + ) + (if (time-elapsed? (-> self state-time) (seconds 1.6)) + (seek! (-> self legs-strength 1) 0.0 (* 10.0 (seconds-per-frame))) + ) + (if (time-elapsed? (-> self state-time) (seconds 2.4)) + (seek! (-> self legs-strength 2) 0.5 (* 10.0 (seconds-per-frame))) + ) + (when (time-elapsed? (-> self state-time) (seconds 2.8)) + (sound-play "bb-explode") + (go-virtual explode) + ) + (when (< (-> self beep-time) (current-time)) + (sound-play "bb-beep") + (set! (-> self beep-time) + (+ (current-time) (the int (* 0.2 (the float (- (seconds 2.8) (- (current-time) (-> self state-time))))))) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + (ja-no-eval :group! bombbot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (set! (-> self root transv y) 0.0) + (nav-enemy-method-187 self) + ) + ) + +;; definition for symbol *bombbot-debris-params*, type debris-static-params +(define *bombbot-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 7 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 15 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 18 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 19 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 16 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 17 :group "skel-kg-debris-d") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +;; failed to figure out what this is: +(defstate explode (bombbot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (set! (-> self explosing) #f) + (set-time! (-> self state-time)) + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-1 duration) (seconds 3)) + (set! (-> a1-1 gravity) -163840.0) + (set! (-> a1-1 scale-rand-lo) 1.0) + (set! (-> a1-1 scale-rand-hi) 3.0) + (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self root trans quad)) + (debris-spawn self a1-1 *bombbot-debris-params* (the-as process-drawable #f)) + ) + (let ((v1-15 (new 'stack-no-clear 'vector))) + (set! (-> v1-15 quad) (-> self root trans quad)) + (+! (-> v1-15 y) 2048.0) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self node-list data 3 bone transform trans quad)) + (new 'stack-no-clear 'vector) + 4.0 + (+! (-> s5-0 y) 8192.0) + (activate! *camera-smush-control* 1024.0 37 210 1.0 0.995 (-> self clock)) + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> s5-0 quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) 61440.0) + (set! (-> gp-0 scale) 1.0) + (set! (-> gp-0 group) (-> *part-group-id-table* 217)) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-0 damage) 2.0) + (set! (-> gp-0 damage-scale) 1.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle #f)) + (explosion-spawn gp-0 self) + ) + ) + (dotimes (gp-1 4) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 (* 16384.0 (the float gp-1)))) + (set-vector! s4-0 (cos f30-0) 0.0 (sin f30-0) 1.0) + ) + (vector-float*! s4-0 s4-0 (* 4096.0 (+ 2.0 (* 2.0 (rand-vu))))) + (set! (-> s5-1 quad) (-> self root trans quad)) + (vector+! (-> self root trans) (-> self root trans) s4-0) + (set! (-> self fact pickup-type) (pickup-type ammo-random)) + (set! (-> self fact pickup-amount) 10.0) + (set! (-> self fact pickup-spawn-amount) 2.0) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + (set! (-> self root trans quad) (-> s5-1 quad)) + ) + ) + (set! (-> self explosing) #t) + (set! (-> self root nav-flags) (nav-flags)) + (let ((v1-62 (-> self root root-prim))) + (set! (-> v1-62 prim-core collide-as) (collide-spec)) + (set! (-> v1-62 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-set! 0) + (ja-post) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 7 of type bombbot +(defmethod relocate ((this bombbot) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this joint-ik v1-0)) + (&+! (-> this joint-ik v1-0) offset) + ) + ) + (if (nonzero? (-> this rigidbody)) + (&+! (-> this rigidbody) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 120 of type bombbot +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this bombbot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 34) 0))) + (set! (-> s5-0 total-prims) (the-as uint 35)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 32768.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec bot enemy)) + (set! (-> v1-12 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set-vector! (-> v1-12 local-sphere) 0.0 20480.0 0.0 20480.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 1638.4 0.0 8192.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-16 transform-index) 19) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-18 transform-index) 19) + (set-vector! (-> v1-18 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-20 transform-index) 19) + (set-vector! (-> v1-20 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-22 transform-index) 19) + (set-vector! (-> v1-22 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-24 transform-index) 18) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-26 transform-index) 18) + (set-vector! (-> v1-26 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-28 transform-index) 18) + (set-vector! (-> v1-28 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-30 transform-index) 18) + (set-vector! (-> v1-30 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-32 transform-index) 13) + (set-vector! (-> v1-32 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-34 transform-index) 13) + (set-vector! (-> v1-34 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-36 transform-index) 13) + (set-vector! (-> v1-36 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-38 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-38 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-38 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-38 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-38 transform-index) 13) + (set-vector! (-> v1-38 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-40 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-40 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-40 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-40 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-40 transform-index) 12) + (set-vector! (-> v1-40 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-42 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-42 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-42 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-42 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-42 transform-index) 12) + (set-vector! (-> v1-42 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-44 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-44 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-44 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-44 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-44 transform-index) 12) + (set-vector! (-> v1-44 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-46 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-46 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-46 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-46 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-46 transform-index) 12) + (set-vector! (-> v1-46 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-48 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-48 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-48 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-48 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-48 transform-index) 17) + (set-vector! (-> v1-48 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-50 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-50 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-50 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-50 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-50 transform-index) 17) + (set-vector! (-> v1-50 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-52 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-52 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-52 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-52 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-52 transform-index) 17) + (set-vector! (-> v1-52 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-54 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-54 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-54 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-54 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-54 transform-index) 17) + (set-vector! (-> v1-54 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-56 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-56 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-56 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-56 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-56 transform-index) 16) + (set-vector! (-> v1-56 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-58 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-58 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-58 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-58 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-58 transform-index) 16) + (set-vector! (-> v1-58 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-60 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-60 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-60 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-60 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-60 transform-index) 16) + (set-vector! (-> v1-60 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-62 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-62 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-62 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-62 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-62 transform-index) 16) + (set-vector! (-> v1-62 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-64 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-64 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-64 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-64 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-64 transform-index) 15) + (set-vector! (-> v1-64 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-66 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-66 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-66 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-66 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-66 transform-index) 15) + (set-vector! (-> v1-66 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-68 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-68 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-68 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-68 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-68 transform-index) 15) + (set-vector! (-> v1-68 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-70 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-70 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-70 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-70 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-70 transform-index) 15) + (set-vector! (-> v1-70 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-72 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-72 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-72 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-72 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-72 transform-index) 14) + (set-vector! (-> v1-72 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-74 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-74 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-74 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-74 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-74 transform-index) 14) + (set-vector! (-> v1-74 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-76 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-76 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-76 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-76 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-76 transform-index) 14) + (set-vector! (-> v1-76 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-78 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) + (set! (-> v1-78 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-78 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-78 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-78 transform-index) 14) + (set-vector! (-> v1-78 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (set! (-> s5-0 nav-radius) 22528.0) + (let ((v1-80 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-80 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-80 prim-core collide-with)) + ) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + (set! (-> this root max-iteration-count) (the-as uint 8)) + 0 + (none) + ) + +;; definition for method 67 of type bombbot +(defmethod coin-flip? ((this bombbot)) + #f + ) + +;; definition for function bombbot-callback +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun bombbot-callback ((arg0 cspace) (arg1 transformq)) + (local-vars + (sv-176 (function quaternion quaternion quaternion quaternion)) + (sv-192 quaternion) + (sv-208 quaternion) + (sv-224 vector) + (sv-240 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) *unity-quaternion*)) + ) + (let ((f30-0 0.0) + (s2-0 (vector-reset! (new 'stack-no-clear 'vector))) + ) + (dotimes (s0-0 4) + (let ((v1-3 (-> s4-0 feet s0-0))) + (let ((a1-2 s2-0)) + (let ((a0-2 s2-0)) + (let ((a2-1 (+ (the-as uint (-> s4-0 feet 0 real-position)) (* 112 s0-0)))) + (let ((a3-3 0.25)) + (.mov vf7 a3-3) + ) + (.lvf vf5 (&-> (the-as (pointer int128) a2-1))) + ) + (.lvf vf4 (&-> a0-2 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 (&-> a1-2 quad) vf6) + ) + (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y))) + (set! (-> v1-3 main-y) (-> v1-3 delta-y)) + (+! f30-0 (* 0.25 (-> v1-3 main-y))) + (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) + (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) + (new 'stack-no-clear 'vector) + (set! sv-224 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-3 pos-offset) 1.0)) + ) + (set! sv-240 (vector-normalize-copy! (new 'stack-no-clear 'vector) s1-0 1.0)) + (let ((f0-8 (vector-vector-angle-safe sv-224 sv-240))) + (when (!= f0-8 0.0) + (set! sv-176 quaternion*!) + (set! sv-192 s3-0) + (set! sv-208 s3-0) + (let ((t9-4 quaternion-vector-angle!) + (a0-14 (new 'stack-no-clear 'quaternion)) + (a1-8 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> sv-224 quad)) + (.lvf vf2 (&-> sv-240 quad)) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> a1-8 quad) vf3) + (let ((a2-5 (t9-4 a0-14 a1-8 f0-8))) + (sv-176 sv-192 sv-208 a2-5) + ) + ) + ) + ) + ) + (let* ((f0-9 0.0) + (f0-10 (+ -16384.0 f0-9)) + (f2-0 (- f30-0 (-> s4-0 main-pos-y))) + (f1-7 (- (-> s4-0 main-spd-y))) + (f0-12 (+ f0-10 (* 60.0 f2-0) (* 10.0 f1-7))) + ) + (+! (-> s4-0 main-spd-y) (* f0-12 (seconds-per-frame))) + ) + (+! (-> s4-0 main-pos-y) (* (-> s4-0 main-spd-y) (seconds-per-frame))) + (vector-! s2-0 s2-0 (-> s4-0 root trans)) + (vector-inv-orient-by-quat! s2-0 s2-0 (-> s4-0 root quat)) + (let ((a1-13 (-> s4-0 main-pos))) + (let ((v1-19 (-> s4-0 main-pos))) + (let ((a0-20 (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-0 main-pos)))) + (let ((a2-10 (* 4.0 (seconds-per-frame)))) + (.mov vf7 a2-10) + ) + (.lvf vf5 (&-> a0-20 quad)) + ) + (.lvf vf4 (&-> v1-19 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 (&-> a1-13 quad) vf6) + ) + ) + (quaternion-slerp! (-> s4-0 main-quat) (-> s4-0 main-quat) s3-0 0.8) + ) + (quaternion-copy! (-> arg1 quat) (-> s4-0 main-quat)) + (set! (-> arg1 trans quad) (-> s4-0 main-pos quad)) + (set! (-> arg1 trans y) (+ 16384.0 (-> s4-0 main-pos-y))) + (quaternion-copy! (-> arg1 quat) (the-as quaternion (-> s4-0 rigidbody rot))) + (set! (-> arg1 trans quad) + (-> (rigid-body-control-method-25 (-> s4-0 rigidbody) (new 'stack-no-clear 'vector)) quad) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +;; definition for function bombbot-head-callback +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun bombbot-head-callback ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((a1-1 (-> s4-0 nav state))) + (set! (-> s2-0 quad) (-> a1-1 target-pos quad)) + ) + (vector-! s2-0 s2-0 (-> s4-0 root trans)) + (set! (-> s2-0 y) 0.0) + (let ((a1-6 (-> s4-0 nav state))) + (set! (-> s2-0 quad) (-> a1-6 heading quad)) + ) + (vector-normalize! s2-0 1.0) + (quaternion-from-two-vectors! + s3-0 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root quat)) + s2-0 + ) + (quaternion-smooth-seek! (-> s4-0 top-quat) (-> s4-0 top-quat) s3-0 (* 4.0 (seconds-per-frame))) + ) + (quaternion-copy! (-> arg1 quat) (-> s4-0 top-quat)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +;; definition for function bombbot-gun-swivel-callback +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun bombbot-gun-swivel-callback ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-128 vector) (sv-144 vector) (sv-160 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s3-0 (the-as bombbot (-> arg0 param1)))) + (set! sv-160 (new 'stack-no-clear 'vector)) + (let ((s4-0 (new 'stack-no-clear 'quaternion)) + (s0-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector))) + ) + (set! sv-144 sv-160) + (set! sv-128 (-> s3-0 target-pos)) + (let ((v0-2 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) + (.lvf vf4 (&-> sv-128 quad)) + (.lvf vf5 (&-> v0-2 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-144 quad) vf6) + (rot-zxy-from-vector! s0-0 (-> arg0 bone transform fvec)) + (rot-zxy-from-vector! s0-0 *z-vector*) + (rot-zxy-from-vector! s1-0 sv-160) + (set! (-> s2-0 x) (deg- (-> s1-0 x) (-> s0-0 x))) + (set! (-> s2-0 y) (deg- (-> s1-0 y) (-> s0-0 y))) + (set! (-> s2-0 y) (deg- (-> s1-0 y) 0.0)) + (set! (-> s3-0 angle-turret) (deg-seek (-> s3-0 angle-turret) (-> s2-0 y) (* 36408.89 (seconds-per-frame)))) + (quaternion-vector-angle! s4-0 *up-vector* (-> s3-0 angle-turret)) + (quaternion->matrix (-> arg0 bone transform) s4-0) + (set! (-> arg0 bone transform trans quad) (-> s5-0 quad)) + ) + ) + 0 + (none) + ) + ) + +;; definition for function bombbot-gun-callback +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun bombbot-gun-callback ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-112 vector) (sv-128 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-128 s0-0) + (set! sv-112 (-> s4-0 target-pos)) + (let ((v0-1 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) + (.lvf vf4 (&-> sv-112 quad)) + (.lvf vf5 (&-> v0-1 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-128 quad) vf6) + (rot-zxy-from-vector! s2-0 (-> arg0 bone transform fvec)) + (rot-zxy-from-vector! s1-0 s0-0) + (set! (-> s3-0 x) (fmax -4551.1113 (fmin 4551.1113 (deg- (-> s1-0 x) (-> s2-0 x))))) + (set! (-> s3-0 y) (deg- (-> s1-0 y) (-> s2-0 y))) + (set! (-> s4-0 angle-gun) + (deg-seek (-> s4-0 angle-gun) (-> s3-0 x) (* (-> s4-0 gun-rotation-speed) (seconds-per-frame))) + ) + ) + ) + (quaternion-vector-angle! (-> arg1 quat) *x-vector* (+ (-> s4-0 angle-gun) (-> s4-0 extra-angle-gun))) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +;; definition of type spring-setup +(deftype spring-setup (structure) + ((bpos1 vector) + (wpos2 vector) + ) + ) + +;; definition for method 3 of type spring-setup +(defmethod inspect ((this spring-setup)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'spring-setup) + (format #t "~1Tbpos1: #~%" (-> this bpos1)) + (format #t "~1Twpos2: #~%" (-> this wpos2)) + (label cfg-4) + this + ) + +;; definition for symbol *bombbot-spring-setup*, type (array spring-setup) +(define *bombbot-spring-setup* (new 'static 'boxed-array :type spring-setup + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x 4096.0 :y -4096.0 :z 4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x 6144.0 :y 14336.0 :z 6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x 4096.0 :y -4096.0 :z -4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x 6144.0 :y 14336.0 :z -6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x -4096.0 :y -4096.0 :z -4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x -6144.0 :y 14336.0 :z -6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x -4096.0 :y -4096.0 :z 4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x -6144.0 :y 14336.0 :z 6144.0 :w 1.0) + ) + ) + ) + +;; definition for method 198 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-198 ((this bombbot)) + (local-vars (at-0 int) (sv-160 vector) (sv-176 vector)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (vector-reset! a1-0) + (set! (-> a1-0 y) (* -1.0 (-> this info extra gravity) (-> this rigidbody info mass))) + (add-force! (-> this rigidbody) a1-0) + ) + (rigid-body-control-method-26 (-> this rigidbody)) + (logclear! (-> this rigidbody flags) (rigid-body-flag active)) + (dotimes (s5-0 4) + (let ((s4-0 (vector-matrix*! + (new 'stack-no-clear 'vector) + (-> *bombbot-spring-setup* s5-0 bpos1) + (-> this rigidbody matrix) + ) + ) + ) + (set! sv-160 (new 'stack-no-clear 'vector)) + (let ((v1-19 (-> *bombbot-spring-setup* s5-0 wpos2 quad))) + (set! (-> sv-160 quad) v1-19) + ) + (set! sv-176 (new 'stack-no-clear 'vector)) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> sv-160 y) (* (-> this legs-strength s5-0) (-> sv-160 y))) + (+! (-> sv-160 y) (-> this feet s5-0 main-y)) + 0.0 + 0.0 + 0.0 + (rigid-body-control-method-23 (-> this rigidbody) s4-0 sv-176) + (let ((v1-31 s0-0)) + (.lvf vf4 (&-> s4-0 quad)) + (.lvf vf5 (&-> sv-160 quad)) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-31 quad) vf6) + ) + (let ((a1-4 s1-0) + (v1-32 *null-vector*) + ) + (vector-! a1-4 sv-176 v1-32) + ) + (let ((f0-10 (vector-length s0-0))) + (vector-float*! s2-0 s0-0 (/ 1.0 f0-10)) + (let ((f0-12 (* 60.0 (+ -40.96 f0-10))) + (f1-8 (* 0.8 (vector-dot s1-0 s2-0))) + ) + (vector-float*! s3-0 s2-0 (- (+ f0-12 f1-8))) + ) + ) + (apply-impact! (-> this rigidbody) s4-0 s3-0) + ) + ) + ) + (let ((v1-48 (new 'stack-no-clear 'vector))) + (.lvf vf1 (&-> (-> this linear-speed) quad)) + (let ((f0-15 (-> pp clock frames-per-second))) + (.mov at-0 f0-15) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-48 quad) vf1) + ) + 0 + (none) + ) + ) + ) + +;; definition for method 199 of type bombbot +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-199 ((this bombbot)) + (rigid-body-control-method-10 + (-> this rigidbody) + (the-as rigid-body-object this) + (seconds-per-frame) + 0.033333335 + ) + 0 + (none) + ) + +;; definition for method 121 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this bombbot)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *bombbot-nav-enemy-info*) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (let ((v1-7 (-> this nav))) + (set! (-> v1-7 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (dotimes (s5-1 4) + (set! (-> this joint-ik s5-1) + (new + 'process + 'joint-mod-ik + this + (-> *bombbot-ik-limb-setup* s5-1 elbow-index) + (-> *bombbot-ik-limb-setup* s5-1 hand-dist) + ) + ) + (set! (-> this joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + ) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 3 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 2 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 3 flags) (joint-mod-ik-flags elbow-rot-neg)) + (let ((f1-0 11878.4) + (f0-6 10240.0) + ) + (let ((f2-0 -10240.0)) + (let ((v1-51 (-> this feet))) + (set! (-> v1-51 0 pos-offset x) f1-0) + (set! (-> v1-51 0 pos-offset y) 0.0) + (set! (-> v1-51 0 pos-offset z) f0-6) + (set! (-> v1-51 0 pos-offset w) 1.0) + ) + (set! (-> this feet 0 offset) 0.0) + (let ((v1-52 (-> this feet 1))) + (set! (-> v1-52 pos-offset x) f1-0) + (set! (-> v1-52 pos-offset y) 0.0) + (set! (-> v1-52 pos-offset z) f2-0) + (set! (-> v1-52 pos-offset w) 1.0) + ) + (set! (-> this feet 1 offset) 0.5) + (let ((v1-54 (-> this feet 2))) + (set! (-> v1-54 pos-offset x) (- f1-0)) + (set! (-> v1-54 pos-offset y) 0.0) + (set! (-> v1-54 pos-offset z) f2-0) + (set! (-> v1-54 pos-offset w) 1.0) + ) + ) + (set! (-> this feet 2 offset) 0.1) + (let ((v1-56 (-> this feet 3))) + (set! (-> v1-56 pos-offset x) (- f1-0)) + (set! (-> v1-56 pos-offset y) 0.0) + (set! (-> v1-56 pos-offset z) f0-6) + (set! (-> v1-56 pos-offset w) 1.0) + ) + ) + (set! (-> this feet 3 offset) 0.6) + (quaternion-copy! (-> this last-quat) (-> this root quat)) + (quaternion-copy! (-> this main-quat) *unity-quaternion*) + (let ((v1-60 (-> this nav))) + (set! (-> v1-60 sphere-mask) (the-as uint 68)) + ) + 0 + (let ((a0-28 (-> this node-list data 3))) + (set! (-> a0-28 param0) bombbot-callback) + (set! (-> a0-28 param1) this) + ) + (let ((a0-29 (-> this node-list data 4))) + (set! (-> a0-29 param0) bombbot-head-callback) + (set! (-> a0-29 param1) this) + ) + (let ((a0-30 (-> this node-list data 5))) + (set! (-> a0-30 param0) bombbot-gun-swivel-callback) + (set! (-> a0-30 param1) this) + ) + (let ((a0-31 (-> this node-list data 6))) + (set! (-> a0-31 param0) bombbot-gun-callback) + (set! (-> a0-31 param1) this) + ) + (set! (-> this rigidbody) (new 'process 'rigid-body-control this)) + (set! (-> this info) *bombbot-body-constants*) + (init! + (-> this rigidbody) + (-> this info info) + *null-vector* + *unity-quaternion* + (the-as (function rigid-body-object float) (method-of-object this bombbot-method-198)) + ) + (set! (-> this head-sound) (new 'static 'sound-id)) + (set! (-> this cannon-sound) (new 'static 'sound-id)) + (set! (-> this gun-rotation-speed) 7281.778) + (set! (-> this extra-angle-gun) 0.0) + (transform-post) + (dotimes (s5-2 4) + (let ((s4-1 (-> this feet s5-2))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> this root quat)) + (vector+! s3-0 s3-0 (-> this root trans)) + (set! (-> s4-1 next-position quad) (-> s3-0 quad)) + (set! (-> s4-1 position quad) (-> s3-0 quad)) + ) + (set! (-> s4-1 delta-y) 0.0) + ) + (set! (-> this legs-strength s5-2) 1.0) + ) + (set! (-> this draw light-index) (the-as uint 10)) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! s5-3 (-> this root quat)) + (set! (-> this y-angle) (vector-y-angle s5-3)) + (set! (-> this nav state heading quad) (-> s5-3 quad)) + ) + 0 + (set! (-> this max-hit-points) (-> this hit-points)) + 0 + (none) + ) + +;; definition of type bombbot-spawn-params +(deftype bombbot-spawn-params (structure) + ((position vector :inline) + (quat quaternion :inline) + (nav-mesh nav-mesh) + (path bombbot-path) + (first-node uint32) + (stop-offset float) + ) + ) + +;; definition for method 3 of type bombbot-spawn-params +(defmethod inspect ((this bombbot-spawn-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bombbot-spawn-params) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~1Tpath: #~%" (-> this path)) + (format #t "~1Tfirst-node: ~D~%" (-> this first-node)) + (format #t "~1Tstop-offset: ~f~%" (-> this stop-offset)) + (label cfg-4) + this + ) + +;; definition for function bombbot-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior bombbot-init-by-other bombbot ((arg0 bombbot-spawn-params)) + (stack-size-set! (-> self main-thread) 512) + (set! (-> self city-path) (-> arg0 path)) + (set! (-> self current-node) (-> arg0 first-node)) + (init-enemy-collision! self) + (set! (-> self root trans quad) (-> self city-path node (-> self current-node) position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (vector-identity! (-> self root scale)) + (-> arg0 nav-mesh) + (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + (init-enemy! self) + (set! (-> self shot-count) (the-as uint 5)) + (set! (-> self last-trans quad) (-> self root trans quad)) + (logior! (-> self mask) (process-mask kg-robot)) + (set! (-> self minimap) #f) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) + (logior! (-> self mask) (process-mask enemy)) + (set! (-> self stop-shoot) (+ (current-time) (the int (-> arg0 stop-offset)))) + (set! (-> self shoot-duration) 1.0) + (set! (-> self draw light-index) (the-as uint 10)) + (go-virtual hostile) + (none) + ) + +;; definition for method 84 of type bombbot +(defmethod send-attack-on-jump-or-knocked ((this bombbot) (arg0 process) (arg1 event-message-block)) + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-1 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask guard vehicle civilian kg-robot metalhead) (-> arg0 mask)) + (and v1-1 + (not (logtest? (-> (the-as process-focusable v1-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + +;; definition of type bomb-bot +(deftype bomb-bot (bombbot) + () + ) + +;; definition for method 3 of type bomb-bot +(defmethod inspect ((this bomb-bot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bombbot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 196 of type bomb-bot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-196 ((this bomb-bot) (arg0 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as process-focusable #f))) + (let ((f30-0 (the-as float #x7f800000)) + (s4-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (countdown (s3-0 (fill-actor-list-for-box *actor-hash* arg0 s4-0 64)) + (let* ((s2-0 (-> s4-0 s3-0)) + (a0-3 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (when a0-3 + (let* ((s1-0 (-> a0-3 process)) + (s2-1 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when (and (the-as process-focusable s2-1) + (and (!= this (the-as process-focusable s2-1)) + (not (focus-test? this inactive)) + (not (focus-test? this disable)) + (not (focus-test? this dead)) + (let ((s1-1 (the-as process-focusable s2-1))) + (and (if (type? s1-1 bombbot) + s1-1 + ) + (the-as process-focusable s2-1) + (not (logtest? (-> (the-as process-focusable s2-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + ) + ) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> (the-as process-focusable s2-1) root trans)))) + (when (or (not gp-0) (< f0-0 f30-0)) + (set! gp-0 (the-as process-focusable s2-1)) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + ) + ) + (cond + (gp-0 + (set! (-> this target-pos quad) (-> (get-trans gp-0 3) quad)) + (let ((v1-25 (-> this target-pos))) + (let ((a0-12 (-> gp-0 root trans))) + (let ((a1-7 (-> gp-0 root transv))) + (let ((a2-1 0.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-7 quad)) + ) + (.lvf vf4 (&-> a0-12 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 (&-> v1-25 quad) vf6) + ) + (set! (-> this start-target-pos quad) (-> this target-pos quad)) + (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) + (try-update-focus (-> this focus) gp-0 this) + ) + (else + (clear-focused (-> this focus)) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 122 of type bomb-bot +(defmethod go-idle2 ((this bomb-bot)) + (go (method-of-object this hostile)) + ) + +;; failed to figure out what this is: +(defstate hostile (bomb-bot) + :virtual #t + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (< (-> self next-target) (current-time)) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (set! (-> a1-0 w) 409600.0) + (bombbot-method-196 self a1-0) + ) + (set! (-> self next-target) (+ (current-time) (seconds 4))) + (set! (-> self gun-type) (the-as uint 0)) + 0 + ) + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when gp-0 + (when (< (current-time) (+ (-> self next-target) (seconds -2))) + (set-time! (-> self start-target)) + (set! (-> self start-target-pos quad) (-> (get-trans gp-0 3) quad)) + (set! (-> self start-target-vel quad) (-> gp-0 root transv quad)) + (vector-! (-> self target-delta) (-> gp-0 root trans) (-> self root trans)) + ) + (let ((a1-5 (-> self target-pos))) + (let ((v1-26 (-> self start-target-pos))) + (let ((a0-17 (-> self start-target-vel))) + (let ((a2-4 (* 0.0033333334 (the float (- (current-time) (-> self start-target)))))) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-17 quad)) + ) + (.lvf vf4 (&-> v1-26 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 (&-> a1-5 quad) vf6) + ) + (set! (-> self target-pos quad) (-> self start-target-pos quad)) + (if (< (+ (-> self next-target) (seconds -1)) (current-time)) + (bombbot-method-197 self) + (bombbot-method-204 self) + ) + ) + ) + (bombbot-method-205 self) + (new 'stack-no-clear 'vector) + (let ((f0-4 (* 0.25 (+ (-> self feet 0 next-position y) + (-> self feet 1 next-position y) + (-> self feet 2 next-position y) + (-> self feet 3 next-position y) + ) + ) + ) + ) + (if (!= (-> self nav state mesh) *default-nav-mesh*) + (+! (-> self root trans y) (* 4.0 (seconds-per-frame) (- f0-4 (-> self root trans y)))) + ) + ) + (if (= (vector-length (-> self root transv)) 0.0) + (set-time! (-> self state-time)) + ) + (bombbot-method-202 self) + (bombbot-method-195 self) + ) + ) + :post (behavior () + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (enemy-common-post self) + (update-transforms (-> self root)) + ) + (else + (if (logtest? (-> self nav state flags) (nav-state-flag at-target)) + (nav-enemy-method-164 self) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> self nav state target-pos quad)) + (nav-enemy-method-187 self) + ) + ) + ) + ) + +;; definition for method 11 of type bomb-bot +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this bomb-bot) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (init-enemy-collision! this) + (process-drawable-from-entity! this arg0) + (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + (init-enemy! this) + (set! (-> this shot-count) (the-as uint 5)) + (set! (-> this last-trans quad) (-> this root trans quad)) + (logior! (-> this mask) (process-mask kg-robot)) + (set! (-> this minimap) #f) + (logior! (-> this mask) (process-mask enemy)) + (set-time! (-> this stop-shoot)) + (set! (-> this shoot-duration) 1.0) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this hit-points) 35.0) + (let ((v1-19 (-> this nav state)) + (a0-13 (-> this root trans)) + ) + (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-19 target-pos quad) (-> a0-13 quad)) + ) + 0 + (set! (-> this max-hit-points) (-> this hit-points)) + (go (method-of-object this hostile)) + ) + +;; definition of type bombbot-player +(deftype bombbot-player (bombbot) + ((camera-x-angle float) + (hold-fire symbol) + (hold-fire-time time-frame) + (health-hud handle) + ) + (:state-methods + done + ) + ) + +;; definition for method 3 of type bombbot-player +(defmethod inspect ((this bombbot-player)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bombbot inspect))) + (t9-0 this) + ) + (format #t "~2Tcamera-x-angle: ~f~%" (-> this camera-x-angle)) + (format #t "~2Thold-fire: ~A~%" (-> this hold-fire)) + (format #t "~2Thold-fire-time: ~D~%" (-> this hold-fire-time)) + (format #t "~2Thealth-hud: ~D~%" (-> this health-hud)) + (label cfg-4) + this + ) + +;; definition for method 139 of type bombbot-player +;; INFO: Used lq/sq +(defmethod move-above-ground! ((this bombbot-player) (arg0 vector) (arg1 move-above-ground-params)) + (let ((a1-1 (new 'stack-no-clear 'collide-query))) + (find-ground + (-> this root) + a1-1 + (-> this enemy-info gnd-collide-with) + 16384.0 + 81920.0 + 1024.0 + (the-as process #f) + ) + ) + (-> *math-camera* inv-camera-rot) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> *math-camera* inv-camera-rot fvec quad)) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((a1-2 (new 'stack-no-clear 'collide-query))) + (new 'stack-no-clear 'vector) + (let ((v1-10 (-> a1-2 bbox)) + (a0-6 (-> this root trans)) + (a2-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-2 x) 40960.0) + (set! (-> a2-2 y) -8192.0) + (set! (-> a2-2 z) 40960.0) + (set! (-> a2-2 w) 1.0) + (vector-! (the-as vector v1-10) a0-6 a2-2) + ) + (let ((v1-12 (-> a1-2 bbox max)) + (a0-8 (-> this root trans)) + (a2-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-3 x) 40960.0) + (set! (-> a2-3 y) 32768.0) + (set! (-> a2-3 z) 40960.0) + (set! (-> a2-3 w) 1.0) + (vector+! v1-12 a0-8 a2-3) + ) + (set! (-> a1-2 collide-with) (collide-spec backgnd)) + (set! (-> a1-2 ignore-process0) #f) + (set! (-> a1-2 ignore-process1) #f) + (set! (-> a1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (fill-using-bounding-box *collide-cache* a1-2) + ) + (dotimes (s4-0 (-> *collide-cache* num-tris)) + (let ((a0-11 (-> *collide-cache* tris s4-0))) + (when (!= (-> a0-11 pat mode) (pat-mode wall)) + (mem-copy! + (the-as pointer (-> *collide-cache* tris s4-0)) + (the-as pointer (-> *collide-cache* tris (+ (-> *collide-cache* num-tris) -1))) + 64 + ) + (+! (-> *collide-cache* num-tris) -1) + (+! (-> *collide-cache* prims 0 num-tris) -1) + (+! s4-0 -1) + ) + ) + ) + (let ((v1-40 (new 'stack-no-clear 'collide-query)) + (a0-19 (-> this root)) + ) + (set! (-> v1-40 collide-with) (collide-spec backgnd)) + (set! (-> v1-40 ignore-process0) this) + (set! (-> v1-40 ignore-process1) #f) + (set! (-> v1-40 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-40 action-mask) (collide-action solid)) + (integrate-and-collide! a0-19 arg0) + ) + (none) + ) + +;; definition for method 59 of type bombbot-player +;; WARN: Return type mismatch float vs none. +(defmethod enemy-common-post ((this bombbot-player)) + (let ((t9-0 (method-of-type bombbot enemy-common-post))) + (t9-0 this) + ) + (set! (-> *game-info* health-bar) (* 100.0 (/ (-> this hit-points) (-> this max-hit-points)))) + (let ((f0-3 (* 0.25 (+ (-> this feet 0 next-position y) + (-> this feet 1 next-position y) + (-> this feet 2 next-position y) + (-> this feet 3 next-position y) + ) + ) + ) + ) + (when (!= (-> this nav state mesh) *default-nav-mesh*) + (+! (-> this root trans y) (* 4.0 (seconds-per-frame) (- f0-3 (-> this root trans y)))) + (if (< (-> this root trans y) (+ -12288.0 (-> this root gspot-pos y))) + (set! (-> this root trans y) (+ -12288.0 (-> this root gspot-pos y))) + ) + ) + ) + (none) + ) + +;; definition for method 21 of type bombbot-player +(defmethod get-trans ((this bombbot-player) (arg0 int)) + "Get the `trans` for this process." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (cond + ((= arg0 4) + (let ((gp-0 (new 'static 'vector))) + (let ((v1-2 (-> this root trans))) + (let ((a0-1 *y-vector*)) + (let ((a1-2 12288.0)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-2 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 (&-> gp-0 quad) vf6) + (let ((s4-0 gp-0)) + (let ((s5-0 gp-0)) + (let ((v1-3 (-> (camera-matrix) rvec))) + (let ((a0-2 0.0)) + (.mov vf7 a0-2) + ) + (.lvf vf5 (&-> v1-3 quad)) + ) + (.lvf vf4 (&-> s5-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 (&-> s4-0 quad) vf6) + ) + gp-0 + ) + ) + (else + ((method-of-type nav-enemy get-trans) this arg0) + ) + ) + ) + ) + +;; definition for method 196 of type bombbot-player +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-196 ((this bombbot-player) (arg0 vector)) + (local-vars + (sv-864 process-drawable) + (sv-868 number) + (sv-872 vector) + (sv-876 vector) + (sv-880 collide-query) + (sv-884 (pointer collide-shape)) + (sv-888 vector) + (sv-896 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! sv-864 (the-as process-drawable #f)) + (set! sv-868 (gpr->fpr #x7f800000)) + (set! sv-872 (new 'stack-no-clear 'vector)) + (set! sv-876 (new 'stack-no-clear 'vector)) + (set! sv-880 (new 'stack-no-clear 'collide-query)) + (set! sv-884 (new 'stack-no-clear 'array 'collide-shape 64)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> (camera-matrix) fvec quad)) + (set! sv-888 s5-0) + ) + (set! sv-896 0) + (set! (-> sv-888 y) 0.0) + (vector-normalize! sv-888 1.0) + (let ((s5-1 sv-876)) + (let ((v1-8 (camera-pos))) + (let ((a0-2 sv-888)) + (let ((a1-3 40960.0)) + (.mov vf7 a1-3) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-8 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 (&-> s5-1 quad) vf6) + ) + (set! (-> sv-876 quad) (-> (get-trans this 4) quad)) + (matrix->trans (-> this node-list data 6 bone transform) sv-872) + (set! (-> sv-876 y) (-> sv-872 y)) + (vector-normalize-copy! sv-872 sv-888 204800.0) + (set! (-> sv-880 start-pos quad) (-> sv-876 quad)) + (set! (-> sv-880 move-dist quad) (-> sv-872 quad)) + (let ((v1-20 sv-880)) + (set! (-> v1-20 radius) 40.96) + (set! (-> v1-20 collide-with) (collide-spec backgnd)) + (set! (-> v1-20 ignore-process0) this) + (set! (-> v1-20 ignore-process1) #f) + (set! (-> v1-20 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-20 action-mask) (collide-action solid)) + ) + (let ((f0-5 (fill-and-probe-using-line-sphere *collide-cache* sv-880))) + (if (>= f0-5 0.0) + (vector-float*! sv-872 sv-872 f0-5) + ) + ) + (set! sv-896 (fill-actor-list-for-sphere *actor-hash* sv-876 sv-872 40960.0 sv-884 64 -1)) + (countdown (s5-3 sv-896) + (let* ((s4-0 (-> sv-884 s5-3)) + (a0-19 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (when a0-19 + (let* ((s3-0 (-> a0-19 process)) + (s4-1 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (when (and s4-1 + (valid-target? this (the-as process-focusable s4-1)) + (not (logtest? (process-mask guard) (-> s4-1 mask))) + (not (logtest? (process-mask civilian) (-> s4-1 mask))) + (not (logtest? (process-mask vehicle) (-> s4-1 mask))) + ) + (vector-! s3-1 (-> s4-1 root trans) (-> this root trans)) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (when (< (cos 2730.6667) (vector-dot s3-1 sv-888)) + (let ((f0-8 (vector-vector-xz-distance (-> this root trans) (-> s4-1 root trans)))) + (when (and (or (not sv-864) (< f0-8 (the-as float sv-868))) + (< (-> s4-1 root trans y) (+ 61440.0 (-> this root trans y))) + ) + (set! sv-864 s4-1) + (set! sv-868 f0-8) + ) + ) + ) + ) + ) + ) + ) + (cond + (sv-864 + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable sv-864) 3) quad)) + (set! (-> this start-target-pos quad) (-> sv-864 root trans quad)) + (set! (-> this start-target-vel quad) (-> sv-864 root transv quad)) + (try-update-focus (-> this focus) (the-as process-focusable sv-864) this) + ) + (else + (vector+! (-> this target-pos) sv-876 sv-872) + (clear-focused (-> this focus)) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 197 of type bombbot-player +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-197 ((this bombbot-player)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (handle->process (-> this focus handle)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> this node-list data 6 bone transform)) + (v1-7 (-> a2-0 rvec quad)) + (a0-5 (-> a2-0 uvec quad)) + (a1-1 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 rvec quad) v1-7) + (set! (-> s5-0 uvec quad) a0-5) + (set! (-> s5-0 fvec quad) a1-1) + (set! (-> s5-0 trans quad) a2-1) + ) + (new 'stack-no-clear 'matrix) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (matrix->trans s5-0 s3-0) + (let ((a1-3 s3-0)) + (let ((v1-12 s3-0)) + (let ((a0-7 (-> s5-0 fvec))) + (let ((a2-3 8192.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-7 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> a1-3 quad) vf6) + ) + (vector-normalize-copy! s4-0 (-> s5-0 fvec) 614400.0) + (spawn-bombbot-projectile + this + s3-0 + (vector+! (new 'stack-no-clear 'vector) s3-0 s4-0) + 819200.0 + (the-as vector #f) + 3.0 + ) + (launch-particles (-> *part-id-table* 2055) s3-0) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> s4-0 quad)) + (vector-normalize! s5-1 -2048000.0) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) + (apply-impact! + (-> this rigidbody) + (rigid-body-control-method-25 (-> this rigidbody) (new 'stack-no-clear 'vector)) + s5-1 + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (bombbot-player) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self camera-x-angle) 25.0) + (let ((f30-0 (* 182.04445 (-> self camera-x-angle)))) + (set-setting! 'string-min-height 'abs (+ -4096.0 (* 61440.0 (sin f30-0))) 0) + (set-setting! 'string-max-height 'abs (+ 4096.0 (* 61440.0 (sin f30-0))) 0) + (set-setting! 'string-min-length 'abs (+ -4096.0 (* 61440.0 (cos f30-0))) 0) + (set-setting! 'string-max-length 'abs (+ 4096.0 (* 61440.0 (cos f30-0))) 0) + ) + (set-setting! 'immediate-string-min-max #f 0.0 0) + (logior! (-> self focus-status) (focus-status dangerous)) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (sound-stop (-> self head-sound)) + (sound-stop (-> self cannon-sound)) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((f0-1 (the float (+ (-> *cpad-list* cpads 0 righty) -128)))) + (when (< 32.0 (fabs f0-1)) + (set! (-> self camera-x-angle) (- (-> self camera-x-angle) (* 0.3 (seconds-per-frame) f0-1))) + (if (< 25.0 (-> self camera-x-angle)) + (set! (-> self camera-x-angle) 25.0) + ) + (if (< (-> self camera-x-angle) -4.0) + (set! (-> self camera-x-angle) -4.0) + ) + ) + ) + (let ((f30-0 (* 182.04445 (-> self camera-x-angle)))) + (set-setting! 'string-min-height 'abs (+ -4096.0 (* 61440.0 (sin f30-0))) 0) + (set-setting! 'string-max-height 'abs (+ 4096.0 (* 61440.0 (sin f30-0))) 0) + (set-setting! 'string-min-length 'abs (+ -4096.0 (* 61440.0 (cos f30-0))) 0) + (set-setting! 'string-max-length 'abs (+ 4096.0 (* 61440.0 (cos f30-0))) 0) + (set-setting! 'slave-options 'set 0.0 (cam-slave-options BOMBBOT)) + (if *camera* + (vector-normalize! (-> *camera* slave 0 view-flat) (+ 4096.0 (* 61440.0 (cos f30-0)))) + ) + ) + (set-setting! 'immediate-string-min-max #f 0.0 0) + (let* ((v1-45 *game-info*) + (a0-13 (+ (-> v1-45 attack-id) 1)) + ) + (set! (-> v1-45 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((s5-5 (-> self target-pos))) + (let ((gp-5 (camera-pos))) + (let ((v1-46 (-> (camera-matrix) fvec))) + (let ((a0-15 204800.0)) + (.mov vf7 a0-15) + ) + (.lvf vf5 (&-> v1-46 quad)) + ) + (.lvf vf4 (&-> gp-5 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 (&-> s5-5 quad) vf6) + ) + (let ((a1-7 (new 'stack-no-clear 'vector))) + (set! (-> a1-7 quad) (-> self root trans quad)) + (set! (-> a1-7 w) 204800.0) + (bombbot-method-196 self a1-7) + ) + (set! (-> self next-target) (+ (current-time) (seconds 2))) + (set-time! (-> self start-target)) + (cond + ((and (-> self hold-fire) (>= (+ (current-time) (seconds -0.3)) (-> self hold-fire-time))) + (+! (-> self extra-angle-gun) (* -8192.0 (seconds-per-frame))) + (if (< (-> self extra-angle-gun) -3640.889) + (set! (-> self extra-angle-gun) -3640.889) + ) + ) + (else + (+! (-> self extra-angle-gun) (* 18204.445 (seconds-per-frame))) + (if (< 0.0 (-> self extra-angle-gun)) + (set! (-> self extra-angle-gun) 0.0) + ) + (bombbot-method-204 self) + ) + ) + (when (handle->process (-> self focus handle)) + ) + (when (and (cpad-pressed? 0 r1) (>= (+ (current-time) (seconds -0.02)) (-> self next-shoot))) + (set-time! (-> self next-shoot)) + (bombbot-method-197 self) + ) + (bombbot-method-205 self) + (if (= (vector-length (-> self root transv)) 0.0) + (set-time! (-> self state-time)) + ) + (bombbot-method-202 self) + (bombbot-method-195 self) + (send-event *camera* 'change-target self) + ) + ) + :code (behavior () + (local-vars (v1-1 object)) + (until v1-1 + (suspend) + (set! v1-1 + (and *target* (not (focus-test? *target* teleporting)) (send-event *target* 'change-mode 'grab-ride #t)) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (-> self root) + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (enemy-common-post self) + (update-transforms (-> self root)) + ) + (else + (-> *math-camera* inv-camera-rot) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (vector-rotate90-around-y! s4-0 gp-0) + (vector-cross! gp-0 (-> self root gspot-normal) s4-0) + ) + (vector-rotate-around-y! gp-0 gp-0 (-> *cpad-list* cpads 0 stick0-dir)) + (let ((v1-17 s5-0)) + (let ((a0-10 (-> self root trans))) + (let ((a1-3 gp-0)) + (let ((a2-4 (* 12288.0 (-> *cpad-list* cpads 0 stick0-speed)))) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-10 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 (&-> v1-17 quad) vf6) + ) + (set! (-> self root transv y) 0.0) + (when (< 0.4 (-> *cpad-list* cpads 0 stick0-speed)) + (let ((v1-24 (-> self nav state))) + (logclear! (-> v1-24 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-24 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-24 target-pos quad) (-> s5-0 quad)) + ) + 0 + (when *target* + (quaternion-look-at! (-> *target* control dir-targ) gp-0 *up-vector*) + (quaternion-look-at! (-> *target* control quat) gp-0 *up-vector*) + ) + ) + ) + ) + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 target-speed) (* 49152.0 (-> *cpad-list* cpads 0 stick0-speed))) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate explode (bombbot-player) + :virtual #t + :code (behavior () + (send-event (handle->process (-> self health-hud)) 'hide-and-die) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; failed to figure out what this is: +(defstate done (bombbot-player) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('dead) + #t + ) + ) + ) + :code sleep-code + ) + +;; definition for method 146 of type bombbot-player +;; WARN: Return type mismatch none vs sound-id. +(defmethod play-damage-sound ((this bombbot-player) (arg0 int)) + ((method-of-type bombbot play-damage-sound) this arg0) + (the-as sound-id (if (zero? arg0) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) + ) + ) + ) + +;; definition for function bombbot-player-init-by-other +;; INFO: Used lq/sq +(defbehavior bombbot-player-init-by-other bombbot-player ((arg0 bombbot-spawn-params)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (stack-size-set! (-> self main-thread) 512) + (set! (-> self city-path) (-> arg0 path)) + (set! (-> self current-node) (the-as uint 0)) + (init-enemy-collision! self) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (vector-identity! (-> self root scale)) + (-> arg0 nav-mesh) + (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + (init-enemy! self) + (set! (-> self gun-rotation-speed) 7281.778) + (set! (-> self shot-count) (the-as uint 5)) + (set! (-> self last-trans quad) (-> self root trans quad)) + (set! (-> self minimap) #f) + (logior! (-> self mask) (process-mask enemy guard)) + (send-event *camera* 'change-target self) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'teleport-to-vector-start-string) + (let ((v1-25 (new 'stack-no-clear 'vector))) + (let ((a0-16 (-> arg0 position))) + (let ((a2-0 *z-vector*)) + (let ((a3-1 40960.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> a0-16 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 (&-> v1-25 quad) vf6) + (set! (-> a1-3 param 0) (the-as uint v1-25)) + ) + (send-event-function *camera* a1-3) + ) + (set! (-> self shoot-duration) 1.0) + (set! (-> self hold-fire) #f) + (set! (-> self draw light-index) (the-as uint 10)) + (set! (-> self max-hit-points) (the float (+ (* 50 (the int (you-suck-scale *game-info* #f 0))) 50))) + (set! (-> self hit-points) (-> self max-hit-points)) + (set! (-> self health-hud) + (ppointer->handle (process-spawn bombbot-hud :init hud-init-by-other :name "bombbot-hud" :to self)) + ) + (set! (-> self mission-squad) *cty-attack-controller*) + (when (-> self mission-squad) + (set! (-> self attacker-info) (allocate-attacker (-> self mission-squad))) + (init! (-> self attacker-info) self 13) + (set! (-> self attacker-info max-num-attackers) (the-as uint 16)) + (logior! (-> self attacker-info flags) (city-attacker-info-flag cai1 cai4)) + ) + (go-virtual hostile) + ) + ) + +;; definition of type task-manager-blow-barricade +(deftype task-manager-blow-barricade (task-manager) + ((check-timer time-frame) + (bombbot-h handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (done? int32) + (minimap connection-minimap) + (wall-h handle) + (start-point vector :inline) + ) + (:methods + (task-manager-blow-barricade-method-32 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-blow-barricade +(defmethod inspect ((this task-manager-blow-barricade)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (format #t "~2Tbombbot-h: ~D~%" (-> this bombbot-h)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tdone?: ~D~%" (-> this done?)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Twall-h: ~D~%" (-> this wall-h)) + (format #t "~2Tstart-point: #~%" (-> this start-point)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate active (task-manager-blow-barricade) + :virtual #t + :parent (task-manager-blow-barricade active) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('checkpoint) + #f + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (remove-setting! 'entity-name) + ) + :trans (behavior () + (let ((gp-0 (entity-by-name "krimson-wall-6"))) + (when gp-0 + (if (not (-> self wall-h)) + (set! (-> self wall-h) + (ppointer->handle + (process-spawn krimson-wall-break gp-0 'lbombbot :name "krimson-wall-break" :to *entity-pool*) + ) + ) + ) + ) + ) + (if (and (zero? (-> self done?)) (not (handle->process (-> self bombbot-h)))) + (send-event self 'fail) + ) + (let ((s3-0 (new 'static 'vector :x 4199997.5 :y 30146.56 :z 1763819.5 :w 1.0)) + (s4-0 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (target-pos 0) quad)) + (if (and (< 4096000.0 (vector-vector-distance s5-1 s3-0)) + (< 819200.0 (vector-vector-distance s5-1 (-> self start-point))) + ) + (send-event self 'fail) + ) + (vector+! s4-0 s3-0 (new 'static 'vector :z -163840.0 :w 1.0)) + (vector+! gp-1 s3-0 (new 'static 'vector :x 102400.0 :z 163840.0 :w 1.0)) + (when (and (zero? (-> self done?)) + (< (-> s4-0 x) (-> s5-1 x)) + (< (-> s4-0 z) (-> s5-1 z)) + (< (-> s5-1 x) (-> gp-1 x)) + (< (-> s5-1 z) (-> gp-1 z)) + ) + (set! (-> self done?) 1) + (set-setting! 'entity-name "camera-305" 0.0 0) + (send-event (handle->process (-> self bombbot-h)) 'blow-wall) + ) + ) + (when (= (-> self done?) 1) + (let ((v1-48 (handle->process (-> self bombbot-h)))) + (when (and v1-48 (-> v1-48 next-state) (= (-> v1-48 next-state name) 'explode)) + (set! (-> self done?) 2) + (let ((v1-55 (entity-by-name "krimson-wall-6"))) + (if v1-55 + (send-event (-> v1-55 extra process) 'break) + ) + ) + (send-event (handle->process (-> self wall-h)) 'break) + ) + ) + ) + (when (= (-> self done?) 2) + (when (send-event (handle->process (-> self wall-h)) 'done) + (when (process-release? *target*) + (send-event *target* 'continue (get-continue-by-name *game-info* "hiphog-start")) + (send-event self 'complete) + ) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 32 of type task-manager-blow-barricade +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-blow-barricade-method-32 ((this task-manager-blow-barricade)) + 0 + (none) + ) + +;; definition for symbol *blow-barricade-kg-squad-member-settings*, type (inline-array kg-squad-member-settings) +(define *blow-barricade-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +;; definition for method 21 of type task-manager-blow-barricade +;; INFO: Used lq/sq +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-blow-barricade)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this wall-h) (the-as handle #f)) + (set-setting! 'music 'blowbarr 0.0 0) + (set! (-> this minimap) (add-icon! + *minimap* + this + (the-as uint 12) + (the-as int #f) + (new 'static 'vector :x 4199997.5 :y 30146.56 :z 1763819.5 :w 1.0) + 0 + ) + ) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'city-sound '(citybbf) 0.0 2) + (set-setting! 'disable-parking-spots? #t 0.0 0) + (when *cty-attack-controller* + (let ((s5-0 (push-back-hatred *cty-attack-controller*))) + (set! (-> s5-0 hatred) 0.6) + (set! (-> s5-0 hatred-dist) 245760.0) + (set! (-> s5-0 dist-scale) 0.5) + (set! (-> s5-0 attacker-scale) 0.01) + (set! (-> s5-0 max-consider-dist) 614400.0) + (set-hatred-indices-for-all *cty-attack-controller* 0 (get-hatred-at-idx *cty-attack-controller* 9 0) s5-0 13) + ) + ) + (set-vector! (-> this start-point) 2538700.8 31539.2 6048399.5 1.0) + (when (or (zero? (-> this bombbot-h)) (not (handle->process (-> this bombbot-h)))) + (let ((s5-1 (new 'stack 'bombbot-spawn-params))) + (set! (-> s5-1 nav-mesh) (get-nav-mesh (the-as actor-id #x48e9))) + (set! (-> s5-1 position quad) (-> this start-point quad)) + (set! (-> s5-1 position quad) (-> (target-pos 0) quad)) + (quaternion-copy! (-> s5-1 quat) (new 'static 'quaternion :y 0.841 :w 0.5409)) + (set! (-> this bombbot-h) + (ppointer->handle (process-spawn bombbot-player s5-1 :name "bombbot-player" :to this)) + ) + ) + ) + (set! (-> this done?) 0) + (set-setting! 'pickups #f 0.0 0) + (none) + ) + +;; definition of type task-manager-port-fight +(deftype task-manager-port-fight (task-manager) + ((check-timer time-frame) + (bombbot-h handle 4) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (done? int32) + (minimap connection-minimap) + (min-time uint32) + (intro-state int32 :offset 312) + (target-far-enough? symbol :offset 328) + ) + (:state-methods + fail-screen + ) + (:methods + (add-danger (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-port-fight +(defmethod inspect ((this task-manager-port-fight)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (format #t "~2Tbombbot-h[4] @ #x~X~%" (-> this bombbot-h)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tdone?: ~D~%" (-> this done?)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tmin-time: ~D~%" (-> this min-time)) + (format #t "~2Thud-timer: ~D~%" (-> this hud-timer)) + (format #t "~2Tintro-state: ~D~%" (-> this intro-state)) + (format #t "~2Tintro-time: ~D~%" (-> this intro-time)) + (format #t "~2Ttarget-far-enough?: ~A~%" (-> this target-far-enough?)) + (label cfg-7) + this + ) + +;; definition for method 26 of type task-manager-port-fight +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-port-fight)) + (if (not (-> this target-far-enough?)) + (add-danger this) + ) + (cond + ((zero? (-> this intro-state)) + (set! (-> this intro-time) (+ (current-time) (seconds 2))) + (+! (-> this intro-state) 1) + ) + ((= (-> this intro-state) 1) + (if (< (-> this intro-time) (current-time)) + (+! (-> this intro-state) 1) + ) + ) + ((= (-> this intro-state) 2) + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (if (process-grab? *target* #f) + (+! (-> this intro-state) 1) + ) + ) + ((= (-> this intro-state) 3) + (set-setting! 'interp-time 'abs 150.0 0) + (+! (-> this intro-state) 1) + ) + ((= (-> this intro-state) 4) + (send-event *camera* 'change-target (handle->process (-> this bombbot-h 1))) + (+! (-> this intro-state) 1) + (set! (-> this intro-time) (+ (current-time) (seconds 3))) + (sound-play "bb-cam-out") + (persist-with-delay *setting-control* 'blur-a (seconds 1) 'blur-a 'abs 0.5 0) + ) + ((= (-> this intro-state) 5) + (remove-setting! 'mode-name) + (when (< (-> this intro-time) (current-time)) + (remove-setting! 'interp-time) + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (+! (-> this intro-state) 1) + ) + ) + ((= (-> this intro-state) 6) + (set-setting! 'interp-time 'abs 150.0 0) + (+! (-> this intro-state) 1) + ) + ((= (-> this intro-state) 7) + (send-event *camera* 'change-target *target*) + (+! (-> this intro-state) 1) + (sound-play "bb-cam-in") + (persist-with-delay *setting-control* 'blur-a (seconds 1) 'blur-a 'abs 0.5 0) + ) + ((= (-> this intro-state) 8) + (remove-setting! 'mode-name) + (when (< (-> this intro-time) (current-time)) + (remove-setting! 'interp-time) + (if (process-release? *target*) + (+! (-> this intro-state) 1) + ) + ) + ) + ) + (when (and (-> this next-state) (= (-> this next-state name) 'active)) + (let ((s5-2 0)) + (let ((s4-2 10000)) + (dotimes (s3-0 3) + (when (-> this bombbot-h s3-0) + (let* ((s1-0 (handle->process (-> this bombbot-h s3-0))) + (s2-0 (if (type? s1-0 bombbot) + (the-as bombbot s1-0) + ) + ) + ) + (when s2-0 + (+! s5-2 1) + (let ((v1-114 + (the int (* 0.000030517578 (vector-vector-xz-distance + (-> s2-0 root trans) + (the-as vector (-> s2-0 city-path node (+ (-> s2-0 city-path node-count) -1))) + ) + ) + ) + ) + ) + (if (< v1-114 s4-2) + (set! s4-2 v1-114) + ) + ) + (when (= (-> s2-0 current-node) (+ (-> s2-0 city-path node-count) -1)) + ) + ) + ) + ) + ) + (set! (-> this min-time) (the-as uint s4-2)) + (cond + ((< s4-2 10) + (set! (-> *game-info* timer) (the-as time-frame (the int (* 300.0 (the float s4-2))))) + (if (not (-> this hud-timer)) + (set! (-> this hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to this)) + ) + ) + (if (zero? s4-2) + (go (method-of-object this fail-screen)) + ) + ) + (else + (when (handle->process (-> this hud-timer)) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (set! (-> this hud-timer) (the-as handle #f)) + ) + ) + ) + ) + (if (zero? s5-2) + (send-event this 'complete) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-port-fight) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((gp-0 (new 'stack 'bombbot-spawn-params))) + (quaternion-copy! (-> gp-0 quat) (new 'static 'quaternion :y 0.841 :w 0.5409)) + (set! (-> gp-0 path) *bombbot-path-1*) + (set! (-> gp-0 first-node) (the-as uint 4)) + (set! (-> gp-0 stop-offset) 1500.0) + (set! (-> self bombbot-h 0) (ppointer->handle (process-spawn bombbot gp-0 :name "bombbot" :to self))) + (set! (-> gp-0 path) *bombbot-path-2*) + (set! (-> gp-0 first-node) (the-as uint 0)) + (set! (-> gp-0 stop-offset) 1500.0) + (set! (-> self bombbot-h 1) (ppointer->handle (process-spawn bombbot gp-0 :name "bombbot" :to self))) + (set! (-> gp-0 path) *bombbot-path-3*) + (set! (-> gp-0 first-node) (the-as uint 0)) + (set! (-> gp-0 stop-offset) 2100.0) + (set! (-> self bombbot-h 2) (ppointer->handle (process-spawn bombbot gp-0 :name "bombbot" :to self))) + ) + ) + ) + +;; failed to figure out what this is: +(defstate fail-screen (task-manager-port-fight) + :virtual #t + :parent (task-manager-port-fight active) + :code (behavior () + (when (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead)))) + (cond + ((= (status-of-level-and-borrows *level* 'ctyport #f) 'active) + (set-setting! 'entity-name "camera-321" 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) + (suspend) + ) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) + (dotimes (gp-1 3) + (let ((s5-0 (handle->process (-> self bombbot-h gp-1)))) + (when s5-0 + (if (type? s5-0 bombbot) + (send-event s5-0 'explode) + ) + ) + ) + ) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.3))) + (suspend) + ) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (seconds-per-frame) + (bucket-id tex-hud-hud-alpha) + #x3fffff + #x33001 + #t + ) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) + (suspend) + ) + (set-setting! 'interp-time 'abs 0.0 0) + (remove-setting! 'entity-name) + ) + (else + ) + ) + ) + (send-event self 'fail) + (sleep-code) + ) + ) + +;; definition for method 25 of type task-manager-port-fight +;; WARN: Return type mismatch symbol vs none. +(defmethod task-manager-method-25 ((this task-manager-port-fight)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (disable *screen-filter*) + (when (-> this hud-timer) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (set! (-> this hud-timer) (the-as handle #f)) + ) + (none) + ) + +;; definition for method 33 of type task-manager-port-fight +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod add-danger ((this task-manager-port-fight)) + (when *traffic-engine* + (let ((gp-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> gp-0 sphere quad) (-> (new 'static 'vector :x -242360.31 :y 31621.12 :z 5512233.0 :w 1.0) quad)) + (if (< 614400.0 (vector-vector-xz-distance (target-pos 0) (-> gp-0 sphere))) + (set! (-> this target-far-enough?) #t) + ) + (set! (-> gp-0 sphere r) 819200.0) + (vector-reset! (-> gp-0 velocity)) + (set! (-> gp-0 notify-radius) 819200.0) + (set! (-> gp-0 danger-level) 1.0) + (set! (-> gp-0 decay-rate) 0.0) + (set! (-> gp-0 flags) (the-as uint 1)) + (set! (-> gp-0 danger-type) (the-as uint 0)) + (add-danger *traffic-engine* gp-0) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate wait (task-manager-port-fight) + :virtual #t + :code (behavior () + (while (or (not *target*) (not *spawn-actors*)) + (suspend) + ) + (set-time-limit self) + (while (or (not (level-get-target-inside *level*)) (!= (-> (level-get-target-inside *level*) name) 'ctyport)) + (suspend) + ) + (set-setting! 'airlock #f 0.0 0) + (go-virtual active) + ) + ) + +;; definition for method 21 of type task-manager-port-fight +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-port-fight)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! *bombbot-hint* (the-as sound-id 1)) + (set! *bombbot-hint-time* 0.0) + (set! (-> this bombbot-h 0) (the-as handle #f)) + (set! (-> this bombbot-h 1) (the-as handle #f)) + (set! (-> this bombbot-h 2) (the-as handle #f)) + (set! (-> this bombbot-h 3) (the-as handle #f)) + (set-setting! 'city-sound '(citybbh) 0.0 2) + (set-setting! 'music 'cityfi 0.0 0) + (set! (-> this hud-timer) (the-as handle #f)) + (set! (-> this target-far-enough?) #f) + (add-danger this) + (set! (-> this done?) 0) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/city/common/cty-faction-h_REF.gc b/test/decompiler/reference/jak3/levels/city/common/cty-faction-h_REF.gc new file mode 100644 index 0000000000..57b2571da3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/cty-faction-h_REF.gc @@ -0,0 +1,214 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type cty-faction-info +(deftype cty-faction-info (structure) + ((data int8 6) + (ff-guard int8 :overlay-at (-> data 0)) + (ff-ped int8 :overlay-at (-> data 1)) + (kg-guard int8 :overlay-at (-> data 2)) + (kg-ped int8 :overlay-at (-> data 3)) + (mh-guard int8 :overlay-at (-> data 4)) + (mh-ped int8 :overlay-at (-> data 5)) + ) + :allow-misaligned + ) + +;; definition for method 3 of type cty-faction-info +(defmethod inspect ((this cty-faction-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'cty-faction-info) + (format #t "~1Tdata[6] @ #x~X~%" (&-> this ff-guard)) + (format #t "~1Tff-guard: ~D~%" (-> this ff-guard)) + (format #t "~1Tff-ped: ~D~%" (-> this ff-ped)) + (format #t "~1Tkg-guard: ~D~%" (-> this kg-guard)) + (format #t "~1Tkg-ped: ~D~%" (-> this kg-ped)) + (format #t "~1Tmh-guard: ~D~%" (-> this mh-guard)) + (format #t "~1Tmh-ped: ~D~%" (-> this mh-ped)) + (label cfg-4) + this + ) + +;; definition of type cty-faction-strength +(deftype cty-faction-strength (structure) + ((data int8 3) + (ff-strength int8 :overlay-at (-> data 0)) + (kg-strength int8 :overlay-at (-> data 1)) + (mh-strength int8 :overlay-at (-> data 2)) + ) + :allow-misaligned + ) + +;; definition for method 3 of type cty-faction-strength +(defmethod inspect ((this cty-faction-strength)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'cty-faction-strength) + (format #t "~1Tdata[3] @ #x~X~%" (&-> this ff-strength)) + (format #t "~1Tff-strength: ~D~%" (-> this ff-strength)) + (format #t "~1Tkg-strength: ~D~%" (-> this kg-strength)) + (format #t "~1Tmh-strength: ~D~%" (-> this mh-strength)) + (label cfg-4) + this + ) + +;; definition of type territory-faction-mode +(deftype territory-faction-mode (structure) + ((data int8 3) + (ff-mode uint8 :overlay-at (-> data 0)) + (kg-mode uint8 :overlay-at (-> data 1)) + (mh-mode uint8 :overlay-at (-> data 2)) + ) + :allow-misaligned + ) + +;; definition for method 3 of type territory-faction-mode +(defmethod inspect ((this territory-faction-mode)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'territory-faction-mode) + (format #t "~1Tdata[3] @ #x~X~%" (&-> this ff-mode)) + (format #t "~1Tff-mode: ~D~%" (-> this ff-mode)) + (format #t "~1Tkg-mode: ~D~%" (-> this kg-mode)) + (format #t "~1Tmh-mode: ~D~%" (-> this mh-mode)) + (label cfg-4) + this + ) + +;; definition of type territory-faction-flag +(deftype territory-faction-flag (structure) + ((data uint8 3) + (ff-mode uint8 :overlay-at (-> data 0)) + (kg-mode uint8 :overlay-at (-> data 1)) + (mh-mode uint8 :overlay-at (-> data 2)) + ) + :pack-me + ) + +;; definition for method 3 of type territory-faction-flag +(defmethod inspect ((this territory-faction-flag)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'territory-faction-flag) + (format #t "~1Tdata[3] @ #x~X~%" (&-> this ff-mode)) + (format #t "~1Tff-mode: ~D~%" (-> this ff-mode)) + (format #t "~1Tkg-mode: ~D~%" (-> this kg-mode)) + (format #t "~1Tmh-mode: ~D~%" (-> this mh-mode)) + (label cfg-4) + this + ) + +;; definition of type faction-spawn-info +(deftype faction-spawn-info (structure) + ((faction-type uint8) + (current-level uint8) + (requested-level uint8) + (flags faction-spawn-flag) + ) + :allow-misaligned + ) + +;; definition for method 3 of type faction-spawn-info +(defmethod inspect ((this faction-spawn-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'faction-spawn-info) + (format #t "~1Tfaction-type: ~D~%" (-> this faction-type)) + (format #t "~1Tcurrent-level: ~D~%" (-> this current-level)) + (format #t "~1Trequested-level: ~D~%" (-> this requested-level)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (label cfg-4) + this + ) + +;; definition of type cty-faction-manager +(deftype cty-faction-manager (basic) + ((faction-array cty-faction-info 30) + (faction-mod-array cty-faction-info 30 :inline) + (global-faction-strength-mod cty-faction-strength :inline) + (territory-faction-strength-mod cty-faction-strength 4 :inline) + (permission-cache uint8 30 :offset 671) + (last-requested-level symbol) + (territory-faction-modes territory-faction-mode 30 :inline) + (territory-flags uint8 30) + (last-active-territories uint32) + (update-flags cty-faction-update-flag) + (target-exclusive-branch-index uint8) + (territory-faction-flags territory-faction-flag :inline) + (faction-spawn faction-spawn-info 7 :inline) + (last-change-music-time time-frame :offset 1344) + (start-fight-music-time time-frame) + ) + (:methods + (cty-faction-manager-method-9 (_type_ int symbol) int) + (cty-faction-manager-method-10 (_type_ int symbol) int) + (cty-faction-manager-method-11 (_type_ int) uint) + (cty-faction-manager-method-12 (_type_ int int) int) + (cty-faction-manager-method-13 (_type_) symbol) + (cty-faction-manager-method-14 (_type_ nav-territory-type int int) int) + (restore-defaults (_type_) cty-faction-update-flag) + (cty-faction-manager-method-16 (_type_ nav-territory-type) int) + (cty-faction-manager-method-17 (_type_ symbol) int) + (cty-faction-manager-method-18 (_type_ symbol) int) + (cty-faction-manager-method-19 (_type_) symbol) + (cty-faction-manager-method-20 (_type_ uint) int) + (cty-faction-manager-method-21 (_type_ int) symbol) + (cty-faction-manager-method-22 (_type_) cty-faction-update-flag) + (cty-faction-manager-method-23 (_type_ uint) symbol) + (cty-faction-manager-method-24 (_type_) symbol) + (faction-spawn (_type_ int int symbol symbol) faction-spawn-flag) + ) + ) + +;; definition for method 3 of type cty-faction-manager +(defmethod inspect ((this cty-faction-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tfaction-array[30] @ #x~X~%" (-> this faction-array)) + (format #t "~1Tfaction-mod-array[30] @ #x~X~%" (-> this faction-mod-array)) + (format + #t + "~1Tglobal-faction-strength-mod: #~%" + (-> this global-faction-strength-mod) + ) + (format #t "~1Tterritory-faction-strength-mod[4] @ #x~X~%" (-> this territory-faction-strength-mod)) + (format #t "~1Tpermission-cache[30] @ #x~X~%" (-> this permission-cache)) + (format #t "~1Tlast-requested-level: ~A~%" (-> this last-requested-level)) + (format #t "~1Tterritory-faction-modes[30] @ #x~X~%" (-> this territory-faction-modes)) + (format #t "~1Tterritory-flags[30] @ #x~X~%" (-> this territory-flags)) + (format #t "~1Tlast-active-territories: ~D~%" (-> this last-active-territories)) + (format #t "~1Tupdate-flags: ~D~%" (-> this update-flags)) + (format #t "~1Ttarget-exclusive-branch-index: ~D~%" (-> this target-exclusive-branch-index)) + (format #t "~1Tterritory-faction-flags: #~%" (-> this territory-faction-flags)) + (format #t "~1Tfaction-spawn[7] @ #x~X~%" (-> this faction-spawn)) + (format #t "~1Tlast-change-music-time: ~D~%" (-> this last-change-music-time)) + (format #t "~1Tstart-fight-music-time: ~D~%" (-> this start-fight-music-time)) + (label cfg-4) + this + ) + +;; definition for method 12 of type cty-faction-manager +(defmethod cty-faction-manager-method-12 ((this cty-faction-manager) (arg0 int) (arg1 int)) + (-> this territory-faction-modes 0 data (+ arg1 (* arg0 16))) + ) + +;; definition for symbol *cty-faction-manager*, type cty-faction-manager +(define *cty-faction-manager* (the-as cty-faction-manager #f)) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/common/cty-guard-projectile_REF.gc b/test/decompiler/reference/jak3/levels/city/common/cty-guard-projectile_REF.gc new file mode 100644 index 0000000000..84b45b8350 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/cty-guard-projectile_REF.gc @@ -0,0 +1,673 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vehicle-grenade +(deftype vehicle-grenade (projectile-bounce) + ((blast-radius float) + ) + (:methods + (vehicle-grenade-method-44 (_type_) none) + ) + ) + +;; definition for method 3 of type vehicle-grenade +(defmethod inspect ((this vehicle-grenade)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile-bounce inspect))) + (t9-0 this) + ) + (format #t "~2Tblast-radius: ~f~%" (-> this blast-radius)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-vehicle-grenade gun gun-grenade-lod0-jg gun-grenade-idle-ja + ((gun-grenade-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :texture-level 10 + ) + +;; definition for method 28 of type vehicle-grenade +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this vehicle-grenade) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "grenade-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "grenade-explode") + ) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type vehicle-grenade +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this vehicle-grenade)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) projectile-bounce-reaction) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate explode)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 819.2) + (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! (-> s5-0 max-iteration-count) (the-as uint 2)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set-collide-with! + (-> this root) + (collide-spec + backgnd + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set-collide-as! (-> this root) (collide-spec enemy)) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +;; definition for method 40 of type vehicle-grenade +(defmethod projectile-method-40 ((this vehicle-grenade)) + 256 + ) + +;; definition for method 31 of type vehicle-grenade +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this vehicle-grenade)) + (ctywide-entity-hack) + (set! (-> this attack-mode) 'eco-dark) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-vehicle-grenade" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-3 (method-of-type projectile-bounce init-proj-settings!))) + (t9-3 this) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 213) this)) + (set! (-> this blast-radius) 16384.0) + (set! (-> this max-speed) 90112.0) + (set! (-> this timeout) (seconds 4)) + (let ((v1-11 (new 'stack-no-clear 'vector))) + (set! (-> v1-11 x) 2.0) + (set! (-> v1-11 y) 2.0) + (set! (-> v1-11 z) 2.0) + (set! (-> v1-11 w) 1.0) + (set! (-> this root scale quad) (-> v1-11 quad)) + ) + 0 + (none) + ) + +;; definition for method 25 of type vehicle-grenade +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this vehicle-grenade)) + (spawn (-> this part) (-> this root trans)) + (ja-post) + 0 + (none) + ) + +;; definition for method 42 of type vehicle-grenade +;; WARN: Return type mismatch int vs none. +(defmethod projectile-bounce-method-42 ((this vehicle-grenade)) + (spawn (-> this part) (-> this root trans)) + 0 + (none) + ) + +;; definition for method 39 of type vehicle-grenade +;; WARN: Return type mismatch sound-id vs none. +(defmethod projectile-method-39 ((this vehicle-grenade)) + (let* ((a2-0 (-> this root)) + (v1-0 (-> a2-0 status)) + ) + (if (logtest? v1-0 (collide-status touch-surface)) + (vector-float*! (-> a2-0 transv) (-> a2-0 transv) 0.2) + ) + (when (and (logtest? v1-0 (collide-status impact-surface)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) + ) + (set-time! (-> this played-bounce-time)) + (sound-play "grenade-bounce") + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate impact (vehicle-grenade) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (if (send-event + proc + 'attack + (-> block param 0) + (static-attack-info :mask (vehicle-impulse-factor) ((id (-> self attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'explode) + ) + ) + ) + #t + ) + ) + ) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) (-> self blast-radius)) + (set! (-> gp-0 scale) 1.0) + (set! (-> gp-0 group) (-> *part-group-id-table* 104)) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-0 damage) 6.0) + (set! (-> gp-0 damage-scale) 1.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle #f)) + (explosion-spawn gp-0 self) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-17 (-> self root root-prim))) + (set! (-> v1-17 prim-core collide-as) (collide-spec)) + (set! (-> v1-17 prim-core collide-with) (collide-spec)) + ) + 0 + (while (-> self child) + (suspend) + ) + (deactivate self) + ) + ) + +;; definition for method 44 of type vehicle-grenade +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-grenade-method-44 ((this vehicle-grenade)) + (when *traffic-manager* + (let ((v1-1 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-1 sphere quad) (-> this root trans quad)) + (set! (-> v1-1 sphere r) (-> this blast-radius)) + (set! (-> v1-1 velocity quad) (-> this root transv quad)) + (set! (-> v1-1 notify-radius) 122880.0) + (set! (-> v1-1 danger-level) 2.0) + (set! (-> v1-1 decay-rate) 0.0) + (set! (-> v1-1 flags) (the-as uint 1)) + (set! (-> v1-1 danger-type) (the-as uint 6)) + (set! (-> v1-1 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere v1-1) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate sitting (vehicle-grenade) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (vehicle-grenade-method-44 self) + ) + :code (behavior () + (until #f + (when (time-elapsed? (-> self state-time) (seconds 0.5)) + (set-time! (-> self state-time)) + (vehicle-grenade-method-44 self) + ) + (suspend) + ) + #f + (when *traffic-manager* + (let ((v1-10 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-10 sphere quad) (-> self root trans quad)) + (set! (-> v1-10 sphere r) (the-as float (* (the int (-> self blast-radius)) 2))) + (set! (-> v1-10 velocity quad) (-> self root transv quad)) + (set! (-> v1-10 notify-radius) 122880.0) + (set! (-> v1-10 danger-level) 2.0) + (set! (-> v1-10 decay-rate) 0.0) + (set! (-> v1-10 flags) (the-as uint 1)) + (set! (-> v1-10 danger-type) (the-as uint 6)) + (set! (-> v1-10 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere v1-10) + ) + ) + ) + ) + +;; definition of type vehicle-grenade-deflect +(deftype vehicle-grenade-deflect (vehicle-grenade) + ((has-been-deflected symbol) + (has-hit-ground symbol) + ) + ) + +;; definition for method 3 of type vehicle-grenade-deflect +(defmethod inspect ((this vehicle-grenade-deflect)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle-grenade inspect))) + (t9-0 this) + ) + (format #t "~2Thas-been-deflected: ~A~%" (-> this has-been-deflected)) + (format #t "~2Thas-hit-ground: ~A~%" (-> this has-hit-ground)) + (label cfg-4) + this + ) + +;; definition for method 31 of type vehicle-grenade-deflect +;; WARN: Return type mismatch symbol vs none. +(defmethod init-proj-settings! ((this vehicle-grenade-deflect)) + (set! (-> this has-been-deflected) #f) + (let ((t9-0 (method-of-type vehicle-grenade init-proj-settings!))) + (t9-0 this) + ) + (set! (-> this has-hit-ground) #f) + (none) + ) + +;; failed to figure out what this is: +(defstate moving (vehicle-grenade-deflect) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type vehicle-grenade moving) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type vehicle-grenade moving) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type vehicle-grenade moving) trans))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (let ((t9-0 (-> (method-of-type vehicle-grenade moving) code))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + :post (behavior () + (when (logtest? (-> self root status) (collide-status on-ground)) + (set! (-> self has-hit-ground) #t) + (if (= (-> self charge-level) 0.0) + (go-virtual impact) + ) + ) + (let ((t9-1 (-> (method-of-type vehicle-grenade moving) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +;; definition for method 35 of type vehicle-grenade-deflect +;; INFO: Used lq/sq +(defmethod proj-event-handler ((this vehicle-grenade-deflect) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (format #t "attack") + (when (and (!= (-> this owner-handle) arg0) + (not (-> this has-been-deflected)) + (logtest? (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3) (penetrate spin)) + (-> this next-state) + (let ((v1-7 (-> this next-state name))) + (or (= v1-7 'moving) (= v1-7 'sitting)) + ) + ) + (let* ((s4-1 (new 'stack-no-clear 'vector)) + (s3-0 (handle->process (-> this owner-handle))) + (s4-2 (vector-! + s4-1 + (get-trans + (the-as process-focusable (if (type? s3-0 process-focusable) + (the-as process-focusable s3-0) + ) + ) + 0 + ) + (-> this root trans) + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (the-as uint128 0)) + (set! (-> s4-2 y) 0.0) + (let ((f28-0 1274.3112) + (f30-0 245760.0) + ) + (vector-normalize! s4-2 1.0) + (when (-> this has-hit-ground) + (set! f28-0 3276.8) + (set! f30-0 204800.0) + ) + (let* ((s2-0 arg0) + (a0-16 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + 0.0 + (let ((f26-0 -0.3) + (v1-22 a0-16) + ) + (when (= (-> a0-16 type) target) + (if (-> this has-hit-ground) + (set! f26-0 0.7) + ) + (set! (-> s3-1 quad) (-> (the-as target v1-22) control to-target-pt-xz quad)) + (vector-normalize! s3-1 1.0) + (set! (-> s3-1 y) 0.0) + (if (< (vector-dot s3-1 s4-2) f26-0) + (set! (-> s4-2 quad) (-> s3-1 quad)) + ) + ) + ) + ) + (set! (-> s4-2 y) (tan f28-0)) + (vector-normalize! s4-2 1.0) + (let ((v1-29 (-> s4-2 quad))) + (set! (-> this root transv quad) v1-29) + ) + (vector-normalize! (-> this root transv) f30-0) + ) + ) + (set! (-> this has-been-deflected) #t) + (set! (-> this owner-handle) (process->handle arg0)) + (set! (-> this ignore-handle) (-> this owner-handle)) + (if (and (-> this next-state) (= (-> this next-state name) 'sitting)) + (go (method-of-object this moving)) + ) + ) + ) + (('touched 'touch) + (if (or (not (-> this has-been-deflected)) (!= (process->handle arg0) (-> this owner-handle))) + ((method-of-type projectile proj-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + (else + ((method-of-type projectile proj-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 19) (new 'static 'lightning-spec + :name "lightning-trail-crimson-guard" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 20) (new 'static 'lightning-spec + :name "lightning-fractal-crimson-guard" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(defpart 1163 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 1164 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup part-crimson-lightning-glow + :id 254 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1164 :fade-after (meters 100) :flags (sp6)) (sp-item 1163 :fade-after (meters 100) :flags (sp6))) + ) + +;; definition of type guard-lazer-shot +(deftype guard-lazer-shot (projectile) + () + ) + +;; definition for method 3 of type guard-lazer-shot +(defmethod inspect ((this guard-lazer-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate dissipate (guard-lazer-shot) + :virtual #t + :enter (behavior () + (go-virtual impact) + ) + ) + +;; definition for method 38 of type guard-lazer-shot +(defmethod made-impact? ((this guard-lazer-shot)) + (let ((gp-0 (-> this root)) + (s5-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((v1-0 s5-0)) + (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) + (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> v1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-0 action-mask) (collide-action solid)) + ) + (let ((a0-2 (the-as process-focusable (handle->process (-> this notify-handle))))) + (when a0-2 + (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans a0-2 3))) + (f0-2 (- (vector-length s4-1))) + ) + (fill-and-try-snap-to-surface gp-0 s4-1 f0-2 0.0 -3072.0 s5-0) + ) + ) + ) + ) + ) + +;; definition for function guard-lazer-shot-move +;; WARN: Return type mismatch int vs none. +(defun guard-lazer-shot-move ((arg0 guard-lazer-shot)) + (projectile-move-fill-line-sphere arg0) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + 0 + (none) + ) + +;; definition for method 30 of type guard-lazer-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this guard-lazer-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum 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 enemy-yellow-shot)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 1228.8) + (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! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type guard-lazer-shot +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this guard-lazer-shot)) + (set! (-> this attack-mode) 'shock) + (set! (-> this max-speed) 131072.0) + (set! (-> this timeout) (seconds 0.125)) + (set! (-> this move) guard-lazer-shot-move) + (set! (-> this damage) 3.0) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) + (set! (-> this vehicle-damage-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + 0 + (none) + ) + +;; definition for method 37 of type guard-lazer-shot +(defmethod deal-damage! ((this guard-lazer-shot) (arg0 process) (arg1 event-message-block)) + (if (logtest? (process-mask kg-robot) (-> arg0 mask)) + (set! (-> this damage) 5.0) + ) + (call-parent-method this arg0 arg1) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/common/ctywide-init_REF.gc b/test/decompiler/reference/jak3/levels/city/common/ctywide-init_REF.gc new file mode 100644 index 0000000000..e9059e4dc3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/ctywide-init_REF.gc @@ -0,0 +1,239 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function update-level-info +;; WARN: Return type mismatch int vs none. +(defun update-level-info ((arg0 level)) + (let ((v1-0 *traffic-info*)) + (dotimes (a0-1 44) + (let ((a1-1 (-> v1-0 traffic-object-type-from-vehicle-type a0-1))) + (if (< (the-as uint a1-1) (the-as uint 29)) + (set! (-> v1-0 traffic-object-levels a1-1) (-> v1-0 vehicle-levels a0-1)) + ) + ) + ) + (let ((a0-4 *traffic-engine*)) + (when a0-4 + (dotimes (a1-5 29) + (set! (-> a0-4 object-type-info-array a1-5 level) (-> v1-0 traffic-object-levels a1-5)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type dummy-alloc +(deftype dummy-alloc (structure) + ((val uint32) + ) + ) + +;; definition for method 3 of type dummy-alloc +(defmethod inspect ((this dummy-alloc)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'dummy-alloc) + (format #t "~1Tval: ~D~%" (-> this val)) + (label cfg-4) + this + ) + +;; definition for function ctywide-login +;; WARN: Return type mismatch int vs none. +(defun ctywide-login ((arg0 level)) + (format 0 "citywide-login~%") + (malloc 'loading-level #x1b800) + (set! *traffic-engine* (new 'loading-level 'traffic-engine)) + (set! *ff-squad-control* (new 'loading-level 'ff-squad-control)) + (set! *kg-squad-control* (new 'loading-level 'kg-squad-control)) + (set! *mh-squad-control* (new 'loading-level 'mh-squad-control)) + (set! *city-borrow-manager* (new 'loading-level 'cty-borrow-manager)) + (set! *cty-faction-manager* (new 'loading-level 'cty-faction-manager)) + (initialize-cty-attack-controller) + (let ((t9-9 cty-attack-reset) + (a0-9 #f) + (a1-8 #f) + ) + (t9-9 a0-9 a1-8 #f) + (init! *city-borrow-manager*) + (initialize *ff-squad-control* (the-as process a1-8)) + (initialize *kg-squad-control* (the-as process a1-8)) + (initialize *mh-squad-control* (the-as process a1-8)) + ) + (clear-borrow-holds! *city-borrow-manager*) + (set! *city-mode* 'ctywide) + 0 + (none) + ) + +;; definition for function ctywide-activate +;; WARN: Return type mismatch int vs none. +(defun ctywide-activate ((arg0 level) (arg1 symbol)) + (cty-attack-reset #f #f #f) + (format 0 "ctywide-activate (mode ~s, *spawn-actors* ~s)~%" arg1 (if *spawn-actors* + "#t" + "#f" + ) + ) + (let ((v1-1 *traffic-info*)) + (when v1-1 + (set! (-> v1-1 ctywide-level) arg0) + (set! (-> v1-1 vehicle-level) arg0) + (set! (-> v1-1 restore-speech-callback) restore-city-speeches) + ) + ) + (vehicle-manager-kill) + (set! *traffic-fast-spawn* (or (= arg1 'life) (= arg1 'debug))) + (cond + ((and (= arg1 'debug) (not *spawn-actors*)) + (traffic-kill) + ) + (else + (restore-defaults *cty-faction-manager*) + (traffic-start) + (clear-borrow-holds! *city-borrow-manager*) + (add-squad-to-traffic-engine *ff-squad-control* *traffic-engine*) + (squad-control-method-10 *ff-squad-control*) + (add-squad-to-traffic-engine *kg-squad-control* *traffic-engine*) + (squad-control-method-10 *kg-squad-control*) + (add-squad-to-traffic-engine *mh-squad-control* *traffic-engine*) + (squad-control-method-10 *mh-squad-control*) + (restore-default-settings *traffic-engine*) + ) + ) + (let ((v1-27 *traffic-info*)) + (if (not (-> v1-27 vehicle-levels 6)) + (set! (-> v1-27 vehicle-levels 6) 'ctywide) + ) + ) + (when *traffic-engine* + (let ((v1-31 (-> *traffic-engine* object-type-info-array 28))) + (logior! (-> v1-31 flags) (traffic-type-flag ttf3)) + ) + ) + 0 + (none) + ) + +;; definition for function ctywide-deactivate +;; WARN: Return type mismatch int vs none. +(defun ctywide-deactivate ((arg0 level)) + (format 0 "ctywide-deactivate~%") + (set! (-> *traffic-info* ctywide-level) #f) + (persist-with-delay *setting-control* 'cty-faction-music 0 'music 'city1 0.0 0) + 0 + (none) + ) + +;; definition for function ctywide-logout +;; WARN: Return type mismatch int vs none. +(defun ctywide-logout ((arg0 level)) + (set! *traffic-engine* #f) + (set! *ff-squad-control* #f) + (set! *kg-squad-control* #f) + (set! *mh-squad-control* #f) + (clear-callback! *city-borrow-manager*) + (set! *city-borrow-manager* #f) + (set! *cty-faction-manager* #f) + (set! *trail-graph* #f) + (set! *city-mode* #f) + (set! *cty-attack-controller* #f) + (let ((v1-2 *traffic-info*)) + (set! (-> v1-2 vehicle-levels 6) #f) + (set! (-> v1-2 restore-speech-callback) #f) + ) + (when *traffic-engine* + (let ((v1-7 (-> *traffic-engine* object-type-info-array 28))) + (logclear! (-> v1-7 flags) (traffic-type-flag ttf3)) + ) + ) + 0 + (none) + ) + +;; definition for symbol *traffic-alert-level-force*, type symbol +(define *traffic-alert-level-force* #f) + +;; definition for function lwide-activate +;; WARN: Return type mismatch int vs none. +(defun lwide-activate ((arg0 level) (arg1 symbol)) + (format #t "lwide-activate ~s~%" arg0) + (let ((v1-0 *traffic-info*) + (a0-2 (-> arg0 name)) + ) + (set! (-> v1-0 restore-speech-callback) restore-city-speeches) + (case (-> arg0 name) + (('ctycara) + (set! (-> v1-0 vehicle-levels 3) a0-2) + (set! (-> v1-0 vehicle-levels 4) a0-2) + (set! (-> v1-0 vehicle-levels 5) a0-2) + ) + (('ctycarb) + (set! (-> v1-0 vehicle-levels 0) a0-2) + (set! (-> v1-0 vehicle-levels 1) a0-2) + (set! (-> v1-0 vehicle-levels 2) a0-2) + ) + (('ctypepa) + (set! (-> v1-0 traffic-object-levels 0) a0-2) + (set! (-> v1-0 traffic-object-levels 1) a0-2) + (set! (-> v1-0 traffic-object-levels 2) a0-2) + (set! (-> v1-0 traffic-object-levels 3) a0-2) + ) + (('ctypesb) + (set! (-> v1-0 traffic-object-levels 8) a0-2) + (set! (-> v1-0 traffic-object-levels 9) a0-2) + ) + (('ctypepb) + (set! (-> v1-0 traffic-object-levels 10) a0-2) + ) + (('ctypesa) + (set! (-> v1-0 traffic-object-levels 4) a0-2) + (set! (-> v1-0 traffic-object-levels 6) a0-2) + (set! (-> v1-0 traffic-object-levels 13) a0-2) + ) + (('ctypesc) + (set! (-> v1-0 traffic-object-levels 14) a0-2) + (set! (-> v1-0 traffic-object-levels 15) a0-2) + (set! (-> v1-0 traffic-object-levels 16) a0-2) + ) + (('lctyhijk) + (set! (-> v1-0 vehicle-levels 11) a0-2) + ) + ) + (update-level-info (the-as level a0-2)) + ) + 0 + (none) + ) + +;; definition for function lwide-deactivate +;; WARN: Return type mismatch int vs none. +(defun lwide-deactivate ((arg0 level)) + (let ((v1-0 *traffic-info*)) + (dotimes (a1-0 44) + (if (= (-> v1-0 vehicle-levels a1-0) (-> arg0 name)) + (set! (-> v1-0 vehicle-levels a1-0) #f) + ) + ) + (dotimes (a1-3 29) + (if (= (-> v1-0 traffic-object-levels a1-3) (-> arg0 name)) + (set! (-> v1-0 traffic-object-levels a1-3) #f) + ) + ) + ) + (let ((v1-3 *traffic-info*)) + (set! (-> v1-3 vehicle-level) #f) + (set! (-> v1-3 restore-speech-callback) #f) + ) + (update-level-info arg0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/common/ff-squad-control_REF.gc b/test/decompiler/reference/jak3/levels/city/common/ff-squad-control_REF.gc new file mode 100644 index 0000000000..8921f8fa21 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/ff-squad-control_REF.gc @@ -0,0 +1,686 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *alert-level-settings*, type squad-alert-state-settings +(define *alert-level-settings* (new 'static 'squad-alert-state-settings + :ped-tazer (new 'static 'squad-unit-settings + :target-count 3 + :shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 2) + ) + :ped-rifle (new 'static 'squad-unit-settings + :target-count 3 + :shot-count 2 + :rand-shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 2) + ) + :ped-grenade (new 'static 'squad-unit-settings + :target-count 1 + :shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 2) + ) + :bike-turret (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 5) + ) + :hellcat-turret (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 1 + :inaccuracy 0.5 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 5) + ) + ) + ) + +;; definition for symbol *ff-war-alert-state-settings*, type squad-alert-state-settings +(define *ff-war-alert-state-settings* (new 'static 'squad-alert-state-settings + :ped-tazer (new 'static 'squad-unit-settings + :target-count 4 + :shot-count 1 + :inaccuracy 0.125 + :acquire-delay (seconds 0.5) + :shot-delay (seconds 0.25) + :burst-delay (seconds 2) + ) + :ped-rifle (new 'static 'squad-unit-settings + :target-count 7 + :shot-count 2 + :rand-shot-count 2 + :inaccuracy 0.125 + :acquire-delay (seconds 0.5) + :shot-delay (seconds 0.15) + :burst-delay (seconds 2) + ) + :ped-grenade (new 'static 'squad-unit-settings + :target-count 3 + :shot-count 1 + :inaccuracy 0.125 + :acquire-delay (seconds 1) + :shot-delay (seconds 0.25) + :burst-delay (seconds 3) + ) + :bike-turret (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 2 + :inaccuracy 0.125 + :acquire-delay (seconds 0.5) + :shot-delay (seconds 0.25) + :burst-delay (seconds 3) + ) + :hellcat-turret (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 2 + :inaccuracy 0.125 + :acquire-delay (seconds 0.5) + :shot-delay (seconds 0.25) + :burst-delay (seconds 3) + ) + ) + ) + +;; definition for symbol *ff-guard-type-mask*, type int +(define *ff-guard-type-mask* 63) + +;; definition for method 10 of type ff-squad-control +(defmethod squad-control-method-10 ((this ff-squad-control)) + (call-parent-method this) + (dotimes (v1-0 3) + (set! (-> this guard-type-info-array 0 data v1-0 object-type) (traffic-type guard-a)) + (set! (-> this guard-type-info-array 1 data v1-0 object-type) (traffic-type guard-a)) + (set! (-> this guard-type-info-array 2 data v1-0 object-type) (traffic-type guard-a)) + (set! (-> this guard-type-info-array 3 data v1-0 object-type) (traffic-type wlander-male)) + (set! (-> this guard-type-info-array 4 data v1-0 object-type) (traffic-type guard-bike)) + (set! (-> this guard-type-info-array 5 data v1-0 object-type) (traffic-type guard-car)) + ) + (dotimes (v1-3 29) + (set! (-> this guard-type-mask-from-object-type v1-3) (the-as uint 0)) + ) + (dotimes (v1-6 10) + (when (logtest? *ff-guard-type-mask* (ash 1 v1-6)) + (let ((a0-17 (-> this guard-type-info-array v1-6 guard-info-normal object-type))) + (set! (-> this guard-type-mask-from-object-type a0-17) + (the-as uint (logior (ash 1 v1-6) (-> this guard-type-mask-from-object-type a0-17))) + ) + ) + ) + ) + (init-alert this) + (none) + ) + +;; definition for method 12 of type ff-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod init-alert ((this ff-squad-control)) + (let ((t9-0 (-> *traffic-info* restore-speech-callback))) + (if t9-0 + (t9-0) + ) + ) + (let ((t9-1 (method-of-type squad-control init-alert))) + (t9-1 this) + ) + (dotimes (v1-4 3) + (dotimes (a0-2 10) + (when (logtest? *ff-guard-type-mask* (ash 1 a0-2)) + (let ((a1-6 (the-as traffic-guard-type-array (+ (+ (* v1-4 16) 1780 (* 48 a0-2)) (the-as int this))))) + (set! (-> a1-6 guard-info-normal min-target-count) 0) + (set! (-> a1-6 guard-info-normal max-target-count) 127) + ) + ) + ) + ) + (set-guard-target-level this 1.0) + 0 + (none) + ) + +;; definition for method 56 of type ff-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod ff-squad-control-method-56 ((this ff-squad-control) (arg0 int) (arg1 int) (arg2 int)) + (let ((v1-3 (-> this guard-type-info-array (the-as uint arg0)))) + (set! (-> v1-3 guard-info-normal min-target-count) (max 0 (min 127 arg1))) + (set! (-> v1-3 guard-info-normal max-target-count) (max 0 (min 127 arg2))) + ) + 0 + (none) + ) + +;; definition for method 16 of type ff-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod squad-control-method-16 ((this ff-squad-control) (arg0 vector) (arg1 process-focusable) (arg2 squad-target-status)) + (local-vars (sv-176 (array crimson-guard)) (sv-180 (array float)) (sv-184 int)) + (let ((t9-0 (method-of-type squad-control squad-control-method-16))) + (t9-0 this arg0 arg1 arg2) + ) + (let ((s4-0 (get-idx-in-status-arr this (-> arg2 handle)))) + (set! sv-176 (the-as (array crimson-guard) (new 'stack 'boxed-array crimson-guard 16))) + (set! sv-180 (the-as (array float) (new 'stack 'boxed-array float 16))) + (set! sv-184 0) + (dotimes (s3-0 (the-as int (-> this traffic tracker1 active-object-count))) + (case (-> this traffic tracker1 active-object-type-list s3-0) + (((traffic-type guard-a)) + (let ((s2-0 (the-as crimson-guard (handle->process (-> this traffic tracker1 active-object-list s3-0))))) + (when (and s2-0 (not (focus-test? s2-0 dead inactive)) (= (-> s2-0 target-status handle) (-> arg2 handle))) + (set! (-> sv-176 sv-184) s2-0) + (set! (-> sv-180 sv-184) (vector-vector-distance (-> s2-0 root trans) (-> arg2 position))) + (set! sv-184 (+ sv-184 1)) + (set! (-> s2-0 move-index) -1) + ) + ) + ) + ) + ) + (let ((a0-14 #t)) + (while a0-14 + (set! a0-14 #f) + (dotimes (v1-32 (+ sv-184 -1)) + (when (< (-> sv-180 (+ v1-32 1)) (-> sv-180 v1-32)) + (let ((a0-17 (-> sv-176 v1-32)) + (f0-2 (-> sv-180 v1-32)) + ) + (set! (-> sv-176 v1-32) (-> sv-176 (+ v1-32 1))) + (set! (-> sv-176 (+ v1-32 1)) a0-17) + (set! (-> sv-180 v1-32) (-> sv-180 (+ v1-32 1))) + (set! (-> sv-180 (+ v1-32 1)) f0-2) + ) + (set! a0-14 #t) + ) + ) + ) + ) + (cond + ((< s4-0 0) + ) + (else + (let ((s3-1 (new 'stack-no-clear 'array 'float 16))) + (dotimes (v1-37 16) + (set! (-> s3-1 v1-37) 0.0) + ) + (dotimes (s2-1 sv-184) + (crimson-guard-method-282 (-> sv-176 s2-1) (-> arg2 position) (-> this target-formation-array s4-0) s3-1 16) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 35 of type ff-squad-control +(defmethod squad-control-city-method-35 ((this ff-squad-control) (arg0 citizen) (arg1 handle)) + (cond + ((type? arg0 citizen) + (let ((a0-2 arg0)) + (cond + ((!= (-> a0-2 faction-mode) 1) + (if (zero? (-> this alert-state level)) + (the-as process-focusable #f) + (get-focus-in-range this arg0) + ) + ) + (else + (call-parent-method this arg0 arg1) + ) + ) + ) + ) + (else + (ff-squad-control-method-51 + this + arg0 + (collide-spec jak enemy hit-by-others-list player-list bot-targetable jak-vehicle) + ) + ) + ) + ) + +;; definition for method 51 of type ff-squad-control +;; WARN: Return type mismatch process-drawable vs process-focusable. +(defmethod ff-squad-control-method-51 ((this ff-squad-control) (arg0 process-focusable) (arg1 collide-spec)) + (let ((gp-0 (the-as process-drawable #f))) + (let ((f30-0 (the-as float #x7f800000))) + (when (logtest? arg1 (collide-spec player-list)) + (let ((v1-4 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((s3-0 (-> v1-4 next0))) + (while (!= v1-4 (-> *collide-player-list* alive-list-end)) + (let ((v1-5 (the-as collide-shape (-> (the-as connection v1-4) param1)))) + (when (logtest? arg1 (-> v1-5 root-prim prim-core collide-as)) + (let* ((s1-0 (-> v1-5 process)) + (s2-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when (and s2-0 (not (focus-test? (the-as process-focusable s2-0) disable dead inactive)) (!= arg0 s2-0)) + (let ((f0-0 (vector-vector-xz-distance (-> arg0 root trans) (-> (the-as process-focusable s2-0) root trans)))) + (when (or (not gp-0) (< f0-0 f30-0)) + (set! gp-0 s2-0) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + (set! v1-4 s3-0) + *collide-player-list* + (set! s3-0 (-> (the-as connection s3-0) next0)) + ) + ) + ) + ) + (when (logtest? arg1 (collide-spec hit-by-player-list hit-by-others-list)) + (when (logtest? arg1 (collide-spec hit-by-player-list)) + (let ((v1-22 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((s3-1 (-> v1-22 next0))) + (while (!= v1-22 (-> *collide-hit-by-player-list* alive-list-end)) + (let ((v1-23 (the-as collide-shape (-> (the-as connection v1-22) param1)))) + (when (logtest? arg1 (-> v1-23 root-prim prim-core collide-as)) + (let* ((s1-1 (-> v1-23 process)) + (s2-1 (if (type? s1-1 process-focusable) + s1-1 + ) + ) + ) + (when (and s2-1 (not (focus-test? (the-as process-focusable s2-1) disable dead inactive)) (!= arg0 s2-1)) + (let ((f0-1 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-1 root trans)))) + (when (or (not gp-0) (< f0-1 f30-0)) + (set! gp-0 s2-1) + (set! f30-0 f0-1) + ) + ) + ) + ) + ) + ) + (set! v1-22 s3-1) + *collide-hit-by-player-list* + (set! s3-1 (-> s3-1 next0)) + ) + ) + ) + ) + (when (logtest? arg1 (collide-spec hit-by-others-list)) + (let ((v1-38 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((s3-2 (-> v1-38 next0))) + (while (!= v1-38 (-> *collide-hit-by-others-list* alive-list-end)) + (let ((v1-39 (the-as collide-shape (-> (the-as connection v1-38) param1)))) + (when (logtest? arg1 (-> v1-39 root-prim prim-core collide-as)) + (let* ((s1-2 (-> v1-39 process)) + (s2-2 (if (type? s1-2 process-focusable) + s1-2 + ) + ) + ) + (when (and s2-2 (not (focus-test? (the-as process-focusable s2-2) disable dead inactive)) (!= arg0 s2-2)) + (let ((f0-2 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-2 root trans)))) + (when (or (not gp-0) (< f0-2 f30-0)) + (set! gp-0 s2-2) + (set! f30-0 f0-2) + ) + ) + ) + ) + ) + ) + (set! v1-38 s3-2) + *collide-hit-by-others-list* + (set! s3-2 (-> s3-2 next0)) + ) + ) + ) + ) + ) + ) + (the-as process-focusable gp-0) + ) + ) + +;; definition for method 48 of type ff-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod ff-squad-control-method-48 ((this ff-squad-control)) + (let ((v0-0 0)) + (dotimes (v1-0 10) + (if (logtest? *ff-guard-type-mask* (ash 1 v1-0)) + (+! v0-0 (-> this guard-type-info-array v1-0 guard-info-normal count)) + ) + ) + ) + (none) + ) + +;; definition for method 50 of type ff-squad-control +(defmethod get-focus ((this ff-squad-control)) + (get-target-focus this) + ) + +;; definition for method 49 of type ff-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod set-guard-target-level ((this ff-squad-control) (arg0 float)) + (set! (-> this alert-state guard-target-level) arg0) + 0 + (none) + ) + +;; definition for method 53 of type ff-squad-control +(defmethod get-unit-settings-by-idx ((this ff-squad-control) (arg0 int)) + (-> this settings guard-settings-array arg0) + ) + +;; definition for method 54 of type ff-squad-control +;; WARN: Return type mismatch uint vs none. +(defmethod ff-squad-control-method-54 ((this ff-squad-control) (arg0 int)) + (-> this traffic object-type-info-array arg0 guard-type) + (none) + ) + +;; definition for method 55 of type ff-squad-control +(defmethod ff-squad-control-method-55 ((this ff-squad-control) (arg0 int) (arg1 int)) + (-> (the-as ff-squad-control (+ (the-as uint this) (* (the-as uint 48) (the-as uint arg0)) (* arg1 16))) + guard-type-info-array + 0 + guard-info-normal + change-to-type + ) + ) + +;; definition for method 46 of type ff-squad-control +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 45 of type ff-squad-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ff-squad-control-method-45 ((this ff-squad-control)) + (let ((s5-0 (get-target-focus this))) + (let ((a1-0 (-> this alert-state level))) + (mem-copy! + (the-as pointer (-> this settings)) + (the-as pointer (+ (the-as uint *alert-level-settings*) (* 320 (the-as int a1-0)))) + 320 + ) + ) + (mem-copy! (the-as pointer (-> this settings-war)) (the-as pointer *ff-war-alert-state-settings*) 320) + (dotimes (v1-2 3) + (dotimes (a0-4 10) + (when (logtest? *ff-guard-type-mask* (ash 1 a0-4)) + (let ((a2-7 (the-as squad-alert-state-settings (+ (+ (* a0-4 32) 820 (* 320 v1-2)) (the-as int this)))) + (a1-13 (the-as traffic-guard-type-array (+ (+ (* v1-2 16) 1780 (* 48 a0-4)) (the-as int this)))) + ) + (set! (-> a2-7 ped-tazer inaccuracy) + (fmax 0.0 (fmin 1.0 (* (-> a2-7 ped-tazer inaccuracy) (-> this alert-state guard-inaccuracy-factor)))) + ) + (when (and s5-0 (= (-> s5-0 type) target)) + (when (focus-test? *target* pilot) + (set! (-> a2-7 ped-tazer acquire-delay) + (the-as uint (the int (* 0.75 (the float (-> a2-7 ped-tazer acquire-delay))))) + ) + (set! (-> a2-7 ped-tazer shot-delay) + (the-as uint (the int (* 0.6 (the float (-> a2-7 ped-tazer shot-delay))))) + ) + (set! (-> a2-7 ped-tazer burst-delay) + (the-as uint (the int (* 0.8 (the float (-> a2-7 ped-tazer burst-delay))))) + ) + ) + ) + (set! (-> a1-13 guard-info-normal target-count) + (max + (min + (the int (* (the float (-> a2-7 ped-tazer target-count)) (-> this alert-state guard-target-level))) + (-> a1-13 guard-info-normal max-target-count) + ) + (-> a1-13 guard-info-normal min-target-count) + ) + ) + ) + ) + ) + ) + ) + (dotimes (v1-5 3) + (dotimes (a0-7 29) + (let ((a2-12 (-> this guard-type-mask-from-object-type a0-7))) + (when (nonzero? a2-12) + (let ((a3-20 0) + (a1-17 0) + ) + (while (nonzero? a2-12) + (if (logtest? a2-12 1) + (+! a1-17 (-> (the-as ff-squad-control (+ (the-as uint this) (* 48 a3-20) (* v1-5 16))) + guard-type-info-array + 0 + guard-info-normal + target-count + ) + ) + ) + (+! a3-20 1) + (set! a2-12 (shr a2-12 1)) + ) + (set! (-> this traffic object-type-info-array 0 target-counts (+ v1-5 (* a0-7 32))) a1-17) + ) + ) + ) + ) + ) + (let ((s5-1 #f)) + (when (not (logtest? (-> this alert-state flags) (squad-alert-flag war))) + (when *traffic-alert-level-force* + (set! (-> this alert-state level) (the-as uint 3)) + (logclear! (-> this alert-state flags) (squad-alert-flag alert-ending)) + (set-time! (-> this alert-state start-time)) + ) + (when (>= (-> this alert-state level) (the-as uint 1)) + (set! s5-1 #t) + (cond + ((logtest? (-> this alert-state flags) (squad-alert-flag alert-ending)) + (cond + ((> (the-as int (ff-squad-control-method-48 this)) 0) + (set-time! (-> this alert-state start-time)) + ) + (else + (when (time-elapsed? (-> this alert-state start-time) (seconds 3)) + (set! s5-1 #f) + (set! (-> this alert-state level) (the-as uint 0)) + (logclear! (-> this alert-state flags) (squad-alert-flag alert-ending)) + ) + ) + ) + ) + (else + (let ((s4-0 + (+ (- (-> this alert-state start-time) (current-time)) (the-as time-frame (-> this alert-state duration))) + ) + ) + (if (and (get-target-focus this) + (= (-> (get-target-focus this) type) target) + (-> *target* next-state) + (= (-> *target* next-state name) 'target-hide) + ) + (set! s4-0 (- s4-0 (the-as time-frame (* (- (current-time) (-> *target* state-time)) 2)))) + ) + (if (> s4-0 0) + 0 + (logior! (-> this alert-state flags) (squad-alert-flag alert-ending)) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (if (not (logtest? (-> this alert-state flags) (squad-alert-flag alarm-on))) + (logior! (-> this alert-state flags) (squad-alert-flag alarm-on)) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> (target-pos 0) quad)) + (if #t + (ff-squad-control-method-47 this) + ) + (let ((v1-65 0)) + (dotimes (a0-26 29) + (let ((a1-20 (-> this traffic object-type-info-array a0-26))) + (if #t + (+! v1-65 (-> a1-20 killed-count)) + ) + ) + ) + (if (and (>= v1-65 (the-as int (* (-> this alert-state level) 8))) + (< (-> this alert-state level) (-> this alert-state max-level)) + ) + (start-alert this (the-as int (+ (-> this alert-state level) 1))) + ) + ) + ) + (else + (when (logtest? (-> this alert-state flags) (squad-alert-flag alarm-on)) + (logclear! (-> this alert-state flags) (squad-alert-flag alarm-on)) + (ff-squad-control-method-47 this) + (let ((v1-79 (-> this alert-state target-status-array))) + (logclear! (-> v1-79 0 flags) (squad-target-flag visible-now visible-recently visible-ever)) + ) + (dotimes (v1-80 29) + (set! (-> this traffic object-type-info-array v1-80 killed-count) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 47 of type ff-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod ff-squad-control-method-47 ((this ff-squad-control)) + (set-time! (-> this alert-state notify-time)) + (cond + ((> (-> this alert-state level) 0) + (if (and (not (logtest? (-> this alert-state flags) (squad-alert-flag alert-ending))) (get-target-focus this)) + (for-all-active-processes + (-> this traffic) + (lambda ((arg0 crimson-guard) (arg1 traffic-object-type-info)) + (when (logtest? (-> arg1 flags) (traffic-type-flag ttf0)) + (let ((a0-1 arg0)) + (if (!= (-> a0-1 faction-mode) 1) + (send-event arg0 'alert-begin (get-target-focus *ff-squad-control*)) + ) + ) + ) + (none) + ) + ) + ) + ) + (else + (for-all-active-processes + (-> this traffic) + (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) + (if (logtest? (-> arg1 flags) (traffic-type-flag ttf0)) + (send-event arg0 'alert-end) + ) + (none) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 52 of type ff-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod end-pursuit-for-all ((this ff-squad-control) (arg0 int)) + (for-all-active-processes-of-type + (-> this traffic tracker-array (-> this traffic object-type-info-array arg0 tracker-index)) + (the-as traffic-type arg0) + (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) (send-event arg0 'end-pursuit) (none)) + ) + 0 + (none) + ) + +;; definition for method 26 of type ff-squad-control +(defmethod set-pos-vel ((this ff-squad-control) (arg0 primary-target-pos-vel)) + (squad-control-method-25 this arg0 (seconds 0.45)) + arg0 + ) + +;; definition for method 13 of type ff-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod update ((this ff-squad-control)) + (call-parent-method this) + (ff-squad-control-method-45 this) + (ff-squad-control-method-46 this) + (when *cty-faction-manager* + (let ((a2-0 (if (> (-> this alert-state level) 0) + (the-as int (+ (-> this alert-state level) 3)) + 3 + ) + ) + ) + (faction-spawn *cty-faction-manager* 2 a2-0 #f #f) + ) + ) + 0 + (none) + ) + +;; definition for method 39 of type ff-squad-control +(defmethod squad-control-city-method-39 ((this ff-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (if (type? arg0 crimson-guard) + (crimson-guard-method-288 (the-as crimson-guard arg0) arg1) + ) + ) + +;; definition for method 43 of type ff-squad-control +(defmethod squad-control-city-method-43 ((this ff-squad-control) (arg0 process-focusable)) + (if (type? arg0 crimson-guard) + (time-elapsed? (-> (the-as crimson-guard arg0) last-choose-new-enemy-time) (seconds 4)) + #t + ) + ) + +;; definition for function set-ff-primary-target +;; WARN: Return type mismatch int vs none. +(defun set-ff-primary-target ((arg0 handle) (arg1 float)) + (when *ff-squad-control* + (let* ((s5-0 *ff-squad-control*) + (s4-0 (method-of-object s5-0 squad-control-method-27)) + (s3-0 (handle->process arg0)) + ) + (s4-0 + s5-0 + (if (type? s3-0 process-focusable) + s3-0 + ) + arg1 + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc new file mode 100644 index 0000000000..a7fbbaea9f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc @@ -0,0 +1,565 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 264 of type crimson-guard +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod crimson-guard-method-264 ((this crimson-guard)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14)))) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'traj3d-params)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0)) + (f30-0 1.0) + ) + (set! (-> s3-1 y) 0.0) + (vector-rotate-around-y! s3-1 s3-1 (* 182.04445 (+ (if (zero? (rand-vu-int-count 2)) + 90.0 + -90.0 + ) + (rand-vu-float-range -45.0 45.0) + ) + ) + ) + (set! f30-0 + (cond + ((!= (-> (handle->process (-> this focus handle)) type) target) + (set! (-> s3-1 quad) (the-as uint128 0)) + (set! (-> s5-0 dest quad) + (-> (get-trans (the-as process-focusable (handle->process (-> this focus handle))) 3) quad) + ) + 0.0 + ) + (else + (if (logtest? (-> this draw status) (draw-control-status on-screen)) + (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 2.0))) + (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 3.0))) + ) + (set! (-> s5-0 dest quad) + (-> (vector+! (new 'stack-no-clear 'vector) s3-1 (-> this target-pos-predict-miss)) quad) + ) + f30-0 + ) + ) + ) + (set! (-> s5-0 src quad) (-> s4-0 quad)) + (set! (-> s5-0 initial-tilt) 8192.0) + (set! (-> s5-0 gravity) 184320.0) + (when (traj3d-calc-initial-velocity-using-tilt s5-0) + (let ((a1-14 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> a1-14 ent) (-> this entity)) + (set! (-> a1-14 charge) f30-0) + (set! (-> a1-14 options) (projectile-options)) + (logclear! (-> a1-14 options) (projectile-options po14 po15 po16)) + (set! (-> a1-14 pos quad) (-> s5-0 src quad)) + (set! (-> a1-14 vel quad) (-> s5-0 initial-velocity quad)) + (set! (-> a1-14 notify-handle) (the-as handle #f)) + (set! (-> a1-14 owner-handle) (process->handle this)) + (set! (-> a1-14 target-handle) (the-as handle #f)) + (set! (-> a1-14 target-pos quad) (the-as uint128 0)) + (set! (-> a1-14 ignore-handle) (process->handle this)) + (let* ((v1-38 *game-info*) + (a0-37 (+ (-> v1-38 attack-id) 1)) + ) + (set! (-> v1-38 attack-id) a0-37) + (set! (-> a1-14 attack-id) a0-37) + ) + (set! (-> a1-14 timeout) (seconds 4)) + (spawn-projectile vehicle-grenade-deflect a1-14 this *default-dead-pool*) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate grenade-throw-post-retreating (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (set-time! (-> self state-time)) + (nav-enemy-method-177 self) + (flee-info-method-12 (-> self flee-behavior) self) + (set-time! (-> self last-check-player-time)) + (go-active-if-necessary) + (set! (-> self danger-pos quad) (-> self focus-pos quad)) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (go-active-if-necessary) + (+! (-> self total-flee-time) + (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)) + ) + (when (time-elapsed? (-> self last-check-player-time) (seconds 0.5)) + (set-time! (-> self last-check-player-time)) + (set! (-> self danger-pos quad) (-> self focus-pos quad)) + ) + (flee-info-method-11 (-> self flee-behavior) self) + (cond + ((< (seconds 2) (-> self total-flee-time)) + (set! (-> self urgent-fire) #t) + (go-hostile self) + ) + ((>= (-> self target-self-xz-dist) (* 1.2 (-> self grenade-guard-min-player-dist))) + (go-virtual grenade-throw-post-reloading) + ) + ((< (-> self target-self-xz-dist) 16384.0) + (go-virtual close-attack) + ) + ) + ) + :code (behavior () + (loop + (let ((a2-0 (new 'stack-no-clear 'vector))) + (let ((a1-0 (-> self nav state))) + (set! (-> a2-0 quad) (-> a1-0 target-pos quad)) + ) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 2) *color-red*) + ) + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 60) + ) + ) + :post (behavior () + (flee-info-method-13 (-> self flee-behavior) self) + ) + ) + +;; definition of type reload-grenade-spawn-params +(deftype reload-grenade-spawn-params (structure) + ((owner handle) + (joint-index uint16) + ) + ) + +;; definition for method 3 of type reload-grenade-spawn-params +(defmethod inspect ((this reload-grenade-spawn-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'reload-grenade-spawn-params) + (format #t "~1Towner: ~D~%" (-> this owner)) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (label cfg-4) + this + ) + +;; definition of type reload-grenade +(deftype reload-grenade (process-drawable) + ((owner handle) + (joint-index uint16) + ) + (:state-methods + dormant + visible + shrinking + die + ) + (:methods + (move-to-joint (_type_) quaternion) + ) + ) + +;; definition for method 3 of type reload-grenade +(defmethod inspect ((this reload-grenade)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Towner: ~D~%" (-> this owner)) + (format #t "~2Tjoint-index: ~D~%" (-> this joint-index)) + (label cfg-4) + this + ) + +;; definition for function reload-grenade-init-by-other +;; WARN: Return type mismatch int vs object. +(defbehavior reload-grenade-init-by-other reload-grenade ((arg0 reload-grenade-spawn-params)) + (ctywide-entity-hack) + (stack-size-set! (-> self main-thread) 128) + (set! (-> self owner) (-> arg0 owner)) + (set! (-> self joint-index) (-> arg0 joint-index)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-vehicle-grenade" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> self root scale) 1.4 1.4 1.4 1.0) + (go-virtual dormant) + 0 + ) + +;; failed to figure out what this is: +(defstate dormant (reload-grenade) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('wake-up) + (go-virtual visible) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate visible (reload-grenade) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('sleep) + (go-virtual shrinking) + ) + ) + ) + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let* ((f0-1 (fmin 1.0 (* 0.016666668 (the float (- (current-time) (-> self state-time)))))) + (f0-2 (lerp 0.01 1.4 f0-1)) + ) + (set-vector! (-> self root scale) f0-2 f0-2 f0-2 1.0) + ) + (move-to-joint self) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate shrinking (reload-grenade) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let* ((f0-1 (fmin 1.0 (* 0.016666668 (the float (- (current-time) (-> self state-time)))))) + (f0-2 (lerp 1.4 0.01 f0-1)) + ) + (set-vector! (-> self root scale) f0-2 f0-2 f0-2 1.0) + ) + (move-to-joint self) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) + (go-virtual die) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate die (reload-grenade) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + '() + ) + ) + +;; definition for method 24 of type reload-grenade +(defmethod move-to-joint ((this reload-grenade)) + (let ((s5-0 (the-as process-focusable (handle->process (-> this owner))))) + (when s5-0 + (vector<-cspace! (-> this root trans) (-> s5-0 node-list data (-> this joint-index))) + (matrix->quaternion (-> this root quat) (-> s5-0 node-list data (-> this joint-index) bone transform)) + ) + ) + ) + +;; definition for function reload-grenade-spawn +;; WARN: Return type mismatch process vs reload-grenade. +(defun reload-grenade-spawn ((arg0 crimson-guard) (arg1 type) (arg2 reload-grenade-spawn-params)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* arg1 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg0 "grenade" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 reload-grenade-init-by-other arg2) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as reload-grenade gp-0) + ) + ) + +;; failed to figure out what this is: +(defstate grenade-throw-post-reloading (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-time! (-> self state-time)) + (set! (-> self urgent-fire) #f) + (let ((a2-0 (new 'stack-no-clear 'reload-grenade-spawn-params))) + (set! (-> a2-0 owner) (process->handle self)) + (set! (-> a2-0 joint-index) (the-as uint 9)) + (set! (-> self reloading-ammo) (process->handle (reload-grenade-spawn self reload-grenade a2-0))) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((a0-3 (handle->process (-> self reloading-ammo)))) + (if a0-3 + (send-event a0-3 'sleep) + ) + ) + (set! (-> self reloading-ammo) (the-as handle #f)) + ) + :trans (behavior () + (when (>= (* 0.5 (-> self grenade-guard-min-player-dist)) (-> self target-self-xz-dist)) + (cond + ((not (time-elapsed? (-> self state-time) (seconds 1.5))) + (+! (-> self num-times-reloading-interrupted) 1) + (cond + ((>= (-> self num-times-reloading-interrupted) 2) + (set! (-> self num-times-reloading-interrupted) 0) + (set! (-> self urgent-fire) #t) + (go-hostile self) + ) + (else + (go-virtual grenade-throw-post-retreating) + ) + ) + ) + (else + (set! (-> self urgent-fire) #t) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-grenade-reload-ja :num! (seek! max 0.92) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-0 (handle->process (-> self reloading-ammo))) + (f0-4 (ja-frame-num 0)) + ) + (when gp-0 + (cond + ((and (>= f0-4 4.0) (< f0-4 13.0)) + (send-event gp-0 'wake-up) + ) + ((< 14.0 f0-4) + (send-event gp-0 'sleep) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max 0.92)) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! crimson-guard-cock-gun-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (crimson-guard-method-285 self 1) + (go-hostile self) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate grenade-throw (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) 0.0) + ) + 0 + (let ((v1-12 (-> self nav state))) + (set! (-> v1-12 speed) 0.0) + ) + 0 + (let ((a0-8 (-> self nav state)) + (v1-15 *null-vector*) + ) + (set! (-> a0-8 velocity quad) (-> v1-15 quad)) + ) + 0 + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (set-time! (-> self last-fire-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-grenade-attack-ja + :num! (seek! (ja-aframe 12.0 0) 1.5) + :frame-num (ja-aframe 1.0 0) + ) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 1.5)) + ) + (go-active-if-necessary) + (crimson-guard-method-264 self) + (crimson-guard-method-285 self -1) + (set! (-> self urgent-fire) #f) + (set! (-> self grenade-guard-min-player-dist) 81920.0) + (ja-no-eval :group! crimson-guard-grenade-attack-ja + :num! (seek! (ja-aframe 32.0 0)) + :frame-num (ja-aframe 22.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 32.0 0))) + ) + (ja-no-eval :group! crimson-guard-grenade-attack-ja + :num! (seek! (ja-aframe 37.0 0)) + :frame-num (ja-aframe 33.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 37.0 0))) + ) + (set! (-> self total-flee-time) 0) + (cond + ((crimson-guard-method-272 self) + (crimson-guard-method-275 self) + ) + ((>= (-> self target-self-xz-dist) (-> self grenade-guard-min-player-dist)) + (go-virtual grenade-throw-post-reloading) + ) + (else + (go-virtual grenade-throw-post-retreating) + ) + ) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate grenade-hostile (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (crimson-guard-method-251 self) + (let* ((f30-0 150.0) + (v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-5 (the-as number (logior #x3f800000 v1-4))) + ) + (set! (-> self rand-state-time) (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-5)))))) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (crimson-guard-method-252 self) + (cond + ((> (-> self ammo-count) 0) + (if (and (or (time-elapsed? (-> self state-time) (-> self rand-state-time)) (-> self urgent-fire)) + (and (logtest? (-> self flags) (citizen-flag target-in-sight)) (< (-> self target-self-xz-dist) 81920.0)) + ) + (go-virtual grenade-throw) + ) + ) + (else + (if (or (and (time-elapsed? (-> self state-time) (seconds 1.5)) (not (-> self urgent-fire))) + (>= (-> self target-self-xz-dist) (* 0.75 (-> self grenade-guard-min-player-dist))) + ) + (go-virtual grenade-throw-post-reloading) + ) + ) + ) + (when (< (vector-vector-xz-distance (-> self root trans) (-> self move-position)) 8192.0) + (crimson-guard-method-289 self (-> self last-quick-target-spot-angle)) + (go-virtual grenade-throw-post-reloading) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (crimson-guard-method-253 self) + (crimson-guard-method-254 self) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-rifle_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-rifle_REF.gc new file mode 100644 index 0000000000..220a270f3a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/guard-rifle_REF.gc @@ -0,0 +1,352 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 255 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod crimson-guard-method-255 ((this crimson-guard)) + (let ((s5-0 (-> this target-pos-predict-miss)) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) + ) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 s3-0) 1.0) + (new 'stack-no-clear 'vector) + (spawn-guard-projectile this s3-0 s5-0 819200.0 s4-0) + ) + (crimson-guard-method-285 this -1) + 0 + (none) + ) + +;; definition for method 257 of type crimson-guard +;; INFO: Used lq/sq +(defmethod crimson-guard-method-257 ((this crimson-guard)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a0-3)) + ) + (vector-normalize! s3-1 409600.0) + (and (crimson-guard-method-256 this) + (zero? (crimson-guard-method-258 this s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate gun-shoot (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (if (zero? (-> self ammo-count)) + (go-virtual rifle-reload) + ) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self other-side) (if (< (rand-vu) 0.5) + #t + #f + ) + ) + (nav-enemy-method-177 self) + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logclear (-> v1-11 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-11 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-14 self)) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logclear (-> v1-14 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-17 (-> self nav state))) + (set! (-> v1-17 speed) 0.0) + ) + 0 + (let ((a0-9 (-> self nav state)) + (v1-20 *null-vector*) + ) + (set! (-> a0-9 velocity quad) (-> v1-20 quad)) + ) + 0 + (set-time! (-> self state-time)) + (set-time! (-> self last-time-see-target)) + (set! (-> self miss-amount) (lerp-scale 0.0 16384.0 (-> self target-self-dist) 40960.0 122880.0)) + (set! (-> self miss-amount) 16384.0) + (let ((v1-30 (handle->process (-> self focus handle)))) + (if (and v1-30 (logtest? (process-mask enemy) (-> v1-30 mask))) + (set! (-> self miss-amount) 0.0) + ) + ) + (set-time! (-> self next-shot)) + (set! (-> self joint-enable) #t) + ) + :exit (behavior () + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :trans (behavior () + (go-active-if-necessary) + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when gp-0 + (when (not (and gp-0 (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))))) + (set! (-> self miss-amount) (lerp-scale 0.0 16384.0 (-> self target-self-dist) 40960.0 122880.0)) + (set! (-> self miss-amount) 16384.0) + ) + (if (and (< (-> self target-self-xz-dist) 16384.0) + (and (< (fabs (-> self target-y-angle)) 7281.778) + gp-0 + (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + (go-virtual close-attack) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) + (or (not (logtest? (-> self flags) (citizen-flag target-in-sight))) + (< 184320.0 (-> self target-self-xz-dist)) + (< 10922.667 (fabs (-> self target-y-angle))) + ) + ) + (go-hostile self) + ) + ) + ) + ) + :code (behavior () + (local-vars (v1-33 object)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 0 anim-index)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (label cfg-3) + (when (crimson-guard-method-257 self) + (set! v1-33 #t) + (goto cfg-10) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (set! v1-33 #f) + (goto cfg-10) + ) + (suspend) + (b! (not #f) cfg-3 :delay (set! v1-33 #f)) + (label cfg-10) + (when v1-33 + (set-time! (-> self state-time)) + (let ((gp-1 (min 3 (the-as int (+ (logand (rand-uint31-gen *random-generator*) 3) 1))))) + (until #f + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 1 anim-index)) :num! min) + (set! (-> self already-shot) #t) + (lerp-scale 1.0 0.2 (-> self target-self-dist) 20480.0 122880.0) + (let ((f0-8 1.0)) + (cond + ((logtest? (-> self draw status) (draw-control-status on-screen)) + (let ((v1-58 (handle->process (-> self focus handle)))) + (when v1-58 + (if (or (< (-> self target-vel) 40.96) + (and (focus-test? (the-as process-focusable v1-58) pilot) (< (-> self target-pos y) 49152.0)) + ) + (set! (-> self miss-amount) (- (-> self miss-amount) (* 12288.0 f0-8))) + (set! (-> self miss-amount) (- (-> self miss-amount) (* 4096.0 f0-8))) + ) + ) + ) + ) + (else + (set! (-> self miss-amount) (- (-> self miss-amount) (* 3276.8 f0-8))) + ) + ) + ) + (if (< (-> self miss-amount) 0.0) + (set! (-> self miss-amount) 0.0) + ) + (crimson-guard-method-255 self) + (set-time! (-> self last-fire-time)) + (until (ja-done? 0) + (ja :num! (seek!)) + (suspend) + ) + (if (zero? (-> self ammo-count)) + (go-virtual rifle-reload) + ) + (+! gp-1 -1) + (if (or (< gp-1 0) + (not (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + ) + (goto cfg-59) + ) + ) + ) + #f + ) + (label cfg-59) + (let ((f30-1 (rnd-float-range self 0.9 1.1))) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 2 anim-index)) + :num! (seek! max f30-1) + :frame-num 0.0 + ) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (crimson-guard-method-268 self) + ) + :post (behavior () + (citizen-method-213 self) + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate rifle-reload (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim crimson-guard-grenade-reload-ja)) + (set! (-> gp-0 param 0) + (the float (+ (-> (the-as art-joint-anim crimson-guard-grenade-reload-ja) frames num-frames) -1)) + ) + (let* ((f30-0 1.1) + (f28-0 0.39999998) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> gp-0 param 1) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-15))))) + ) + (set! (-> gp-0 frame-num) 0.0) + (joint-control-channel-group! gp-0 (the-as art-joint-anim crimson-guard-grenade-reload-ja) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (let* ((f30-1 1.1) + (f28-1 0.39999998) + (v1-29 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-30 (the-as number (logior #x3f800000 v1-29))) + ) + (set! (-> gp-1 param 1) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-30))))) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (crimson-guard-method-285 self 3) + (set! (-> self last-fire-time) 0) + (let ((v1-36 #f)) + (let ((a0-13 (handle->process (-> self focus handle)))) + (if (and a0-13 (focus-test? (the-as process-focusable a0-13) ignore)) + (set! v1-36 #t) + ) + ) + (when (and (not v1-36) (or (>= 40960.0 (-> self target-self-xz-dist)) + (= (-> self ammo-count) (crimson-guard-method-286 self)) + (time-elapsed? (-> self last-fire-time) (-> self rand-state-time)) + ) + ) + 0 + (goto cfg-26) + ) + ) + ) + #f + (label cfg-26) + (ja-channel-push! 1 0) + (ja-no-eval :group! crimson-guard-cock-gun-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (go-hostile self) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate rifle-hostile (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (crimson-guard-method-251 self) + (set! (-> self rand-state-time) (the-as time-frame (the int (* 300.0 (rnd-float-range self 2.5 4.5))))) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (crimson-guard-method-252 self) + (let ((v1-4 (handle->process (-> self focus handle)))) + (if (or (not v1-4) + (not (and v1-4 + (not (logtest? (-> (the-as process-focusable v1-4) focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + ) + (go-virtual rifle-reload) + ) + ) + (when (and (< (-> self target-self-xz-dist) 163840.0) + (or (< 40960.0 (-> self target-self-xz-dist)) (>= 2 (the-as int (-> self focus aware)))) + ) + (when (and (logtest? (-> self flags) (citizen-flag target-in-sight)) + (< (vector-vector-xz-distance (-> self root trans) (-> self move-position)) 20480.0) + ) + (if (or (time-elapsed? (-> self last-fire-time) (-> self rand-state-time)) (= (-> self faction-mode) 1)) + (go-virtual gun-shoot) + (go-virtual rifle-reload) + ) + ) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-position)) 8192.0) + (crimson-guard-method-289 self (-> self last-quick-target-spot-angle)) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (crimson-guard-method-253 self) + (crimson-guard-method-254 self) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc new file mode 100644 index 0000000000..4a970c4418 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc @@ -0,0 +1,1202 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate knocked-recover (crimson-guard) + :virtual #t + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((a0-3 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-3 flags) (nav-state-flag directional-mode)) + (set! (-> a0-3 travel quad) (-> v1-3 quad)) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (set! (-> self hit-face) (the-as uint -1)) + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((v1-1 (if (zero? (-> self hit-face)) + (-> self anim-get-up-front) + (-> self anim-get-up-back) + ) + ) + ) + (ja-no-eval :group! (-> self draw art-group data v1-1) :num! (seek! max (-> self speed-scale)) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (if (enemy-method-109 self) + (go-die self) + (go-best-state self) + ) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-front (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (set! (-> self hit-face) (the-as uint -1)) + (enemy-method-50 self 0) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-get-up-front)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (set! (-> self hit-face) (the-as uint -1)) + (go-best-state self) + ) + :post (behavior () + (reset-penetrate! self) + (let ((a0-1 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-3 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-back (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (set! (-> self hit-face) (the-as uint -1)) + (enemy-method-50 self 0) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-get-up-back)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (set! (-> self hit-face) (the-as uint -1)) + (go-best-state self) + ) + :post (behavior () + (reset-penetrate! self) + (let ((a0-1 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-3 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (crimson-guard) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (if (= (-> self hit-points) 0.0) + (set! (-> self root penetrated-by) (the-as penetrate -1)) + ) + (set! (-> self hit-face) + (the-as + uint + (if (< (vector-dot (-> self root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + 0.0 + ) + 1 + 0 + ) + ) + ) + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (reset-penetrate! self) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-off-vehicle (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + '() + ) + :code (behavior () + (suspend) + (citizen-method-206 self) + ) + ) + +;; definition for function debug-active +(defun debug-active () + #f + ) + +;; failed to figure out what this is: +(defstate active (crimson-guard) + :virtual #t + :enter (behavior () + (when (not (-> self nav)) + (format #t "++++++++++++++ guard::active : nav = #f +++++++++++++++~%") + (go-inactive self) + ) + (let ((t9-2 (-> (method-of-type citizen active) enter))) + (if t9-2 + (t9-2) + ) + ) + (logclear! (-> self flags) (citizen-flag in-pursuit hostile)) + (set! (-> self already-shot) #f) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type citizen active) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (logtest? (-> self draw status) (draw-control-status on-screen)) + (let ((f0-0 61440.0)) + (cond + ((< (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> self root trans))) + (speech-control-method-13 *speech-control* self (speech-type guard-chatter) (-> self traffic-id)) + (speech-control-method-17 *speech-control* (speech-type guard-chatter-jak) 0.2) + ) + (else + (speech-control-method-13 *speech-control* self (speech-type guard-chatter-jak) (-> self traffic-id)) + (speech-control-method-17 *speech-control* (speech-type guard-chatter) 0.2) + ) + ) + ) + ) + (crimson-guard-method-270 self) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (handle->process (-> self target-status handle)) + (go-hostile self) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate close-attack-active (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let* ((v1-5 *game-info*) + (a0-8 (+ (-> v1-5 attack-id) 1)) + ) + (set! (-> v1-5 attack-id) a0-8) + (set! (-> self attack-id) a0-8) + ) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) 0.0) + ) + 0 + (logior! (-> self focus-status) (focus-status dangerous)) + ) + :exit (behavior () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (logclear! (-> v1-3 prim-core action) (collide-action deadly)) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-0 #f)) + (ja-no-eval :group! crimson-guard-rifle-butt-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (< 3.5 (ja-frame-num 0)) (not gp-0)) + (let ((v1-22 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (logior! (-> v1-22 prim-core action) (collide-action deadly)) + ) + (set! gp-0 #t) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-virtual active) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate inactive (crimson-guard) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((t9-0 (-> (method-of-type citizen inactive) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self flags) (citizen-flag in-pursuit hostile)) + (set! (-> self already-shot) #f) + ) + ) + +;; failed to figure out what this is: +(defstate search (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (nav-enemy-method-177 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self enemy-info run-travel-speed))) + ) + 0 + (if (zero? (-> self controller branch)) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + '() + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (if (and (nonzero? (-> self controller branch)) + (let ((f0-0 (vector-vector-xz-distance-squared (-> self root trans) (-> self dest-point))) + (f1-0 16384.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + ) + (let ((a0-2 (-> self nav state)) + (v1-9 (-> self dest-point)) + ) + (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-2 target-pos quad) (-> v1-9 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +;; definition for method 251 of type crimson-guard +;; WARN: Return type mismatch float vs none. +(defmethod crimson-guard-method-251 ((this crimson-guard)) + ((-> (method-of-type nav-enemy hostile) enter)) + (nav-enemy-method-177 this) + (when (-> this nav) + (let ((v1-6 (-> this nav))) + (set! (-> v1-6 target-speed) (* (-> this speed-scale) (-> this enemy-info run-travel-speed))) + ) + 0 + ) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + (logclear! (-> this flags) (citizen-flag in-formation)) + (set! (-> this root nav-radius) 6144.0) + (none) + ) + +;; definition for method 252 of type crimson-guard +(defmethod crimson-guard-method-252 ((this crimson-guard)) + (go-active-if-necessary) + (speech-control-method-17 *speech-control* (speech-type guard-chatter) 0.2) + (speech-control-method-17 *speech-control* (speech-type guard-chatter-jak) 0.2) + (cond + (*guard-died-recently?* + (speech-control-method-13 *speech-control* this (speech-type guard-witness-death) (-> this traffic-id)) + (set! *guard-died-recently?* #f) + ) + (else + (speech-control-method-13 *speech-control* this (speech-type guard-generic-battle) (-> this traffic-id)) + ) + ) + (if (crimson-guard-method-270 this) + (go-hostile this) + ) + (let* ((s4-0 (-> this target-status)) + (s3-0 (handle->process (-> s4-0 handle))) + (s5-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (if (and s5-0 (or (focus-test? (the-as process-focusable s5-0) inactive) + (focus-test? (the-as process-focusable s5-0) disable) + ) + ) + (set! s5-0 (the-as process #f)) + ) + (cond + ((not s5-0) + ) + (else + (when (and (logtest? (-> this nav state flags) (nav-state-flag at-target)) + (not (logtest? (-> s4-0 flags) (squad-target-flag visible-recently))) + ) + (logclear! (-> this flags) (citizen-flag persistent)) + (citizen-method-208 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this search)) + ) + (when (or (logtest? (-> s4-0 flags) (squad-target-flag visible-recently)) + (not (logtest? (-> s5-0 mask) (process-mask target))) + ) + (cond + ((focus-test? (the-as process-focusable s5-0) arrestable) + (if (and (< (-> this target-self-xz-dist) 28672.0) + (< (fabs (-> this target-y-angle)) 7281.778) + (>= 8192.0 (fabs (- (-> (get-trans (the-as process-focusable s5-0) 1) y) (-> this root trans y)))) + ) + (go (method-of-object this arrest)) + ) + ) + (else + (if (crimson-guard-method-269 this (the-as process-focusable s5-0)) + (go (method-of-object this close-attack)) + ) + ) + ) + ) + (let ((f0-7 (* 2.0 (crimson-guard-method-283 this)))) + (when (and (time-elapsed? (-> this state-time) (seconds 1)) + (< (* f0-7 f0-7) + (vector-vector-xz-distance-squared (-> this root trans) (get-trans (the-as process-focusable s5-0) 0)) + ) + ) + (set-time! (-> this state-time)) + (crimson-guard-method-289 this 0.0) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 253 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod crimson-guard-method-253 ((this crimson-guard)) + 0 + (none) + ) + +;; definition for method 254 of type crimson-guard +;; INFO: Used lq/sq +(defmethod crimson-guard-method-254 ((this crimson-guard)) + (local-vars (sv-112 vector) (sv-128 vector) (sv-144 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (handle->process (-> this focus handle)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this move-position quad)) + (when (< 8192000.0 (-> this target-self-xz-dist)) + (let ((s3-0 (-> this root trans)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! (-> s1-0 quad) (-> s5-0 quad)) + (vector-z-quaternion! s2-0 (-> this root quat)) + (let ((f30-0 (* 182.04445 (* 60.0 (the float (- (-> this traffic-id) *guard-min-id-hack*)))))) + (set! sv-128 s0-0) + (set! (-> sv-128 x) (cos f30-0)) + (set! (-> sv-128 y) 0.0) + (set! (-> sv-128 z) (sin f30-0)) + ) + (set! (-> sv-128 w) 1.0) + (let ((a1-2 s1-0)) + (let ((v1-21 s1-0)) + (let ((a0-13 s0-0)) + (let ((a2-1 12288.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-13 quad)) + ) + (.lvf vf4 (&-> v1-21 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 (&-> a1-2 quad) vf6) + ) + (let ((f30-2 (* 0.5 (vector-vector-xz-distance s3-0 s1-0)))) + (vector-normalize! s2-0 (* 0.5 f30-2)) + (vector-normalize! s0-0 (* 2.0 f30-2)) + ) + (set! sv-144 0) + (while (< sv-144 10) + (do-spline s4-0 s3-0 s2-0 s1-0 s0-0 (* 0.1 (the float sv-144))) + (do-spline sv-112 s3-0 s2-0 s1-0 s0-0 (* 0.1 (the float (+ sv-144 1)))) + (add-debug-line #t (bucket-id debug-no-zbuf1) s4-0 sv-112 *color-red* #f (the-as rgba -1)) + (set! sv-144 (+ sv-144 1)) + ) + (do-spline s4-0 s3-0 s2-0 s1-0 s0-0 0.9) + (set! (-> s4-0 quad) (-> s5-0 quad)) + ) + ) + (let ((v1-39 (-> this nav state))) + (logclear! (-> v1-39 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-39 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-39 target-pos quad) (-> s5-0 quad)) + ) + ) + 0 + (nav-enemy-method-187 this) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (crimson-guard-method-251 self) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (crimson-guard-method-252 self) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (crimson-guard-method-253 self) + (crimson-guard-method-254 self) + ) + ) + +;; failed to figure out what this is: +(defstate close-attack (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-4 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-4 enemy-flags))) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-4 enemy-flags)))) + ) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-4 enemy-flags)))) + (set! (-> v1-4 nav callback-info) (-> v1-4 enemy-info callback-info)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self urgent-fire) #f) + (let* ((v1-9 *game-info*) + (a0-17 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a0-17) + (set! (-> self attack-id) a0-17) + ) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 target-speed) 0.0) + ) + 0 + ) + :exit (behavior () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (logclear! (-> v1-3 prim-core action) (collide-action deadly)) + ) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (crimson-guard-method-261 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-0 #f)) + (ja-no-eval :group! crimson-guard-rifle-butt-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (< 3.5 (ja-frame-num 0)) (not gp-0)) + (let ((v1-22 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (logior! (-> v1-22 prim-core action) (collide-action deadly)) + ) + (set! gp-0 #t) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-hostile self) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate flee-danger (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (set-time! (-> self state-time)) + (nav-enemy-method-177 self) + (flee-info-method-12 (-> self flee-behavior) self) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (flee-info-method-11 (-> self flee-behavior) self) + (if (time-elapsed? (-> self state-time) (seconds 4)) + (go-hostile self) + ) + (if (< 81920.0 (vector-vector-xz-distance (-> self root trans) (-> self danger-pos))) + (go-virtual active) + ) + ) + :code (behavior () + (loop + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 60) + ) + ) + :post (behavior () + (flee-info-method-13 (-> self flee-behavior) self) + ) + ) + +;; failed to figure out what this is: +(defstate roll-right (crimson-guard) + :virtual #t + :event enemy-event-handler + :code (behavior () + (vector-reset! (-> self root transv)) + (vector-x-quaternion! (-> self root transv) (-> self root quat)) + (set! (-> self root transv y) 24576.0) + (vector-xz-normalize! (-> self root transv) 40960.0) + (let ((v1-7 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-7 enemy-flags))) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-7 enemy-flags)))) + ) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-7 enemy-flags)))) + (set! (-> v1-7 nav callback-info) (-> v1-7 enemy-info callback-info)) + ) + 0 + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 6.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (let ((a0-20 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-20 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans a0-20 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 6.0 0))) + ) + ) + (else + (ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 9.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (let ((a0-33 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-33 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans a0-33 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 9.0 0))) + ) + ) + ) + (let ((v1-58 self)) + (set! (-> v1-58 enemy-flags) (the-as enemy-flag (logclear (-> v1-58 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-58 nav callback-info) *null-nav-callback-info*) + ) + 0 + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 6.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 11.0 0))) + ) + ) + (else + (ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 9.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 11.0 0))) + ) + ) + ) + (go-virtual gun-shoot) + ) + :post (behavior () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef37) (-> a0-0 enemy-flags)) + (vector-v++! + (-> self root transv) + (compute-acc-due-to-gravity (-> self root) (new 'stack-no-clear 'vector) 0.0) + ) + (let ((a2-1 (new 'stack-no-clear 'collide-query)) + (a0-5 (-> self root)) + ) + (set! (-> a2-1 collide-with) (-> a0-5 root-prim prim-core collide-with)) + (set! (-> a2-1 ignore-process0) self) + (set! (-> a2-1 ignore-process1) #f) + (set! (-> a2-1 ignore-pat) (-> a0-5 pat-ignore-mask)) + (set! (-> a2-1 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide a0-5 (-> self root transv) a2-1 (meters 0)) + ) + ) + ) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate roll-left (crimson-guard) + :virtual #t + :event enemy-event-handler + :code (behavior () + (vector-reset! (-> self root transv)) + (vector-x-quaternion! (-> self root transv) (-> self root quat)) + (set! (-> self root transv y) 24576.0) + (vector-xz-normalize! (-> self root transv) -40960.0) + (let ((v1-7 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-7 enemy-flags))) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-7 enemy-flags)))) + ) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-7 enemy-flags)))) + (set! (-> v1-7 nav callback-info) (-> v1-7 enemy-info callback-info)) + ) + 0 + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 9.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (let ((a0-20 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-20 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans a0-20 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 9.0 0))) + ) + ) + (else + (ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 6.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (let ((a0-33 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-33 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans a0-33 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 6.0 0))) + ) + ) + ) + (let ((v1-58 self)) + (set! (-> v1-58 enemy-flags) (the-as enemy-flag (logclear (-> v1-58 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-58 nav callback-info) *null-nav-callback-info*) + ) + 0 + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 9.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 11.0 0))) + ) + ) + (else + (ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 6.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 11.0 0))) + ) + ) + ) + (go-virtual gun-shoot) + ) + :post (-> (method-of-type crimson-guard roll-right) post) + ) + +;; failed to figure out what this is: +(defstate arrest (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (nav-enemy-method-178 self) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (vector-reset! (-> self root transv)) + (let ((a0-9 (-> self nav state)) + (v1-12 *null-vector*) + ) + (set! (-> a0-9 velocity quad) (-> v1-12 quad)) + ) + 0 + (set-time! (-> self state-time)) + (set-time! (-> self last-time-see-target)) + (set! (-> self miss-amount) 0.0) + (set-time! (-> self next-shot)) + (set! (-> self joint-enable) #t) + (crimson-guard-method-262 self) + ) + :exit (behavior () + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :trans (behavior () + (send-event (handle->process (-> self focus handle)) 'arrest) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! crimson-guard-idle-to-stab-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (until #f + (if (or (not (logtest? (-> self flags) (citizen-flag target-in-sight))) + (< 49152.0 (-> self target-self-xz-dist)) + (< 10922.667 (fabs (-> self target-y-angle))) + ) + (goto cfg-17) + ) + (ja-no-eval :group! crimson-guard-stab-idle-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (label cfg-17) + (let ((f30-1 (rnd-float-range self 0.9 1.1))) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-stab-idle-to-idle-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (go-hostile self) + ) + :post (behavior () + (citizen-method-213 self) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate waiting-ambush (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (nav-enemy-method-178 self) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (vector-reset! (-> self root transv)) + (let ((a0-9 (-> self nav state)) + (v1-12 *null-vector*) + ) + (set! (-> a0-9 velocity quad) (-> v1-12 quad)) + ) + 0 + (set-time! (-> self state-time)) + (set! (-> self miss-amount) 0.0) + (set-time! (-> self next-shot)) + (set! (-> self joint-enable) #t) + (crimson-guard-method-262 self) + ) + :exit (behavior () + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! crimson-guard-idle-to-stab-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (while (not (logtest? (-> self flags) (citizen-flag target-in-sight))) + (ja-no-eval :group! crimson-guard-stab-idle-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((f30-1 (rnd-float-range self 0.9 1.1))) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-stab-idle-to-idle-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (go-hostile self) + ) + :post (behavior () + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate exit-transport (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) + (logclear! (-> self flags) (citizen-flag hostile)) + (nav-enemy-method-177 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self enemy-info run-travel-speed))) + ) + 0 + (set! (-> self already-shot) #f) + ) + :exit (behavior () + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + (if (-> self nav) + (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) + ) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (not (-> self already-shot)) + (crimson-guard-method-265 self 1.0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s5-0 (new 'stack 'collide-query)) + ) + (let ((a0-3 gp-0)) + (let ((v1-8 gp-0)) + (let ((a1-4 20480.0)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> s4-0 quad)) + (.lvf vf4 (&-> v1-8 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 (&-> a0-3 quad) vf6) + ) + (if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y)) + ) + ) + ) + (when (!= (crimson-guard-method-266 self (-> self event-param-point)) 0.0) + (let* ((v1-16 (-> self nav)) + (a1-7 (-> self event-param-point)) + (f0-3 (-> v1-16 extra-nav-sphere w)) + ) + (set! (-> v1-16 extra-nav-sphere quad) (-> a1-7 quad)) + (set! (-> v1-16 extra-nav-sphere w) f0-3) + ) + 0 + (let ((v1-19 (-> self nav))) + (set! (-> v1-19 extra-nav-sphere w) (-> self nav-radius-backup)) + ) + 0 + (let ((v1-21 (-> self nav))) + (logior! (-> v1-21 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (set! (-> self already-shot) #t) + ) + (crimson-guard-method-265 self 0.0) + ) + ) + ) + :code (behavior () + (while (not (-> self already-shot)) + (suspend) + ) + (set-time! (-> self state-time)) + (ja-channel-set! 1) + (let ((gp-0 (current-time)) + (s5-0 150) + (f30-0 2.0) + ) + (ja-no-eval :group! crimson-guard-run-ja :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? gp-0 s5-0) + (crimson-guard-method-265 self (* 0.006666667 (the float (- (current-time) (-> self state-time))))) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event self 'jump 0 (-> self event-param-point)) + (sleep-code) + ) + :post (behavior () + (ja-post) + ) + ) + +;; definition for method 78 of type crimson-guard +;; WARN: Return type mismatch int vs object. +(defmethod go-hostile ((this crimson-guard)) + (let ((v1-2 (handle->process (-> this focus handle)))) + (cond + (v1-2 + (logior! (-> this flags) (citizen-flag hostile)) + (if (and (not (logtest? (-> v1-2 mask) (process-mask target))) + (-> this next-state) + (= (-> this next-state name) 'active) + ) + (speech-control-method-13 *speech-control* this (speech-type guard-go-hostile) (-> this traffic-id)) + ) + (cond + (#f + ) + (else + (case (-> this guard-type) + (((guard-type rifle)) + (go (method-of-object this rifle-hostile)) + ) + (((guard-type tazer)) + (go (method-of-object this tazer-hostile)) + ) + (((guard-type grenade)) + (go (method-of-object this grenade-hostile)) + ) + ) + ) + ) + ) + (else + (go (method-of-object this active)) + ) + ) + ) + 0 + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-tazer_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-tazer_REF.gc new file mode 100644 index 0000000000..fb32c69dc5 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/guard-tazer_REF.gc @@ -0,0 +1,649 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function spread-lightning-lazer +;; INFO: Used lq/sq +(defun spread-lightning-lazer ((arg0 lightning-control) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (sv-640 int) (sv-656 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg2 quad)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'quaternion)) + ) + (vector-length arg2) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (set! (-> s1-0 quad) (-> arg3 quad)) + (let ((s0-0 (new 'stack-no-clear 'collide-query))) + (set! sv-640 0) + (while (< sv-640 6) + (let ((v1-6 s0-0)) + (set! (-> v1-6 radius) 2867.2) + (set! (-> v1-6 collide-with) + (collide-spec jak bot civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-6 ignore-process0) #f) + (set! (-> v1-6 ignore-process1) #f) + (set! (-> v1-6 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-6 action-mask) (collide-action solid)) + ) + (set! (-> s0-0 start-pos quad) (-> s5-0 quad)) + (set! (-> s0-0 move-dist quad) (-> s4-0 quad)) + (set-from-point-offset-pad! (-> s0-0 bbox) (-> s0-0 start-pos) (-> s0-0 move-dist) (-> s0-0 radius)) + (fill-using-bounding-box *collide-cache* s0-0) + (set! (-> s0-0 radius) 409.6) + (let ((f0-4 (probe-using-line-sphere *collide-cache* s0-0))) + (cond + ((>= f0-4 0.0) + (let ((a1-4 s3-0)) + (let ((v1-13 (-> s0-0 start-pos))) + (let ((a0-12 (-> s0-0 move-dist))) + (let ((a2-2 f0-4)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-12 quad)) + ) + (.lvf vf4 (&-> v1-13 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 (&-> a1-4 quad) vf6) + ) + (set! (-> s5-0 quad) (-> s3-0 quad)) + ) + (else + (vector+! (-> s0-0 start-pos) s5-0 s4-0) + (let ((a1-7 (-> s0-0 start-pos))) + (let ((v1-16 (-> s0-0 start-pos))) + (let ((a0-16 s1-0)) + (let ((a2-4 -2048.0)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-16 quad)) + ) + (.lvf vf4 (&-> v1-16 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 (&-> a1-7 quad) vf6) + ) + (vector-negate! (-> s0-0 move-dist) s4-0) + (set! f0-4 (probe-using-line-sphere *collide-cache* s0-0)) + (when (>= f0-4 0.0) + (let ((a1-10 s3-0)) + (let ((v1-19 (-> s0-0 start-pos))) + (let ((a0-19 (-> s0-0 move-dist))) + (let ((a2-5 f0-4)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-19 quad)) + ) + (.lvf vf4 (&-> v1-19 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 (&-> a1-10 quad) vf6) + ) + (let ((a1-11 s3-0)) + (let ((v1-20 s3-0)) + (let ((a0-20 s1-0)) + (let ((a2-7 2048.0)) + (.mov vf7 a2-7) + ) + (.lvf vf5 (&-> a0-20 quad)) + ) + (.lvf vf4 (&-> v1-20 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 (&-> a1-11 quad) vf6) + ) + (set! (-> s5-0 quad) (-> s3-0 quad)) + ) + ) + ) + (cond + ((>= f0-4 0.0) + (+! (-> s3-0 x) (rand-vu-float-range -819.2 819.2)) + (+! (-> s3-0 y) (rand-vu-float-range -819.2 819.2)) + (+! (-> s3-0 z) (rand-vu-float-range -819.2 819.2)) + (set-point! arg0 (-> arg0 state points-to-draw) s3-0) + (+! (-> arg0 state points-to-draw) 1) + (set! sv-656 (-> s0-0 best-other-tri normal)) + (quaternion-from-two-vectors! s2-0 s1-0 sv-656) + (vector-orient-by-quat! s4-0 s4-0 s2-0) + (set! (-> s1-0 quad) (-> sv-656 quad)) + (vector-flatten! s4-0 s4-0 sv-656) + ) + (else + (vector+! s5-0 s5-0 s4-0) + (when (< sv-640 6) + (set-point! arg0 (-> arg0 state points-to-draw) s5-0) + (+! (-> arg0 state points-to-draw) 1) + ) + ) + ) + ) + (set! sv-640 (+ sv-640 1)) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 263 of type crimson-guard +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod crimson-guard-method-263 ((this crimson-guard)) + (local-vars (sv-832 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) + (s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0)) + (s1-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0) 16384.0) + ) + (s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'collide-query)) + ) + (when (< 1820.4445 (vector-vector-angle-safe s2-0 s1-0)) + (let* ((a1-9 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) s2-0 s1-0) 1.0)) + (a2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-9 1820.4445)) + ) + (vector-orient-by-quat! s1-0 s2-0 a2-1) + ) + ) + (let ((a0-12 s4-0)) + (let ((v1-8 s4-0)) + (let ((a1-12 0.2)) + (.mov vf7 a1-12) + ) + (.lvf vf5 (&-> s2-0 quad)) + (.lvf vf4 (&-> v1-8 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 (&-> a0-12 quad) vf6) + ) + (vector+! s5-0 s4-0 s1-0) + (let ((v1-10 s3-0)) + (set! (-> v1-10 radius) 409.6) + (set! (-> v1-10 collide-with) + (collide-spec jak bot civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-10 ignore-process0) #f) + (set! (-> v1-10 ignore-process1) #f) + (set! (-> v1-10 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-10 action-mask) (collide-action solid)) + ) + (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) + (set! (-> s3-0 move-dist quad) (-> s1-0 quad)) + (set! (-> this l-control state points-to-draw) 0) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (cond + ((>= f0-3 0.0) + (vector-float*! s1-0 (-> s3-0 move-dist) f0-3) + (vector+! s5-0 s4-0 s1-0) + (point-in-plane-<-point+normal! s2-1 s5-0 (-> s3-0 best-other-tri normal)) + (vector-! s2-1 s2-1 s5-0) + (let ((s1-1 quaternion-vector-angle!) + (s0-0 (new 'stack-no-clear 'quaternion)) + ) + (set! sv-832 (-> s3-0 best-other-tri normal)) + (let* ((a2-3 (rand-vu-float-range 0.0 65536.0)) + (a2-4 (s1-1 s0-0 sv-832 a2-3)) + ) + (vector-orient-by-quat! s2-1 s2-1 a2-4) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) + ) + ) + (set-point! (-> this l-control) 0 s4-0) + (set-point! (-> this l-control) 1 s5-0) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 19)) + (+! (-> this l-control state points-to-draw) 2) + (let* ((s1-6 (-> s3-0 best-other-tri collide-ptr)) + (v1-91 (if (type? s1-6 collide-shape-prim) + s1-6 + ) + ) + (s1-7 #t) + ) + (when v1-91 + (set! s1-7 #f) + (let ((s0-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s0-1 ent) (-> this entity)) + (set! (-> s0-1 charge) 1.0) + (set! (-> s0-1 options) (projectile-options)) + (logclear! (-> s0-1 options) (projectile-options po14 po15 po16)) + (set! (-> s0-1 notify-handle) (process->handle this)) + (set! (-> s0-1 owner-handle) (the-as handle #f)) + (set! (-> s0-1 target-handle) (the-as handle #f)) + (set! (-> s0-1 target-pos quad) (the-as uint128 0)) + (set! (-> s0-1 ignore-handle) (process->handle this)) + (set! (-> s0-1 attack-id) (-> this attack-id)) + (set! (-> s0-1 timeout) (seconds 4)) + (set! (-> s0-1 pos quad) (-> s4-0 quad)) + (vector-! (-> s0-1 vel) s5-0 s4-0) + (vector-normalize! (-> s0-1 vel) 131072.0) + (spawn-projectile guard-lazer-shot s0-1 this *default-dead-pool*) + ) + ) + ) + (spread-lightning-lazer (-> this l-control) s5-0 s2-1 (-> s3-0 best-other-tri normal)) + ) + (else + (cond + ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) + ) + ) + (set! (-> this l-control state points-to-draw) 9) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 20)) + (let ((v1-176 s4-0)) + (set! (-> this l-control state meet data 0 quad) (-> v1-176 quad)) + ) + (let ((a0-97 (-> this l-control)) + (v1-178 s5-0) + ) + (set! (-> a0-97 state meet data (+ (-> a0-97 state points-to-draw) -1) quad) (-> v1-178 quad)) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate attack (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self joint-enable) #t) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-5 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-8 self)) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logclear (-> v1-8 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self miss-amount) 0.0) + (set-time! (-> self state-time)) + (set! (-> self lazer-sound) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (if (nonzero? (-> self lazer-sound)) + (sound-stop (-> self lazer-sound)) + ) + (iterate-prims + (-> self root) + (lambda ((arg0 collide-shape-prim)) (logclear! (-> arg0 prim-core action) (collide-action deadly)) (none)) + ) + (let ((v1-5 (-> self l-control)) + (a0-2 0) + ) + (let ((a1-2 (!= a0-2 (-> v1-5 state mode)))) + (case a0-2 + ((3) + (if a1-2 + (set! (-> v1-5 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-5 state start-color) (-> v1-5 spec start-color)) + (set! (-> v1-5 state end-color) (-> v1-5 spec end-color)) + ) + ) + ) + (set! (-> v1-5 state mode) (the-as uint a0-2)) + ) + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 1)) + (or (< 32768.0 (-> self target-self-xz-dist)) (not (logtest? (-> self flags) (citizen-flag target-in-sight)))) + ) + (go-hostile self) + ) + (let ((v1-12 (handle->process (-> self focus handle)))) + (if (and v1-12 (or (focus-test? (the-as process-focusable v1-12) inactive) + (focus-test? (the-as process-focusable v1-12) disable) + ) + ) + (set! v1-12 (the-as process #f)) + ) + (cond + ((not v1-12) + (go-virtual active) + ) + ((and (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + (< (fabs (-> self target-y-angle)) 8192.0) + ) + (if (< (-> self target-self-xz-dist) 16384.0) + (go-virtual close-attack) + (go-virtual attack-tazer) + ) + ) + (else + (set! (-> self next-shot) (+ (current-time) (seconds 1))) + ) + ) + ) + ) + :code (behavior () + (local-vars (v1-37 symbol)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! crimson-guard-idle-to-stab-idle-ja :num! (seek! (ja-aframe 7.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + (until #f + (while (or (< 7281.778 (fabs (-> self target-y-angle))) (>= (-> self next-shot) (current-time))) + (when (not (orient-towards-code (the-as degrees #x45e38e39))) + (let ((v1-17 (ja-group))) + (if (not (and v1-17 (= v1-17 crimson-guard-stab-idle-loop-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! crimson-guard-stab-idle-loop-ja :num! (loop!)) + (until v1-37 + (suspend) + (ja :num! (loop!)) + (set! v1-37 + (or (< (current-time) (-> self next-shot)) + (< (-> self target-self-xz-dist) 16384.0) + (not (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + (>= (fabs (-> self target-y-angle)) 7281.778) + ) + ) + ) + ) + (when (< (-> self target-self-xz-dist) 16384.0) + (set! (-> self next-shot) 0) + 0 + ) + (suspend) + ) + ) + #f + ) + :post (behavior () + (citizen-method-213 self) + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate attack-tazer (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self joint-enable) #t) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-5 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-8 self)) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logclear (-> v1-8 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self miss-amount) 0.0) + (set-time! (-> self state-time)) + (set! (-> self lazer-sound) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (if (nonzero? (-> self lazer-sound)) + (sound-stop (-> self lazer-sound)) + ) + (iterate-prims + (-> self root) + (lambda ((arg0 collide-shape-prim)) (logclear! (-> arg0 prim-core action) (collide-action deadly)) (none)) + ) + (let ((v1-5 (-> self l-control)) + (a0-2 0) + ) + (let ((a1-2 (!= a0-2 (-> v1-5 state mode)))) + (case a0-2 + ((3) + (if a1-2 + (set! (-> v1-5 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-5 state start-color) (-> v1-5 spec start-color)) + (set! (-> v1-5 state end-color) (-> v1-5 spec end-color)) + ) + ) + ) + (set! (-> v1-5 state mode) (the-as uint a0-2)) + ) + (set! (-> self joint-enable) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 1)) + (or (< 32768.0 (-> self target-self-xz-dist)) (not (logtest? (-> self flags) (citizen-flag target-in-sight)))) + ) + (go-hostile self) + ) + (let ((v1-12 (handle->process (-> self focus handle)))) + (if (and v1-12 (or (focus-test? (the-as process-focusable v1-12) inactive) + (focus-test? (the-as process-focusable v1-12) disable) + ) + ) + (set! v1-12 (the-as process #f)) + ) + (if (not v1-12) + (go-virtual active) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! crimson-guard-stab-idle-to-attack-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (crimson-guard-method-262 self) + (set! (-> self next-shot) (+ (current-time) (seconds 0.1))) + (let ((v1-32 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 2))) + (logior! (-> v1-32 prim-core action) (collide-action deadly)) + ) + (let* ((v1-33 *game-info*) + (a0-8 (+ (-> v1-33 attack-id) 1)) + ) + (set! (-> v1-33 attack-id) a0-8) + (set! (-> self attack-id) a0-8) + ) + (set! (-> self lazer-sound) (sound-play "guard-zap")) + (let ((v1-35 (-> self l-control)) + (a0-11 1) + ) + (let ((a1-5 (!= a0-11 (-> v1-35 state mode)))) + (case a0-11 + ((3) + (if a1-5 + (set! (-> v1-35 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-35 state start-color) (-> v1-35 spec start-color)) + (set! (-> v1-35 state end-color) (-> v1-35 spec end-color)) + ) + ) + ) + (set! (-> v1-35 state mode) (the-as uint a0-11)) + ) + (let ((gp-1 (current-time)) + (s5-1 150) + (f30-0 1.0) + ) + (ja-no-eval :group! crimson-guard-stab-attack-ja :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? gp-1 s5-1) + (crimson-guard-method-263 self) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (let ((v1-58 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 2))) + (logclear! (-> v1-58 prim-core action) (collide-action deadly)) + ) + (let ((v1-59 (-> self l-control)) + (a0-17 3) + ) + (let ((a1-18 (!= a0-17 (-> v1-59 state mode)))) + (case a0-17 + ((3) + (if a1-18 + (set! (-> v1-59 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-59 state start-color) (-> v1-59 spec start-color)) + (set! (-> v1-59 state end-color) (-> v1-59 spec end-color)) + ) + ) + ) + (set! (-> v1-59 state mode) (the-as uint a0-17)) + ) + (ja-no-eval :group! crimson-guard-stab-attack-to-stab-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + :post (behavior () + (citizen-method-213 self) + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate tazer-hostile (crimson-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (crimson-guard-method-251 self) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (crimson-guard-method-252 self) + (if (or (< (-> self target-self-xz-dist) 32768.0) (>= 2 (the-as int (-> self focus aware)))) + (go-virtual attack) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-position)) 8192.0) + (crimson-guard-method-289 self (-> self last-quick-target-spot-angle)) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (crimson-guard-method-253 self) + (crimson-guard-method-254 self) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/common/kg-squad-control_REF.gc b/test/decompiler/reference/jak3/levels/city/common/kg-squad-control_REF.gc new file mode 100644 index 0000000000..84a5cc8bcb --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/kg-squad-control_REF.gc @@ -0,0 +1,397 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *default-kg-squad-member-settings*, type (inline-array kg-squad-member-settings) +(define *default-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 1 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 4 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +;; definition for symbol *alert-kg-squad-member-settings*, type (inline-array kg-squad-member-settings) +(define *alert-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 4 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +;; definition for symbol *war-kg-squad-member-settings*, type (inline-array kg-squad-member-settings) +(define *war-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 5 + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 4 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 5 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +;; definition for method 50 of type kg-squad-control +;; WARN: Return type mismatch pointer vs none. +(defmethod copy-squad-settings-to-idx ((this kg-squad-control) (arg0 (inline-array kg-squad-member-settings)) (arg1 int)) + (mem-copy! (the-as pointer (-> this squad-settings arg1)) (the-as pointer arg0) 64) + (none) + ) + +;; definition for method 12 of type kg-squad-control +;; WARN: Return type mismatch symbol vs none. +(defmethod init-alert ((this kg-squad-control)) + (copy-squad-settings-to-idx this *default-kg-squad-member-settings* 0) + (copy-squad-settings-to-idx this *war-kg-squad-member-settings* 1) + (copy-squad-settings-to-idx this *default-kg-squad-member-settings* 2) + (set! (-> this alert-level) 0) + (call-parent-method this) + (kg-squad-control-method-51 this) + (none) + ) + +;; definition for method 10 of type kg-squad-control +(defmethod squad-control-method-10 ((this kg-squad-control)) + (set! (-> this active-squad-member-list length) 0) + (set! (-> this guard-to-traffic-mapping 6) (traffic-type roboguard)) + (set! (-> this guard-to-traffic-mapping 7) (traffic-type roboguard)) + (set! (-> this guard-to-traffic-mapping 8) (traffic-type flying-turret)) + (set! (-> this guard-to-traffic-mapping 9) (traffic-type spydroid)) + (logior! (-> this used-guard-types) (kg-squad-used-guard-types kg6)) + (logior! (-> this used-guard-types) (kg-squad-used-guard-types kg7)) + (logior! (-> this used-guard-types) (kg-squad-used-guard-types kg8)) + (logior! (-> this used-guard-types) (kg-squad-used-guard-types kg9)) + (set! (-> this guard-to-squad-setting-mapping 6) (the-as uint 0)) + (set! (-> this guard-to-squad-setting-mapping 7) (the-as uint 1)) + (set! (-> this guard-to-squad-setting-mapping 8) (the-as uint 2)) + (set! (-> this guard-to-squad-setting-mapping 9) (the-as uint 3)) + (call-parent-method this) + (none) + ) + +;; definition for method 9 of type kg-squad-control +;; WARN: Return type mismatch handle-array vs none. +(defmethod initialize ((this kg-squad-control) (arg0 process)) + (set! (-> this active-squad-member-list) (new 'loading-level 'handle-array 126)) + (none) + ) + +;; definition for method 47 of type kg-squad-control +(defmethod add-squad-member ((this kg-squad-control) (arg0 process)) + (push-back (-> this active-squad-member-list) (process->handle arg0)) + ) + +;; definition for method 48 of type kg-squad-control +(defmethod pop-squad-member-from-list ((this kg-squad-control) (arg0 process)) + (let ((v1-2 (process->handle arg0))) + (dotimes (a1-4 (-> this active-squad-member-list length)) + (when (= (-> this active-squad-member-list data0 a1-4) v1-2) + (pop-front (-> this active-squad-member-list) a1-4) + (return 0) + ) + ) + ) + (the-as int #f) + ) + +;; definition for method 52 of type kg-squad-control +(defmethod kg-squad-control-method-52 ((this kg-squad-control) (arg0 process) (arg1 process)) + (let ((v1-2 (process->handle arg1)) + (v0-0 0) + ) + (dotimes (a2-4 (-> this active-squad-member-list length)) + (let ((a3-3 (the-as kg-squad-member (handle->process (-> this active-squad-member-list data0 a2-4))))) + (if (and a3-3 (!= a3-3 arg0) (= (-> a3-3 current-enemy) v1-2)) + (+! v0-0 1) + ) + ) + ) + v0-0 + ) + ) + +;; definition for method 51 of type kg-squad-control +(defmethod kg-squad-control-method-51 ((this kg-squad-control)) + (local-vars (a1-8 symbol)) + (dotimes (v1-0 3) + (dotimes (a1-0 10) + (when (logtest? (-> this used-guard-types) (ash 1 a1-0)) + (set! (-> this + traffic + object-type-info-array + 0 + target-counts + (+ v1-0 (* (-> this guard-to-traffic-mapping a1-0) 32)) + ) + 0 + ) + 0 + ) + ) + ) + (dotimes (v1-3 3) + (dotimes (a1-3 4) + (let ((a2-12 (the-as kg-squad-settings (+ (+ (* a1-3 16) 860 (* v1-3 64)) (the-as int this))))) + (+! (-> this + traffic + object-type-info-array + 0 + target-counts + (+ v1-3 (* (-> a2-12 roboguard-settings object-type) 32)) + ) + (max + (min (-> a2-12 roboguard-settings target-count) (-> a2-12 roboguard-settings max-target-count)) + (-> a2-12 roboguard-settings min-target-count) + ) + ) + ) + ) + ) + (dotimes (v1-6 3) + (let ((a1-6 (new 'static 'boxed-array :type int8 :length 0 :allocated-length 10)) + (a2-17 (new 'static 'boxed-array :type int8 :length 0 :allocated-length 10)) + ) + (dotimes (a3-10 10) + (set! (-> a1-6 a3-10) 0) + (set! (-> a2-17 a3-10) 0) + ) + (dotimes (a3-13 4) + (let ((t0-13 (the-as kg-squad-settings (+ (+ (* a3-13 16) 860 (* v1-6 64)) (the-as int this))))) + (set! (-> a2-17 (-> t0-13 roboguard-settings enemy-type)) + (max + (min (-> t0-13 roboguard-settings target-count) (-> t0-13 roboguard-settings max-target-count)) + (-> t0-13 roboguard-settings min-target-count) + ) + ) + ) + ) + (dotimes (a3-16 (-> this active-squad-member-list length)) + (let ((t0-19 (the-as kg-squad-member (handle->process (-> this active-squad-member-list data0 a3-16))))) + (when t0-19 + (if (= (-> t0-19 faction-mode) v1-6) + (+! (-> a1-6 (-> t0-19 kg-type)) 1) + ) + ) + ) + ) + (dotimes (a3-19 10) + (when (< (-> a1-6 a3-19) (-> a2-17 a3-19)) + (dotimes (t0-28 10) + (when (< (-> a2-17 t0-28) (-> a1-6 t0-28)) + (set! (-> this enemy-type-seek-from) (the-as uint t0-28)) + (set! (-> this enemy-type-seek-to) (the-as uint a3-19)) + (set! a1-8 #t) + (goto cfg-47) + ) + ) + ) + ) + ) + (set! a1-8 #f) + (label cfg-47) + (when (not a1-8) + (set! (-> this enemy-type-seek-from-list v1-6) (the-as uint 11)) + (set! (-> this enemy-type-seek-to-list v1-6) (the-as uint 11)) + ) + ) + #f + ) + +;; definition for method 13 of type kg-squad-control +(defmethod update ((this kg-squad-control)) + (cond + ((-> *setting-control* user-current kg-enemy-settings) + (set! (-> this city-mode) (squad-city-mode two)) + (copy-squad-settings-to-idx + this + (the-as (inline-array kg-squad-member-settings) (-> *setting-control* user-current kg-enemy-settings)) + 0 + ) + ) + (else + (set! (-> this city-mode) (squad-city-mode zero)) + (copy-squad-settings-to-idx this *default-kg-squad-member-settings* 0) + ) + ) + (kg-squad-control-method-51 this) + (kg-squad-control-method-53 this) + (when *cty-faction-manager* + (let ((a2-2 (cond + ((-> *setting-control* user-current kg-enemy-settings) + 7 + ) + ((> (-> this alert-level) 0) + 7 + ) + (else + 3 + ) + ) + ) + ) + (faction-spawn *cty-faction-manager* 0 a2-2 #f (if (-> *setting-control* user-current kg-enemy-settings) + #t + ) + ) + ) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 45 of type kg-squad-control +(defmethod increment-alert-level ((this kg-squad-control) (arg0 int)) + (let ((v0-0 (+ (-> this alert-level) arg0))) + (set! (-> this alert-level) v0-0) + v0-0 + ) + ) + +;; definition for method 46 of type kg-squad-control +(defmethod set-alert-level1 ((this kg-squad-control) (arg0 int)) + (set! (-> this alert-level) arg0) + arg0 + ) + +;; definition for method 53 of type kg-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod kg-squad-control-method-53 ((this kg-squad-control)) + (cond + ((> (-> this alert-level) 0) + (if (not (-> *setting-control* user-current kg-enemy-settings)) + (copy-squad-settings-to-idx this *alert-kg-squad-member-settings* 0) + ) + ) + (else + (copy-squad-settings-to-idx this *default-kg-squad-member-settings* 0) + ) + ) + 0 + (none) + ) + +;; definition for method 49 of type kg-squad-control +(defmethod get-alert-level1 ((this kg-squad-control)) + (-> this alert-level) + ) + +;; definition for method 38 of type kg-squad-control +(defmethod squad-control-city-method-38 ((this kg-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (kg-squad-member-method-219 (the-as kg-squad-member arg0) arg1) + ) + +;; definition for method 40 of type kg-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod squad-control-city-method-40 ((this kg-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (if (not (logtest? (process-mask kg-robot) (-> arg1 mask))) + (set! (-> this current-target-attackers) (kg-squad-control-method-52 this arg0 arg1)) + ) + (none) + ) + +;; definition for method 41 of type kg-squad-control +(defmethod squad-control-city-method-41 ((this kg-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (not (logtest? (process-mask kg-robot) (-> arg1 mask))) + ) + +;; definition for method 42 of type kg-squad-control +(defmethod squad-control-city-method-42 ((this kg-squad-control)) + (if (< 4 (-> this current-target-attackers)) + 100000.0 + (+ 1.0 (the float (-> this current-target-attackers))) + ) + ) + +;; definition for method 43 of type kg-squad-control +(defmethod squad-control-city-method-43 ((this kg-squad-control) (arg0 process-focusable)) + (let ((v1-0 arg0)) + (time-elapsed? + (-> (the-as kg-squad-member v1-0) last-choose-new-enemy-time) + (-> (the-as kg-squad-member v1-0) choose-new-enemy-delay-time) + ) + ) + ) + +;; definition for method 39 of type kg-squad-control +(defmethod squad-control-city-method-39 ((this kg-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (kg-squad-member-method-216 (the-as kg-squad-member arg0) arg1) + ) + +;; definition for function set-kg-primary-target +;; WARN: Return type mismatch int vs none. +(defun set-kg-primary-target ((arg0 handle) (arg1 float)) + (when *kg-squad-control* + (let* ((s5-0 *kg-squad-control*) + (s4-0 (method-of-object s5-0 squad-control-method-27)) + (s3-0 (handle->process arg0)) + ) + (s4-0 + s5-0 + (if (type? s3-0 process-focusable) + s3-0 + ) + arg1 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 54 of type kg-squad-control +(defmethod kg-squad-control-method-54 ((this kg-squad-control)) + (-> *setting-control* user-current kg-difficulty) + ) diff --git a/test/decompiler/reference/jak3/levels/city/common/kg-squad-member-h_REF.gc b/test/decompiler/reference/jak3/levels/city/common/kg-squad-member-h_REF.gc new file mode 100644 index 0000000000..417b185c37 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/kg-squad-member-h_REF.gc @@ -0,0 +1,67 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type hatred-instance-info +(deftype hatred-instance-info (structure) + ((hated-target handle) + (hatred-value float) + ) + :pack-me + ) + +;; definition for method 3 of type hatred-instance-info +(defmethod inspect ((this hatred-instance-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hatred-instance-info) + (format #t "~1Thated-target: ~D~%" (-> this hated-target)) + (format #t "~1Thatred-value: ~f~%" (-> this hatred-value)) + (label cfg-4) + this + ) + +;; definition of type kg-squad-member +(deftype kg-squad-member (citizen) + ((squad kg-squad-control :override) + (hatred-memory hatred-instance-info 3 :inline) + (last-choose-new-enemy-time time-frame) + (current-enemy handle) + (kg-type uint8) + (choose-new-enemy-delay-time time-frame) + (next-update-target-time time-frame) + (minimap connection-minimap) + ) + (:methods + (kg-squad-member-method-216 (_type_ process) float) + (enemy->hatred-val (_type_ process) float) + (get-hatred-val-for-target (_type_ handle) float) + (kg-squad-member-method-219 (_type_ process-focusable) symbol) + (kg-squad-member-method-220 (_type_) symbol) + (get-current-enemy (_type_) process) + ) + ) + +;; definition for method 3 of type kg-squad-member +(defmethod inspect ((this kg-squad-member)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type citizen inspect))) + (t9-0 this) + ) + (format #t "~2Thatred-memory[3] @ #x~X~%" (-> this hatred-memory)) + (format #t "~2Tlast-choose-new-enemy-time: ~D~%" (-> this last-choose-new-enemy-time)) + (format #t "~2Tcurrent-enemy: ~D~%" (-> this current-enemy)) + (format #t "~2Tkg-type: ~D~%" (-> this kg-type)) + (format #t "~2Tchoose-new-enemy-delay-time: ~D~%" (-> this choose-new-enemy-delay-time)) + (format #t "~2Tnext-update-target-time: ~D~%" (-> this next-update-target-time)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/levels/city/common/kg-squad-member_REF.gc b/test/decompiler/reference/jak3/levels/city/common/kg-squad-member_REF.gc new file mode 100644 index 0000000000..d7075c822c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/kg-squad-member_REF.gc @@ -0,0 +1,263 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 193 of type kg-squad-member +;; WARN: Return type mismatch symbol vs none. +(defmethod set-squad ((this kg-squad-member)) + (set! (-> this squad) *kg-squad-control*) + (set! (-> this minimap) #f) + (none) + ) + +;; definition for method 194 of type kg-squad-member +(defmethod citizen-method-194 ((this kg-squad-member)) + (dotimes (v1-0 3) + (set! (-> this hatred-memory v1-0 hated-target) (the-as handle #f)) + (set! (-> this hatred-memory v1-0 hatred-value) 0.0) + ) + (set! (-> this last-choose-new-enemy-time) 0) + (set! (-> this choose-new-enemy-delay-time) (seconds 3)) + (set! (-> this current-enemy) (the-as handle #f)) + (logior! (-> this mask) (process-mask kg-robot)) + (set! (-> this next-update-target-time) 0) + (set! (-> this faction-mode) (the-as uint 0)) + (set! (-> this fact fade-time) (seconds 10)) + (logior! (-> this fact options) (actor-option fade-out no-distance-check-fadeout)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 139) (the-as int #f) (the-as vector #t) 0)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 221 of type kg-squad-member +;; WARN: disable def twice: 6. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod get-current-enemy ((this kg-squad-member)) + (if #t + (handle->process (-> this attacker-info enemy)) + (squad-control-city-method-35 (-> this squad) this (-> this current-enemy)) + ) + ) + +;; definition for method 212 of type kg-squad-member +(defmethod go-from-behavior ((this kg-squad-member) (arg0 traffic-object-spawn-params)) + (add-squad-member (-> this squad) this) + (call-parent-method this arg0) + (none) + ) + +;; definition for method 196 of type kg-squad-member +(defmethod go-inactive ((this kg-squad-member)) + (pop-squad-member-from-list (-> this squad) this) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate inactive (kg-squad-member) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((t9-0 (-> (method-of-type citizen inactive) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +;; definition for method 10 of type kg-squad-member +(defmethod deactivate ((this kg-squad-member)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (pop-squad-member-from-list (-> this squad) this) + (call-parent-method this) + (none) + ) + +;; definition for method 217 of type kg-squad-member +(defmethod enemy->hatred-val ((this kg-squad-member) (arg0 process)) + (cond + ((logtest? (process-mask guard) (-> arg0 mask)) + 0.5 + ) + ((logtest? (process-mask metalhead) (-> arg0 mask)) + -0.01 + ) + ((= (-> arg0 type) target) + 0.3 + ) + ((logtest? (process-mask civilian) (-> arg0 mask)) + 0.02 + ) + ((logtest? (process-mask kg-robot) (-> arg0 mask)) + -1.0 + ) + ((and (logtest? (process-mask vehicle) (-> arg0 mask)) (not (logtest? (process-mask enemy) (-> arg0 mask)))) + 0.01 + ) + (else + -1.0 + ) + ) + ) + +;; definition for method 218 of type kg-squad-member +(defmethod get-hatred-val-for-target ((this kg-squad-member) (arg0 handle)) + (dotimes (v1-0 3) + (if (= arg0 (-> this hatred-memory v1-0 hated-target)) + (return (-> this hatred-memory v1-0 hatred-value)) + ) + ) + 0.0 + ) + +;; definition for method 216 of type kg-squad-member +(defmethod kg-squad-member-method-216 ((this kg-squad-member) (arg0 process)) + (let ((f30-0 (enemy->hatred-val this arg0)) + (f0-0 (get-hatred-val-for-target this (process->handle arg0))) + ) + 0.0 + (+ f0-0 f30-0) + ) + ) + +;; definition for method 219 of type kg-squad-member +(defmethod kg-squad-member-method-219 ((this kg-squad-member) (arg0 process-focusable)) + (let* ((s4-0 (get-trans arg0 0)) + (f0-0 (vector-vector-xz-distance-squared (-> this root trans) s4-0)) + (f1-0 409600.0) + ) + (or (and (< f0-0 (* f1-0 f1-0)) (< (fabs (- (-> s4-0 y) (-> this root trans y))) 61440.0)) + (< 0.0 (get-hatred-val-for-target this (process->handle arg0))) + ) + ) + ) + +;; definition for method 59 of type kg-squad-member +(defmethod enemy-common-post ((this kg-squad-member)) + (local-vars (s5-0 int)) + (when (focus-test? this dangerous) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + ) + (cond + ((logtest? (-> this flags) (citizen-flag in-mission)) + (set! (-> this faction-mode) (the-as uint 2)) + ) + ((nonzero? (-> this controller branch)) + (let ((v1-15 (get-city-mode (-> this squad)))) + 0 + (cond + ((= v1-15 (squad-city-mode two)) + (set! s5-0 2) + ) + (else + (let ((v1-17 *cty-faction-manager*) + (a1-2 (-> this controller branch clock-type)) + ) + (set! s5-0 (-> v1-17 territory-faction-modes 0 data (+ 1 (* a1-2 16)))) + ) + ) + ) + ) + (when (!= (-> this faction-mode) s5-0) + (if (not (send-event this 'change-faction-mode s5-0 (-> this faction-mode))) + (set! (-> this faction-mode) (the-as uint s5-0)) + ) + ) + ) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 84 of type kg-squad-member +(defmethod send-attack-on-jump-or-knocked ((this kg-squad-member) (arg0 process) (arg1 event-message-block)) + (cond + (#f + ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-2 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask enemy guard civilian metalhead) (-> arg0 mask)) + (not (logtest? (process-mask kg-robot) (-> arg0 mask))) + (and v1-2 + (not (logtest? (-> (the-as process-focusable v1-2) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 220 of type kg-squad-member +(defmethod kg-squad-member-method-220 ((this kg-squad-member)) + (if (or (not (-> this draw)) (not (logtest? (-> this draw status) (draw-control-status on-screen)))) + (return #f) + ) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (math-camera-pos))) + (f1-0 122880.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (return #t) + ) + ) + #f + ) + +;; failed to figure out what this is: +(defstate in-ditch (kg-squad-member) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + +;; failed to figure out what this is: +(defstate die-fast (kg-squad-member) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/city/common/krimson-wall_REF.gc b/test/decompiler/reference/jak3/levels/city/common/krimson-wall_REF.gc new file mode 100644 index 0000000000..0ac6167287 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/krimson-wall_REF.gc @@ -0,0 +1,492 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-krimson-wall + :id 329 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 1419 :flags (is-3d sp7) :period (seconds 2) :length (seconds 0.035)) + (sp-item 1420 :fade-after (meters 40) :flags (is-3d sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1419 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 11)) + (:scale-x (meters 18)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-z (degrees 90)) + (:scale-y (meters 54)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 + 20 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1420 + :init-specs ((:texture (static1 level-default-sprite)) + (:num 1.0) + (:y (meters 11)) + (:scale-x (meters 18)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-z (degrees 90) 1 (degrees 180)) + (:scale-y (meters 180)) + (:r 255.0) + (:g 10.0) + (:b 10.0) + (:a 4.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-krimson-wall-break krimson-wall-break krimson-wall-break-lod0-jg krimson-wall-break-idle-ja + ((krimson-wall-break-lod0-mg (meters 999999))) + :bounds (static-spherem -40 0 0 400) + :origin-joint-index 3 + ) + +;; definition of type krimson-wall-break +(deftype krimson-wall-break (process-drawable) + ((art-name string) + (anim spool-anim) + (pillar (pointer manipy) 2) + (level-name symbol) + ) + (:state-methods + idle + explode + done + ) + ) + +;; definition for method 3 of type krimson-wall-break +(defmethod inspect ((this krimson-wall-break)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tpillar[2] @ #x~X~%" (-> this pillar)) + (format #t "~2Tlevel-name: ~A~%" (-> this level-name)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (krimson-wall-break) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('break) + (go-virtual explode) + ) + ) + ) + :enter (behavior () + '() + ) + :trans (behavior () + (let* ((v1-0 (new 'stack-no-clear 'matrix)) + (a3-0 (-> self node-list data 2 bone transform)) + (a0-2 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-0 rvec quad) a0-2) + (set! (-> v1-0 uvec quad) a1-0) + (set! (-> v1-0 fvec quad) a2-0) + (set! (-> v1-0 trans quad) a3-1) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate explode (krimson-wall-break) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (not (time-elapsed? (-> self state-time) (seconds 0.5))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (+! (-> gp-0 z) (* 4096.0 (rand-vu-float-range -60.0 60.0))) + (+! (-> gp-0 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> gp-0 y) (* 4096.0 (rand-vu-float-range 0.0 25.0))) + (let ((v1-9 (rand-vu-int-count 2))) + (cond + ((zero? v1-9) + (cond + ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) + ) + ) + ) + ((= v1-9 1) + (cond + ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 218)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 218)) + ) + ) + ) + ) + ) + ) + ) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate done (krimson-wall-break) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('done) + #t + ) + ) + ) + :code sleep-code + ) + +;; definition for method 11 of type krimson-wall-break +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this krimson-wall-break) (arg0 entity-actor)) + (local-vars (sv-96 entity)) + (set! (-> this level) (level-get *level* (-> this level-name))) + (stack-size-set! (-> this main-thread) 512) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-krimson-wall-break" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this anim) + (new 'static 'spool-anim :name "krimson-wall-break-1" :anim-name "break" :parts 2 :command-list '()) + ) + (set! (-> this art-name) (res-lump-struct arg0 'art-name string)) + (let ((s4-1 (-> this root trans)) + (s5-1 (-> this root trans)) + ) + (let ((s2-0 (entity-actor-lookup arg0 'alt-actor 0)) + (v0-8 (entity-actor-lookup arg0 'alt-actor 1)) + ) + (if s2-0 + (set! s4-1 (-> s2-0 extra trans)) + ) + (if v0-8 + (set! s5-1 (-> v0-8 extra trans)) + ) + ) + (let ((s3-1 (get-process *default-dead-pool* manipy #x20000 1))) + (set! (-> this pillar 0) + (the-as + (pointer manipy) + (when s3-1 + (let ((t9-10 (method-of-type manipy activate))) + (t9-10 (the-as manipy s3-1) this "krimson-wall-break" (the-as pointer #x70004000)) + ) + (let ((s2-1 run-function-in-process) + (s1-0 s3-1) + (s0-0 manipy-init) + ) + (set! sv-96 (-> this level entity data 0 entity)) + (let ((t0-1 (art-group-get-by-name *level* "skel-krimson-wall-break" (the-as (pointer level) #f))) + (t1-1 #f) + (t2-1 0) + ) + ((the-as (function object object object object object object object none) s2-1) + s1-0 + s0-0 + s4-1 + sv-96 + t0-1 + t1-1 + t2-1 + ) + ) + ) + (-> s3-1 ppointer) + ) + ) + ) + ) + (send-event (ppointer->process (-> this pillar 0)) 'anim-mode 'clone-anim) + (send-event (ppointer->process (-> this pillar 0)) 'prefix "a-") + (set! (-> this pillar 1) + (process-spawn + manipy + :init manipy-init + s5-1 + (-> this level entity data 0 entity) + (art-group-get-by-name *level* "skel-krimson-wall-break" (the-as (pointer level) #f)) + #f + 0 + :name "krimson-wall-break" + :to this + :stack-size #x20000 + ) + ) + ) + (send-event (ppointer->process (-> this pillar 1)) 'anim-mode 'clone-anim) + (send-event (ppointer->process (-> this pillar 1)) 'prefix "b-") + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) (-> this anim name) -99.0 0) + (go (method-of-object this idle)) + ) + +;; definition for function krimson-wall-break-init-by-other +(defbehavior krimson-wall-break-init-by-other krimson-wall-break ((arg0 entity-actor) (arg1 symbol)) + (set! (-> self level-name) arg1) + (init-from-entity! self arg0) + ) + +;; failed to figure out what this is: +(defskelgroup skel-krimson-wall krimson-wall krimson-wall-lod0-jg krimson-wall-idle-ja + ((krimson-wall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 13 0 16) + ) + +;; definition of type krimson-wall +(deftype krimson-wall (process-focusable) + ((alt-actor entity-actor 2) + (collision-part int32) + (width float) + ) + (:state-methods + idle + die + ) + (:methods + (krimson-wall-method-30 (_type_ symbol) none) + ) + ) + +;; definition for method 3 of type krimson-wall +(defmethod inspect ((this krimson-wall)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Talt-actor[2] @ #x~X~%" (-> this alt-actor)) + (format #t "~2Tcollision-part: ~D~%" (-> this collision-part)) + (format #t "~2Twidth: ~f~%" (-> this width)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (krimson-wall) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('break) + (when (and (-> self alt-actor 0) (-> self alt-actor 1)) + (send-event (-> self alt-actor 0 extra process) 'kill) + (send-event (-> self alt-actor 1 extra process) 'kill) + (go-virtual die) + ) + ) + (('kill) + (go-virtual die) + ) + ) + ) + :trans (behavior () + (when (nonzero? (-> self collision-part)) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate die (krimson-wall) + :virtual #t + :code (behavior () + (suspend) + (cleanup-for-death self) + ) + ) + +;; definition for method 30 of type krimson-wall +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod krimson-wall-method-30 ((this krimson-wall) (arg0 symbol)) + (cond + (arg0 + (let ((gp-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (let ((f30-0 (-> this width))) + (let ((t9-0 vector-matrix*!) + (a0-1 (-> gp-0 0)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 0.0) + (set! (-> a1-1 y) 0.0) + (set! (-> a1-1 z) f30-0) + (set! (-> a1-1 w) 1.0) + (t9-0 a0-1 a1-1 (-> this node-list data 2 bone transform)) + ) + (let ((t9-1 vector-matrix*!) + (a0-2 (-> gp-0 1)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) 0.0) + (set! (-> a1-2 y) 0.0) + (set! (-> a1-2 z) (- f30-0)) + (set! (-> a1-2 w) 1.0) + (t9-1 a0-2 a1-2 (-> this node-list data 2 bone transform)) + ) + ) + (if (nonzero? (-> this alt-actor 0)) + (set! (-> gp-0 0 quad) (-> this alt-actor 0 extra trans quad)) + ) + (if (nonzero? (-> this alt-actor 1)) + (set! (-> gp-0 1 quad) (-> this alt-actor 1 extra trans quad)) + ) + (spawn-security-wall this (-> gp-0 0) (-> gp-0 1) 77824.0 #f) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 1) (-> gp-0 0)))) + (vector-normalize! s4-1 40960.0) + (vector+float*! (-> gp-0 0) (-> gp-0 0) s4-1 -1.0) + (vector+float*! (-> gp-0 1) (-> gp-0 1) s4-1 1.0) + ) + (+! (-> gp-0 0 y) 61440.0) + (+! (-> gp-0 1 y) 61440.0) + (spawn-security-wall this (-> gp-0 0) (-> gp-0 1) 102400.0 #t) + ) + ) + (else + (let ((gp-1 (-> this child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'off) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type krimson-wall +(defmethod init-from-entity! ((this krimson-wall) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable no-standon)) + (set-vector! (-> s3-0 local-sphere) 0.0 53248.0 0.0 65536.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 53248.0 0.0 65536.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-11 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this entity) arg0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-krimson-wall" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (transform-post) + (set! (-> this collision-part) (res-lump-value arg0 'extra-id int :time -1000000000.0)) + (set! (-> this width) (res-lump-float arg0 'dist :default 81920.0)) + (set! (-> this alt-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this alt-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) + (format #t "collision part ~D~%" (-> this collision-part)) + (if (nonzero? (-> this collision-part)) + (krimson-wall-method-30 this #t) + ) + (go (method-of-object this idle)) + ) diff --git a/test/decompiler/reference/jak3/levels/city/common/mh-squad-control_REF.gc b/test/decompiler/reference/jak3/levels/city/common/mh-squad-control_REF.gc new file mode 100644 index 0000000000..7baba694de --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/mh-squad-control_REF.gc @@ -0,0 +1,194 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *default-mh-squad-member-settings*, type (inline-array kg-squad-member-settings) +(define *default-mh-squad-member-settings* + (new 'static 'inline-array kg-squad-member-settings 3 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-grunt) + :max-target-count #x7f + :target-count 4 + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-flitter) + :max-target-count #x7f + :target-count 3 + ) + (new 'static 'kg-squad-member-settings :object-type (traffic-type metalhead-predator) :max-target-count #x7f) + ) + ) + +;; definition for symbol *war-mh-squad-member-settings*, type (inline-array kg-squad-member-settings) +(define *war-mh-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 3 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-grunt) + :max-target-count #x7f + :target-count 5 + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-flitter) + :max-target-count #x7f + :target-count 5 + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type metalhead-predator) + :max-target-count #x7f + :target-count 2 + ) + ) + ) + +;; definition for method 47 of type mh-squad-control +;; WARN: Return type mismatch pointer vs none. +(defmethod copy-squad-settings-to-idx ((this mh-squad-control) (arg0 (inline-array mh-squad-member-settings)) (arg1 int)) + (mem-copy! (the-as pointer (-> this squad-settings (the-as uint arg1))) (the-as pointer arg0) 48) + (none) + ) + +;; definition for method 12 of type mh-squad-control +;; WARN: Return type mismatch symbol vs none. +(defmethod init-alert ((this mh-squad-control)) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) *default-mh-squad-member-settings*) + 0 + ) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) *war-mh-squad-member-settings*) + 1 + ) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) *default-mh-squad-member-settings*) + 2 + ) + (set! (-> this alert-level) 0) + (call-parent-method this) + (mh-squad-control-method-48 this) + (none) + ) + +;; definition for method 10 of type mh-squad-control +(defmethod squad-control-method-10 ((this mh-squad-control)) + (set! (-> this active-squad-member-list length) 0) + (dotimes (v1-1 29) + (set! (-> this map-traffic-object-type-to-squad v1-1) (traffic-type invalid0)) + ) + (set! (-> this map-traffic-object-type-to-squad 8) (traffic-type civilian-male)) + (set! (-> this map-traffic-object-type-to-squad 9) (traffic-type civilian-female)) + (set! (-> this map-traffic-object-type-to-squad 10) (traffic-type civilian-fat)) + (call-parent-method this) + (none) + ) + +;; definition for method 9 of type mh-squad-control +;; WARN: Return type mismatch handle-array vs none. +(defmethod initialize ((this mh-squad-control) (arg0 process)) + (set! (-> this active-squad-member-list) (new 'loading-level 'handle-array 126)) + (none) + ) + +;; definition for method 45 of type mh-squad-control +(defmethod add-squad-member ((this mh-squad-control) (arg0 process)) + (push-back (-> this active-squad-member-list) (process->handle arg0)) + ) + +;; definition for method 46 of type mh-squad-control +(defmethod pop-squad-member-from-list ((this mh-squad-control) (arg0 process)) + (let ((v1-2 (process->handle arg0))) + (dotimes (a1-4 (-> this active-squad-member-list length)) + (when (= (-> this active-squad-member-list data0 a1-4) v1-2) + (pop-front (-> this active-squad-member-list) a1-4) + (return 0) + ) + ) + ) + (the-as int #f) + ) + +;; definition for method 48 of type mh-squad-control +(defmethod mh-squad-control-method-48 ((this mh-squad-control)) + (dotimes (v1-0 3) + (dotimes (a1-0 3) + (let ((a3-2 (the-as mh-squad-settings (+ (+ (* a1-0 16) 828 (* 48 v1-0)) (the-as int this))))) + (set! (-> this traffic object-type-info-array 0 target-counts (+ v1-0 (* (-> a3-2 grunt-settings object-type) 32))) + (max + (min (-> a3-2 grunt-settings target-count) (-> a3-2 grunt-settings max-target-count)) + (-> a3-2 grunt-settings min-target-count) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 13 of type mh-squad-control +(defmethod update ((this mh-squad-control)) + (cond + ((-> *setting-control* user-current mh-enemy-settings) + (set! (-> this city-mode) (squad-city-mode two)) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) (-> *setting-control* user-current mh-enemy-settings)) + 0 + ) + ) + (else + (set! (-> this city-mode) (squad-city-mode zero)) + (copy-squad-settings-to-idx + this + (the-as (inline-array mh-squad-member-settings) *default-mh-squad-member-settings*) + 0 + ) + ) + ) + (when *cty-faction-manager* + (let ((a2-2 (if (-> *setting-control* user-current mh-enemy-settings) + 7 + 3 + ) + ) + ) + (faction-spawn *cty-faction-manager* 1 a2-2 #f (if (-> *setting-control* user-current mh-enemy-settings) + #t + ) + ) + ) + ) + (mh-squad-control-method-48 this) + (call-parent-method this) + (none) + ) + +;; definition for method 41 of type mh-squad-control +(defmethod squad-control-city-method-41 ((this mh-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (not (logtest? (process-mask metalhead) (-> arg1 mask))) + ) + +;; definition for method 39 of type mh-squad-control +(defmethod squad-control-city-method-39 ((this mh-squad-control) (arg0 process-focusable) (arg1 process-focusable)) + (get-hatred-val-for-proc (the-as mh-squad-member arg0) arg1) + ) + +;; definition for function set-mh-primary-target +;; WARN: Return type mismatch int vs none. +(defun set-mh-primary-target ((arg0 handle) (arg1 float)) + (when *mh-squad-control* + (let* ((s5-0 *mh-squad-control*) + (s4-0 (method-of-object s5-0 squad-control-method-27)) + (s3-0 (handle->process arg0)) + ) + (s4-0 + s5-0 + (if (type? s3-0 process-focusable) + s3-0 + ) + arg1 + ) + ) + ) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/city/common/mh-squad-member-h_REF.gc b/test/decompiler/reference/jak3/levels/city/common/mh-squad-member-h_REF.gc new file mode 100644 index 0000000000..6ccdd061fa --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/mh-squad-member-h_REF.gc @@ -0,0 +1,38 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mh-squad-member +(deftype mh-squad-member (citizen-enemy) + ((squad mh-squad-control :override) + (last-choose-new-enemy-time time-frame) + (current-enemy handle) + (choose-new-enemy-delay-time time-frame) + (next-update-target-time time-frame) + ) + (:methods + (get-hatred-val-for-proc (_type_ process) float) + (pfoc-in-range? (_type_ process-focusable) symbol) + (enemy->hatred-val (_type_ process) float) + (get-current-enemy (_type_) process) + ) + ) + +;; definition for method 3 of type mh-squad-member +(defmethod inspect ((this mh-squad-member)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type citizen-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tlast-choose-new-enemy-time: ~D~%" (-> this last-choose-new-enemy-time)) + (format #t "~2Tcurrent-enemy: ~D~%" (-> this current-enemy)) + (format #t "~2Tchoose-new-enemy-delay-time: ~D~%" (-> this choose-new-enemy-delay-time)) + (format #t "~2Tnext-update-target-time: ~D~%" (-> this next-update-target-time)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc b/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc new file mode 100644 index 0000000000..bf8e13d215 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc @@ -0,0 +1,296 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 193 of type mh-squad-member +;; WARN: Return type mismatch mh-squad-control vs none. +(defmethod set-squad ((this mh-squad-member)) + (set! (-> this squad) *mh-squad-control*) + (none) + ) + +;; definition for method 194 of type mh-squad-member +(defmethod citizen-method-194 ((this mh-squad-member)) + (set! (-> this last-choose-new-enemy-time) 0) + (set! (-> this choose-new-enemy-delay-time) (seconds 3)) + (set! (-> this current-enemy) (the-as handle #f)) + (set! (-> this mask) (the-as process-mask (logior (process-mask metalhead) (-> this mask)))) + (set! (-> this faction-mode) (the-as uint 0)) + (set! (-> this next-update-target-time) 0) + (set! (-> this fact pickup-type) (pickup-type eco-pill-dark)) + (if (zero? (mod (the-as int (rand-uint31-gen *random-generator*)) 11)) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + ) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this fact fade-time) (seconds 10)) + (call-parent-method this) + (none) + ) + +;; definition for method 212 of type mh-squad-member +(defmethod go-from-behavior ((this mh-squad-member) (arg0 traffic-object-spawn-params)) + (add-squad-member (-> this squad) this) + (call-parent-method this arg0) + (none) + ) + +;; definition for method 196 of type mh-squad-member +(defmethod go-inactive ((this mh-squad-member)) + (pop-squad-member-from-list (-> this squad) this) + (call-parent-method this) + (none) + ) + +;; definition for method 10 of type mh-squad-member +(defmethod deactivate ((this mh-squad-member)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (pop-squad-member-from-list (-> this squad) this) + (call-parent-method this) + (none) + ) + +;; definition for method 220 of type mh-squad-member +(defmethod enemy->hatred-val ((this mh-squad-member) (arg0 process)) + (cond + ((logtest? (process-mask metalhead) (-> arg0 mask)) + -1.0 + ) + ((logtest? (process-mask guard) (-> arg0 mask)) + 0.5 + ) + ((= (-> arg0 type) target) + 0.49 + ) + ((logtest? (process-mask civilian) (-> arg0 mask)) + 0.2 + ) + ((logtest? (process-mask kg-robot) (-> arg0 mask)) + -0.01 + ) + ((and (logtest? (process-mask vehicle) (-> arg0 mask)) (not (logtest? (process-mask enemy) (-> arg0 mask)))) + 0.01 + ) + (else + -1.0 + ) + ) + ) + +;; definition for method 218 of type mh-squad-member +(defmethod get-hatred-val-for-proc ((this mh-squad-member) (arg0 process)) + (let ((f1-0 (enemy->hatred-val this arg0))) + 0.0 + f1-0 + ) + ) + +;; definition for method 219 of type mh-squad-member +(defmethod pfoc-in-range? ((this mh-squad-member) (arg0 process-focusable)) + (let* ((s5-0 (get-trans arg0 0)) + (f0-0 (vector-vector-xz-distance-squared (-> this root trans) s5-0)) + (f1-0 245760.0) + ) + (and (< f0-0 (* f1-0 f1-0)) (< (fabs (- (-> s5-0 y) (-> this root trans y))) 61440.0)) + ) + ) + +;; definition for method 59 of type mh-squad-member +(defmethod enemy-common-post ((this mh-squad-member)) + (local-vars (s5-0 int)) + (when (focus-test? this dangerous) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + ) + (cond + ((logtest? (-> this flags) (citizen-flag in-mission)) + (set! (-> this faction-mode) (the-as uint 2)) + ) + ((nonzero? (-> this controller branch)) + (let ((v1-15 (get-city-mode (-> this squad)))) + 0 + (cond + ((= v1-15 (squad-city-mode two)) + (set! s5-0 2) + ) + (else + (let ((v1-17 *cty-faction-manager*) + (a1-2 (-> this controller branch clock-type)) + ) + (set! s5-0 (-> v1-17 territory-faction-modes 0 data (+ 1 (* a1-2 16)))) + ) + ) + ) + ) + (when (!= (-> this faction-mode) s5-0) + (if (not (send-event this 'change-faction-mode s5-0 (-> this faction-mode))) + (set! (-> this faction-mode) (the-as uint s5-0)) + ) + ) + ) + ) + (find-new-focus this) + ((method-of-type citizen enemy-common-post) this) + (none) + ) + +;; definition for method 84 of type mh-squad-member +(defmethod send-attack-on-jump-or-knocked ((this mh-squad-member) (arg0 process) (arg1 event-message-block)) + (cond + (#f + ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-2 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask enemy guard civilian kg-robot) (-> arg0 mask)) + (not (logtest? (process-mask metalhead) (-> arg0 mask))) + (and v1-2 + (not (logtest? (-> (the-as process-focusable v1-2) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 221 of type mh-squad-member +;; WARN: disable def twice: 6. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod get-current-enemy ((this mh-squad-member)) + (if #t + (handle->process (-> this attacker-info enemy)) + (squad-control-city-method-35 (-> this squad) this (-> this current-enemy)) + ) + ) + +;; definition for method 217 of type mh-squad-member +;; WARN: disable def twice: 120. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod find-new-focus ((this mh-squad-member)) + (local-vars (v0-6 object)) + (when (not (handle->process (-> this current-enemy))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + (let ((a0-6 (get-current-enemy this))) + (if a0-6 + (set! (-> this current-enemy) (process->handle a0-6)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 3))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (let* ((s5-0 (handle->process (-> this current-enemy))) + (a0-18 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and a0-18 + (not (logtest? (-> (the-as process-focusable a0-18) focus-status) (focus-status disable dead inactive))) + ) + (let* ((s5-1 this) + (s4-0 (method-of-object s5-1 enemy-method-70)) + (s3-0 (handle->process (-> this current-enemy))) + ) + (s4-0 + s5-1 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus this) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (f1-0 266240.0) + ) + (cond + ((< f0-0 (* f1-0 f1-0)) + (when (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (set! v0-6 (logior (-> this flags) (citizen-flag persistent))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + (else + (set! v0-6 (logclear (-> this flags) (citizen-flag persistent))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + ) + ) + (else + (set! (-> this focus handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent)) + (if (and (-> this next-state) (= (-> this next-state name) 'hostile)) + (go (method-of-object this active)) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (mh-squad-member) + :virtual #t + :trans (behavior () + (when (handle->process (-> self current-enemy)) + (let* ((gp-0 (handle->process (-> self current-enemy))) + (v1-7 (if (type? gp-0 process-focusable) + (the-as process-focusable gp-0) + ) + ) + ) + (if (not (or (focus-test? v1-7 inactive) (focus-test? v1-7 disable))) + (go-virtual hostile) + ) + ) + ) + (let ((t9-3 (-> (find-parent-state) trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/city/common/nav-graph-h_REF.gc b/test/decompiler/reference/jak3/levels/city/common/nav-graph-h_REF.gc index c70abe2d98..5919012a00 100644 --- a/test/decompiler/reference/jak3/levels/city/common/nav-graph-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/nav-graph-h_REF.gc @@ -16,21 +16,21 @@ (max-user-count uint8) (user-count uint8) (width uint8) - (flags uint8) + (flags nav-branch-flags) ) (:methods - (nav-branch-method-9 () none) - (nav-branch-method-10 () none) + (set-default-density-speed-and-width (_type_) none) + (debug-print (_type_ object int) none) (get-density (_type_) float) (get-speed-limit (_type_) float) (get-width (_type_) float) (user-limit-reached? (_type_) symbol) (dest-node-id-at-max? (_type_) symbol) - (nav-branch-method-16 () none) - (nav-branch-method-17 () none) - (nav-branch-method-18 () none) - (nav-branch-method-19 () none) - (nav-branch-method-20 () none) + (set-density (_type_ float) none) + (set-speed-limit (_type_ float) none) + (set-width (_type_ float) none) + (set-src-node (_type_ nav-node) none) + (set-dst-node (_type_ nav-node) none) ) ) @@ -77,15 +77,15 @@ (level symbol :overlay-at (-> data 7)) ) (:methods - (nav-node-method-9 () none) - (nav-node-method-10 () none) - (nav-node-method-11 () none) - (nav-node-method-12 () none) - (nav-node-method-13 () none) - (nav-node-method-14 () none) - (nav-node-method-15 () none) - (nav-node-method-16 () none) - (nav-node-method-17 () none) + (debug-draw (_type_) none) + (debug-print (_type_ symbol string) none) + (remove-branch-by-idx (_type_ int) none) + (init-from-pt-and-heading (_type_ vector vector) none) + (set-pos-xyz (_type_ vector) none) + (set-angle-from-heading (_type_ vector) none) + (set-id-and-link-branches-back (_type_ uint) none) + (set-radius (_type_ float) none) + (set-angle (_type_ float) none) (get-position (_type_ vector) vector) (calc-sine-and-cosine! (_type_ vector) vector) (get-angle (_type_) float) @@ -232,43 +232,43 @@ (pad1 uint32 6) ) (:methods - (new (symbol type) _type_) - (nav-graph-method-9 () none) - (nav-graph-method-10 () none) - (nav-graph-method-11 () none) - (nav-graph-method-12 () none) - (nav-graph-method-13 () none) - (nav-graph-method-14 () none) - (nav-graph-method-15 () none) - (nav-graph-method-16 () none) - (nav-graph-method-17 () none) - (nav-graph-method-18 () none) - (nav-graph-method-19 () none) - (nav-graph-method-20 () none) - (nav-graph-method-21 () none) - (nav-graph-method-22 () none) - (nav-graph-method-23 () none) - (nav-graph-method-24 () none) - (nav-graph-method-25 () none) - (nav-graph-method-26 () none) - (nav-graph-method-27 () none) - (nav-graph-method-28 () none) - (nav-graph-method-29 () none) - (nav-graph-method-30 () none) - (nav-graph-method-31 () none) - (nav-graph-method-32 () none) - (nav-graph-method-33 () none) - (nav-graph-method-34 () none) - (nav-graph-method-35 () none) - (nav-graph-method-36 () none) - (nav-graph-method-37 () none) - (nav-graph-method-38 () none) - (nav-graph-method-39 () none) - (nav-graph-method-40 () none) + (new (symbol type int int int uint) _type_) + (debug-draw-nodes (_type_) none) + (find-nearest-nav-node (_type_ vector symbol) nav-node) + (print-nav-graph (_type_) none) + (set-first-node (_type_) none) + (nav-graph-method-13 (_type_ int int) none) + (nav-graph-method-14 (_type_ int int) none) + (reset! (_type_) none) + (add-node (_type_ int) nav-node) + (link-node-to-graph (_type_ nav-node) none) + (reset-branch-array (_type_ nav-node int) none) + (nav-graph-method-19 (_type_ int int int int int int) none) + (nav-graph-method-20 (_type_ int int) none) + (move-selected-to-height-map-height (_type_) none) + (select-nodes-in-range (_type_ int int) none) + (deselect-nodes-in-range (_type_ int int) none) + (toggle-select-nodes-in-range (_type_ int int) none) + (select-nodes-in-level (_type_ symbol symbol) none) + (select-nodes-by-nav-mesh-id (_type_ int symbol) none) + (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none) + (print-selected-nodes (_type_) none) + (assign-selected-nodes-to-level (_type_ symbol) none) + (assign-selected-nodes-to-nav-mesh (_type_ uint) none) + (set-radius-of-selected-nodes (_type_ float) none) + (set-speed-limit-of-selected (_type_ float) none) + (set-density-of-selected (_type_ float) none) + (set-width-of-selected (_type_ float) none) + (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) + (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) + (offset-pos-of-selected (_type_ vector) none) + (nav-graph-method-38 (_type_) none) + (nav-graph-method-39 (_type_) none) + (nav-graph-method-40 (_type_ int) int) (node-at-idx (_type_ int) nav-node) - (nav-graph-method-42 () none) - (nav-graph-method-43 () none) - (nav-graph-method-44 () none) + (patch-nodes (_type_) none) + (copy-to-mysql-graph (_type_ mysql-nav-graph string) none) + (from-editor (_type_ mysql-nav-graph symbol) none) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc b/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc new file mode 100644 index 0000000000..c488066935 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc @@ -0,0 +1,1468 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 16 of type nav-branch +;; WARN: Return type mismatch int vs none. +(defmethod set-density ((this nav-branch) (arg0 float)) + (set! (-> this density) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 128.0 arg0))))))) + 0 + (none) + ) + +;; definition for method 17 of type nav-branch +;; WARN: Return type mismatch int vs none. +(defmethod set-speed-limit ((this nav-branch) (arg0 float)) + (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + 0 + (none) + ) + +;; definition for method 18 of type nav-branch +;; WARN: Return type mismatch int vs none. +(defmethod set-width ((this nav-branch) (arg0 float)) + (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) + 0 + (none) + ) + +;; definition for method 19 of type nav-branch +;; WARN: Return type mismatch int vs none. +(defmethod set-src-node ((this nav-branch) (arg0 nav-node)) + (set! (-> this src-node) arg0) + 0 + (none) + ) + +;; definition for method 20 of type nav-branch +;; WARN: Return type mismatch int vs none. +(defmethod set-dst-node ((this nav-branch) (arg0 nav-node)) + (set! (-> this dest-node) arg0) + 0 + (none) + ) + +;; definition for method 9 of type nav-branch +;; WARN: Return type mismatch int vs none. +(defmethod set-default-density-speed-and-width ((this nav-branch)) + (set-density this 0.25) + (set-speed-limit this 61440.0) + (set-width this 16384.0) + 0 + (none) + ) + +;; definition for method 9 of type nav-node +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this nav-node)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'sphere)) + ) + (let ((a1-0 this) + (v1-0 gp-0) + ) + (set! (-> v1-0 quad) (-> a1-0 position quad)) + (set! (-> v1-0 w) 1.0) + ) + (set! (-> s4-0 quad) (-> gp-0 quad)) + (let ((v1-2 this)) + (set! (-> s4-0 r) (* 1024.0 (the float (-> v1-2 radius)))) + ) + (when (logtest? (-> this flags) (nav-node-flag-byte selected)) + (let ((v1-8 (new 'stack-no-clear 'inline-array 'vector 2))) + (let ((a1-3 (-> v1-8 0))) + (let ((a0-6 gp-0)) + (let ((a2-1 -8192.0)) + (.mov vf6 a2-1) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-3 quad) vf5) + ) + (let ((a1-4 (-> v1-8 1))) + (let ((a0-7 gp-0)) + (let ((a2-3 8192.0)) + (.mov vf6 a2-3) + ) + (.lvf vf4 (&-> a0-7 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-4 quad) vf5) + ) + (add-debug-box #t (bucket-id debug) (-> v1-8 0) (-> v1-8 1) *color-yellow*) + ) + ) + (when (and (not (logtest? (-> this flags) (nav-node-flag-byte hidden))) + (let ((f0-6 (vector-vector-distance-squared gp-0 (camera-pos))) + (f1-2 327680.0) + ) + (and (< f0-6 (* f1-2 f1-2)) (sphere-in-view-frustum? s4-0)) + ) + ) + (add-debug-x #t (bucket-id debug) gp-0 *color-red*) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 583) + ) + (format (clear *temp-string*) "~D ~D" (-> this id) (-> this nav-mesh-id)) + (s4-1 + s3-1 + (the-as bucket-id s2-1) + *temp-string* + gp-0 + (if (logtest? (-> this flags) (nav-node-flag-byte blocked)) + (font-color red) + (font-color cyan) + ) + (the-as vector2h #f) + ) + ) + (let ((s4-2 add-debug-vector) + (s3-2 #t) + (s2-2 583) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (let ((f0-8 (the float (-> this angle))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (sincos! s5-1 f0-8) + (set! (-> s1-1 x) (-> s5-1 y)) + (set! (-> s1-1 y) 0.0) + (set! (-> s1-1 z) (- (-> s5-1 x))) + ) + (set! (-> s1-1 w) 1.0) + (s4-2 s3-2 (the-as bucket-id s2-2) gp-0 s1-1 (meters 2) *color-green*) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 10 of type nav-branch +;; WARN: Return type mismatch int vs none. +(defmethod debug-print ((this nav-branch) (arg0 object) (arg1 int)) + (format arg0 "~S~T~T~T (new-nav-branch :dest-node-id ~d~%" arg1 (-> this dest-node id)) + (let ((t9-1 format) + (a0-2 arg0) + (a1-2 "~S~T~T~T~T~T :density ~4,,3f~%") + (a2-2 arg1) + (v1-1 this) + ) + (t9-1 a0-2 a1-2 a2-2 (* 0.0078125 (the float (-> v1-1 density)))) + ) + (let ((t9-2 format) + (a0-3 arg0) + (a1-3 "~S~T~T~T~T~T :width ~4,,3M~%") + (a2-3 arg1) + (v1-3 this) + ) + (t9-2 a0-3 a1-3 a2-3 (* 256.0 (the float (-> v1-3 width)))) + ) + (let ((t9-3 format) + (a0-4 arg0) + (a1-4 "~S~T~T~T~T~T :speed-limit ~4,,3M~%") + (a2-4 arg1) + (v1-5 this) + ) + (t9-3 a0-4 a1-4 a2-4 (* 1024.0 (the float (-> v1-5 speed-limit)))) + ) + (when (nonzero? (-> this clock-type)) + (let ((t9-4 format) + (a0-5 arg0) + (a1-5 "~S~T~T~T~T~T :clock-type ~S~%") + (a2-5 arg1) + (v1-9 (-> this clock-type)) + ) + (t9-4 a0-5 a1-5 a2-5 (cond + ((= v1-9 (nav-branch-clock-type clock3)) + "clock3" + ) + ((= v1-9 (nav-branch-clock-type no-clock)) + "no-clock" + ) + ((= v1-9 (nav-branch-clock-type clock2)) + "clock2" + ) + ((= v1-9 (nav-branch-clock-type clock4)) + "clock4" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format arg0 "~S~T~T~T~T~T :clock-mask (" arg1) + (let ((s4-1 (-> this clock-mask))) + (if (= (logand s4-1 (nav-branch-clock-mask phase-1a)) (nav-branch-clock-mask phase-1a)) + (format arg0 "phase-1a ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-2a)) (nav-branch-clock-mask phase-2a)) + (format arg0 "phase-2a ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-1)) (nav-branch-clock-mask phase-1)) + (format arg0 "phase-1 ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-3a)) (nav-branch-clock-mask phase-3a)) + (format arg0 "phase-3a ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-2)) (nav-branch-clock-mask phase-2)) + (format arg0 "phase-2 ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-4a)) (nav-branch-clock-mask phase-4a)) + (format arg0 "phase-4a ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-3)) (nav-branch-clock-mask phase-3)) + (format arg0 "phase-3 ") + ) + (if (= (logand s4-1 (nav-branch-clock-mask phase-4)) (nav-branch-clock-mask phase-4)) + (format arg0 "phase-4 ") + ) + ) + (format arg0 ")~%") + ) + (format arg0 "~S~T~T~T~T~T )~%" arg1) + 0 + (none) + ) + +;; definition for method 10 of type nav-node +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-print ((this nav-node) (arg0 symbol) (arg1 string)) + (format arg0 "~S (new-nav-node :id ~d~%" arg1 (-> this id)) + (format arg0 "~S~T :branch-list (~%" arg1) + (dotimes (s3-0 (-> this branch-count)) + (debug-print (-> this branch-array s3-0) arg0 (the-as int arg1)) + ) + (format arg0 "~S~T~T~T )~%" arg1) + (let* ((v1-6 (-> this flags)) + (s3-1 (logclear v1-6 (nav-node-flag-byte visited blocked))) + ) + (when (nonzero? s3-1) + (format arg0 "~S~T :flags (" arg1) + (if (= (logand s3-1 (nav-node-flag-byte blocked)) (nav-node-flag-byte blocked)) + (format arg0 "blocked ") + ) + (if (= (logand s3-1 (nav-node-flag-byte selected)) (nav-node-flag-byte selected)) + (format arg0 "selected ") + ) + (if (= (logand s3-1 (nav-node-flag-byte pedestrian)) (nav-node-flag-byte pedestrian)) + (format arg0 "pedestrian ") + ) + (if (= (logand s3-1 (nav-node-flag-byte visited)) (nav-node-flag-byte visited)) + (format arg0 "visited ") + ) + (if (= (logand s3-1 (nav-node-flag-byte hidden)) (nav-node-flag-byte hidden)) + (format arg0 "hidden ") + ) + (format arg0 ")~%") + ) + ) + (let ((v1-24 (new 'stack-no-clear 'vector))) + (let ((a2-6 this) + (a0-19 v1-24) + ) + (set! (-> a0-19 quad) (-> a2-6 position quad)) + (set! (-> a0-19 w) 1.0) + ) + (format arg0 "~S~T :position (~4,,2M ~4,,2M ~4,,2M)~%" arg1 (-> v1-24 x) (-> v1-24 y) (-> v1-24 z)) + ) + (format arg0 "~S~T :angle ~4,,3f~%" arg1 (* 0.005493164 (the float (-> this angle)))) + (let ((t9-13 format) + (a0-22 arg0) + (a1-16 "~S~T :radius ~4,,2M~%") + (a2-11 arg1) + (v1-30 this) + ) + (t9-13 a0-22 a1-16 a2-11 (* 1024.0 (the float (-> v1-30 radius)))) + ) + (if (nonzero? (-> this nav-mesh-id)) + (format arg0 "~S~T :nav-mesh-id ~d~%" arg1 (-> this nav-mesh-id)) + ) + (if (-> this level) + (format arg0 "~S~T :level ~s~%" arg1 (-> this level)) + ) + (format arg0 "~S~T )~%" arg1) + 0 + (none) + ) + +;; definition for method 13 of type nav-node +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-pos-xyz ((this nav-node) (arg0 vector)) + (let ((f0-0 (-> this position w))) + (set! (-> this position quad) (-> arg0 quad)) + (set! (-> this position w) f0-0) + ) + 0 + (none) + ) + +;; definition for method 14 of type nav-node +;; WARN: Return type mismatch int vs none. +(defmethod set-angle-from-heading ((this nav-node) (arg0 vector)) + (set! (-> this angle) (the-as uint (the int (atan (- (-> arg0 z)) (-> arg0 x))))) + 0 + (none) + ) + +;; definition for method 16 of type nav-node +;; WARN: Return type mismatch int vs none. +(defmethod set-radius ((this nav-node) (arg0 float)) + (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + 0 + (none) + ) + +;; definition for method 17 of type nav-node +;; WARN: Return type mismatch int vs none. +(defmethod set-angle ((this nav-node) (arg0 float)) + (set! (-> this angle) (the-as uint (the int (+ 0.5 arg0)))) + 0 + (none) + ) + +;; definition for method 15 of type nav-node +;; WARN: Return type mismatch int vs none. +(defmethod set-id-and-link-branches-back ((this nav-node) (arg0 uint)) + (set! (-> this id) arg0) + (dotimes (v1-0 (-> this branch-count)) + (set! (-> this branch-array v1-0 src-node) this) + ) + 0 + (none) + ) + +;; definition for method 12 of type nav-node +;; WARN: Return type mismatch int vs none. +(defmethod init-from-pt-and-heading ((this nav-node) (arg0 vector) (arg1 vector)) + (set-pos-xyz this arg0) + (set-angle-from-heading this arg1) + (set! (-> this flags) (nav-node-flag-byte pedestrian selected)) + (set-radius this 32768.0) + (set! (-> this level) 'ctyport) + (set! (-> this nav-mesh-id) (the-as uint 0)) + (dotimes (s5-1 (-> this branch-count)) + (set-default-density-speed-and-width (-> this branch-array s5-1)) + ) + 0 + (none) + ) + +;; definition for method 11 of type nav-node +;; WARN: Return type mismatch int vs none. +(defmethod remove-branch-by-idx ((this nav-node) (arg0 int)) + (when (and (>= arg0 0) (< arg0 (-> this branch-count))) + (let ((s5-0 (+ arg0 1)) + (s4-0 arg0) + ) + (while (< s5-0 (-> this branch-count)) + (mem-copy! (the-as pointer (-> this branch-array s4-0)) (the-as pointer (-> this branch-array s5-0)) 16) + (+! s5-0 1) + (+! s4-0 1) + ) + ) + (+! (-> this branch-count) -1) + ) + 0 + (none) + ) + +;; definition for method 18 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod reset-branch-array ((this nav-graph) (arg0 nav-node) (arg1 int)) + (set! (-> arg0 branch-array) (the-as (inline-array nav-branch) (-> this branch-array (-> this branch-count)))) + (set! (-> arg0 branch-count) arg1) + (+! (-> this branch-count) arg1) + (dotimes (s4-0 arg1) + (let ((s3-0 (-> arg0 branch-array s4-0))) + (set-default-density-speed-and-width s3-0) + (set! (-> s3-0 src-node) arg0) + (set! (-> s3-0 dest-node) #f) + ) + ) + 0 + (none) + ) + +;; definition for method 16 of type nav-graph +(defmethod add-node ((this nav-graph) (arg0 int)) + (let ((s4-0 (the-as nav-node #f))) + (let ((s5-0 (-> this node-count)) + (v1-1 (+ arg0 -1 (-> this branch-count))) + ) + (when (and (< s5-0 2000) (< v1-1 2500)) + (set! s4-0 (-> this node-array s5-0)) + (reset-branch-array this s4-0 arg0) + (set-id-and-link-branches-back s4-0 (the-as uint s5-0)) + (+! (-> this node-count) 1) + ) + ) + s4-0 + ) + ) + +;; definition for method 17 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod link-node-to-graph ((this nav-graph) (arg0 nav-node)) + (when (> (-> arg0 branch-count) 0) + (let ((a0-1 (-> arg0 branch-array 0)) + (t9-0 (method-of-type nav-branch set-dst-node)) + (a2-0 this) + (v1-4 (-> this first-node)) + (a1-1 (the-as nav-node #f)) + ) + (if (and (>= v1-4 0) (< v1-4 (-> a2-0 node-count))) + (set! a1-1 (-> a2-0 node-array v1-4)) + ) + (t9-0 a0-1 a1-1) + ) + (let ((v1-9 (+ (-> arg0 id) -1))) + (when (>= v1-9 (the-as uint (-> this first-node))) + (let ((v1-11 (-> this node-array v1-9))) + (set! (-> v1-11 branch-count) 1) + (set-dst-node (-> v1-11 branch-array 0) arg0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod nav-graph-method-13 ((this nav-graph) (arg0 int) (arg1 int)) + (when (and (< arg0 (-> this node-count)) (> arg1 0)) + (let ((s4-1 (min arg1 (- (-> this node-count) arg0)))) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) + (dotimes (s1-0 (-> s2-0 branch-count)) + (let ((v1-9 (nav-graph-method-40 this (the-as int (-> s2-0 branch-array s1-0 dest-node))))) + (when (and (>= v1-9 arg0) (< v1-9 (+ arg0 s4-1))) + (let ((v1-11 (-> this node-array v1-9))) + (cond + ((= (-> v1-11 branch-count) 1) + (let ((v1-14 (-> v1-11 branch-array 0 dest-node id))) + (if (or (< v1-14 (the-as uint arg0)) (>= v1-14 (the-as uint (+ arg0 s4-1)))) + (set-dst-node (-> s2-0 branch-array s1-0) (-> this node-array v1-14)) + (remove-branch-by-idx s2-0 s1-0) + ) + ) + ) + (else + (remove-branch-by-idx s2-0 s1-0) + ) + ) + ) + ) + ) + ) + ) + ) + (dotimes (s3-1 (-> this node-count)) + (let ((s2-1 (-> this node-array s3-1))) + (dotimes (s1-1 (-> s2-1 branch-count)) + (let ((v1-28 (nav-graph-method-40 this (the-as int (-> s2-1 branch-array s1-1 dest-node))))) + (if (>= v1-28 (+ arg0 s4-1)) + (set-dst-node (-> s2-1 branch-array s1-1) (-> this node-array (- v1-28 s4-1))) + ) + ) + ) + ) + ) + (let ((s3-2 arg0) + (s2-2 (-> this node-array (+ arg0 s4-1))) + (s1-2 (-> this node-array arg0)) + ) + (countdown (s0-0 (- (-> this node-count) (+ arg0 s4-1))) + (mem-copy! (the-as pointer s1-2) (the-as pointer s2-2) 32) + (set-id-and-link-branches-back s1-2 (the-as uint s3-2)) + (&+! s2-2 32) + (&+! s1-2 32) + (+! s3-2 1) + ) + ) + (set! (-> this node-count) (- (-> this node-count) s4-1)) + (if (< arg0 (-> this first-node)) + (set! (-> this first-node) (- (-> this first-node) s4-1)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 14 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod nav-graph-method-14 ((this nav-graph) (arg0 int) (arg1 int)) + (when (and (< arg0 (-> this node-count)) (> arg1 0)) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) + (dotimes (s1-0 (-> s2-0 branch-count)) + (let ((v1-7 (nav-graph-method-40 this (the-as int (-> s2-0 branch-array s1-0 dest-node))))) + (if (< arg0 v1-7) + (set-dst-node (-> s2-0 branch-array s1-0) (-> this node-array (+ v1-7 arg1))) + ) + ) + ) + ) + ) + (let* ((s3-1 (+ arg1 -1 (-> this node-count))) + (s2-1 (-> this node-array (- s3-1 arg1))) + (s1-1 (-> this node-array s3-1)) + ) + (countdown (s0-0 (- (-> this node-count) arg0)) + (mem-copy! (the-as pointer s1-1) (the-as pointer s2-1) 32) + (set-id-and-link-branches-back s1-1 (the-as uint s3-1)) + (set! s2-1 (+ (the-as uint s2-1) -32)) + (set! s1-1 (+ (the-as uint s1-1) -32)) + (+! s3-1 -1) + ) + ) + (+! (-> this node-count) arg1) + (+! (-> this first-node) arg1) + (let ((s3-2 (-> this node-array arg0)) + (s2-2 (-> this node-array arg0)) + ) + (dotimes (s1-2 arg1) + (mem-copy! (the-as pointer s2-2) (the-as pointer s3-2) 32) + (set-id-and-link-branches-back s2-2 (the-as uint arg0)) + (+! (-> s2-2 position y) (* 8192.0 (the float (+ s1-2 1)))) + (reset-branch-array this s2-2 1) + (set-dst-node (-> s2-2 branch-array 0) (-> this node-array (+ arg0 1))) + (&+! s2-2 32) + (+! arg0 1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 15 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod reset! ((this nav-graph)) + (set! (-> this node-count) 0) + (set! (-> this branch-count) 0) + (set! (-> this first-node) 0) + (set! (-> this patched) #f) + 0 + (none) + ) + +;; definition for method 12 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod set-first-node ((this nav-graph)) + (set! (-> this first-node) (-> this node-count)) + 0 + (none) + ) + +;; definition for method 28 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod print-selected-nodes ((this nav-graph)) + (let ((s4-0 0) + (s1-0 0) + (v1-0 #f) + (s3-0 0) + (gp-0 0) + ) + (dotimes (s2-0 (-> this node-count)) + (let* ((a0-2 (-> this node-array s2-0)) + (s0-1 (logtest? (-> a0-2 flags) (nav-node-flag-byte selected))) + ) + (when s0-1 + (+! gp-0 1) + (if (not v1-0) + (set! s4-0 s2-0) + ) + (set! s1-0 s2-0) + ) + (set! v1-0 (and (not s0-1) v1-0)) + (when (or v1-0 (and s0-1 (= s2-0 (+ (-> this node-count) -1)))) + (if (> s3-0 0) + (format #t ", ") + ) + (if (= s4-0 s1-0) + (format #t "~d" s4-0) + (format #t "~d-~d" s4-0 s1-0) + ) + (+! s3-0 1) + ) + (set! v1-0 s0-1) + ) + ) + (format #t "~%") + (format #t "~d nodes selected~%" gp-0) + ) + 0 + (none) + ) + +;; definition for method 22 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod select-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) + (a2-3 arg0) + ) + (+ (- 1 arg0) v1-3) + (while (>= v1-3 a2-3) + (let ((a1-4 (-> this node-array a2-3))) + (logior! (-> a1-4 flags) (nav-node-flag-byte selected)) + ) + (+! a2-3 1) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +;; definition for method 23 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod deselect-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) + (a2-3 arg0) + ) + (+ (- 1 arg0) v1-3) + (while (>= v1-3 a2-3) + (let ((a1-4 (-> this node-array a2-3))) + (logclear! (-> a1-4 flags) (nav-node-flag-byte selected)) + ) + (+! a2-3 1) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +;; definition for method 24 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod toggle-select-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) + (a2-3 arg0) + ) + (+ (- 1 arg0) v1-3) + (while (>= v1-3 a2-3) + (let ((a1-4 (-> this node-array a2-3))) + (logxor! (-> a1-4 flags) (nav-node-flag-byte selected)) + ) + (+! a2-3 1) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +;; definition for method 25 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod select-nodes-in-level ((this nav-graph) (arg0 symbol) (arg1 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((a3-1 (-> this node-array v1-0)) + (t0-2 (= (-> a3-1 level) arg0)) + ) + (case arg1 + (('set) + (logclear! (-> a3-1 flags) (nav-node-flag-byte selected)) + (if t0-2 + (logior! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('and) + (if (not t0-2) + (logclear! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('or) + (if t0-2 + (logior! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +;; definition for method 26 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod select-nodes-by-nav-mesh-id ((this nav-graph) (arg0 int) (arg1 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((a3-1 (-> this node-array v1-0)) + (t0-2 (= (-> a3-1 nav-mesh-id) arg0)) + ) + (case arg1 + (('set) + (logclear! (-> a3-1 flags) (nav-node-flag-byte selected)) + (if t0-2 + (logior! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('and) + (if (not t0-2) + (logclear! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('or) + (if t0-2 + (logior! (-> a3-1 flags) (nav-node-flag-byte selected)) + ) + ) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +;; definition for method 27 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod select-nodes-by-flags ((this nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((t0-1 (-> this node-array v1-0)) + (t1-3 (= (logand (-> t0-1 flags) arg1) arg0)) + ) + (case arg2 + (('set) + (logclear! (-> t0-1 flags) (nav-node-flag-byte selected)) + (if t1-3 + (logior! (-> t0-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('and) + (if (not t1-3) + (logclear! (-> t0-1 flags) (nav-node-flag-byte selected)) + ) + ) + (('or) + (if t1-3 + (logior! (-> t0-1 flags) (nav-node-flag-byte selected)) + ) + ) + ) + ) + ) + (print-selected-nodes this) + 0 + (none) + ) + +;; definition for method 29 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod assign-selected-nodes-to-level ((this nav-graph) (arg0 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) + (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) + (set! (-> a2-1 level) arg0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod assign-selected-nodes-to-nav-mesh ((this nav-graph) (arg0 uint)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) + (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) + (set! (-> a2-1 nav-mesh-id) arg0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 31 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod set-radius-of-selected-nodes ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((a0-2 (-> this node-array s4-0))) + (if (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) + (set-radius a0-2 arg0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 35 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod or-flags-of-selected-nodes ((this nav-graph) (arg0 nav-node-flag-byte)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) + (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) + (logior! (-> a2-1 flags) arg0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 36 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod and-flags-of-selected-nodes ((this nav-graph) (arg0 nav-node-flag-byte)) + (let ((v1-0 (lognot arg0))) + (dotimes (a1-1 (-> this node-count)) + (let ((a2-1 (-> this node-array a1-1))) + (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) + (logand! (-> a2-1 flags) v1-0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 32 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod set-speed-limit-of-selected ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) + (dotimes (s2-0 (-> s3-0 branch-count)) + (set-speed-limit (-> s3-0 branch-array s2-0) arg0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 33 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod set-density-of-selected ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) + (dotimes (s2-0 (-> s3-0 branch-count)) + (set-density (-> s3-0 branch-array s2-0) arg0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 34 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod set-width-of-selected ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) + (dotimes (s2-0 (-> s3-0 branch-count)) + (set-width (-> s3-0 branch-array s2-0) arg0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 37 of type nav-graph +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod offset-pos-of-selected ((this nav-graph) (arg0 vector)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (dotimes (s3-0 (-> this node-count)) + (let ((a0-2 (-> this node-array s3-0))) + (when (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) + (let ((a2-0 a0-2) + (v1-4 s4-0) + ) + (set! (-> v1-4 quad) (-> a2-0 position quad)) + (set! (-> v1-4 w) 1.0) + ) + (vector+! s4-0 s4-0 arg0) + (set-pos-xyz a0-2 s4-0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 38 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod nav-graph-method-38 ((this nav-graph)) + (let ((s5-0 (new 'stack-no-clear 'vehicle-controller)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) + (when (and (logtest? (-> s2-0 flags) (nav-node-flag-byte selected)) (= (-> s2-0 branch-count) 1)) + (let ((a1-0 (-> s2-0 branch-array 0))) + (-> a1-0 dest-node) + (vehicle-controller-method-13 s5-0 a1-0 (-> s2-0 position)) + ) + (vehicle-controller-method-11 s5-0) + (vector-! s4-0 (-> s5-0 target-point) (-> s2-0 position)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (set-angle-from-heading s2-0 s4-0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type nav-graph +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-nodes ((this nav-graph)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (when (not (logtest? (-> s3-0 flags) (nav-node-flag-byte hidden))) + (debug-draw s3-0) + (let ((a1-0 s3-0) + (v1-6 (-> s5-0 rvec)) + ) + (set! (-> v1-6 quad) (-> a1-0 position quad)) + (set! (-> v1-6 w) 1.0) + ) + (dotimes (s2-0 (-> s3-0 branch-count)) + (let ((v1-9 (-> s3-0 branch-array s2-0 dest-node))) + (when v1-9 + (let ((a2-0 v1-9) + (a0-7 (-> s5-0 uvec)) + ) + (set! (-> a0-7 quad) (-> a2-0 position quad)) + (set! (-> a0-7 w) 1.0) + ) + (vector-! (-> s5-0 fvec) (-> s5-0 uvec) (-> s5-0 rvec)) + (let* ((f0-2 (vector-length (-> s5-0 fvec))) + (f1-2 (fmax (* 0.75 f0-2) (+ -8192.0 f0-2))) + ) + (vector-float*! (-> s5-0 fvec) (-> s5-0 fvec) (/ f1-2 f0-2)) + ) + (vector+! (-> s5-0 trans) (-> s5-0 rvec) (-> s5-0 fvec)) + (add-debug-line + #t + (bucket-id debug) + (-> s5-0 rvec) + (-> s5-0 trans) + (cond + ((= (-> v1-9 id) #xffff) + *color-dark-blue* + ) + ((logtest? (-> s3-0 flags) (nav-node-flag-byte pedestrian)) + *color-dark-red* + ) + (else + *color-dark-green* + ) + ) + #f + *color-white* + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type nav-graph +;; INFO: Used lq/sq +(defmethod find-nearest-nav-node ((this nav-graph) (arg0 vector) (arg1 symbol)) + (let ((gp-0 (the-as nav-node #f))) + (let* ((f0-0 409600000.0) + (f30-0 (* f0-0 f0-0)) + ) + (dotimes (s2-0 (-> this node-count)) + (let ((s1-0 (-> this node-array s2-0)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (when (and (not (logtest? (-> s1-0 flags) (nav-node-flag-byte hidden))) + (or (not arg1) (and arg1 (logtest? (-> s1-0 flags) (nav-node-flag-byte selected)))) + ) + (let ((a2-1 s1-0) + (v1-8 a1-1) + ) + (set! (-> v1-8 quad) (-> a2-1 position quad)) + (set! (-> v1-8 w) 1.0) + ) + (let ((f0-3 (vector-vector-distance-squared arg0 a1-1))) + (when (< f0-3 f30-0) + (set! gp-0 s1-0) + (set! f30-0 f0-3) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + +;; definition for method 21 of type nav-graph +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod move-selected-to-height-map-height ((this nav-graph)) + (dotimes (s5-0 (-> this node-count)) + (let ((s4-0 (-> this node-array s5-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (when (and (not (logtest? (-> s4-0 flags) (nav-node-flag-byte hidden))) + (not (logtest? (-> s4-0 flags) (nav-node-flag-byte pedestrian))) + (logtest? (-> s4-0 flags) (nav-node-flag-byte selected)) + ) + (let ((a1-0 s4-0) + (v1-8 s3-0) + ) + (set! (-> v1-8 quad) (-> a1-0 position quad)) + (set! (-> v1-8 w) 1.0) + ) + (let ((a1-3 s3-0)) + (set! (-> s3-0 y) (get-height-at-point *traffic-height-map* a1-3)) + ) + (set-pos-xyz s4-0 s3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 39 of type nav-graph +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod nav-graph-method-39 ((this nav-graph)) + (local-vars (sv-80 entity-nav-mesh) (sv-96 entity-nav-mesh)) + (dotimes (s5-0 (-> this node-count)) + (let ((s4-0 (-> this node-array s5-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((a1-0 s4-0) + (v1-1 s3-0) + ) + (set! (-> v1-1 quad) (-> a1-0 position quad)) + (set! (-> v1-1 w) 1.0) + ) + (when (logtest? (-> s4-0 flags) (nav-node-flag-byte pedestrian)) + (dotimes (s2-0 (-> *level* length)) + (let ((v1-8 (-> *level* level s2-0))) + (when (= (-> v1-8 status) 'active) + (let ((s1-0 (-> v1-8 bsp nav-meshes))) + (when (nonzero? s1-0) + (dotimes (s0-0 (-> s1-0 length)) + (set! sv-80 (-> s1-0 s0-0)) + (-> sv-80 aid) + (set! sv-96 sv-80) + (let ((v1-16 (if (type? sv-96 entity-nav-mesh) + sv-96 + ) + ) + ) + (when v1-16 + (let ((a0-10 (-> v1-16 nav-mesh)) + (a1-5 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-5 vertex)) s3-0 (the-as vector (-> a0-10 bounds))) + (set! (-> a1-5 vertex1 x) 40960.0) + (set! (-> a1-5 data 20) (the-as uint 2)) + (if (nav-mesh-method-45 a0-10 a1-5) + (set! (-> s4-0 nav-mesh-id) (-> sv-80 aid)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 19 of type nav-graph +(defmethod nav-graph-method-19 ((this nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) + (let ((gp-0 (-> this node-array arg0)) + (s0-0 (-> this node-array arg1)) + (s4-0 (-> this node-array arg2)) + (s2-0 (-> this node-array arg3)) + (s1-0 (-> this node-array arg4)) + (s3-0 (-> this node-array arg5)) + ) + (reset-branch-array this s0-0 2) + (set-dst-node (-> s0-0 branch-array 0) s4-0) + (set-dst-node (-> s0-0 branch-array 1) s1-0) + (reset-branch-array this s2-0 2) + (set-dst-node (-> s2-0 branch-array 0) s1-0) + (set-dst-node (-> s2-0 branch-array 1) gp-0) + (reset-branch-array this s3-0 2) + (set-dst-node (-> s3-0 branch-array 0) gp-0) + (set-dst-node (-> s3-0 branch-array 1) s4-0) + ) + (none) + ) + +;; definition for method 40 of type nav-graph +(defmethod nav-graph-method-40 ((this nav-graph) (arg0 int)) + -1 + (shr (- arg0 (the-as int (-> this node-array 0))) 5) + ) + +;; definition for method 20 of type nav-graph +(defmethod nav-graph-method-20 ((this nav-graph) (arg0 int) (arg1 int)) + (let ((gp-0 (-> this node-array arg0)) + (s5-0 (-> this node-array arg1)) + ) + (reset-branch-array this gp-0 1) + (set-dst-node (-> gp-0 branch-array 0) s5-0) + ) + (none) + ) + +;; definition for method 11 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod print-nav-graph ((this nav-graph)) + (format #t "(define *traffic-nav-graph*~%") + (format #t " (new-nav-graph~%") + (format #t " :node-list (~%") + (dotimes (s5-0 (-> this node-count)) + (let ((a0-5 (-> this node-array s5-0))) + (set! (-> a0-5 id) (the-as uint s5-0)) + (debug-print a0-5 #t " ") + ) + ) + (format #t "~T~T )~%") + (format #t " )~%") + (format #t " )~%") + 0 + (none) + ) + +;; definition for method 42 of type nav-graph +;; WARN: Return type mismatch int vs none. +(defmethod patch-nodes ((this nav-graph)) + (when (not (-> this patched)) + (set! (-> this patched) #t) + (let ((s5-0 0)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) + (dotimes (s2-0 (-> s3-0 branch-count)) + (let ((s1-0 (-> s3-0 branch-array s2-0))) + (+! s5-0 1) + (set-src-node s1-0 s3-0) + (let ((v1-7 (the-as object (-> s1-0 dest-node)))) + (set-dst-node s1-0 (-> this node-array (the-as uint v1-7))) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 43 of type nav-graph +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 43 nav-graph) has a return type of none, but the expression builder found a return statement. +(defmethod copy-to-mysql-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 string)) + (set! (-> arg0 node-array length) 0) + (set! (-> arg0 edge-array length) 0) + (set! (-> arg0 visnode-array length) 0) + (set! (-> arg0 graph-type) (the-as basic (mysql-nav-graph-method-21 arg0))) + (let ((s3-0 (clear *temp-string*))) + (format s3-0 "select nav_graph_id from nav_graph where name='~S'" arg1) + (let ((a2-2 (sql-query s3-0))) + (when (!= (-> a2-2 content-type) 'select) + (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 this) + (return #f) + ) + (set! (-> arg0 nav_graph_id) (the-as uint (string->int (the-as string (-> a2-2 sql-data 0))))) + ) + ) + (dotimes (v1-9 (-> this node-count)) + (let ((a1-7 (-> arg0 node-array data (-> arg0 node-array length))) + (a0-12 (-> this node-array v1-9)) + ) + (logior! (-> a1-7 mysql-save-flag) (mysql-save-flag insert)) + (set! (-> a1-7 runtime-id) (-> a0-12 id)) + (set! (-> a1-7 nav_graph_id) (-> arg0 nav_graph_id)) + (let ((t0-0 a0-12) + (a2-8 (-> a1-7 position)) + ) + (set! (-> a2-8 quad) (-> t0-0 position quad)) + (set! (-> a2-8 w) 1.0) + ) + (set! (-> a1-7 level_name) (-> a0-12 level)) + (set! (-> a1-7 angle) (the float (-> a0-12 angle))) + (let ((a2-13 a0-12)) + (set! (-> a1-7 radius) (* 1024.0 (the float (-> a2-13 radius)))) + ) + (set! (-> a1-7 nav_node_flag) (the-as nav-node-flag (-> a0-12 flags))) + (set! (-> a1-7 nav_mesh_id) (-> a0-12 nav-mesh-id)) + (+! (-> arg0 node-array length) 1) + (dotimes (a1-11 (-> a0-12 branch-count)) + (let ((a2-22 (-> arg0 edge-array data (-> arg0 edge-array length))) + (a3-8 (-> a0-12 branch-array a1-11)) + ) + (logior! (-> a2-22 mysql-save-flag) (mysql-save-flag insert)) + (set! (-> a2-22 nav_graph_id) (-> arg0 nav_graph_id)) + (set! (-> a2-22 runtime-id) (the-as uint (-> arg0 edge-array length))) + (set! (-> a2-22 runtime-node-id-1) (the-as int (-> a0-12 id))) + (set! (-> a2-22 runtime-node-id-2) (the-as int (-> a3-8 dest-node id))) + (set! (-> a2-22 directionality) (nav-directionality default)) + (let ((t0-12 a3-8)) + (set! (-> a2-22 speed_limit) (* 1024.0 (the float (-> t0-12 speed-limit)))) + ) + (let ((t0-15 a3-8)) + (set! (-> a2-22 density) (* 0.0078125 (the float (-> t0-15 density)))) + ) + (set! (-> a2-22 nav_clock_mask) (the-as nav-clock-mask (-> a3-8 clock-mask))) + (set! (-> a2-22 nav_clock_type) (the-as nav-clock-type (-> a3-8 clock-type))) + (set! (-> a2-22 width) (* 256.0 (the float (-> a3-8 width)))) + ) + (+! (-> arg0 edge-array length) 1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 0 of type nav-graph +;; WARN: Return type mismatch object vs nav-graph. +(defmethod new nav-graph ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int) (arg2 int) (arg3 uint)) + (let ((s1-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as nav-graph s1-0)) + (set! s1-0 0) + (goto cfg-4) + ) + (set! (-> (the-as nav-graph s1-0) node-count) arg0) + (set! (-> (the-as nav-graph s1-0) branch-count) arg1) + (set! (-> (the-as nav-graph s1-0) link-count) arg2) + (set! (-> (the-as nav-graph s1-0) node-array) + (the-as (inline-array nav-node) (malloc allocation (* arg0 32))) + ) + (set! (-> (the-as nav-graph s1-0) branch-array) + (the-as (inline-array nav-branch) (malloc allocation (* arg1 16))) + ) + (set! (-> (the-as nav-graph s1-0) link-array) + (the-as (inline-array nav-graph-link) (malloc allocation (* 48 arg2))) + ) + (set! (-> (the-as nav-graph s1-0) first-node) 0) + (set! (-> (the-as nav-graph s1-0) patched) #f) + (set! (-> (the-as nav-graph s1-0) id) arg3) + (label cfg-4) + (the-as nav-graph s1-0) + ) + ) + +;; definition for method 44 of type nav-graph +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod from-editor ((this nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) + (local-vars + (sv-16 int) + (sv-32 int) + (sv-48 mysql-nav-node) + (sv-64 nav-branch) + (sv-80 nav-graph-link) + (sv-96 nav-node) + (sv-112 int) + ) + (set! (-> this node-count) 0) + (set! (-> this branch-count) 0) + (set! (-> this link-count) 0) + (mysql-nav-graph-method-20 arg0) + (let ((s5-0 0)) + (let ((s2-0 0)) + (b! #t cfg-34 :delay (nop!)) + (label cfg-1) + (let ((s0-0 (-> arg0 node-array data s2-0))) + (b! + (not (and (or (= arg1 #f) (= arg1 (-> s0-0 level_name))) + (not (logtest? (-> s0-0 mysql-save-flag) (mysql-save-flag delete))) + ) + ) + cfg-27 + :delay (nop!) + ) + (set! sv-16 (temp-edge-size s0-0)) + (let ((s1-0 (add-node this sv-16))) + (b! (not s1-0) cfg-36 :delay (nop!)) + (set! (-> s1-0 id) (the-as uint (if arg1 + (-> s0-0 level-node-index) + s2-0 + ) + ) + ) + (set! (-> s1-0 flags) (the-as nav-node-flag-byte (-> s0-0 nav_node_flag))) + (set-pos-xyz s1-0 (-> s0-0 position)) + (set-angle s1-0 (-> s0-0 angle)) + (set-radius s1-0 (-> s0-0 radius)) + (set! (-> s1-0 level) (-> s0-0 level_name)) + (set! (-> s1-0 nav-mesh-id) (-> s0-0 nav_mesh_id)) + (when (!= (-> this branch-array s5-0) (-> s1-0 branch-array 0)) + (format 0 "nav-graph::from-editor: ERROR something went awry in allocate-branches~%") + (break!) + 0 + ) + (let ((s0-1 (the-as object (-> s0-0 temp-edge-list)))) + (set! sv-32 sv-16) + (while (nonzero? sv-32) + (set! sv-32 (+ sv-32 -1)) + (set! sv-64 (-> this branch-array s5-0)) + (set-src-node sv-64 s1-0) + (set-speed-limit sv-64 (-> (the-as mysql-nav-edge s0-1) speed_limit)) + (set-density sv-64 (-> (the-as mysql-nav-edge s0-1) density)) + (set-width sv-64 (-> (the-as mysql-nav-edge s0-1) width)) + (set! (-> sv-64 clock-type) (the-as nav-branch-clock-type (-> (the-as mysql-nav-edge s0-1) nav_clock_type))) + (set! (-> sv-64 clock-mask) (the-as nav-branch-clock-mask (-> (the-as mysql-nav-edge s0-1) nav_clock_mask))) + (set! sv-48 (-> arg0 node-array data (-> (the-as mysql-nav-edge s0-1) runtime-node-id-2))) + (cond + ((or (= arg1 #f) (= arg1 (-> sv-48 level_name))) + (let ((t9-11 (method-of-type nav-branch set-dst-node)) + (a1-11 (-> this node-array (if arg1 + (-> sv-48 level-node-index) + (-> (the-as mysql-nav-edge s0-1) runtime-node-id-2) + ) + ) + ) + ) + (t9-11 sv-64 a1-11) + ) + ) + (else + (set-dst-node sv-64 (the-as nav-node #f)) + (set! sv-112 (-> this link-count)) + (set! sv-80 (-> this link-array sv-112)) + (set! (-> sv-80 dest-graph-id) (-> (lookup-level-info2 arg0 sv-48 #f) level-id)) + (set! (-> sv-80 src-branch-id) (the-as uint s5-0)) + (set! (-> sv-80 dest-node-id) (the-as uint (-> sv-48 level-node-index))) + (set! (-> sv-80 dest-graph) #f) + (set! sv-96 (-> sv-80 dummy-node)) + (set! (-> sv-96 id) (the-as uint #xffff)) + (set! (-> sv-96 flags) (the-as nav-node-flag-byte (-> sv-48 nav_node_flag))) + (set-pos-xyz sv-96 (-> sv-48 position)) + (set-angle sv-96 (-> sv-48 angle)) + (set-radius sv-96 (-> sv-48 radius)) + (set! (-> sv-96 level) (-> sv-48 level_name)) + (set! (-> sv-96 nav-mesh-id) (-> sv-48 nav_mesh_id)) + (set-dst-node sv-64 (-> sv-80 dummy-node)) + (format #t "outputting link ~d~%" sv-112) + (+! (-> this link-count) 1) + ) + ) + (+! s5-0 1) + (set! s0-1 (-> (the-as mysql-nav-edge s0-1) temp-next-edge)) + ) + ) + ) + (b! #t cfg-33 :delay (nop!)) + (label cfg-27) + (let ((v1-78 (the-as object (-> s0-0 temp-edge-list)))) + (while v1-78 + (when (= arg1 (-> arg0 node-array data (-> (the-as mysql-nav-edge v1-78) runtime-node-id-2) level_name)) + ) + (set! v1-78 (-> (the-as mysql-nav-edge v1-78) temp-next-edge)) + ) + ) + ) + (label cfg-33) + (+! s2-0 1) + (label cfg-34) + (b! (< s2-0 (-> arg0 node-array length)) cfg-1) + ) + (format #t "branch-count ~d~%" s5-0) + ) + (set! (-> this patched) #t) + (label cfg-36) + 0 + (none) + ) + +;; definition for function make-nav-graph +(defun make-nav-graph ((arg0 mysql-nav-graph) (arg1 symbol)) + (mysql-nav-graph-method-20 arg0) + (let ((s4-0 (the-as nav-graph #f))) + (let ((v1-2 (the-as mysql-nav-graph-level-info #f))) + (dotimes (a0-2 (-> arg0 level-info-array-length)) + (let ((a1-3 (-> arg0 level-info-array a0-2))) + (if (= (-> a1-3 level) arg1) + (set! v1-2 a1-3) + ) + ) + ) + (when v1-2 + (set! s4-0 + (new 'debug 'nav-graph (-> v1-2 node-count) (-> v1-2 branch-count) (-> v1-2 to-link-count) (-> v1-2 level-id)) + ) + (if s4-0 + (from-editor s4-0 arg0 arg1) + ) + ) + ) + s4-0 + ) + ) + +;; definition for method 15 of type nav-branch +(defmethod dest-node-id-at-max? ((this nav-branch)) + (with-pp + (and (!= (-> this dest-node id) #xffff) + (or (not *cty-faction-manager*) + (logtest? (cty-faction-manager-method-9 *cty-faction-manager* (the-as int (-> this clock-type)) (-> pp level name)) + 1 + ) + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/common/searchlight_REF.gc b/test/decompiler/reference/jak3/levels/city/common/searchlight_REF.gc new file mode 100644 index 0000000000..528bcd9364 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/common/searchlight_REF.gc @@ -0,0 +1,114 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type searchlight +(deftype searchlight (process-drawable) + ((sync sync-eased :inline) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type searchlight +(defmethod inspect ((this searchlight)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tsync: #~%" (-> this sync)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-searchlight searchlight searchlight-lod0-jg searchlight-idle-ja + ((searchlight-lod0-mg (meters 999999))) + :bounds (static-spherem 0 60 0 120) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (searchlight) + :virtual #t + :code (behavior () + (until #f + (let ((gp-1 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (new 'static 'vector :z 1.0 :w 1.0) + (+ -4004.9778 (* 8192.0 (get-norm! (-> self sync) 0))) + ) + ) + (s5-2 (quaternion-axis-angle! + (new 'stack-no-clear 'quaternion) + 0.0 + 1.0 + 0.0 + (vector-y-angle (-> (math-camera-matrix) fvec)) + ) + ) + ) + (let ((f0-3 (calc-fade-from-fog (-> self root trans)))) + (set-vector! (-> self draw color-emissive) f0-3 f0-3 f0-3 1.0) + ) + (quaternion-normalize! (quaternion*! (-> self root quat) s5-2 gp-1)) + ) + (when (rand-vu-percent? 0.05) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'hour) + (let ((v1-13 (send-event-function (ppointer->process *time-of-day*) a1-4))) + (if (and v1-13 (>= (the-as int v1-13) 7) (>= 18 (the-as int v1-13))) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + ) + ) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +;; definition for method 11 of type searchlight +(defmethod init-from-entity! ((this searchlight) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-searchlight" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set! (-> this root scale y) (rand-vu-float-range 1.8 2.0)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) + (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-12 0)) + (if #t + (set! v1-12 (logior v1-12 1)) + ) + (set! (-> s4-1 sync-type) 'sync-eased) + (set! (-> s4-1 sync-flags) (the-as sync-flags v1-12)) + ) + (set! (-> s4-1 period) (the-as uint (rand-vu-int-range 3000 6000))) + (set! (-> s4-1 entity) arg0) + (set! (-> s4-1 percent) 0.0) + (set! (-> s4-1 ease-in) 0.15) + (set! (-> s4-1 ease-out) 0.15) + (set! (-> s4-1 pause-in) 0.0) + (set! (-> s4-1 pause-out) 0.0) + (initialize! (-> this sync) s4-1) + ) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/ctyport-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/ctyport-obs_REF.gc new file mode 100644 index 0000000000..f916841f23 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/ctyport-obs_REF.gc @@ -0,0 +1,960 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type boat-manager +(deftype boat-manager (process) + ((mesh nav-mesh) + (paths path-control 4) + (boats-stop? symbol) + ) + (:state-methods + idle + ) + (:methods + (boat-manager-method-15 (_type_) none) + (boat-manager-method-16 (_type_) symbol) + ) + ) + +;; definition for method 3 of type boat-manager +(defmethod inspect ((this boat-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tmesh: ~A~%" (-> this mesh)) + (format #t "~2Tpaths[4] @ #x~X~%" (-> this paths)) + (format #t "~2Tboats-stop?: ~A~%" (-> this boats-stop?)) + (label cfg-4) + this + ) + +;; definition for symbol *barge-constants*, type rigid-body-vehicle-constants +(define *barge-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 100.0 + :inv-mass 0.01 + :linear-damping 0.9 + :angular-damping 0.9 + :bounce-factor 0.1 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 8192.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 16) (meters 6) (meters 20)) + ) + :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 '*barge-constants* + :flags #x8 + :object-type (traffic-type vehicle-task) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 1.0 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 1274.3112 + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 1.0 + :tire-static-friction 0.5 + :tire-static-friction-speed (meters 1) + :tire-dynamic-friction 0.25 + :tire-dynamic-friction-speed (meters 3) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 0.5 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 182.04445 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.05 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :thruster-flame-width (meters 0.25) + :thruster-flame-length (meters 4) + :thruster-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :exhaust-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :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 :w 1.0) (new 'static 'vector :w 1.0)) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 2000.0 + :inv-hit-points 0.0005 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :z 22118.4 :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :rider-stance #x1 + :grab-rail-array #f + :rider-hand-offset (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; definition of type boat-base +(deftype boat-base (vehicle) + ((manager handle) + (angle float) + (y-rot float) + (path-num uint32) + (path-index float) + ) + ) + +;; definition for method 3 of type boat-base +(defmethod inspect ((this boat-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle inspect))) + (t9-0 this) + ) + (format #t "~2Tmanager: ~D~%" (-> this manager)) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Ty-rot: ~f~%" (-> this y-rot)) + (format #t "~2Tpath-num: ~D~%" (-> this path-num)) + (format #t "~2Tpath-index: ~f~%" (-> this path-index)) + (label cfg-4) + this + ) + +;; definition for method 46 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod apply-damage ((this boat-base) (arg0 float) (arg1 rigid-body-impact)) + 0 + (none) + ) + +;; definition for method 50 of type boat-base +(defmethod attack-handler ((this boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + #f + ) + +;; definition for method 103 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-103 ((this boat-base)) + (local-vars (v1-8 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (time-elapsed? (-> this disturbed-time) (seconds 2)) + (let* ((f0-0 (-> this camera-dist2)) + (f1-0 0.000024414063) + (f0-1 (* f0-0 (* f1-0 f1-0))) + ) + (.lvf vf1 (&-> (-> this rbody ang-velocity) 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-8 vf1) + (when (< v1-8 f0-1) + (logclear! (-> this v-flags) (vehicle-flag disturbed)) + (vehicle-method-142 this) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 30 of type boat-base +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defmethod rigid-body-object-method-30 ((this boat-base)) + (local-vars (v1-42 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (rider-trans) + (let ((t9-1 (method-of-type vehicle rigid-body-object-method-30))) + (t9-1 this) + ) + (let ((s5-0 (-> this root))) + (pull-riders! s5-0) + (cond + ((logtest? (do-push-aways s5-0) (collide-spec jak)) + (+! (-> this overlap-player-counter) 1) + (when (< (the-as uint 60) (-> this overlap-player-counter)) + (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1000.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'smush)) + ) + ) + (set! (-> this overlap-player-counter) (the-as uint 0)) + 0 + ) + ) + (else + (set! (-> this overlap-player-counter) (the-as uint 0)) + 0 + ) + ) + ) + (when (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 6))) + (let ((a1-1 (-> this nav state))) + (set! (-> s5-1 0 quad) (-> a1-1 velocity quad)) + ) + (let ((s4-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info))) + (let ((s3-0 (-> this nav state current-poly))) + (vector-xz-normalize-copy! (-> s5-1 3) (-> s5-1 0) 163840.0) + (set! (-> s5-1 4 quad) (-> s5-1 3 quad)) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s3-0 (-> s5-1 4) s4-0) + ) + (when (-> s4-0 found-boundary) + (let ((f30-0 (vector-length (-> s5-1 0)))) + (vector-flatten! (-> s5-1 0) (-> s5-1 0) (-> s4-0 boundary-normal)) + (vector-rotate90-around-y! (-> s5-1 0) (-> s4-0 boundary-normal)) + (vector-normalize! (-> s5-1 0) f30-0) + ) + (when (= this *debug-actor*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this root trans) (-> s5-1 0) (meters 10) *color-blue*) + (format *stdebug* "avoid border~%") + ) + ) + ) + (let* ((f0-3 4.096) + (f0-5 (* f0-3 f0-3)) + ) + (.lvf vf1 (&-> (-> s5-1 0) 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-42 vf1) + (when (< f0-5 v1-42) + (set! (-> s5-1 5 quad) (-> s5-1 0 quad)) + (vector-normalize! (-> s5-1 5) 1.0) + (let ((s4-1 (-> this root quat))) + (quaternion-set! (the-as quaternion (-> s5-1 2)) 0.0 (-> s5-1 5 x) 0.0 (+ 1.0 (-> s5-1 5 z))) + (quaternion-normalize! (the-as quaternion (-> s5-1 2))) + (quaternion-smooth-seek! s4-1 s4-1 (the-as quaternion (-> s5-1 2)) (* 1.2 (seconds-per-frame))) + ) + (vector-z-quaternion! (-> s5-1 1) (-> this root quat)) + (vector-v*float+! (-> this root trans) (-> this root trans) (-> s5-1 1) 8954.266) + (seek! (-> this root trans y) 4096.0 (* 4096.0 (seconds-per-frame))) + ) + ) + ) + (when (= this *debug-actor*) + (format *stdebug* "no physics~%") + (format *stdebug* "~M~%" (-> this root trans y)) + ) + ) + (if (= this *debug-actor*) + (format *stdebug* "speed ~M~%" (vector-length (-> this root transv))) + ) + (let ((s4-2 (handle->process (-> this manager))) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (when s4-2 + (let ((a1-22 (-> this nav state))) + (set! (-> s5-2 quad) (-> a1-22 target-pos quad)) + ) + (if (or (= (-> this path-num) 2) (-> *setting-control* user-current stop-boats?)) + (get-point-at-percent-along-path! + (-> (the-as boat-manager (+ (* (-> this path-num) 4) (the-as uint s4-2))) paths 0) + (-> this root trans) + (-> this path-index) + 'interp + ) + ) + (when (and (not (or (= (-> this path-num) 2) (-> *setting-control* user-current stop-boats?))) + (< (vector-vector-xz-distance (-> this root trans) s5-2) 163840.0) + ) + (+! (-> this path-index) 0.01) + (let ((f0-20 (-> this path-index))) + (set! (-> this path-index) (- f0-20 (* (the float (the int (/ f0-20 1.0))) 1.0))) + ) + ) + (get-point-at-percent-along-path! + (-> (the-as boat-manager (+ (* (-> this path-num) 4) (the-as uint s4-2))) paths 0) + s5-2 + (-> this path-index) + 'interp + ) + (let ((v1-102 (-> this nav state))) + (logclear! (-> v1-102 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-102 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-102 target-pos quad) (-> s5-2 quad)) + ) + 0 + ) + ) + (vehicle-method-78 this) + ) + ) + +;; definition for method 55 of type boat-base +(defmethod clear-impulse-force-flag! ((this boat-base)) + ((method-of-type vehicle clear-impulse-force-flag!) this) + (none) + ) + +;; definition for method 31 of type boat-base +;; INFO: Used lq/sq +(defmethod apply-gravity! ((this boat-base) (arg0 float)) + (let ((s3-0 (-> this rbody)) + (s2-0 (-> this info)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (let ((a1-1 (-> this nav state))) + (set! (-> s4-0 uvec quad) (-> a1-1 velocity quad)) + ) + (vector-! (-> s4-0 rvec) (-> s4-0 uvec) (-> s3-0 lin-velocity)) + (vector-float*! (-> s4-0 rvec) (-> s4-0 rvec) (* 4.0 (-> s2-0 info mass))) + (set-vector! (-> s4-0 trans) 0.0 -122880.0 40960.0 1.0) + (vector-matrix*! (-> s4-0 fvec) (-> s4-0 trans) (-> s3-0 matrix)) + (apply-impact! s3-0 (-> s4-0 fvec) (-> s4-0 rvec)) + (vector-reset! (-> s4-0 rvec)) + (set! (-> s4-0 rvec y) (* -4.0 (-> s2-0 extra gravity) (-> s2-0 info mass))) + (add-force! s3-0 (-> s4-0 rvec)) + ) + (rigid-body-object-method-53 this arg0) + (vehicle-method-96 this arg0) + (none) + ) + +;; definition for method 93 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-93 ((this boat-base)) + 0 + (none) + ) + +;; definition for method 38 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-38 ((this boat-base)) + 0 + (none) + ) + +;; definition for method 131 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-131 ((this boat-base) (arg0 traffic-object-spawn-params)) + (get-nav-control this (-> arg0 nav-mesh)) + (set! (-> this manager) (-> arg0 handle)) + (set! (-> this nav callback-info) *physics-nav-callback-info*) + (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 target-speed) 40960.0) + ) + 0 + (let ((v1-7 (-> this nav))) + (set! (-> v1-7 acceleration) 8192.0) + ) + 0 + (let ((v1-9 (-> this nav))) + (set! (-> v1-9 turning-acceleration) 8192.0) + ) + 0 + (let ((v1-11 (-> this nav))) + (set! (-> v1-11 max-rotation-rate) 9102.223) + ) + 0 + (let ((v1-13 (-> this nav))) + (set! (-> v1-13 nav-cull-radius) 122880.0) + ) + 0 + (let ((v1-15 (-> this nav))) + (set! (-> v1-15 sphere-mask) (the-as uint 64)) + ) + 0 + (set! (-> this path-num) (-> arg0 user-data)) + (set! (-> this path-index) (+ 0.05 (-> arg0 position w))) + (when (-> *setting-control* user-current stop-boats?) + ) + (logior! (-> this root root-prim prim-core collide-as) (collide-spec pusher)) + (let ((v1-26 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + 0 + (none) + ) + +;; definition for method 33 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod alloc-rbody-control! ((this boat-base) (arg0 rigid-body-object-constants)) + ((method-of-type vehicle alloc-rbody-control!) this arg0) + 0 + (none) + ) + +;; definition for method 109 of type boat-base +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-method-109 ((this boat-base)) + (go (method-of-object this idle)) + (none) + ) + +;; definition for method 102 of type boat-base +(defmethod vehicle-method-102 ((this boat-base)) + #f + ) + +;; failed to figure out what this is: +(defstate waiting (boat-base) + :virtual #t + :enter (behavior () + (go-virtual idle) + ) + :exit (behavior () + '() + ) + ) + +;; failed to figure out what this is: +(defstate inactive (boat-base) + :virtual #t + :enter (behavior () + (go-virtual idle) + ) + :exit (behavior () + '() + ) + ) + +;; failed to figure out what this is: +(defstate idle (boat-base) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (logior! (-> self v-flags) (vehicle-flag riding)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + '() + ) + :post (behavior () + (rbody-post self) + (update-transforms (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-barge barge barge-lod0-jg barge-idle-ja + ((barge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 21) + ) + +;; definition of type barge +(deftype barge (boat-base) + ((engine sound-id) + (bow-wash sound-id) + ) + ) + +;; definition for method 3 of type barge +(defmethod inspect ((this barge)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type boat-base inspect))) + (t9-0 this) + ) + (format #t "~2Tengine: ~D~%" (-> this engine)) + (format #t "~2Tbow-wash: ~D~%" (-> this bow-wash)) + (label cfg-4) + this + ) + +;; definition for method 34 of type barge +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this barge)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 19) 0))) + (set! (-> s5-0 total-prims) (the-as uint 20)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core action) (collide-action solid rideable)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 81920.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) 0.0 0.0 -32768.0 16384.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 0.0 -8192.0 16384.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 0.0 16384.0 16384.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 40960.0 16384.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 0) + (set-vector! (-> v1-23 local-sphere) 24576.0 0.0 -32768.0 16384.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 0) + (set-vector! (-> v1-25 local-sphere) 24576.0 0.0 -8192.0 16384.0) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 0) + (set-vector! (-> v1-27 local-sphere) 24576.0 0.0 16384.0 16384.0) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-29 prim-core action) (collide-action solid)) + (set! (-> v1-29 transform-index) 0) + (set-vector! (-> v1-29 local-sphere) 24576.0 0.0 40960.0 16384.0) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-31 prim-core action) (collide-action solid)) + (set! (-> v1-31 transform-index) 0) + (set-vector! (-> v1-31 local-sphere) -24576.0 0.0 -32768.0 16384.0) + ) + (let ((v1-33 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-33 prim-core action) (collide-action solid)) + (set! (-> v1-33 transform-index) 0) + (set-vector! (-> v1-33 local-sphere) -24576.0 0.0 -8192.0 16384.0) + ) + (let ((v1-35 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-35 prim-core action) (collide-action solid)) + (set! (-> v1-35 transform-index) 0) + (set-vector! (-> v1-35 local-sphere) -24576.0 0.0 16384.0 16384.0) + ) + (let ((v1-37 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-37 prim-core action) (collide-action solid)) + (set! (-> v1-37 transform-index) 0) + (set-vector! (-> v1-37 local-sphere) -24576.0 0.0 40960.0 16384.0) + ) + (let ((v1-39 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-39 prim-core action) (collide-action solid)) + (set! (-> v1-39 transform-index) 0) + (set-vector! (-> v1-39 local-sphere) 16384.0 0.0 -57344.0 16384.0) + ) + (let ((v1-41 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-41 prim-core action) (collide-action solid)) + (set! (-> v1-41 transform-index) 0) + (set-vector! (-> v1-41 local-sphere) -16384.0 0.0 -57344.0 16384.0) + ) + (let ((v1-43 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-43 prim-core action) (collide-action solid)) + (set! (-> v1-43 transform-index) 0) + (set-vector! (-> v1-43 local-sphere) 0.0 8192.0 -61440.0 16384.0) + ) + (let ((v1-45 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-45 prim-core action) (collide-action solid)) + (set! (-> v1-45 transform-index) 0) + (set-vector! (-> v1-45 local-sphere) -40960.0 0.0 -53248.0 16384.0) + ) + (let ((v1-47 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-47 prim-core action) (collide-action solid)) + (set! (-> v1-47 transform-index) 0) + (set-vector! (-> v1-47 local-sphere) 40960.0 0.0 -53248.0 16384.0) + ) + (set! (-> s5-0 nav-radius) 81920.0) + (let ((v1-49 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-49 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-49 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 35 of type barge +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this barge)) + (with-pp + (set! (-> pp level) (level-get *level* 'ctyport)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-barge" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *barge-constants*) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this engine) (new-sound-id)) + (set! (-> this bow-wash) (new-sound-id)) + (set-vector! (-> this draw color-emissive) 0.3 0.3 0.0 0.0) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((= v1-0 -1) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ((= v1-0 1) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec camera-blocker vehicle-mesh vehicle-mesh-probeable)) + ) + ((zero? v1-0) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) + (collide-spec vehicle-sphere camera-blocker vehicle-mesh vehicle-mesh-probeable) + ) + ) + ) + ) + (none) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 7 of type boat-manager +;; WARN: Return type mismatch process vs boat-manager. +(defmethod relocate ((this boat-manager) (offset int)) + (dotimes (v1-0 4) + (if (-> this paths v1-0) + (&+! (-> this paths v1-0) offset) + ) + ) + (the-as boat-manager ((method-of-type process relocate) this offset)) + ) + +;; failed to figure out what this is: +(defstate idle (boat-manager) + :virtual #t + :trans (behavior () + (when (and (not (-> self boats-stop?)) (-> *setting-control* user-current stop-boats?)) + (kill-by-type barge *active-pool*) + (boat-manager-method-16 self) + (set! (-> self boats-stop?) #t) + ) + (dotimes (gp-0 4) + (let ((a0-2 (-> self paths gp-0))) + (if a0-2 + (debug-draw a0-2) + ) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 16 of type boat-manager +;; INFO: Used lq/sq +(defmethod boat-manager-method-16 ((this boat-manager)) + (when (-> this mesh) + (dotimes (s5-0 4) + (when (-> this paths s5-0) + (when #t + (logior! (-> this paths s5-0 flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s4-0 (-> this paths s5-0)) + (f30-0 0.0) + ) + 1 + (let ((s3-0 (new 'stack-no-clear 'matrix))) + (vector-reset! (-> s3-0 fvec)) + (set! (-> s3-0 fvec y) 1.0) + (the int (* 0.0000016276042 (total-distance s4-0))) + (while (< f30-0 0.8) + (displacement-between-points-at-percent-normalized! s4-0 (-> s3-0 uvec) f30-0) + (get-point-at-percent-along-path! s4-0 (-> s3-0 rvec) f30-0 'interp) + (vector-normalize! (-> s3-0 uvec) 1.0) + (quaternion-look-at! (the-as quaternion (-> s3-0 trans)) (-> s3-0 uvec) (-> s3-0 fvec)) + (let ((s2-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s2-0 object-type) (traffic-type guard-a)) + (set! (-> s2-0 behavior) (the-as uint 1)) + (set! (-> s2-0 id) (the-as uint 0)) + (set! (-> s2-0 nav-mesh) (-> this mesh)) + (set! (-> s2-0 nav-branch) #f) + (set! (-> s2-0 proc) #f) + (set! (-> s2-0 handle) (process->handle this)) + (set! (-> s2-0 user-data) (the-as uint s5-0)) + (set! (-> s2-0 flags) (traffic-spawn-flags tsf0)) + (set! (-> s2-0 guard-type) (the-as uint 11)) + (set! (-> s2-0 entity) #f) + (set! (-> s2-0 velocity quad) (-> s3-0 uvec quad)) + (set! (-> s2-0 position quad) (-> s3-0 rvec quad)) + (quaternion-copy! (-> s2-0 rotation) (the-as quaternion (-> s3-0 trans))) + (set! (-> s2-0 position w) f30-0) + (when (vehicle-spawn-hack barge s2-0 this) + ) + ) + (let ((f0-4 0.25)) + (if (and (!= s5-0 2) (not (-> *setting-control* user-current stop-boats?))) + (set! f0-4 (rand-vu)) + ) + (+! f30-0 (/ (* 4096.0 (+ 150.0 (* 150.0 f0-4))) (total-distance s4-0))) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 11 of type boat-manager +(defmethod init-from-entity! ((this boat-manager) (arg0 entity-actor)) + (set! (-> this mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) + (set! (-> this entity) arg0) + (set! (-> this boats-stop?) (-> *setting-control* user-current stop-boats?)) + (when (-> this mesh) + (dotimes (s5-1 4) + (set! (-> this paths s5-1) (new 'process 'curve-control this 'path (the float s5-1))) + ) + (boat-manager-method-16 this) + ) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-obs-h_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-obs-h_REF.gc new file mode 100644 index 0000000000..9c179fc3a5 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/ctywide-obs-h_REF.gc @@ -0,0 +1,79 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type city-race-ring-info +(deftype city-race-ring-info (structure) + ((pos vector :inline) + (angle float :overlay-at (-> pos data 3)) + (boost float) + (dist float) + ) + (:methods + (gen-static-macro (_type_ object) none) + ) + ) + +;; definition for method 3 of type city-race-ring-info +(defmethod inspect ((this city-race-ring-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'city-race-ring-info) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tangle: ~f~%" (-> this pos w)) + (format #t "~1Tboost: ~f~%" (-> this boost)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (label cfg-4) + this + ) + +;; definition of type city-ambush-spot +(deftype city-ambush-spot (structure) + ((pos vector :inline) + (obj-type traffic-type) + ) + ) + +;; definition for method 3 of type city-ambush-spot +(defmethod inspect ((this city-ambush-spot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'city-ambush-spot) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tobj-type: ~D~%" (-> this obj-type)) + (label cfg-4) + this + ) + +;; definition of type city-ambush-info +(deftype city-ambush-info (structure) + ((count int16) + (array (inline-array city-ambush-spot)) + ) + (:methods + (init (_type_ traffic-object-spawn-params) none) + ) + ) + +;; definition for method 3 of type city-ambush-info +(defmethod inspect ((this city-ambush-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'city-ambush-info) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tarray: #x~X~%" (-> this array)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc new file mode 100644 index 0000000000..027fb81413 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc @@ -0,0 +1,3961 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type security-wall +(deftype security-wall (process-drawable) + ((root collide-shape :override) + (pass pickup-type) + (incoming-attack-id uint32) + (next-message-time time-frame) + (message int32) + (plane plane :inline) + (color vector :inline) + (target-pos vector :inline) + (flash float) + (touch-count int32) + (breach symbol) + ) + (:state-methods + idle-open + idle-close + ) + (:methods + (init-wall (_type_ vector vector float) vector) + (play-speech (_type_) none) + (security-wall-method-24 (_type_) none) + ) + ) + +;; definition for method 3 of type security-wall +(defmethod inspect ((this security-wall)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tpass: ~D~%" (-> this pass)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tnext-message-time: ~D~%" (-> this next-message-time)) + (format #t "~2Tmessage: ~D~%" (-> this message)) + (format #t "~2Tplane: #~%" (-> this plane)) + (format #t "~2Tcolor: #~%" (-> this color)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tflash: ~f~%" (-> this flash)) + (format #t "~2Ttouch-count: ~D~%" (-> this touch-count)) + (format #t "~2Tbreach: ~A~%" (-> this breach)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-security-wall security-wall security-wall-lod0-jg security-wall-idle-ja + ((security-wall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100.1) + ) + +;; definition for method 23 of type security-wall +;; WARN: Return type mismatch int vs none. +(defmethod play-speech ((this security-wall)) + (when (< (-> this next-message-time) (current-time)) + (set! (-> this next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) + (let ((v1-6 (rand-vu-int-count 15))) + (cond + ((zero? v1-6) + (case (-> this pass) + (((pickup-type pass-red)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + ) + (((pickup-type pass-green)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + ) + (((pickup-type pass-yellow)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + ) + (((pickup-type pass-blue)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + ) + ) + ) + ((= v1-6 1) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + ) + ((= v1-6 2) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + ) + ((= v1-6 3) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + ) + ((= v1-6 4) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + ) + ((= v1-6 5) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + ) + ((= v1-6 6) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + ) + ((= v1-6 7) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + ) + ((= v1-6 8) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + ) + ((= v1-6 9) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + ) + ((= v1-6 10) + (let ((v1-45 (rand-vu-int-count 3))) + (cond + ((zero? v1-45) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv035" -99.0 0) + ) + ((= v1-45 1) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv038" -99.0 0) + ) + ((= v1-45 2) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv058" -99.0 0) + ) + ) + ) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + ) + ((= v1-6 11) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (let ((v1-57 (rand-vu-int-count 3))) + (cond + ((zero? v1-57) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv035" -99.0 0) + ) + ((= v1-57 1) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv038" -99.0 0) + ) + ((= v1-57 2) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv058" -99.0 0) + ) + ) + ) + ) + ((= v1-6 12) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (case (-> this pass) + (((pickup-type pass-red)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + ) + (((pickup-type pass-green)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + ) + (((pickup-type pass-yellow)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + ) + (((pickup-type pass-blue)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + ) + ) + ) + ((= v1-6 13) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (case (-> this pass) + (((pickup-type pass-red)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + ) + (((pickup-type pass-green)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + ) + (((pickup-type pass-yellow)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + ) + (((pickup-type pass-blue)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + ) + ) + ) + ((= v1-6 14) + (case (-> this pass) + (((pickup-type pass-red)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + ) + (((pickup-type pass-green)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + ) + (((pickup-type pass-yellow)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + ) + (((pickup-type pass-blue)) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + ) + ) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + ) + ) + ) + (+! (-> this message) 1) + (when (>= (-> this message) 5) + (set! (-> this message) 0) + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 24 of type security-wall +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod security-wall-method-24 ((this security-wall)) + (let ((s4-0 *target*)) + (when s4-0 + (let* ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> s4-0 control trans))) + (f30-0 (+ 40960.0 (-> this root root-prim local-sphere w))) + (f1-1 f30-0) + ) + (when (< f0-0 (* f1-1 f1-1)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) + (set! (-> s5-0 0 quad) (-> s4-0 control trans quad)) + (when (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) (* f30-0 f30-0)) + (let ((f0-3 (vector4-dot (-> this target-pos) (the-as vector (-> this plane)))) + (f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> this plane)))) + ) + (if (and (< (fabs f1-7) 16384.0) + (< (fabs f0-3) 16384.0) + (or (and (< f0-3 0.0) (>= f1-7 0.0)) (and (< f1-7 0.0) (>= f0-3 0.0))) + ) + (set! (-> this breach) #t) + ) + ) + ) + (set! (-> this target-pos quad) (-> s5-0 0 quad)) + ) + (when (-> this breach) + (if (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'grenade)) + ) + ) + (set! (-> this breach) #f) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle-close (security-wall) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as object (-> self root backup-collide-with)))) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 + ) + ) + ) + (('off) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (('attack) + (let ((v1-5 (the-as attack-info (-> block param 1)))) + (when (!= (-> v1-5 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> v1-5 id)) + (let* ((s5-0 proc) + (s3-0 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (when s3-0 + (let ((s5-1 (process-spawn + manipy + :init manipy-init + (-> (the-as process-drawable s3-0) root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when s5-1 + (send-event (ppointer->process s5-1) 'anim-mode 'play1) + (send-event (ppointer->process s5-1) 'speed 1.5) + (send-event (ppointer->process s5-1) 'art-joint-anim "generic-ripples-idle" 0) + (set-vector! (-> (the-as process-drawable (-> s5-1 0)) root scale) 1.0 1.0 1.0 1.0) + (quaternion-rotate-local-x! (-> (the-as process-drawable (-> s5-1 0)) root quat) (-> self root quat) -16384.0) + (let ((v1-43 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-29 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-11 *up-vector*)) + (let ((a2-7 8192.0)) + (.mov vf7 a2-7) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-29 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 (&-> v1-43 quad) vf6) + ) + (let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> s5-1 0)) root trans) (the-as vector (-> self plane))))) + (let ((v1-50 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-33 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-12 (-> self plane))) + (let ((a2-8 (- f0-6))) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-12 quad)) + ) + (.lvf vf4 (&-> a0-33 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 (&-> v1-50 quad) vf6) + ) + (let ((v1-53 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-36 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-13 (-> self plane))) + (let ((a2-10 (the-as float (if (< 0.0 f0-6) + -2048.0 + 2048.0 + ) + ) + ) + ) + (.mov vf7 a2-10) + ) + (.lvf vf5 (&-> a1-13 quad)) + ) + (.lvf vf4 (&-> a0-36 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 (&-> v1-53 quad) vf6) + ) + ) + (send-event (ppointer->process s5-1) 'trans-hook (lambda () #f)) + ) + ) + ) + ) + (when (zero? (-> self touch-count)) + (+! (-> self touch-count) 1) + (set! (-> self flash) 0.375) + ) + (+! (-> self touch-count) 1) + (if (and (logtest? (-> proc mask) (process-mask target)) + (not (logtest? (process-mask projectile) (-> proc mask))) + ) + (play-speech self) + ) + ) + ) + ) + (('touched) + (when (zero? (-> self touch-count)) + (+! (-> self touch-count) 1) + (set! (-> self flash) 0.375) + ) + (+! (-> self touch-count) 1) + (let ((v1-81 (if (type? proc process-focusable) + proc + ) + ) + ) + (when v1-81 + (let* ((gp-1 (-> (the-as process-drawable v1-81) root)) + (a0-45 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (if (and a0-45 (logtest? (-> (the-as collide-shape a0-45) root-prim prim-core collide-as) (collide-spec jak))) + (play-speech self) + ) + ) + ) + ) + ) + ) + ) + ) + :trans (behavior () + (security-wall-method-24 self) + ) + :code (behavior () + (until #f + (when (and (logtest? (game-feature feature35) (-> *game-info* features)) + (= (pickup-type pass-slumb-genb) (-> self pass)) + ) + (go-virtual idle-open) + #t + (b! #t cfg-9 :delay (nop!)) + (the-as none 0) + ) + (let ((f30-0 (calc-fade-from-fog (-> self root trans))) + (a0-4 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-4 (-> self color) f30-0) + (set-security-color! a0-4) + (vector-float*! gp-0 (-> self color) (* f30-0 (-> self flash))) + (seek! (-> self flash) 0.0 (seconds-per-frame)) + (if (nonzero? (-> self touch-count)) + (+! (-> self touch-count) -1) + ) + (set-security-flash! gp-0) + ) + (suspend) + ) + #f + (label cfg-9) + ) + ) + +;; failed to figure out what this is: +(defstate idle-open (security-wall) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as int (-> self root backup-collide-with)))) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 + ) + ) + ) + (('off) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :trans (behavior () + (let* ((f28-0 (vector4-dot (the-as vector (-> self plane)) (target-pos 0))) + (f30-0 (calc-fade-from-fog (-> self root trans))) + (f28-1 (lerp-scale 0.0 1.0 (fabs f28-0) 163840.0 327680.0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (when (= f28-1 0.0) + (cleanup-for-death self) + (deactivate self) + ) + (let ((f0-3 (* f30-0 f28-1))) + (vector-float*! gp-1 (-> self color) f0-3) + ) + (set! (-> gp-1 w) 1.0) + (set-security-color! gp-1) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + ) + +;; definition for method 22 of type security-wall +;; INFO: Used lq/sq +(defmethod init-wall ((this security-wall) (arg0 vector) (arg1 vector) (arg2 float)) + 0.0 + (* 0.5 (vector-vector-distance arg0 arg1)) + (let ((s2-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-3 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle blocking-plane camera-blocker)) + (set! (-> v1-3 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-3 prim-core action) (collide-action solid)) + (set! (-> v1-3 transform-index) 3) + (set! (-> s2-0 total-prims) (the-as uint 1)) + (set! (-> s2-0 root-prim) v1-3) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-6 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-6 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-6 prim-core collide-with)) + ) + (set! (-> this root) s2-0) + ) + (let ((s2-1 (new 'stack-no-clear 'matrix)) + (s1-0 (-> this root)) + ) + (vector+! (-> s1-0 trans) arg0 arg1) + (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) + (+! (-> s1-0 trans y) (* 0.5 arg2)) + (vector-! (-> s2-1 rvec) arg1 arg0) + (let ((f30-1 (vector-normalize-ret-len! (-> s2-1 rvec) 1.0))) + (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) + (set! (-> s1-0 scale y) (* 0.00024414062 arg2)) + (set! (-> s1-0 scale z) 1.0) + (set! (-> s2-1 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-cross! (-> s2-1 fvec) (-> s2-1 rvec) (-> s2-1 uvec)) + (vector-normalize! (-> s2-1 fvec) 1.0) + (matrix->quaternion (-> s1-0 quat) s2-1) + (set! (-> this plane quad) (-> s2-1 fvec quad)) + (set! (-> this plane w) (- (vector-dot (-> s2-1 fvec) (-> this root trans)))) + (let ((v0-6 (-> this root root-prim local-sphere))) + (set! (-> v0-6 x) 0.0) + (set! (-> v0-6 y) (* 0.00024414062 (* 0.5 arg2))) + (set! (-> v0-6 z) 0.0) + (let ((f0-20 0.5) + (f1-7 (* f30-1 f30-1)) + (f2-2 arg2) + ) + (set! (-> v0-6 w) (* f0-20 (sqrtf (+ f1-7 (* f2-2 f2-2))))) + ) + v0-6 + ) + ) + ) + ) + +;; definition for method 11 of type security-wall +(defmethod init-from-entity! ((this security-wall) (arg0 entity-actor)) + (ctywide-entity-hack) + (set! (-> this breach) #f) + (set! (-> this pass) (res-lump-value arg0 'pickup-type pickup-type :time -1000000000.0)) + (let ((v1-3 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))) + (set! (-> this path) v1-3) + (if (or (not v1-3) (!= (-> v1-3 curve num-cverts) 2)) + (go process-drawable-art-error "bad path") + ) + ) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (get-point-in-path! (-> this path) s5-1 0.0 'exact) + (get-point-in-path! (-> this path) s4-0 1.0 'exact) + (init-wall this s5-1 s4-0 122880.0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-security-wall" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this root event-self) 'touched) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set-security-texture-masks! (the-as vector (-> this draw mgeo header texture-usage-group data 4))) + (set-vector! (-> this color) 1.0 1.0 1.0 1.0) + (cond + ((= (-> this pass) (pickup-type pass-red)) + (set-vector! (-> this color) 1.0 0.0 0.0 1.0) + ) + ((= (-> this pass) (pickup-type pass-yellow)) + (set-vector! (-> this color) 1.0 1.0 0.0 1.0) + ) + ((= (-> this pass) (pickup-type pass-green)) + (set-vector! (-> this color) 0.0 1.0 0.0 1.0) + ) + ((= (-> this pass) (pickup-type pass-blue)) + (set-vector! (-> this color) 0.0 0.0 1.0 1.0) + ) + ) + (set-security-color! (-> this color)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> this draw color-emissive) 1.0 1.0 1.0 1.0) + (transform-post) + (cond + ((logtest? (game-feature feature35) (-> *game-info* features)) + (= (pickup-type pass-slumb-genb) (-> this pass)) + (go (method-of-object this idle-open)) + ) + (else + (go (method-of-object this idle-close)) + ) + ) + ) + +;; definition of type security-wall-child +(deftype security-wall-child (security-wall) + ((hidden? symbol) + ) + (:state-methods + hide-wall + ) + ) + +;; definition for method 3 of type security-wall-child +(defmethod inspect ((this security-wall-child)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type security-wall inspect))) + (t9-0 this) + ) + (format #t "~2Thidden?: ~A~%" (-> this hidden?)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle-close (security-wall-child) + :virtual #t + :code (behavior () + (until #f + (let ((f30-0 (calc-fade-from-fog (-> self root trans))) + (a0-1 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-1 (-> self color) f30-0) + (set-security-color! a0-1) + (vector-float*! gp-0 (-> self color) (* f30-0 (-> self flash))) + (seek! (-> self flash) 0.0 (seconds-per-frame)) + (if (nonzero? (-> self touch-count)) + (+! (-> self touch-count) -1) + ) + (set-security-flash! gp-0) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate hide-wall (security-wall-child) + :virtual #t + :parent (security-wall-child idle-close) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + #f + ) + (else + ((-> (method-of-type security-wall-child idle-close) event) proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (ja-post) + ) + :code sleep-code + ) + +;; definition for function security-wall-child-init-by-other +(defbehavior security-wall-child-init-by-other security-wall-child ((arg0 vector) (arg1 vector) (arg2 float) (arg3 symbol)) + (ctywide-entity-hack) + (set! (-> self breach) #f) + (set! (-> self hidden?) arg3) + (init-wall self arg0 arg1 arg2) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-security-wall" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root event-self) 'touched) + (logior! (-> self draw status) (draw-control-status disable-fog)) + (set-security-texture-masks! (the-as vector (-> self draw mgeo header texture-usage-group data 4))) + (set-vector! (-> self color) 1.0 1.0 1.0 1.0) + (set-vector! (-> self color) 1.0 0.0 0.0 1.0) + (set-security-color! (-> self color)) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) + (transform-post) + (if (-> self hidden?) + (go-virtual hide-wall) + (go-virtual idle-close) + ) + ) + +;; definition for function spawn-security-wall +;; WARN: Return type mismatch int vs handle. +(defun spawn-security-wall ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float) (arg4 symbol)) + (the-as handle (ppointer->handle + (process-spawn security-wall-child arg1 arg2 arg3 arg4 :name "security-wall-child" :to arg0) + ) + ) + ) + +;; definition of type parking-spot +(deftype parking-spot (process-drawable) + ((vehicle handle) + (spawned symbol) + (minimap connection-minimap) + (test-sphere sphere :inline) + (expire-time time-frame) + (last-update-time time-frame) + ) + (:state-methods + idle + ) + (:methods + (parking-spot-method-21 (_type_) none) + (parking-spot-method-22 (_type_) none) + (parking-spot-method-23 (_type_ traffic-type) none) + (parking-spot-method-24 (_type_) none) + (parking-spot-method-25 (_type_ symbol) symbol) + (parking-spot-method-26 (_type_) symbol) + ) + ) + +;; definition for method 3 of type parking-spot +(defmethod inspect ((this parking-spot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tvehicle: ~D~%" (-> this vehicle)) + (format #t "~2Tspawned: ~A~%" (-> this spawned)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Ttest-sphere: #~%" (-> this test-sphere)) + (format #t "~2Texpire-time: ~D~%" (-> this expire-time)) + (format #t "~2Tlast-update-time: ~D~%" (-> this last-update-time)) + (label cfg-4) + this + ) + +;; definition for method 25 of type parking-spot +;; WARN: disable def twice: 36. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod parking-spot-method-25 ((this parking-spot) (arg0 symbol)) + (local-vars (f30-0 float)) + (and (not (-> *setting-control* user-current disable-parking-spots?)) + (begin + (set! f30-0 (vector-vector-distance (-> this root trans) (math-camera-pos))) + (or (< 163840.0 f30-0) arg0) + ) + (if (sphere-in-view-frustum? (-> this test-sphere)) + (and (or arg0 (< 614400.0 f30-0)) (< f30-0 1024000.0)) + (< f30-0 614400.0) + ) + ) + ) + +;; definition for method 26 of type parking-spot +(defmethod parking-spot-method-26 ((this parking-spot)) + (let ((f30-0 (vector-vector-distance (-> this root trans) (math-camera-pos)))) + (or (< f30-0 163840.0) (and (sphere-in-view-frustum? (-> this test-sphere)) (< f30-0 614400.0))) + ) + ) + +;; definition for method 24 of type parking-spot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod parking-spot-method-24 ((this parking-spot)) + (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) + (set! (-> gp-0 vec0 quad) (-> this root trans quad)) + (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-reset! (-> gp-0 vec1)) + (set! (-> gp-0 vec1 y) 1.0) + (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-5 (-> gp-0 cquery))) + (set! (-> v1-5 radius) 1024.0) + (set! (-> v1-5 collide-with) (collide-spec backgnd)) + (set! (-> v1-5 ignore-process0) #f) + (set! (-> v1-5 ignore-process1) #f) + (set! (-> v1-5 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-5 action-mask) (collide-action solid)) + ) + (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) + (when (>= f30-0 0.0) + (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) + (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (format #t "parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) + ) + (if (< f30-0 0.0) + (format #t "parking-spot::find-ground: could not find ground~%") + ) + ) + (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) + ) + 0 + (none) + ) + +;; definition for method 21 of type parking-spot +;; WARN: Return type mismatch int vs none. +(defmethod parking-spot-method-21 ((this parking-spot)) + (with-pp + (let ((s5-0 (the-as vehicle (handle->process (-> this vehicle))))) + (cond + (s5-0 + (cond + ((or (-> *setting-control* user-current disable-parking-spots?) + (focus-test? s5-0 dead inactive) + (not (logtest? (vehicle-flag waiting-for-player) (-> s5-0 v-flags))) + (let ((f0-0 (-> this test-sphere r))) + (< (* f0-0 f0-0) (vector-vector-distance-squared (-> s5-0 root trans) (-> this test-sphere))) + ) + ) + (logclear! (-> s5-0 v-flags) (vehicle-flag persistent)) + (cond + ((-> *setting-control* user-current disable-parking-spots?) + (when (or (< (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) + (>= (-> *setting-control* user-current bg-a) 1.0) + (>= (-> *setting-control* user-current bg-a-force) 1.0) + (let ((f0-5 (-> this test-sphere r))) + (and (>= (* f0-5 f0-5) (vector-vector-distance-squared (-> s5-0 root trans) (-> this test-sphere))) + (not (sphere-in-view-frustum? (-> this test-sphere))) + ) + ) + ) + (send-event (handle->process (-> this vehicle)) 'traffic-off-force) + (set! (-> this vehicle) (the-as handle #f)) + ) + ) + (else + (set! (-> this vehicle) (the-as handle #f)) + ) + ) + ) + (else + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 11) (the-as int #f) (the-as vector #t) 0)) + ) + (cond + ((parking-spot-method-26 this) + (logior! (-> s5-0 v-flags) (vehicle-flag persistent)) + (+! (-> this expire-time) (- (current-time) (-> pp clock old-frame-counter))) + ) + (else + ) + ) + (when (< (-> this expire-time) (current-time)) + (logclear! (-> s5-0 v-flags) (vehicle-flag persistent)) + (set! (-> this vehicle) (the-as handle #f)) + ) + ) + ) + ) + (else + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this spawned) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function parking-spot-spawn +;; WARN: Return type mismatch object vs vehicle. +(defun parking-spot-spawn ((arg0 traffic-object-spawn-params)) + (set! (-> arg0 proc) #f) + (the-as vehicle (cond + ((= (-> arg0 object-type) (traffic-type bike-d)) + (let ((v0-0 (the-as object (vehicle-spawn (vehicle-type h-bike-d) arg0)))) + (if (the-as process-drawable v0-0) + (logior! (-> (the-as vehicle v0-0) v-flags) (vehicle-flag traffic-managed)) + ) + (set! (-> arg0 proc) (the-as vehicle v0-0)) + v0-0 + ) + ) + (else + (send-event *traffic-manager* 'activate-object arg0) + ) + ) + ) + ) + +;; definition for method 23 of type parking-spot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod parking-spot-method-23 ((this parking-spot) (arg0 traffic-type)) + (let ((v1-0 (new 'stack-no-clear 'cquery-with-vec))) + (let* ((a0-1 (new 'stack-no-clear 'inline-array 'vector 1)) + (a1-2 (the-as uint #xa01013fd)) + (a2-1 (logand -2 a1-2)) + ) + (set! (-> a0-1 0 quad) (-> this test-sphere quad)) + (let ((a1-4 (-> v1-0 cquery))) + (set! (-> a1-4 best-dist) (the-as float a0-1)) + (set! (-> a1-4 best-other-prim) (the-as collide-shape-prim 1)) + (set! (-> a1-4 collide-with) (the-as collide-spec a2-1)) + (set! (-> a1-4 ignore-process0) #f) + (set! (-> a1-4 ignore-process1) #f) + (set! (-> a1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a1-4 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> a1-4 action-mask) (collide-action solid)) + ) + ) + 0 + (when (not (fill-and-probe-using-spheres *collide-cache* (-> v1-0 cquery))) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 position quad) (-> this root trans quad)) + (mem-copy! (the-as pointer (-> s4-0 rotation)) (the-as pointer (-> this root quat)) 16) + (+! (-> s4-0 position y) 14336.0) + (set! (-> s4-0 behavior) (the-as uint 0)) + (set! (-> s4-0 object-type) arg0) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 proc) #f) + (parking-spot-spawn s4-0) + (when (-> s4-0 proc) + (let ((v1-9 (-> s4-0 proc))) + (if v1-9 + (logior! (-> (the-as vehicle v1-9) v-flags) (vehicle-flag persistent)) + ) + ) + (set! (-> this expire-time) (+ (current-time) (seconds 10))) + (set! (-> this vehicle) (process->handle (-> s4-0 proc))) + (set! (-> this spawned) #t) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type parking-spot +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this parking-spot) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this minimap) #f) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this spawned) #f) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) + (if (!= f0-0 0.0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) + ) + ) + (parking-spot-method-24 this) + (set! (-> this test-sphere quad) (-> this root trans quad)) + (set! (-> this test-sphere r) 24576.0) + (set-time! (-> this state-time)) + (when (parking-spot-method-25 this #t) + (let ((s4-0 29)) + (if (nonzero? (res-lump-value arg0 'use-special-bike uint128 :time -1000000000.0)) + (set! s4-0 28) + ) + (if (= s4-0 29) + (set! s4-0 (the-as int (get-random-parking-spot-type *traffic-engine*))) + ) + (if (!= s4-0 29) + (parking-spot-method-23 this (the-as traffic-type s4-0)) + ) + ) + ) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defstate idle (parking-spot) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (parking-spot-method-21 self) + (send-event (handle->process (-> self vehicle)) 'traffic-off-force) + ) + :code sleep-code + :post (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.25)) + (parking-spot-method-21 self) + (when (time-elapsed? (-> self last-update-time) (seconds 0.2)) + (set-time! (-> self last-update-time)) + (when (and (not (-> self spawned)) (parking-spot-method-25 self #f)) + (let ((a1-1 (get-random-parking-spot-type *traffic-engine*))) + (if (!= a1-1 (traffic-type max)) + (parking-spot-method-23 self a1-1) + ) + ) + ) + ) + 0 + ) + ) + ) + +;; definition of type propa +(deftype propa (process-focusable) + ((sound-id sound-id) + (sound-index uint32) + (handle handle) + (y-rot float) + (hit-points int32) + (incoming-attack-id uint32) + ) + (:state-methods + idle + broken + ) + (:methods + (propa-method-30 (_type_) none) + (propa-method-31 (_type_) none) + (propa-method-32 (_type_ vector) none) + ) + ) + +;; definition for method 3 of type propa +(defmethod inspect ((this propa)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tsound-index: ~D~%" (-> this sound-index)) + (format #t "~2Thandle: ~D~%" (-> this handle)) + (format #t "~2Ty-rot: ~f~%" (-> this y-rot)) + (format #t "~2Thit-points: ~D~%" (-> this hit-points)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-propa propa 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 3)) + +;; definition for symbol *propa-sounds*, type (array string) +(define *propa-sounds* (new 'static 'boxed-array :type string + "prop009" + "prop010" + "prop011" + "prop012" + "prop013" + "prop014" + "prop015" + "prop016" + "prop017" + "prop018" + "prop019" + "prop020" + "prop021" + "prop022" + "prop023" + "prop024" + "prop025" + "prop026" + "prop028" + "prop027" + "prop029" + "prop030" + "prop031" + "prop032" + "prop033" + "prop034" + "prop035" + "prop036" + "prop037" + "prop038" + "prop039" + "prop040" + "prop041" + "prop042" + "prop043" + "prop008" + "prop006" + "prop005" + "prop004" + "prop002" + "prop003" + "bar001" + "prop044" + "prop045" + "prop046" + "prop047" + "prop048" + "prop049" + "prop051" + "prop052" + "prop053" + "prop054" + "prop055" + "prop056" + ) + ) + +;; definition for symbol *propa-sounds-class-3*, type (array string) +(define *propa-sounds-class-3* (new 'static 'boxed-array :type string "cityv177")) + +;; definition for symbol *propa-sounds-class-2*, type (array string) +(define *propa-sounds-class-2* (new 'static 'boxed-array :type string "cityv176")) + +;; definition for symbol *propa-sounds-class-1*, type (array string) +(define *propa-sounds-class-1* (new 'static 'boxed-array :type string "prop050" "spot004" "cityv175")) + +;; definition for symbol *propa-sounds-metalheads*, type (array string) +(define *propa-sounds-metalheads* (new 'static 'boxed-array :type string + "prop007" + "prop057" + "cityv096" + "cityv097" + "cityv098" + "cityv099" + "cityv142" + "cityv143" + ) + ) + +;; definition for symbol *propa-sounds-baron-construction*, type (array string) +(define *propa-sounds-baron-construction* (new 'static 'boxed-array :type string "prop058")) + +;; definition for function propa-pu->knocked-type +;; WARN: Return type mismatch int vs knocked-type. +(defun propa-pu->knocked-type ((arg0 penetrate)) + (the-as knocked-type (cond + ((logtest? arg0 (penetrate vehicle)) + 7 + ) + ((logtest? (penetrate jak-blue-shot) arg0) + 6 + ) + ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) + 4 + ) + ((logtest? (penetrate jak-red-shot) arg0) + 5 + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + 2 + ) + ((logtest? (penetrate dark-bomb dark-smack) arg0) + 3 + ) + ((logtest? arg0 (penetrate mech-punch)) + 1 + ) + (else + 0 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate broken (propa) + :virtual #t + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate idle (propa) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case message + (('attack) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (let ((v1-2 (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info v1-2) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-2) id)) + (let ((s5-1 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) + (if (and (not (logtest? (penetrate dark-skin) s5-1)) (zero? (propa-pu->knocked-type s5-1))) + (set! (-> self hit-points) (- (-> self hit-points) (the int (penetrate-using->damage s5-1)))) + (+! (-> self hit-points) -10) + ) + ) + (cond + ((< (-> self hit-points) 3) + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 1 0) + (let* ((a0-9 (the-as collide-shape-prim-group (-> self root root-prim))) + (v1-18 (-> a0-9 child 0)) + ) + (let ((a0-11 (-> a0-9 child 1))) + (set! (-> a0-11 prim-core collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> a0-11 prim-core collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) + ) + 0 + (cond + ((logtest? (-> *part-group-id-table* 224 flags) (sp-group-flag sp13)) + (let ((v1-25 (-> *launch-matrix* trans)) + (a0-12 (new 'stack-no-clear 'vector)) + ) + (let ((a1-9 (-> self root trans))) + (let ((a2-3 *up-vector*)) + (let ((a3-2 8192.0)) + (.mov vf7 a3-2) + ) + (.lvf vf5 (&-> a2-3 quad)) + ) + (.lvf vf4 (&-> a1-9 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 (&-> a0-12 quad) vf6) + (set! (-> v1-25 quad) (-> a0-12 quad)) + ) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 224)) + ) + (else + (let ((v1-40 (-> *launch-matrix* trans)) + (a0-17 (new 'stack-no-clear 'vector)) + ) + (let ((a1-14 (-> self root trans))) + (let ((a2-9 *up-vector*)) + (let ((a3-6 8192.0)) + (.mov vf7 a3-6) + ) + (.lvf vf5 (&-> a2-9 quad)) + ) + (.lvf vf4 (&-> a1-14 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 (&-> a0-17 quad) vf6) + (set! (-> v1-40 quad) (-> a0-17 quad)) + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 224)) + ) + ) + (go-virtual broken) + ) + ((< (-> self hit-points) 6) + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 2 0) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (behavior () + (when (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + ) + :code sleep-code + :post (behavior () + (cond + ((or (not (-> *setting-control* user-current speech-control)) + (< 245760.0 (vector-vector-distance (camera-pos) (-> self root trans))) + ) + (when (nonzero? (-> self sound-id)) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + (+! (-> self sound-index) 1) + (when (>= (-> self sound-index) (the-as uint (-> *propa-sounds* length))) + (set! (-> self sound-index) (the-as uint 0)) + 0 + ) + ) + ) + ((< (vector-vector-distance (camera-pos) (-> self root trans)) 225280.0) + (cond + ((zero? (-> self sound-id)) + (set! (-> self sound-id) (add-process + *gui-control* + self + (gui-channel alert) + (gui-action play) + (-> *propa-sounds* (-> self sound-index)) + -99.0 + 0 + ) + ) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> self root trans quad)) + (set! (-> a1-4 w) 40960.0) + (propa-method-32 self a1-4) + ) + ) + (else + (when *sound-player-enable* + (let ((gp-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-2 command) (sound-command set-param)) + (set! (-> gp-2 id) (-> self sound-id)) + (set! (-> gp-2 params fo-min) 40) + (set! (-> gp-2 params fo-max) 55) + (set! (-> gp-2 params fo-curve) 2) + (let ((a1-5 (-> self root trans))) + (let ((s5-0 self)) + (when (= a1-5 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 root))) + (set! a1-5 (-> s5-0 root trans)) + (set! a1-5 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> gp-2 params trans) a1-5) + ) + (set! (-> gp-2 params mask) (the-as uint 480)) + (-> gp-2 id) + ) + ) + (when (= (get-status *gui-control* (-> self sound-id)) (gui-status unknown)) + (set! (-> self sound-id) (new 'static 'sound-id)) + (+! (-> self sound-index) 1) + (when (>= (-> self sound-index) (the-as uint (-> *propa-sounds* length))) + (set! (-> self sound-index) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + ) + (let ((s5-1 (matrix->trans (-> self node-list data 3 bone transform) (new 'stack-no-clear 'vector))) + (s4-0 (new 'stack-no-clear 'vector)) + (gp-3 (new 'stack-no-clear 'matrix)) + ) + (when (and (nonzero? (-> self handle)) (handle->process (-> self handle))) + (let* ((s3-0 (handle->process (-> self handle))) + (a0-25 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when a0-25 + (vector-! s4-0 (-> (the-as process-focusable a0-25) root trans) (-> self root trans)) + (set! (-> self y-rot) (deg-seek + (-> self y-rot) + (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> self root quat))) + (* 36408.89 (seconds-per-frame)) + ) + ) + ) + ) + ) + (matrix-rotate-y! gp-3 (-> self y-rot)) + (matrix<-trans gp-3 s5-1) + (spawn-from-mat (-> self part) gp-3) + ) + ) + ) + +;; definition for method 32 of type propa +;; WARN: Return type mismatch int vs none. +(defmethod propa-method-32 ((this propa) (arg0 vector)) + (let ((s5-0 (the-as process-drawable #f))) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (countdown (s2-0 (fill-actor-list-for-box *actor-hash* arg0 s3-0 64)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-3 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-3 + (let* ((s0-0 (-> a0-3 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (!= this s1-1) + (not (focus-test? (the-as process-focusable s1-1) inactive)) + (not (focus-test? (the-as process-focusable s1-1) disable)) + (not (focus-test? (the-as process-focusable s1-1) dead)) + (not (logtest? (process-mask guard) (-> s1-1 mask))) + (not (logtest? (process-mask crate) (-> s1-1 mask))) + (not (logtest? (process-mask vehicle) (-> s1-1 mask))) + ) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) + (when (or (not s5-0) (< f0-0 f30-0)) + (set! s5-0 s1-1) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + ) + ) + (if (and *target* (< (vector-vector-distance (target-pos 0) arg0) (-> arg0 w))) + (set! s5-0 *target*) + ) + (if s5-0 + (set! (-> this handle) (process->handle s5-0)) + (set! (-> this handle) (the-as handle #f)) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type propa +;; WARN: Return type mismatch int vs none. +(defmethod propa-method-30 ((this propa)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-12 prim-core action) (collide-action solid rideable)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-14 prim-core action) (collide-action solid rideable)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 31 of type propa +;; WARN: Return type mismatch int vs none. +(defmethod propa-method-31 ((this propa)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 259) this)) + 0 + (none) + ) + +;; definition for method 11 of type propa +(defmethod init-from-entity! ((this propa) (arg0 entity-actor)) + (propa-method-30 this) + (process-drawable-from-entity! this arg0) + (ctywide-entity-hack) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-propa" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (propa-method-31 this) + (set! (-> this sound-index) (the-as uint (rand-vu-int-count (-> *propa-sounds* length)))) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 4 0) + (set! (-> this hit-points) 10) + (transform-post) + (go (method-of-object this idle)) + ) + +;; definition of type burning-bush +(deftype burning-bush (process-focusable) + ((task game-task-control) + (part-off sparticle-launch-control) + (part-alert sparticle-launch-control) + (angle float) + (time float) + (rotmin float) + (rotmax float) + (bb-perm entity-perm) + ) + (:state-methods + idle + talking + menu + collect-gems + ) + (:methods + (burning-bush-method-32 (_type_) none) + (burning-bush-method-33 (_type_) none) + (burning-bush-method-34 (_type_) object) + ) + ) + +;; definition for method 3 of type burning-bush +(defmethod inspect ((this burning-bush)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Ttask: ~A~%" (-> this task)) + (format #t "~2Tpart-off: ~A~%" (-> this part-off)) + (format #t "~2Tpart-alert: ~A~%" (-> this part-alert)) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Ttime: ~f~%" (-> this time)) + (format #t "~2Trotmin: ~f~%" (-> this rotmin)) + (format #t "~2Trotmax: ~f~%" (-> this rotmax)) + (format #t "~2Tbb-perm: #~%" (-> this bb-perm)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate collect-gems (burning-bush) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (process-release? *target*) + ) + :code (behavior () + (until (process-grab? *target* #f) + (suspend) + ) + (suspend) + (let ((gp-0 (-> (get-current-task-event (-> self task)) tex))) + (format 0 "skull-cost: ~d~%" gp-0) + (set! (-> *target* game gem) (- (-> *target* game gem) (the float gp-0))) + (until (time-elapsed? (-> self state-time) (* 45 (the-as int gp-0))) + (suspend) + ) + ) + (go-virtual talking) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-burning-bush burning-bush burning-bush-lod0-jg burning-bush-idle-ja + ((burning-bush-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 3.5) + ) + +;; failed to figure out what this is: +(defstate idle (burning-bush) + :virtual #t + :exit (behavior () + '() + ) + :trans (behavior () + (let ((gp-0 (get-current-task-event (-> self task)))) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (-> self node-list data 3 bone transform)) + (v1-4 (-> a2-0 rvec quad)) + (a0-1 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 rvec quad) v1-4) + (set! (-> s5-0 uvec quad) a0-1) + (set! (-> s5-0 fvec quad) a1-0) + (set! (-> s5-0 trans quad) a2-1) + ) + (when (< (vector-dot + (-> s5-0 fvec) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans s5-0 (new 'stack-no-clear 'vector))) + ) + 0.0 + ) + ) + (let ((v1-11 (-> self entity extra perm))) + (logior! (-> v1-11 status) (entity-perm-status bit-5)) + (set! (-> self bb-perm) v1-11) + (logior! (-> v1-11 status) (entity-perm-status bit-14)) + ) + (cond + ((= (-> self bb-perm user-object 0) 1) + (if (nonzero? (-> gp-0 action)) + (spawn-from-mat (-> self part) s5-0) + ) + ) + ((= (-> gp-0 action) (game-task-action show)) + (spawn-from-mat (-> self part-off) s5-0) + ) + ((= (-> gp-0 action) (game-task-action play)) + (spawn-from-mat (-> self part-off) s5-0) + ) + ((= (-> gp-0 action) (game-task-action menu)) + (spawn-from-mat (-> self part) s5-0) + ) + (else + ) + ) + ) + (cond + ((and (or (= (-> gp-0 action) (game-task-action show)) (= (-> gp-0 action) (game-task-action menu))) + (and (burning-bush-method-34 self) (can-display-query? self (the-as string #f) -99.0)) + ) + (let ((s4-2 + (new 'stack 'font-context *font-default-matrix* 32 300 0.0 (font-color default) (font-flags shadow kerning)) + ) + (s5-1 (-> gp-0 tex)) + ) + (set! (-> s4-2 flags) (font-flags shadow kerning large)) + (let ((v1-36 s4-2)) + (set! (-> v1-36 width) (the float 340)) + ) + (let ((v1-37 s4-2)) + (set! (-> v1-37 height) (the float 80)) + ) + (let ((v1-38 s4-2)) + (set! (-> v1-38 scale) 0.6) + ) + (let ((v1-41 (-> self entity extra perm))) + (logior! (-> v1-41 status) (entity-perm-status bit-5)) + (set! (-> self bb-perm) v1-41) + (logior! (-> v1-41 status) (entity-perm-status bit-14)) + ) + (cond + ((zero? (-> self bb-perm user-object 0)) + (let ((s3-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-061d) #f) s5-1) + (s3-1 *temp-string* s4-2 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (logior! (-> *hud-skullgem* 0 flags) (hud-flags show)) + ) + (else + (let ((s3-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id press-triangle-to-talk) #f)) + (s3-2 *temp-string* s4-2 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (cond + ((= (-> gp-0 action) (game-task-action menu)) + (go-virtual menu) + ) + ((and (zero? (-> self bb-perm user-object 0)) + (or (= s5-1 (the int (-> *target* game gem))) + (< (the-as uint s5-1) (the-as uint (the int (-> *target* game gem)))) + ) + ) + (set! (-> self bb-perm user-object 0) 1) + (go-virtual collect-gems) + ) + ((= (-> self bb-perm user-object 0) 1) + (go-virtual talking) + ) + (else + (sound-play "skull-negative") + ) + ) + ) + ) + ) + (else + (if *hud-skullgem* + (logclear! (-> *hud-skullgem* 0 flags) (hud-flags show)) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-4 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 20480.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate talking (burning-bush) + :virtual #t + :enter (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self time) -1.0) + (process-entity-status! self (entity-perm-status no-kill) #t) + ) + :exit (behavior () + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (remove-setting! 'minimap) + (set! (-> *part-id-table* 1180 init-specs 4 initial-valuef) 14336.0) + (set! (-> *part-id-table* 1181 init-specs 4 initial-valuef) 16384.0) + (send-event *camera* 'change-target *target*) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (local-vars + (sv-272 vector) + (sv-288 quaternion) + (sv-304 (function float float float float float float)) + (sv-320 float) + (sv-336 float) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (!= (-> self time) -1.0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s5-0 gp-0) + (s4-0 (-> self root trans)) + (s3-0 vector-orient-by-quat!) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'static 'vector :y 16384.0 :z 40960.0 :w 1.0)) + (s0-0 quaternion-rotate-local-y!) + ) + (set! sv-272 (new 'stack-no-clear 'vector)) + (set! sv-288 (-> self root quat)) + (set! sv-304 lerp-scale) + (set! sv-320 (-> self rotmin)) + (set! sv-336 (-> self rotmax)) + (let* ((a2-0 (sin (* 7281.778 (-> self time)))) + (a3-0 -1.0) + (t0-0 1.0) + (a2-1 (sv-304 sv-320 sv-336 a2-0 a3-0 t0-0)) + ) + (vector+! s5-0 s4-0 (s3-0 s2-0 s1-0 (s0-0 (the-as quaternion sv-272) sv-288 a2-1))) + ) + ) + (set! (-> *camera* slave 0 trans quad) (-> gp-0 quad)) + (let ((t9-4 forward-down->inv-matrix) + (a0-6 (-> *camera* slave 0 tracking)) + (a1-3 (new 'stack-no-clear 'vector)) + (v1-18 (new 'stack-no-clear 'vector)) + ) + (let ((a2-4 (-> self root trans))) + (let ((a3-1 *up-vector*)) + (let ((t0-2 20480.0)) + (.mov vf7 t0-2) + ) + (.lvf vf5 (&-> a3-1 quad)) + ) + (.lvf vf4 (&-> a2-4 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 (&-> v1-18 quad) vf6) + (t9-4 (the-as matrix a0-6) (vector-! a1-3 v1-18 gp-0) (-> *camera* local-down)) + ) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'matrix))) + (let* ((a2-6 (-> self node-list data 3 bone transform)) + (v1-23 (-> a2-6 rvec quad)) + (a0-7 (-> a2-6 uvec quad)) + (a1-5 (-> a2-6 fvec quad)) + (a2-7 (-> a2-6 trans quad)) + ) + (set! (-> gp-1 rvec quad) v1-23) + (set! (-> gp-1 uvec quad) a0-7) + (set! (-> gp-1 fvec quad) a1-5) + (set! (-> gp-1 trans quad) a2-7) + ) + (if (< (vector-dot + (-> gp-1 fvec) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-1 (new 'stack-no-clear 'vector))) + ) + 0.0 + ) + (matrix*! gp-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 32768.0) gp-1) + ) + (+! (-> self angle) (* 100.0 (rand-vu))) + (set! (-> *part-id-table* 1180 init-specs 4 initial-valuef) + (+ 14336.0 (* 1228.8 (cos (* 182.04445 (-> self angle))))) + ) + (set! (-> *part-id-table* 1181 init-specs 4 initial-valuef) + (+ 2048.0 (-> *part-id-table* 1180 init-specs 4 initial-valuef)) + ) + (spawn-from-mat (-> self part) gp-1) + ) + ) + ) + :code (behavior () + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (suspend) + (until (process-grab? *target* #f) + (suspend) + ) + (suspend) + (if *target* + (set! (-> *target* neck flex-blend) 1.0) + ) + (add-setting! 'music-volume 'rel (-> *setting-control* user-current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* user-current sfx-volume-movie) 0) + (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-talker) 0) + (set-time! (-> self state-time)) + (let* ((v1-21 (get-current-task-event (-> self task))) + (gp-0 (add-process *gui-control* self (gui-channel bbush) (gui-action play) (-> v1-21 scene) -99.0 0)) + ) + (let ((s5-0 (current-time))) + (while (and (nonzero? (get-status *gui-control* gp-0)) (not (time-elapsed? s5-0 (seconds 60)))) + (set! (-> self time) (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (suspend) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "inter-burn-bush") + (goto cfg-13) + ) + ) + ) + (label cfg-13) + (set-action! + *gui-control* + (gui-action stop) + gp-0 + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (until (process-release? *target*) + (suspend) + ) + (task-node-close! (-> self task current-node) 'event) + (go-virtual idle) + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-4 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 20480.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate menu (burning-bush) + :virtual #t + :enter (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self time) -1.0) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (remove-setting! 'minimap) + (send-event *camera* 'change-target *target*) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (time-elapsed? (-> self state-time) (seconds 1.5)) + (let ((gp-0 0) + (s5-0 0) + ) + (when (cpad-pressed? 0 down l-analog-down) + (+! s5-0 1) + (if (< (+ gp-0 -1) s5-0) + (set! s5-0 (+ gp-0 -1)) + (sound-play "menu-up-down") + ) + ) + (when (cpad-pressed? 0 up l-analog-up) + (+! s5-0 -1) + (if (< s5-0 0) + (set! s5-0 0) + (sound-play "menu-up-down") + ) + ) + (let* ((s4-2 40) + (s3-2 36) + (s2-0 (- 228 (* gp-0 (/ s4-2 2)))) + (v1-19 (new + 'stack + 'font-context + *font-default-matrix* + s3-2 + s2-0 + 0.0 + (font-color default) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> v1-19 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((a0-17 v1-19)) + (set! (-> a0-17 width) (the float 440)) + ) + (let ((a0-18 v1-19)) + (set! (-> a0-18 height) (the float 50)) + ) + (let ((a0-19 v1-19)) + (set! (-> a0-19 scale) 1.0) + ) + (let ((a0-20 v1-19) + (a2-3 s3-2) + (a1-6 40) + ) + (set! (-> a0-20 origin x) (the float a2-3)) + (set! (-> a0-20 origin y) (the float a1-6)) + ) + (let ((a1-7 v1-19)) + (set! (-> a1-7 color) (font-color progress-old-yellow)) + ) + (let ((a0-22 v1-19)) + (set! (-> a0-22 height) (the float s4-2)) + ) + (dotimes (a0-23 gp-0) + (let ((a1-9 v1-19) + (a3-3 s3-2) + (a2-4 s2-0) + ) + (set! (-> a1-9 origin x) (the float a3-3)) + (set! (-> a1-9 origin y) (the float a2-4)) + ) + (let ((a1-10 v1-19)) + (set! (-> a1-10 scale) (if (= a0-23 s5-0) + 0.8 + 0.6 + ) + ) + ) + (let ((a2-6 v1-19)) + (set! (-> a2-6 color) (if (= a0-23 s5-0) + (font-color progress-old-selected) + (font-color default) + ) + ) + ) + (+! s2-0 s4-2) + ) + ) + ) + ) + (when (!= (-> self time) -1.0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (vector+! gp-1 (-> self root trans) (vector-orient-by-quat! + (new 'stack-no-clear 'vector) + (new 'static 'vector :y 24166.4 :z 32768.0 :w 1.0) + (-> self root quat) + ) + ) + (set! (-> *camera* slave 0 trans quad) (-> gp-1 quad)) + (let ((t9-6 forward-down->inv-matrix) + (a0-27 (-> *camera* slave 0 tracking)) + (a1-13 (new 'stack-no-clear 'vector)) + (v1-35 (new 'stack-no-clear 'vector)) + ) + (let ((a2-9 (-> self root trans))) + (let ((a3-4 *up-vector*)) + (let ((t0-4 24166.4)) + (.mov vf7 t0-4) + ) + (.lvf vf5 (&-> a3-4 quad)) + ) + (.lvf vf4 (&-> a2-9 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 (&-> v1-35 quad) vf6) + (t9-6 (the-as matrix a0-27) (vector-! a1-13 v1-35 gp-1) (-> *camera* local-down)) + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'matrix))) + (let* ((a2-11 (-> self node-list data 3 bone transform)) + (v1-40 (-> a2-11 rvec quad)) + (a0-28 (-> a2-11 uvec quad)) + (a1-15 (-> a2-11 fvec quad)) + (a2-12 (-> a2-11 trans quad)) + ) + (set! (-> gp-2 rvec quad) v1-40) + (set! (-> gp-2 uvec quad) a0-28) + (set! (-> gp-2 fvec quad) a1-15) + (set! (-> gp-2 trans quad) a2-12) + ) + (if (< (vector-dot + (-> gp-2 fvec) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-2 (new 'stack-no-clear 'vector))) + ) + 0.0 + ) + (matrix*! gp-2 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 32768.0) gp-2) + ) + (spawn-from-mat (-> self part-off) gp-2) + ) + ) + ) + :code (behavior () + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (suspend) + (until (process-grab? *target* #f) + (suspend) + ) + (set! (-> self time) 0.0) + (let ((s4-0 #f)) + (let ((gp-0 (add-process *gui-control* self (gui-channel bbush) (gui-action play) "cityv174" -99.0 0))) + (let ((s5-0 (current-time))) + (while (and (nonzero? (get-status *gui-control* gp-0)) (not (time-elapsed? s5-0 (seconds 60))) (not s4-0)) + (suspend) + (when (or (cpad-pressed? 0 triangle) (cpad-pressed? 0 confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (sound-play "inter-burn-bush") + (set! s4-0 #t) + ) + ) + ) + (set-action! + *gui-control* + (gui-action stop) + gp-0 + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (when (not s4-0) + (until #f + (when (or (cpad-pressed? 0 confirm) (cpad-pressed? 0 triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (sound-play "menu-pick") + #t + (goto cfg-23) + ) + (suspend) + ) + #f + ) + ) + (until (process-release? *target*) + (label cfg-23) + (suspend) + ) + (go-virtual idle) + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-4 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 20480.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + ) + ) + ) + +;; definition for method 34 of type burning-bush +(defmethod burning-bush-method-34 ((this burning-bush)) + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + ) + (and *target* + (not (focus-test? *target* pilot)) + (< (fabs f30-0) 10240.0) + (< 0.0 f0-2) + (< (fabs f0-2) 20480.0) + ) + ) + ) + +;; definition for method 32 of type burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod burning-bush-method-32 ((this burning-bush)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((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 tobot)) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 33 of type burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod burning-bush-method-33 ((this burning-bush)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 260) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 261) this)) + (set! (-> this part-alert) (create-launch-control (-> *part-group-id-table* 262) this)) + 0 + (none) + ) + +;; definition for method 7 of type burning-bush +;; WARN: Return type mismatch process-focusable vs burning-bush. +(defmethod relocate ((this burning-bush) (offset int)) + (if (nonzero? (-> this task)) + (&+! (-> this task) offset) + ) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) offset) + ) + (if (nonzero? (-> this part-alert)) + (&+! (-> this part-alert) offset) + ) + (the-as burning-bush ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for method 10 of type burning-bush +(defmethod deactivate ((this burning-bush)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part-off)) + (kill-particles (-> this part-off)) + ) + (if (nonzero? (-> this part-alert)) + (kill-particles (-> this part-alert)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 12 of type burning-bush +(defmethod run-logic? ((this burning-bush)) + "Should this process be run? Checked by execute-process-tree." + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) + ) + ) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) + ) + ) + ) + +;; definition for method 11 of type burning-bush +(defmethod init-from-entity! ((this burning-bush) (arg0 entity-actor)) + (burning-bush-method-32 this) + (process-drawable-from-entity! this arg0) + (ctywide-entity-hack) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-burning-bush" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (burning-bush-method-33 this) + (set! (-> this rotmin) (res-lump-float arg0 'rotmin :default -5461.3335)) + (set! (-> this rotmax) (res-lump-float arg0 'rotmax :default 5461.3335)) + (let ((f0-2 (res-lump-float (-> this entity) 'rotoffset))) + (if (!= f0-2 0.0) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-2) + ) + ) + (set! (-> this task) + (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) + ) + (set! (-> this angle) 0.0) + (set! (-> this root pause-adjust-distance) 819200.0) + (transform-post) + (go (method-of-object this idle)) + ) + +;; definition of type city-burning-bush-get-on-info +(deftype city-burning-bush-get-on-info (structure) + ((trans vector :inline) + (quat quaternion :inline) + (camera-trans vector :inline) + (camera-rot float 9) + (time float) + (fov float) + ) + ) + +;; definition for method 3 of type city-burning-bush-get-on-info +(defmethod inspect ((this city-burning-bush-get-on-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'city-burning-bush-get-on-info) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tcamera-trans: #~%" (-> this camera-trans)) + (format #t "~1Tcamera-rot[9] @ #x~X~%" (-> this camera-rot)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tfov: ~f~%" (-> this fov)) + (label cfg-4) + this + ) + +;; definition for symbol *city-burning-bush-get-on-info*, type (array city-burning-bush-get-on-info) +(define *city-burning-bush-get-on-info* + (new 'static 'boxed-array :type city-burning-bush-get-on-info + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1442120.5 :y 32765.543 :z -412846.9 :w 1.0) + :quat (new 'static 'quaternion :x 0.0006 :y 0.8826 :z -0.0012 :w -0.4699) + :camera-trans (new 'static 'vector :x 1458548.4 :y 46188.543 :z -449677.72 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8889 0.0 0.458 -0.0229 0.9987 0.0444 -0.4574 -0.05 0.8878) + :time 7500.0 + :fov 12743.111 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 2247272.5 :y 67314.484 :z -1134648.9 :w 1.0) + :quat (new 'static 'quaternion :x -0.1469 :y 0.0545 :z 0.0068 :w 0.9876) + :camera-trans (new 'static 'vector :x 2279621.8 :y 74105.24 :z -1128908.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6307 0.0 0.776 -0.2236 0.9575 -0.1817 -0.743 -0.2881 -0.6039) + :time 5400.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1438305.1 :y 71998.26 :z -1084914.5 :w 1.0) + :quat (new 'static 'quaternion :x 0.001 :y -0.9202 :z 0.0002 :w -0.3912) + :camera-trans (new 'static 'vector :x 1479435.0 :y 85435.59 :z -1095610.4 :w 1.0) + :camera-rot (new 'static 'array float 9 0.151 0.0 0.9885 0.0056 0.9999 -0.0008 -0.9885 0.0057 0.151) + :time 5400.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1466428.2 :y 125903.26 :z -1495985.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.2215 :w 0.9751) + :camera-trans (new 'static 'vector :x 1465902.8 :y 102859.57 :z -1401041.8 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9864 0.0 0.1639 0.0493 0.9536 0.2967 -0.1563 0.3008 -0.9407) + :time 6600.0 + :fov 10922.667 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 634022.3 :y 122880.0 :z -697692.56 :w 1.0) + :quat (new 'static 'quaternion :x -0.0012 :y 0.6246 :z 0.0009 :w -0.7808) + :camera-trans (new 'static 'vector :x 684180.7 :y 160337.52 :z -642709.1 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6785 0.0 0.7345 -0.3495 0.8795 -0.3229 -0.646 -0.4758 -0.5967) + :time 5100.0 + :fov 10922.667 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1966872.6 :y 47686.86 :z -206054.19 :w 1.0) + :quat (new 'static 'quaternion :y 0.9988 :w 0.0482) + :camera-trans (new 'static 'vector :x 1971155.4 :y 38171.44 :z -273855.7 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9641 0.0 -0.2652 0.0043 0.9998 0.0158 0.2652 -0.0164 0.964) + :time 6900.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 2645027.2 :y 7752.499 :z -2422284.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.9993 :w -0.0352) + :camera-trans (new 'static 'vector :x 2643901.8 :y 20940.8 :z -2451367.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.818 0.0 0.5751 -0.061 0.9943 0.0869 -0.5718 -0.1062 0.8134) + :time 5400.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 2339761.0 :y 92694.12 :z -3021732.8 :w 1.0) + :quat (new 'static 'quaternion :y 0.3606 :w -0.9326) + :camera-trans (new 'static 'vector :x 2329062.2 :y 105224.6 :z -2983756.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.7717 0.0 -0.6359 0.3292 0.8555 -0.3995 0.544 -0.5177 -0.6602) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 3210766.0 :y 32764.314 :z 787847.2 :w 1.0) + :quat (new 'static 'quaternion :x 0.0008 :y 0.5021 :z 0.0011 :w -0.8647) + :camera-trans (new 'static 'vector :x 3185149.2 :y 40500.84 :z 778470.6 :w 1.0) + :camera-rot (new 'static 'array float 9 0.1119 0.0 -0.9937 0.0693 0.9975 0.0078 0.9912 -0.0697 0.1116) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 4139099.2 :y 37910.527 :z 1484301.5 :w 1.0) + :quat (new 'static 'quaternion :x -0.0002 :y -0.1337 :z 0.0015 :w 0.991) + :camera-trans (new 'static 'vector :x 4120032.5 :y 53998.387 :z 1506306.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6088 0.0 -0.7932 0.1409 0.984 -0.1082 0.7806 -0.1777 -0.5991) + :time 3300.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 3936017.2 :y 94799.46 :z 2196627.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0015 :y -0.483 :z -0.0002 :w -0.8755) + :camera-trans (new 'static 'vector :x 3910655.2 :y 104816.23 :z 2183312.2 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6539 0.0 -0.7564 0.0916 0.9926 0.0792 0.7509 -0.1211 0.6491) + :time 4200.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 4434624.0 :y 100512.56 :z 2489095.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0005 :y 0.1411 :w 0.9899) + :camera-trans (new 'static 'vector :x 4484939.5 :y 121671.27 :z 2430261.2 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6538 0.0 0.7566 -0.4974 0.7535 0.4298 -0.5701 -0.6573 0.4926) + :time 3000.0 + :fov 18204.445 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 3858326.8 :y 99340.695 :z 3912547.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.0271 :w 0.9996) + :camera-trans (new 'static 'vector :x 3848977.5 :y 111943.68 :z 3934181.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8843 0.0 -0.4667 0.1047 0.9744 -0.1984 0.4548 -0.2243 -0.8618) + :time 3900.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 3764324.2 :y 98499.79 :z 4562610.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0012 :y 0.0062 :w 0.9999) + :camera-trans (new 'static 'vector :x 3691300.0 :y 123541.914 :z 4541654.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.2135 0.0 -0.9769 0.2535 0.9657 0.0554 0.9434 -0.2594 0.2062) + :time 3900.0 + :fov 7281.778 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 4427024.5 :y 74095.414 :z 3948627.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.972 :w 0.2349) + :camera-trans (new 'static 'vector :x 4436096.0 :y 88536.266 :z 3978709.8 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9909 0.0 0.1338 -0.0287 0.9767 -0.2124 -0.1307 -0.2143 -0.9679) + :time 3900.0 + :fov 18204.445 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1377852.2 :y 76197.89 :z 7083083.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0004 :y 0.3829 :z -0.001 :w 0.9237) + :camera-trans (new 'static 'vector :x 1263103.6 :y 188428.28 :z 6971105.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.5705 0.0 -0.8212 0.5598 0.7316 0.3889 0.6008 -0.6817 0.4174) + :time 1800.0 + :fov 5461.3335 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x -942875.9 :y 96113.46 :z 6424137.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0002 :y 0.9944 :w 0.1048) + :camera-trans (new 'static 'vector :x -755284.4 :y 180505.81 :z 6304042.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6079 0.0 0.7939 -0.329 0.9101 0.2519 -0.7225 -0.4143 0.5533) + :time 2100.0 + :fov 3640.889 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x -1205959.5 :y 114149.375 :z 5692970.5 :w 1.0) + :quat (new 'static 'quaternion :x -0.0005 :y 0.8807 :z -0.001 :w -0.4736) + :camera-trans (new 'static 'vector :x -1230954.9 :y 126642.586 :z 5698481.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.1203 0.0 -0.9927 0.4576 0.8874 -0.0554 0.8809 -0.4609 -0.1068) + :time 6900.0 + :fov 16384.0 + ) + (new 'static 'city-burning-bush-get-on-info + :trans (new 'static 'vector :x 1641758.8 :y 97295.98 :z 5436796.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0001 :y 0.4706 :z 0.0001 :w 0.8823) + :camera-trans (new 'static 'vector :x 1620224.0 :y 105643.625 :z 5418739.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8069 0.0 -0.5906 0.1079 0.9831 0.1474 0.5807 -0.1826 0.7933) + :time 4500.0 + :fov 14563.556 + ) + ) + ) + +;; definition of type task-manager-ctywide-bbush-get-to +(deftype task-manager-ctywide-bbush-get-to (task-manager) + ((skill handle) + ) + (:methods + (task-manager-ctywide-bbush-get-to-method-32 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-ctywide-bbush-get-to +(defmethod inspect ((this task-manager-ctywide-bbush-get-to)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tskill: ~D~%" (-> this skill)) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-ctywide-bbush-get-to +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-ctywide-bbush-get-to-method-32 ((this task-manager-ctywide-bbush-get-to)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + 0 + (none) + ) + +;; definition for method 21 of type task-manager-ctywide-bbush-get-to +(defmethod set-time-limit ((this task-manager-ctywide-bbush-get-to)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (task-manager-ctywide-bbush-get-to-method-32 this) + (when (nonzero? (-> this skill)) + (let ((a0-5 (handle->process (-> this skill)))) + (if a0-5 + (deactivate a0-5) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-ctywide-bbush-get-to) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (send-event self 'complete) + ) + (('die) + (send-event self 'fail) + ) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (while (not (process-grab? *target* #f)) + (suspend) + ) + (let ((t1-1 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) + (a0-3 (new 'stack-no-clear 'vector)) + ) + (logior! (-> t1-1 options) (actor-option fade-out)) + (set! (-> t1-1 fade-time) + (the-as time-frame (the int (-> *city-burning-bush-get-on-info* (-> self info index) time))) + ) + (set! (-> a0-3 quad) (-> *city-burning-bush-get-on-info* (-> self info index) trans quad)) + (+! (-> a0-3 y) 4096.0) + (set! (-> self skill) + (ppointer->handle + (birth-pickup-at-point a0-3 (pickup-type skill) (-> *FACT-bank* super-skill-inc) #t self t1-1) + ) + ) + ) + (set-time! (-> self start-time)) + (set! (-> self time-limit) + (the-as time-frame (the int (+ 300.0 (-> *city-burning-bush-get-on-info* (-> self info index) time)))) + ) + (suspend) + (send-event (handle->process (-> self skill)) 'get-notify self) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set! (-> *ACTOR-bank* birth-max) 1000) + (suspend) + (let ((f30-0 (-> *camera* settings fov))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *camera-combiner* trans quad)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-7 (-> *camera-combiner* inv-camera-rot)) + (v1-46 (-> a2-7 rvec quad)) + (a0-15 (-> a2-7 uvec quad)) + (a1-15 (-> a2-7 fvec quad)) + (a2-8 (-> a2-7 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-46) + (set! (-> gp-0 uvec quad) a0-15) + (set! (-> gp-0 fvec quad) a1-15) + (set! (-> gp-0 trans quad) a2-8) + ) + (let ((s4-0 (new 'stack 'transformq))) + (let ((v1-52 (-> *city-burning-bush-get-on-info* (-> self info index))) + (a1-17 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s4-0 trans quad) (-> v1-52 camera-trans quad)) + (set-vector! (-> s4-0 scale) 1.0 1.0 1.0 1.0) + (set! (-> a1-17 rvec x) (-> v1-52 camera-rot 0)) + (set! (-> a1-17 rvec y) (-> v1-52 camera-rot 1)) + (set! (-> a1-17 rvec z) (-> v1-52 camera-rot 2)) + (set! (-> a1-17 rvec w) 0.0) + (set! (-> a1-17 uvec x) (-> v1-52 camera-rot 3)) + (set! (-> a1-17 uvec y) (-> v1-52 camera-rot 4)) + (set! (-> a1-17 uvec z) (-> v1-52 camera-rot 5)) + (set! (-> a1-17 uvec w) 0.0) + (set! (-> a1-17 fvec x) (-> v1-52 camera-rot 6)) + (set! (-> a1-17 fvec y) (-> v1-52 camera-rot 7)) + (set! (-> a1-17 fvec z) (-> v1-52 camera-rot 8)) + (set! (-> a1-17 fvec w) 0.0) + (set! (-> a1-17 trans x) 0.0) + (set! (-> a1-17 trans y) 0.0) + (set! (-> a1-17 trans z) 0.0) + (set! (-> a1-17 trans w) 1.0) + (matrix->quaternion (-> s4-0 quat) a1-17) + ) + (send-event *camera* 'teleport-to-transformq s4-0) + ) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 (seconds 3)) + (set! (-> *camera* slave 0 fov) (-> *city-burning-bush-get-on-info* (-> self info index) fov)) + (suspend) + ) + ) + (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) + (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) + (v1-74 (-> gp-0 rvec quad)) + (a0-24 (-> gp-0 uvec quad)) + (a1-19 (-> gp-0 fvec quad)) + (a3-5 (-> gp-0 trans quad)) + ) + (set! (-> a2-15 rvec quad) v1-74) + (set! (-> a2-15 uvec quad) a0-24) + (set! (-> a2-15 fvec quad) a1-19) + (set! (-> a2-15 trans quad) a3-5) + ) + ) + ) + (set! (-> *camera* settings fov) f30-0) + ) + (remove-setting! 'minimap) + (set! (-> *ACTOR-bank* birth-max) 1000) + (let ((a0-28 (get-continue-by-name *game-info* (-> self node-info reset fail-info retry continue))) + (gp-1 (new 'static 'vector :z 1.0)) + ) + (when a0-28 + (move-camera! a0-28) + (set-vector! + gp-1 + (-> *camera-combiner* inv-camera-rot uvec x) + (-> *camera-combiner* inv-camera-rot uvec y) + (-> *camera-combiner* inv-camera-rot uvec z) + 1.0 + ) + (vector-negate-in-place! gp-1) + (set-setting! 'string-startup-vector 'abs gp-1 0) + ) + ) + (persist-with-delay *setting-control* 'interp-time (seconds 0.5) 'interp-time 'abs 0.0 0) + (remove-setting! 'fov) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + (while (not (process-release? *target*)) + (suspend) + ) + (until #f + (hud-timer-handler self) + (suspend) + ) + #f + ) + ) + +;; definition for method 9 of type city-race-ring-info +;; WARN: Return type mismatch int vs none. +(defmethod gen-static-macro ((this city-race-ring-info) (arg0 object)) + (format arg0 "(static-race-ring-info~%") + (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%" (-> this pos x) (-> this pos y) (-> this pos z)) + (let ((f0-3 (-> this pos w))) + (format arg0 " :angle (deg ~f)~%" (* 0.005493164 f0-3)) + ) + (if (!= (-> this boost) 1.0) + (format arg0 " :boost ~4,,2f~%" (-> this boost)) + ) + (format arg0 " :dist (meters ~4,,2M)~%" (-> this dist)) + (format arg0 " ~%)~%") + 0 + (none) + ) + +;; definition for method 9 of type city-ambush-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init ((this city-ambush-info) (arg0 traffic-object-spawn-params)) + (set! (-> arg0 position quad) (-> this array 0 pos quad)) + (set! (-> arg0 nav-mesh) (find-nearest-nav-mesh (-> arg0 position) (the-as float #x7f800000))) + (vector-reset! (-> arg0 velocity)) + (dotimes (s4-0 (-> this count)) + (let ((v1-3 (-> this array s4-0))) + (set! (-> arg0 position quad) (-> v1-3 pos quad)) + (set! (-> arg0 object-type) (-> v1-3 obj-type)) + ) + (send-event *traffic-manager* 'activate-object arg0) + 0 + ) + 0 + (none) + ) + +;; definition of type ctyn-lamp +(deftype ctyn-lamp (process-focusable) + () + (:state-methods + idle + die + ) + (:methods + (ctyn-lamp-method-30 (_type_) none) + (ctyn-lamp-method-31 (_type_) none) + ) + ) + +;; definition for method 3 of type ctyn-lamp +(defmethod inspect ((this ctyn-lamp)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctyn-lamp ctyn-lamp 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 5)) + +;; failed to figure out what this is: +(defskelgroup skel-ctyn-lamp-explode ctyn-lamp 3 5 ((4 (meters 999999))) :bounds (static-spherem 0 0 0 80)) + +;; definition for symbol *ctyn-lamp-exploder-params*, type joint-exploder-static-params +(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 (collide-spec backgnd) + ) + ) + +;; failed to figure out what this is: +(defstate idle (ctyn-lamp) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (-> block param 1) + (let ((s5-0 proc) + (gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1))) + ) + (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (the-as joint-exploder 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 level) #f)) + 5 + gp-0 + *ctyn-lamp-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (go-virtual die) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die (ctyn-lamp) + :virtual #t + :enter #f + :exit #f + :trans #f + :code (behavior () + (sound-play "lamp-hit") + (let ((v1-3 (-> self root 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) + ) + :post #f + ) + +;; definition for method 30 of type ctyn-lamp +;; WARN: Return type mismatch int vs none. +(defmethod ctyn-lamp-method-30 ((this ctyn-lamp)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 31 of type ctyn-lamp +;; WARN: Return type mismatch int vs none. +(defmethod ctyn-lamp-method-31 ((this ctyn-lamp)) + (logior! (-> this mask) (process-mask crate)) + 0 + (none) + ) + +;; definition for method 11 of type ctyn-lamp +(defmethod init-from-entity! ((this ctyn-lamp) (arg0 entity-actor)) + (ctyn-lamp-method-30 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyn-lamp" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ctyn-lamp-method-31 this) + (transform-post) + (go (method-of-object this idle)) + ) + +;; definition of type fac-lowrez-move +(deftype fac-lowrez-move (structure) + ((light light-state :inline) + (roty float) + (rotz float) + (rot-bob float) + (wobble float) + (bob float) + ) + :pack-me + ) + +;; definition for method 3 of type fac-lowrez-move +(defmethod inspect ((this fac-lowrez-move)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'fac-lowrez-move) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Troty: ~f~%" (-> this roty)) + (format #t "~1Trotz: ~f~%" (-> this rotz)) + (format #t "~1Trot-bob: ~f~%" (-> this rot-bob)) + (format #t "~1Twobble: ~f~%" (-> this wobble)) + (format #t "~1Tbob: ~f~%" (-> this bob)) + (label cfg-4) + this + ) + +;; definition of type fac-lorez +(deftype fac-lorez (process-drawable) + ((move-info fac-lowrez-move :inline) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type fac-lorez +(defmethod inspect ((this fac-lorez)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tmove-info: #~%" (-> this move-info)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-lorez fac-lorez fac-lorez-lod0-jg fac-lorez-idle-ja + ((fac-lorez-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 400) + ) + +;; definition for method 11 of type fac-lorez +(defmethod init-from-entity! ((this fac-lorez) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-lorez" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) + ) + +;; definition for method 12 of type fac-lorez +(defmethod run-logic? ((this fac-lorez)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; failed to figure out what this is: +(defstate idle (fac-lorez) + :virtual #t + :trans (behavior () + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-vector-angle! s5-0 *y-vector* (- (-> self move-info roty))) + (quaternion-vector-angle! gp-0 *z-vector* (-> self move-info wobble)) + (quaternion*! (-> self root quat) gp-0 s5-0) + ) + (quaternion-normalize! (-> self root quat)) + (let ((f0-4 (+ (-> self move-info roty) (* 910.2222 (seconds-per-frame))))) + (set! (-> self move-info roty) (- f0-4 (* (the float (the int (/ f0-4 65536.0))) 65536.0))) + ) + (let ((f0-7 (+ (-> self move-info rotz) (* 8192.0 (seconds-per-frame))))) + (set! (-> self move-info rotz) (- f0-7 (* (the float (the int (/ f0-7 65536.0))) 65536.0))) + ) + (set! (-> self move-info wobble) (* 910.2222 (sin (-> self move-info rotz)))) + (let ((f0-13 (+ (-> self move-info rot-bob) (* 16384.0 (seconds-per-frame))))) + (set! (-> self move-info rot-bob) (- f0-13 (* (the float (the int (/ f0-13 65536.0))) 65536.0))) + ) + (set! (-> self move-info bob) (+ -40960.0 (* 40960.0 (sin (-> self move-info rot-bob))))) + ) + :code sleep-code + :post ja-post + ) + +;; definition of type flitter-spawner +(deftype flitter-spawner (process-drawable) + ((actor-group (pointer actor-group) :offset 204) + (actor-group-count int32) + (spawner proc-focusable-spawner) + (desired-spawn-count int32) + (spawn-times (array time-frame)) + (last-seen-times (array time-frame)) + ) + (:state-methods + active + ) + (:methods + (spawn-flitter (_type_ entity-actor) object) + ) + ) + +;; definition for method 3 of type flitter-spawner +(defmethod inspect ((this flitter-spawner)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tspawner: ~A~%" (-> this spawner)) + (format #t "~2Tdesired-spawn-count: ~D~%" (-> this desired-spawn-count)) + (format #t "~2Tspawn-times: ~A~%" (-> this spawn-times)) + (format #t "~2Tlast-seen-times: ~A~%" (-> this last-seen-times)) + (label cfg-7) + this + ) + +;; definition for method 7 of type flitter-spawner +(defmethod relocate ((this flitter-spawner) (offset int)) + (if (nonzero? (-> this spawner)) + (&+! (-> this spawner) offset) + ) + (if (nonzero? (-> this spawn-times)) + (&+! (-> this spawn-times) offset) + ) + (if (nonzero? (-> this last-seen-times)) + (&+! (-> this last-seen-times) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 12 of type flitter-spawner +(defmethod run-logic? ((this flitter-spawner)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 11 of type flitter-spawner +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this flitter-spawner) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this entity) arg0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (cond + ((and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) v1-2) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-scenecamera" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this desired-spawn-count) 8) + (when (> (-> this actor-group-count) 0) + (set! (-> this spawner) (new 'process 'proc-focusable-spawner)) + (set! (-> this spawn-times) (new 'process 'boxed-array time-frame (-> this actor-group-count))) + (alloc-records! (-> this spawner) (+ (-> this desired-spawn-count) 2) 'process) + (set! (-> this last-seen-times) (new 'process 'boxed-array time-frame (+ (-> this desired-spawn-count) 2))) + (dotimes (s5-2 (-> this spawner records length)) + (let ((s4-1 (new 'stack-no-clear 'traffic-object-spawn-params))) + (set! (-> s4-1 velocity quad) (the-as uint128 0)) + (set! (-> s4-1 behavior) (the-as uint 1)) + (set! (-> s4-1 object-type) (traffic-type metalhead-flitter)) + (set! (-> s4-1 flags) (traffic-spawn-flags tsf0)) + (set! (-> s4-1 nav-branch) #f) + (set! (-> this spawner records data s5-2 proc) + (ppointer->handle + (process-spawn metalhead-flitter :init citizen-init-by-other s4-1 :name "metalhead-flitter" :to this) + ) + ) + ) + ) + ) + (go (method-of-object this active)) + ) + +;; definition for method 21 of type flitter-spawner +;; INFO: Used lq/sq +(defmethod spawn-flitter ((this flitter-spawner) (arg0 entity-actor)) + (let ((gp-0 (new 'stack-no-clear 'traffic-object-spawn-params))) + (set! (-> gp-0 velocity quad) (the-as uint128 0)) + (set! (-> gp-0 position quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> gp-0 rotation) (-> arg0 quat)) + (set! (-> gp-0 behavior) (the-as uint 2)) + (set! (-> gp-0 object-type) (traffic-type metalhead-flitter)) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (set! (-> gp-0 user-data) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 nav-branch) #f) + (let ((s4-0 (-> gp-0 position))) + (let ((s3-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> s3-0 start-pos) s4-0 *up-vector* 24576.0) + (set! (-> s3-0 move-dist quad) (the-as uint128 0)) + (set! (-> s3-0 move-dist y) -81920.0) + (let ((v1-8 s3-0)) + (set! (-> v1-8 radius) 40.96) + (set! (-> v1-8 collide-with) (collide-spec backgnd)) + (set! (-> v1-8 ignore-process0) #f) + (set! (-> v1-8 ignore-process1) #f) + (set! (-> v1-8 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-8 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) + (set! (-> s4-0 quad) (-> s3-0 best-other-tri intersect quad)) + ) + ) + (set! (-> gp-0 nav-mesh) (find-nearest-nav-mesh s4-0 (the-as float #x7f800000))) + ) + (let ((a0-15 (get-last-unused-val! (-> this spawner)))) + (when (>= a0-15 0) + (let ((v1-18 (-> this spawner records data a0-15 proc))) + (set-time! (-> this last-seen-times a0-15)) + (send-event (handle->process v1-18) 'traffic-activate gp-0 *traffic-engine*) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (flitter-spawner) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 1)) + (set-time! (-> self state-time)) + (let ((gp-0 0)) + (dotimes (s5-0 (-> self spawner records length)) + (let* ((s4-0 (handle->process (-> self spawner records data s5-0 proc))) + (v1-11 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when v1-11 + (if (not (focus-test? (the-as process-focusable v1-11) disable dead inactive)) + (+! gp-0 1) + ) + ) + ) + ) + (when (< gp-0 (-> self desired-spawn-count)) + (let ((gp-1 0)) + (dotimes (s5-1 (length (-> self actor-group 0))) + (let ((s4-1 (-> self actor-group 0 data s5-1 actor))) + (when s4-1 + (if (and (is-object-visible? (-> s4-1 extra level) (-> s4-1 vis-id)) + (let ((s3-0 sphere-in-view-frustum?) + (a0-13 (new 'stack 'sphere)) + ) + (set! (-> a0-13 quad) (-> s4-1 extra trans quad)) + (set! (-> a0-13 r) 8192.0) + (or (not (s3-0 a0-13)) (< 409600.0 (vector-vector-distance (-> s4-1 extra trans) (camera-pos)))) + ) + (time-elapsed? (-> self spawn-times s5-1) (seconds 3)) + (< 61440.0 (vector-vector-distance (-> s4-1 extra trans) (target-pos 0))) + ) + (set! gp-1 (logior gp-1 (ash 1 s5-1))) + ) + ) + ) + ) + (when (nonzero? gp-1) + (let* ((a1-10 (lognot gp-1)) + (v1-52 (rand-vu-int-count-excluding (-> self actor-group 0 length) a1-10)) + ) + (set-time! (-> self spawn-times v1-52)) + (spawn-flitter self (-> self actor-group 0 data v1-52 actor)) + ) + ) + ) + ) + ) + (check-inactive (-> self spawner)) + (dotimes (gp-2 (-> self last-seen-times length)) + (let* ((s4-3 (handle->process (-> self spawner records data gp-2 proc))) + (s5-2 (if (type? s4-3 process-focusable) + s4-3 + ) + ) + (s4-4 (new 'stack 'sphere)) + ) + 0.0 + (when (the-as process-focusable s5-2) + (let ((f30-2 (vector-vector-distance (-> (the-as process-focusable s5-2) root trans) (target-pos 0)))) + (set! (-> s4-4 quad) (-> (the-as process-focusable s5-2) root trans quad)) + (set! (-> s4-4 r) 8192.0) + (if (or (and (sphere-in-view-frustum? s4-4) (< f30-2 307200.0)) (< f30-2 61440.0)) + (set-time! (-> self last-seen-times gp-2)) + ) + (if (and (time-elapsed? (-> self last-seen-times gp-2) (seconds 10)) + (or (not (sphere-in-view-frustum? s4-4)) (< 409600.0 f30-2)) + ) + (send-event s5-2 'traffic-off-force) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + ) + +;; definition of type flitter-point +(deftype flitter-point (process-hidden) + () + ) + +;; definition for method 3 of type flitter-point +(defmethod inspect ((this flitter-point)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) + (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) + (format #t "process-tree ") + ) + (if (= (logand s5-0 (process-mask target)) (process-mask target)) + (format #t "target ") + ) + (if (= (logand (process-mask collectable) s5-0) (process-mask collectable)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand s5-0 (process-mask sleep-code)) (process-mask sleep-code)) + (format #t "sleep-code ") + ) + (if (= (logand s5-0 (process-mask actor-pause)) (process-mask actor-pause)) + (format #t "actor-pause ") + ) + (if (= (logand (process-mask metalhead) s5-0) (shl #x8000 16)) + (format #t "metalhead ") + ) + (if (= (logand (process-mask bot) s5-0) (process-mask bot)) + (format #t "bot ") + ) + (if (= (logand (process-mask vehicle) s5-0) (process-mask vehicle)) + (format #t "vehicle ") + ) + (if (= (logand (process-mask enemy) s5-0) (process-mask enemy)) + (format #t "enemy ") + ) + (if (= (logand (process-mask entity) s5-0) (process-mask entity)) + (format #t "entity ") + ) + (if (= (logand s5-0 (process-mask heap-shrunk)) (process-mask heap-shrunk)) + (format #t "heap-shrunk ") + ) + (if (= (logand (process-mask sidekick) s5-0) (process-mask sidekick)) + (format #t "sidekick ") + ) + (if (= (logand s5-0 (process-mask going)) (process-mask going)) + (format #t "going ") + ) + (if (= (logand s5-0 (process-mask execute)) (process-mask execute)) + (format #t "execute ") + ) + (if (= (logand (process-mask civilian) s5-0) (process-mask civilian)) + (format #t "civilian ") + ) + (if (= (logand (process-mask death) s5-0) (process-mask death)) + (format #t "death ") + ) + (if (= (logand (process-mask guard) s5-0) (process-mask guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (process-mask no-kill)) (process-mask no-kill)) + (format #t "no-kill ") + ) + (if (= (logand (process-mask kg-robot) s5-0) (process-mask kg-robot)) + (format #t "kg-robot ") + ) + (if (= (logand (process-mask platform) s5-0) (process-mask platform)) + (format #t "platform ") + ) + (if (= (logand s5-0 (process-mask freeze)) (process-mask freeze)) + (format #t "freeze ") + ) + (if (= (logand s5-0 (process-mask sleep)) (process-mask sleep)) + (format #t "sleep ") + ) + (if (= (logand s5-0 (process-mask progress)) (process-mask progress)) + (format #t "progress ") + ) + (if (= (logand s5-0 (process-mask menu)) (process-mask menu)) + (format #t "menu ") + ) + (if (= (logand (process-mask camera) s5-0) (process-mask camera)) + (format #t "camera ") + ) + (if (= (logand (process-mask ambient) s5-0) (process-mask ambient)) + (format #t "ambient ") + ) + (if (= (logand s5-0 (process-mask dark-effect)) (process-mask dark-effect)) + (format #t "dark-effect ") + ) + (if (= (logand (process-mask crate) s5-0) (process-mask crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (process-mask kernel-run)) (process-mask kernel-run)) + (format #t "kernel-run ") + ) + (if (= (logand s5-0 (process-mask movie)) (process-mask movie)) + (format #t "movie ") + ) + (if (= (logand s5-0 (process-mask pause)) (process-mask pause)) + (format #t "pause ") + ) + ) + (format #t ")~%") + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tstate-stack: ~A~%" (-> this state-stack)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) + (label cfg-68) + this + ) + +;; definition of type board-score-hud +(deftype board-score-hud (hud-goal) + () + ) + +;; definition for method 3 of type board-score-hud +(defmethod inspect ((this board-score-hud)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud-goal inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type board-score-hud +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this board-score-hud)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 447 70) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type board-score-hud +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this board-score-hud)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type board-score-hud +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this board-score-hud)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) + (let ((s5-0 format) + (gp-1 (clear (-> this strings 1 text))) + (s4-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0866) #f)) + (s5-0 gp-1 s4-0 *temp-string*) + ) + 0 + (none) + ) + +;; definition of type task-manager-bbush-board +(deftype task-manager-bbush-board (task-manager) + ((score float) + (challenge-done symbol) + (hud-score handle) + (hud-goal handle) + (game-score uint8) + (new-high-score symbol) + (goal-cup uint8) + (last-cup uint8) + (roll-back-task? symbol) + ) + (:methods + (task-manager-bbush-board-method-32 (_type_) none) + (task-manager-bbush-board-method-33 (_type_) none) + (task-manager-bbush-board-method-34 (_type_ float) none) + ) + ) + +;; definition for method 3 of type task-manager-bbush-board +(defmethod inspect ((this task-manager-bbush-board)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tscore: ~f~%" (-> this score)) + (format #t "~2Tchallenge-done: ~A~%" (-> this challenge-done)) + (format #t "~2Thud-score: ~D~%" (-> this hud-score)) + (format #t "~2Thud-goal: ~D~%" (-> this hud-goal)) + (format #t "~2Tgame-score: ~D~%" (-> this game-score)) + (format #t "~2Tnew-high-score: ~A~%" (-> this new-high-score)) + (format #t "~2Tgoal-cup: ~D~%" (-> this goal-cup)) + (format #t "~2Tlast-cup: ~D~%" (-> this last-cup)) + (format #t "~2Troll-back-task?: ~A~%" (-> this roll-back-task?)) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-bbush-board +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-bbush-board-method-32 ((this task-manager-bbush-board)) + (set-setting! 'music 'cityjetb 0.0 0) + (set-setting! 'city-sound '(citybb1) 0.0 2) + 0 + (none) + ) + +;; definition for method 21 of type task-manager-bbush-board +(defmethod set-time-limit ((this task-manager-bbush-board)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this game-score) (the-as uint 10)) + (set! (-> this hud-score) (the-as handle #f)) + (set! (-> this hud-goal) (the-as handle #f)) + (if (= (-> this hud-score) #f) + (set! (-> this hud-score) + (ppointer->handle (process-spawn board-score-hud :init hud-init-by-other :name "board-score-hud" :to this)) + ) + ) + (if (= (-> this hud-goal) #f) + (set! (-> this hud-goal) + (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :name "hud-goal" :to this)) + ) + ) + (set! (-> this roll-back-task?) #f) + (task-manager-bbush-board-method-32 this) + (none) + ) + +;; definition for method 33 of type task-manager-bbush-board +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-bbush-board-method-33 ((this task-manager-bbush-board)) + (when (< (-> *game-info* goal) (-> this score)) + (set! (-> this new-high-score) #t) + (when (>= (the-as uint 3) (-> this goal-cup)) + (sound-play "special-pickup") + (+! (-> this goal-cup) 1) + ) + ) + (set! (-> *game-info* goal) + (game-info-method-31 *game-info* (the-as int (-> this game-score)) (the-as int (-> this goal-cup))) + ) + (let ((v1-14 (handle->process (-> this hud-goal)))) + (when v1-14 + (let ((s5-1 format) + (s4-1 (clear (-> (the-as hud v1-14) strings 1 text))) + (s3-0 "~S") + ) + (let* ((s2-0 format) + (s1-0 (clear *temp-string*)) + (a0-13 *common-text*) + (t9-5 (method-of-object a0-13 lookup-text!)) + (v1-17 (-> this goal-cup)) + ) + (s2-0 s1-0 (t9-5 + a0-13 + (cond + ((= v1-17 1) + (text-id text-0139) + ) + ((= v1-17 2) + (text-id text-0138) + ) + ((= v1-17 3) + (text-id text-0137) + ) + (else + (text-id text-0136) + ) + ) + #f + ) + ) + ) + (s5-1 s4-1 s3-0 *temp-string*) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 34 of type task-manager-bbush-board +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-bbush-board-method-34 ((this task-manager-bbush-board) (arg0 float)) + (set! (-> this roll-back-task?) #t) + (let* ((s2-0 (-> this game-score)) + (s4-0 (game-info-method-29 *game-info* (the-as int s2-0))) + (t0-0 (get-highscore-rank *game-info* (the-as int s2-0) arg0)) + (s3-1 (max 0 (- t0-0 s4-0))) + ) + (let ((t9-2 format) + (a0-3 #t) + (a1-3 "report-score ~s ~f my-cup ~d prev-cup ~d eggs ~d~%") + (v1-4 s2-0) + ) + (t9-2 + a0-3 + a1-3 + (cond + ((= v1-4 7) + "snake-total-jump-distance" + ) + ((= v1-4 5) + "snake-total-air-time" + ) + ((= v1-4 10) + "hoverboard" + ) + ((= v1-4 12) + "gungame-2" + ) + ((= v1-4 17) + "arena-training" + ) + ((= v1-4 8) + "snake-roll-count" + ) + ((= v1-4 14) + "gungame-4" + ) + ((= v1-4 6) + "snake-jump-distance" + ) + ((= v1-4 13) + "gungame-3" + ) + ((= v1-4 4) + "snake-air-time" + ) + ((= v1-4 9) + "wascity-gungame-1" + ) + ((zero? v1-4) + "none" + ) + ((= v1-4 15) + "power-game" + ) + ((= v1-4 3) + "snake-race" + ) + ((= v1-4 1) + "neo-sat-game" + ) + ((= v1-4 16) + "destroy-interceptors" + ) + ((= v1-4 11) + "gungame-1" + ) + ((= v1-4 2) + "turtle-race" + ) + (else + "*unknown*" + ) + ) + arg0 + t0-0 + s4-0 + s3-1 + ) + ) + (game-info-method-27 *game-info* (the-as game-score s2-0) arg0) + (let ((v1-7 (new 'static 'fact-info)) + (f30-0 (* (the float s3-1) (the float (-> this info user-count)))) + ) + (set! (-> v1-7 options) (actor-option)) + (logior! (-> v1-7 options) (actor-option suck-in)) + (cond + ((< (the-as uint s4-0) (the-as uint 3)) + (cond + ((zero? s3-1) + (send-event this 'fail) + ) + (else + (give *game-info* 'skill f30-0 (the-as handle #f)) + (until (time-elapsed? (-> this state-time) (the int (* 45.0 f30-0))) + (suspend) + ) + ) + ) + ) + (else + (let ((f0-5 (game-info-method-31 *game-info* (the-as int (-> this game-score)) (the-as int (-> this goal-cup))))) + (if (< arg0 f0-5) + (send-event this 'fail) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-bbush-board) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trick-judge) + (set! (-> self score) (the-as float (-> block param 1))) + (let ((v0-0 (the-as object #t))) + (set! (-> self challenge-done) (the-as symbol v0-0)) + v0-0 + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (until #f + (set! (-> self score) 0.0) + (set! (-> self challenge-done) #f) + (send-event *target* 'get-notify self) + (let ((gp-1 (ppointer->handle (judge-spawn self (target-pos 0) (the-as uint 0) #t)))) + (suspend) + (while (send-event (handle->process (the-as handle gp-1)) 'waiting) + (suspend) + ) + (set! (-> self last-cup) (the-as uint (game-info-method-29 *game-info* (the-as int (-> self game-score))))) + (format #t "last-cup: ~d~%" (-> self last-cup)) + (set! (-> self goal-cup) (+ (-> self last-cup) 1)) + (suspend) + (while (send-event (handle->process (the-as handle gp-1)) 'judging) + (set! (-> self score) (-> *game-info* score)) + (task-manager-bbush-board-method-33 self) + (suspend) + ) + ) + (send-event (handle->process (-> self hud-score)) 'hide-and-die) + (send-event (handle->process (-> self hud-goal)) 'hide-and-die) + (task-manager-bbush-board-method-34 self (-> self score)) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (let ((v1-41 (process->ppointer self))) + (set! (-> a1-9 from) v1-41) + ) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'complete) + (send-event-function self a1-9) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate resolution (task-manager-bbush-board) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-31 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (cond + ((-> self roll-back-task?) + (let ((a0-13 (-> self node-info parent-node 0))) + (task-node-open! a0-13 'event) + ) + ) + (else + (task-node-close! (-> self info final-node) 'event) + ) + ) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-31 (or (handle->process (-> self arrow)) (begin + (countdown (v1-32 4) + (when (handle->process (-> self hud v1-32)) + (set! v1-31 #t) + (goto cfg-42) + ) + ) + #f + ) + ) + ) + (label cfg-42) + v1-31 + ) + (suspend) + ) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-tower-smoke-cty + :id 297 + :flags (sp0 sp4 sp11) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1286 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1286 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.001 0.05) + (:x (meters -10) (meters 20)) + (:y (meters -30)) + (:z (meters -10) (meters 20)) + (:scale-x (meters 40) (meters 10)) + (:rot-z (degrees 160) (degrees 40)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 10.0) + (:a 0.0) + (:vel-y (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.033333335)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.13333334 0.26666668) + (:accel-x (meters 0.00016666666)) + (:friction 0.997) + (:timer (seconds 166.67)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 1287) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1287 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 1288) + ) + ) + +;; failed to figure out what this is: +(defpart 1288 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14222223) + (:fade-g 0.031111112) + (:fade-b 0.13111112) + (:next-time (seconds 2)) + (:next-launcher 1289) + ) + ) + +;; failed to figure out what this is: +(defpart 1289 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.006 -0.0024)) + ) + +;; definition of type mh-tower-smoke-cty +(deftype mh-tower-smoke-cty (process-drawable) + () + (:state-methods + idle + die + ) + ) + +;; definition for method 3 of type mh-tower-smoke-cty +(defmethod inspect ((this mh-tower-smoke-cty)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 10 of type mh-tower-smoke-cty +(defmethod deactivate ((this mh-tower-smoke-cty)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (mh-tower-smoke-cty) + :virtual #t + :code sleep-code + :post (behavior () + (spawn (-> self part) (-> self root trans)) + ) + ) + +;; failed to figure out what this is: +(defstate die (mh-tower-smoke-cty) + :virtual #t + :code (behavior () + '() + ) + ) + +;; definition for method 12 of type mh-tower-smoke-cty +(defmethod run-logic? ((this mh-tower-smoke-cty)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 11 of type mh-tower-smoke-cty +(defmethod init-from-entity! ((this mh-tower-smoke-cty) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 297) this)) + (cond + ((not (task-node-closed? (game-task-node tower-destroy-resolution))) + (cleanup-for-death this) + (go (method-of-object this die)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-part_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-part_REF.gc new file mode 100644 index 0000000000..b7e770929c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/ctywide-part_REF.gc @@ -0,0 +1,3094 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-stadium-light + :id 258 + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1165 :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 1166 :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 1165 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 48.5) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1166 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 96) (meters 0.1)) + (:rot-x (degrees 78.75)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-baron-propoganda-holo + :id 259 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1173 :flags (is-3d sp6 sp7)) + (sp-item 1174 :fade-after (meters 150) :flags (sp6 sp7)) + (sp-item 1175 :binding 1167) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1168) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1169) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1170) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1171) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1172) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1168) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1169) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1170) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1171) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1172) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1168) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1169) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1170) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1171) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1172) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1168) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1169) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1170) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1171) + (sp-item 1167 :flags (sp1 sp2 sp3) :binding 1172) + (sp-item 1168 :flags (is-3d sp1 sp2)) + (sp-item 1169 :flags (is-3d sp1 sp2)) + (sp-item 1170 :flags (is-3d sp1 sp2)) + (sp-item 1171 :flags (is-3d sp1 sp2)) + (sp-item 1172 :flags (is-3d sp1 sp2)) + (sp-item 1168 :flags (is-3d sp1 sp2)) + (sp-item 1169 :flags (is-3d sp1 sp2)) + (sp-item 1170 :flags (is-3d sp1 sp2)) + (sp-item 1171 :flags (is-3d sp1 sp2)) + (sp-item 1172 :flags (is-3d sp1 sp2)) + (sp-item 1168 :flags (is-3d sp1 sp2)) + (sp-item 1169 :flags (is-3d sp1 sp2)) + (sp-item 1170 :flags (is-3d sp1 sp2)) + (sp-item 1171 :flags (is-3d sp1 sp2)) + (sp-item 1172 :flags (is-3d sp1 sp2)) + (sp-item 1168 :flags (is-3d sp1 sp2)) + (sp-item 1169 :flags (is-3d sp1 sp2)) + (sp-item 1170 :flags (is-3d sp1 sp2)) + (sp-item 1171 :flags (is-3d sp1 sp2)) + (sp-item 1172 :flags (is-3d sp1 sp2)) + (sp-item 1176 :flags (is-3d sp6 sp7)) + (sp-item 1177 :fade-after (meters 150) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 1177 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.9 0.1) + (:y (meters 3.1)) + (:scale-x (meters 2) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 17) (degrees 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 1 128.0) + (:b 0.0 128.0) + (:a 16.0 16.0) + (:omega (degrees 3386.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 2048.0) + ) + ) + +;; definition for function birth-func-ctywide-baron-propoganda-ticker-rotate +;; WARN: Return type mismatch int vs none. +(defun birth-func-ctywide-baron-propoganda-ticker-rotate ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-6 float) (v1-7 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg4 sprite))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 arg2) + (f0-0 (-> v1-0 qx-qy-qz-sy x)) + (f1-0 (-> v1-0 qx-qy-qz-sy y)) + (f2-0 (-> v1-0 qx-qy-qz-sy z)) + ) + (set! (-> s4-0 x) f0-0) + (set! (-> s4-0 y) f1-0) + (set! (-> s4-0 z) f2-0) + (set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion-rotate-y! s4-0 s4-0 (+ 8192.0 (-> s5-0 sprite flag-rot-sy z))) + (let ((v1-5 arg2)) + (cond + ((< (-> s4-0 w) 0.0) + (.lvf vf1 (&-> v1-5 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-5 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + (else + (.lvf vf1 (&-> v1-5 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-5 qx-qy-qz-sy quad) vf1) + (.mov v1-7 vf1) + ) + ) + ) + ) + (set! (-> arg2 r-g-b-a w) (-> s5-0 sprite r-g-b-a w)) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defpart 1175 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.1) + (:y (meters 5)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 1167 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 2)) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 96.0) + (:a 0.0) + (:omega (degrees 45)) + (:vel-x (meters 0.02)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees 0.45)) + (:fade-a 0.8) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:next-time (seconds 0.267)) + (:next-launcher 1178) + ) + ) + +;; failed to figure out what this is: +(defpart 1178 + :init-specs ((:a 64.0) (:fade-a 0.0) (:next-time (seconds 1.467)) (:next-launcher 1179)) + ) + +;; failed to figure out what this is: +(defpart 1179 + :init-specs ((:fade-a -0.8)) + ) + +;; failed to figure out what this is: +(defpart 1168 + :init-specs ((:texture (ticker-a ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 1169 + :init-specs ((:texture (ticker-b ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 1170 + :init-specs ((:texture (ticker-c ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 1171 + :init-specs ((:texture (ticker-d ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 1172 + :init-specs ((:texture (ticker-e ctywide-sprite)) + (:birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (:num 1.0) + (:y (meters 0)) + (:scale-x (meters 0.65)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 1174 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0 96.0) + (:b :copy g) + (:a 20.0 4.0) + (:omega (degrees 3386.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 10240.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1173 + :init-specs ((:texture (baron-propoganda-logo ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 192.0) + (:g 0.0 64.0) + (:b :copy g) + (:a 96.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1176 + :init-specs ((:texture (baron-propoganda-logo ctywide-sprite)) + (:num 1.0) + (:y (meters 5.75)) + (:z (meters 0.05)) + (:scale-x (meters 6.5) (meters 0.5)) + (:rot-x (degrees 80) (degrees 4)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 16.0) + (:a 32.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-14 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-burning-bush-holo-on + :id 260 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1180 :flags (is-3d sp6 sp7)) + (sp-item 1181 :flags (is-3d sp6 sp7)) + (sp-item 1182 :flags (is-3d sp6 sp7)) + (sp-item 1183 :fade-after (meters 150) :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1183 + :init-specs ((:texture (green-lightning level-default-sprite)) + (:num 2.0 4.0) + (:x (meters -2.25) (meters 4.5)) + (:y (meters 6.1)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 6)) + (:r 128.0 1 128.0) + (:g 255.0) + (:b 128.0) + (:a 0.0) + (:fade-a 1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.067)) + (:next-launcher 1184) + (:rotate-y (degrees 0) 1 (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 1184 + :init-specs ((:fade-a -1.6)) + ) + +;; failed to figure out what this is: +(defpart 1180 + :init-specs ((:texture (baron-propoganda-logo ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.02)) + (:scale-x (meters 3.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 120.0) + (:b 0.0) + (:a 160.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1182 + :init-specs ((:texture (rod-of-god level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 6)) + (:r 32.0) + (:g 0.0) + (:b 255.0) + (:a 32.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1181 + :init-specs ((:texture (baron-propoganda-logo ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.02)) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-burning-bush-holo-off + :id 261 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1185 :flags (is-3d sp6 sp7)) + (sp-item 1186 :flags (is-3d sp6 sp7)) + (sp-item 1187 :flags (is-3d sp6 sp7)) + (sp-item 1188 :flags (is-3d sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1185 + :init-specs ((:texture (burning-bush-off ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.02)) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1187 + :init-specs ((:texture (rod-of-god level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 6)) + (:r 64.0 64.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 32.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1188 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees -90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 6)) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 0.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1186 + :init-specs ((:texture (burning-bush-off ctywide-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.02)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-burning-bush-holo-red + :id 262 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1189 :flags (is-3d sp6 sp7)) (sp-item 1190 :fade-after (meters 150) :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 1189 + :init-specs ((:texture (rod-of-god level-default-sprite)) + (:num 1.0) + (:y (meters 5)) + (:z (meters 0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1190 + :init-specs ((:texture (lightning-darkjak level-default-sprite)) + (:num 2.0 4.0) + (:x (meters -2.25) (meters 4.5)) + (:y (meters 4.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 3) (meters 1.5)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.067)) + (:next-launcher 1191) + (:rotate-y (degrees 0) 1 (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-palace-high-fire + :id 263 + :flags (sp8) + :bounds (static-bspherem 0 2 0 5) + :parts ((sp-item 1192 :fade-after (meters 500) :falloff-to (meters 600)) + (sp-item 1193 :fade-after (meters 500) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 1192 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 4) (meters 2)) + (:scale-y (meters 4) (meters 2)) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 32.0 32.0) + (:vel-x (meters 0) (meters -0.0033333334)) + (:scalevel-x (meters -0.009375)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -0.1 -0.1) + (:accel-y (meters 0.00083333335) (meters 0.00066666666)) + (:timer (seconds 0.535) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpart 1193 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.5) + (:y (meters 4)) + (:scale-x (meters 16) (meters 0.5)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-red-1 + :id 264 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1194 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-red-2 + :id 265 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1194 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-red-3 + :id 266 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1194 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 800 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-red-4 + :id 267 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1194 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 1200 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 1194 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 3)) + (:r 255.0) + (:g 40.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.035)) + (:scalevel-y (meters 0.03)) + (:fade-a 0.08) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 1195) + ) + ) + +;; failed to figure out what this is: +(defpart 1195 + :init-specs ((:scale-y (meters 6)) + (:a 16.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 1196) + ) + ) + +;; failed to figure out what this is: +(defpart 1196 + :init-specs ((:scalevel-x (meters -0.035)) + (:scalevel-y (meters -0.03)) + (:fade-a -0.08) + (:next-time (seconds 0.335)) + (:next-launcher 1197) + ) + ) + +;; failed to figure out what this is: +(defpart 1197 + :init-specs ((:scale-y (meters 3)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-blue-1 + :id 268 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1198 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-blue-2 + :id 269 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1198 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-blue-3 + :id 270 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1198 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 1198 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 8)) + (:r 0.0) + (:g 128.0 32.0) + (:b 255.0) + (:a 4.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.0005)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 1199) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-cable-lights + :id 271 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 1200 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpart 1200 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 12) (meters 4)) + (:rot-x (degrees 56.25)) + (:rot-z (degrees 17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 64.0) + (:b 64.0) + (:a 20.0 8.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slums-seal-of-mar-glow + :id 272 + :flags (sp6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 90) (degrees 0) (degrees 90)) + :parts ((sp-item 1201) (sp-item 1202) (sp-item 1203 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1201 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.5) + (:z (meters -0.05)) + (:scale-x (meters 0.9) (meters 0.25)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0 16.0) + (:b 12.0 4.0) + (:a 16.0 16.0) + (:fade-a -1.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1202 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.5) + (:z (meters 0.05)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0 16.0) + (:b 12.0 4.0) + (:a 12.0 12.0) + (:fade-a -0.48) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1203 + :init-specs ((:texture (glow level-default-sprite)) + (:num 4.0 2.0) + (:x (meters 0.2)) + (:scale-x (meters 0.01) (meters 0.0025)) + (:scale-y :copy scale-x) + (:r 196.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 128.0 128.0) + (:vel-x (meters 0.02) (meters 0.02)) + (:fade-a -0.42666668 -0.42666668) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-chimney + :id 273 + :flags (sp8) + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 1204 :fade-after (meters 600) :falloff-to (meters 600)) + (sp-item 1205 :fade-after (meters 600) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 1205 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 13513.499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1204 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.3) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 1206) + ) + ) + +;; failed to figure out what this is: +(defpart 1206 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 1207)) + ) + +;; failed to figure out what this is: +(defpart 1207 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 1208) + ) + ) + +;; failed to figure out what this is: +(defpart 1208 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 1209) + ) + ) + +;; failed to figure out what this is: +(defpart 1209 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-chimney-smoke + :id 274 + :flags (sp8) + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 1210 :fade-after (meters 950) :falloff-to (meters 1200))) + ) + +;; failed to figure out what this is: +(defpart 1210 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 1211) + ) + ) + +;; failed to figure out what this is: +(defpart 1211 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 1212) + ) + ) + +;; failed to figure out what this is: +(defpart 1212 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyind-sparks + :id 275 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1213 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 1214 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + (sp-item 1214 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1213 + :init-specs ((:texture (gun-blue-hit-spek level-default-sprite)) + (:num 10.0) + (:scale-x (meters 0.05) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0 128.0) + (:a 128.0 128.0) + (:omega (degrees 0.0675)) + (:vel-z (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters -0.0016666667)) + (:friction 0.96 0.02) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 1)) + (:next-launcher 1215) + (:conerot-y (degrees -30) (degrees 60)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1215 + :init-specs ((:fade-a -0.85333335 -0.85333335)) + ) + +;; failed to figure out what this is: +(defpart 1214 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.1) + (:x (meters -0.5) (meters 1)) + (:y (meters -0.5) (meters 1)) + (:z (meters 1)) + (:scale-x (meters 1) (meters 3)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a -512.0 5 128.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyind-hot-gas + :id 276 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1216 :falloff-to (meters 60) :flags (sp7)) + (sp-item 1217 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1216 + :init-specs ((:num 1.0) + (:rot-x 5) + (:rot-z (degrees 0) (degrees 360)) + (:r 8192.0) + (:g 3276.8 1638.4) + (:b 4096.0) + (:vel-z (meters 0.1)) + (:timer (seconds 0.417)) + (:flags (distort)) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1217 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:z (meters 1)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-z (meters 0.1)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-color-gas-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-alpha-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-gas-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-gas-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *r-curve-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.45 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :w 0.2) + :one-over-x-deltas (new 'static 'vector :y -20.000008 :z 0.36363637 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *g-curve-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.45 :z -0.5 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 0.1) + :one-over-x-deltas (new 'static 'vector :y -17.999996 :z -0.2 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *b-curve-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-alpha-gas-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :y 10.000001 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-gas-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 0.8 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :y 0.39999998 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-gas-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 0.8 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :y 0.39999998 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-ctyind-hot-gas-curve-settings*, type particle-curve-settings +(define *part-ctyind-hot-gas-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.1) + :flags (particle-curve-flags pcf0 pcf1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 1217 init-specs 14 initial-valuef) + (the-as float *part-ctyind-hot-gas-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* color-start) *range-color-gas-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* alpha-start) *range-alpha-gas-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* scale-x-start) *range-scale-gas-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* scale-y-start) *range-scale-gas-flame-y*) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* r-scalar) *r-curve-gas-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* g-scalar) *g-curve-gas-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* b-scalar) *b-curve-gas-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* a-scalar) *curve-alpha-gas-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* scale-x-scalar) *curve-gas-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-ctyind-hot-gas-curve-settings* scale-y-scalar) *curve-gas-flame-y*) + +;; failed to figure out what this is: +(defpartgroup group-ctyind-rubble-smoke + :id 277 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1218 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1218 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 1219) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1219 + :init-specs ((:fade-a -0.11636364)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyind-electric-arc + :id 278 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1220 :fade-after (meters 100) :falloff-to (meters 200) :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 1220 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.01 0.05) + (:scale-x (meters 5.8)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-z (degrees -90) 1 (degrees 180)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:vel-z (meters 0.033333335)) + (:scalevel-x (meters 0.01)) + (:rotvel-x (degrees 0.6)) + (:rotvel-y (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.415)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 30)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-red-wall-light + :id 279 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1221 :fade-after (meters 80) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +;; failed to figure out what this is: +(defpart 1221 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0) + (:b 0.0) + (:a 20.0 2.0) + (:omega (degrees 2261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-blue-wall-light + :id 280 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1222 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +;; failed to figure out what this is: +(defpart 1222 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5.5) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 20.0) + (:b 255.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-long-blue-light + :id 281 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1223 :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +;; failed to figure out what this is: +(defpart 1223 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 90)) + (:scale-y (meters 5)) + (:r 20.0) + (:g 20.0) + (:b 255.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-long-blue-lightb + :id 282 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1224 :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +;; failed to figure out what this is: +(defpart 1224 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0)) + (:scale-y (meters 5)) + (:r 20.0) + (:g 20.0) + (:b 255.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-streetlight + :id 283 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 1225 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111111000000) + (sp-item 1226 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111111000000) + (sp-item 1227 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 1225 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:y (meters 0.1)) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 1226 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 30.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 1227 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 10.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-lamp-glow + :id 284 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1228 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +;; failed to figure out what this is: +(defpart 1228 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 60.0) + (:b 20.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-yellow-light + :id 285 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1229 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +;; failed to figure out what this is: +(defpart 1229 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 100.0) + (:b 20.0) + (:a 30.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-steam-vent + :id 286 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 1230 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1230 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.1) + (:x (meters -0.5) (meters 1)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.53333336) + (:accel-y (meters 0.00006666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x405c00 #x400000)) + (:next-time (seconds 0.5)) + (:next-launcher 1231) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1231 + :init-specs ((:fade-a -0.07619048 -0.07619048)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-bulb-orange-glow + :id 287 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 1232 :fade-after (meters 2400) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 1232 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 5)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 90.0) + (:b 20.0) + (:a 8.0 4.0) + (:omega (degrees 20270.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-green-chimney-smoke + :id 288 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 48) + :parts ((sp-item 1233 :fade-after (meters 1800) :falloff-to (meters 2000))) + ) + +;; failed to figure out what this is: +(defpart 1233 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1 0.1) + (:scale-x (meters 8) (meters 1)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 20.0 10.0) + (:g 80.0 20.0) + (:b 20.0 10.0) + (:a 0.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.00033333333) (meters 0.00033333333)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 2.56) + (:accel-x (meters -0.0005) (meters 0.000033333334)) + (:accel-y (meters 0.00006666667) (meters 0.000016666667)) + (:accel-z (meters -0.00006666667) (meters 0.000033333334)) + (:friction 0.99) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.167)) + (:next-launcher 1234) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-z (degrees -10) (degrees 20)) + (:rotate-y (degrees 20)) + ) + ) + +;; failed to figure out what this is: +(defpart 1234 + :init-specs ((:scalevel-x (meters 0.001)) + (:fade-r -0.06666667) + (:fade-g -0.06666667) + (:fade-b -0.04) + (:fade-a -0.042666666 -0.042666666) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-heater-haze + :id 289 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 1235 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1235 + :init-specs ((:num 1.0) + (:x (meters -3) (meters 6)) + (:z (meters -4) (meters 8)) + (:rot-x 8) + (:r 12288.0) + (:g 4096.0) + (:b 4096.0) + (:fade-g 1.3653333) + (:accel-y (meters 0.00066666666) (meters 0.00033333333)) + (:friction 0.97) + (:timer (seconds 1)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1236) + ) + ) + +;; failed to figure out what this is: +(defpart 1236 + :init-specs ((:fade-g -1.3653333)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-fan-haze + :id 290 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 1237 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7)) + (sp-item 1238 :flags (is-3d sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1237 + :init-specs ((:num 1.0) + (:x (meters 0) (meters 8)) + (:rot-x 8) + (:r 12288.0) + (:g 4096.0) + (:b 4096.0) + (:vel-z (meters 0.16666667)) + (:fade-g 1.3653333) + (:accel-y (meters 0.00066666666) (meters 0.00033333333)) + (:friction 0.97) + (:timer (seconds 1)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1239) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1239 + :init-specs ((:fade-g -1.3653333)) + ) + +;; failed to figure out what this is: +(defpart 1238 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:z (meters -4)) + (:scale-x (meters 15)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 20.0) + (:b 255.0) + (:a 40.0 20.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-small-fountain + :id 291 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1240 :fade-after (meters 80) :falloff-to (meters 140) :flags (is-3d sp7)) + (sp-item 1241 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7)) + (sp-item 1242 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 1243 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 1244 :fade-after (meters 40) :falloff-to (meters 120) :flags (is-3d sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1240 + :init-specs ((:texture (wave-foam ctywide-sprite)) + (:num 1.5) + (:scale-x (meters 0.2) (meters 1)) + (:scale-y (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.011333333)) + (:accel-z (meters 0)) + (:friction 0.98) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:func 'spt-func-turn-to-vel-radial) + (:next-time (seconds 0.5)) + (:next-launcher 1245) + (:conerot-x (degrees -90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1245 + :init-specs ((:scalevel-x (meters -0.0033333334) (meters 0.006666667)) + (:scalevel-y (meters 0.006666667) (meters 0.02)) + (:accel-z (meters -0.0016666667)) + (:friction 0.9) + ) + ) + +;; failed to figure out what this is: +(defpart 1241 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:scale-y (meters 1) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.011666667)) + (:accel-z (meters 0)) + (:friction 0.98) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.5)) + (:next-launcher 1246) + (:conerot-x (degrees -90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1246 + :init-specs ((:scalevel-y (meters 0.006666667)) + (:accel-z (meters -0.0016666667)) + (:friction 0.9 0.05) + (:next-time (seconds 0.085) (seconds 0.665)) + (:next-launcher 1247) + ) + ) + +;; failed to figure out what this is: +(defpart 1247 + :init-specs ((:r 50.0 100.0) + (:g 50.0 100.0) + (:b 50.0 100.0) + (:a 128.0 128.0) + (:next-time (seconds 0.017) (seconds 0.015)) + (:next-launcher 1248) + ) + ) + +;; failed to figure out what this is: +(defpart 1248 + :init-specs ((:a 32.0 32.0) (:next-time (seconds 0.167) (seconds 0.665)) (:next-launcher 1247)) + ) + +;; failed to figure out what this is: +(defpart 1242 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 5.0) + (:x (meters 1.6) (meters 0.1)) + (:y (meters -4.3)) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 160.0) + (:b 160.0) + (:a 128.0) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:scalevel-y (meters 0.0033333334) (meters 0.006666667)) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1243 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 10.0) + (:x (meters 1.6) (meters 0.1)) + (:y (meters -4.3)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 220.0) + (:b 255.0) + (:a 64.0 64.0) + (:vel-y (meters 0.006666667) (meters 0.02)) + (:rotvel-z (degrees -4) (degrees 8)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13 left-multiply-quat)) + (:conerot-x (degrees -20) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1244 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:y (meters -4.3)) + (:scale-x (meters 5) (meters 0.3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 160.0) + (:b 160.0) + (:a 40.0) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406400 #x408200)) + (:next-time (seconds 0.167)) + (:next-launcher 1249) + ) + ) + +;; failed to figure out what this is: +(defpart 1249 + :init-specs ((:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56 -2.56) + (:next-time (seconds 0.085)) + (:next-launcher 1250) + ) + ) + +;; failed to figure out what this is: +(defpart 1250 + :init-specs ((:scalevel-x (meters 0.006666667)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-big-fountain + :id 292 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1251 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1251 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.5) (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.05) (meters 0.016666668)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 1.335)) + (:flags (launch-along-z left-multiply-quat)) + (:conerot-x (degrees 0) (degrees 3.0000002)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-big-fountain-top + :id 293 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1252 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7) :hour-mask #b111111000000000000111111) + (sp-item 1253 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7) :hour-mask #b111111111111000000) + (sp-item 1254 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7) :hour-mask #b111111111111000000) + (sp-item 1255 :fade-after (meters 80) :falloff-to (meters 140) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1252 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 8)) + (:r 180.0) + (:g 180.0) + (:b 180.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y (meters -0.026666667)) + (:fade-a -0.19692308 -0.19692308) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.835) (seconds 0.08)) + (:next-launcher 1256) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1256 + :init-specs ((:scalevel-y (meters 0.026666667)) (:fade-a -0.09846154)) + ) + +;; failed to figure out what this is: +(defpart 1257 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:scale-x (meters 8)) + (:rot-z (degrees 90) 1 (degrees 180)) + (:scale-y (meters 0.2) (meters 0.5)) + (:r 180.0) + (:g 180.0) + (:b 180.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters -0.026666667)) + (:scalevel-y (meters 0.006666667)) + (:fade-a -0.19692308 -0.19692308) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.835) (seconds 0.08)) + (:next-launcher 1258) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1258 + :init-specs ((:scalevel-x (meters 0.026666667)) (:fade-a -0.09846154)) + ) + +;; failed to figure out what this is: +(defpart 1253 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 8)) + (:r 0.0 40.0) + (:g 100.0 20.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y (meters -0.026666667)) + (:fade-r 0.12923077) + (:fade-g 0.03076923) + (:fade-a -0.19692308 -0.19692308) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.835) (seconds 0.08)) + (:next-launcher 1259) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1259 + :init-specs ((:scalevel-y (meters 0.026666667)) (:fade-a -0.09846154)) + ) + +;; failed to figure out what this is: +(defpart 1254 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:scale-x (meters 8)) + (:rot-z (degrees 90) 1 (degrees 180)) + (:scale-y (meters 0.2) (meters 0.5)) + (:r 0.0 40.0) + (:g 100.0 20.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters -0.026666667)) + (:scalevel-y (meters 0.006666667)) + (:fade-r 0.12923077) + (:fade-g 0.03076923) + (:fade-a -0.19692308 -0.19692308) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.835) (seconds 0.08)) + (:next-launcher 1260) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1260 + :init-specs ((:scalevel-x (meters 0.026666667)) (:fade-a -0.09846154)) + ) + +;; failed to figure out what this is: +(defpart 1255 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 2.0) + (:y (meters -1)) + (:scale-x (meters 1) (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 220.0) + (:g 220.0) + (:b 220.0) + (:a 64.0 64.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668 -0.42666668) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:conerot-x (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-big-fountain-top-light + :id 294 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1261 :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000)) + ) + +;; failed to figure out what this is: +(defpart 1261 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 1.0) + (:y (meters -2)) + (:scale-x (meters 200)) + (:rot-z (degrees 90)) + (:scale-y (meters 5)) + (:r 0.0 40.0) + (:g 100.0 20.0) + (:b 128.0) + (:a 60.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-barrel-fire + :id 295 + :bounds (static-bspherem 0 3 0 4) + :parts ((sp-item 1263 :fade-after (meters 50) :falloff-to (meters 80)) + (sp-item 1264 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 0.335) :length (seconds 0.167)) + (sp-item 1265 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.4) :length (seconds 0.185) :offset 20) + (sp-item 1266 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 0.535) :length (seconds 0.1) :offset 35) + (sp-item 1264 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.85) :length (seconds 0.2) :offset 65) + (sp-item 1265 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 1.25) :length (seconds 0.135) :offset 15) + (sp-item 1266 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 1.435) :length (seconds 0.167) :offset 85) + (sp-item 1264 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 2) :length (seconds 0.235) :offset 100) + (sp-item 1265 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 4.167) :length (seconds 0.15) :offset 450) + (sp-item 1266 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 5) :length (seconds 0.085) :offset 115) + (sp-item 1264 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 7) :length (seconds 0.185) :offset 80) + (sp-item 1267 :fade-after (meters 20) :falloff-to (meters 10) :binding 1262) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1262 :flags (sp1 sp2 sp3)) + (sp-item 1268 :fade-after (meters 50) :falloff-to (meters 50)) + (sp-item 1269 :fade-after (meters 30) :falloff-to (meters 30)) + (sp-item 1270 :fade-after (meters 70) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 1270 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 12.0) + (:fade-a -0.4) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 10240.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1267 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 0.8) + (:sound (static-sound-spec "fire-pop" :group 0 :volume 10000.0)) + (:x (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:accel-y (meters -0.000033333334) (meters -0.00006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 1262 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.1) (meters 0.3)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 128.0) + (:b 128.0) + (:a 96.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.026666667) (meters 0.053333335)) + (:vel-y (meters 0)) + (:vel-z (meters -0.0013333333) (meters 0.0026666666)) + (:fade-r 0.0) + (:fade-g -0.7111111) + (:fade-b -0.7111111) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.6)) + (:next-launcher 1271) + ) + ) + +;; failed to figure out what this is: +(defpart 1271 + :init-specs ((:fade-r -1.0666667) (:fade-g 1.0666667) (:fade-b 1.0666667)) + ) + +;; failed to figure out what this is: +(defpart 1264 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 1272) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 87)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 1265 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 1272) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 120) (degrees 90)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 1266 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 1272) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 240) (degrees 110)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 1272 + :init-specs ((:b 0.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.4 -0.2) + (:next-time (seconds 0.135) (seconds 0.03)) + (:next-launcher 1273) + ) + ) + +;; failed to figure out what this is: +(defpart 1273 + :init-specs ((:fade-r -0.125) (:fade-g 0.4) (:fade-b 0.4)) + ) + +;; failed to figure out what this is: +(defpart 1263 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 4.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 1268 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.4) + (:x (meters -0.25) (meters 0.5)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.64) + (:fade-g -0.32) + (:fade-b -0.32) + (:fade-a -0.017777778 -0.026666667) + (:accel-y (meters -0.000006666667)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.5) (seconds 0.165)) + (:next-launcher 1274) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 1274 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpart 1269 + :init-specs ((:num 0.4) + (:x (meters 0) (meters 0.2)) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-x (meters 0) (meters 0.006666667)) + (:vel-y (meters 0.02) (meters 0.013333334)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 1275) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 1275 + :init-specs ((:fade-b -0.68266666)) + ) + +;; failed to figure out what this is: +(defpartgroup group-hijack-kgpickup-explode + :id 296 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 1277 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1278 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1279 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1280 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1281 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1282 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1283 :period (seconds 30) :length (seconds 0.167)) + (sp-item 1284 :period (seconds 30) :length (seconds 0.5)) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1285 :flags (sp3) :binding 1276) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1276 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 1277 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1278 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1279 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1280 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1281 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-kgpickup-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-kgpickup-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-kgpickup-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-kgpickup-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-kgpickup-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-kgpickup-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-kgpickup-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-hijack-kgpickup-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-hijack-kgpickup-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 1281 init-specs 14 initial-valuef) + (the-as float *part-hijack-kgpickup-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* color-start) *range-kgpickup-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* alpha-start) *range-kgpickup-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* scale-x-start) + *range-kgpickup-dust-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* scale-y-start) + *range-kgpickup-dust-scale-y* + ) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* a-scalar) *curve-kgpickup-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* scale-x-scalar) + *curve-kgpickup-dust-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-dust-in-curve-settings* scale-y-scalar) + *curve-kgpickup-dust-scale-y* + ) + +;; failed to figure out what this is: +(defpart 1283 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1284 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-kgpickup-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-kgpickup-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-kgpickup-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-kgpickup-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-kgpickup-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-kgpickup-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-kgpickup-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-hijack-kgpickup-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-hijack-kgpickup-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 1284 init-specs 16 initial-valuef) + (the-as float *part-hijack-kgpickup-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* color-start) *range-kgpickup-color*) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* alpha-start) *range-kgpickup-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* scale-x-start) *range-kgpickup-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* scale-y-start) *range-kgpickup-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* a-scalar) *curve-kgpickup-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* scale-x-scalar) *curve-kgpickup-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-hijack-kgpickup-explosion-texture-curve-settings* scale-y-scalar) *curve-kgpickup-scale-y*) + +;; failed to figure out what this is: +(defpart 1282 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1285 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.033333335) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1276 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-scenes_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-scenes_REF.gc new file mode 100644 index 0000000000..f8224d4480 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/ctywide-scenes_REF.gc @@ -0,0 +1,2305 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-cara-movie cara cara-lod0-jg cara-idle-ja + ((cara-lod0-mg (meters 20)) (cara-lod0-mg (meters 40)) (cara-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :shadow cara-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "sewer-met-hum-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-192" + :art-group "scenecamera" + :anim "sewer-met-hum-intro" + :parts 17 + :command-list '((572 (part-tracker + "group-barrier-hand-shock" + entity + "jakc-highres" + joint + "rringA" + track + #t + duration + (frame-range 572 608) + ) + ) + (1930 (fadeout (frame-time-30 10))) + (10000 (task-close! "sewer-met-hum-introduction")) + ) + :cut-list '(1 61 149 198 227 398 533 616 758 903 1001 1033 1103 1285 1412 1508 1547 1728 1794) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'slumbset + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'slumbset + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(227 1103) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'lsamos + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'slumbset + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctygenb-samos" + :end-point "ctygenb-samos" + :borrow '((ctywide 4 lsamos special)) + :sfx-volume -1.0 + :ambient-volume 0.5 + :music-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "genb-mov-amb") ("barrier-mov-amb")) + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 21) (new 'static 'lightning-spec + :name "darkjak-punch-lightning" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.42 + :num-points 32 + :box-size 3686.4 + :merge-factor 0.5 + :merge-count 2 + :radius 409.6 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "city-get-dark-punch" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-189" + :art-group "scenecamera" + :anim "city-get-dark-punch" + :parts 5 + :command-list '((0 + (fma-sphere (nav kill-once) sphere (new 'static 'sphere :x -1554249.8 :y 40071.58 :z 4844934.5 :r 81920.0)) + (fadein (frame-time-30 2)) + (send-event + "darkjak-highres" + 'trans-hook + ,(lambda :behavior scene-player + () + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((< f0-0 230.0) + (set-darkjak-highres-texture-morph! 0.0) + ) + ((and (>= f0-0 230.0) (>= 330.0 f0-0)) + (set-darkjak-highres-texture-morph! (* 0.01 (+ -230.0 f0-0))) + ) + (else + (set-darkjak-highres-texture-morph! 1.0) + ) + ) + ) + (none) + ) + ) + ) + (4 (part-tracker + "group-metal-head-egg-explosion" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 4 23) + ) + ) + (10 (part-tracker + "group-fma-dark-eco-steam" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 10 600) + ) + ) + (15 (part-tracker + "group-fma-hand-steam" + entity + "darkjak-highres" + joint + "sk_lhand" + track + #t + duration + (frame-range 15 388) + ) + ) + (17 (part-tracker + "group-fma-hand-steam" + entity + "darkjak-highres" + joint + "sk_rhand" + track + #t + duration + (frame-range 17 450) + ) + ) + (40 (part-tracker + "group-fma-dark-eco-fire" + entity + "darkjak-highres" + joint + "sk_lhand" + track + #t + duration + (frame-range 40 340) + ) + ) + (100 (part-tracker + "group-fma-dark-eco-fire" + entity + "darkjak-highres" + joint + "sk_rhand" + track + #t + duration + (frame-range 100 400) + ) + ) + (358 (part-tracker + "group-fma-dark-eco-fire-flash" + entity + "darkjak-highres" + joint + "sk_lhand" + track + #t + duration + (frame-range 358 359) + ) + ) + (359 + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "particleman" + from-joint + "sk_lhand" + to-joint + "particleA" + duration + (frame-range 359 600) + ) + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "mhcity-de-tower-egg" + from-joint + "sk_lhand" + to-joint + "main" + duration + (frame-range 359 600) + ) + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "particleman" + from-joint + "sk_lhand" + to-joint + "particleA" + duration + (frame-range 359 600) + ) + ) + (400 (part-tracker + "group-fma-dark-eco-fire-flash" + entity + "darkjak-highres" + joint + "sk_rhand" + track + #t + duration + (frame-range 400 401) + ) + ) + (405 + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "mhcity-de-tower-egg" + from-joint + "sk_rhand" + to-joint + "main" + duration + (frame-range 405 600) + ) + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "particleman" + from-joint + "sk_rhand" + to-joint + "particleA" + duration + (frame-range 405 600) + ) + (lightning-tracker + "darkjak-punch-lightning" + from-entity + "darkjak-highres" + to-entity + "mhcity-de-tower-egg" + from-joint + "sk_rhand" + to-joint + "main" + duration + (frame-range 405 600) + ) + ) + (590 (fadeout (frame-time-30 10))) + (10000 (task-close! "city-destroy-darkeco-dark-punch")) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'mhctycst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "darkjak-highres" + :level 'mhctycst + :art-group "skel-darkjak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #xe0 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'mhctycst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "mhcity-de-tower-egg" + :level 'mhctycst + :art-group "skel-mhcity-de-tower-egg" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "mhcitya-fma" + :end-point "mhcitya-end-darkeco" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :music-delay 1500.0 + :scene-task #x8f + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-blue-gun-mod-three blue-gun-mod-three blue-gun-mod-three-lod0-jg blue-gun-mod-three-idle-ja + ((blue-gun-mod-three-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "city-destroy-grid-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-212" + :art-group "scenecamera" + :anim "city-destroy-grid-res" + :parts 9 + :command-list '((-30 (kill "krimson-wall-4") (kill "krimson-wall-5") (kill "krimson-wall-7") (fadein (frame-time-30 10))) + (1 (part-tracker + "group-fma-city-barrier-explosion-big" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 1 30) + ) + ) + (121 (part-tracker + "group-fma-cigar-smoke" + entity + "jinx-highres" + joint + "cigsmoke" + track + #t + duration + (frame-range 121 500) + subsample-num + (new 'static 'bfloat :data 5.0) + ) + ) + (412 + (part-tracker + "group-cara-thrusters" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 412 500) + ) + (part-tracker + "group-cara-thrusters" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 412 500) + ) + ) + (500 (fadeout (frame-time-30 10))) + (10000 (send-event self 'user-data-set! (task-closed? "city-destroy-grid-resolution"))) + ) + :cut-list '(106 249 311) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'gridcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'gridcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'gridcst + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "jinx-highres" + :level 'gridcst + :art-group "skel-jinx-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "talk-box" + :level #f + :art-group "skel-talk-box" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "cara-movie" + :level 'gridcst + :art-group "skel-cara-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x1fe + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'gridcst + :art-group "skel-krimson-wall-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'gridcst + :art-group "skel-krimson-wall-break" + :prefix "a-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'gridcst + :art-group "skel-krimson-wall-break" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "blue-gun-mod-three" + :level 'gridcst + :art-group "skel-blue-gun-mod-three" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctyinda-grid-res-a" + :end-point "ctyinda-grid-res-b" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete '(unless (send-event self 'user-data) (talker-spawn "powup010")) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-h-kg-pickup-fma kg-pickup kg-pickup-lod0-jg kg-pickup-idle-ja + ((kg-pickup-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.2) + :shadow kg-pickup-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-eco-canister-fma eco-canister eco-canister-dark-lod0-jg eco-canister-dark-idle-ja + ((eco-canister-dark-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.3) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-mhcity-tower-door-break-fma mhcity-tower-door-break mhcity-tower-door-break-lod0-jg mhcity-tower-door-break-idle-ja + ((mhcity-tower-door-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1000) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-purple-three-fma purple-three purple-three-lod0-jg purple-three-idle-ja + ((purple-three-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1000) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "tower-destroy-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-193" + :art-group "scenecamera" + :anim "tower-destroy-intro" + :parts 8 + :command-list '((0 + (fadein (frame-time-30 10)) + (kill "mhcity-tower-door-1") + (kill "mhcity-tower-door-2") + (apply ,(lambda :behavior scene-player + () + (if *target* + (process-drawable-show-all-cloth *target* #f) + ) + (none) + ) + ) + ) + (1 (kill "mhcity-tower-door-1")) + (182 + (part-tracker + "group-pickup-sparks" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-range 182 183) + ) + ) + (190 + (part-tracker + "group-pickup-sparks" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-range 190 191) + ) + ) + (196 + (part-tracker + "group-truck-explosion" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 196 226) + ) + (part-tracker + "group-mhcity-door-explode" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 196 226) + ) + ) + (680 (fadeout (frame-time-30 10))) + (10000 + (apply ,(lambda :behavior scene-player + () + (if *target* + (process-drawable-show-all-cloth *target* #t) + ) + (none) + ) + ) + (kill "mhcity-tower-door-2") + (send-event self 'user-data-set! (task-closed? "tower-destroy-introduction")) + (task-close! "tower-destroy-introduction") + ) + ) + :cut-list '(25 52 91 116 139 170 250 315 396 502 628) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'towercst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'towercst + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "jinx-highres" + :level 'towercst + :art-group "skel-jinx-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sig-highres" + :level 'towercst + :art-group "skel-sig-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'towercst + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-kg-pickup-fma" + :level 'towercst + :art-group "skel-h-kg-pickup-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min 25)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hellcat-movie" + :level 'towercst + :art-group "skel-hellcat-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "eco-canister-fma" + :level 'ctywide + :art-group "skel-eco-canister-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "mhcity-tower-door-break-fma" + :level 'towercst + :art-group "skel-mhcity-tower-door-break-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "purple-three-fma" + :level 'towercst + :art-group "skel-purple-three-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'towercst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "mhcityb-tower-fma" + :end-point "mhcityb-tower-fma-end" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :music-delay 1500.0 + :scene-task #xfd + :on-running '(begin (sound-play-loop "eco-amb-mov") (sound-play-loop "eco-bubbles-mov")) + :on-complete '(unless + (send-event self 'user-data) + (send-event *target* 'get-pickup (int 18) (float (new 'static 'bfloat :data 15.0))) + (talker-spawn "powup016") + ) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-pickup-sparks + :id 298 + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1290)) + ) + +;; failed to figure out what this is: +(defpart 1290 + :init-specs ((:texture (middot level-default-sprite)) + (:num 20.0 20.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 100.0 100.0) + (:omega (degrees 0.0225)) + (:vel-z (meters -0.06666667) (meters -0.16666667)) + (:fade-g -3.2) + (:fade-b -10.2) + (:accel-y (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 0.085) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 30) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mhcity-door-explode + :id 299 + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1291 :flags (sp3)) + (sp-item 1292 :period (seconds 20) :length (seconds 0.335)) + (sp-item 1293 :period (seconds 20) :length (seconds 0.085)) + ) + ) + +;; failed to figure out what this is: +(defpart 1291 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1292 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 20.0) + (:scale-x (meters 1) (meters 2)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 128.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.13333334) + (:fade-b -0.05) + (:fade-a -0.425 -0.425) + (:friction 0.9 0.05) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1293 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 128.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.06666667)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.13333334) + (:fade-b -0.05) + (:fade-a -0.425 -0.425) + (:friction 0.95 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 80) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-barrier-hand-shock + :id 300 + :flags (sp0) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1294 :flags (is-3d sp6))) + ) + +;; failed to figure out what this is: +(defpart 1294 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 50.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-metal-head-egg-explosion + :id 301 + :flags (sp0) + :bounds (static-bspherem 0 -2 0 24) + :parts ((sp-item 1295 :period (seconds 4) :length (seconds 0.035)) + (sp-item 1296 :period (seconds 4) :length (seconds 0.25)) + (sp-item 1297 :period (seconds 4) :length (seconds 0.335)) + (sp-item 1298 :period (seconds 4) :length (seconds 0.017)) + (sp-item 1299 :flags (sp3)) + (sp-item 1300 :flags (sp3)) + (sp-item 1301 :flags (sp3)) + ) + ) + +;; failed to figure out what this is: +(defpart 1295 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 1296 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 6.0) + (:scale-x (meters 0.1) (meters 0.9)) + (:scale-y :copy scale-x) + (:r 40.0 40.0) + (:g 10.0) + (:b 128.0) + (:a 100.0 100.0) + (:vel-y (meters 0.1) (meters 0.33333334)) + (:scalevel-x (meters 0.033333335) (meters 0.06666667)) + (:scalevel-y (meters 0.1) (meters 0.033333335)) + (:fade-a -2.0) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.167)) + (:next-launcher 1302) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 1302 + :init-specs ((:scalevel-x (meters 0.006666667)) + (:scalevel-y (meters 0.016666668)) + (:fade-r -0.2) + (:fade-g -0.2) + (:fade-a -1.0 -1.0) + (:friction 0.95) + ) + ) + +;; failed to figure out what this is: +(defpart 1297 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 4.0) + (:scale-x (meters 0.3) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 40.0 40.0) + (:g 0.0) + (:b 128.0) + (:a 128.0 128.0) + (:vel-y (meters 0.05) (meters 0.06666667)) + (:scalevel-x (meters 0.01) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-b -0.64) + (:fade-a -0.85 -0.85) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 1298 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:z (meters 2) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 40.0 40.0) + (:g 0.0) + (:b 128.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:rotate-x (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1299 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 10.0) + (:b 128.0) + (:a 255.0) + (:scalevel-x (meters 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.375) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 1300 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 80.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 40.0 40.0) + (:g 10.0) + (:b 128.0) + (:a 100.0 100.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.001) (meters -0.0013333333)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.0026666666)) + (:friction 0.9) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 1303 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 80)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 10.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6761.25)) + (:fade-a -2.55) + (:timer (seconds 0.335)) + (:flags (glow)) + (:userdata 4096.0) + ) + ) + +;; definition for function spt-birth-func-brightness-part-fma-dark-eco-steam +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-part-fma-dark-eco-steam ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 151) 50)) + (s3-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 61) 30)) + (s4-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 200)) + (v1-6 (mod (the-as int (rand-uint31-gen *random-generator*)) 61)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 s3-0))) + (set! (-> arg2 rotate-y) (the float (- s5-0 (the-as int s4-0)))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-dark-eco-steam + :id 302 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1304 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1304 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-part-fma-dark-eco-steam) + (:num 0.1) + (:z (meters 0) (meters 1)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.005925926)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.000033333334) (meters 0.00006666667)) + (:accel-y (meters 0.00033333333) (meters 0.000033333334)) + (:accel-z (meters -0.000033333334) (meters 0.00006666667)) + (:friction 0.94) + (:timer (seconds 10.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 1305) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1305 + :init-specs ((:fade-a -0.024615385 -0.024615385)) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-hand-steam + :id 303 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1306 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1306 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-part-fma-dark-eco-steam) + (:num 0.1) + (:scale-x (meters 3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters -0.01) (meters -0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-dark-eco-fire + :id 304 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1309 :flags (sp3) :binding 1307) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1307 :flags (sp2) :binding 1308) + (sp-item 1308 :flags (sp2)) + (sp-item 1308 :flags (sp2)) + (sp-item 1308 :flags (sp2)) + (sp-item 1308 :flags (sp2)) + (sp-item 1308 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 1309 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.42666668) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'part-tracker-track-root) + (:next-time (seconds 1)) + (:next-launcher 1310) + ) + ) + +;; failed to figure out what this is: +(defpart 1310 + :init-specs ((:fade-a 0.0) (:next-time (seconds 8)) (:next-launcher 1311)) + ) + +;; failed to figure out what this is: +(defpart 1311 + :init-specs ((:fade-a -0.42666668)) + ) + +;; failed to figure out what this is: +(defpart 1307 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.05 0.5) + (:y (meters 0) (meters 16)) + (:z (meters 0.04) (meters 0.04)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.006666667)) + (:accel-z (meters -0.00033333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +;; failed to figure out what this is: +(defpart 1308 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.3) + (:y (meters -0.05)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters -0.00083333335) (meters -0.00083333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.0) + (:fade-g -0.42666668) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-dark-eco-fire-flash + :id 305 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 1312 :flags (sp3))) + ) + +;; failed to figure out what this is: +(defpart 1312 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 0.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -3.4) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-cigar-smoke + :id 306 + :flags (sp0 sp4 sp13) + :bounds (static-bspherem 0 0 0 24) + :parts ((sp-item 1313 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1313 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0) (meters 0.01)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 80.0) + (:g :copy r) + (:b :copy r) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00016666666) (meters 0.00016666666)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.010666667 -0.010666667) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.9) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 3.335)) + (:next-launcher 1314) + ) + ) + +;; failed to figure out what this is: +(defpart 1314 + :init-specs ((:scalevel-x (meters 0.00066666666) (meters 0.00066666666)) + (:scalevel-y (meters 0.00066666666) (meters 0.00066666666)) + (:friction 0.85) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-city-barrier-explosion-big + :id 307 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 1316 :flags (sp3 sp7) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1317 :flags (sp7) :period (seconds 30) :length (seconds 0.035)) + (sp-item 1318 :flags (sp3 sp7) :period (seconds 30)) + (sp-item 1319 :flags (sp3 sp7) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1320 :flags (sp7) :period (seconds 30) :length (seconds 0.335)) + (sp-item 1321 :period (seconds 30) :length (seconds 0.5)) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1322 :flags (sp3 sp7) :binding 1315) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1315 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 1316 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1317 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1318 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.12307692) + (:fade-b -0.046153847) + (:fade-a -0.19692308 -0.19692308) + (:accel-z (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.93) + (:timer (seconds 2.167)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:next-time (seconds 0.335)) + (:next-launcher 1323) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1323 + :init-specs ((:friction 0.7)) + ) + +;; failed to figure out what this is: +(defpart 1320 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.5) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.10666667) + (:fade-b -0.04) + (:fade-a -0.17066666 -0.17066666) + (:accel-z (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.7) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.335)) + (:next-launcher 1324) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1324 + :init-specs ((:friction 0.7)) + ) + +;; failed to figure out what this is: +(defpart 1321 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.13333334)) + (:accel-z (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:next-time (seconds 0.335)) + (:next-launcher 1325) + (:conerot-z (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1325 + :init-specs ((:friction 0.7)) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fma-city-barrier-explo-big-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fma-city-barrier-explo-big-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fma-city-barrier-explo-big-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fma-city-barrier-explo-big-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fma-city-barrier-explo-big-alpha* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fma-city-barrier-explo-big-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fma-city-barrier-explo-big-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fma-city-barrier-explosion-big-texture-curve-settings*, type particle-curve-settings +(define *part-fma-city-barrier-explosion-big-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.7) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 1321 init-specs 17 initial-valuef) + (the-as float *part-fma-city-barrier-explosion-big-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* color-start) + *range-fma-city-barrier-explo-big-color* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* alpha-start) + *range-fma-city-barrier-explo-big-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* scale-x-start) + *range-fma-city-barrier-explo-big-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* scale-y-start) + *range-fma-city-barrier-explo-big-scale-y* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* a-scalar) + *curve-fma-city-barrier-explo-big-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* scale-x-scalar) + *curve-fma-city-barrier-explo-big-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-city-barrier-explosion-big-texture-curve-settings* scale-y-scalar) + *curve-fma-city-barrier-explo-big-scale-y* + ) + +;; failed to figure out what this is: +(defpart 1319 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1322 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.1)) + (:scalevel-x (meters -0.05) (meters -0.05)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1315 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 0.5) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0) + (:g 50.0 30.0) + (:b 0.0) + (:a 32.0 32.0) + (:fade-a -0.08533333 -0.08533333) + (:accel-y (meters 0) (meters -0.000033333334)) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-cara-thrusters + :id 308 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1326 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 1327 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 1326 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 20.0) + (:z (meters 1.5)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 3 (degrees 45)) + (:scale-y (meters 2) (meters 1)) + (:r 10.0 20.0) + (:g 200.0) + (:b 255.0) + (:a 10.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1327 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters 1.5)) + (:scale-x (meters 3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 12.0 1.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-truck-explosion + :id 309 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6) + :bounds (static-bspherem 0 0 0 60) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1328 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 1329 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 1330 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 1331 :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 1332 :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 1333 :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 1334 :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpart 1329 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow set-conerot)) + (:next-time (seconds 0.25)) + (:next-launcher 1335) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1335 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1334 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:next-time (seconds 0.085)) + (:next-launcher 1336) + (:conerot-x '*sp-temp*) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1333 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 3.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 1336) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1336 + :init-specs ((:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 1337) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1337 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 1338) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1338 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 1339) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1339 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125) (:rotate-y (degrees 0))) + ) + +;; failed to figure out what this is: +(defpart 1328 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:next-time (seconds 0.1)) + (:next-launcher 1340) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1340 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1332 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 1341) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1341 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 1342) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1342 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043) (:rotate-y (degrees 0))) + ) + +;; failed to figure out what this is: +(defpart 1330 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 1343) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1343 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 1344) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1344 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1331 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-speech_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-speech_REF.gc new file mode 100644 index 0000000000..92b5b2e95d --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/ctywide-speech_REF.gc @@ -0,0 +1,329 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function restore-city-speeches +;; WARN: Return type mismatch int vs none. +(defun restore-city-speeches () + (speech-table-set! + *speech-control* + (speech-type guard-generic-battle) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 3 + :delay-pre-time (seconds 1) + :request-timeout (seconds 2) + :min-delay (seconds 15) + :max-delay (seconds 25) + :list (new 'static 'boxed-array :type string + "grds109a" + "grds111a" + "grds112a" + "grds113a" + "grds114a" + "grds115a" + "grds116a" + "grds121a" + "grds124a" + "grds133a" + "grds144a" + "grds126a" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-battle-victory) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 6 + :request-timeout (seconds 0.5) + :min-delay (seconds 3) + :max-delay (seconds 5) + :list (new 'static 'boxed-array :type string + "grds127a" + "grds129a" + "grds128a" + "grds151a" + "grds152a" + "grds153a" + "grds157a" + "grds155a" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-change-targets) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next skip-first-time) + :priority 4 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1.5) + :min-delay (seconds 10) + :max-delay (seconds 20) + :list (new 'static 'boxed-array :type string "grds141a" "grds146a" "grds142a" "grds143a" "grds147a" "grds120a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-go-hostile) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 5 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1.5) + :min-delay (seconds 20) + :max-delay (seconds 40) + :list (new 'static 'boxed-array :type string + "grds144a" + "grds122a" + "grds104a" + "grds145a" + "grds126a" + "grds130a" + "grds164a" + "grds163a" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-hit) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 6 + :request-timeout (seconds 0.1) + :min-delay (seconds 10) + :max-delay (seconds 15) + :list (new 'static 'boxed-array :type string "grds134a" "grds135a" "grds136a" "grds137a" "grds138a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-witness-death) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next skip-first-time) + :priority 6 + :delay-pre-time (seconds 1) + :request-timeout (seconds 2) + :min-delay (seconds 10) + :max-delay (seconds 15) + :list (new 'static 'boxed-array :type string "grds148a" "grds149a" "grds187a" "grds117a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-chatter) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 1 + :delay-pre-time (seconds 1) + :request-timeout (seconds 3) + :min-delay (seconds 30) + :max-delay (seconds 60) + :list (new 'static 'boxed-array :type string + "grds181a" + "grds171a" + "grds172a" + "grds173a" + "grds174a" + "grds165a" + "grds158a" + "grds162a" + "grds183a" + "grds161a" + "grds182a" + "grds160a" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-chatter-jak) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next) + :priority 2 + :request-timeout (seconds 0.3) + :min-delay (seconds 30) + :max-delay (seconds 60) + :list (new 'static 'boxed-array :type string "grds180a" "grds186a" "grds176a" "grds175a" "grds177a" "grds184a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-bumped-by-jak) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order linked-next skip-first-time) + :priority 5 + :request-timeout (seconds 1) + :min-delay (seconds 3) + :max-delay (seconds 6) + :list (new 'static 'boxed-array :type string "grds167a" "grds168a" "grds169a" "grds170a" "grds179a") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-generic-battle-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 3 + :delay-pre-time (seconds 1) + :request-timeout (seconds 2) + :min-delay (seconds 15) + :max-delay (seconds 25) + :list (new 'static 'boxed-array :type string + "grds109b" + "grds111b" + "grds112b" + "grds113b" + "grds114b" + "grds115b" + "grds116b" + "grds121b" + "grds124b" + "grds133b" + "grds144b" + "grds126b" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-battle-victory-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 6 + :request-timeout (seconds 0.5) + :min-delay (seconds 3) + :max-delay (seconds 5) + :list (new 'static 'boxed-array :type string + "grds127b" + "grds129b" + "grds128b" + "grds151b" + "grds152b" + "grds153b" + "grds157b" + "grds155b" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-change-targets-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order skip-first-time) + :priority 4 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1.5) + :min-delay (seconds 10) + :max-delay (seconds 20) + :list (new 'static 'boxed-array :type string "grds141b" "grds146b" "grds142b" "grds143b" "grds147b" "grds120b") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-go-hostile-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 5 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1.5) + :min-delay (seconds 20) + :max-delay (seconds 40) + :list (new 'static 'boxed-array :type string + "grds144b" + "grds122b" + "grds104b" + "grds145b" + "grds126b" + "grds130b" + "grds164b" + "grds163b" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-hit-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 6 + :request-timeout (seconds 0.1) + :min-delay (seconds 10) + :max-delay (seconds 15) + :list (new 'static 'boxed-array :type string "grds134b" "grds135b" "grds136b" "grds137b" "grds138b") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-witness-death-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 6 + :delay-pre-time (seconds 1) + :request-timeout (seconds 2) + :min-delay (seconds 10) + :max-delay (seconds 15) + :list (new 'static 'boxed-array :type string "grds148b" "grds149b" "grds187b" "grds117b") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-chatter-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 1 + :delay-pre-time (seconds 1) + :request-timeout (seconds 3) + :min-delay (seconds 30) + :max-delay (seconds 60) + :list (new 'static 'boxed-array :type string + "grds181b" + "grds171b" + "grds172b" + "grds173b" + "grds174b" + "grds165b" + "grds158b" + "grds162b" + "grds183b" + "grds161b" + "grds182b" + "grds160b" + ) + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-chatter-jak-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 2 + :request-timeout (seconds 0.3) + :min-delay (seconds 30) + :max-delay (seconds 60) + :list (new 'static 'boxed-array :type string "grds180b" "grds186b" "grds176b" "grds175b" "grds177b" "grds184b") + ) + ) + (speech-table-set! + *speech-control* + (speech-type guard-bumped-by-jak-b) + (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 5 + :request-timeout (seconds 1) + :min-delay (seconds 3) + :max-delay (seconds 6) + :list (new 'static 'boxed-array :type string "grds167b" "grds168b" "grds169b" "grds170b" "grds179b") + ) + ) + (speech-control-method-17 *speech-control* (speech-type guard-chatter) 0.5) + (speech-control-method-17 *speech-control* (speech-type guard-witness-death) 1.0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc new file mode 100644 index 0000000000..1a8823580d --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc @@ -0,0 +1,376 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function wait-for-speech-end +(defun wait-for-speech-end ((arg0 sound-id)) + (while (nonzero? (get-status *gui-control* arg0)) + (suspend) + ) + #f + ) + +;; definition of type task-manager-city-vehicle-training-hover-zone-1 +(deftype task-manager-city-vehicle-training-hover-zone-1 (task-manager) + ((speech-id sound-id) + ) + ) + +;; definition for method 3 of type task-manager-city-vehicle-training-hover-zone-1 +(defmethod inspect ((this task-manager-city-vehicle-training-hover-zone-1)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tspeech-id: ~D~%" (-> this speech-id)) + (label cfg-4) + this + ) + +;; definition for method 26 of type task-manager-city-vehicle-training-hover-zone-1 +(defmethod task-manager-method-26 ((this task-manager-city-vehicle-training-hover-zone-1)) + (when (and (!= (-> this player-vehicle) #f) (not (and *target* (focus-test? *target* pilot)))) + (set! (-> this speech-id) + (talker-spawn-func (-> *talker-speech* 30) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (send-event this 'fail) + ) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-city-vehicle-training-hover-zone-1) + :virtual #t + :code (behavior () + (until #f + (if (and *target* (focus-test? *target* pilot)) + (goto cfg-7) + ) + (suspend) + ) + #f + (label cfg-7) + (set! (-> self player-vehicle) (-> *target* pilot vehicle)) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 26) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 28) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (while (let ((v1-36 (handle->process (-> self player-vehicle)))) + (not (logtest? (vehicle-flag flight-level-transition) (-> (the-as vehicle v1-36) v-flags))) + ) + (suspend) + ) + (wait-for-speech-end (-> self speech-id)) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 29) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (set! (-> self player-vehicle) (the-as handle #f)) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 1)) + (suspend) + ) + ) + (send-event self 'complete) + (let ((t9-14 (-> (find-parent-state) code))) + (if t9-14 + ((the-as (function none) t9-14)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate fail (task-manager-city-vehicle-training-hover-zone-1) + :virtual #t + :code (behavior ((arg0 resetter-params)) + (task-node-close! (game-task-node city-vehicle-training-hover-zone-1) 'event) + (sleep-code) + (let ((t9-3 (-> (find-parent-state) code))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate complete (task-manager-city-vehicle-training-hover-zone-1) + :virtual #t + :code (behavior () + (task-node-close! (game-task-node city-vehicle-training-hover-zone-2) 'event) + (let ((t9-2 (-> (find-parent-state) code))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +;; definition of type task-manager-city-vehicle-training-hover-zone-2 +(deftype task-manager-city-vehicle-training-hover-zone-2 (task-manager) + ((speech-id sound-id) + ) + ) + +;; definition for method 3 of type task-manager-city-vehicle-training-hover-zone-2 +(defmethod inspect ((this task-manager-city-vehicle-training-hover-zone-2)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tspeech-id: ~D~%" (-> this speech-id)) + (label cfg-4) + this + ) + +;; definition for method 26 of type task-manager-city-vehicle-training-hover-zone-2 +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-city-vehicle-training-hover-zone-2)) + (if (not (and *target* (focus-test? *target* pilot))) + (send-event this 'fail) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-city-vehicle-training-hover-zone-2) + :virtual #t + :code (behavior () + (set-time! (-> self state-time)) + (until #f + (cond + ((and *target* (focus-test? *target* pilot)) + (let ((v1-8 (the-as vehicle (handle->process (-> *target* pilot vehicle))))) + (if (logtest? (vehicle-flag flight-level-transition) (-> v1-8 v-flags)) + (go-virtual complete) + ) + ) + ) + (else + (set-time! (-> self state-time)) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 60)) + (goto cfg-18) + ) + (suspend) + ) + #f + (label cfg-18) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 28) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (until #f + (let ((v1-35 (handle->process (-> *target* pilot vehicle)))) + (if (logtest? (vehicle-flag flight-level-transition) (-> (the-as vehicle v1-35) v-flags)) + (goto cfg-30) + ) + ) + (suspend) + ) + #f + (label cfg-30) + (wait-for-speech-end (-> self speech-id)) + (set! (-> self speech-id) + (talker-spawn-func (-> *talker-speech* 29) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (wait-for-speech-end (-> self speech-id)) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 3)) + (suspend) + ) + ) + (go-virtual complete) + ) + ) + +;; definition of type cty-hijack-intro +(deftype cty-hijack-intro (task-manager) + () + ) + +;; definition for method 3 of type cty-hijack-intro +(defmethod inspect ((this cty-hijack-intro)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate active (cty-hijack-intro) + :virtual #t + :trans (behavior () + ((-> (method-of-object self wait) trans)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 5)) + (suspend) + ) + ) + (until (< 327680.0 + (vector-vector-xz-distance (target-pos 0) (new 'static 'vector :x -285696.0 :y 36044.8 :z 5443625.0 :w 1.0)) + ) + (suspend) + ) + (set-setting! 'airlock-command '(("hip-door-a-6" close)) 0.0 0) + (talker-spawn-func (-> *talker-speech* 162) *entity-pool* (target-pos 0) (the-as region #f)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 5)) + (suspend) + ) + ) + (until (handle-command-list *gui-control* (gui-channel voicebox) (the-as gui-connection #f)) + (suspend) + ) + (send-event self 'complete) + ) + ) + +;; definition for method 25 of type cty-hijack-intro +(defmethod task-manager-method-25 ((this cty-hijack-intro)) + (nop!) + (call-parent-method this) + (none) + ) + +;; definition of type task-manager-force-load-borrows +(deftype task-manager-force-load-borrows (task-manager) + () + ) + +;; definition for method 3 of type task-manager-force-load-borrows +(defmethod inspect ((this task-manager-force-load-borrows)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate active (task-manager-force-load-borrows) + :virtual #t + :exit (behavior () + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + ) + :trans (behavior () + '() + ) + :code (behavior () + (local-vars (v1-22 symbol)) + (send-event (ppointer->process *time-of-day*) 'change 'hour 8) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (when (> (-> (task-perm-by-index *game-info* 46) user-uint64) 0) + (set-blackout-frames (seconds 100)) + (until (process-grab? *target* #f) + (suspend) + ) + ) + (until v1-22 + (suspend) + (set! v1-22 (and (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) + (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) + (= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) + ) + ) + ) + (send-event self 'complete) + ) + ) + +;; definition of type task-manager-blackout +(deftype task-manager-blackout (task-manager) + () + ) + +;; definition for method 3 of type task-manager-blackout +(defmethod inspect ((this task-manager-blackout)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate active (task-manager-blackout) + :virtual #t + :code (behavior () + (persist-with-delay *setting-control* 'task-manager-blackout (seconds 10) 'music 'portattk 0.0 0) + (persist-with-delay + *setting-control* + 'task-manager-blackout2 + (seconds 10) + 'city-sound + (the-as symbol '(portatk1)) + 0.0 + 2 + ) + (set-blackout-frames (seconds 100)) + (send-event self 'complete) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-texture_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-texture_REF.gc new file mode 100644 index 0000000000..9776e42fdb --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/ctywide-texture_REF.gc @@ -0,0 +1,203 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *security-texture-anim-array*, type (texture-anim-array texture-anim) +(define *security-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x2 + :func #f + :init-func #f + :tex #f + :tex-name "security-env-dest" + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 4800.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + :data (new 'static 'array texture-anim-layer 2 + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 4800.0 + :tex-name "security-env-uscroll" + :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0 0.5)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 4.0 0.5)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 4800.0 + :tex-name "security-env-uscroll" + :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 2.0 3.0)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "security-dot-dest" + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 600.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :data (new 'static 'array texture-anim-layer 6 + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 4800.0 + :tex-name "common-white" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "security-dot-src" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0078125 0.015625)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.0078125 0.015625)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "security-dot-src" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0078125 0.140625)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 2.0078125 0.140625)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + ) + ) + ) + +;; definition for function set-security-color! +;; INFO: Used lq/sq +(defun set-security-color! ((arg0 vector)) + (let ((v1-1 (-> *security-texture-anim-array* array-data 0))) + (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) + (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) + (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) + ) + (let ((v1-5 (-> *security-texture-anim-array* array-data 1))) + (set! (-> v1-5 data 1 start-color quad) (-> arg0 quad)) + (set! (-> v1-5 data 1 end-color quad) (-> arg0 quad)) + (set! (-> v1-5 data 2 start-color quad) (-> arg0 quad)) + (let ((v0-0 (-> v1-5 data 2 end-color))) + (set! (-> v0-0 quad) (-> arg0 quad)) + v0-0 + ) + ) + ) + +;; definition for function set-security-flash! +;; INFO: Used lq/sq +(defun set-security-flash! ((arg0 vector)) + (let ((v1-1 (-> *security-texture-anim-array* array-data 1))) + (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + (let ((v0-0 (-> v1-1 data 0 end-color))) + (set! (-> v0-0 quad) (-> arg0 quad)) + v0-0 + ) + ) + ) + +;; definition for function set-security-texture-masks! +;; INFO: Used lq/sq +(defun set-security-texture-masks! ((arg0 vector)) + (local-vars (a3-3 uint128) (a3-4 uint128)) + (let ((v1-3 (-> *security-texture-anim-array* array-data 0 data 0 tex)) + (a1-3 (-> *security-texture-anim-array* array-data 1 data 1 tex)) + ) + (when (and v1-3 a1-3) + (dotimes (a2-1 3) + (let ((a3-2 (-> (the-as (pointer uint128) (+ (the-as uint arg0) (* a2-1 16))))) + (t0-2 (-> v1-3 masks data a2-1 mask quad)) + ) + (.por a3-3 a3-2 t0-2) + ) + (let ((t0-5 (-> a1-3 masks data a2-1 mask quad))) + (.por a3-4 a3-3 t0-5) + ) + (set! (-> (the-as (pointer uint128) (+ (the-as uint arg0) (* a2-1 16)))) a3-4) + ) + #f + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc b/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc new file mode 100644 index 0000000000..f33d504cb7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc @@ -0,0 +1,2460 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type jinx-hud +(deftype jinx-hud (hud) + () + ) + +;; definition for method 3 of type jinx-hud +(defmethod inspect ((this jinx-hud)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type jinx-hud +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this jinx-hud)) + (set-hud-piece-position! + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) + ) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 6 2) + (set! (-> this sprites 3 scale-x) 1.2) + (set! (-> this sprites 3 scale-y) 1.25) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type jinx-hud +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this jinx-hud)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type jinx-hud +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this jinx-hud)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-transparent-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-npcring-bar-01 level-default-minimap))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tid) (the-as texture-id (get-texture hud-npcring-01 level-default-minimap))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #x9f8))) + ) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 pos z) #xffffff) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-jinx jinx jinx-lod0-jg jinx-idle0-ja + ((jinx-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow jinx-shadow-mg + :origin-joint-index 14 + :shadow-joint-index 14 + ) + +;; definition for symbol *jinx-nav-enemy-info*, type nav-enemy-info +(define *jinx-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (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 8 + :die-falling-anim 8 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 7 + :bullseye-joint 5 + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 20.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.7 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 45056.0 + :knocked-soft-vxz-hi 54067.2 + :knocked-soft-vy-lo 38092.8 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 65536.0 + :knocked-medium-vxz-hi 74547.2 + :knocked-medium-vy-lo 65536.0 + :knocked-medium-vy-hi 73728.0 + :knocked-hard-vxz-lo 66355.2 + :knocked-hard-vxz-hi 85196.8 + :knocked-hard-vy-lo 60620.8 + :knocked-hard-vy-hi 101580.8 + :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 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 73728.0 + :knocked-red-vy-lo 65536.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 40960.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -2) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #f + :use-pacing #f + :walk-anim 9 + :turn-anim -1 + :run-anim 10 + :taunt-anim -1 + :run-travel-speed (meters 10) + :run-acceleration (meters 14) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 8) + :walk-turning-acceleration (meters 6) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 10) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *jinx-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; failed to figure out what this is: +(set! (-> *jinx-nav-enemy-info* nav-mesh) *default-nav-mesh*) + +;; definition for symbol *citizen-jinx-global-info*, type civilian-global-info +(define *citizen-jinx-global-info* (new 'static 'civilian-global-info :seat-flag #x2)) + +;; definition of type jinx +(deftype jinx (civilian) + ((min-speed float) + (max-speed float) + (follow-offset float) + (travel-anim-interp float) + (travel-prev-ry float) + (travel-prev-ry1 float) + (player-blocking float) + (follow-dir vector :inline) + (destination vector :inline) + (nav-mesh-aid actor-id) + (health-handle handle) + (box-time float) + (jinx-flags jinx-flag :offset 1212) + ) + (:state-methods + traveling-blocked + traveling + waiting-idle + undefined0 + go-power-box + do-power-box + ) + (:methods + (adjust-target-speed (_type_) none) + (player-blocking-travel? (_type_) symbol) + (travel-anim (_type_) int) + (update-nav-mesh (_type_) none) + (move-cam-to-jinx (_type_) object) + (set-cam-height (_type_ vector) float) + ) + ) + +;; definition for method 3 of type jinx +(defmethod inspect ((this jinx)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type civilian inspect))) + (t9-0 this) + ) + (format #t "~2Tmin-speed: ~f~%" (-> this min-speed)) + (format #t "~2Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~2Tfollow-offset: ~f~%" (-> this follow-offset)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> this travel-anim-interp)) + (format #t "~2Ttravel-prev-ry: ~f~%" (-> this travel-prev-ry)) + (format #t "~2Ttravel-prev-ry1: ~f~%" (-> this travel-prev-ry1)) + (format #t "~2Tplayer-blocking: ~f~%" (-> this player-blocking)) + (format #t "~2Tfollow-dir: #~%" (-> this follow-dir)) + (format #t "~2Tdestination: #~%" (-> this destination)) + (format #t "~2Tnav-mesh-aid: ~D~%" (-> this nav-mesh-aid)) + (format #t "~2Thealth-handle: ~D~%" (-> this health-handle)) + (format #t "~2Tbox-time: ~f~%" (-> this box-time)) + (format #t "~2Tattacker-info: #~%" (-> this attacker-info)) + (format #t "~2Tmission-squad: ~A~%" (-> this mission-squad)) + (format #t "~2Tjinx-flags: ~D~%" (-> this jinx-flags)) + (label cfg-4) + this + ) + +;; definition for method 243 of type jinx +;; WARN: Return type mismatch int vs none. +(defmethod update-nav-mesh ((this jinx)) + (when (= (-> this nav state mesh) *default-nav-mesh*) + (let ((a0-4 (find-nearest-nav-mesh (-> this root trans) 0.0))) + (when a0-4 + (change-to a0-4 this) + (let ((v1-7 (-> this nav state))) + (set! (-> v1-7 current-poly) (the-as nav-poly #f)) + ) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 81 of type jinx +(defmethod go-die ((this jinx)) + ((method-of-type nav-enemy go-die) this) + ) + +;; definition for method 139 of type jinx +(defmethod move-above-ground! ((this jinx) (arg0 vector) (arg1 move-above-ground-params)) + ((method-of-type nav-enemy move-above-ground!) this arg0 arg1) + (none) + ) + +;; definition for method 160 of type jinx +(defmethod normalize-heading! ((this jinx) (arg0 nav-control)) + ((method-of-type nav-enemy normalize-heading!) this arg0) + (none) + ) + +;; definition for method 187 of type jinx +(defmethod nav-enemy-method-187 ((this jinx)) + ((method-of-type nav-enemy nav-enemy-method-187) this) + (none) + ) + +;; definition for method 59 of type jinx +(defmethod enemy-common-post ((this jinx)) + (logior! (-> this flags) (citizen-flag persistent)) + (update-nav-mesh this) + (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) + (set! (-> this travel-prev-ry1) (quaternion-y-angle (-> this root quat))) + (set! (-> *game-info* bot-health 0) (/ (-> this hit-points) (-> this enemy-info default-hit-points))) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; definition for method 241 of type jinx +(defmethod player-blocking-travel? ((this jinx)) + (let ((s5-0 #f)) + (when *target* + (let ((a1-0 (-> *target* control trans)) + (v1-4 (-> this root)) + (f0-0 14336.0) + ) + (when (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> v1-4 trans) a1-0)) + (let ((v1-8 (-> *target* control transv))) + (when (>= (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) 2048.0) + (if (logtest? (-> this nav state flags) (nav-state-flag avoiding-sphere)) + (set! s5-0 #t) + ) + ) + ) + ) + ) + ) + (let* ((f0-8 (-> this player-blocking)) + (f0-10 (if s5-0 + (seek f0-8 1.0 (seconds-per-frame)) + (seek f0-8 0.0 (seconds-per-frame)) + ) + ) + ) + (set! (-> this player-blocking) f0-10) + (= f0-10 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait-for-ride (jinx) + :virtual #t + :enter (behavior () + (when (and (nonzero? (-> self vehicle)) (-> self vehicle)) + (let ((a0-1 (the-as vehicle (handle->process (-> self vehicle))))) + (when a0-1 + (remove-riders a0-1 (the-as handle self)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + ) + ) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :exit #f + :trans (behavior () + (when (and (nonzero? (-> self vehicle)) (-> self vehicle)) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info object-type) + (((traffic-type civilian-car-a) (traffic-type civilian-car-b) (traffic-type civilian-car-c)) + (go-virtual move-to-vehicle) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 jinx-idle0-ja) (= v1-2 jinx-idle1-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (let ((gp-0 (rnd-int self 5))) + (while (>= gp-0 0) + (let ((v1-18 (ja-group))) + (if (not (and v1-18 (= v1-18 jinx-idle0-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! jinx-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (+! gp-0 -1) + ) + ) + (let ((v1-50 (ja-group))) + (if (not (and v1-50 (= v1-50 jinx-idle1-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (stop-look-at! self) + (ja-no-eval :group! jinx-idle1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-look-at-mode! self 1) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate move-to-vehicle (jinx) + :virtual #t + :enter (behavior () + (let ((gp-0 (the-as vehicle (handle->process (-> self vehicle))))) + (set! (-> self seat) + (get-best-seat gp-0 (-> self root trans) (the-as vehicle-seat-flag (-> self info seat-flag)) 1) + ) + (if (!= (-> self seat) -1) + (put-rider-in-seat gp-0 (-> self seat) self) + ) + ) + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s0-0 (the-as vehicle (handle->process (-> self vehicle))))) + (cond + ((and (-> self vehicle) s0-0) + (cond + ((!= (-> self seat) -1) + (vehicle-method-66 s0-0 gp-0 (-> self seat)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (set! (-> s2-0 quad) (-> self root trans quad)) + (set! (-> s1-0 quad) (-> gp-0 quad)) + (vector-! s5-0 gp-0 (-> s0-0 root trans)) + (vector-z-quaternion! s4-0 (-> self root quat)) + (let ((f30-1 (* 0.5 (vector-vector-xz-distance s2-0 s1-0)))) + (vector-normalize! s4-0 (* 2.0 f30-1)) + (vector-normalize! s5-0 (* 4.0 f30-1)) + ) + (do-spline2 s3-0 s2-0 s4-0 s1-0 s5-0 0.8) + (set! (-> s3-0 y) (-> self root trans y)) + (let ((v1-20 (-> self nav state))) + (logclear! (-> v1-20 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-20 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-20 target-pos quad) (-> s3-0 quad)) + ) + ) + 0 + (if (and (< (vector-dot (vector-normalize! s4-0 1.0) (vector-normalize! s5-0 1.0)) -0.5) + (< (vector-vector-xz-distance gp-0 (-> self root trans)) 18432.0) + (< (fabs (- (-> gp-0 y) (-> self root trans y))) 20480.0) + ) + (go-virtual board-vehicle) + ) + ) + ) + (else + (go-virtual wait-for-ride) + ) + ) + ) + (else + (go-virtual wait-for-ride) + ) + ) + ) + (if (< 204800.0 (vector-vector-xz-distance gp-0 (-> self root trans))) + (go-virtual wait-for-ride) + ) + ) + ) + :code (behavior () + (until #f + (travel-anim self) + (suspend) + ) + #f + ) + ) + +;; definition for function board-vehicle-get-in-car-jump +(defbehavior board-vehicle-get-in-car-jump jinx ((arg0 vector) (arg1 quaternion) (arg2 symbol)) + (let ((s0-0 (the-as vehicle (handle->process (-> self vehicle)))) + (s1-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s0-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! s3-0 (-> s0-0 root quat)) + (vehicle-method-66 s0-0 s1-0 (-> self seat)) + (vector-! s4-0 s1-0 arg0) + (let ((f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (cond + (arg2 + (set! f30-1 (- 1.0 f30-1)) + (quaternion-rotate-local-y! s3-0 s3-0 (* f30-1 (if (zero? (-> self seat)) + 16384.0 + -16384.0 + ) + ) + ) + ) + (else + (quaternion-rotate-local-y! s3-0 s3-0 (* f30-1 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + (quaternion-slerp! (-> self root quat) arg1 s3-0 f30-1) + (vector+float*! (-> self root trans) arg0 s4-0 f30-1) + ) + ) + ) + +;; definition for function board-vehicle-get-in-car-land +(defbehavior board-vehicle-get-in-car-land jinx ((arg0 symbol)) + (let ((s4-0 (the-as vehicle (handle->process (-> self vehicle)))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s4-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! gp-0 (-> s4-0 root quat)) + (vehicle-method-66 s4-0 (-> self root trans) (-> self seat)) + (let ((f0-0 1.0)) + (if arg0 + (quaternion-rotate-local-y! gp-0 gp-0 (* f0-0 (if (zero? (-> self seat)) + 16384.0 + -16384.0 + ) + ) + ) + (quaternion-rotate-local-y! gp-0 gp-0 (* f0-0 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + (quaternion-copy! (-> self root quat) gp-0) + ) + ) + +;; definition for function board-vehicle-get-in-car-sit +(defbehavior board-vehicle-get-in-car-sit jinx ((arg0 symbol)) + (let ((s4-0 (the-as vehicle (handle->process (-> self vehicle)))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s4-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! gp-0 (-> s4-0 root quat)) + (vehicle-method-66 s4-0 (-> self root trans) (-> self seat)) + (let ((f0-2 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (if arg0 + (set! f0-2 (- 1.0 f0-2)) + ) + (if arg0 + (quaternion-rotate-local-y! (-> self root quat) gp-0 (* (- 1.0 f0-2) (if (zero? (-> self seat)) + 16384.0 + -16384.0 + ) + ) + ) + (quaternion-rotate-local-y! (-> self root quat) gp-0 (* (- 1.0 f0-2) (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + ) + ) + +;; definition for function board-vehicle-get-in-car-end +(defbehavior board-vehicle-get-in-car-end jinx () + (let ((gp-0 (the-as vehicle (handle->process (-> self vehicle))))) + (if (not gp-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! (-> self root quat) (-> gp-0 root quat)) + (vehicle-method-66 gp-0 (-> self root trans) (-> self seat)) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate board-vehicle (jinx) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jinx-get-in-car-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) + (ja-no-eval :group! jinx-get-in-car-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-jump gp-0 s5-0 #f) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-no-eval :group! jinx-get-in-car-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-land #f) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-get-in-car-sit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-sit #f) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-get-in-car-sit-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-end) + (suspend) + (ja :num! (seek!)) + ) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (jinx) + :virtual #t + :code (behavior () + (cond + ((enemy-method-109 self) + (go-die self) + ) + ((>= 0.0 (-> self box-time)) + (go-virtual wait-for-ride) + ) + (else + (go-virtual go-power-box) + ) + ) + ) + ) + +;; definition for method 232 of type jinx +(defmethod civilian-method-232 ((this jinx) (arg0 vector)) + (let ((s3-0 (the-as vehicle (handle->process (-> this vehicle)))) + (s4-0 (new 'stack 'collide-query)) + ) + (vehicle-method-66 s3-0 arg0 (-> this seat)) + (vector-! arg0 arg0 (-> s3-0 root trans)) + (vector-normalize! arg0 (+ 18432.0 (vector-length arg0))) + (vector+! arg0 arg0 (-> s3-0 root trans)) + (when (enemy-above-ground? this s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> arg0 y) (-> s4-0 best-other-tri intersect y)) + (let ((v1-14 (-> this nav)) + (a1-10 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-10 vertex)) arg0 (the-as vector (-> v1-14 state mesh bounds))) + (set! (-> a1-10 vertex1 x) (-> v1-14 nearest-y-threshold)) + (set! (-> a1-10 data 20) (the-as uint 2)) + (if (nav-mesh-method-45 (-> v1-14 state mesh) a1-10) + (return #t) + ) + ) + ) + ) + #f + ) + +;; failed to figure out what this is: +(defstate exit-vehicle (jinx) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((a0-1 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) + (if a0-1 + (set! (-> self nav-mesh-aid) (the-as actor-id (-> a0-1 entity aid))) + ) + (change-to a0-1 self) + ) + (when (not (-> self nav)) + (format #t "nav mesh not found~%") + (go-inactive self) + ) + (let ((v1-11 (-> self nav state))) + (set! (-> v1-11 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a0-5 (-> self nav state)) + (v1-14 (-> self dest-point)) + ) + (logclear! (-> a0-5 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-5 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-5 target-pos quad) (-> v1-14 quad)) + ) + 0 + (citizen-method-195 self) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (logior! (-> self flags) (citizen-flag persistent)) + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + (set-time! (-> self state-time)) + (let ((v1-28 (-> self root root-prim))) + (set! (-> v1-28 prim-core collide-as) (collide-spec)) + (set! (-> v1-28 prim-core collide-with) (collide-spec)) + ) + 0 + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + ) + :exit (behavior () + (set! (-> self box-time) 15.0) + (let ((t9-0 (-> (method-of-type civilian exit-vehicle) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (remove-riders (the-as vehicle (handle->process (-> self vehicle))) (the-as handle self)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (set-time! (-> self state-time)) + (while (not (civilian-method-232 self gp-0)) + (let ((s5-0 (the-as vehicle (handle->process (-> self vehicle)))) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s4-0 (-> s5-0 root quat)) + (vehicle-method-66 s5-0 (-> self root trans) (-> self seat)) + (quaternion-copy! (-> self root quat) s4-0) + ) + (when (time-elapsed? (-> self state-time) (seconds 2)) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride) + ) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jinx-get-out-car-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-end) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-get-out-car-getup-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-sit #t) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-get-out-car-start-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-land #t) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> gp-0 quad)) + (let ((gp-1 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) + (ja-no-eval :group! jinx-get-out-car-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (board-vehicle-get-in-car-jump s5-1 gp-1 #t) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (let ((v1-133 (-> self root root-prim))) + (set! (-> v1-133 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-133 prim-core collide-with) (-> self root backup-collide-with)) + ) + (send-event (ppointer->process (-> self parent)) 'go-power-box) + (go-virtual go-power-box) + ) + ) + +;; failed to figure out what this is: +(defstate waiting-idle (jinx) + :virtual #t + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> self destination))) + (let ((v1-0 (target-pos 0))) + (let ((a0-1 (-> self follow-dir))) + (let ((a1-0 (-> self follow-offset))) + (.mov vf7 a1-0) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-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 (&-> gp-0 quad) vf6) + ) + (if (< 12288.0 (vector-vector-distance (-> self destination) (-> self root trans))) + (go-virtual traveling) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 jinx-idle0-ja) (= v1-2 jinx-idle1-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (let ((gp-0 (rnd-int self 5))) + (while (>= gp-0 0) + (let ((v1-18 (ja-group))) + (if (not (and v1-18 (= v1-18 jinx-idle0-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! jinx-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (+! gp-0 -1) + ) + ) + (let ((v1-50 (ja-group))) + (if (not (and v1-50 (= v1-50 jinx-idle1-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (stop-look-at! self) + (ja-no-eval :group! jinx-idle1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-look-at-mode! self 1) + ) + #f + ) + :post (behavior () + (transform-post) + ) + ) + +;; failed to figure out what this is: +(defstate traveling (jinx) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (stop-look-at! self) + (nav-enemy-method-177 self) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> self destination))) + (let ((v1-0 (target-pos 0))) + (let ((a0-1 (-> self follow-dir))) + (let ((a1-0 (-> self follow-offset))) + (.mov vf7 a1-0) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-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 (&-> gp-0 quad) vf6) + ) + (cond + ((< (vector-vector-distance (-> self destination) (-> self root trans)) 8192.0) + (go-virtual waiting-idle) + ) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (player-blocking-travel? self)) + (go-virtual traveling-blocked) + ) + ) + ) + ) + :code (behavior () + (until #f + (travel-anim self) + (suspend) + ) + #f + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self destination)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate go-power-box (jinx) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (stop-look-at! self) + (nav-enemy-method-177 self) + ) + :trans (behavior () + (set! (-> self destination quad) (-> self event-param-point quad)) + (if (< (vector-vector-distance (-> self destination) (-> self root trans)) 10240.0) + (go-virtual do-power-box) + ) + ) + :code (behavior () + (until #f + (travel-anim self) + (suspend) + ) + #f + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self destination)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate do-power-box (jinx) + :virtual #t + :event enemy-event-handler + :trans (behavior () + (set! (-> self box-time) (- (-> self box-time) (seconds-per-frame))) + ) + :code (behavior () + (stop-look-at! self) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jinx-kneel-down-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-3 (vector-! (new 'stack-no-clear 'vector) (-> self destination) (-> self root trans)))) + (seek-toward-heading-vec! (-> self root) a1-3 65536.0 0) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jinx-kneel-fix-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! jinx-kneel-loop0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (< (-> self box-time) 0.0) + #t + (goto cfg-16) + ) + (ja-no-eval :group! jinx-kneel-loop1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (< (-> self box-time) 0.0) + #t + (goto cfg-16) + ) + ) + #f + (label cfg-16) + (ja-no-eval :group! jinx-kneel-up-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-look-at-mode! self 1) + (go-virtual wait-for-ride) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate traveling-blocked (jinx) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-182 self) + (nav-enemy-method-178 self) + (nav-enemy-method-184 self) + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (not (player-blocking-travel? self))) + (go-virtual traveling) + ) + ) + :code (-> (method-of-type jinx waiting-idle) code) + :post nav-enemy-simple-post + ) + +;; definition for method 240 of type jinx +;; WARN: Return type mismatch int vs none. +(defmethod adjust-target-speed ((this jinx)) + (-> this root) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> this destination) (-> this root trans)) + (vector-normalize-copy! (-> this follow-dir) s5-0 1.0) + (let* ((f0-1 (vector-dot (-> this follow-dir) s5-0)) + (f0-2 (- (- (-> this follow-offset)) f0-1)) + ) + 0.0 + (let ((f0-5 (if (>= f0-2 0.0) + (- 1.0 (* 0.000048828126 (fmin 20480.0 f0-2))) + (* -0.000048828126 (fmax -20480.0 f0-2)) + ) + ) + (s5-1 (-> this nav)) + ) + (set! (-> s5-1 target-speed) (lerp (-> this min-speed) (-> this max-speed) f0-5)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 242 of type jinx +(defmethod travel-anim ((this jinx)) + (with-pp + (adjust-target-speed this) + (let ((f30-0 (-> this nav state speed))) + (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 12288.0 40960.0))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + ) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-9 (= v1-9 (-> this draw art-group data 9))) + (let ((v1-14 (-> this skel root-channel 1))) + (set! (-> v1-14 frame-interp 1) f28-0) + (set! (-> v1-14 frame-interp 0) f28-0) + ) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) + (f0-8 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) + (f0-11 (/ (* 16.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) + (a0-11 (-> this skel root-channel 0)) + ) + (set! (-> a0-11 param 0) f0-11) + (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-12 (-> this skel root-channel 1))) + (set! (-> a0-12 param 0) 0.0) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (else + (ja-channel-push! 2 (seconds 0.15)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 dist) 13107.2) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 9))) + (set! (-> a0-14 param 0) 1.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 9)) num-func-loop!) + ) + (let ((a0-15 (-> this skel root-channel 1))) + (set! (-> a0-15 frame-interp 1) f28-0) + (set! (-> a0-15 frame-interp 0) f28-0) + (set! (-> a0-15 dist) 21843.969) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) + (set! (-> a0-15 param 0) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-chan) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 82 of type jinx +(defmethod event-handler ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('nav-mesh-kill) + (set! (-> this nav-mesh-aid) (the-as actor-id (-> this nav state mesh entity aid))) + (change-to *default-nav-mesh* this) + #t + ) + (else + ((method-of-type civilian event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 84 of type jinx +(defmethod send-attack-on-jump-or-knocked ((this jinx) (arg0 process) (arg1 event-message-block)) + (cond + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) + ) + ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-6 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask enemy) (-> arg0 mask)) + (and v1-6 + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 12 of type jinx +(defmethod run-logic? ((this jinx)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 194 of type jinx +;; WARN: Return type mismatch citizen-flag vs none. +(defmethod citizen-method-194 ((this jinx)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (logior! (-> this flags) (citizen-flag persistent)) + (none) + ) + +;; definition for method 210 of type jinx +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-210 ((this jinx) (arg0 int) (arg1 process)) + 0 + (none) + ) + +;; definition for method 120 of type jinx +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this jinx)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 5734.4 0.0 7372.8) + (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 bot bot-targetable)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> v1-13 local-sphere) 0.0 3686.4 0.0 3686.4) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 5939.2 0.0 3686.4) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-17 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-17 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-17 local-sphere) 0.0 8192.0 0.0 3686.4) + ) + (set! (-> s5-0 nav-radius) 5734.4) + (let ((v1-19 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 6)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 119 of type jinx +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-defaults! ((this jinx) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) + (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (t9-0 this arg0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + 0 + (none) + ) + +;; definition for method 121 of type jinx +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this jinx)) + (set-vector! (-> this follow-dir) 0.0 0.0 1.0 1.0) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask bot)) + (set! (-> this min-speed) 24576.0) + (set! (-> this max-speed) 49152.0) + (set! (-> this follow-offset) 24576.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this info) *citizen-jinx-global-info*) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-jinx" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *jinx-nav-enemy-info*) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this shield-handle) (the-as handle #f)) + (set! (-> this health-handle) + (ppointer->handle (process-spawn jinx-hud :init hud-init-by-other :name "jinx-hud" :to this)) + ) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (-> this mission-squad) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 13) + (set! (-> this attacker-info max-num-attackers) (the-as uint 2)) + (logior! (-> this attacker-info flags) (city-attacker-info-flag cai1)) + ) + (go (method-of-object this wait-for-ride)) + 0 + (none) + ) + +;; definition of type task-manager-city-destroy-grid +(deftype task-manager-city-destroy-grid (task-manager) + ((jinx handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (next-box uint32) + (arrow-h handle) + (goal-pos vector :inline) + (goal-pos-front vector :inline) + (sub-state uint32) + (vehicle handle) + (wall-h handle) + (sound-name string) + (id sound-id) + (delay time-frame) + (delay-start time-frame) + (end-time time-frame :offset 360) + (intro-play? symbol) + ) + (:methods + (update-jinx-speech (_type_) none) + (set-speech-name (_type_ string int int) none) + ) + ) + +;; definition for method 3 of type task-manager-city-destroy-grid +(defmethod inspect ((this task-manager-city-destroy-grid)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tjinx: ~D~%" (-> this jinx)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tnext-box: ~D~%" (-> this next-box)) + (format #t "~2Tarrow-h: ~D~%" (-> this arrow-h)) + (format #t "~2Tgoal-pos: #~%" (-> this goal-pos)) + (format #t "~2Tgoal-pos-front: #~%" (-> this goal-pos-front)) + (format #t "~2Tsub-state: ~D~%" (-> this sub-state)) + (format #t "~2Tvehicle: ~D~%" (-> this vehicle)) + (format #t "~2Twall-h: ~D~%" (-> this wall-h)) + (format #t "~2Tsound-name: ~A~%" (-> this sound-name)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tdelay: ~D~%" (-> this delay)) + (format #t "~2Tdelay-start: ~D~%" (-> this delay-start)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Tend-time: ~D~%" (-> this end-time)) + (format #t "~2Tintro-play?: ~A~%" (-> this intro-play?)) + (label cfg-7) + this + ) + +;; definition for symbol *cty-destroy-grid-kg-squad-member-settings*, type (inline-array kg-squad-member-settings) +(define *cty-destroy-grid-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :target-count 2 + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 3 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +;; definition for symbol *cty-destroy-grid-mh-squad-member-settings*, type (inline-array mh-squad-member-settings) +(define *cty-destroy-grid-mh-squad-member-settings* (new 'static 'inline-array mh-squad-member-settings 3 + (new 'static 'mh-squad-member-settings + :object-type (traffic-type metalhead-grunt) + :max-target-count #x7f + :target-count 5 + ) + (new 'static 'mh-squad-member-settings + :object-type (traffic-type metalhead-flitter) + :max-target-count #x7f + :target-count 6 + ) + (new 'static 'mh-squad-member-settings + :object-type (traffic-type metalhead-predator) + :max-target-count #x7f + :target-count 2 + ) + ) + ) + +;; definition for method 21 of type task-manager-city-destroy-grid +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this task-manager-city-destroy-grid)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this wall-h) (the-as handle #f)) + (set-setting! 'kg-enemy-settings #f 0.0 *cty-destroy-grid-kg-squad-member-settings*) + (set-setting! 'mh-enemy-settings #f 0.0 *cty-destroy-grid-mh-squad-member-settings*) + (set-setting! 'city-sound '(citygrid) 0.0 2) + (set! (-> this sub-state) (the-as uint 0)) + (set! (-> this next-box) (the-as uint 0)) + (set! (-> this arrow-h) (the-as handle #f)) + (logior! (-> *cty-attack-controller* target-attacker flags) (city-attacker-info-flag cai3)) + (when *cty-attack-controller* + (let ((s5-0 (push-back-hatred *cty-attack-controller*))) + (set! (-> s5-0 hatred) 0.6) + (set! (-> s5-0 hatred-dist) 245760.0) + (set! (-> s5-0 dist-scale) 0.5) + (set! (-> s5-0 attacker-scale) 0.01) + (set! (-> s5-0 max-consider-dist) 614400.0) + (set-hatred-indices-for-all *cty-attack-controller* 0 (get-hatred-at-idx *cty-attack-controller* 9 0) s5-0 13) + ) + ) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this intro-play?) #f) + (set! (-> this sound-name) #f) + (none) + ) + +;; definition for method 33 of type task-manager-city-destroy-grid +;; WARN: Return type mismatch int vs none. +(defmethod set-speech-name ((this task-manager-city-destroy-grid) (arg0 string) (arg1 int) (arg2 int)) + (set! (-> this delay-start) + (+ (current-time) (the int (rand-vu-float-range (the float arg1) (the float arg2)))) + ) + (set! (-> this sound-name) arg0) + 0 + (none) + ) + +;; definition for method 32 of type task-manager-city-destroy-grid +;; WARN: Return type mismatch int vs none. +(defmethod update-jinx-speech ((this task-manager-city-destroy-grid)) + (with-pp + (case (get-status *gui-control* (-> this id)) + (((gui-status pending)) + (when (time-elapsed? (-> this start-time) (seconds 1)) + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + (set-time! (-> this end-time)) + ) + ) + (((gui-status unknown)) + (set! (-> this id) (new 'static 'sound-id)) + (set-time! (-> this end-time)) + ) + ) + (when (nonzero? (-> this jinx)) + (let ((s5-0 (handle->process (-> this jinx)))) + (when s5-0 + (when (and (zero? (-> this id)) (-> this sound-name) (>= (current-time) (-> this delay-start))) + (set! (-> this id) + (add-process *gui-control* this (gui-channel hal) (gui-action play) (-> this sound-name) -99.0 0) + ) + (sound-params-set! *gui-control* (-> this id) #f -1 -1 -1 (-> *setting-control* user-current talker-volume)) + (set-time! (-> this start-time)) + (set! (-> this sound-name) #f) + ) + (when (nonzero? (-> this id)) + (cond + ((-> *setting-control* user-current speech-control) + (when *sound-player-enable* + (let ((s4-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> s4-0 command) (sound-command set-param)) + (set! (-> s4-0 id) (-> this id)) + (set! (-> s4-0 params volume) (the int (* 1024.0 (-> *setting-control* user-current talker-volume)))) + (set! (-> s4-0 params fo-min) 15) + (set! (-> s4-0 params fo-max) 90) + (set! (-> s4-0 params fo-curve) 9) + (let ((a1-5 (-> (the-as process-focusable s5-0) root trans))) + (let ((gp-1 pp)) + (when (= a1-5 #t) + (if (and gp-1 (type? gp-1 process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) + (set! a1-5 (-> (the-as process-drawable gp-1) root trans)) + (set! a1-5 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> s4-0 params trans) a1-5) + ) + (set! (-> s4-0 params mask) (the-as uint 481)) + (-> s4-0 id) + ) + ) + ) + (else + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 244 of type jinx +(defmethod move-cam-to-jinx ((this jinx)) + (cond + ((logtest? (-> this jinx-flags) (jinx-flag j0)) + (logclear! (-> this jinx-flags) (jinx-flag j0)) + (logior! (-> this jinx-flags) (jinx-flag j1)) + (let ((s4-0 (-> this move-dest))) + (set-cam-height this s4-0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 s4-0 (-> this root trans)) + (set-setting! 'string-max-height 'abs (-> s5-0 y) 0) + (set-setting! 'string-min-height 'abs (-> s5-0 y) 0) + (let ((f30-0 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))) + (set-setting! 'string-max-length 'abs f30-0 0) + (set-setting! 'string-min-length 'abs f30-0 0) + ) + ) + ) + (set-setting! 'immediate-string-min-max #f 0.0 0) + (let ((v0-6 (the-as object 1000))) + (set! (-> *ACTOR-bank* birth-max) (the-as int v0-6)) + v0-6 + ) + ) + ((logtest? (-> this jinx-flags) (jinx-flag j1)) + (logclear! (-> this jinx-flags) (jinx-flag j1)) + (send-event *camera* 'change-target this) + (send-event *camera* 'teleport-to-vector-start-string (-> this move-dest)) + ) + ) + ) + +;; definition for method 245 of type jinx +(defmethod set-cam-height ((this jinx) (arg0 vector)) + (set-vector! arg0 0.0 12288.0 28672.0 1.0) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) + ) + ) + +;; failed to figure out what this is: +(defstate die-fast (jinx) + :virtual #t + :enter (behavior () + (go-virtual die) + ) + ) + +;; failed to figure out what this is: +(defstate die (jinx) + :virtual #t + :enter (behavior () + (logior! (-> self jinx-flags) (jinx-flag j0)) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (until (process-grab? *target* #f) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info die-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (send-event (ppointer->process (-> self parent)) 'fail) + (until #f + (suspend) + ) + #f + (let ((gp-0 (-> self child))) + (while gp-0 + (send-event (ppointer->process gp-0) 'notice 'die) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post (behavior () + (move-cam-to-jinx self) + (let ((t9-2 (-> (find-parent-state) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +;; definition for symbol *jinx-exit-vehicle-speech-index*, type int +(define *jinx-exit-vehicle-speech-index* 0) + +;; definition for symbol *jinx-board-vehicle-speech-index*, type int +(define *jinx-board-vehicle-speech-index* 0) + +;; definition for symbol *jinx-exit-vehicle-speech*, type (array string) +(define *jinx-exit-vehicle-speech* + (new 'static 'boxed-array :type string "jinx105" "jinx106" "jinx107" "jinx108") + ) + +;; definition for symbol *jinx-board-vehicle-speech*, type (array string) +(define *jinx-board-vehicle-speech* + (new 'static 'boxed-array :type string "jinx112" "jinx113" "jinx114" "jinx115" "jinx116" "jinx117") + ) + +;; definition for method 26 of type task-manager-city-destroy-grid +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-city-destroy-grid)) + (local-vars (v1-180 float) (v1-201 float)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (update-jinx-speech this) + (when (nonzero? (-> this jinx)) + (let ((s5-0 (the-as jinx (handle->process (-> this jinx))))) + (when s5-0 + (when (nonzero? (-> this actor-group)) + (dotimes (s4-0 (length (-> this actor-group 0))) + (let ((s3-0 (-> this actor-group 0 data s4-0))) + (when (= (-> this next-box) s4-0) + (set! (-> this goal-pos quad) (-> s3-0 actor trans quad)) + (let ((s2-0 (-> this goal-pos-front))) + (let ((s1-0 (-> s3-0 actor trans))) + (let ((v1-17 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 actor quat)))) + (let ((a0-12 8192.0)) + (.mov vf7 a0-12) + ) + (.lvf vf5 (&-> v1-17 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) + ) + (when (< (vector-vector-distance (-> s3-0 actor trans) (-> s5-0 root trans)) 40960.0) + ) + ) + ) + ) + ) + (let ((s4-1 (entity-nav-mesh-by-aid (-> s5-0 nav-mesh-aid)))) + (cond + ((if (type? s4-1 entity-nav-mesh) + s4-1 + ) + ) + (else + ) + ) + ) + (when (= (+ (length (-> this actor-group 0)) 1) (-> this next-box)) + (+! (-> this next-box) 1) + (deactivate s5-0) + (let ((a0-20 (handle->process (-> this vehicle)))) + (if a0-20 + (deactivate a0-20) + ) + ) + (let ((a0-23 (-> this arrow-h process 0))) + (if a0-23 + (deactivate a0-23) + ) + ) + (send-event this 'complete) + ) + (let ((a1-6 *target*)) + (when (and a1-6 (focus-test? a1-6 pilot)) + (set-setting! 'music 'cityfi 0.0 0) + (when (not (-> this intro-play?)) + (set-setting! 'airlock #f 0.0 0) + (set-speech-name this "jinx102" 300 600) + (set! (-> this intro-play?) #t) + ) + ) + ) + (let ((v1-67 (the-as vehicle (handle->process (-> this vehicle))))) + (cond + (v1-67 + (logior! (-> v1-67 v-flags) (vehicle-flag persistent)) + (if (or (and (-> v1-67 next-state) (= (-> v1-67 next-state name) 'inactive)) (focus-test? v1-67 dead)) + (send-event this 'fail) + ) + ) + (else + (send-event this 'fail) + ) + ) + ) + (when (-> this arrow-h) + (let ((a0-47 (-> this arrow-h process 0)) + (v1-82 *target*) + (a2-4 (handle->process (-> this vehicle))) + ) + (cond + ((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'wait-for-ride)) + (logclear! (-> (the-as vehicle a2-4) v-flags) (vehicle-flag persistent)) + (if (and (the-as vehicle a2-4) v1-82 (not (logtest? (focus-status pilot) (-> v1-82 focus-status)))) + (send-event a0-47 'set-position (-> (the-as vehicle a2-4) root trans)) + (send-event a0-47 'set-position (-> s5-0 root trans)) + ) + (send-event (handle->process (-> this arrow-h)) 'show) + ) + ((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'ride)) + (cond + ((and a2-4 v1-82 (not (logtest? (focus-status pilot) (-> v1-82 focus-status)))) + (send-event a0-47 'set-position (-> s5-0 root trans)) + (send-event (handle->process (-> this arrow-h)) 'show) + ) + (else + (send-event (handle->process (-> this arrow-h)) 'set-position (-> this goal-pos)) + (send-event (handle->process (-> this arrow-h)) 'show) + ) + ) + ) + (else + (send-event (handle->process (-> this arrow-h)) 'hide) + ) + ) + ) + ) + (when *target* + (if (< 819200.0 (vector-vector-distance (-> s5-0 root trans) (target-pos 0))) + (send-event this 'fail) + ) + (let ((s4-4 (the-as vehicle (handle->process (-> this vehicle))))) + (when s4-4 + (cond + ((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'ride)) + (when (= (-> this next-box) (length (-> this actor-group 0))) + (deactivate s5-0) + (let ((a0-85 (handle->process (-> this vehicle)))) + (if a0-85 + (deactivate a0-85) + ) + ) + (let ((a0-88 (-> this arrow-h process 0))) + (if a0-88 + (deactivate a0-88) + ) + ) + (send-event this 'complete) + ) + (if (and (< (vector-vector-distance (-> this goal-pos) (-> s5-0 root trans)) 163840.0) + (begin + (.lvf vf1 (&-> (-> s4-4 root transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-180 vf1) + (let ((f0-4 v1-180) + (f1-2 12288.0) + ) + (< f0-4 (* f1-2 f1-2)) + ) + ) + ) + (send-event s5-0 'exit-vehicle (-> this goal-pos-front)) + ) + ) + ((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'wait-for-ride)) + (let ((v1-197 (get-best-seat s4-4 (-> s4-4 root trans) (the-as vehicle-seat-flag (-> s5-0 info seat-flag)) 1))) + (when (!= v1-197 -1) + (.lvf vf1 (&-> (-> s4-4 root transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-201 vf1) + (let ((f0-5 v1-201) + (f1-5 32768.0) + ) + (when (and (< f0-5 (* f1-5 f1-5)) + (let ((f0-6 (vector-vector-distance-squared (-> s4-4 root trans) (-> s5-0 root trans))) + (f1-8 204800.0) + ) + (< f0-6 (* f1-8 f1-8)) + ) + ) + (send-event s5-0 'board-vehicle s4-4) + (when (and (nonzero? (-> this next-box)) (!= (-> this next-box) (length (-> this actor-group 0)))) + (let ((a1-50 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-50 from) (process->ppointer pp)) + (set! (-> a1-50 num-params) 0) + (set! (-> a1-50 message) 'explode) + (let ((t9-38 send-event-function) + (v1-228 (-> this actor-group 0 data (+ (-> this next-box) -1) actor)) + ) + (t9-38 + (if v1-228 + (-> v1-228 extra process) + ) + a1-50 + ) + ) + ) + (set-speech-name this (-> *jinx-board-vehicle-speech* *jinx-board-vehicle-speech-index*) 300 600) + (set! *jinx-board-vehicle-speech-index* + (mod (+ *jinx-board-vehicle-speech-index* 1) (-> *jinx-board-vehicle-speech* length)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait (task-manager-city-destroy-grid) + :virtual #t + :code (behavior () + (set-setting! 'borrow-hold-perm '(ctycara) 0.0 0) + (while (or (!= (status-of-level-and-borrows *level* 'ctycara #f) 'active) + (!= (status-of-level-and-borrows *level* 'mhcitya #f) 'active) + ) + (suspend) + ) + (let ((t9-4 (-> (find-parent-state) code))) + (if t9-4 + ((the-as (function none) t9-4)) + ) + ) + ) + ) + +;; definition for method 30 of type task-manager-city-destroy-grid +(defmethod taskman-event-handler ((this task-manager-city-destroy-grid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('go-power-box) + (set-speech-name this (-> *jinx-exit-vehicle-speech* *jinx-exit-vehicle-speech-index*) 300 600) + (set! *jinx-exit-vehicle-speech-index* + (mod (+ *jinx-exit-vehicle-speech-index* 1) (-> *jinx-exit-vehicle-speech* length)) + ) + (let ((v0-1 (the-as object (+ (-> this next-box) 1)))) + (set! (-> this next-box) (the-as uint v0-1)) + v0-1 + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-city-destroy-grid) + :virtual #t + :enter (behavior () + (local-vars (sv-272 res-tag)) + (set-time! (-> self state-time)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> gp-0 position quad) (-> (new 'static 'vector :x -1781217.8 :y 49152.0 :z 3740217.0 :w 1.0) quad)) + (quaternion-copy! (-> gp-0 rotation) (new 'static 'quaternion :x 0.0013 :y 0.744 :z -0.0068 :w 0.6681)) + (set! (-> gp-0 object-type) (traffic-type civilian-car-a)) + (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~%") + ) + (when (-> gp-0 proc) + (set! (-> self vehicle) (process->handle (-> gp-0 proc))) + (send-event (handle->process (-> self vehicle)) 'scale-max-hit-points #x42c80000) + ) + ) + (let ((gp-1 (entity-by-name "tmanager-1"))) + (when gp-1 + (let ((s5-1 (new 'stack-no-clear 'enemy-init-by-other-params))) + (set! (-> s5-1 trans quad) (-> (new 'static 'vector :x -1785244.0 :y 35316.53 :z 3693337.5 :w 1.0) quad)) + (quaternion-copy! (-> s5-1 quat) (new 'static 'quaternion :y 0.5494 :w 0.8355)) + (set! (-> s5-1 entity) gp-1) + (set! (-> s5-1 directed?) #f) + (set! (-> s5-1 no-initial-move-to-ground?) #t) + (set! (-> s5-1 art-level) #f) + (set! (-> self jinx) + (process->handle + (ppointer->process (process-spawn jinx :init enemy-init-by-other self s5-1 :name "jinx" :to self)) + ) + ) + ) + (let ((v1-36 (-> self jinx process))) + (set-setting! 'kg-primary-target v1-36 1.0 (-> v1-36 0 pid)) + ) + (let ((v1-40 (-> self jinx process))) + (set-setting! 'mh-primary-target v1-40 1.0 (-> v1-40 0 pid)) + ) + (set! (-> self entity) (the-as entity-actor gp-1)) + (set! sv-272 (new 'static 'res-tag)) + (let ((v1-44 (res-lump-data gp-1 'actor-groups pointer :tag-ptr (& sv-272)))) + (cond + ((and v1-44 (nonzero? (-> sv-272 elt-count))) + (set! (-> self actor-group-count) (the-as int (-> sv-272 elt-count))) + (set! (-> self actor-group) (the-as (pointer actor-group) v1-44)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> self node-info task))) + ) + ) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'task-arrow-params))) + (let ((a0-38 (new 'static 'vector :w 1.0))) + (set! (-> gp-3 pos quad) (-> a0-38 quad)) + ) + (quaternion-identity! (-> gp-3 quat)) + (set! (-> gp-3 flags) (task-arrow-flags taf3 taf8)) + (set! (-> gp-3 map-icon) (the-as uint 12)) + (set! (-> self arrow-h) (process->handle (task-arrow-spawn gp-3 self))) + ) + ) + ) + +;; definition of type com-power-box +(deftype com-power-box (process-drawable) + ((root collide-shape :override) + (sound-id sound-id) + ) + (:state-methods + idle + explode + ) + ) + +;; definition for method 3 of type com-power-box +(defmethod inspect ((this com-power-box)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-com-power-box com-power-box com-power-box-lod0-jg com-power-box-idle-ja + ((com-power-box-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defskelgroup skel-combox-debris-piece com-power-box com-power-box-debris-piece-lod0-jg -1 + ((com-power-box-debris-piece-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-combox-debris-panelwires com-power-box com-power-box-debris-panelwires-lod0-jg -1 + ((com-power-box-debris-panelwires-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-combox-debris-paneltop com-power-box com-power-box-debris-paneltop-lod0-jg -1 + ((com-power-box-debris-paneltop-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-combox-debris-tubes com-power-box com-power-box-debris-tubes-lod0-jg -1 + ((com-power-box-debris-tubes-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; definition for symbol *combox-debris-params*, type debris-static-params +(define *combox-debris-params* (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-piece" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-panelwires" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-paneltop" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-tubes" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-piece" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-panelwires" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-paneltop" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-tubes" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-piece" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-panelwires" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-paneltop" + :offset (new 'static 'vector :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-combox-debris-tubes" + :offset (new 'static 'vector :w 1.0) + ) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; failed to figure out what this is: +(defstate idle (com-power-box) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('explode) + (go-virtual explode) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate explode (com-power-box) + :virtual #t + :exit (behavior () + (sound-stop (-> self sound-id)) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + (sound-play "bomb-set") + (set! (-> self sound-id) (sound-play "time-tick-loop")) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 5)) + (suspend) + ) + ) + (sound-stop (-> self sound-id)) + (sound-play "bomb-explode") + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 1 0) + (let ((v1-15 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 0))) + (set! (-> v1-15 prim-core collide-as) (collide-spec)) + (set! (-> v1-15 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-4 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-4 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-4 spawn-quat)) + (set! (-> gp-4 radius) 32768.0) + (set! (-> gp-4 scale) 1.0) + (set! (-> gp-4 group) (-> *part-group-id-table* 217)) + (set! (-> gp-4 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-4 damage) 2.0) + (set! (-> gp-4 damage-scale) 1.0) + (set! (-> gp-4 vehicle-damage-factor) 1.0) + (set! (-> gp-4 vehicle-impulse-factor) 1.0) + (set! (-> gp-4 ignore-proc) (process->handle #f)) + (explosion-spawn gp-4 (the-as process-drawable *default-pool*)) + ) + (dotimes (gp-5 (-> *combox-debris-params* joints length)) + (set-vector! + (-> *combox-debris-params* joints gp-5 offset) + (rand-vu-float-range -16384.0 16384.0) + (rand-vu-float-range 0.0 8192.0) + (rand-vu-float-range -4096.0 4096.0) + 1.0 + ) + ) + (let ((a1-11 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-11 hit-xz-reaction) 0.95) + (set! (-> a1-11 hit-y-reaction) 0.6) + (set! (-> a1-11 scale-rand-lo) 0.4) + (set! (-> a1-11 scale-rand-hi) 0.7) + (set! (-> a1-11 fountain-rand-transv-lo quad) (-> self root trans quad)) + (+! (-> a1-11 fountain-rand-transv-lo y) -40960.0) + (debris-spawn self a1-11 *combox-debris-params* (the-as process-drawable #f)) + ) + (sleep-code) + ) + :post ja-post + ) + +;; definition for method 11 of type com-power-box +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this com-power-box) (arg0 entity-actor)) + (local-vars (sv-80 vector) (sv-96 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v0-3 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v0-3 prim-core collide-as) (collide-spec crate)) + (set! (-> v0-3 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v0-3 prim-core action) (collide-action solid rideable)) + (set! (-> v0-3 transform-index) 3) + (set-vector! (-> v0-3 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v0-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v0-4 prim-core collide-as) (collide-spec crate)) + (set! (-> v0-4 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v0-4 prim-core action) (collide-action solid rideable)) + (set! (-> v0-4 transform-index) 3) + (set-vector! (-> v0-4 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-24 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-com-power-box" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw light-index) (the-as uint 10)) + (let ((s5-2 (get-process *default-dead-pool* simple-nav-sphere #x4000 1))) + (when s5-2 + (let ((t9-9 (method-of-type simple-nav-sphere activate))) + (t9-9 (the-as simple-nav-sphere s5-2) this "simple-nav-sphere" (the-as pointer #x70004000)) + ) + (let ((s4-2 run-function-in-process) + (s3-1 s5-2) + (s2-0 simple-nav-sphere-init-by-other) + (s1-0 #x46333333) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-80 (-> this root trans)) + (let ((v0-10 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (let ((v1-36 8192.0)) + (.mov vf7 v1-36) + ) + (.lvf vf5 (&-> v0-10 quad)) + ) + (.lvf vf4 (&-> sv-80 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 (&-> s0-0 quad) vf6) + ((the-as (function object object object object object object none) s4-2) s3-1 s2-0 s1-0 s0-0 #f -1) + ) + (-> s5-2 ppointer) + ) + ) + (let ((s5-3 (get-process *default-dead-pool* simple-nav-sphere #x4000 1))) + (when s5-3 + (let ((t9-13 (method-of-type simple-nav-sphere activate))) + (t9-13 (the-as simple-nav-sphere s5-3) this "simple-nav-sphere" (the-as pointer #x70004000)) + ) + (let ((s4-3 run-function-in-process) + (s3-2 s5-3) + (s2-1 simple-nav-sphere-init-by-other) + (s1-1 #x46333333) + (s0-1 (new 'stack-no-clear 'vector)) + ) + (set! sv-96 (-> this root trans)) + (let ((v0-14 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (let ((v1-46 -8192.0)) + (.mov vf7 v1-46) + ) + (.lvf vf5 (&-> v0-14 quad)) + ) + (.lvf vf4 (&-> sv-96 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 (&-> s0-1 quad) vf6) + ((the-as (function object object object object object object none) s4-3) s3-2 s2-1 s1-1 s0-1 #f -1) + ) + (-> s5-3 ppointer) + ) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 2 0) + (go (method-of-object this idle)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/farm/ctyfarm-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/farm/ctyfarm-obs_REF.gc new file mode 100644 index 0000000000..c601bfb4ee --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/farm/ctyfarm-obs_REF.gc @@ -0,0 +1,1771 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-farm-marrow-explode + :id 1134 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4001 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 4002 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4003 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4004 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 4005 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4006 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4004 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4003 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 32.0) + (:y (meters 0) (meters 5)) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 128.0 32.0) + (:a 128.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.033333335) (meters 0.083333336)) + (:accel-y (meters -0.003) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata 36864.0) + (:func 'check-water-level-drop-motion) + (:conerot-x (degrees 0) (degrees 85)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +;; failed to figure out what this is: +(defpart 4005 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 12.0 2.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 32.0 32.0) + (:g 64.0 128.0) + (:b 255.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4006 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 3)) + (:scale-x (meters 7)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 5)) + (:r 32.0) + (:g 128.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4002 + :init-specs ((:texture (ctyfarm-eggplant-body ctyfarma-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xf100500 #xf100400 #xf100300)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4001 + :init-specs ((:texture (ctyfarm-eggplant-body ctyfarma-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 3.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.13333334)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xf100500 #xf100400 #xf100300)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function check-farm-piece-ground +;; WARN: Return type mismatch number vs none. +(defun check-farm-piece-ground ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (if (and (>= 35225.6 (-> arg2 rvec y)) (>= 0.0 (-> arg1 vel-sxvel y))) + (set! (-> arg2 rvec y) 35225.6) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 4007 + :init-specs ((:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0)) + (:vel-y (meters 0)) + (:rotvel-x (degrees 0)) + (:rotvel-y (degrees 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:friction 0.8 0.1) + (:timer (seconds 4)) + (:next-time (seconds 0.5) (seconds 0.997)) + (:next-launcher 4008) + ) + ) + +;; failed to figure out what this is: +(defpart 4008 + :init-specs ((:fade-a -0.21333334 -0.21333334) (:flags (sp-cpuinfo-flag-2 left-multiply-quat))) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-beetree-explode + :id 1135 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4009 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4010 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 4011 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4012 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + (sp-item 4013 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 4014 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpart 4014 + :init-specs ((:texture (ctyfarm-chili-stem ctyfarma-sprite)) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 9)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.4) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4013 + :init-specs ((:texture (ctyfarm-chili-stem ctyfarma-sprite)) + (:num 12.0 3.0) + (:y (meters 0.5) (meters 9)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.4) (meters 0.4)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.13333334)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-cabbage-explode + :id 1136 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4015 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 4016 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4017 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4018 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 4019 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4020 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4018 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0.5) (meters 3)) + (:z (meters -4) (meters 8)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 255.0) + (:b 0.0 64.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4017 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 32.0) + (:y (meters 0) (meters 2)) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 255.0) + (:b 0.0 128.0) + (:a 128.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.06666667) (meters 0.083333336)) + (:accel-y (meters -0.003) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata 36864.0) + (:func 'check-water-level-drop-motion) + (:conerot-x (degrees 0) (degrees 85)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +;; failed to figure out what this is: +(defpart 4019 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 12.0 2.0) + (:y (meters 0.5) (meters 3)) + (:z (meters -4) (meters 8)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 196.0 64.0) + (:g 255.0) + (:b 0.0 64.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4020 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1.5)) + (:scale-x (meters 3)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 5)) + (:r 128.0) + (:g 255.0) + (:b 0.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4016 + :init-specs ((:texture (ctyfarm-cab-body ctyfarma-sprite)) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 2)) + (:z (meters -1.5) 2.0 (meters 3)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4015 + :init-specs ((:texture (ctyfarm-cab-body ctyfarma-sprite)) + (:num 12.0 3.0) + (:y (meters 0.5) (meters 2)) + (:z (meters -1.5) 2.0 (meters 3)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.13333334)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-small-cabbage-explode + :id 1137 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4009 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4010 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 4011 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4012 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4010 + :init-specs ((:texture (specs level-default-sprite)) + (:num 20.0) + (:y (meters 0.5) (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 255.0) + (:b 0.0 64.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4011 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 2.0) + (:y (meters 0.5) (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 1)) + (:r 196.0 64.0) + (:g 255.0) + (:b 0.0 64.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4012 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1.5)) + (:scale-x (meters 2)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 3.5)) + (:r 128.0) + (:g 255.0) + (:b 0.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4009 + :init-specs ((:texture (ctyfarm-cab-body ctyfarma-sprite)) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 1)) + (:z (meters -1.5) 2.0 (meters 3)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-chilirots-explode + :id 1138 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 4021 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 4022 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 4023 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 4024 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + (sp-item 4025 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 4025 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4023 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 12.0 2.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 64.0) + (:g 0.0 16.0) + (:b 0.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4024 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 3)) + (:scale-x (meters 7)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 5)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4022 + :init-specs ((:texture (ctyfarm-chili-stem ctyfarma-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.1)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xf100100 #xf100200)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4021 + :init-specs ((:texture (ctyfarm-chili-stem ctyfarma-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 3.0) + (:y (meters 0.5) (meters 5)) + (:z (meters -1) 2.0 (meters 2)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.13333334)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xf100100 #xf100200)) + (:func 'check-farm-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 4007) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-sprinkler-barrels-water + :id 1139 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 128) + :parts ((sp-item 4026 :fade-after (meters 300) :falloff-to (meters 300) :flags (sp7) :period (seconds 2) :length (seconds 0.167) :offset 80) + (sp-item 4027 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7) :period (seconds 2) :length (seconds 0.167) :offset 80) + (sp-item 4028 :fade-after (meters 180) :falloff-to (meters 180) :flags (sp7) :period (seconds 2) :length (seconds 0.335) :offset 30) + (sp-item 4028 :fade-after (meters 180) :falloff-to (meters 180) :flags (sp7) :period (seconds 2) :length (seconds 0.25) :offset 55) + (sp-item 4028 :fade-after (meters 180) :falloff-to (meters 180) :flags (sp7) :period (seconds 2) :length (seconds 0.335) :offset 80) + (sp-item 4029 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7) :period (seconds 2) :length (seconds 0.167) :offset 80) + ) + ) + +;; failed to figure out what this is: +(defpart 4027 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 1.0) + (:z (meters -0.5)) + (:scale-x (meters 1) (meters 0.1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 64.0) + (:vel-z (meters 0.2) (meters 0.06666667)) + (:scalevel-x (meters 0.026666667) (meters 0.01)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.8 0.08) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:launchrot-x (degrees -15) (degrees 30)) + (:launchrot-z (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4026 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 10.0 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.2) (meters 0.06666667)) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyfarma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4028 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 2.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.13333334) (meters 0.13333334)) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyfarma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + (:launchrot-x (degrees -16) (degrees 32)) + (:launchrot-z (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4029 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 2.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.06666667)) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyfarma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + (:launchrot-x (degrees -70) (degrees 140)) + (:launchrot-z (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-marrow farm-marrow farm-marrow-lod0-jg farm-marrow-idle-ja + ((farm-marrow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2.4 0 4) + ) + +;; definition of type farm-marrow +(deftype farm-marrow (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type farm-marrow +(defmethod inspect ((this farm-marrow)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (farm-marrow) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +;; definition for method 11 of type farm-marrow +(defmethod init-from-entity! ((this farm-marrow) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-marrow" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-beetree farm-beetree farm-beetree-lod0-jg farm-beetree-idle-ja + ((farm-beetree-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 7) + ) + +;; definition of type farm-beetree +(deftype farm-beetree (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type farm-beetree +(defmethod inspect ((this farm-beetree)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (farm-beetree) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +;; definition for method 11 of type farm-beetree +(defmethod init-from-entity! ((this farm-beetree) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-beetree" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-cabbage farm-cabbage farm-cabbage-lod0-jg farm-cabbage-idle-ja + ((farm-cabbage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; definition of type farm-cabbage +(deftype farm-cabbage (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type farm-cabbage +(defmethod inspect ((this farm-cabbage)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (farm-cabbage) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +;; definition for method 11 of type farm-cabbage +(defmethod init-from-entity! ((this farm-cabbage) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-cabbage" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-small-cabbage farm-small-cabbage farm-small-cabbage-lod0-jg farm-small-cabbage-idle-ja + ((farm-small-cabbage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) + +;; definition of type farm-small-cabbage +(deftype farm-small-cabbage (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type farm-small-cabbage +(defmethod inspect ((this farm-small-cabbage)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (farm-small-cabbage) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +;; definition for method 11 of type farm-small-cabbage +(defmethod init-from-entity! ((this farm-small-cabbage) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-small-cabbage" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-chilirots farm-chilirots farm-chilirots-lod0-jg farm-chilirots-idle-ja + ((farm-chilirots-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 4.5) + ) + +;; definition of type farm-chilirots +(deftype farm-chilirots (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type farm-chilirots +(defmethod inspect ((this farm-chilirots)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (farm-chilirots) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +;; definition for method 11 of type farm-chilirots +(defmethod init-from-entity! ((this farm-chilirots) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-chilirots" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-sprinkler-barrels farm-sprinkler-barrels farm-sprinkler-barrels-lod0-jg farm-sprinkler-barrels-idle-ja + ((farm-sprinkler-barrels-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 3 4) + ) + +;; definition of type farm-sprinkler-barrels +(deftype farm-sprinkler-barrels (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type farm-sprinkler-barrels +(defmethod inspect ((this farm-sprinkler-barrels)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (farm-sprinkler-barrels) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! farm-sprinkler-barrels-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + ) + ) + +;; definition for method 11 of type farm-sprinkler-barrels +(defmethod init-from-entity! ((this farm-sprinkler-barrels) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-farm-sprinkler-barrels" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask crate)) + (go (method-of-object this idle)) + ) + +;; definition for function farm-activate +;; WARN: Return type mismatch int vs none. +(defun farm-activate ((arg0 level)) + (let* ((v1-0 (-> arg0 name)) + (s5-0 (cond + ((= v1-0 'ctyfarma) + (new 'static 'boxed-array :type int32 5 0 0 #xf100500 #xf100400 #xf100300) + ) + ((= v1-0 'ctyfarmb) + (new 'static 'boxed-array :type int32 5 0 0 #xfd00500 #xfd00400 #xfd00300) + ) + ) + ) + (v1-1 (-> arg0 name)) + (gp-0 (cond + ((= v1-1 'ctyfarma) + (new 'static 'boxed-array :type int32 5 0 0 #xf100100 #xf100200) + ) + ((= v1-1 'ctyfarmb) + (new 'static 'boxed-array :type int32 5 0 0 #xfd00100 #xfd00200) + ) + ) + ) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4002) (sp-field-id spt-userdata)) initial-valuef) + (the-as float s5-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4001) (sp-field-id spt-userdata)) initial-valuef) + (the-as float s5-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4022) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4021) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + ) + (setup-special-textures (-> *part-id-table* 4002) "ctyfarm-eggplant-body") + (setup-special-textures (-> *part-id-table* 4001) "ctyfarm-eggplant-body") + (setup-special-textures (-> *part-id-table* 4014) "ctyfarm-chili-stem") + (setup-special-textures (-> *part-id-table* 4013) "ctyfarm-chili-stem") + (setup-special-textures (-> *part-id-table* 4016) "ctyfarm-cab-body") + (setup-special-textures (-> *part-id-table* 4015) "ctyfarm-cab-body") + (setup-special-textures (-> *part-id-table* 4009) "ctyfarm-cab-body") + (setup-special-textures (-> *part-id-table* 4022) "ctyfarm-chili-stem") + (setup-special-textures (-> *part-id-table* 4021) "ctyfarm-chili-stem") + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyfarma-light + :id 1140 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4031 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 4032 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 4031 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 4032 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 12.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyfarma-drip-1 + :id 1141 + :flags (sp8) + :bounds (static-bspherem 0 -4 0 16) + :parts ((sp-item 4033 :fade-after (meters 140) :falloff-to (meters 140))) + ) + +;; definition for function birth-func-ctyfarma-drip +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun birth-func-ctyfarma-drip ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) + (let ((v1-2 s4-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd)) + (set! (-> v1-2 ignore-process0) #f) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* s4-0) + (cond + ((>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (set! (-> arg1 user-float) (-> s4-0 best-other-tri intersect y)) + (set! (-> arg1 datab 0) (the int (* 127.0 (-> s4-0 best-other-tri normal x)))) + (set! (-> arg1 datab 1) (the int (* 127.0 (-> s4-0 best-other-tri normal y)))) + (set! (-> arg1 datab 2) (the int (* 127.0 (-> s4-0 best-other-tri normal z)))) + (set! (-> arg1 datab 3) (the-as int (-> s4-0 best-other-tri pat event))) + ) + (else + (set! (-> arg1 omega) 65280.0) + (set! (-> arg1 user-float) (+ -204800.0 (-> arg2 launchrot y))) + ) + ) + ) + (let ((f0-19 (get-height *ocean* (-> arg2 launchrot) #f))) + (when (!= f0-19 4095996000.0) + (when (< (-> arg1 user-float) f0-19) + (set! (-> arg1 user-float) f0-19) + (set! (-> arg1 datab 0) 0) + (set! (-> arg1 datab 1) 127) + (set! (-> arg1 datab 2) 0) + (set! (-> arg1 datab 3) 0) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for function check-drop-level-ctyfarma-drop-userdata +;; INFO: Used lq/sq +(defun check-drop-level-ctyfarma-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (when (< (-> arg2 rvec y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 rvec x) (-> arg1 user-float) (-> arg2 rvec z) 1.0) + (if (< (vector-vector-distance (camera-pos) s3-0) 204800.0) + (sound-play "dirt-drips" :position s3-0) + ) + (launch-particles (-> *part-id-table* 4034) s3-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 4035) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +;; failed to figure out what this is: +(defpart 4034 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.016666668) (meters 0.03)) + (:fade-a -0.16) + (:accel-y (meters -0.001) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 4030 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 4036)) + ) + +;; failed to figure out what this is: +(defpart 4036 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 4030)) + ) + +;; failed to figure out what this is: +(defpart 4035 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:omega (degrees 0)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 10 0 0 #x401800 #x403d00 #x400700 #x408200)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpart 4033 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:birth-func 'birth-func-ctyfarma-drip) + (:num 0.05) + (:scale-x (meters 0)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 0.0) + (:vel-z (meters 0)) + (:scalevel-x (meters 0.00044444445)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.28444445) + (:friction 0.93 0.02) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-rain2) + (:next-time (seconds 0.75) (seconds 0.747)) + (:next-launcher 4037) + ) + ) + +;; failed to figure out what this is: +(defpart 4037 + :init-specs ((:a 128.0) + (:fade-a 0.0) + (:accel-y (meters -0.006666667) (meters 0.00066666666)) + (:friction 0.93 0.02) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4030) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyfarma-wall-bubbles + :id 1142 + :flags (sp4) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4038 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4038 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.5) + (:x (meters -0.75) (meters 1.5)) + (:z (meters -4)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 16.0 16.0) + (:g 64.0 16.0) + (:b 32.0 32.0) + (:a 32.0 64.0) + (:vel-z (meters 0.013333334) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyfarmb-light + :id 1143 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4039 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 4040 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 4039 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 4040 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 12.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyfarmb-drip-1 + :id 1144 + :flags (sp8) + :bounds (static-bspherem 0 -4 0 16) + :parts ((sp-item 4041 :fade-after (meters 140) :falloff-to (meters 140))) + ) + +;; definition for function birth-func-ctyfarmb-drip +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun birth-func-ctyfarmb-drip ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) + (let ((v1-2 s4-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd)) + (set! (-> v1-2 ignore-process0) #f) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* s4-0) + (cond + ((>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (set! (-> arg1 user-float) (-> s4-0 best-other-tri intersect y)) + (set! (-> arg1 datab 0) (the int (* 127.0 (-> s4-0 best-other-tri normal x)))) + (set! (-> arg1 datab 1) (the int (* 127.0 (-> s4-0 best-other-tri normal y)))) + (set! (-> arg1 datab 2) (the int (* 127.0 (-> s4-0 best-other-tri normal z)))) + (set! (-> arg1 datab 3) (the-as int (-> s4-0 best-other-tri pat event))) + ) + (else + (set! (-> arg1 omega) 65280.0) + (set! (-> arg1 user-float) (+ -204800.0 (-> arg2 launchrot y))) + ) + ) + ) + (let ((f0-19 (get-height *ocean* (-> arg2 launchrot) #f))) + (when (!= f0-19 4095996000.0) + (when (< (-> arg1 user-float) f0-19) + (set! (-> arg1 user-float) f0-19) + (set! (-> arg1 datab 0) 0) + (set! (-> arg1 datab 1) 127) + (set! (-> arg1 datab 2) 0) + (set! (-> arg1 datab 3) 0) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for function check-drop-level-ctyfarmb-drop-userdata +;; INFO: Used lq/sq +(defun check-drop-level-ctyfarmb-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (when (< (-> arg2 rvec y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 rvec x) (-> arg1 user-float) (-> arg2 rvec z) 1.0) + (if (< (vector-vector-distance (camera-pos) s3-0) 204800.0) + (sound-play "dirt-drips" :position s3-0) + ) + (launch-particles (-> *part-id-table* 4042) s3-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 4043) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +;; failed to figure out what this is: +(defpart 4042 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.016666668) (meters 0.03)) + (:fade-a -0.16) + (:accel-y (meters -0.001) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4044) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 4044 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 4045)) + ) + +;; failed to figure out what this is: +(defpart 4045 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 4044)) + ) + +;; failed to figure out what this is: +(defpart 4043 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:omega (degrees 0)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 10 0 0 #x401800 #x403d00 #x400700 #x408200)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpart 4041 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:birth-func 'birth-func-ctyfarmb-drip) + (:num 0.05) + (:scale-x (meters 0)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 0.0) + (:vel-z (meters 0)) + (:scalevel-x (meters 0.00044444445)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.28444445) + (:friction 0.93 0.02) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-rain2) + (:next-time (seconds 0.75) (seconds 0.747)) + (:next-launcher 4046) + ) + ) + +;; failed to figure out what this is: +(defpart 4046 + :init-specs ((:a 128.0) + (:fade-a 0.0) + (:accel-y (meters -0.006666667) (meters 0.00066666666)) + (:friction 0.93 0.02) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4044) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyfarmb-wall-bubbles + :id 1145 + :flags (sp4) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4047 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4047 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.5) + (:x (meters -0.75) (meters 1.5)) + (:z (meters -4)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 16.0 16.0) + (:g 64.0 16.0) + (:b 32.0 32.0) + (:a 32.0 64.0) + (:vel-z (meters 0.013333334) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/farm/ctyfarma-part_REF.gc b/test/decompiler/reference/jak3/levels/city/farm/ctyfarma-part_REF.gc new file mode 100644 index 0000000000..8e4b1f21d4 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/farm/ctyfarma-part_REF.gc @@ -0,0 +1,9 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/city/farm/ctyfarmb-part_REF.gc b/test/decompiler/reference/jak3/levels/city/farm/ctyfarmb-part_REF.gc new file mode 100644 index 0000000000..8e4b1f21d4 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/farm/ctyfarmb-part_REF.gc @@ -0,0 +1,9 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/city/freehq/freehq-part_REF.gc b/test/decompiler/reference/jak3/levels/city/freehq/freehq-part_REF.gc new file mode 100644 index 0000000000..39ac9447de --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/freehq/freehq-part_REF.gc @@ -0,0 +1,2836 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-freehq-center-sphere + :id 808 + :flags (sp0 sp6) + :bounds (static-bspherem 0 3 0 64) + :rotate ((degrees 90) (degrees 0) (degrees 0)) + :parts ((sp-item 2962 :flags (sp6)) + (sp-item 2963 :binding 2961) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2961 :flags (sp1 sp2 sp3)) + (sp-item 2964 :flags (sp6)) + (sp-item 2965 :flags (sp6)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + (sp-item 2966 :flags (is-3d sp1 sp3)) + ) + ) + +;; failed to figure out what this is: +(defpart 2962 + :init-specs ((:texture (vinroom-tv-circle freehq-sprite)) + (:num 1.0) + (:y (meters 1.25)) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 30.0 30.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2964 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1.25)) + (:scale-x (meters 6)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 24.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-4 glow)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2965 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 5.0) + (:y (meters 2.2)) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x (degrees 45)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.5)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0 15.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2966 + :init-specs ((:texture (holo-line freehq-sprite)) + (:num 1.0) + (:y (meters 1.25)) + (:scale-x (meters 1.8)) + (:rot-z (degrees 0) (degrees 36000)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 60.0) + (:b 10.0) + (:a 100.0) + (:rotvel-y (degrees -0.2) 1 (degrees 0.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'part-freehq-sphere-vert-line-flicker) + ) + ) + +;; definition for function part-freehq-sphere-vert-line-flicker +;; WARN: Return type mismatch int vs none. +(defun part-freehq-sphere-vert-line-flicker ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (if (zero? (mod (-> arg1 timer) 5)) + (set! (-> arg2 coneradius) (rand-vu-float-range 10.0 100.0)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 2963 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5) + (:y (meters 0.55) (meters 1.5)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; definition for function birth-func-freehq-sphere +;; WARN: Return type mismatch int vs none. +(defun birth-func-freehq-sphere ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((v1-1 (-> arg4 sprite key))) + (when (nonzero? v1-1) + (let ((f0-2 (+ (- 5120.0 (-> arg2 launchrot y)) (-> v1-1 origin trans y)))) + (set! (-> arg1 radius) (sqrtf (- (* (-> arg1 radius) (-> arg1 radius)) (* f0-2 f0-2)))) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 2961 + :init-specs ((:texture (glow level-default-sprite)) + (:birth-func 'birth-func-freehq-sphere) + (:num 1.0) + (:x (meters 0) (meters 160)) + (:y (meters 0)) + (:z (meters 0.9)) + (:scale-x (meters 0.02) (meters 0.06)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 40.0) + (:a 0.0) + (:omega (degrees 0) (degrees 3600)) + (:vel-x (meters -0.005925926) (meters -0.005925926)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:fade-a 1.59375) + (:timer (seconds 4.4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.535)) + (:next-launcher 2967) + ) + ) + +;; failed to figure out what this is: +(defpart 2967 + :init-specs ((:a 255.0) (:fade-a 0.0) (:next-time (seconds 1.667)) (:next-launcher 2968)) + ) + +;; failed to figure out what this is: +(defpart 2968 + :init-specs ((:fade-a -1.59375)) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-smalla + :id 809 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2969 :flags (is-3d sp7)) + (sp-item 2970 :flags (is-3d sp7) :period (seconds 0.135) :length (seconds 0.017)) + (sp-item 2971 :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2969 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 0.2) + (:z (meters 0.015)) + (:scale-x (meters 0)) + (:rot-x (degrees 90)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0 8.0) + (:scalevel-x (meters 0.018437501)) + (:scalevel-y (meters 0.0103124995)) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 2972) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2972 + :init-specs ((:fade-a -2.1333334)) + ) + +;; failed to figure out what this is: +(defpart 2970 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:z (meters 0.015)) + (:scale-x (meters 1.4) (meters 0.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.65) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:fade-a -1.0666667) + (:timer (seconds 0.135) (seconds 0.065)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 80 0 0 #x40b01300 #x40b01400 #x40b01500 #x40b01600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-smallb + :id 810 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2973 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2974 :flags (is-3d sp7) :period (seconds 1.067) :length (seconds 0.017) :offset 10) + (sp-item 2971 :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2973 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 1.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2974 + :init-specs ((:texture (vinroom-small-monitor-08 freehq-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 1.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:fade-a -0.7111111) + (:timer (seconds 1.067)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 80 0 0 #x40b01700 #x40b01800 #x40b01900 #x40b01a00)) + (:func 'sparticle-texture-animate) + (:next-time (seconds 0.267)) + (:next-launcher 2975) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2975 + :init-specs ((:a 64.0) (:fade-a -0.7111111) (:next-time (seconds 0.267)) (:next-launcher 2975)) + ) + +;; failed to figure out what this is: +(defpart 2971 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 3)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 5)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 12.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-smallc + :id 811 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.5 0.65 0.0) + :parts ((sp-item 2976 :flags (sp7)) (sp-item 2977 :flags (sp7)) (sp-item 2978 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 2978 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 7)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 5)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2977 + :init-specs ((:texture (vinroom-tv-text-m freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 1.0) + (:x (meters 0) 4 (meters 0.22)) + (:y (meters 1.6)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 2 64.0) + (:vel-y (meters -0.02)) + (:timer (seconds 0.767)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x40b02900 #x40b02b00 #x40b02c00 #x40b02800 #x40b02700 #x40b02a00) + ) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2976 + :init-specs ((:texture (vinroom-tv-text-m freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 4.0) + (:x (meters -0.66) 2 (meters 0.22)) + (:y (meters 1.5)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 3 64.0) + (:vel-y (meters -0.031666666)) + (:timer (seconds 0.435)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x40b02900 #x40b02b00 #x40b02c00 #x40b02800 #x40b02700 #x40b02a00) + ) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-smalld + :id 812 + :flags (sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.8 0.83 1.0) + :parts ((sp-item 2979 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2980 :flags (is-3d sp7) :period (seconds 0.8) :length (seconds 0.017)) + (sp-item 2981 :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2981 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 12.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2980 + :init-specs ((:texture (vinroom-tv-text-m freehq-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.625)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0016666667)) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 + 40 + 0 + 0 + #x40b02900 + #x40b02b00 + #x40b02c00 + #x40b02800 + #x40b02700 + #x40b02a00 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2979 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.05)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-x (degrees 90)) + (:scale-y (meters 1.25)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-rtablea + :id 813 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.25 0.25 1.0) + :parts ((sp-item 2982 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2983 :flags (is-3d sp7) :period (seconds 0.8) :length (seconds 0.017)) + (sp-item 2984 :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2984 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2983 + :init-specs ((:texture (vinroom-tv-text-m freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees -90)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.625)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.001)) + (:scalevel-y (meters 0.00033333333)) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 + 40 + 0 + 0 + #x40b02900 + #x40b02b00 + #x40b02c00 + #x40b02800 + #x40b02700 + #x40b02a00 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2982 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1.8)) + (:rot-x (degrees 0)) + (:rot-y (degrees -90)) + (:rot-z (degrees 90)) + (:scale-y (meters 1.25)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-rtableb + :id 814 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.06 0.06 1.0) + :parts ((sp-item 2985 :flags (is-3d sp7)) + (sp-item 2986 :flags (is-3d sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 2987 :flags (sp7) :period (seconds 2) :length (seconds 0.017) :offset 125) + (sp-item 2988 :flags (sp7) :period (seconds 2) :length (seconds 0.017) :offset 300) + (sp-item 2989 :flags (sp7) :period (seconds 2) :length (seconds 0.017) :offset 375) + (sp-item 2990 :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2990 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 16)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2985 + :init-specs ((:texture (vinroom-tv-circle freehq-sprite)) + (:num 0.0 0.2) + (:x (meters 0.4)) + (:y (meters -0.2)) + (:z (meters -0.02)) + (:scale-x (meters 0)) + (:rot-x (degrees -90)) + (:rot-y (degrees 0)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y (meters 0.0016666667)) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:next-time (seconds 0.335)) + (:next-launcher 2991) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2991 + :init-specs ((:fade-a -0.53333336)) + ) + +;; failed to figure out what this is: +(defpart 2986 + :init-specs ((:texture (vinroom-tv-radar freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 5)) + (:rot-x (degrees 0)) + (:rot-y (degrees -100.00001)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 80.0) + (:rotvel-y (degrees -0.6)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2987 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:x (meters 1.5)) + (:y (meters 1.5)) + (:z (meters 0)) + (:scale-x (meters 0.2)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.28444445) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2988 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:x (meters 1)) + (:y (meters -1.5)) + (:z (meters 0)) + (:scale-x (meters 0.2)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.28444445) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2989 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:x (meters -0.5)) + (:y (meters -2)) + (:z (meters 0)) + (:scale-x (meters 0.2)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.28444445) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-rtablec + :id 815 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2992 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2993 :flags (is-3d sp7) :period (seconds 1.067) :length (seconds 0.017) :offset 10) + (sp-item 2994 :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2992 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.46)) + (:rot-x (degrees 0)) + (:rot-y (degrees -90)) + (:rot-z (degrees -90)) + (:scale-y (meters 0.3)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2993 + :init-specs ((:texture (vinroom-small-monitor-08 freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.46)) + (:rot-x (degrees 0)) + (:rot-y (degrees -90)) + (:rot-z (degrees -90)) + (:scale-y (meters 0.3)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.7111111) + (:timer (seconds 1.067)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 80 0 0 #x40b01700 #x40b01800 #x40b01900 #x40b01a00)) + (:func 'sparticle-texture-animate) + (:next-time (seconds 0.267)) + (:next-launcher 2995) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2995 + :init-specs ((:a 64.0) (:fade-a -0.7111111) (:next-time (seconds 0.267)) (:next-launcher 2995)) + ) + +;; failed to figure out what this is: +(defpart 2994 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 2)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-rtabled + :id 816 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2996 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 2997 :flags (is-3d sp3 sp7)) + (sp-item 2998 :flags (is-3d sp3 sp7)) + (sp-item 2999 :flags (is-3d sp3 sp7)) + (sp-item 3000 :flags (is-3d sp3 sp7)) + (sp-item 3001 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3002 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3003 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3004 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3005 :falloff-to (meters 10) :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3006 :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2996 + :init-specs ((:texture (screen-00 freehq-sprite)) + (:num 1.0) + (:x (meters 0.025)) + (:y (meters 0.05)) + (:z (meters -0.015)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x40b00800 + #x40b00900 + #x40b00a00 + #x40b00b00 + #x40b00c00 + #x40b00d00 + #x40b00e00 + #x40b00f00 + #x40b01000 + #x40b01100 + #x40b01200 + #x40b00300 + #x40b00400 + #x40b00500 + #x40b00600 + #x40b00700 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2997 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 1.0) + (:x (meters -0.22)) + (:y (meters 0)) + (:z (meters -0.015)) + (:scale-x (meters 0.35)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 64.0) + (:rotvel-y (degrees -1.2) (degrees 2.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 3007) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3007 + :init-specs ((:rotvel-y (degrees -1.2) (degrees 2.4)) (:next-time (seconds 0.167) (seconds 0.33)) (:next-launcher 3007)) + ) + +;; failed to figure out what this is: +(defpart 2998 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 1.0) + (:x (meters -0.22)) + (:y (meters 0)) + (:z (meters -0.015)) + (:scale-x (meters 0.15)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 255.0) + (:b 100.0) + (:a 64.0) + (:rotvel-y (degrees -1.2) (degrees 2.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 3007) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2999 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 1.0) + (:x (meters 0.22)) + (:y (meters 0.08)) + (:z (meters -0.015)) + (:scale-x (meters 0.25)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 64.0) + (:rotvel-y (degrees -1.2) (degrees 2.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 3008) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3008 + :init-specs ((:rotvel-y (degrees -0.6) (degrees 1.2)) (:next-time (seconds 0.5) (seconds 0.497)) (:next-launcher 3008)) + ) + +;; failed to figure out what this is: +(defpart 3000 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 1.0) + (:x (meters 0.22)) + (:y (meters 0.08)) + (:z (meters -0.015)) + (:scale-x (meters 0.1)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 255.0) + (:b 100.0) + (:a 64.0) + (:rotvel-y (degrees -1.2) (degrees 2.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 3008) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function sparticle-kill-at-scale-eqline +;; WARN: Return type mismatch float vs none. +(defun sparticle-kill-at-scale-eqline ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when (or (>= (-> arg2 launchrot w) 4096.0) (>= (-> arg2 conerot w) 1228.8)) + (set! (-> arg2 launchrot w) 0.0) + (set! (-> arg2 conerot w) 0.0) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 3001 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3009 + :init-specs ((:scalevel-y (meters -0.0033333334) (meters 0.006666667)) + (:next-time (seconds 0.05) (seconds 0.047)) + (:next-launcher 3009) + ) + ) + +;; failed to figure out what this is: +(defpart 3002 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3003 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0.1)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3004 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0.15)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3005 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:y (meters -0.2)) + (:z (meters -0.015)) + (:scale-x (meters 0.04)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-eqline) + (:next-time (seconds 0.017)) + (:next-launcher 3009) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3006 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0.05)) + (:y (meters -0.1)) + (:scale-x (meters 1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 2)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-mediuma + :id 817 + :flags (sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3010 :flags (sp6 sp7)) + (sp-item 3011 :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3012 :flags (is-3d sp3 sp7)) + (sp-item 3013 :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 3012 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:y (meters 0)) + (:z (meters -0.02)) + (:scale-x (meters 4)) + (:rot-x (degrees 90)) + (:scale-y (meters 2)) + (:r 15.0) + (:g 15.0) + (:b 30.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (aux-list sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3013 + :init-specs ((:texture (vinroom-tv-linetext-01 freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:y (meters -0.8)) + (:z (meters 0.06)) + (:scale-x (meters 3.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 64.0 32.0) + (:vel-y (meters 0)) + (:timer (seconds 7.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 aux-list left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x40b01d00 + #x40b01e00 + #x40b01f00 + #x40b02000 + #x40b02100 + #x40b02200 + #x40b02300 + #x40b02400 + ) + ) + (:next-time (seconds 0.485)) + (:next-launcher 3014) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3014 + :init-specs ((:vel-y (meters 0.0016666667)) (:next-time (seconds 0.485)) (:next-launcher 3015)) + ) + +;; failed to figure out what this is: +(defpart 3015 + :init-specs ((:vel-y (meters 0)) (:next-time (seconds 0.485)) (:next-launcher 3014)) + ) + +;; failed to figure out what this is: +(defpart 3011 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 1.0) + (:x (meters 1.85)) + (:y (meters -0.8)) + (:z (meters 0.13)) + (:scale-x (meters 7.8)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.2)) + (:r 15.0) + (:g 15.0) + (:b 30.0) + (:a 128.0) + (:scalevel-x (meters -0.04)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 aux-list sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3010 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 6)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-mediumb + :id 818 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3016 :flags (sp6 sp7)) + (sp-item 3017 :flags (is-3d sp3 sp7)) + (sp-item 3018 :flags (is-3d sp3 sp7)) + (sp-item 3019 :flags (is-3d sp3 sp7)) + (sp-item 3020 :flags (is-3d sp3 sp7)) + (sp-item 3021 :flags (is-3d sp3 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3016 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 6)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function sparticle-kill-at-scale-mediumb +;; WARN: Return type mismatch float vs none. +(defun sparticle-kill-at-scale-mediumb ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (if (>= (-> arg2 launchrot w) 18432.0) + (set! (-> arg2 launchrot w) 8192.0) + ) + (if (>= 0.0 (-> arg2 launchrot w)) + (set! (-> arg2 launchrot w) 2048.0) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 3017 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 1.5)) + (:y (meters 0.8)) + (:z (meters -0.015)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 3022 + :init-specs ((:scalevel-x (meters -0.006666667) (meters 0.013333334)) + (:next-time (seconds 0.085) (seconds 0.165)) + (:next-launcher 3022) + ) + ) + +;; failed to figure out what this is: +(defpart 3018 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 1.3)) + (:y (meters 0.4)) + (:z (meters -0.015)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 20.0) + (:g 255.0) + (:b 100.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 3019 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 1.1)) + (:y (meters 0)) + (:z (meters -0.015)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 3020 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 0.9)) + (:y (meters -0.4)) + (:z (meters -0.01)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 20.0) + (:g 255.0) + (:b 100.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 3021 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 2.0) + (:x (meters 0.7)) + (:y (meters -0.8)) + (:z (meters -0.015)) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.3)) + (:r 40.0) + (:g 20.0) + (:b 255.0) + (:a 50.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-mediumb) + (:next-time (seconds 0.017)) + (:next-launcher 3022) + (:rotate-y (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-mediumc + :id 819 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3023 :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 3024 :flags (sp6 sp7)) + (sp-item 3025 :flags (is-3d sp7) :period (seconds 1) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 3024 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 6)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 10)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3025 + :init-specs ((:texture (vinroom-small-monitor-01 freehq-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0.025)) + (:y (meters -0.05)) + (:z (meters 0.02)) + (:scale-x (meters 3.8)) + (:rot-x (degrees 90)) + (:scale-y (meters 1.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.16666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + #x12c + 0 + 0 + #x40b01300 + #x40b01400 + #x40b01500 + #x40b01600 + #x40b01700 + #x40b01800 + #x40b01900 + #x40b01a00 + ) + ) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3023 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 1.0) + (:x (meters -0.06)) + (:y (meters -0.8)) + (:z (meters 0.03)) + (:scale-x (meters 3.6)) + (:rot-x (degrees 90)) + (:scale-y (meters 3)) + (:r 15.0) + (:g 15.0) + (:b 30.0) + (:a 128.0) + (:scalevel-y (meters -0.053333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 aux-list sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3026 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:x (meters 0.025)) + (:y (meters -0.8)) + (:z (meters 0.1)) + (:scale-x (meters 3.8)) + (:rot-x (degrees 90)) + (:scale-y (meters 3)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:scalevel-y (meters -0.053333335)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-mediumd + :id 820 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 16) + :scale (0.5 0.5 0.5) + :parts ((sp-item 3027 :flags (is-3d sp7)) + (sp-item 3028 :flags (is-3d sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 3029 :flags (is-3d sp7) :period (seconds 0.267) :length (seconds 0.017)) + (sp-item 3030 :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3030 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 16)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 20.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3027 + :init-specs ((:texture (vinroom-tv-circle freehq-sprite)) + (:num 0.0 0.2) + (:scale-x (meters 0)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.026666667)) + (:scalevel-y (meters 0.013333334)) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:next-time (seconds 0.335)) + (:next-launcher 3031) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3031 + :init-specs ((:fade-a -0.53333336)) + ) + +;; failed to figure out what this is: +(defpart 3028 + :init-specs ((:texture (vinroom-tv-radar freehq-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 80.0) + (:rotvel-y (degrees -0.6)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3029 + :init-specs ((:texture (vinroom-tv-radar-dots freehq-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 1.5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:rotvel-y (degrees 0.33333334) (degrees 0.26666668)) + (:timer (seconds 0.135) (seconds 0.53)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-biga + :id 821 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3032 :flags (sp6 sp7)) (sp-item 3033 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 3033 + :init-specs ((:texture (holo-curve freehq-sprite)) + (:num 0.0 0.2) + (:y (meters -0.2)) + (:scale-x (meters 2.3) 4 (meters 2.3)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 55.0 200.0) + (:g 55.0 200.0) + (:b 255.0) + (:a 8.0 8.0) + (:rotvel-y (degrees -0.26666668) (degrees 0.53333336)) + (:timer (seconds 0.5) (seconds 4.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3032 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 30)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-bigb + :id 822 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 3034 :flags (sp6 sp7)) + (sp-item 3035 :flags (is-3d sp7)) + (sp-item 3036 :flags (is-3d sp7)) + (sp-item 3037 :flags (is-3d sp7) :period (seconds 0.5) :length (seconds 0.017)) + ) + ) + +;; definition for function sparticle-kill-at-scale +;; WARN: Return type mismatch float vs none. +(defun sparticle-kill-at-scale ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when (or (>= (-> arg2 launchrot w) 114688.0) (>= (-> arg2 conerot w) 65536.0)) + (set! (-> arg2 launchrot w) 0.0) + (set! (-> arg2 conerot w) 0.0) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 3035 + :init-specs ((:texture (line-scroll freehq-sprite)) + (:num 0.0 0.3) + (:x (meters 7.5)) + (:y (meters -4) 9 (meters 1)) + (:z (meters 0)) + (:scale-x (meters 0.15)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.15)) + (:r 200.0) + (:g 200.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.1) (meters 0.1)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3038 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a -0.016 -0.016)) + ) + +;; failed to figure out what this is: +(defpart 3036 + :init-specs ((:texture (line-scroll2 freehq-sprite)) + (:num 0.0 0.3) + (:x (meters -7) 13 (meters 1)) + (:y (meters -4.5)) + (:z (meters 0)) + (:scale-x (meters 0.15)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.15)) + (:r 200.0) + (:g 200.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-y (meters 0.1) (meters 0.1)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function sparticle-kill-at-scale-squares +;; WARN: Return type mismatch float vs none. +(defun sparticle-kill-at-scale-squares ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when (or (>= (-> arg2 launchrot w) 40960.0) (>= (-> arg2 conerot w) 20480.0)) + (set! (-> arg2 launchrot w) 0.0) + (set! (-> arg2 conerot w) 0.0) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 3037 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:x (meters -3) (meters 6)) + (:y (meters -3) (meters 6)) + (:z (meters 0.06)) + (:scale-x (meters 2) (meters 4)) + (:rot-x (degrees 90)) + (:scale-y (meters 1) (meters 2)) + (:r 55.0 200.0) + (:g 55.0 200.0) + (:b 255.0) + (:a 8.0 8.0) + (:vel-y (meters 0)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-kill-at-scale-squares) + (:next-time (seconds 0.485)) + (:next-launcher 3039) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3039 + :init-specs ((:scalevel-x (meters -0.06666667) 4 (meters 0.033333335)) + (:scalevel-y (meters -0.06666667) 4 (meters 0.033333335)) + (:next-time (seconds 0.167)) + (:next-launcher 3040) + ) + ) + +;; failed to figure out what this is: +(defpart 3040 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:next-time (seconds 0.485)) (:next-launcher 3039)) + ) + +;; failed to figure out what this is: +(defpart 3034 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 30)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-bigc + :id 823 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3043 :flags (sp6 sp7)) + (sp-item 3044 :flags (sp3 sp7) :binding 3041) + (sp-item 3041 :flags (sp2 sp3 sp7) :binding 3042) + (sp-item 3042 :flags (is-3d sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 3043 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 30)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3044 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 3041 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:z (meters 1)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 255.0) + (:b 0.0) + (:a 0.0) + (:omega (degrees 90)) + (:vel-y (meters 0.053333335)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +;; failed to figure out what this is: +(defpart 3042 + :init-specs ((:texture (circle freehq-sprite)) + (:num 0.08) + (:scale-x (meters 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 76)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 50.0) + (:scalevel-x (meters 0.006666667)) + (:rotvel-y (degrees 0.4)) + (:scalevel-y (meters 0.0139999995)) + (:fade-a -0.053333335) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-giant + :id 824 + :flags (sp0 sp1 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3045 :flags (sp6 sp7)) + (sp-item 3046 :flags (sp7)) + (sp-item 3047 :flags (sp7)) + (sp-item 3048 :flags (sp7)) + (sp-item 3049 :flags (sp7)) + (sp-item 3050 :flags (sp7)) + (sp-item 3051 :flags (is-3d sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3045 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 40)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 50)) + (:r 50.0 20.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3051 + :init-specs ((:texture (landscape freehq-sprite)) + (:birth-func 'birth-func-curve) + (:num 0.04) + (:x (meters 0)) + (:y (meters 2)) + (:z (meters 0.1)) + (:scale-x (meters 1)) + (:rot-x (degrees 90) 1 (degrees 180)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 255.0) + (:b 50.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:fade-a 0.026666667) + (:friction 1.01) + (:timer (seconds 4.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-landscape-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 16.0 :z 17.0 :w 18.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-landscape-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.3 :z 0.6 :w 1.6) + :one-over-x-deltas (new 'static 'vector :x 0.12500001 :y 1.5000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-landscape-scale-x-temp* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.9 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.5 :y 1.5 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :y -2.9999988 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-landscape-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.85 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.8 :z 2.8 :w 3.7) + :one-over-x-deltas (new 'static 'vector :x 1.5999999 :y 2.8571427 :z 6.0000014 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-landscape-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-freehq-giant-landscape-curve-settings*, type particle-curve-settings +(define *part-freehq-giant-landscape-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 4.085)) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 3051 init-specs 19 initial-valuef) + (the-as float *part-freehq-giant-landscape-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* color-start) #f) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* alpha-start) #f) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* scale-x-start) *range-landscape-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* scale-y-start) *range-landscape-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* a-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* scale-x-scalar) *curve-landscape-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-freehq-giant-landscape-curve-settings* scale-y-scalar) *curve-landscape-scale-y*) + +;; failed to figure out what this is: +(defpart 3046 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.007) + (:x (meters -3.7)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.012) + (:timer (seconds 3.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees -45)) + ) + ) + +;; failed to figure out what this is: +(defpart 3047 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.009) + (:x (meters -2)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.011) + (:timer (seconds 4.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees -25.000002)) + ) + ) + +;; failed to figure out what this is: +(defpart 3048 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.008) + (:x (meters 0)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.01) + (:timer (seconds 4.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3049 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.007) + (:x (meters 2)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.011) + (:timer (seconds 4.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees 25.000002)) + ) + ) + +;; failed to figure out what this is: +(defpart 3050 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.009) + (:x (meters 3.7)) + (:y (meters 1.8)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters 0.0005)) + (:fade-a 0.094814815) + (:friction 1.012) + (:timer (seconds 4.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-z (degrees 45)) + ) + ) + +;; failed to figure out what this is: +(defpart 3052 + :init-specs ((:texture (common-white common)) + (:birth-func 'birth-func-simple-prim) + (:num 1.0) + (:x (meters -27)) + (:y (meters -3)) + (:z (meters 1)) + (:scale-x (meters 30)) + (:rot-x (degrees 90)) + (:scale-y (meters 15)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3053 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:x (meters -10.5)) + (:y (meters -7)) + (:z (meters 1)) + (:scale-x (meters 3.3)) + (:rot-x (degrees 90)) + (:scale-y (meters 3.3)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3054 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:x (meters 19)) + (:y (meters -3)) + (:z (meters 1)) + (:scale-x (meters 15)) + (:rot-x (degrees 90)) + (:scale-y (meters 15)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-bigtable + :id 825 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3055 :flags (is-3d sp3 sp7)) (sp-item 3056 :flags (is-3d sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 3055 + :init-specs ((:texture (yavin freehq-sprite)) + (:num 1.0) + (:z (meters -0.15)) + (:scale-x (meters 3.7)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3056 + :init-specs ((:texture (twirl freehq-sprite)) + (:num 1.0) + (:z (meters -0.14)) + (:scale-x (meters 3.7)) + (:rot-x (degrees -90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 140.0) + (:rotvel-y (degrees 1.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-green-light-1 + :id 826 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.335) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-green-light-2 + :id 827 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.535) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-green-light-3 + :id 828 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.7) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-green-light-4 + :id 829 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.185) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-green-light-5 + :id 830 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 0.935) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-green-light-6 + :id 831 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.385) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-green-light-7 + :id 832 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 1.567) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-green-light-8 + :id 833 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3057 :fade-after (meters 60) :flags (sp6) :period (seconds 2) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpart 3057 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -0.025)) + (:z (meters 0)) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 255.0) + (:b 64.0 64.0) + (:a 32.0 4.0) + (:omega (degrees 1359)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-blue-light-1 + :id 834 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.335) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-blue-light-2 + :id 835 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.535) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-blue-light-3 + :id 836 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.7) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-blue-light-4 + :id 837 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.185) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-blue-light-5 + :id 838 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 0.935) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-blue-light-6 + :id 839 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.385) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-blue-light-7 + :id 840 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 1.567) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-console-blue-light-8 + :id 841 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3058 :fade-after (meters 60) :flags (sp6) :period (seconds 2) :length (seconds 0.167))) + ) + +;; failed to figure out what this is: +(defpart 3058 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 20.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1359)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-red-wall-light + :id 842 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 3059 :fade-after (meters 80) :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 3059 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 20.0) + (:b 20.0) + (:a 40.0 2.0) + (:omega (degrees 1359)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-white-wall-light-top + :id 843 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 3060 :flags (sp6 sp7) :period (seconds 0.5) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 3060 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -0.2)) + (:scale-x (meters 0.6)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 0.8)) + (:r 40.0) + (:g 40.0) + (:b 200.0) + (:a -512.0 5 128.0) + (:omega (degrees 2268)) + (:timer (seconds 0.335) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-white-wall-light-bottom + :id 844 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 3061 :fade-after (meters 150) :flags (sp6 sp7) :period (seconds 0.5) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 3061 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -0.2)) + (:scale-x (meters 1)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 0.8)) + (:r 40.0) + (:g 128.0) + (:b 110.0) + (:a -256.0 5 64.0) + (:omega (degrees 2268)) + (:timer (seconds 0.335) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-freehq-red-wall-lights + :id 845 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 3062 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3063 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3064 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3065 :fade-after (meters 100) :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3062 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters 0.2)) + (:scale-x (meters 4.2) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 20.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 13107.2) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3063 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1.5)) + (:z (meters 0.2)) + (:scale-x (meters 4.2) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 20.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 13107.2) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3064 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters -1.5)) + (:z (meters 0.2)) + (:scale-x (meters 4.2) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 20.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 13107.2) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3065 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 8) (meters 0.1)) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 20.0 4.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 13107.2) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/freehq/freehq-scenes_REF.gc b/test/decompiler/reference/jak3/levels/city/freehq/freehq-scenes_REF.gc new file mode 100644 index 0000000000..cad9d30870 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/freehq/freehq-scenes_REF.gc @@ -0,0 +1,1046 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-purple-two purple-two purple-two-lod0-jg purple-two-idle-ja + ((purple-two-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "factory-sky-battle-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "factory-sky-battle-intro" + :parts 8 + :command-list '((fadein (frame-time 30 20)) + (945 (fadeout (frame-time-30 15))) + (10000 (task-close! "factory-sky-battle-introduction")) + ) + :cut-list '(160 188 285 333 413 516 596 656 785 868) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(160 656) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'freehq + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'ltornsam + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "freehq-start" + :borrow '((freehq 0 ltornsam special)) + :sfx-volume -1.0 + :ambient-volume 0.5 + :music-delay 1500.0 + :scene-task #xd1 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-freehq-sml-door freehq-sml-door freehq-sml-door-lod0-jg freehq-sml-door-idle-ja + ((freehq-sml-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 7) + ) + +;; definition of type freehq-sml-door +(deftype freehq-sml-door (com-airlock) + () + ) + +;; definition for method 3 of type freehq-sml-door +(defmethod inspect ((this freehq-sml-door)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type freehq-sml-door +(defmethod init-from-entity! ((this freehq-sml-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 14336.0 0.0 28672.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 12288.0 14336.0 0.0 28672.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -12288.0 14336.0 0.0 28672.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-freehq-sml-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this sound-open) (static-sound-spec "hqdoor-open" :group 0)) + (set! (-> this sound-close) (static-sound-spec "hqdoor-close" :group 0)) + (go (method-of-object this close) #t) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "city-protect-hq-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "city-protect-hq-intro" + :parts 25 + :command-list '((0) + (101 (kill "freehq-part-1")) + (216 (restore "freehq-part-1")) + (391 (kill "freehq-part-1")) + (667 (restore "freehq-part-1")) + (1170 (kill "freehq-part-1")) + (1256 (restore "freehq-part-1")) + (1500 (kill "freehq-part-1")) + (1636 (restore "freehq-part-1")) + (1731 (kill "freehq-part-1")) + (1790 (restore "freehq-part-1")) + (1907 (kill "freehq-part-1")) + (1938 (restore "freehq-part-1")) + (2185 (fadeout (frame-time-30 15))) + (10000 (task-close! "city-protect-hq-introduction")) + ) + :cut-list '(0 + 34 + 101 + 217 + 280 + 345 + 391 + 445 + 668 + 752 + 911 + 1057 + 1170 + 1257 + 1280 + 1342 + 1411 + 1500 + 1637 + 1731 + 1791 + 1889 + 1907 + 1938 + 2023 + 2046 + 2094 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min 1938) (2046 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(34 217 (667 671) 752 1500 1889 1938 2023 (2044 2050) (2092 2096)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min 2023) (2094 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'freehq + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'freecast + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'freecast + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'freecast + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'freecast + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'freecast + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "ctyslumc-freehq-exit" + :borrow '((freehq 0 ltornsam special)) + :sfx-volume -1.0 + :music-delay 1500.0 + :scene-task #xa8 + :on-running '(begin (sound-play-loop "hq-amb-mov") (sound-play-loop "hq-amb-loop-mov")) + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "city-protect-hq-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "city-protect-hq-res" + :parts 34 + :command-list '((2970 (fadeout (frame-time-30 30))) + (10000 (task-close! "sewer-hum-kg-introduction") (apply ,(lambda :behavior scene-player + () + (if (kiosk?) + (set! (-> self end-point) "sewb-elevator") + ) + (none) + ) + ) + ) + ) + :cut-list '(1 + 36 + 80 + 139 + 207 + 243 + 264 + 355 + 410 + 466 + 503 + 602 + 685 + 753 + 861 + 946 + 1001 + 1146 + 1178 + 1216 + 1278 + 1317 + 1436 + 1493 + 1557 + 1638 + 1723 + 1810 + 1869 + 1910 + 1967 + 2165 + 2198 + 2272 + 2391 + 2466 + 2544 + 2643 + 2772 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(80 139 207 355 (667 671) 753 1178 1638 1869 1910 1967 2165 2272 2391 2466) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'freecast + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'freecast + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min 503) (602 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'freecast + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'freecast + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min 685) (753 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'freecast + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "veger-highres" + :level 'freecast + :art-group "skel-veger-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(1 204 260 355 602 685 (751 755) 787 860 946 1178 1278 1317 1493 1638 1723 1802 1810 1820 1856 (1866 1879)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "freehq-movie" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "hq-amb-mov") (sound-play-loop "hq-amb-loop-mov")) + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "city-blow-tower-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "city-blow-tower-intro" + :parts 15 + :command-list '((1720 (fadeout (frame-time-30 15))) (10000 (task-close! "city-blow-tower-introduction"))) + :cut-list '(134 208 269 475 579 712 733 829 1019 1077 1201 1285 1328 1481 1536 1599) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'freecast + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "cty-blow-tower-mission" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "hq-amb-mov") (sound-play-loop "hq-amb-loop-mov")) + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "temple-defend-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "temple-defend-intro" + :parts 13 + :command-list '((0 (kill "freehq-part-1")) + (530 + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LindexC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LpinkyC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LthumbC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LringC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "LmiddleC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RpinkyC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RthumbC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RringC" + track + #t + duration + (frame-range 530 711) + ) + (part-tracker + "groupfreehq-onin-small-finger-effect" + entity + "onin-highres" + joint + "RmiddleC" + track + #t + duration + (frame-range 530 711) + ) + ) + (1111 (fadeout (frame-time-30 10))) + (10000 + (send-event self 'user-data-set! (task-closed? "temple-defend-introduction")) + (task-close! "temple-defend-introduction") + ) + ) + :cut-list '(28 151 530 712 825 1007 1067) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'freehq + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(712) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'freehq + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'freecast + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'freecast + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'freecast + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "purple-two" + :level 'freecast + :art-group "skel-purple-two" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'freecast + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-movie" + :end-point "freehq-movie" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "hq-amb-mov") (sound-play-loop "hq-amb-loop-mov")) + :on-complete '(unless (send-event self 'user-data) (talker-spawn "powup015")) + ) + ) + +;; failed to figure out what this is: +(defpartgroup groupfreehq-onin-finger-effect + :id 846 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3066 :falloff-to (meters 20)) (sp-item 3067 :falloff-to (meters 20))) + ) + +;; failed to figure out what this is: +(defpart 3066 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.000016666667)) + (:timer (seconds 1) (seconds 2.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3068) + ) + ) + +;; failed to figure out what this is: +(defpart 3068 + :init-specs ((:scale-x (meters 0.01) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.0) + (:next-time (seconds 0.017)) + (:next-launcher 3069) + ) + ) + +;; failed to figure out what this is: +(defpart 3069 + :init-specs ((:r 0.0) (:g 64.0 64.0) (:b 255.0) (:a 64.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 3068)) + ) + +;; failed to figure out what this is: +(defpart 3067 + :init-specs ((:texture (onin-magic-bigpuff freehq-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:timer (seconds 0.5) (seconds 1.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup groupfreehq-onin-small-finger-effect + :id 847 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3070 :falloff-to (meters 15)) (sp-item 3071 :falloff-to (meters 15))) + ) + +;; failed to figure out what this is: +(defpart 3070 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.000016666667)) + (:timer (seconds 0.5) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3068) + ) + ) + +;; failed to figure out what this is: +(defpart 3071 + :init-specs ((:texture (onin-magic-bigpuff freehq-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:timer (seconds 0.5) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/hijack/billiards_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/billiards_REF.gc new file mode 100644 index 0000000000..34aabb84d3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/hijack/billiards_REF.gc @@ -0,0 +1,324 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type billiard-ball +(deftype billiard-ball (structure) + ((pos vector :inline) + (prev-pos vector :inline) + (size float) + (flags billiard-ball-flag) + ) + ) + +;; definition for method 3 of type billiard-ball +(defmethod inspect ((this billiard-ball)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'billiard-ball) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tprev-pos: #~%" (-> this prev-pos)) + (format #t "~1Tsize: ~f~%" (-> this size)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (label cfg-4) + this + ) + +;; definition of type billiard-ball-array +(deftype billiard-ball-array (inline-array-class) + ((data billiard-ball :inline :dynamic) + ) + ) + +;; definition for method 3 of type billiard-ball-array +(defmethod inspect ((this billiard-ball-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> billiard-ball-array heap-base) (the-as uint 48)) + +;; definition of type billiard-table +(deftype billiard-table (basic) + ((billiards billiard-ball-array) + (accum-force vector :inline) + (drag float) + (bounds vector 2 :inline) + (min-xyz vector :inline :overlay-at (-> bounds 0)) + (max-xyz vector :inline :overlay-at (-> bounds 1)) + (bounce-wall-friction float) + (ball-friction float) + ) + (:methods + (init! (_type_ int vector vector) none) + (billiard-table-method-10 (_type_) none) + (debug-draw (_type_) none) + (reset-accum-force (_type_) none) + (billiard-table-method-13 (_type_) symbol) + (billiard-table-method-14 (_type_) symbol) + (billiard-table-method-15 (_type_ float) none) + ) + ) + +;; definition for method 3 of type billiard-table +(defmethod inspect ((this billiard-table)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbilliards: ~A~%" (-> this billiards)) + (format #t "~1Taccum-force: #~%" (-> this accum-force)) + (format #t "~1Tdrag: ~f~%" (-> this drag)) + (format #t "~1Tbounds[2] @ #x~X~%" (-> this min-xyz)) + (format #t "~1Tmin-xyz: #~%" (-> this min-xyz)) + (format #t "~1Tmax-xyz: #~%" (-> this max-xyz)) + (format #t "~1Tbounce-wall-friction: ~f~%" (-> this bounce-wall-friction)) + (format #t "~1Tball-friction: ~f~%" (-> this ball-friction)) + (label cfg-4) + this + ) + +;; definition for method 12 of type billiard-table +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod reset-accum-force ((this billiard-table)) + (set! (-> this accum-force quad) (the-as uint128 0)) + 0 + (none) + ) + +;; definition for method 9 of type billiard-table +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this billiard-table) (arg0 int) (arg1 vector) (arg2 vector)) + (set! (-> this billiards) (new 'process 'billiard-ball-array arg0)) + (set! (-> this billiards length) arg0) + (set! (-> this min-xyz quad) (-> arg1 quad)) + (set! (-> this max-xyz quad) (-> arg2 quad)) + (dotimes (v1-4 (-> this billiards length)) + (set! (-> this billiards data v1-4 size) 4096.0) + ) + (billiard-table-method-13 this) + (none) + ) + +;; definition for method 13 of type billiard-table +;; INFO: Used lq/sq +(defmethod billiard-table-method-13 ((this billiard-table)) + (dotimes (s5-0 (-> this billiards length)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this max-xyz) (-> this min-xyz))) + (s3-0 s4-0) + ) + (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + ) + (set! (-> s3-0 x) (* (+ -1.0 (the-as float v1-3)) (-> s2-1 x))) + ) + (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-7 (the-as number (logior #x3f800000 v1-6))) + ) + (set! (-> s3-0 y) (* (+ -1.0 (the-as float v1-7)) (-> s2-1 y))) + ) + (let* ((v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-11 (the-as number (logior #x3f800000 v1-10))) + ) + (set! (-> s3-0 z) (* (+ -1.0 (the-as float v1-11)) (-> s2-1 z))) + ) + (set! (-> s3-0 w) 1.0) + ) + (vector+! (the-as vector (-> this billiards data s5-0)) (-> this min-xyz) s4-0) + ) + ) + (billiard-table-method-14 this) + (dotimes (v1-23 (-> this billiards length)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> this billiards data 0 prev-pos)) (* 48 v1-23)))) + (-> this billiards data v1-23 pos quad) + ) + ) + #f + ) + +;; definition for method 10 of type billiard-table +(defmethod billiard-table-method-10 ((this billiard-table)) + (with-pp + (dotimes (v1-0 (-> this billiards length)) + (set! (-> this billiards data v1-0 flags) (billiard-ball-flag)) + ) + (reset-accum-force this) + (billiard-table-method-15 + this + (* 0.0033333334 (the float (- (current-time) (-> pp clock old-frame-counter)))) + ) + (billiard-table-method-14 this) + (debug-draw this) + (none) + ) + ) + +;; definition for method 15 of type billiard-table +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod billiard-table-method-15 ((this billiard-table) (arg0 float)) + (let ((f0-1 (* arg0 arg0)) + (f1-1 (-> this drag)) + ) + (dotimes (v1-0 (-> this billiards length)) + (let ((a2-1 (-> this billiards data v1-0)) + (a1-4 (new 'stack-no-clear 'vector)) + ) + (let ((a3-0 (new 'stack-no-clear 'vector))) + (set! (-> a3-0 quad) (-> this accum-force quad)) + (vector-float*! a1-4 (-> a2-1 pos) (- 2.0 f1-1)) + (vector-! a1-4 a1-4 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) + (vector+float*! a1-4 a1-4 a3-0 f0-1) + ) + (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) + (set! (-> a2-1 pos quad) (-> a1-4 quad)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 7 of type billiard-table +(defmethod relocate ((this billiard-table) (offset int)) + (if (nonzero? (-> this billiards)) + (&+! (-> this billiards) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 14 of type billiard-table +;; INFO: Used lq/sq +(defmethod billiard-table-method-14 ((this billiard-table)) + (dotimes (s5-0 (-> this billiards length)) + (let ((s4-0 (+ s5-0 1)) + (s3-0 (+ (-> this billiards length) -1)) + ) + (while (>= s3-0 s4-0) + (let* ((s1-0 (-> this billiards data s5-0)) + (s2-0 (-> this billiards data s4-0)) + (s0-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 pos) (-> s1-0 pos))) + ) + 0.0 + (let ((f0-2 (+ (-> s1-0 size) (-> s2-0 size))) + (f1-1 (vector-length s0-1)) + ) + (when (< f1-1 f0-2) + (let ((f28-0 (/ (-> s2-0 size) f0-2)) + (f30-0 (/ (-> s1-0 size) f0-2)) + ) + (logior! (-> s1-0 flags) (billiard-ball-flag bb1)) + (logior! (-> s2-0 flags) (billiard-ball-flag bb1)) + (vector-normalize! s0-1 (- f0-2 f1-1)) + (vector+float*! (-> s1-0 pos) (-> s1-0 pos) s0-1 (- f28-0)) + (vector+float*! (-> s2-0 pos) (-> s2-0 pos) s0-1 f30-0) + ) + (let ((a0-9 (vector-! (new 'stack-no-clear 'vector) (-> s1-0 prev-pos) (-> s1-0 pos))) + (v1-21 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 prev-pos) (-> s2-0 pos))) + ) + (vector+float*! (-> s1-0 prev-pos) (-> s1-0 pos) a0-9 (- 1.0 (-> this ball-friction))) + (vector+float*! (-> s2-0 prev-pos) (-> s2-0 pos) v1-21 (- 1.0 (-> this ball-friction))) + ) + ) + ) + ) + (+! s4-0 1) + ) + ) + ) + (dotimes (s5-1 1) + (dotimes (s4-1 (-> this billiards length)) + (let ((s3-1 (-> this billiards data s4-1)) + (s1-1 #f) + (f30-1 2.0) + (s2-1 -1) + ) + -1 + (add-debug-line #t (bucket-id debug) (-> s3-1 prev-pos) (-> s3-1 pos) *color-blue* #f *color-green*) + (dotimes (v1-33 3) + (when (!= v1-33 1) + (let ((f0-10 (- (-> s3-1 prev-pos data v1-33) (-> s3-1 pos data v1-33)))) + 0.0 + (dotimes (a0-20 2) + (let ((f1-8 (/ (- (-> s3-1 prev-pos data v1-33) + (-> (the-as billiard-table (+ (+ (* v1-33 4) (* a0-20 16)) (the-as int this))) min-xyz x) + ) + f0-10 + ) + ) + ) + (when (and (< f1-8 f30-1) (>= f1-8 0.0) (< f1-8 1.0)) + (set! s1-1 #t) + (set! f30-1 f1-8) + (set! s2-1 v1-33) + ) + ) + ) + ) + ) + ) + (when s1-1 + (let ((a0-24 (vector-! (new 'stack-no-clear 'vector) (-> s3-1 pos) (-> s3-1 prev-pos))) + (v1-38 (new 'stack-no-clear 'vector)) + (s1-2 (new 'stack-no-clear 'vector)) + ) + (logior! (-> s3-1 flags) (billiard-ball-flag bb0)) + (vector+float*! v1-38 (-> s3-1 prev-pos) a0-24 f30-1) + (set! (-> s1-2 quad) (-> a0-24 quad)) + (set! (-> s1-2 data s2-1) (* -1.0 (-> s1-2 data s2-1))) + (vector+float*! (-> s3-1 pos) v1-38 s1-2 (- 1.0 f30-1)) + (let ((v1-39 (vector-normalize-copy! (new 'stack-no-clear 'vector) s1-2 1.0))) + 0.0 + (let* ((f0-18 (fabs (-> v1-39 data s2-1))) + (f1-10 (* f0-18 f0-18)) + ) + (vector-float*! s1-2 s1-2 (* -1.0 (- 1.0 (* f1-10 (-> this bounce-wall-friction))))) + ) + ) + (vector+! (-> s3-1 prev-pos) (-> s3-1 pos) s1-2) + ) + ) + ) + ) + ) + (dotimes (v1-51 (-> this billiards length)) + (let ((a0-40 (-> this billiards data v1-51))) + (dotimes (a1-30 3) + (set! (-> a0-40 pos data a1-30) + (fmax (fmin (-> a0-40 pos data a1-30) (-> this max-xyz data a1-30)) (-> this min-xyz data a1-30)) + ) + ) + ) + ) + #f + ) + +;; definition for method 11 of type billiard-table +;; WARN: Return type mismatch symbol vs none. +(defmethod debug-draw ((this billiard-table)) + (dotimes (s5-0 (-> this billiards length)) + (let ((v1-3 (-> this billiards data s5-0))) + (add-debug-sphere #t (bucket-id debug) (-> v1-3 pos) (-> v1-3 size) *color-red*) + ) + ) + (add-debug-box #t (bucket-id debug) (-> this min-xyz) (-> this max-xyz) *color-red*) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack-missile_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack-missile_REF.gc new file mode 100644 index 0000000000..059609a0fa --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack-missile_REF.gc @@ -0,0 +1,1618 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 4710 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 150.0) + (:b 150.0) + (:a 30.0 30.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.2 -0.2) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x400000 #x405c00)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4711 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 250.0) + (:g 80.0) + (:b 0.0) + (:a 30.0 30.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.0) + (:fade-g 1.4) + (:fade-b 3.0) + (:fade-a -0.2 -0.2) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 50 1 0 #x400000 #x405c00)) + (:next-time (seconds 0.167)) + (:next-launcher 4712) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4712 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-missile-thruster-fire + :id 1432 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4713 :flags (is-3d sp7)) (sp-item 4714 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4713 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -0.4) 1 (meters -0.5)) + (:scale-x (meters 0.1) 1 (meters 2)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 2) 1 (meters 2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 40.0) + (:fade-a -0.6) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4714 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.25)) + (:scale-x (meters 1.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 40.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-hijack-missile cty-homing-missile cty-homing-missile-lod0-jg cty-homing-missile-idle-ja + ((cty-homing-missile-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :origin-joint-index 3 + ) + +;; definition of type cty-hijack-missile-init-params +(deftype cty-hijack-missile-init-params (structure) + ((pos vector :inline) + (quat quaternion :inline) + (track-obj handle) + (is-leader? symbol) + ) + ) + +;; definition for method 3 of type cty-hijack-missile-init-params +(defmethod inspect ((this cty-hijack-missile-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'cty-hijack-missile-init-params) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Ttrack-obj: ~D~%" (-> this track-obj)) + (format #t "~1Tis-leader?: ~A~%" (-> this is-leader?)) + (label cfg-4) + this + ) + +;; definition of type evasive-compare-params +(deftype evasive-compare-params (structure) + ((data float 3) + (y-val float :overlay-at (-> data 0)) + (angular-velocity float :overlay-at (-> data 1)) + (speed float :overlay-at (-> data 2)) + ) + :pack-me + ) + +;; definition for method 3 of type evasive-compare-params +(defmethod inspect ((this evasive-compare-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'evasive-compare-params) + (format #t "~1Tdata[3] @ #x~X~%" (&-> this y-val)) + (format #t "~1Ty-val: ~f~%" (-> this y-val)) + (format #t "~1Tangular-velocity: ~f~%" (-> this angular-velocity)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (label cfg-4) + this + ) + +;; definition of type evasive-action-info +(deftype evasive-action-info (structure) + ((start-values evasive-compare-params :inline) + (max-values evasive-compare-params :inline) + (difficulty float) + (evaded? symbol) + ) + (:methods + (init! (_type_ evasive-compare-params evasive-compare-params float) none) + (evaded? (_type_ evasive-compare-params) symbol) + ) + ) + +;; definition for method 3 of type evasive-action-info +(defmethod inspect ((this evasive-action-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'evasive-action-info) + (format #t "~1Tstart-values: #~%" (-> this start-values)) + (format #t "~1Tmax-values: #~%" (-> this max-values)) + (format #t "~1Tdifficulty: ~f~%" (-> this difficulty)) + (format #t "~1Tevaded?: ~A~%" (-> this evaded?)) + (label cfg-4) + this + ) + +;; definition of type hijack-missile-bobber +(deftype hijack-missile-bobber (structure) + ((start-val float) + (current-val float) + (total-time time-frame) + (current-time time-frame) + (current-size-scalar float) + (dir float) + (num-iterations float) + (time-scalar float) + (start-time-scalar float) + (desired-time-scalar float) + (scale-min float) + (scale-max float) + (time-min float) + (time-max float) + (base-time float) + (current-speed float) + (output-scale float) + (output-val float) + (charge-time time-frame) + (wait-time time-frame) + (turning? symbol) + ) + :pack-me + (:methods + (init! (_type_) none) + (hijack-missile-bobber-method-10 (_type_) time-frame) + (hijack-missile-bobber-method-11 (_type_) time-frame) + ) + ) + +;; definition for method 3 of type hijack-missile-bobber +(defmethod inspect ((this hijack-missile-bobber)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hijack-missile-bobber) + (format #t "~1Tstart-val: ~f~%" (-> this start-val)) + (format #t "~1Tcurrent-val: ~f~%" (-> this current-val)) + (format #t "~1Ttotal-time: ~D~%" (-> this total-time)) + (format #t "~1Tcurrent-time: ~D~%" (-> this current-time)) + (format #t "~1Tcurrent-size-scalar: ~f~%" (-> this current-size-scalar)) + (format #t "~1Tdir: ~f~%" (-> this dir)) + (format #t "~1Tnum-iterations: ~f~%" (-> this num-iterations)) + (format #t "~1Ttime-scalar: ~f~%" (-> this time-scalar)) + (format #t "~1Tstart-time-scalar: ~f~%" (-> this start-time-scalar)) + (format #t "~1Tdesired-time-scalar: ~f~%" (-> this desired-time-scalar)) + (format #t "~1Tscale-min: ~f~%" (-> this scale-min)) + (format #t "~1Tscale-max: ~f~%" (-> this scale-max)) + (format #t "~1Ttime-min: ~f~%" (-> this time-min)) + (format #t "~1Ttime-max: ~f~%" (-> this time-max)) + (format #t "~1Tbase-time: ~f~%" (-> this base-time)) + (format #t "~1Tcurrent-speed: ~f~%" (-> this current-speed)) + (format #t "~1Toutput-scale: ~f~%" (-> this output-scale)) + (format #t "~1Toutput-val: ~f~%" (-> this output-val)) + (format #t "~1Tcharge-time: ~D~%" (-> this charge-time)) + (format #t "~1Twait-time: ~D~%" (-> this wait-time)) + (format #t "~1Tturning?: ~A~%" (-> this turning?)) + (label cfg-4) + this + ) + +;; definition for method 9 of type evasive-action-info +;; WARN: Return type mismatch pointer vs none. +(defmethod init! ((this evasive-action-info) (arg0 evasive-compare-params) (arg1 evasive-compare-params) (arg2 float)) + (set! (-> this evaded?) #f) + (set! (-> this difficulty) arg2) + (mem-copy! (the-as pointer (-> this start-values)) (the-as pointer arg1) 12) + (mem-copy! (the-as pointer (-> this max-values)) (the-as pointer arg0) 12) + (none) + ) + +;; definition for method 10 of type evasive-action-info +(defmethod evaded? ((this evasive-action-info) (arg0 evasive-compare-params)) + (local-vars (v0-0 symbol)) + 0.0 + (dotimes (v1-0 3) + (let ((f0-4 (/ (fabs (- (-> arg0 data v1-0) (-> this start-values data v1-0))) (-> this max-values data v1-0)))) + (when (< (-> this difficulty) f0-4) + (set! (-> this evaded?) #t) + (return (-> this evaded?)) + ) + ) + ) + (return (-> this evaded?)) + v0-0 + ) + +;; definition of type cty-hijack-missile +(deftype cty-hijack-missile (process-focusable) + ((root collide-shape-moving :override) + (tracked-player-positions vector-array) + (current-track-index uint32) + (last-record-time time-frame) + (track-obj handle) + (current-speed float) + (target-speed float) + (lunge-speed float) + (temp-vec vector :inline) + (evasive-info evasive-action-info :inline) + (target-pos vector :inline) + (flee-vec vector :inline) + (is-leader? symbol) + (offset-dist float) + (vel-factor float) + (original-quat quaternion :inline) + (rotate-deg float) + (basetrans vector :inline) + (lisa lissajous-interp :inline) + (next-lisa-time time-frame) + (lisa-pt vector :inline) + (circle-mag float) + (last-trans vector :inline) + (min-chase-speed float) + (min-targ-chase-speed float) + (max-chase-speed float) + (targ-scale-factor float) + (scale-factor float) + (missile-dist float) + (stage int8) + (particle-trail sparticle-subsampler) + (particle-trail-thrust sparticle-subsampler) + (peel-off-sound sound-id) + (bobber hijack-missile-bobber :inline) + ) + (:state-methods + idle + undefined0 + chasing + explode + undefined1 + undefined2 + undefined3 + lunge-prepare + lure + lure-die + chasing-2 + die + explode-tiny + initial-launch + fake-chase + ) + (:methods + (go-idle (_type_) object) + (cty-hijack-missile-method-44 (_type_) none) + (probe-ground (_type_ vector vector) symbol) + (get-tracked-obj-pos (_type_ vector) vector) + (cty-hijack-missile-method-47 (_type_ vector int) vector) + (cty-hijack-missile-method-48 (_type_ vector) vector) + (cty-hijack-missile-method-49 (_type_) none) + (event-handler (_type_ process int symbol event-message-block) object) + (cty-hijack-missile-method-51 (_type_) none) + (cty-hijack-missile-method-52 (_type_ symbol) float) + (cty-hijack-missile-method-53 (_type_) none) + ) + ) + +;; definition for method 3 of type cty-hijack-missile +(defmethod inspect ((this cty-hijack-missile)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Ttracked-player-positions: ~A~%" (-> this tracked-player-positions)) + (format #t "~2Tcurrent-track-index: ~D~%" (-> this current-track-index)) + (format #t "~2Tlast-record-time: ~D~%" (-> this last-record-time)) + (format #t "~2Ttrack-obj: ~D~%" (-> this track-obj)) + (format #t "~2Tcurrent-speed: ~f~%" (-> this current-speed)) + (format #t "~2Ttarget-speed: ~f~%" (-> this target-speed)) + (format #t "~2Tlunge-speed: ~f~%" (-> this lunge-speed)) + (format #t "~2Ttemp-vec: #~%" (-> this temp-vec)) + (format #t "~2Tevasive-info: #~%" (-> this evasive-info)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tflee-vec: #~%" (-> this flee-vec)) + (format #t "~2Tis-leader?: ~A~%" (-> this is-leader?)) + (format #t "~2Toffset-dist: ~f~%" (-> this offset-dist)) + (format #t "~2Tvel-factor: ~f~%" (-> this vel-factor)) + (format #t "~2Toriginal-quat: #~%" (-> this original-quat)) + (format #t "~2Trotate-deg: ~f~%" (-> this rotate-deg)) + (format #t "~2Tbasetrans: #~%" (-> this basetrans)) + (format #t "~2Tlisa: #~%" (-> this lisa)) + (format #t "~2Tnext-lisa-time: ~D~%" (-> this next-lisa-time)) + (format #t "~2Tlisa-pt: #~%" (-> this lisa-pt)) + (format #t "~2Tcircle-mag: ~f~%" (-> this circle-mag)) + (format #t "~2Tlast-trans: #~%" (-> this last-trans)) + (format #t "~2Tmin-chase-speed: ~f~%" (-> this min-chase-speed)) + (format #t "~2Tmin-targ-chase-speed: ~f~%" (-> this min-targ-chase-speed)) + (format #t "~2Tmax-chase-speed: ~f~%" (-> this max-chase-speed)) + (format #t "~2Ttarg-scale-factor: ~f~%" (-> this targ-scale-factor)) + (format #t "~2Tscale-factor: ~f~%" (-> this scale-factor)) + (format #t "~2Tmissile-dist: ~f~%" (-> this missile-dist)) + (format #t "~2Tstage: ~D~%" (-> this stage)) + (format #t "~2Tparticle-trail: ~A~%" (-> this particle-trail)) + (format #t "~2Tparticle-trail-thrust: ~A~%" (-> this particle-trail-thrust)) + (format #t "~2Tpeel-off-sound: ~D~%" (-> this peel-off-sound)) + (format #t "~2Tbobber: #~%" (-> this bobber)) + (label cfg-4) + this + ) + +;; definition for symbol *missile-dist-near*, type float +(define *missile-dist-near* 31129.6) + +;; definition for symbol *missile-dist-far*, type float +(define *missile-dist-far* 86016.0) + +;; definition for function cty-hijack-missile-init-by-other +;; INFO: Used lq/sq +(defbehavior cty-hijack-missile-init-by-other cty-hijack-missile ((arg0 cty-hijack-missile-init-params)) + (set! (-> self level) (level-get *level* 'lctyhijk)) + (stack-size-set! (-> self main-thread) 256) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((s5-0 (new 'process 'collide-shape-moving self (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-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) (collide-spec hit-by-others-list)) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-12) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-hijack-missile" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + self + (set! (-> self particle-trail) + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 4710) 8.0) + ) + self + (set! (-> self particle-trail-thrust) + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 4711) 8.0) + ) + (set! (-> self tracked-player-positions) (new 'process 'vector-array 250)) + (set! (-> self tracked-player-positions length) 0) + (set! (-> self last-record-time) 0) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1432) self)) + (set! (-> self is-leader?) (-> arg0 is-leader?)) + (set! (-> self track-obj) (-> arg0 track-obj)) + (set-vector! (-> self root scale) 0.8 0.8 0.9 1.0) + (go-idle self) + ) + +;; definition for method 43 of type cty-hijack-missile +(defmethod go-idle ((this cty-hijack-missile)) + (set! (-> this peel-off-sound) (new-sound-id)) + (set! (-> this current-track-index) (the-as uint -1)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (set! (-> this stage) 0) + (init! (-> this bobber)) + (ja-post) + (go (method-of-object this idle)) + ) + +;; definition for method 46 of type cty-hijack-missile +;; INFO: Used lq/sq +(defmethod get-tracked-obj-pos ((this cty-hijack-missile) (arg0 vector)) + (let* ((s5-0 (handle->process (-> this track-obj))) + (a0-5 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (if a0-5 + (set! (-> arg0 quad) (-> (get-trans a0-5 3) quad)) + ) + ) + arg0 + ) + +;; definition for method 45 of type cty-hijack-missile +;; INFO: Used lq/sq +(defmethod probe-ground ((this cty-hijack-missile) (arg0 vector) (arg1 vector)) + (let ((v1-0 (new 'stack-no-clear 'collide-query))) + (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> v1-0 move-dist) arg1 (-> v1-0 start-pos)) + (let ((a0-4 v1-0)) + (set! (-> a0-4 radius) 8192.0) + (set! (-> a0-4 collide-with) (collide-spec backgnd)) + (set! (-> a0-4 ignore-process0) #f) + (set! (-> a0-4 ignore-process1) #f) + (set! (-> a0-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a0-4 action-mask) (collide-action solid)) + ) + (< (fill-and-probe-using-line-sphere *collide-cache* v1-0) 0.0) + ) + ) + +;; definition for method 44 of type cty-hijack-missile +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 44 cty-hijack-missile) has a return type of none, but the expression builder found a return statement. +(defmethod cty-hijack-missile-method-44 ((this cty-hijack-missile)) + (let ((v1-1 (-> this tracked-player-positions length))) + (-> this tracked-player-positions) + (when (>= v1-1 (-> this tracked-player-positions allocated-length)) + (break!) + 0 + ) + ) + (let ((s5-0 (get-tracked-obj-pos this (new 'stack-no-clear 'vector)))) + (if (>= 40.96 (vector-vector-distance + (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -1)) + s5-0 + ) + ) + (return 0) + ) + (if (probe-ground + this + (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -2)) + s5-0 + ) + (set! (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -1) quad) + (-> s5-0 quad) + ) + (push-back (-> this tracked-player-positions) s5-0) + ) + ) + (none) + ) + +;; definition for method 7 of type cty-hijack-missile +(defmethod relocate ((this cty-hijack-missile) (offset int)) + (if (nonzero? (-> this tracked-player-positions)) + (&+! (-> this tracked-player-positions) offset) + ) + (if (nonzero? (-> this particle-trail)) + (&+! (-> this particle-trail) offset) + ) + (if (nonzero? (-> this particle-trail-thrust)) + (&+! (-> this particle-trail-thrust) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 52 of type cty-hijack-missile +(defmethod cty-hijack-missile-method-52 ((this cty-hijack-missile) (arg0 symbol)) + (set! (-> this min-chase-speed) 221184.0) + (set! (-> this min-targ-chase-speed) 221184.0) + (set! (-> this max-chase-speed) 253952.0) + (set! (-> this missile-dist) *missile-dist-near*) + (set! (-> this offset-dist) *missile-dist-near*) + (set! (-> this stage) 2) + (set! (-> this targ-scale-factor) 1.0) + (if arg0 + (set! (-> this scale-factor) (-> this targ-scale-factor)) + ) + ) + +;; failed to figure out what this is: +(defstate idle (cty-hijack-missile) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('chase-2) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (cty-hijack-missile-method-52 self #t) + (go-virtual chasing-2) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self missile-dist) *missile-dist-far*) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (not (task-node-closed? (game-task-node city-hijack-vehicle-escape))) + (set! (-> self targ-scale-factor) 0.6) + (set! (-> self scale-factor) (-> self targ-scale-factor)) + (set! (-> self min-chase-speed) 114688.0) + (set! (-> self min-targ-chase-speed) 221184.0) + (set! (-> self max-chase-speed) 0.0) + (go-virtual initial-launch) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate initial-launch (cty-hijack-missile) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('begin-moving) + (go-virtual fake-chase) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :trans (behavior () + (cty-hijack-missile-method-49 self) + (if (and (time-elapsed? (-> self state-time) (seconds 0.6)) + (or (time-elapsed? (-> self state-time) (seconds 1.5)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + ) + (go-virtual fake-chase) + ) + (let ((v1-15 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (* 0.0022222223 (the float (- (current-time) (-> self state-time)))) + (let ((f0-2 163840.0)) + (if (time-elapsed? (-> self state-time) (seconds 0.6)) + (set! f0-2 4096.0) + ) + (vector+float*! (-> self root trans) (-> self root trans) v1-15 (* f0-2 (seconds-per-frame))) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate die (cty-hijack-missile) + :virtual #t + :code nothing + ) + +;; failed to figure out what this is: +(defstate explode-tiny (cty-hijack-missile) + :virtual #t + :enter (behavior () + (cond + ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 217)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 217)) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + '() + ) + ) + +;; failed to figure out what this is: +(defstate explode (cty-hijack-missile) + :virtual #t + :enter (behavior () + (sound-play "hj-explode") + (logior! (-> self draw status) (draw-control-status no-draw)) + (cond + ((logtest? (-> *part-group-id-table* 296 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 296)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 296)) + ) + ) + (send-event + (handle->process (-> self track-obj)) + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 32.0) + (vehicle-damage-factor 2.0) + (vehicle-impulse-factor 0.0) + (mode 'eco-dark) + (penetrate-using (penetrate explode)) + ) + ) + ) + ) + :code (behavior () + '() + ) + ) + +;; definition for method 47 of type cty-hijack-missile +;; INFO: Used lq/sq +(defmethod cty-hijack-missile-method-47 ((this cty-hijack-missile) (arg0 vector) (arg1 int)) + (let* ((s3-0 (handle->process (-> this track-obj))) + (s2-0 (if (type? s3-0 process-focusable) + (the-as h-kg-pickup s3-0) + ) + ) + (s3-1 (get-tracked-obj-pos this (new 'stack-no-clear 'vector))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! (-> s0-0 quad) (-> s2-0 root transv quad)) + (let ((v1-8 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s2-0 root quat))) + (s1-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (set! (-> v1-8 y) 0.0) + (set! (-> s0-0 y) 0.0) + (cond + (#f + (let ((f30-0 (* 0.41380316 (vector-length s0-0) (/ 32768.0 (fabs (-> s2-0 turn-rate))))) + (s0-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) s0-0 1.0)) + ) + (let ((f0-5 16384.0)) + (if (< (-> s2-0 turn-rate) 0.0) + (set! f0-5 (* -1.0 f0-5)) + ) + (vector-rotate-y! s0-1 s0-1 f0-5) + ) + (vector+float*! s1-0 s3-1 s0-1 f30-0) + ) + (let ((f0-8 (* 0.0033333334 (the float arg1) (-> s2-0 turn-rate))) + (s4-2 (vector-! (new 'stack-no-clear 'vector) s3-1 s1-0)) + ) + (vector-rotate-around-y! s4-2 s4-2 f0-8) + (vector+! s5-1 s1-0 s4-2) + ) + ) + (else + (vector+float*! s5-1 s3-1 s0-0 (* 0.0033333334 (the float arg1))) + ) + ) + ) + ) + (set! (-> arg0 quad) (-> s5-1 quad)) + ) + (add-debug-sphere #t (bucket-id debug) arg0 (meters 2) *color-yellow*) + arg0 + ) + +;; failed to figure out what this is: +(defstate lunge-prepare (cty-hijack-missile) + :virtual #t + :code sleep-code + ) + +;; definition for method 48 of type cty-hijack-missile +(defmethod cty-hijack-missile-method-48 ((this cty-hijack-missile) (arg0 vector)) + (let* ((s5-0 (handle->process (-> this track-obj))) + (v1-3 (if (type? s5-0 process-focusable) + (the-as h-kg-pickup s5-0) + ) + ) + ) + (when v1-3 + (set! (-> arg0 x) (-> v1-3 root trans y)) + (set! (-> arg0 y) (-> v1-3 turn-rate)) + (set! (-> arg0 z) (vector-length (-> v1-3 root transv))) + ) + ) + arg0 + ) + +;; failed to figure out what this is: +(defstate lure-die (cty-hijack-missile) + :virtual #t + :enter (behavior () + (sound-stop (-> self peel-off-sound)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (cond + ((logtest? (-> *part-group-id-table* 88 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 88)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 88)) + ) + ) + (send-event (handle->process (-> self track-obj)) 'missile-hit) + (send-event (ppointer->process (-> self parent)) 'missile-die) + ) + :code nothing + ) + +;; failed to figure out what this is: +(defstate lure (cty-hijack-missile) + :virtual #t + :enter (behavior () + (set! (-> self current-speed) 389120.0) + (set-time! (-> self state-time)) + (sound-play "missil-peel-off" :id (-> self peel-off-sound)) + ) + :trans (behavior () + (cty-hijack-missile-method-49 self) + (get-tracked-obj-pos self (-> self target-pos)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self target-pos) (-> self root trans)))) + 0.0 + (if (< (vector-normalize-ret-len! s5-1 1.0) 20480.0) + (go-virtual lure-die) + ) + (cond + ((not (time-elapsed? (-> self state-time) (seconds 0.2))) + (* 0.016666668 (the float (- (current-time) (-> self state-time)))) + (quaternion-slerp! + (-> self root quat) + (-> self root quat) + (-> self original-quat) + (* 3.0 (seconds-per-frame)) + ) + ) + (else + (let* ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (f0-7 (vector-dot s5-1 gp-0)) + ) + (when (< f0-7 0.999) + (let ((s4-1 (vector-cross! (new 'stack-no-clear 'vector) gp-0 s5-1)) + (f30-0 (acos f0-7)) + (f28-0 32768.0) + ) + (if (time-elapsed? (-> self state-time) (seconds 1.5)) + (set! f28-0 (* 0.0033333334 (the float (- (current-time) (-> self state-time))) f28-0)) + ) + (vector-normalize! s4-1 1.0) + (let ((f0-12 (fmin f30-0 (* f28-0 (seconds-per-frame))))) + (vector-rotate-around-axis! gp-0 (the-as quaternion gp-0) f0-12 s4-1) + ) + ) + (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) + ) + ) + ) + ) + ) + (let ((v1-42 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (vector+float*! + (-> self root trans) + (-> self root trans) + v1-42 + (* (-> self current-speed) (seconds-per-frame)) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; definition for method 49 of type cty-hijack-missile +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod cty-hijack-missile-method-49 ((this cty-hijack-missile)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (matrix-f-u-compose gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) + (set! (-> gp-0 trans quad) (-> this root trans quad)) + (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -3686.4) + (spawn-from-mat (-> this part) gp-0) + (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -4096.0) + (if (and (-> this next-state) (= (-> this next-state name) 'lure)) + (init-with-mat! (-> this particle-trail-thrust) gp-0) + (init-with-mat! (-> this particle-trail) gp-0) + ) + ) + 0 + (none) + ) + +;; definition for function compute-target-speed +(defun compute-target-speed () + (* 204800.0 (compute-suck-speed-scalar)) + ) + +;; definition for method 50 of type cty-hijack-missile +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs object. +(defmethod event-handler ((this cty-hijack-missile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die) + (go (method-of-object this die)) + ) + (('explode) + (if (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + (go (method-of-object this explode)) + ) + ) + (('get-closer) + (set! (-> this missile-dist) 31129.6) + (set! (-> this target-speed) (compute-target-speed)) + ) + (('chase-2) + (cty-hijack-missile-method-52 this #f) + (if (and (-> this next-state) (= (-> this next-state name) 'chasing)) + (go (method-of-object this chasing-2)) + ) + ) + (('lure) + (when (-> this is-leader?) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 arg0)) + (set! (-> s4-0 quad) (-> (get-trans + (the-as process-focusable (if (type? s3-0 process-focusable) + (the-as process-focusable s3-0) + ) + ) + 3 + ) + quad + ) + ) + ) + (let ((s3-1 (get-tracked-obj-pos this (new 'stack-no-clear 'vector)))) + 0.0 + (let ((a0-17 (new 'stack-no-clear 'vector))) + (vector-! a0-17 s4-0 s3-1) + (let ((f0-3 (vector-normalize-ret-len! a0-17 1.0))) + (when (and (< 192512.0 f0-3) (< f0-3 286720.0)) + (format 0 "Player dist ~m~%" f0-3) + (let ((s2-0 (handle->process (-> this track-obj)))) + (when (if (type? s2-0 process-focusable) + s2-0 + ) + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> this root trans)))) + 0.0 + (let ((s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (vector-normalize-ret-len! s2-2 1.0) + (when (< 0.707 (vector-dot s1-0 s2-2)) + (let* ((s2-4 (vector-! (new 'stack-no-clear 'vector) s4-0 s3-1)) + (s4-1 vector-z-quaternion!) + (s3-2 (new 'stack-no-clear 'vector)) + (s1-1 (handle->process (-> this track-obj))) + (s4-2 (s4-1 s3-2 (-> (the-as process-focusable (if (type? s1-1 process-focusable) + (the-as process-focusable s1-1) + ) + ) + root + quat + ) + ) + ) + ) + (set! (-> s4-2 y) 0.0) + (vector-normalize! s4-2 1.0) + (set! (-> s2-4 y) 0.0) + (vector-normalize! s2-4 1.0) + (vector-cross! s2-4 s2-4 *up-vector*) + (let ((f0-10 (vector-dot s4-2 s2-4)) + (f30-0 9102.223) + ) + (if (< f0-10 0.0) + (set! f30-0 (* -1.0 f30-0)) + ) + (let ((s4-3 quaternion-rotate-y!) + (s3-3 (-> this original-quat)) + (s2-5 (handle->process (-> this track-obj))) + ) + (s4-3 + s3-3 + (-> (the-as process-focusable (if (type? s2-5 process-focusable) + (the-as process-focusable s2-5) + ) + ) + root + quat + ) + f30-0 + ) + ) + (set! (-> this rotate-deg) f30-0) + ) + ) + (set! (-> this track-obj) (process->handle arg0)) + (send-event arg0 'missile-attract) + (go (method-of-object this lure)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (('set-leader) + (set! (-> this is-leader?) #t) + ) + ) + #t + ) + +;; definition for function cty-hijack-missile-chase-event-handler +(defbehavior cty-hijack-missile-chase-event-handler cty-hijack-missile ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (event-handler self arg0 arg1 arg2 arg3) + ) + +;; definition for symbol *k0*, type float +(define *k0* 12.0) + +;; definition for symbol *k1*, type float +(define *k1* 1.0) + +;; definition for symbol *missile-dist-start*, type float +(define *missile-dist-start* 81920.0) + +;; definition for symbol *accel-scalar*, type float +(define *accel-scalar* 0.5) + +;; definition for method 51 of type cty-hijack-missile +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 51 cty-hijack-missile) has a return type of none, but the expression builder found a return statement. +(defmethod cty-hijack-missile-method-51 ((this cty-hijack-missile)) + (local-vars (sv-64 float) (sv-68 float) (sv-72 float) (sv-76 vector) (sv-80 float)) + (let* ((s4-0 (handle->process (-> this track-obj))) + (s5-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + (s4-1 (new 'stack-no-clear 'vector)) + (a0-5 (new 'stack-no-clear 'vector)) + ) + 0.0 + (if (not s5-0) + (return 0) + ) + (set! (-> a0-5 quad) (-> s5-0 root transv quad)) + (let ((f30-0 (vector-normalize-ret-len! a0-5 1.0))) + (set! (-> s4-1 quad) (-> this target-pos quad)) + (when #t + (seek! (-> this offset-dist) (-> this missile-dist) (* 20480.0 (seconds-per-frame))) + (seek! (-> this vel-factor) *k1* (* 2.0 (seconds-per-frame))) + (if (< (vector-vector-xz-distance (-> this basetrans) (get-trans s5-0 0)) 61440.0) + (set! (-> this vel-factor) *k1*) + ) + ) + (set! sv-64 (-> this offset-dist)) + (set! sv-68 (-> this current-speed)) + (set! sv-72 (the-as float 0.0)) + (set! sv-76 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this basetrans))) + (set! sv-80 (the-as float 0.0)) + (set! sv-72 (vector-normalize-ret-len! sv-76 1.0)) + (if (and (-> this is-leader?) (< (vector-vector-xz-distance (-> this basetrans) s4-1) 18432.0)) + (go (method-of-object this explode)) + ) + (cond + ((< 409.6 sv-72) + (set! sv-80 (+ (* (- sv-72 sv-64) *k0*) (* (- f30-0 sv-68) (-> this vel-factor)))) + (set! sv-80 (* sv-80 *accel-scalar*)) + (+! (-> this current-speed) (* sv-80 (seconds-per-frame))) + (when (-> this is-leader?) + ) + (seek! (-> this min-chase-speed) (-> this min-targ-chase-speed) (* 6144.0 (seconds-per-frame))) + (set! (-> this current-speed) (fmax (-> this current-speed) (-> this target-speed))) + (cond + ((>= 0.0 (-> this max-chase-speed)) + (when (< (vector-vector-xz-distance (-> this basetrans) (get-trans s5-0 0)) 32768.0) + ) + ) + ((< (vector-vector-xz-distance (-> this basetrans) (get-trans s5-0 0)) 81920.0) + (set! (-> this current-speed) + (fmax (fmin (-> this current-speed) (-> this max-chase-speed)) (-> this min-chase-speed)) + ) + ) + ) + (when (-> this is-leader?) + ) + (quaternion-look-at! (-> this root quat) sv-76 *up-vector*) + (vector+float*! (-> this basetrans) (-> this basetrans) sv-76 (* (-> this current-speed) (seconds-per-frame))) + ) + (else + (vector+float*! + (-> this basetrans) + (-> this basetrans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (* (-> this current-speed) (seconds-per-frame)) + ) + ) + ) + ) + ) + (when (< (-> this next-lisa-time) (current-time)) + (let* ((f30-1 30720.0) + (f28-0 6144.0) + (v1-57 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-58 (the-as number (logior #x3f800000 v1-57))) + ) + (set! (-> this circle-mag) (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-58))))) + ) + (cond + ((!= (-> this stage) 1) + (let* ((f30-2 43690.668) + (f28-1 10922.664) + (v1-64 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-65 (the-as number (logior #x3f800000 v1-64))) + ) + (set! (-> this lisa rate theta) (* (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-65)))) (seconds-per-frame))) + ) + (let* ((f30-3 9216.0) + (f28-2 7987.199) + (v1-71 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-72 (the-as number (logior #x3f800000 v1-71))) + ) + (set! (-> this lisa dest x-mag) (+ f30-3 (* f28-2 (+ -1.0 (the-as float v1-72))))) + ) + (let* ((f30-4 9216.0) + (f28-3 7987.199) + (v1-77 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-78 (the-as number (logior #x3f800000 v1-77))) + ) + (set! (-> this lisa dest y-mag) (+ f30-4 (* f28-3 (+ -1.0 (the-as float v1-78))))) + ) + (let* ((f30-5 0.5) + (f28-4 0.75) + (v1-83 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-84 (the-as number (logior #x3f800000 v1-83))) + ) + (set! (-> this lisa dest theta-rate) (+ f30-5 (* f28-4 (+ -1.0 (the-as float v1-84))))) + ) + ) + (else + (let* ((f30-6 32768.0) + (f28-5 10922.668) + (v1-90 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-91 (the-as number (logior #x3f800000 v1-90))) + ) + (set! (-> this lisa rate theta) (* (+ f30-6 (* f28-5 (+ -1.0 (the-as float v1-91)))) (seconds-per-frame))) + ) + (let* ((f30-7 5120.0) + (f28-6 5120.0) + (v1-97 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-98 (the-as number (logior #x3f800000 v1-97))) + ) + (set! (-> this lisa dest x-mag) (+ f30-7 (* f28-6 (+ -1.0 (the-as float v1-98))))) + ) + (let* ((f30-8 9216.0) + (f28-7 1024.0) + (v1-103 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-104 (the-as number (logior #x3f800000 v1-103))) + ) + (set! (-> this lisa dest y-mag) (+ f30-8 (* f28-7 (+ -1.0 (the-as float v1-104))))) + ) + (let* ((f30-9 0.5) + (f28-8 0.75) + (v1-109 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-110 (the-as number (logior #x3f800000 v1-109))) + ) + (set! (-> this lisa dest theta-rate) (+ f30-9 (* f28-8 (+ -1.0 (the-as float v1-110))))) + ) + ) + ) + (set! (-> this next-lisa-time) + (the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 601) 150 (current-time))) + ) + ) + (let ((v1-118 (the-as vehicle (handle->process (-> this track-obj))))) + (when v1-118 + (when (and (< 0.75 (fabs (-> v1-118 controls steering))) (!= (-> this stage) 1)) + (seek! (-> this lisa dest x-mag) (-> this circle-mag) (* 18432.0 (seconds-per-frame))) + (seek! (-> this lisa dest y-mag) (-> this circle-mag) (* 18432.0 (seconds-per-frame))) + ) + ) + ) + (set! (-> this lisa dest wx) 1.0) + (set! (-> this lisa dest wy) 1.2) + (set! (-> this lisa rate wx) 10.0) + (set! (-> this lisa rate wy) 10.0) + (set! (-> this lisa rate x-mag) (* 10240.0 (seconds-per-frame))) + (set! (-> this lisa rate y-mag) (* 10240.0 (seconds-per-frame))) + (set! (-> this lisa rate period-shift) (* 16384.0 (seconds-per-frame))) + (set! (-> this lisa dest period-shift) 16384.0) + (lissajous-interp-method-10 (-> this lisa)) + (let ((s5-3 (lissajous-interp-method-9 (-> this lisa) (new 'stack-no-clear 'vector)))) + (vector-float*! s5-3 s5-3 0.5) + (vector-lerp! (-> this lisa-pt) (-> this lisa-pt) s5-3 1.0) + (let ((a2-9 (matrix-f-u-compose (matrix-identity! (new 'stack-no-clear 'matrix)) sv-76 *up-vector*))) + (vector-matrix*! s5-3 (-> this lisa-pt) a2-9) + ) + (vector+! (-> this root trans) (-> this basetrans) s5-3) + ) + (let ((v1-147 (the-as vehicle (handle->process (-> this track-obj))))) + (when v1-147 + (if (< 0.75 (fabs (-> v1-147 controls steering))) + (set! (-> this bobber turning?) #t) + (set! (-> this bobber turning?) #f) + ) + ) + ) + (if (= (-> this stage) 1) + (set! (-> this bobber output-scale) 4096.0) + (set! (-> this bobber output-scale) 16384.0) + ) + (hijack-missile-bobber-method-10 (-> this bobber)) + (let ((f0-118 (- (-> this bobber output-val) (* 0.8 (-> this bobber output-scale))))) + (vector+float*! (-> this root trans) (-> this root trans) sv-76 f0-118) + ) + (let ((s5-5 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this last-trans)))) + (vector-normalize! s5-5 1.0) + (quaternion-look-at! (-> this root quat) s5-5 *up-vector*) + ) + (set! (-> this last-trans quad) (-> this root trans quad)) + (none) + ) + +;; definition for method 53 of type cty-hijack-missile +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod cty-hijack-missile-method-53 ((this cty-hijack-missile)) + (set! (-> this next-lisa-time) 0) + (let* ((f30-0 72817.78) + (v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + ) + (set! (-> this lisa current theta) (* f30-0 (+ -1.0 (the-as float v1-3)))) + ) + (set! (-> this lisa current theta-rate) 1.0) + (set! (-> this lisa rate theta-rate) (seconds-per-frame)) + (set! (-> this lisa current x-mag) 20480.0) + (set! (-> this lisa current y-mag) 20480.0) + (set! (-> this lisa dest theta) (if (not (logtest? (rand-uint31-gen *random-generator*) 1)) + 1820444400.0 + -1820444400.0 + ) + ) + (set! (-> this lisa dest x-mag) 20480.0) + (set! (-> this lisa dest y-mag) 20480.0) + (set! (-> this next-lisa-time) 0) + (set! (-> this lisa dest wx) 1.0) + (set! (-> this lisa dest wy) 1.2) + (set! (-> this lisa dest period-shift) 16384.0) + (set! (-> this basetrans quad) (-> this root trans quad)) + (none) + ) + +;; failed to figure out what this is: +(defstate fake-chase (cty-hijack-missile) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('begin-moving) + (set! (-> self target-speed) 143360.0) + ) + (('full-chase) + (set! (-> self missile-dist) *missile-dist-far*) + (set! (-> self offset-dist) *missile-dist-far*) + (set! (-> self stage) 1) + (set! (-> self targ-scale-factor) 0.6) + (set! (-> self scale-factor) (-> self targ-scale-factor)) + (set! (-> self min-chase-speed) 114688.0) + (set! (-> self min-targ-chase-speed) 221184.0) + (set! (-> self max-chase-speed) 0.0) + (set! (-> self current-speed) (-> self min-chase-speed)) + (set! (-> self target-speed) (-> self min-chase-speed)) + (go-virtual chasing-2) + ) + (else + (cty-hijack-missile-chase-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self target-speed) 0.0) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (cty-hijack-missile-method-53 self) + ) + :trans (behavior () + (local-vars (gp-4 symbol)) + (if (< 40960.0 (-> self min-chase-speed)) + (seek! (-> self min-chase-speed) 40960.0 (* 40960.0 (seconds-per-frame))) + ) + (seek! (-> self scale-factor) (-> self targ-scale-factor) (seconds-per-frame)) + (let ((v1-7 (-> self root scale)) + (a0-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-2 x) 0.8) + (set! (-> a0-2 y) 0.8) + (set! (-> a0-2 z) 0.9) + (set! (-> a0-2 w) 1.0) + (vector-float*! v1-7 a0-2 (-> self scale-factor)) + ) + (cty-hijack-missile-method-49 self) + (get-tracked-obj-pos self (-> self target-pos)) + (when (< (-> self next-lisa-time) (current-time)) + (let* ((f30-0 30720.0) + (f28-0 6144.0) + (v1-18 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-19 (the-as number (logior #x3f800000 v1-18))) + ) + (set! (-> self circle-mag) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-19))))) + ) + (let* ((f30-1 43690.668) + (f28-1 10922.664) + (v1-24 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-25 (the-as number (logior #x3f800000 v1-24))) + ) + (set! (-> self lisa rate theta) (* (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-25)))) (seconds-per-frame))) + ) + (let* ((f30-2 9216.0) + (f28-2 7987.199) + (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-32 (the-as number (logior #x3f800000 v1-31))) + ) + (set! (-> self lisa dest x-mag) (+ f30-2 (* f28-2 (+ -1.0 (the-as float v1-32))))) + ) + (let* ((f30-3 9216.0) + (f28-3 7987.199) + (v1-37 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-38 (the-as number (logior #x3f800000 v1-37))) + ) + (set! (-> self lisa dest y-mag) (+ f30-3 (* f28-3 (+ -1.0 (the-as float v1-38))))) + ) + (let* ((f30-4 0.5) + (f28-4 0.75) + (v1-43 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-44 (the-as number (logior #x3f800000 v1-43))) + ) + (set! (-> self lisa dest theta-rate) (+ f30-4 (* f28-4 (+ -1.0 (the-as float v1-44))))) + ) + (set! (-> self next-lisa-time) + (the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 601) 150 (current-time))) + ) + ) + (set! (-> self lisa dest wx) 1.0) + (set! (-> self lisa dest wy) 1.2) + (set! (-> self lisa rate wx) 10.0) + (set! (-> self lisa rate wy) 10.0) + (set! (-> self lisa rate x-mag) (* 10240.0 (seconds-per-frame))) + (set! (-> self lisa rate y-mag) (* 10240.0 (seconds-per-frame))) + (set! (-> self lisa rate period-shift) (* 16384.0 (seconds-per-frame))) + (set! (-> self lisa dest period-shift) 16384.0) + (lissajous-interp-method-10 (-> self lisa)) + (let ((gp-0 (lissajous-interp-method-9 (-> self lisa) (new 'stack-no-clear 'vector)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self target-pos) (-> self basetrans)))) + (vector-normalize! s5-1 1.0) + (vector-float*! gp-0 gp-0 0.5) + (vector-lerp! (-> self lisa-pt) (-> self lisa-pt) gp-0 1.0) + (let ((a2-4 (matrix-f-u-compose (matrix-identity! (new 'stack-no-clear 'matrix)) s5-1 *up-vector*))) + (vector-matrix*! gp-0 (-> self lisa-pt) a2-4) + ) + (vector+float*! (-> self basetrans) (-> self basetrans) s5-1 (* (-> self target-speed) (seconds-per-frame))) + ) + (vector+! (-> self root trans) (-> self basetrans) gp-0) + ) + (let ((gp-2 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self last-trans)))) + (vector-normalize! gp-2 1.0) + (quaternion-look-at! (-> self root quat) gp-2 *up-vector*) + ) + (set! (-> self last-trans quad) (-> self root trans quad)) + (if (and (< (vector-vector-distance (-> self root trans) (get-tracked-obj-pos self (new 'stack-no-clear 'vector))) + 20480.0 + ) + (-> self is-leader?) + ) + (go-virtual explode) + ) + (if (or (not (handle->process (-> self track-obj))) + (begin + (let* ((gp-5 #t) + (s5-3 (handle->process (-> self track-obj))) + (v1-94 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-3 process-focusable) + (the-as process-focusable s5-3) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-4 v1-94 gp-5) + ) + gp-4 + ) + ) + (go-virtual explode-tiny) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate chasing-2 (cty-hijack-missile) + :virtual #t + :event cty-hijack-missile-chase-event-handler + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self target-speed) 122880.0) + (set! (-> self current-speed) 122880.0) + (set! (-> self vel-factor) 10.0) + (cty-hijack-missile-method-53 self) + ) + :trans (behavior () + (local-vars (gp-0 symbol)) + (seek! (-> self scale-factor) (-> self targ-scale-factor) (seconds-per-frame)) + (let ((v1-2 (-> self root scale)) + (a0-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-1 x) 0.8) + (set! (-> a0-1 y) 0.8) + (set! (-> a0-1 z) 0.9) + (set! (-> a0-1 w) 1.0) + (vector-float*! v1-2 a0-1 (-> self scale-factor)) + ) + (cty-hijack-missile-method-49 self) + (get-tracked-obj-pos self (-> self target-pos)) + (cty-hijack-missile-method-51 self) + (if (or (not (handle->process (-> self track-obj))) + (begin + (let* ((gp-1 #t) + (s5-0 (handle->process (-> self track-obj))) + (v1-18 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-0 v1-18 gp-1) + ) + gp-0 + ) + ) + (go-virtual explode-tiny) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; definition for symbol *use-lunging*, type symbol +(define *use-lunging* #f) + +;; failed to figure out what this is: +(defstate chasing (cty-hijack-missile) + :virtual #t + :event cty-hijack-missile-chase-event-handler + :enter (behavior () + (set! (-> self current-track-index) (the-as uint 1)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self current-speed) 122880.0) + (set! (-> self target-speed) (compute-target-speed)) + ) + :trans (behavior () + (cond + ((-> self is-leader?) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (cty-hijack-missile-method-49 self) + ) + (else + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + ) + (cty-hijack-missile-method-44 self) + (seek! (-> self current-speed) (-> self target-speed) (* 16384.0 (seconds-per-frame))) + (if (and (< (vector-vector-distance (-> self root trans) (get-tracked-obj-pos self (new 'stack-no-clear 'vector))) + 20480.0 + ) + (-> self is-leader?) + ) + (go-virtual explode) + ) + (let* ((a1-3 (-> self tracked-player-positions data (-> self current-track-index))) + (f0-6 (vector-vector-distance-squared (-> self root trans) a1-3)) + (f1-2 819.2) + ) + (when (< f0-6 (* f1-2 f1-2)) + (if (< (-> self current-track-index) (the-as uint (+ (-> self tracked-player-positions length) -1))) + (+! (-> self current-track-index) 1) + ) + ) + ) + (let ((gp-1 (+ (-> self tracked-player-positions length) -2))) + (until #f + (when (< gp-1 (the-as int (+ (-> self current-track-index) 1))) + 0 + (goto cfg-21) + ) + (when (probe-ground self (-> self root trans) (-> self tracked-player-positions data gp-1)) + (set! (-> self current-track-index) (the-as uint gp-1)) + 0 + (goto cfg-21) + ) + (+! gp-1 -1) + ) + ) + #f + (label cfg-21) + (let ((v1-52 (-> self tracked-player-positions data (+ (-> self current-track-index) -1))) + (s5-1 (-> self tracked-player-positions data (-> self current-track-index))) + (a0-19 (new 'stack-no-clear 'vector)) + (gp-2 (new 'stack-no-clear 'vector)) + ) + 0.0 + (vector-! a0-19 s5-1 v1-52) + (vector-normalize! a0-19 1.0) + (vector-! gp-2 s5-1 (-> self root trans)) + (let* ((f0-8 (vector-normalize-ret-len! gp-2 1.0)) + (f0-9 (fmin (* (-> self current-speed) (seconds-per-frame)) f0-8)) + ) + (vector+float*! (-> self root trans) (-> self root trans) gp-2 f0-9) + ) + (quaternion-look-at! (-> self root quat) gp-2 *up-vector*) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; definition for method 10 of type hijack-missile-bobber +(defmethod hijack-missile-bobber-method-10 ((this hijack-missile-bobber)) + (with-pp + (let* ((f1-2 (/ (the float (-> this current-time)) (the float (-> this total-time)))) + (f30-0 (fmax 0.0 (fmin 1.0 f1-2))) + ) + (set! (-> this time-scalar) (lerp (-> this start-time-scalar) (-> this desired-time-scalar) f30-0)) + (set! (-> this current-speed) (* (-> this dir) (cos (* 32768.0 f30-0)))) + (let ((f1-4 (sin (* 32768.0 f30-0)))) + (set! (-> this current-val) (+ (-> this start-val) (* (-> this current-size-scalar) f1-4 (-> this dir)))) + ) + ) + (set! (-> this output-val) (* (-> this output-scale) (-> this current-val))) + (when (< (-> this total-time) (-> this current-time)) + (set! (-> this start-val) (-> this current-val)) + (set! (-> this start-time-scalar) (-> this time-scalar)) + (set! (-> this current-time) 0) + (hijack-missile-bobber-method-11 this) + ) + (let ((v0-4 + (+ (-> this current-time) + (max 1 (the int (* (the float (- (current-time) (-> pp clock old-frame-counter))) (-> this time-scalar)))) + ) + ) + ) + (set! (-> this current-time) v0-4) + v0-4 + ) + ) + ) + +;; definition for method 9 of type hijack-missile-bobber +;; WARN: Return type mismatch time-frame vs none. +(defmethod init! ((this hijack-missile-bobber)) + (set! (-> this start-val) 0.0) + (set! (-> this current-val) 0.0) + (set! (-> this dir) 1.0) + (set! (-> this scale-min) 0.65) + (set! (-> this scale-max) 1.35) + (set! (-> this current-size-scalar) 1.0) + (set! (-> this num-iterations) 1.0) + (set! (-> this time-scalar) 1.0) + (set! (-> this start-time-scalar) 1.0) + (set! (-> this desired-time-scalar) 1.0) + (set! (-> this output-scale) 6144.0) + (set! (-> this time-min) 0.7) + (set! (-> this time-max) 0.8) + (set! (-> this base-time) 1.0) + (set! (-> this desired-time-scalar) 0.75) + (set! (-> this turning?) #f) + (hijack-missile-bobber-method-11 this) + (none) + ) + +;; definition for method 11 of type hijack-missile-bobber +;; WARN: Return type mismatch int vs time-frame. +(defmethod hijack-missile-bobber-method-11 ((this hijack-missile-bobber)) + (cond + (#f + (set! (-> this base-time) 0.25) + ) + (else + (let* ((f30-0 0.4) + (f28-0 0.20000002) + (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-6 (the-as number (logior #x3f800000 v1-5))) + ) + (set! (-> this base-time) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-6))))) + ) + ) + ) + (set! (-> this dir) (* -1.0 (-> this dir))) + (let* ((f28-1 (if (< (-> this dir) 0.0) + (+ 1.0 (-> this current-val)) + (- 1.0 (-> this current-val)) + ) + ) + (f30-1 (fmin (-> this scale-min) f28-1)) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> this current-size-scalar) + (+ f30-1 + (* (+ -1.0 (the-as float v1-15)) (- (fmin (-> this scale-max) f28-1) (fmin (-> this scale-min) f28-1))) + ) + ) + ) + (let* ((f0-19 (-> this current-size-scalar)) + (v0-2 (the int (* 300.0 (-> this base-time) (-> this num-iterations) f0-19))) + ) + (set! (-> this total-time) (the-as time-frame v0-2)) + (the-as time-frame v0-2) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc new file mode 100644 index 0000000000..ce5cf09837 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc @@ -0,0 +1,2336 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *cty-hijack-speech-list*, type (inline-array talker-speech-class) +(define *cty-hijack-speech-list* (new 'static 'inline-array talker-speech-class 52 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "dax372" + :channel (gui-channel daxter) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax373" + :channel (gui-channel daxter) + :flags (talker-flags tf0) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax374" + :channel (gui-channel daxter) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax375" + :channel (gui-channel daxter) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax376" + :channel (gui-channel daxter) + :speech #x5 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax377" + :channel (gui-channel daxter) + :speech #x6 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax378" + :channel (gui-channel daxter) + :speech #x7 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax379" + :channel (gui-channel daxter) + :speech #x8 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax380" + :channel (gui-channel daxter) + :speech #x9 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax381" + :channel (gui-channel daxter) + :flags (talker-flags tf0) + :speech #xa + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax382" + :channel (gui-channel daxter) + :speech #xb + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax383" + :channel (gui-channel daxter) + :speech #xc + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax384" + :channel (gui-channel daxter) + :speech #xd + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax385" + :channel (gui-channel daxter) + :speech #xe + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax386" + :channel (gui-channel daxter) + :speech #xf + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax387" + :channel (gui-channel daxter) + :speech #x10 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax388" + :channel (gui-channel daxter) + :speech #x11 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax389" + :channel (gui-channel daxter) + :speech #x12 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax390" + :channel (gui-channel daxter) + :speech #x13 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax391" + :channel (gui-channel daxter) + :speech #x14 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax392" + :channel (gui-channel daxter) + :speech #x15 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax393" + :channel (gui-channel daxter) + :speech #x16 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax394" + :channel (gui-channel daxter) + :speech #x17 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax395" + :channel (gui-channel daxter) + :speech #x18 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak101" + :channel (gui-channel jak) + :speech #x19 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak102" + :channel (gui-channel jak) + :speech #x1a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak103" + :channel (gui-channel jak) + :flags (talker-flags tf0) + :speech #x1b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak104" + :channel (gui-channel jak) + :speech #x1c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak105" + :channel (gui-channel jak) + :speech #x1d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak106" + :channel (gui-channel jak) + :speech #x1e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak107" + :channel (gui-channel jak) + :flags (talker-flags tf0) + :speech #x1f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak108" + :channel (gui-channel jak) + :speech #x20 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak109" + :channel (gui-channel jak) + :speech #x21 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak110" + :channel (gui-channel jak) + :flags (talker-flags tf0) + :speech #x22 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak111" + :channel (gui-channel jak) + :speech #x23 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "jak112" + :channel (gui-channel jak) + :flags (talker-flags tf0) + :speech #x24 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn149" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x25 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn150" + :channel (gui-channel voicebox) + :speech #x26 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn151" + :channel (gui-channel voicebox) + :speech #x27 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn152" + :channel (gui-channel voicebox) + :speech #x28 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn153" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x29 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn154" + :channel (gui-channel voicebox) + :speech #x2a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn155" + :channel (gui-channel voicebox) + :speech #x2b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn156" + :channel (gui-channel voicebox) + :speech #x2c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn157" + :channel (gui-channel voicebox) + :speech #x2d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn158" + :channel (gui-channel voicebox) + :speech #x2e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn159" + :channel (gui-channel voicebox) + :speech #x2f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn160" + :channel (gui-channel voicebox) + :speech #x30 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn161" + :channel (gui-channel voicebox) + :speech #x31 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn162" + :channel (gui-channel voicebox) + :speech #x32 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn163" + :channel (gui-channel voicebox) + :speech #x33 + :neg #x1 + :on-close #f + :camera #f + ) + ) + ) + +;; definition of type cty-hijack-manager +(deftype cty-hijack-manager (task-manager) + ((hpickup handle) + (missiles (array handle)) + (current-leader-missile int8) + (task-arrow handle) + (alert-expire-time time-frame) + (lure-hit-time time-frame :offset 280) + (naughty-ottsel-lure handle) + (missile-sound sound-id) + (vehicle-is-visible? symbol) + (last-check-vehicle-vis-time time-frame) + ) + (:state-methods + player-riding + decoy-stage + show-missile-launch + ) + (:methods + (cty-hijack-manager-method-35 (_type_) none) + (spawn-missile (_type_ vector quaternion int) handle) + (spawn-missiles-from-launcher (_type_ int) none) + (guide-arrow-spawn (_type_) symbol) + (cty-hijack-manager-method-39 (_type_ int) none) + (reset-hijack-speech (_type_) symbol) + ) + ) + +;; definition for method 3 of type cty-hijack-manager +(defmethod inspect ((this cty-hijack-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Thpickup: ~D~%" (-> this hpickup)) + (format #t "~2Tmissiles: ~A~%" (-> this missiles)) + (format #t "~2Tcurrent-leader-missile: ~D~%" (-> this current-leader-missile)) + (format #t "~2Ttask-arrow: ~D~%" (-> this task-arrow)) + (format #t "~2Talert-expire-time: ~D~%" (-> this alert-expire-time)) + (format #t "~2Thud-timer: ~D~%" (-> this hud-timer)) + (format #t "~2Tlure-hit-time: ~D~%" (-> this lure-hit-time)) + (format #t "~2Tnaughty-ottsel-lure: ~D~%" (-> this naughty-ottsel-lure)) + (format #t "~2Tmissile-sound: ~D~%" (-> this missile-sound)) + (format #t "~2Tvehicle-is-visible?: ~A~%" (-> this vehicle-is-visible?)) + (format #t "~2Tlast-check-vehicle-vis-time: ~D~%" (-> this last-check-vehicle-vis-time)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate fail (cty-hijack-manager) + :virtual #t + :enter (behavior ((arg0 resetter-params)) + (sound-stop (-> self missile-sound)) + (let* ((t9-1 find-parent-method) + (a0-2 cty-hijack-manager) + (t9-2 (-> (the-as (state resetter-params cty-hijack-manager) (t9-1 a0-2 18)) enter)) + ) + (if t9-2 + (t9-2 (the-as resetter-params a0-2)) + ) + ) + ) + ) + +;; definition for symbol *pickup-start-pos*, type vector +(define *pickup-start-pos* (new 'static 'vector :x 3964271.5 :y 43008.0 :z 2372759.5 :w 1.0)) + +;; definition for symbol *pickup-start-angle*, type float +(define *pickup-start-angle* 16384.0) + +;; definition of type hijack-speech-instance +(deftype hijack-speech-instance (speech-instance) + () + ) + +;; definition for method 3 of type hijack-speech-instance +(defmethod inspect ((this hijack-speech-instance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hijack-speech-instance) + (format #t "~1Tspeech: ~D~%" (-> this speech)) + (format #t "~1Tnum-play-times: ~D~%" (-> this num-play-times)) + (format #t "~1Tprobability: ~f~%" (-> this probability)) + (label cfg-4) + this + ) + +;; definition of type hijack-speech-info +(deftype hijack-speech-info (structure) + ((speeches (array hijack-speech-instance)) + (flags hijack-speech-info-flag) + (play-time time-frame) + ) + ) + +;; definition for method 3 of type hijack-speech-info +(defmethod inspect ((this hijack-speech-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hijack-speech-info) + (format #t "~1Tspeeches: ~A~%" (-> this speeches)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tplay-time: ~D~%" (-> this play-time)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defpartgroup group-lure-sirens + :id 1433 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4715 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpartgroup group-lure-sirens-dim + :id 1434 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4716 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4716 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 4715 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + ) + ) + +;; definition for symbol *hijack-speech*, type (array hijack-speech-info) +(define *hijack-speech* (new 'static 'boxed-array :type hijack-speech-info + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x1f :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x3 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0 hsi3) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x2 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x23 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0 hsi3) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x1b :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x20 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x1a :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x1 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x6 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x7 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x4 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0 hsi3) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x25 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x5 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x27 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0 hsi3) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x22 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x8 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x9 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #xa :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x29 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #xb :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2d :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #xc :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2e :probability 1.0) + (new 'static 'hijack-speech-instance :speech #xe :probability 1.0) + (new 'static 'hijack-speech-instance :speech #xf :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2a :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #xd :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2b :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x28 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x2f :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x31 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x13 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x14 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x15 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x16 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x17 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x18 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x1e :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x1c :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x2c :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x10 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x11 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x32 :probability 1.0) + (new 'static 'hijack-speech-instance :speech #x7 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi2) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x12 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + (new 'static 'hijack-speech-info + :speeches (new 'static 'boxed-array :type hijack-speech-instance + (new 'static 'hijack-speech-instance :speech #x33 :probability 1.0) + ) + :flags (hijack-speech-info-flag hsi0) + ) + ) + ) + +;; definition for method 40 of type cty-hijack-manager +(defmethod reset-hijack-speech ((this cty-hijack-manager)) + (dotimes (v1-0 (-> *hijack-speech* length)) + (logclear! (-> *hijack-speech* v1-0 flags) (hijack-speech-info-flag hsi4)) + (set! (-> *hijack-speech* v1-0 play-time) 0) + ) + #f + ) + +;; definition for function debug-reset-hijack-speech +(defun debug-reset-hijack-speech () + (dotimes (v1-0 (-> *hijack-speech* length)) + (logclear! (-> *hijack-speech* v1-0 flags) (hijack-speech-info-flag hsi4 hsi5)) + (set! (-> *hijack-speech* 0 play-time) 0) + ) + #f + ) + +;; definition for method 39 of type cty-hijack-manager +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 39 cty-hijack-manager) has a return type of none, but the expression builder found a return statement. +(defmethod cty-hijack-manager-method-39 ((this cty-hijack-manager) (arg0 int)) + (let ((s4-0 (-> *hijack-speech* arg0)) + (v1-2 #xf4240) + (a1-1 0) + (s5-0 #f) + ) + (if (and (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi0)) + (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi4)) + ) + (return 0) + ) + (when (and (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi3)) + (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi5)) + ) + (set! s5-0 #t) + (set! s4-0 (-> *hijack-speech* (+ arg0 1))) + ) + (if (and (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi0)) + (logtest? (-> s4-0 flags) (hijack-speech-info-flag hsi4)) + ) + (return 0) + ) + (dotimes (a0-21 (-> s4-0 speeches length)) + (set! v1-2 (min (-> s4-0 speeches a0-21 num-play-times) v1-2)) + ) + (dotimes (a0-24 (-> s4-0 speeches length)) + (if (< v1-2 (-> s4-0 speeches a0-24 num-play-times)) + (set! a1-1 (logior a1-1 (ash 1 a0-24))) + ) + ) + (let ((s3-0 (rand-vu-int-count-excluding (-> s4-0 speeches length) a1-1))) + (logior! (-> s4-0 flags) (hijack-speech-info-flag hsi4 hsi5)) + (talker-spawn-func + (-> *cty-hijack-speech-list* (-> s4-0 speeches s3-0 speech)) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + (+! (-> s4-0 speeches s3-0 num-play-times) 1) + ) + (set-time! (-> s4-0 play-time)) + (if s5-0 + (set-time! (-> *hijack-speech* arg0 play-time)) + ) + ) + (none) + ) + +;; definition of type cty-missile-lure-init-params +(deftype cty-missile-lure-init-params (structure) + ((pos vector :inline) + (orient quaternion :inline) + (is-naughty-ottsel? symbol) + ) + ) + +;; definition for method 3 of type cty-missile-lure-init-params +(defmethod inspect ((this cty-missile-lure-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'cty-missile-lure-init-params) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Torient: #~%" (-> this orient)) + (format #t "~1Tis-naughty-ottsel?: ~A~%" (-> this is-naughty-ottsel?)) + (label cfg-4) + this + ) + +;; definition of type cty-missile-lure +(deftype cty-missile-lure (process-focusable) + ((minimap connection-minimap :offset 216) + (is-naughty-ottsel? symbol) + (lock-open? symbol) + (hum-sound sound-id) + (sirens2 sparticle-launch-control) + (raise-sound sound-id) + ) + (:state-methods + idle + active + complete + closing + opening + naughty-ottsel-wait + naughty-ottsel-lure + ) + (:methods + (go-idle (_type_) object) + (find-and-lure-missiles (_type_) symbol) + ) + ) + +;; definition for method 3 of type cty-missile-lure +(defmethod inspect ((this cty-missile-lure)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tis-naughty-ottsel?: ~A~%" (-> this is-naughty-ottsel?)) + (format #t "~2Tlock-open?: ~A~%" (-> this lock-open?)) + (format #t "~2Thum-sound: ~D~%" (-> this hum-sound)) + (format #t "~2Tsirens2: ~A~%" (-> this sirens2)) + (format #t "~2Traise-sound: ~D~%" (-> this raise-sound)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-missile-lure cty-decoy cty-decoy-lod0-jg cty-decoy-idle-ja + ((cty-decoy-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12.5) + ) + +;; definition for method 21 of type cty-missile-lure +;; INFO: Used lq/sq +(defmethod get-trans ((this cty-missile-lure) (arg0 int)) + "Get the `trans` for this process." + (cond + ((= arg0 3) + (let ((gp-1 (new 'static 'vector))) + (if (-> this is-naughty-ottsel?) + (set! (-> gp-1 quad) (-> this root trans quad)) + (vector<-cspace! gp-1 (-> this node-list data 16)) + ) + gp-1 + ) + ) + (else + (call-parent-method this arg0) + ) + ) + ) + +;; definition for function cty-missile-lure-init-by-other +;; INFO: Used lq/sq +(defbehavior cty-missile-lure-init-by-other cty-missile-lure ((arg0 cty-missile-lure-init-params)) + (stack-size-set! (-> self main-thread) 256) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self mask) (process-mask enemy)) + (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-19 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 4) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-21 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 5) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-23 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 6) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-25 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 7) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-27 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-27 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 8) + (set-vector! (-> v1-27 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-29 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-29 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list projectile tobot) + ) + (set! (-> v1-29 prim-core action) (collide-action solid)) + (set! (-> v1-29 transform-index) 9) + (set-vector! (-> v1-29 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-31 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-31 prim-core collide-with) + (collide-spec jak vehicle-sphere hit-by-others-list player-list tobot) + ) + (set! (-> v1-31 prim-core action) (collide-action solid)) + (set! (-> v1-31 transform-index) 3) + (set-vector! (-> v1-31 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-34 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-34 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-34 prim-core collide-with)) + ) + (set! (-> s5-0 event-self) 'touched) + (set! (-> self root) s5-0) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-missile-lure" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 orient)) + (set-vector! (-> self root scale) 3.0 3.0 3.0 1.0) + (set! (-> self is-naughty-ottsel?) (-> arg0 is-naughty-ottsel?)) + (set! (-> self lock-open?) #f) + (go-idle self) + ) + +;; failed to figure out what this is: +(defstate naughty-ottsel-lure (cty-missile-lure) + :virtual #t + :enter (behavior () + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) + ) + :trans (behavior () + (when (< (vector-vector-xz-distance (-> self root trans) (target-pos 0)) 491520.0) + (send-event (ppointer->process (-> self parent)) 'complete) + (go-virtual complete) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate naughty-ottsel-wait (cty-missile-lure) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('wake-up) + (go-virtual naughty-ottsel-lure) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate idle (cty-missile-lure) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (send-event (ppointer->process (-> self parent)) 'lure-hit) + (go-virtual opening) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) + ) + :trans (behavior () + (spawn-from-cspace (-> self sirens2) (-> self node-list data 17)) + (spawn-from-cspace (-> self sirens2) (-> self node-list data 18)) + (spawn-from-cspace (-> self sirens2) (-> self node-list data 19)) + ) + :code transform-and-sleep-code + :post transform-post + ) + +;; definition for method 10 of type cty-missile-lure +(defmethod deactivate ((this cty-missile-lure)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sirens2)) + (kill-particles (-> this sirens2)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type cty-missile-lure +(defmethod relocate ((this cty-missile-lure) (offset int)) + (if (nonzero? (-> this sirens2)) + (&+! (-> this sirens2) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 35 of type cty-missile-lure +(defmethod go-idle ((this cty-missile-lure)) + (set! (-> this hum-sound) (new-sound-id)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1433) this)) + (set! (-> this sirens2) (create-launch-control (-> *part-group-id-table* 1434) this)) + (set! (-> this raise-sound) (new-sound-id)) + (cond + ((-> this is-naughty-ottsel?) + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this naughty-ottsel-wait)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) + +;; definition for method 36 of type cty-missile-lure +;; INFO: Used lq/sq +(defmethod find-and-lure-missiles ((this cty-missile-lure)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> this root trans quad)) + (set! (-> v1-0 w) 327680.0) + ) + (when #f + (let ((v1-3 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((gp-0 (-> v1-3 next0))) + (while (!= v1-3 (-> *collide-player-list* alive-list-end)) + (let ((v1-4 (the-as collide-shape (-> (the-as connection v1-3) param1)))) + (when (logtest? (-> v1-4 root-prim prim-core collide-as) (collide-spec enemy hit-by-others-list)) + (let* ((s5-0 (-> v1-4 process)) + (a0-12 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if (= (-> a0-12 type) cty-hijack-missile) + (send-event a0-12 'lure) + ) + ) + ) + ) + (set! v1-3 gp-0) + *collide-player-list* + (set! gp-0 (-> gp-0 next0)) + ) + ) + ) + ) + (when #t + (when #f + (let ((v1-15 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((gp-1 (-> v1-15 next0))) + (while (!= v1-15 (-> *collide-hit-by-player-list* alive-list-end)) + (let ((v1-16 (the-as collide-shape (-> (the-as connection v1-15) param1)))) + (when (logtest? (-> v1-16 root-prim prim-core collide-as) (collide-spec enemy hit-by-others-list)) + (let* ((s5-1 (-> v1-16 process)) + (a0-24 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + ) + (if (= (-> a0-24 type) cty-hijack-missile) + (send-event a0-24 'lure) + ) + ) + ) + ) + (set! v1-15 gp-1) + *collide-hit-by-player-list* + (set! gp-1 (-> gp-1 next0)) + ) + ) + ) + ) + (when #t + (let ((v1-26 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((gp-2 (-> v1-26 next0))) + (while (!= v1-26 (-> *collide-hit-by-others-list* alive-list-end)) + (let ((v1-27 (the-as collide-shape (-> (the-as connection v1-26) param1)))) + (when (logtest? (-> v1-27 root-prim prim-core collide-as) (collide-spec enemy hit-by-others-list)) + (let* ((s5-2 (-> v1-27 process)) + (a0-36 (if (type? s5-2 process-focusable) + s5-2 + ) + ) + ) + (if (= (-> a0-36 type) cty-hijack-missile) + (send-event a0-36 'lure) + ) + ) + ) + ) + (set! v1-26 gp-2) + *collide-hit-by-others-list* + (set! gp-2 (-> gp-2 next0)) + ) + ) + ) + #f + ) + ) + ) + +;; failed to figure out what this is: +(defstate complete (cty-missile-lure) + :virtual #t + :enter (behavior () + (sound-stop (-> self hum-sound)) + (if (not (-> self is-naughty-ottsel?)) + (sound-play "decoy-explode" :position (-> self root trans)) + ) + (sound-stop (-> self raise-sound)) + (kill-callback (-> *minimap* engine) (-> self minimap)) + ) + :code nothing + ) + +;; failed to figure out what this is: +(defstate opening (cty-missile-lure) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('missile-hit) + (go-virtual complete) + ) + (('missile-attract) + (set! (-> self lock-open?) #t) + (send-event (ppointer->process (-> self parent)) 'missile-attract) + ) + ) + ) + :enter (behavior () + (sound-play "decoy-activate" :id (-> self raise-sound) :position (-> self root trans)) + ) + :exit (behavior () + (sound-stop (-> self raise-sound)) + ) + :trans (behavior () + (spawn-from-cspace (-> self part) (-> self node-list data 17)) + (spawn-from-cspace (-> self part) (-> self node-list data 18)) + (spawn-from-cspace (-> self part) (-> self node-list data 19)) + (find-and-lure-missiles self) + ) + :code (behavior () + (sound-play "hj-decoy-lights" :id (-> self hum-sound)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 2.0) :frame-num 0.0) + (until (ja-done? 0) + (let ((f0-6 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :w 1.0) + (new 'static 'vector :x 0.5 :w 1.0) + f0-6 + ) + ) + (set! (-> self draw color-emissive w) 0.0) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (go-virtual active) + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate closing (cty-missile-lure) + :virtual #t + :enter (behavior () + (send-event (ppointer->process (-> self parent)) 'lure-lower) + (sound-stop (-> self hum-sound)) + ) + :trans (behavior () + (spawn-from-cspace (-> self sirens2) (-> self node-list data 17)) + (spawn-from-cspace (-> self sirens2) (-> self node-list data 18)) + (spawn-from-cspace (-> self sirens2) (-> self node-list data 19)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! 0.0 2.0) :frame-num max) + (until (ja-done? 0) + (let ((f0-6 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :w 1.0) + (new 'static 'vector :x 0.5 :w 1.0) + f0-6 + ) + ) + (set! (-> self draw color-emissive w) 0.0) + (ja :num! (seek! 0.0)) + (suspend) + ) + (go-virtual idle) + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate active (cty-missile-lure) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('missile-hit) + (go-virtual complete) + ) + (('missile-attract) + (send-event (ppointer->process (-> self parent)) 'missile-attract) + (let ((v0-0 (the-as object #t))) + (set! (-> self lock-open?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (sound-play "hj-decoy-lights" :id (-> self hum-sound)) + (let* ((f0-0 0.5) + (f1-1 (+ 0.5 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))) + (f0-1 (* f0-0 (- f1-1 (* (the float (the int (/ f1-1 2.0))) 2.0)))) + ) + 0.0 + (let* ((f0-3 (sin (* 65536.0 f0-1))) + (f0-4 (* 0.125 f0-3)) + ) + (set! (-> self draw color-emissive x) (+ 0.375 f0-4)) + ) + ) + (spawn-from-cspace (-> self part) (-> self node-list data 17)) + (spawn-from-cspace (-> self part) (-> self node-list data 18)) + (spawn-from-cspace (-> self part) (-> self node-list data 19)) + (find-and-lure-missiles self) + (if (and (not (-> self lock-open?)) + (not (-> self is-naughty-ottsel?)) + (time-elapsed? (-> self state-time) (seconds 6)) + (>= (the-as uint 3) + (-> *game-info* sub-task-list (game-task-node city-hijack-vehicle-resolution) death-count) + ) + ) + (go-virtual closing) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post transform-post + ) + +;; definition of type cty-lure-info +(deftype cty-lure-info (structure) + ((pos vector :inline) + ) + ) + +;; definition for method 3 of type cty-lure-info +(defmethod inspect ((this cty-lure-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'cty-lure-info) + (format #t "~1Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; definition for symbol *cty-hijack-lure-positions*, type (array cty-lure-info) +(define *cty-hijack-lure-positions* + (new 'static 'boxed-array :type cty-lure-info + (new 'static 'cty-lure-info :pos (new 'static 'vector :x 1963376.6 :y 6144.0 :z 6455214.0 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x 668016.6 :y 6144.0 :z 7583047.5 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x -318054.4 :y 6144.0 :z 7174676.5 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x -174694.4 :y 6144.0 :z 6374564.0 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x 764354.56 :y 6144.0 :z 5801574.5 :w 1.0)) + (new 'static 'cty-lure-info :pos (new 'static 'vector :x 1914757.1 :y 6144.0 :z 5914255.5 :w 1.0)) + ) + ) + +;; definition for symbol *naughty-ottsel-pos*, type vector +(define *naughty-ottsel-pos* (new 'static 'vector :x -271073.28 :y 121978.88 :z 5468487.5 :w 1.0)) + +;; definition for symbol *ctyport-hijack-fail*, type resetter-params +(define *ctyport-hijack-fail* + (new 'static 'resetter-params + :flags (resetter-flag auto-reset text-message) + :fail (new 'static 'resetter-spec :continue "ctyindb-hijack-vehicle" :reset-mode 'life :execute #f) + :retry (new 'static 'resetter-spec :continue #f :reset-mode 'try :execute #f) + :reset-delay (seconds 3) + ) + ) + +;; definition for method 7 of type cty-hijack-manager +(defmethod relocate ((this cty-hijack-manager) (offset int)) + (if (nonzero? (-> this missiles)) + (&+! (-> this missiles) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 20 of type cty-hijack-manager +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this cty-hijack-manager)) + (call-parent-method this) + (set! (-> this missile-sound) (new-sound-id)) + (set-setting! 'city-sound '(hijack1) 0.0 2) + (set! (-> this hud-timer) (the-as handle #f)) + (set! (-> this missiles) (new 'process 'boxed-array handle (+ (-> *cty-hijack-lure-positions* length) 1))) + (set! (-> this missiles length) 0) + (set! (-> this current-leader-missile) 0) + (set! (-> this task-arrow) (the-as handle #f)) + (reset-hijack-speech this) + (dotimes (v1-8 (-> this missiles allocated-length)) + (set! (-> this missiles v1-8) (the-as handle #f)) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate wait (cty-hijack-manager) + :virtual #t + :code (behavior () + (while (or (not *target*) + (not *spawn-actors*) + (and (task-node-closed? (game-task-node city-hijack-vehicle-escape)) (zero? (-> *target* pilot))) + ) + (suspend) + ) + (set-time-limit self) + (cond + ((task-node-closed? (game-task-node city-hijack-vehicle-escape)) + (if (nonzero? (-> *target* pilot)) + (set! (-> self hpickup) (-> *target* pilot vehicle)) + ) + (adjust-player-ammo 200.0 (pickup-type ammo-yellow)) + (dotimes (gp-0 (-> self missiles allocated-length)) + (spawn-missile self (target-pos 0) (quaternion-identity! (new 'stack-no-clear 'quaternion)) gp-0) + ) + (set! (-> self missiles length) (-> self missiles allocated-length)) + (go-virtual player-riding) + ) + (else + (go-virtual active) + ) + ) + ) + ) + +;; definition for method 25 of type cty-hijack-manager +(defmethod task-manager-method-25 ((this cty-hijack-manager)) + (when (nonzero? (-> this hpickup)) + (send-event (handle->process (-> this hpickup)) 'override-camera #f) + (let ((a0-7 (handle->process (-> this hpickup)))) + (if a0-7 + (deactivate a0-7) + ) + ) + ) + (let ((a0-11 (handle->process (-> this hud-timer)))) + (if a0-11 + (deactivate a0-11) + ) + ) + (call-parent-method this) + (none) + ) + +;; definition for symbol *pre-hijack-kg-squad-member-settings*, type kg-squad-member-settings +(define *pre-hijack-kg-squad-member-settings* (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-a) + ) + ) + +;; failed to figure out what this is: +(defstate active (cty-hijack-manager) + :virtual #t + :enter (behavior () + (set! (-> self vehicle-is-visible?) #f) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (task-node-close! (game-task-node city-vehicle-training-hover-zone-1) 'event) + (set-setting! 'kg-difficulty #f 1.5 0) + (set-setting! 'exclusive-load '((ignore lctyhijk)) 0.0 0) + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (set! (-> gp-0 position quad) (-> *pickup-start-pos* quad)) + (quaternion-identity! (-> gp-0 rotation)) + (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *pickup-start-angle*) + (set! (-> gp-0 velocity quad) (the-as uint128 0)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (let ((s5-0 (get-process *default-dead-pool* h-kg-pickup #x4000 1))) + (set! (-> self hpickup) + (process->handle + (-> (when s5-0 + (let ((t9-9 (method-of-type h-kg-pickup activate))) + (t9-9 (the-as h-kg-pickup s5-0) *vehicle-manager* "pickup" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 vehicle-init-by-other 11 gp-0) + (-> s5-0 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-1 pos quad) (-> *pickup-start-pos* quad)) + (quaternion-identity! (-> gp-1 quat)) + (set! (-> gp-1 flags) (task-arrow-flags taf8)) + (set! (-> gp-1 map-icon) (the-as uint 12)) + (logior! (-> gp-1 flags) (task-arrow-flags taf3)) + (set! (-> self task-arrow) (process->handle (task-arrow-spawn gp-1 self))) + ) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + (when (not (-> self vehicle-is-visible?)) + (let* ((s5-0 (handle->process (-> self hpickup))) + (gp-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when gp-0 + (when (logtest? (-> gp-0 draw status) (draw-control-status on-screen)) + (when (time-elapsed? (-> self last-check-vehicle-vis-time) (seconds 0.5)) + (set-time! (-> self last-check-vehicle-vis-time)) + (let ((s5-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s5-1 start-pos quad) (-> (target-pos 0) quad)) + (vector-! (-> s5-1 move-dist) (get-trans gp-0 0) (-> s5-1 start-pos)) + (let ((v1-20 s5-1)) + (set! (-> v1-20 radius) 40.96) + (set! (-> v1-20 collide-with) (collide-spec backgnd)) + (set! (-> v1-20 ignore-process0) #f) + (set! (-> v1-20 ignore-process1) #f) + (set! (-> v1-20 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-20 action-mask) (collide-action solid)) + ) + (if (= (fill-and-probe-using-line-sphere *collide-cache* s5-1) -100000000.0) + (set! (-> self vehicle-is-visible?) #t) + ) + ) + ) + ) + ) + ) + ) + (if (or (not (handle->process (-> self hpickup))) + (begin + (let* ((gp-2 #t) + (s5-2 (handle->process (-> self hpickup))) + (v1-34 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-2 process-focusable) + (the-as process-focusable s5-2) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-34 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + (let* ((s5-3 (handle->process (-> self hpickup))) + (gp-3 (if (type? s5-3 process-focusable) + (the-as process-focusable s5-3) + ) + ) + ) + (cond + ((and gp-3 (and (< 184320.0 (vector-vector-xz-distance (target-pos 0) (get-trans gp-3 0))) + (> (get-alert-level1 *kg-squad-control*) 0) + ) + ) + ) + (else + (when (and (logtest? (-> gp-3 draw status) (draw-control-status on-screen)) (-> self vehicle-is-visible?)) + (cty-hijack-manager-method-39 self 0) + (task-node-close! (game-task-node city-hijack-vehicle-infiltrate) 'event) + ) + (set-time! (-> self alert-expire-time)) + ) + ) + ) + (when (and *target* (focus-test? *target* pilot-riding) (let ((gp-4 type?)) + (gp-4 (send-event *target* 'get-vehicle) h-kg-pickup) + ) + ) + (task-node-close! (game-task-node city-hijack-vehicle-infiltrate) 'event) + (go-virtual show-missile-launch) + ) + (let ((t9-18 (-> (find-parent-state) trans))) + (if t9-18 + (t9-18) + ) + ) + ) + ) + +;; definition for symbol *post-hijack-kg-squad-member-settings*, type kg-squad-member-settings +(define *post-hijack-kg-squad-member-settings* (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :target-count 7 + :enemy-type (traffic-type guard-a) + ) + ) + +;; failed to figure out what this is: +(defstate decoy-stage (cty-hijack-manager) + :virtual #t + :parent (cty-hijack-manager active) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-4 object)) + (case message + (('complete) + (send-event (handle->process (-> self missiles (-> self current-leader-missile))) 'die) + (deactivate (handle->process (-> self missiles (-> self current-leader-missile)))) + (set-blackout-frames (seconds 0.3)) + (send-event (handle->process (-> self hpickup)) 'die) + (task-manager-event-handler proc argc message block) + ) + (('missile-attract) + (cond + ((< (-> self current-leader-missile) 1) + (cty-hijack-manager-method-39 self 13) + ) + (else + (set! v0-4 (+ (current-time) (seconds -2))) + (set! (-> *hijack-speech* 13 play-time) (the-as time-frame v0-4)) + v0-4 + ) + ) + ) + (('lure-hit) + (set! v0-4 (current-time)) + (set! (-> self lure-hit-time) (the-as time-frame v0-4)) + v0-4 + ) + (('lure-lower) + (cty-hijack-manager-method-39 self 12) + ) + (('wrong-way) + (send-event self 'fail) + ) + (('missile-die) + (+! (-> self current-leader-missile) 1) + (send-event (handle->process (-> self missiles (-> self current-leader-missile))) 'set-leader) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-setting! 'disable-guard-chatter? #t 0.0 0) + (set-time! (-> self state-time)) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + (set-alert-level1 *kg-squad-control* 1) + (cty-hijack-manager-method-39 self 9) + (set-setting! 'music 'hijack 0.0 0) + (send-event *target* 'change-mode 'gun #f (pickup-type gun-yellow-1)) + (auto-save-user) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + ((-> (method-of-type task-manager active) trans)) + (let ((v1-6 (handle->process (-> self missiles (-> self current-leader-missile))))) + (if v1-6 + (sound-play + "hj-missile" + :id (-> self missile-sound) + :position (-> (the-as process-focusable v1-6) root trans) + ) + ) + ) + (dotimes (gp-0 (-> self missiles length)) + (send-event (handle->process (-> self missiles gp-0)) 'chase-2) + ) + (if (not (time-elapsed? (-> self state-time) (seconds 0.1))) + (send-event (handle->process (-> self hpickup)) 'boost) + ) + (send-event (handle->process (-> self hpickup)) 'override-camera #t) + (set-setting! 'string-min-length 'abs (meters 18) 0) + (set-setting! 'string-max-length 'abs (meters 19) 0) + (set-setting! 'string-min-height 'abs (meters 6) 0) + (set-setting! 'string-max-height 'abs (meters 6) 0) + (if (time-elapsed? (-> self state-time) (seconds 6)) + (cty-hijack-manager-method-39 self 11) + ) + (when (and (> (-> *hijack-speech* 13 play-time) 0) (time-elapsed? (-> *hijack-speech* 13 play-time) (seconds 3))) + (set! (-> *hijack-speech* 13 play-time) 0) + (cond + ((>= 1 (-> self current-leader-missile)) + (cty-hijack-manager-method-39 self 14) + ) + ((= (-> self current-leader-missile) (+ (-> self missiles length) -1)) + (cty-hijack-manager-method-39 self 19) + ) + (else + (cty-hijack-manager-method-39 self 15) + ) + ) + ) + (when (and (> (-> *hijack-speech* 19 play-time) 0) (time-elapsed? (-> *hijack-speech* 19 play-time) (seconds 3))) + (send-event (handle->process (-> self naughty-ottsel-lure)) 'wake-up) + (cty-hijack-manager-method-39 self 20) + ) + (when (and (and (> (-> *hijack-speech* 14 play-time) 0) (time-elapsed? (-> *hijack-speech* 14 play-time) (seconds 10))) + (and (not (logtest? (-> *hijack-speech* 19 flags) (hijack-speech-info-flag hsi4))) + (and (or (and (> (-> *hijack-speech* 15 play-time) 0) (time-elapsed? (-> *hijack-speech* 15 play-time) (seconds 10))) + (not (logtest? (-> *hijack-speech* 15 flags) (hijack-speech-info-flag hsi4))) + ) + (time-elapsed? (-> self lure-hit-time) (seconds 8)) + ) + ) + ) + (set! (-> *hijack-speech* 14 play-time) 0) + (set! (-> *hijack-speech* 15 play-time) 0) + (cty-hijack-manager-method-39 self 16) + ) + (if (and *target* + (time-elapsed? (-> self state-time) (seconds 5)) + (and (< (vector-length (get-transv *target*)) 221184.0) + (or (and (> (-> *hijack-speech* 17 play-time) 0) (time-elapsed? (-> *hijack-speech* 17 play-time) (seconds 4))) + (not (logtest? (-> *hijack-speech* 17 flags) (hijack-speech-info-flag hsi4))) + ) + ) + ) + (cty-hijack-manager-method-39 self 17) + ) + (let ((v1-141 #x6978)) + (let ((a0-80 (-> *game-info* sub-task-list (game-task-node city-hijack-vehicle-resolution) death-count))) + (when (< (the-as uint 2) a0-80) + (let ((a0-83 (+ v1-141 (* 4500 (the-as int (+ a0-80 -1)))))) + (set! v1-141 (min #x1a5e0 a0-83)) + ) + ) + ) + (set! (-> *game-info* timer) + (the-as time-frame (- (the-as time-frame v1-141) (- (current-time) (-> self state-time)))) + ) + ) + (if (< (-> *game-info* timer) 0) + (send-event (handle->process (-> self missiles (-> self current-leader-missile))) 'explode) + ) + (if (or (not (handle->process (-> self hpickup))) + (begin + (let* ((gp-2 #t) + (s5-0 (handle->process (-> self hpickup))) + (v1-164 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-164 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + ) + ) + +;; definition for symbol *missile-fire-order*, type (array int32) +(define *missile-fire-order* (new 'static 'boxed-array :type int32 0 1 2 0 2 0 2)) + +;; definition for symbol *missile-fire-frames*, type (array float) +(define *missile-fire-frames* (new 'static 'boxed-array :type float 12.0 14.0 16.0 21.0 23.0 25.0 31.0 31.0)) + +;; failed to figure out what this is: +(defstate show-missile-launch (cty-hijack-manager) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-setting! 'allow-look-around #f 0.0 0) + (set-time! (-> self state-time)) + (set-setting! 'entity-name "camera-320" 0.0 0) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code (behavior () + (local-vars (v1-2 object)) + (until v1-2 + (suspend) + (set! v1-2 (and (-> *target* next-state) (= (-> *target* next-state name) 'target-pilot-stance))) + ) + (until (process-grab? *target* #f) + (suspend) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1.5)) + (suspend) + ) + ) + (send-event (handle->process (-> self hpickup)) 'flight-up) + (let ((gp-1 (-> self missiles allocated-length)) + (s5-0 0) + ) + (let ((s4-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-0 from) (process->ppointer self)) + (set! (-> s4-0 num-params) 0) + (set! (-> s4-0 message) 'recoil) + (let ((s3-0 send-event-function) + (v1-22 (entity-by-name "cty-missile-launcher-1")) + ) + (s3-0 + (if v1-22 + (-> v1-22 extra process) + ) + s4-0 + ) + ) + ) + (while (> gp-1 0) + (let* ((v1-25 (entity-by-name "cty-missile-launcher-1")) + (f30-0 (-> (the-as process-focusable (if v1-25 + (the-as process-focusable (-> v1-25 extra process)) + ) + ) + skel + root-channel + 0 + frame-num + ) + ) + (s4-1 s5-0) + (s3-1 (+ (-> *missile-fire-frames* length) -2)) + ) + (while (>= s3-1 s4-1) + (when (< (-> *missile-fire-frames* s4-1) f30-0) + (spawn-missiles-from-launcher self (-> *missile-fire-order* s4-1)) + (+! s5-0 1) + (+! gp-1 -1) + ) + (+! s4-1 1) + ) + ) + (suspend) + ) + ) + (sound-play "hj-missile" :id (-> self missile-sound)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.5)) + (suspend) + ) + ) + (dotimes (gp-3 (-> self missiles length)) + (send-event (handle->process (-> self missiles gp-3)) 'begin-moving) + ) + (suspend) + (dotimes (gp-4 (-> self missiles length)) + (send-event (handle->process (-> self missiles gp-4)) 'begin-moving) + ) + (cty-hijack-manager-method-39 self 1) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 0.2)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 1)) + (suspend) + ) + ) + (until (process-release? *target*) + (suspend) + ) + (go-virtual player-riding) + ) + ) + +;; definition for method 36 of type cty-hijack-manager +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs handle. +(defmethod spawn-missile ((this cty-hijack-manager) (arg0 vector) (arg1 quaternion) (arg2 int)) + (let ((s4-0 (new 'stack-no-clear 'cty-hijack-missile-init-params))) + (if (zero? arg2) + (set! (-> s4-0 is-leader?) #t) + (set! (-> s4-0 is-leader?) #f) + ) + (set! (-> s4-0 pos quad) (-> arg0 quad)) + (quaternion-copy! (-> s4-0 quat) arg1) + (set! (-> s4-0 track-obj) (-> this hpickup)) + (let* ((s3-0 (get-process *default-dead-pool* cty-hijack-missile #x4000 1)) + (v0-4 (process->handle + (-> (when s3-0 + (let ((t9-2 (method-of-type cty-hijack-missile activate))) + (t9-2 (the-as cty-hijack-missile s3-0) this "cty-hijack-missile" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 cty-hijack-missile-init-by-other s4-0) + (-> s3-0 ppointer) + ) + 0 + ) + ) + ) + ) + (set! (-> this missiles arg2) (the-as handle v0-4)) + (the-as handle v0-4) + ) + ) + ) + +;; failed to figure out what this is: +(defstate player-riding (cty-hijack-manager) + :virtual #t + :parent (cty-hijack-manager active) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('vehicle-bump) + (if (and (time-elapsed? (-> self state-time) (seconds 5)) + (or (and (> (-> *hijack-speech* 17 play-time) 0) (time-elapsed? (-> *hijack-speech* 17 play-time) (seconds 4))) + (not (logtest? (-> *hijack-speech* 17 flags) (hijack-speech-info-flag hsi4))) + ) + ) + (cty-hijack-manager-method-39 self 17) + ) + ) + (('wrong-way) + (send-event self 'fail) + ) + (('stage-2) + (task-node-close! (game-task-node city-hijack-vehicle-escape) 'event) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-setting! 'disable-parking-spots? #t 0.0 0) + (set-setting! 'music 'hijack 0.0 0) + (set-setting! 'stop-boats? #t 0.0 0) + (kill-by-type barge *active-pool*) + (let* ((v1-6 (entity-by-name "boat-manager-1")) + (a0-5 (if v1-6 + (-> v1-6 extra process) + ) + ) + ) + (if a0-5 + (boat-manager-method-16 (the-as boat-manager a0-5)) + ) + ) + (when *target* + (hide-hud 'hud-health) + (hide-hud 'hud-gun) + (set! (-> *target* fact health) (-> *target* fact health-max)) + (set! (-> *game-info* gun-ammo 0) (fmax (-> *game-info* gun-ammo 0) (-> *FACT-bank* ammo-yellow-start))) + ) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (send-event (handle->process (-> self hpickup)) 'set-taskman (process->handle self)) + (guide-arrow-spawn self) + (set-setting! 'exclusive-load '((ignore all) (allow lctyhijk)) 0.0 0) + (let ((gp-0 (new 'stack-no-clear 'cty-missile-lure-init-params))) + (dotimes (s5-0 (-> *cty-hijack-lure-positions* length)) + (let ((a0-21 (-> *cty-hijack-lure-positions* s5-0))) + (set! (-> gp-0 pos quad) (-> a0-21 pos quad)) + ) + (quaternion-identity! (-> gp-0 orient)) + (set! (-> gp-0 is-naughty-ottsel?) #f) + (process-spawn cty-missile-lure gp-0 :name "cty-missile-lure" :to self) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'cty-missile-lure-init-params))) + (set! (-> gp-1 pos quad) (-> *naughty-ottsel-pos* quad)) + (quaternion-identity! (-> gp-1 orient)) + (set! (-> gp-1 is-naughty-ottsel?) #t) + (let ((s5-1 (get-process *default-dead-pool* cty-missile-lure #x4000 1))) + (set! (-> self naughty-ottsel-lure) + (process->handle + (-> (when s5-1 + (let ((t9-18 (method-of-type cty-missile-lure activate))) + (t9-18 (the-as cty-missile-lure s5-1) self "cty-missile-lure" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 cty-missile-lure-init-by-other gp-1) + (-> s5-1 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (send-event (handle->process (-> self task-arrow)) 'leave) + (set-alert-level1 *kg-squad-control* 1) + (let ((v1-66 (-> self hpickup process))) + (set-setting! 'kg-primary-target v1-66 1.0 (-> v1-66 0 pid)) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + (let ((v1-4 (handle->process (-> self missiles (-> self current-leader-missile))))) + (if v1-4 + (sound-play + "hj-missile" + :id (-> self missile-sound) + :position (-> (the-as process-focusable v1-4) root trans) + ) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 3.5)) + (dotimes (gp-0 (-> self missiles length)) + (send-event (handle->process (-> self missiles gp-0)) 'full-chase) + ) + ) + (if (and (> (-> *hijack-speech* 1 play-time) 0) (time-elapsed? (-> *hijack-speech* 1 play-time) (seconds 3))) + (cty-hijack-manager-method-39 self 3) + ) + (if (and (> (-> *hijack-speech* 5 play-time) 0) (time-elapsed? (-> *hijack-speech* 5 play-time) (seconds 7))) + (cty-hijack-manager-method-39 self 6) + ) + (if (and (> (-> *hijack-speech* 6 play-time) 0) (time-elapsed? (-> *hijack-speech* 6 play-time) (seconds 6))) + (cty-hijack-manager-method-39 self 8) + ) + (cty-hijack-manager-method-35 self) + (when (task-node-closed? (game-task-node city-hijack-vehicle-escape)) + (set-setting! 'exclusive-load '((ignore all) (allow lctyhijk)) 0.0 0) + (go-virtual decoy-stage) + ) + (if (or (not (handle->process (-> self hpickup))) + (begin + (let* ((gp-2 #t) + (s5-0 (handle->process (-> self hpickup))) + (v1-69 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-69 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + ) + ) + +;; definition of type cty-missile-launcher +(deftype cty-missile-launcher (process-drawable) + () + (:state-methods + idle + recoil + ) + ) + +;; definition for method 3 of type cty-missile-launcher +(defmethod inspect ((this cty-missile-launcher)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-missile-launcher cty-missile-launcher cty-missile-launcher-lod0-jg cty-missile-launcher-idle-ja + ((cty-missile-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + :origin-joint-index 3 + ) + +;; definition for method 11 of type cty-missile-launcher +(defmethod init-from-entity! ((this cty-missile-launcher) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle impenetrable-obj)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 5) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 6) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-18 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cty-missile-launcher" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (let ((a0-28 (-> this skel root-channel 0))) + (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (joint-control-channel-group-eval! + a0-28 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-identity + ) + ) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defstate recoil (cty-missile-launcher) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! cty-missile-launcher-recoil-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate idle (cty-missile-launcher) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('recoil) + (go-virtual recoil) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! cty-missile-launcher-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post transform-post + ) + +;; definition for symbol *missile-closer-chase-normal*, type vector +(define *missile-closer-chase-normal* (new 'static 'vector :x -0.9951 :z 0.0976 :w 1.0)) + +;; definition for symbol *missile-closer-chase-pos*, type vector +(define *missile-closer-chase-pos* (new 'static 'vector :x 4090870.2 :y 32741.785 :z 2592906.5 :w 1.0)) + +;; definition for method 35 of type cty-hijack-manager +;; WARN: Return type mismatch symbol vs none. +(defmethod cty-hijack-manager-method-35 ((this cty-hijack-manager)) + (when (< (vector-vector-xz-distance (target-pos 0) *missile-closer-chase-pos*) 81920.0) + (let ((f0-2 (vector-dot + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) *missile-closer-chase-pos*) + *missile-closer-chase-normal* + ) + ) + ) + (when (< 0.0 f0-2) + (dotimes (s5-3 (-> this missiles length)) + (cty-hijack-manager-method-39 this 5) + (send-event (handle->process (-> this missiles s5-3)) 'get-closer) + ) + ) + ) + ) + (none) + ) + +;; definition for method 37 of type cty-hijack-manager +;; WARN: Return type mismatch int vs none. +(defmethod spawn-missiles-from-launcher ((this cty-hijack-manager) (arg0 int)) + (sound-play "missile-launch") + (let* ((v1-1 (entity-by-name "cty-missile-launcher-1")) + (s4-1 (if v1-1 + (-> v1-1 extra process) + ) + ) + ) + (when s4-1 + (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as process-focusable s4-1) node-list data 6))) + (s4-2 (matrix->quaternion + (new 'stack-no-clear 'quaternion) + (-> (the-as process-focusable s4-1) node-list data 6 bone transform) + ) + ) + ) + (vector+float*! s5-1 s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-2) 5120.0) + (cond + ((= arg0 2) + (vector+float*! s5-1 s5-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-2) 6553.6) + ) + ((zero? arg0) + (vector+float*! s5-1 s5-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-2) -6553.6) + ) + ) + (spawn-missile this s5-1 s4-2 (-> this missiles length)) + ) + (+! (-> this missiles length) 1) + ) + ) + (none) + ) + +;; definition of type guide-arrow-info +(deftype guide-arrow-info (structure) + ((pos vector :inline) + (facing vector :inline) + ) + ) + +;; definition for method 3 of type guide-arrow-info +(defmethod inspect ((this guide-arrow-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'guide-arrow-info) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tfacing: #~%" (-> this facing)) + (label cfg-4) + this + ) + +;; definition for symbol *guide-arrow-list*, type (array guide-arrow-info) +(define *guide-arrow-list* (new 'static 'boxed-array :type guide-arrow-info + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 4629187.0 :y 55781.785 :z 2322673.2 :w 1.0) + :facing (new 'static 'vector :x 0.1975 :z 0.9803 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 4619754.5 :y 71141.79 :z 2787199.8 :w 1.0) + :facing (new 'static 'vector :x -0.9725 :z -0.2328 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3561828.0 :y 61127.477 :z 2600695.0 :w 1.0) + :facing (new 'static 'vector :x 0.2231 :z 0.9747 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3558417.5 :y 64115.508 :z 3482799.0 :w 1.0) + :facing (new 'static 'vector :x 0.9886 :z -0.15 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3895419.0 :y 60577.793 :z 3534492.5 :w 1.0) + :facing (new 'static 'vector :x 0.1378 :z 0.9904 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3924504.5 :y 63866.47 :z 4484548.0 :w 1.0) + :facing (new 'static 'vector :x -0.9991 :z -0.0421 :w 1.0) + ) + (new 'static 'guide-arrow-info + :pos (new 'static 'vector :x 3363461.5 :y 57093.734 :z 4522630.5 :w 1.0) + :facing (new 'static 'vector :x -0.1454 :z 0.9893 :w 1.0) + ) + ) + ) + +;; definition for method 38 of type cty-hijack-manager +;; INFO: Used lq/sq +(defmethod guide-arrow-spawn ((this cty-hijack-manager)) + (dotimes (s5-0 (-> *guide-arrow-list* length)) + (let ((a0-1 (new 'stack-no-clear 'guide-arrow-init-params))) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> *guide-arrow-list* s5-0 pos quad)) + (let ((a1-5 (new 'stack-no-clear 'vector))) + (set! (-> a1-5 quad) (-> *guide-arrow-list* s5-0 facing quad)) + (set! (-> a0-1 pos quad) (-> v1-0 quad)) + (set! (-> a0-1 facing quad) (-> a1-5 quad)) + ) + ) + (set! (-> a0-1 xz?) #t) + (set! (-> a0-1 twist) 0.0) + (spawn-guide-arrow a0-1 this) + ) + ) + #f + ) diff --git a/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc new file mode 100644 index 0000000000..bb604a27e1 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc @@ -0,0 +1,159 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-guide-arrow ctywide-arrow ctywide-arrow-lod0-jg ctywide-arrow-idle-ja + ((ctywide-arrow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition of type guide-arrow +(deftype guide-arrow (process-drawable) + ((bob-dir vector :inline) + (base-pos vector :inline) + (pad uint8 8) + ) + (:state-methods + idle + die + ) + (:methods + (guide-arrow-method-22 (_type_) vector) + ) + ) + +;; definition for method 3 of type guide-arrow +(defmethod inspect ((this guide-arrow)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tbob-dir: #~%" (-> this bob-dir)) + (format #t "~2Tbase-pos: #~%" (-> this base-pos)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (label cfg-4) + this + ) + +;; definition of type guide-arrow-init-params +(deftype guide-arrow-init-params (structure) + ((pos vector :inline) + (facing vector :inline) + (twist float) + (xz? symbol) + ) + ) + +;; definition for method 3 of type guide-arrow-init-params +(defmethod inspect ((this guide-arrow-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'guide-arrow-init-params) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tfacing: #~%" (-> this facing)) + (format #t "~1Ttwist: ~f~%" (-> this twist)) + (format #t "~1Txz?: ~A~%" (-> this xz?)) + (label cfg-4) + this + ) + +;; definition for function guide-arrow-init-by-other +;; INFO: Used lq/sq +(defbehavior guide-arrow-init-by-other guide-arrow ((arg0 guide-arrow-init-params)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-guide-arrow" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (cond + ((-> arg0 xz?) + (let ((a1-5 (matrix-u-r-compose + (new 'stack-no-clear 'matrix) + (vector-float*! (new 'stack-no-clear 'vector) (-> arg0 facing) -1.0) + *up-vector* + ) + ) + ) + (matrix->quaternion (-> self root quat) a1-5) + ) + ) + (else + (quaternion-identity! (-> self root quat)) + ) + ) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (-> arg0 twist)) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (process-entity-status! self (entity-perm-status no-kill) #t) + (go-virtual idle) + ) + +;; definition for method 22 of type guide-arrow +(defmethod guide-arrow-method-22 ((this guide-arrow)) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set-vector! (-> this draw color-mult) 1.0 0.0 0.0 1.0) + (logior! (-> this draw status) (draw-control-status force-fade)) + (let ((f0-8 (vector-vector-distance (-> this root trans) (math-camera-pos)))) + 0.0 + (let* ((f1-2 (* 0.0000027126737 f0-8)) + (f1-4 (fmax 0.0 (fmin 1.0 f1-2))) + (f0-11 (- 1.0 (* (- 1.0 f1-4) (- 1.0 f1-4)))) + ) + (set! (-> this draw force-fade) (the-as uint (the int (lerp 0.0 96.0 f0-11)))) + ) + ) + (let* ((f0-14 1.5) + (f1-8 (* 0.0033333334 (the float (- (current-time) (-> this state-time))))) + (f30-0 (/ (- f1-8 (* (the float (the int (/ f1-8 f0-14))) f0-14)) f0-14)) + ) + 0.0 + (let ((s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (f0-19 (* 4096.0 (cos (* 65536.0 f30-0)))) + ) + (vector+float*! (-> this root trans) (-> this base-pos) s5-1 f0-19) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (guide-arrow) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (deactivate self) + ) + ) + ) + :enter (behavior () + (set! (-> self base-pos quad) (-> self root trans quad)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (guide-arrow-method-22 self) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate die (guide-arrow) + :virtual #t + :code nothing + ) + +;; definition for function spawn-guide-arrow +;; WARN: Return type mismatch (pointer process) vs (pointer guide-arrow). +(defun spawn-guide-arrow ((arg0 guide-arrow-init-params) (arg1 process)) + (process-spawn guide-arrow arg0 :name "guide-arrow" :to arg1) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/hijack/kg-vehicles_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/kg-vehicles_REF.gc new file mode 100644 index 0000000000..d8d8adccfe --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/hijack/kg-vehicles_REF.gc @@ -0,0 +1,1018 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-h-kg-pickup kg-pickup kg-pickup-lod0-jg kg-pickup-idle-ja + ((kg-pickup-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.2) + :shadow kg-pickup-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(when (or (zero? *hijack-suck-curve*) (!= loading-level global)) + (set! *hijack-suck-curve* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *hijack-suck-curve* 4 'loading-level (the-as int #t)) + ) + +;; failed to figure out what this is: +(set! (-> *hijack-suck-curve* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *hijack-suck-curve* pts data 0 second) 0.85) + +;; failed to figure out what this is: +(set! (-> *hijack-suck-curve* pts data 1 first) 3.0) + +;; failed to figure out what this is: +(set! (-> *hijack-suck-curve* pts data 1 second) 0.85) + +;; failed to figure out what this is: +(set! (-> *hijack-suck-curve* pts data 2 first) 10.0) + +;; failed to figure out what this is: +(set! (-> *hijack-suck-curve* pts data 2 second) 0.7) + +;; failed to figure out what this is: +(set! (-> *hijack-suck-curve* pts data 3 first) 15.0) + +;; failed to figure out what this is: +(set! (-> *hijack-suck-curve* pts data 3 second) 0.6) + +;; definition for function compute-suck-speed-scalar +(defun compute-suck-speed-scalar () + (let ((f30-0 1.0)) + (when (not (task-node-closed? (game-task-node city-hijack-vehicle-escape))) + (let* ((f1-0 (the float (-> *game-info* sub-task-list (game-task-node city-hijack-vehicle-escape) death-count))) + (f0-2 (fmax 0.0 (fmin 15.0 f1-0))) + ) + (set! f30-0 (curve2d-method-9 *hijack-suck-curve* f0-2 2)) + ) + ) + f30-0 + ) + ) + +;; definition for symbol *h-kg-pickup-constants*, type rigid-body-vehicle-constants +(define *h-kg-pickup-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 8) (meters 3) (meters 14)) + ) + :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 '*h-kg-pickup-constants* + :flags #x468 + :object-type (traffic-type kg-pickup) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 59) + :inv-max-engine-thrust 0.0000041379767 + :engine-response-rate 20.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 60) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.4 + :air-drag-factor 1.0 + :steering-thruster-factor 2.0 + :steering-thruster-max-gain 2.5 + :steering-thruster-half-gain-speed (meters 1200) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.6 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 3) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 182.04445 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.09 + :engine-pitch-mod-amp 0.01 + :engine-sound-select 5 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-5") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :z -14336.0 :w 1.0) + (new 'static 'vector :x -3072.0 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6963.2 :y -1024.0 :z -7372.8 :w 1.0) + (new 'static 'vector :x -6963.2 :y -1024.0 :z -7372.8 :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 3072.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -3072.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 4915.2 :z 15564.8 :w 1.0) + (new 'static 'vector :x -4915.2 :z 15564.8 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 24.0 + :inv-hit-points 0.041666668 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x2 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x4 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x80 #x8 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x100 #x10 #x0) + :damage-seg-count 2 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 6 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 6 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4505.6 :y -2662.4 :z 15360.0 :w 1.0) + (new 'static 'vector :x -4505.6 :y -2662.4 :z 15360.0 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 7372.8 :y -819.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x 7372.8 :y -819.2 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -7372.8 :y -819.2 :z 4096.0 :w 1.0) + (new 'static 'vector :x -7372.8 :y -819.2 :z -4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3686.4 :y -409.6 :z -14950.4 :w 1.0) + (new 'static 'vector :x 3686.4 :y -409.6 :z -14950.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3837.952 :y -409.6 :z -14950.4 :w 1.0) + (new 'static 'vector :x 6041.6 :y -614.4 :z -9011.2 :w 1.0) + ) + :normal (new 'static 'vector :x 0.707 :z -0.707 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -6041.6 :y -614.4 :z -9011.2 :w 1.0) + (new 'static 'vector :x -3837.952 :y -409.6 :z -14950.4 :w 1.0) + ) + :normal (new 'static 'vector :x -0.707 :z -0.707 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 819.2 :z 8503.296 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 409.6 :y 819.2 :z -10563.584 :w (the-as float #x40000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2252.8 :y 1638.4 :z 11264.0 :w 1.0) + (new 'static 'vector :x -2252.8 :y 1638.4 :z 11264.0 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; definition of type pickup-sled-sim +(deftype pickup-sled-sim (billiard-table) + ((mat matrix :inline) + (external-force vector :inline) + ) + ) + +;; definition for method 3 of type pickup-sled-sim +(defmethod inspect ((this pickup-sled-sim)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbilliards: ~A~%" (-> this billiards)) + (format #t "~1Taccum-force: #~%" (-> this accum-force)) + (format #t "~1Tdrag: ~f~%" (-> this drag)) + (format #t "~1Tbounds[2] @ #x~X~%" (-> this min-xyz)) + (format #t "~1Tmin-xyz: #~%" (-> this min-xyz)) + (format #t "~1Tmax-xyz: #~%" (-> this max-xyz)) + (format #t "~1Tbounce-wall-friction: ~f~%" (-> this bounce-wall-friction)) + (format #t "~1Tball-friction: ~f~%" (-> this ball-friction)) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Texternal-force: #~%" (-> this external-force)) + (label cfg-4) + this + ) + +;; definition for method 11 of type pickup-sled-sim +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this pickup-sled-sim)) + 0 + (none) + ) + +;; definition for method 12 of type pickup-sled-sim +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod reset-accum-force ((this pickup-sled-sim)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this mat uvec quad)) + (set! (-> s5-0 y) 0.0) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> this mat fvec quad)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this mat rvec quad)) + (let ((s2-0 (new 'stack-no-clear 'matrix))) + (set! (-> s4-0 y) 0.0) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector-normalize! s3-0 1.0) + (matrix-fr-compose s2-0 s4-0 s3-0) + (matrix-transpose! s2-0 s2-0) + (set! (-> s5-0 w) 0.0) + (vector-matrix*! s5-0 s5-0 s2-0) + ) + ) + ) + (vector-float*! (-> this accum-force) s5-0 81920.0) + ) + (let ((a2-2 (matrix-transpose! (new 'stack-no-clear 'matrix) (-> this mat))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! s5-1 (-> this external-force) a2-2) + (vector+float*! (-> this accum-force) (-> this accum-force) s5-1 0.3) + ) + 0 + (none) + ) + +;; definition of type h-kg-pickup +(deftype h-kg-pickup (h-car-base) + ((fin-fr joint-mod-rotate-local :inline) + (fin-fl joint-mod-rotate-local :inline) + (fin-r joint-mod-rotate-local :inline) + (fin-l joint-mod-rotate-local :inline) + (rudder-l joint-mod-rotate-local :inline) + (rudder-r joint-mod-rotate-local :inline) + (turn-rate float) + (target-turn-rate float) + (camera-override? symbol) + (initial-creation-time time-frame) + (auto-boost? symbol) + (steering-val float) + (sled pickup-sled-sim) + (barrels handle-array) + (taskman handle) + (last-jitter-time time-frame) + (last-slide-time time-frame) + ) + ) + +;; definition for method 3 of type h-kg-pickup +(defmethod inspect ((this h-kg-pickup)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-car-base inspect))) + (t9-0 this) + ) + (format #t "~2Tfin-fr: #~%" (-> this fin-fr)) + (format #t "~2Tfin-fl: #~%" (-> this fin-fl)) + (format #t "~2Tfin-r: #~%" (-> this fin-r)) + (format #t "~2Tfin-l: #~%" (-> this fin-l)) + (format #t "~2Trudder-l: #~%" (-> this rudder-l)) + (format #t "~2Trudder-r: #~%" (-> this rudder-r)) + (format #t "~2Tturn-rate: ~f~%" (-> this turn-rate)) + (format #t "~2Ttarget-turn-rate: ~f~%" (-> this target-turn-rate)) + (format #t "~2Tcamera-override?: ~A~%" (-> this camera-override?)) + (format #t "~2Tinitial-creation-time: ~D~%" (-> this initial-creation-time)) + (format #t "~2Tauto-boost?: ~A~%" (-> this auto-boost?)) + (format #t "~2Tsteering-val: ~f~%" (-> this steering-val)) + (format #t "~2Tsled: ~A~%" (-> this sled)) + (format #t "~2Tbarrels: ~A~%" (-> this barrels)) + (format #t "~2Ttaskman: ~D~%" (-> this taskman)) + (format #t "~2Tlast-jitter-time: ~D~%" (-> this last-jitter-time)) + (format #t "~2Tlast-slide-time: ~D~%" (-> this last-slide-time)) + (label cfg-4) + this + ) + +;; definition for method 30 of type h-kg-pickup +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs object. +(defmethod rigid-body-object-method-30 ((this h-kg-pickup)) + (let ((t9-0 (method-of-type hvehicle rigid-body-object-method-30))) + (t9-0 this) + ) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (dotimes (s5-0 (-> this sled billiards length)) + (let ((f30-0 (vector-vector-xz-distance + (the-as vector (-> this sled billiards data s5-0)) + (the-as vector (+ (the-as uint (-> this sled billiards data 0 prev-pos)) (* 48 s5-0))) + ) + ) + ) + (when (and (< 204.8 f30-0) (time-elapsed? (-> this last-slide-time) (seconds 0.25))) + (set-time! (-> this last-slide-time)) + (sound-play "hj-cans-slide") + ) + (when (logtest? (-> this sled billiards data s5-0 flags) (billiard-ball-flag bb0 bb1)) + (let* ((f1-0 (* 0.0022194602 f30-0)) + (f30-1 (fmax 0.0 (fmin 1.0 f1-0))) + ) + (set-time! (-> this last-jitter-time)) + (sound-play-by-name + (static-sound-name "hj-cans-bump") + (new-sound-id) + (the int (* 1024.0 f30-1)) + 0 + 0 + (sound-group) + #t + ) + ) + ) + ) + ) + (set! (-> this sled drag) 0.05) + (set! (-> this sled bounce-wall-friction) 0.3) + (set! (-> this sled ball-friction) 0.05) + (let* ((v1-45 (-> this sled mat)) + (a3-2 (-> this rbody matrix)) + (a0-13 (-> a3-2 rvec quad)) + (a1-5 (-> a3-2 uvec quad)) + (a2-2 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> v1-45 rvec quad) a0-13) + (set! (-> v1-45 uvec quad) a1-5) + (set! (-> v1-45 fvec quad) a2-2) + (set! (-> v1-45 trans quad) a3-3) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (get-linear-accel! this s5-1) + (let ((f0-10 (vector-normalize-ret-len! s5-1 1.0))) + (vector-float*! (-> this sled external-force) s5-1 (* -1.0 f0-10)) + (if (< 40960.0 f0-10) + (vector-z-quaternion! s5-1 (-> this root quat)) + ) + ) + ) + (billiard-table-method-10 (-> this sled)) + (dotimes (s5-2 (-> this barrels length)) + (let* ((s3-2 (handle->process (-> this barrels data0 s5-2))) + (s4-2 (if (type? s3-2 process-focusable) + (the-as dark-barrel s3-2) + ) + ) + ) + (quaternion-copy! (-> s4-2 root quat) (-> this root quat)) + (-> this sled billiards data s5-2) + (let ((s3-3 (new 'stack-no-clear 'vector))) + (vector-matrix*! s3-3 (the-as vector (-> this sled billiards data s5-2)) (-> this sled mat)) + (set! (-> s4-2 root trans quad) (-> s3-3 quad)) + ) + ) + ) + #f + ) + +;; failed to figure out what this is: +(defskelgroup skel-dark-barrel eco-canister eco-canister-dark-lod0-jg eco-canister-dark-idle-ja + ((eco-canister-dark-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.3) + ) + +;; definition of type dark-barrel +(deftype dark-barrel (process-focusable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type dark-barrel +(defmethod inspect ((this dark-barrel)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for function dark-barrel-init-by-other +(defbehavior dark-barrel-init-by-other dark-barrel () + (set! (-> self level) (level-get *level* 'ctywide)) + (let ((gp-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (set! (-> gp-0 penetrate-using) (penetrate)) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 2048.0) + (set! (-> gp-0 total-prims) (the-as uint 1)) + (set! (-> gp-0 root-prim) v1-4) + ) + (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) + (let ((v1-7 (-> gp-0 root-prim))) + (set! (-> gp-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> gp-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> self root) gp-0) + ) + (set-vector! (-> self root scale) 2.0 2.0 2.0 1.0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-barrel" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> self focus-status) (focus-status pilot-riding)) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defstate idle (dark-barrel) + :virtual #t + :code transform-and-sleep-code + :post ja-post + ) + +;; definition for method 7 of type h-kg-pickup +(defmethod relocate ((this h-kg-pickup) (offset int)) + (if (nonzero? (-> this sled)) + (&+! (-> this sled) offset) + ) + (if (nonzero? (-> this barrels)) + (&+! (-> this barrels) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 35 of type h-kg-pickup +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-kg-pickup)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-kg-pickup" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-kg-pickup-constants*) + (set! (-> this taskman) (the-as handle #f)) + (init (-> this fin-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this fin-l) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-r) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this rudder-l) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this rudder-r) this (the-as uint 8) (joint-mod-base-flags attached)) + (set! (-> this target-turn-rate) 0.0) + (set! (-> this turn-rate) 0.0) + (set! (-> this camera-override?) #f) + (vector-float*! + (-> this rbody lin-momentum) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + 1843200.0 + ) + (set-time! (-> this initial-creation-time)) + (set! (-> this auto-boost?) #f) + (set! (-> this sled) (new 'process 'pickup-sled-sim)) + (init! + (-> this sled) + 5 + (new 'static 'vector :x -4096.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x 4096.0 :z 2048.0 :w 1.0) + ) + (set! (-> this barrels) (the-as handle-array (new 'process 'boxed-array handle 5))) + (dotimes (s5-3 5) + (set! (-> this barrels data0 s5-3) + (ppointer->handle (process-spawn dark-barrel :name "dark-barrel" :to this)) + ) + ) + (set! (-> this barrels length) (-> this barrels allocated-length)) + (dotimes (v1-35 5) + (set! (-> this sled billiards data v1-35 size) 1638.4) + ) + (billiard-table-method-13 (-> this sled)) + 0 + (none) + ) + +;; definition for method 34 of type h-kg-pickup +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this h-kg-pickup)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 3686.4 0.0 12288.0 4096.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -3686.4 0.0 12288.0 4096.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 819.2 5734.4 4915.2) + (set! (-> v1-15 nav-radius) 14336.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 144)))) + (set! (-> v1-17 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 2048.0 -4096.0 5734.4) + (set! (-> v1-17 nav-radius) 14336.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 4915.2 0.0 -11468.8 4096.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) -4915.2 0.0 -11468.8 4096.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 79 of type h-kg-pickup +;; WARN: Return type mismatch quaternion vs none. +(defmethod vehicle-method-79 ((this h-kg-pickup)) + (let ((f30-0 (* 3640.889 (-> this controls steering)))) + (* 9102.223 (-> this controls steering)) + (let* ((f0-4 (* -3640.889 (-> this controls lean-z))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + (f28-0 (* -1.0 f0-4)) + ) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-l rotation) s5-0 f28-0) + ) + (quaternion-vector-angle! (-> this rudder-l rotation) *up-vector* (- f30-0)) + (quaternion-vector-angle! (-> this rudder-r rotation) *up-vector* (- f30-0)) + ) + (none) + ) + +;; definition for function spawn-pickup +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defun spawn-pickup () + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 position quad) (-> (target-pos 0) quad)) + (quaternion-identity! (-> gp-0 rotation)) + (set! (-> gp-0 velocity quad) (the-as uint128 0)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (process-spawn h-kg-pickup :init vehicle-init-by-other 11 gp-0 :name "torpedo") + ) + (none) + ) + +;; definition for method 31 of type h-kg-pickup +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 31 h-kg-pickup) has a return type of none, but the expression builder found a return statement. +(defmethod apply-gravity! ((this h-kg-pickup) (arg0 float)) + (when (and (-> this next-state) (= (-> this next-state name) 'waiting)) + ((method-of-type hvehicle apply-gravity!) this arg0) + (return 0) + ) + (if (-> this auto-boost?) + (vector-float*! + (-> this rbody lin-momentum) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + 1843200.0 + ) + ) + (if (time-elapsed? (-> this initial-creation-time) (seconds 0.2)) + (set! (-> this auto-boost?) #f) + ) + (when #f + (set! (-> this info handling steering-thruster-factor) 2.0) + (call-parent-method this arg0) + (return 0) + ) + (set! (-> this info handling steering-thruster-factor) 0.0) + (let* ((f1-0 (fabs (-> this controls steering))) + (f0-5 (- 1.0 (* (- 1.0 f1-0) (- 1.0 f1-0)))) + ) + (if (< (-> this controls steering) 0.0) + (set! f0-5 (* -1.0 f0-5)) + ) + (set! (-> this steering-val) f0-5) + ) + (set! (-> this target-turn-rate) (* 21845.334 (-> this steering-val))) + (let ((f0-9 (* 2.0 arg0))) + (if (< (fabs (-> this target-turn-rate)) (fabs (-> this turn-rate))) + (set! f0-9 (* 4.0 f0-9)) + ) + (let ((f0-11 (fmax 0.0 (fmin 1.0 f0-9)))) + (set! (-> this turn-rate) (lerp (-> this turn-rate) (-> this target-turn-rate) f0-11)) + ) + ) + (quaternion-rotate-y! + (the-as quaternion (-> this rbody rot)) + (the-as quaternion (-> this rbody rot)) + (* arg0 (-> this turn-rate)) + ) + (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (the-as quaternion (-> this rbody rot)))) + (s4-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-2 quad) (-> this rbody lin-momentum quad)) + 0.0 + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s4-2 y) 0.0) + (let ((f30-0 (vector-normalize-ret-len! s4-2 1.0))) + 0.0 + (let ((f0-20 (vector-dot s4-2 s3-0))) + (cond + (#f + (set! (-> s4-2 quad) (-> s3-0 quad)) + ) + (else + (let ((s2-1 (vector-cross! (new 'stack-no-clear 'vector) s4-2 s3-0)) + (f28-0 (acos f0-20)) + ) + (vector-normalize! s2-1 1.0) + (let ((f0-23 (fmin f28-0 (* 16384.0 arg0)))) + (vector-rotate-around-axis! s4-2 (the-as quaternion s4-2) f0-23 s2-1) + ) + ) + ) + ) + ) + (if (not (-> this auto-boost?)) + (set! f30-0 (fmin f30-0 (* 1843200.0 (compute-suck-speed-scalar)))) + ) + (vector-normalize! s4-2 f30-0) + ) + (set! (-> this rbody lin-momentum x) (-> s4-2 x)) + (set! (-> this rbody lin-momentum z) (-> s4-2 z)) + ) + (call-parent-method this arg0) + (none) + ) + +;; definition for method 94 of type h-kg-pickup +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-94 ((this h-kg-pickup)) + (call-parent-method this) + (when (-> this camera-override?) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (remove-setting! 'string-min-height) + (remove-setting! 'string-max-height) + ) + 0 + (none) + ) + +;; definition for method 49 of type h-kg-pickup +(defmethod rbody-event-handler ((this h-kg-pickup) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('set-taskman) + (let ((v0-0 (the-as object (-> arg3 param 0)))) + (set! (-> this taskman) (the-as handle v0-0)) + v0-0 + ) + ) + (('impact-impulse) + (send-event (handle->process (-> this taskman)) 'vehicle-bump) + (call-parent-method this arg0 arg1 arg2 arg3) + ) + (('override-camera) + (set! (-> this camera-override?) (the-as symbol (-> arg3 param 0))) + #t + ) + (('die) + (deactivate this) + ) + (('flight-up) + (hvehicle-method-154 this) + ) + (('boost) + (set-time! (-> this initial-creation-time)) + (set! (-> this auto-boost?) #t) + (hvehicle-method-154 this) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 88 of type h-kg-pickup +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-88 ((this h-kg-pickup) (arg0 vehicle-controls)) + (call-parent-method this arg0) + (set! (-> arg0 throttle) (- 1.0 (* (- 1.0 (-> arg0 throttle)) (- 1.0 (-> arg0 throttle))))) + 0 + (none) + ) + +;; definition for method 50 of type h-kg-pickup +(defmethod attack-handler ((this h-kg-pickup) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + (local-vars (v0-0 symbol)) + (cond + ((logtest? (penetrate jak-dark-nuke) arg3) + (return #f) + v0-0 + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-obs_REF.gc new file mode 100644 index 0000000000..e119105049 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-obs_REF.gc @@ -0,0 +1,185 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ctyinda-vingate +(deftype ctyinda-vingate (elec-gate) + () + ) + +;; definition for method 3 of type ctyinda-vingate +(defmethod inspect ((this ctyinda-vingate)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elec-gate inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *vingate-elec-gate-params*, type elec-gate-params +(define *vingate-elec-gate-params* (new 'static 'elec-gate-params + :bolt-spec (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8601.6 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + :ring-spec #f + :ring-radius-min 1638.4 + :ring-radius-max 2867.2 + :speed-mult 1.0 + :min-dist 163840.0 + :max-dist 491520.0 + :plane-expand-xz 8192.0 + :plane-expand-y 81920.0 + ) + ) + +;; definition for method 24 of type ctyinda-vingate +(defmethod get-params ((this ctyinda-vingate)) + *vingate-elec-gate-params* + ) + +;; definition for method 26 of type ctyinda-vingate +;; WARN: Return type mismatch int vs none. +(defmethod elec-gate-method-26 ((this ctyinda-vingate)) + (call-parent-method this) + (set! (-> this quality-enabled?) #f) + 0 + (none) + ) + +;; definition for method 11 of type ctyinda-vingate +(defmethod init-from-entity! ((this ctyinda-vingate) (arg0 entity-actor)) + (when (task-node-closed? (game-task-node sewer-hum-kg-resolution)) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + ) + (call-parent-method this arg0) + ) + +;; definition of type industrial-board-vent +(deftype industrial-board-vent (bouncer) + () + ) + +;; definition for method 3 of type industrial-board-vent +(defmethod inspect ((this industrial-board-vent)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bouncer inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 24 of type industrial-board-vent +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this industrial-board-vent)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action)) + (set-vector! (-> v1-2 local-sphere) 0.0 4096.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 23 of type industrial-board-vent +;; WARN: Return type mismatch int vs none. +(defmethod init-skel! ((this industrial-board-vent)) + 0 + (none) + ) + +;; definition of type ctyinda-evil-streetlamp +(deftype ctyinda-evil-streetlamp (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type ctyinda-evil-streetlamp +(defmethod inspect ((this ctyinda-evil-streetlamp)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctyinda-evil-streetlamp ctyinda-evil-streetlamp ctyinda-evil-streetlamp-lod0-jg ctyinda-evil-streetlamp-idle-ja + ((ctyinda-evil-streetlamp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 8 15) + ) + +;; failed to figure out what this is: +(defstate idle (ctyinda-evil-streetlamp) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for method 11 of type ctyinda-evil-streetlamp +(defmethod init-from-entity! ((this ctyinda-evil-streetlamp) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ctyinda-evil-streetlamp" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> this root pause-adjust-distance) 327680.0) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-part_REF.gc b/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-part_REF.gc new file mode 100644 index 0000000000..93c28a5078 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-part_REF.gc @@ -0,0 +1,1145 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-tri-red-light + :id 1078 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3889 :fade-after (meters 80) :flags (sp6)) + (sp-item 3890 :fade-after (meters 80) :flags (sp6)) + (sp-item 3891 :fade-after (meters 80) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 3889 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 3.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3890 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 120.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3891 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-tri-yellow-light + :id 1079 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3892 :fade-after (meters 80) :flags (sp6)) (sp-item 3893 :fade-after (meters 80) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3892 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 100.0) + (:a 100.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3893 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 24.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-red-lights + :id 1080 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3894 :fade-after (meters 80) :flags (sp6)) (sp-item 3895 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3894 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 24.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3895 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-blue-lights + :id 1081 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3896 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3897 :fade-after (meters 120) :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3896 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.3)) + (:y (meters 0.2)) + (:scale-x (meters 1.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 1.4) (meters 0.1)) + (:r 0.0) + (:g 192.0 64.0) + (:b 255.0) + (:a 12.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3897 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.3)) + (:y (meters 0.2)) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 5) (meters 0.1)) + (:r 0.0) + (:g 192.0 32.0) + (:b 255.0) + (:a 12.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-wide-glows-yellow + :id 1082 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3898 :fade-after (meters 80) :flags (sp6)) (sp-item 3899 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3898 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 12) (meters 0.1)) + (:r 255.0) + (:g 192.0 64.0) + (:b 0.0) + (:a 10.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 15155.2) + ) + ) + +;; failed to figure out what this is: +(defpart 3899 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 20) (meters 0.1)) + (:r 255.0) + (:g 192.0 32.0) + (:b 0.0) + (:a 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 15155.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-sign-fashion-8x4 + :id 1083 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3900 :flags (is-3d sp3 sp7)) + (sp-item 3901 :flags (is-3d sp3 sp7)) + (sp-item 3902 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3902 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 48) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3900 + :init-specs ((:texture (sign-fashion2 ctyinda-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100000 -2139062144 0 1 0 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3901 + :init-specs ((:texture (sign-fashion2 ctyinda-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100000 -2139062144 0 1 0 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-sign-praxis-banner-4x8 + :id 1084 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3903 :flags (is-3d sp3 sp7)) + (sp-item 3904 :flags (is-3d sp3 sp7)) + (sp-item 3905 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3905 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 48) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3903 + :init-specs ((:texture (sign-praxis-banner ctyinda-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100200 -2139062144 0 1 #xb100200 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3904 + :init-specs ((:texture (sign-praxis-banner ctyinda-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100200 -2139062144 0 1 #xb100200 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-sign-onin-knows-4x4 + :id 1085 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3906 :flags (is-3d sp3 sp7)) + (sp-item 3907 :flags (is-3d sp3 sp7)) + (sp-item 3908 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3908 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3906 + :init-specs ((:texture (sign-onin-knows ctyinda-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100100 -2139062144 0 1 #xb100100 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3907 + :init-specs ((:texture (sign-onin-knows ctyinda-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb100100 -2139062144 0 1 #xb100100 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-chimney + :id 1086 + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 3909 :fade-after (meters 600) :falloff-to (meters 700)) + (sp-item 3910 :fade-after (meters 300) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 3910 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 20263.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3909 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3911) + ) + ) + +;; failed to figure out what this is: +(defpart 3911 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3912)) + ) + +;; failed to figure out what this is: +(defpart 3912 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3913) + ) + ) + +;; failed to figure out what this is: +(defpart 3913 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3914) + ) + ) + +;; failed to figure out what this is: +(defpart 3914 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-chimney-smoke + :id 1087 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3915 :fade-after (meters 600) :falloff-to (meters 700))) + ) + +;; failed to figure out what this is: +(defpart 3915 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3916) + ) + ) + +;; failed to figure out what this is: +(defpart 3916 + :init-specs ((:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3917) + ) + ) + +;; failed to figure out what this is: +(defpart 3917 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-chimney-small + :id 1088 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3918 :fade-after (meters 300) :falloff-to (meters 350))) + ) + +;; failed to figure out what this is: +(defpart 3918 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.0002)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3919) + ) + ) + +;; failed to figure out what this is: +(defpart 3919 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3920) + ) + ) + +;; failed to figure out what this is: +(defpart 3920 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-red-big-lights-1 + :id 1089 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-red-big-lights-2 + :id 1090 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-red-big-lights-3 + :id 1091 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-red-big-lights-4 + :id 1092 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-red-big-lights-5 + :id 1093 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-red-big-lights-6 + :id 1094 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3921 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000) + ) + ) + +;; failed to figure out what this is: +(defpart 3921 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 27015.748)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3922) + ) + ) + +;; failed to figure out what this is: +(defpart 3922 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 3923) + ) + ) + +;; failed to figure out what this is: +(defpart 3923 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 3924) + ) + ) + +;; failed to figure out what this is: +(defpart 3924 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-smokestack + :id 1095 + :bounds (static-bspherem 0 8 0 16) + :parts ((sp-item 3925 :fade-after (meters 400) :falloff-to (meters 400))) + ) + +;; failed to figure out what this is: +(defpart 3925 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1) + (:y (meters 0)) + (:scale-x (meters 20) (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 192.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.04) (meters 0.026666667)) + (:rotvel-z (degrees -0.05) (degrees 0.1)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.026666667 0.026666667) + (:accel-y (meters 0) (meters -0.0001)) + (:friction 0.995) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1) (seconds -0.005)) + (:next-launcher 3926) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3926 + :init-specs ((:fade-a -0.013333334 -0.013333334)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-squarevent + :id 1096 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3927 :fade-after (meters 200) :falloff-to (meters 250) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3927 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -0.5) (meters 1)) + (:y (meters -0.5) (meters 2)) + (:z (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.033333335) (meters -0.006666667)) + (:vel-z (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.013333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.7) + (:fade-g 1.28) + (:fade-a 0.48) + (:accel-y (meters 0.00083333335) (meters 0.00083333335)) + (:friction 0.95 0.025) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3928) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3928 + :init-specs ((:fade-a -0.12 -0.16)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-bulb-red-glow + :id 1097 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3929 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3929 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 4.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-bulb-red-glow-pulse + :id 1098 + :flags (sp0) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3930 :fade-after (meters 120) :flags (sp6) :period (seconds 2) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 3930 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 1.0) + (:omega (degrees 2715.75)) + (:fade-a 0.13) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:next-time (seconds 1)) + (:next-launcher 3931) + ) + ) + +;; failed to figure out what this is: +(defpart 3931 + :init-specs ((:fade-a -0.13333334)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-glowlite-yellow-glow + :id 1099 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3932 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3932 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-fast-steam + :id 1100 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3933 :flags (sp7))) + ) + +;; definition for symbol *ctyinda-steam-particle-list*, type (array int32) +(define *ctyinda-steam-particle-list* (new 'static 'boxed-array :type int32 #x405c00 #x400000)) + +;; definition for function birth-func-texture-group-steam-ctyinda +;; WARN: Return type mismatch int vs none. +(defun birth-func-texture-group-steam-ctyinda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (particle-adgif-callback + (-> arg1 adgif) + (the-as + texture-id + (-> *ctyinda-steam-particle-list* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *ctyinda-steam-particle-list* length)) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 3933 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group-steam-ctyinda) + (:num 2.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0.1575)) + (:vel-z (meters 0.2) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16) + (:friction 0.92) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335)) + (:next-launcher 3934) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3934 + :init-specs ((:fade-a -0.32)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-rising-steam + :id 1101 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3935 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3935 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -1) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters -0.006666667) (meters -0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3936) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3936 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-steam-drift + :id 1102 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3937 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3937 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -1) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3938) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3938 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyinda-red-floor-vent + :id 1103 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3939 :fade-after (meters 200) :flags (sp6)) + (sp-item 3940 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 3939 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 12)) + (:rot-x (degrees 67.5)) + (:scale-y (meters 24)) + (:r 255.0) + (:g 64.0 16.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3940 + :init-specs ((:num 0.5) + (:x (meters 1) (meters 2.5)) + (:rot-x 7) + (:r 4096.0) + (:g 3072.0) + (:b 2867.2) + (:vel-y (meters 0.016666668) (meters 0.006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3941) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3941 + :init-specs ((:fade-b 1.3653333)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/industrial/ctyindb-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/industrial/ctyindb-obs_REF.gc new file mode 100644 index 0000000000..58ee2f0e44 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/industrial/ctyindb-obs_REF.gc @@ -0,0 +1,54 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type industrialb-board-vent +(deftype industrialb-board-vent (bouncer) + () + ) + +;; definition for method 3 of type industrialb-board-vent +(defmethod inspect ((this industrialb-board-vent)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bouncer inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 24 of type industrialb-board-vent +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this industrialb-board-vent)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action)) + (set-vector! (-> v1-2 local-sphere) 0.0 4096.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 23 of type industrialb-board-vent +;; WARN: Return type mismatch int vs none. +(defmethod init-skel! ((this industrialb-board-vent)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/industrial/ctyindb-part_REF.gc b/test/decompiler/reference/jak3/levels/city/industrial/ctyindb-part_REF.gc new file mode 100644 index 0000000000..759b91a71c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/industrial/ctyindb-part_REF.gc @@ -0,0 +1,1272 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-red-floor-vent + :id 1104 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3942 :fade-after (meters 200) :flags (sp6)) + (sp-item 3943 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 3942 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 12)) + (:rot-x (degrees 67.5)) + (:scale-y (meters 24)) + (:r 0.0) + (:g 128.0 16.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3943 + :init-specs ((:num 0.5) + (:x (meters 1) (meters 2.5)) + (:rot-x 7) + (:r 4096.0) + (:g 3072.0) + (:b 2867.2) + (:vel-y (meters 0.016666668) (meters 0.006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3944) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3944 + :init-specs ((:fade-b 1.3653333)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-red-lights + :id 1105 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3945 :fade-after (meters 80) :flags (sp6)) (sp-item 3946 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3945 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 24.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3946 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-tri-red-light + :id 1106 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3947 :fade-after (meters 80) :flags (sp6)) (sp-item 3948 :fade-after (meters 80) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3947 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 120.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3948 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-tri-yellow-light + :id 1107 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3949 :fade-after (meters 80) :flags (sp6)) (sp-item 3950 :fade-after (meters 80) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3949 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 100.0) + (:a 100.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3950 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 24.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-blue-lights + :id 1108 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3951 :fade-after (meters 80) :flags (sp6 sp7)) + (sp-item 3952 :fade-after (meters 120) :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3951 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.3)) + (:y (meters 0.2)) + (:scale-x (meters 1.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 1.4) (meters 0.1)) + (:r 0.0) + (:g 192.0 64.0) + (:b 255.0) + (:a 12.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3952 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.3)) + (:y (meters 0.2)) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 5) (meters 0.1)) + (:r 0.0) + (:g 192.0 32.0) + (:b 255.0) + (:a 12.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-wide-glows-yellow + :id 1109 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3953 :fade-after (meters 80) :flags (sp6)) (sp-item 3954 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3953 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 12) (meters 0.1)) + (:r 255.0) + (:g 192.0 64.0) + (:b 0.0) + (:a 10.0 1.0) + (:omega (degrees 1365.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 15155.2) + ) + ) + +;; failed to figure out what this is: +(defpart 3954 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 20) (meters 0.1)) + (:r 255.0) + (:g 192.0 32.0) + (:b 0.0) + (:a 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 15155.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-sign-fashion-8x4 + :id 1110 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3955 :flags (is-3d sp3 sp7)) + (sp-item 3956 :flags (is-3d sp3 sp7)) + (sp-item 3957 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3957 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 48) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3955 + :init-specs ((:texture (sign-fashion2 ctyindb-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800100 -2139062144 0 1 0 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3956 + :init-specs ((:texture (sign-fashion2 ctyindb-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800100 -2139062144 0 1 0 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-sign-praxis-banner-4x8 + :id 1111 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3958 :flags (is-3d sp3 sp7)) + (sp-item 3959 :flags (is-3d sp3 sp7)) + (sp-item 3960 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3960 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 48) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3958 + :init-specs ((:texture (sign-praxis-banner ctyindb-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800300 -2139062144 0 1 #xb800300 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3959 + :init-specs ((:texture (sign-praxis-banner ctyindb-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800300 -2139062144 0 1 #xb800300 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-sign-onin-knows-4x4 + :id 1112 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3961 :flags (is-3d sp3 sp7)) + (sp-item 3962 :flags (is-3d sp3 sp7)) + (sp-item 3963 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3963 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3961 + :init-specs ((:texture (sign-onin-knows ctyindb-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800200 -2139062144 0 1 #xb800200 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3962 + :init-specs ((:texture (sign-onin-knows ctyindb-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xb800200 -2139062144 0 1 #xb800200 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-chimney + :id 1113 + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 3964 :fade-after (meters 600) :falloff-to (meters 700)) + (sp-item 3965 :fade-after (meters 300) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 3965 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 20263.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3964 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3966) + ) + ) + +;; failed to figure out what this is: +(defpart 3966 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3967)) + ) + +;; failed to figure out what this is: +(defpart 3967 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3968) + ) + ) + +;; failed to figure out what this is: +(defpart 3968 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3969) + ) + ) + +;; failed to figure out what this is: +(defpart 3969 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-chimney-smoke + :id 1114 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3970 :fade-after (meters 600) :falloff-to (meters 700))) + ) + +;; failed to figure out what this is: +(defpart 3970 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3971) + ) + ) + +;; failed to figure out what this is: +(defpart 3971 + :init-specs ((:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3972) + ) + ) + +;; failed to figure out what this is: +(defpart 3972 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-chimney-small + :id 1115 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3973 :fade-after (meters 300) :falloff-to (meters 350))) + ) + +;; failed to figure out what this is: +(defpart 3973 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.0002)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3974) + ) + ) + +;; failed to figure out what this is: +(defpart 3974 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3975) + ) + ) + +;; failed to figure out what this is: +(defpart 3975 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-red-big-lights-1 + :id 1116 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-red-big-lights-2 + :id 1117 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-red-big-lights-3 + :id 1118 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-red-big-lights-4 + :id 1119 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-red-big-lights-5 + :id 1120 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-red-big-lights-6 + :id 1121 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3976 :fade-after (meters 1200) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000) + ) + ) + +;; failed to figure out what this is: +(defpart 3976 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 27015.748)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3977) + ) + ) + +;; failed to figure out what this is: +(defpart 3977 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 3978) + ) + ) + +;; failed to figure out what this is: +(defpart 3978 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 3979) + ) + ) + +;; failed to figure out what this is: +(defpart 3979 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-smokestack + :id 1122 + :bounds (static-bspherem 0 8 0 16) + :parts ((sp-item 3980 :fade-after (meters 400) :falloff-to (meters 400))) + ) + +;; failed to figure out what this is: +(defpart 3980 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1) + (:y (meters 0)) + (:scale-x (meters 20) (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 192.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.04) (meters 0.026666667)) + (:rotvel-z (degrees -0.05) (degrees 0.1)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.026666667 0.026666667) + (:accel-y (meters 0) (meters -0.0001)) + (:friction 0.995) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1) (seconds -0.005)) + (:next-launcher 3981) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3981 + :init-specs ((:fade-a -0.013333334 -0.013333334)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-squarevent + :id 1123 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3982 :fade-after (meters 200) :falloff-to (meters 250) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3982 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -0.5) (meters 1)) + (:y (meters -0.5) (meters 2)) + (:z (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.033333335) (meters -0.006666667)) + (:vel-z (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.013333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.7) + (:fade-g 1.28) + (:fade-a 0.48) + (:accel-y (meters 0.00083333335) (meters 0.00083333335)) + (:friction 0.95 0.025) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3983) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3983 + :init-specs ((:fade-a -0.12 -0.16)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyind-rubble-crater-smoke + :id 1124 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3984 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3984 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 1)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.005925926)) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.000033333334) (meters 0.00006666667)) + (:accel-y (meters 0.00033333333) (meters 0.000033333334)) + (:accel-z (meters -0.000033333334) (meters 0.00006666667)) + (:friction 0.94) + (:timer (seconds 10.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3985) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3985 + :init-specs ((:fade-a -0.024615385 -0.024615385)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-rubble-smoke + :id 1125 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3986 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3986 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3987) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3987 + :init-specs ((:fade-a -0.11636364)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-glowlite-yellow-glow-b + :id 1126 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3988 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3988 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-bulb-red-glow-b + :id 1127 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3989 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3989 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-bulb-yellow-glow-b + :id 1128 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3990 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3990 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-bulb-red-glow-pulse + :id 1129 + :flags (sp0) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3991 :fade-after (meters 120) :flags (sp6) :period (seconds 2) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 3991 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 1.0) + (:omega (degrees 2715.75)) + (:fade-a 0.13) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:next-time (seconds 1)) + (:next-launcher 3992) + ) + ) + +;; failed to figure out what this is: +(defpart 3992 + :init-specs ((:fade-a -0.13333334)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-fast-steam + :id 1130 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3993 :flags (sp7))) + ) + +;; definition for symbol *ctyindb-steam-b-particle-list*, type (array int32) +(define *ctyindb-steam-b-particle-list* (new 'static 'boxed-array :type int32 #x405c00 #x400000)) + +;; definition for function birth-func-texture-group-steam-b-ctyindb +;; WARN: Return type mismatch int vs none. +(defun birth-func-texture-group-steam-b-ctyindb ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (particle-adgif-callback + (-> arg1 adgif) + (the-as + texture-id + (-> *ctyindb-steam-b-particle-list* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *ctyindb-steam-b-particle-list* length)) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 3993 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group-steam-b-ctyindb) + (:num 2.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0.1575)) + (:vel-z (meters 0.2) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16) + (:friction 0.92) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335)) + (:next-launcher 3994) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3994 + :init-specs ((:fade-a -0.32)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-steam-drift + :id 1131 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3995 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3995 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -1) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3996) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3996 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-rising-steam + :id 1132 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3997 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3997 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -1) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters -0.006666667) (meters -0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3998) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3998 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyindb-tubes-smoke + :id 1133 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3999 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3999 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 4000) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4000 + :init-specs ((:fade-a -0.11636364)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/onintent/onintent-part_REF.gc b/test/decompiler/reference/jak3/levels/city/onintent/onintent-part_REF.gc new file mode 100644 index 0000000000..04b7e3394e --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/onintent/onintent-part_REF.gc @@ -0,0 +1,1544 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-onin-candle + :id 913 + :bounds (static-bspherem 0 0.1 0 0.7) + :parts ((sp-item 3248 :fade-after (meters 60) :falloff-to (meters 60)) + (sp-item 3249 :fade-after (meters 60) :falloff-to (meters 60)) + ) + ) + +;; failed to figure out what this is: +(defpart 3248 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 0.02)) + (:scale-x (meters 0.2) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 32.0 32.0) + (:vel-x (meters 0) (meters 0.00016666666)) + (:vel-z (meters 0) (meters 0.00016666666)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:accel-y (meters 0.00026666667) (meters 0.00006666667)) + (:timer (seconds 0.2) (seconds 0.097)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpart 3249 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.05)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-octopus-tank-bubbles + :id 914 + :bounds (static-bspherem 0 3 0 6) + :parts ((sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 1.167) :length (seconds 0.017) :binding 3250) + (sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 1.617) :length (seconds 0.017) :binding 3250) + (sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.5) :length (seconds 0.017) :binding 3250) + (sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 4.05) :length (seconds 0.017) :binding 3250) + (sp-item 3252 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.367) :length (seconds 0.017) :binding 3250) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3250 :flags (sp1 sp2 sp3) :binding 3251) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3251 :flags (sp1 sp2 sp3)) + (sp-item 3253 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 3252 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters -1.6) (meters 3.2)) + (:y (meters -0.2)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.005)) + (:timer (seconds 1.417)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 100.00001)) + ) + ) + +;; failed to figure out what this is: +(defpart 3250 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.05)) + (:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.00083333335)) + (:scalevel-y (meters 0.00041666668)) + (:fade-a 1.6) + (:timer (seconds 1.417)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +;; failed to figure out what this is: +(defpart 3251 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:rot-x 9) + (:r 819.2) + (:g 614.4) + (:b 512.0) + (:omega (degrees 0)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 1.417)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch distort)) + ) + ) + +;; failed to figure out what this is: +(defpart 3253 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 1.5) + (:x (meters -1.8) (meters 3.6)) + (:y (meters -0.2)) + (:z (meters -0.6) (meters 1.2)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00008333333)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 13926.4) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 100.00001)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-big-tank-bubbles + :id 915 + :bounds (static-bspherem 0 3 0 6) + :parts ((sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 3255) + (sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.7) :length (seconds 0.017) :binding 3255) + (sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.417) :length (seconds 0.017) :binding 3255) + (sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 8.5) :length (seconds 0.017) :binding 3255) + (sp-item 3257 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.45) :length (seconds 0.017) :binding 3255) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3255 :flags (sp1 sp2 sp3) :binding 3256) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3256 :flags (sp1 sp2 sp3)) + (sp-item 3258 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 3257 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 0.6)) + (:y (meters -0.2)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.005)) + (:timer (seconds 2.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3255 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.05)) + (:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.00083333335)) + (:scalevel-y (meters 0.00041666668)) + (:fade-a 1.6) + (:timer (seconds 2.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +;; failed to figure out what this is: +(defpart 3256 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:rot-x 9) + (:r 819.2) + (:g 614.4) + (:b 512.0) + (:omega (degrees 0)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 2.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch distort)) + ) + ) + +;; failed to figure out what this is: +(defpart 3258 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.8) + (:x (meters 0) (meters 0.9)) + (:y (meters -0.2)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00008333333)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 25395.2) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-medium-tank-bubbles + :id 916 + :bounds (static-bspherem 0 3 0 6) + :parts ((sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 3259) + (sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.7) :length (seconds 0.017) :binding 3259) + (sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.417) :length (seconds 0.017) :binding 3259) + (sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 8.5) :length (seconds 0.017) :binding 3259) + (sp-item 3261 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.45) :length (seconds 0.017) :binding 3259) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3259 :flags (sp1 sp2 sp3) :binding 3260) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3260 :flags (sp1 sp2 sp3)) + (sp-item 3262 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 3261 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 0.4)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.005)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3259 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.05)) + (:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.00083333335)) + (:fade-a 1.6) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +;; failed to figure out what this is: +(defpart 3254 + :init-specs ((:scale-x (meters 0.35)) + (:scale-y (meters 0.325)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y (meters -0.00083333335)) + (:fade-a 0.0) + (:next-time (seconds 0.1)) + (:next-launcher 3263) + ) + ) + +;; failed to figure out what this is: +(defpart 3263 + :init-specs ((:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y (meters 0.00083333335)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +;; failed to figure out what this is: +(defpart 3260 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:rot-x 9) + (:r 819.2) + (:g 614.4) + (:b 512.0) + (:omega (degrees 0)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 1.917)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch distort)) + ) + ) + +;; definition for function check-bubble-surface-onintent +(defun check-bubble-surface-onintent ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (if (< (-> arg1 user-float) (-> arg2 rvec y)) + (sp-kill-particle arg0 arg1) + ) + ) + +;; failed to figure out what this is: +(defpart 3262 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.6) + (:x (meters 0) (meters 0.6)) + (:y (meters 0.4)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00016666666)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 18022.4) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-short-tank-bubbles + :id 917 + :bounds (static-bspherem 0 3 0 6) + :parts ((sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 3264) + (sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.7) :length (seconds 0.017) :binding 3264) + (sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.417) :length (seconds 0.017) :binding 3264) + (sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 8.5) :length (seconds 0.017) :binding 3264) + (sp-item 3266 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.45) :length (seconds 0.017) :binding 3264) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3264 :flags (sp1 sp2 sp3) :binding 3265) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3267 :flags (sp1 sp2 sp3)) + (sp-item 3268 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 3266 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 0.4)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.005)) + (:timer (seconds 1.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3264 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.05)) + (:scale-x (meters 0.4)) + (:scale-y (meters 0.3)) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.00083333335)) + (:scalevel-y (meters 0.00041666668)) + (:fade-a 1.6) + (:timer (seconds 1.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.1)) + (:next-launcher 3254) + ) + ) + +;; failed to figure out what this is: +(defpart 3267 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:rot-x 9) + (:r 819.2) + (:g 614.4) + (:b 512.0) + (:omega (degrees 0)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 1.917)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch distort)) + ) + ) + +;; failed to figure out what this is: +(defpart 3268 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.4) + (:x (meters 0) (meters 0.65)) + (:y (meters 0.25)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00016666666)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 12697.6) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-mini-tank-bubbles + :id 918 + :bounds (static-bspherem 0 1 0 1) + :parts ((sp-item 3269 :fade-after (meters 100) :falloff-to (meters 100))) + ) + +;; failed to figure out what this is: +(defpart 3269 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.4) + (:x (meters 0) (meters 0.5)) + (:y (meters 0)) + (:scale-x (meters 0.025) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 16.0) + (:vel-x (meters -0.00016666666)) + (:vel-y (meters 0.0016666667) (meters 0.005)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 13107.2) + (:func 'check-bubble-surface-onintent) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-flashpot + :id 919 + :bounds (static-bspherem 0 2 0 2.2) + :parts ((sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 1.617) :length (seconds 0.017) :binding 3270) + (sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.267) :length (seconds 0.017) :binding 3270) + (sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.4) :length (seconds 0.017) :binding 3270) + (sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 4.635) :length (seconds 0.017) :binding 3270) + (sp-item 3272 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.335) :length (seconds 0.017) :binding 3270) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3270 :flags (sp1 sp2 sp3) :binding 3271) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3271 :flags (sp1 sp2)) + (sp-item 3273) + (sp-item 3274) + (sp-item 3275) + (sp-item 3276) + ) + ) + +;; failed to figure out what this is: +(defpart 3275 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.5) + (:y (meters 0.4)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-x (degrees 0.225)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 64.0 128.0) + (:b 64.0 64.0) + (:a 48.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.1333334) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 3276 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.8)) + (:scale-x (meters 4.5) (meters 0.2)) + (:rot-x (degrees 0.45)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 64.0 128.0) + (:b 64.0 64.0) + (:a 12.0 4.0) + (:omega (degrees 22.5)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 3274 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.6) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0.25) (meters 0.25)) + (:z (meters -0.2) (meters 0.4)) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3277) + ) + ) + +;; failed to figure out what this is: +(defpart 3277 + :init-specs ((:fade-b -0.68266666)) + ) + +;; failed to figure out what this is: +(defpart 3273 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0.25) (meters 0.25)) + (:z (meters -0.2) (meters 0.4)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g 64.0 128.0) + (:b 0.0 64.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.6) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.047)) + (:next-launcher 3278) + ) + ) + +;; failed to figure out what this is: +(defpart 3278 + :init-specs ((:fade-a -0.043636363 -0.05818182)) + ) + +;; failed to figure out what this is: +(defpart 3272 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters -0.25) (meters 0.5)) + (:y (meters 0)) + (:z (meters -0.25) (meters 0.5)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.025) (meters 0.015)) + (:friction 0.9 0.025) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 15)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3270 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0) (meters 0.05)) + (:scale-x (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 255.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0) (meters 0.0022222223)) + (:vel-z (meters 0.0016666667) (meters 0.00033333333)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:accel-x (meters -0.000008888889)) + (:accel-z (meters -0.000006666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 ready-to-launch)) + (:next-time (seconds 1.5)) + (:next-launcher 3279) + ) + ) + +;; failed to figure out what this is: +(defpart 3279 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpart 3271 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0 2.0) + (:scale-x (meters 0.1) (meters 0.075)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g 64.0 128.0) + (:b 0.0 64.0) + (:a 8.0 16.0) + (:vel-y (meters 0.0016666667) (meters 0.0016666667)) + (:scalevel-x (meters 0) (meters 0.0016666667)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.04 -0.053333335) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:friction 0.85) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-heatpot + :id 920 + :bounds (static-bspherem 0 1 0 1) + :parts ((sp-item 3281 :fade-after (meters 40) :falloff-to (meters 40) :binding 3280) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3280 :flags (sp1 sp2 sp3)) + (sp-item 3282) + (sp-item 3283) + (sp-item 3284) + ) + ) + +;; failed to figure out what this is: +(defpart 3283 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.4) (meters 0.1)) + (:rot-x (degrees 0.225)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b :copy g) + (:a 64.0 8.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.1333334) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpart 3284 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.2)) + (:rot-x (degrees 0.45)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b :copy g) + (:a 12.0 4.0) + (:omega (degrees 22.5)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 3281 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 1.0) + (:sound (static-sound-spec "fire-pop" :group 0 :volume 10000.0)) + (:x (meters -0.1) (meters 0.2)) + (:y (meters 0)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.0033333334)) + (:accel-y (meters -0.000016666667) (meters -0.000033333334)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3280 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0) (meters 0.1)) + (:scale-x (meters 0.05) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 128.0) + (:b 128.0) + (:a 96.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.026666667) (meters 0.053333335)) + (:vel-y (meters 0)) + (:vel-z (meters 0.00033333333) (meters 0.0026666666)) + (:fade-r 0.0) + (:fade-g -0.7111111) + (:fade-b -0.7111111) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.6)) + (:next-launcher 3285) + ) + ) + +;; failed to figure out what this is: +(defpart 3285 + :init-specs ((:fade-r -1.0666667) (:fade-g 1.0666667) (:fade-b 1.0666667)) + ) + +;; failed to figure out what this is: +(defpart 3282 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.3) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0.25) (meters 0.25)) + (:z (meters -0.2) (meters 0.4)) + (:rot-x 5) + (:r 1638.4) + (:g 1392.64) + (:b 1433.6) + (:vel-y (meters 0.0016666667) (meters 0.0033333334)) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:timer (seconds 0.5)) + (:flags (distort)) + (:next-time (seconds 0.25)) + (:next-launcher 3286) + ) + ) + +;; failed to figure out what this is: +(defpart 3286 + :init-specs ((:fade-b -0.54613334)) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-tiki + :id 921 + :bounds (static-bspherem 0 2 0 4) + :parts ((sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 1.617) :length (seconds 0.017) :binding 3287) + (sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2.267) :length (seconds 0.017) :binding 3287) + (sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 3.4) :length (seconds 0.017) :binding 3287) + (sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 4.635) :length (seconds 0.017) :binding 3287) + (sp-item 3289 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 6.335) :length (seconds 0.017) :binding 3287) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3287 :flags (sp1 sp2 sp3) :binding 3288) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3288 :flags (sp1 sp2)) + (sp-item 3290) + (sp-item 3291) + (sp-item 3292) + ) + ) + +;; failed to figure out what this is: +(defpart 3291 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.3) (meters 0.2)) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-x (degrees 0.45)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 128.0 64.0) + (:b 128.0 128.0) + (:a 16.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 3292 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.8)) + (:scale-x (meters 6.5) (meters 0.5)) + (:rot-x (degrees 0.45)) + (:scale-y (meters 8.5) (meters 0.5)) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 128.0 128.0) + (:a 12.0 4.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.0666667) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 3290 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0) + (:x (meters 0) (meters 0.3)) + (:y (meters -0.25) (meters 0.25)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 128.0 64.0) + (:b 128.0 128.0) + (:a 0.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0016666667) (meters 0.0026666666)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.9142857) + (:fade-g -1.8285714) + (:fade-b -0.9142857) + (:fade-a 0.6) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.047)) + (:next-launcher 3293) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3293 + :init-specs ((:fade-a -0.032 -0.042666666) (:next-time (seconds 0.135)) (:next-launcher 3294)) + ) + +;; failed to figure out what this is: +(defpart 3294 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.135)) (:next-launcher 3294)) + ) + +;; failed to figure out what this is: +(defpart 3289 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:x (meters -0.25) (meters 0.5)) + (:y (meters 0)) + (:z (meters -0.25) (meters 0.5)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.041666668) (meters 0.015)) + (:friction 0.9 0.025) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 60) (degrees 15)) + (:conerot-y (degrees -45) (degrees 90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3287 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0) (meters 0.05)) + (:scale-x (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0) (meters 0.0022222223)) + (:vel-z (meters 0.0016666667) (meters 0.00033333333)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:accel-x (meters -0.000008888889)) + (:accel-z (meters -0.000006666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 ready-to-launch)) + (:next-time (seconds 1.5)) + (:next-launcher 3295) + ) + ) + +;; failed to figure out what this is: +(defpart 3295 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpart 3288 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0 2.0) + (:scale-x (meters 0.15) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 0.0 64.0) + (:b 64.0 128.0) + (:a 8.0 16.0) + (:vel-y (meters 0.0016666667) (meters 0.0016666667)) + (:scalevel-x (meters 0) (meters 0.0016666667)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.04 -0.053333335) + (:accel-y (meters -0.000033333334) (meters -0.000033333334)) + (:friction 0.85) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-bird-top + :id 922 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 3296 :fade-after (meters 40) :flags (is-3d sp1) :period (seconds 2) :length (seconds 0.017)) + (sp-item 3297 :fade-after (meters 40) :flags (is-3d sp1) :period (seconds 2) :length (seconds 0.017)) + (sp-item 3298 :fade-after (meters 40) :flags (is-3d sp1) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-bird-cage + :id 923 + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 3306 :fade-after (meters 40) :period (seconds 3) :length (seconds 0.017) :binding 3299) + (sp-item 3299 :flags (sp1 sp2 sp3) :binding 3300) + (sp-item 3300 :flags (is-3d sp1 sp2) :binding 3301) + (sp-item 3301 :flags (is-3d sp1 sp2) :binding 3302) + (sp-item 3302 :flags (is-3d sp1 sp2)) + (sp-item 3299 :flags (sp1 sp2 sp3) :binding 3300) + (sp-item 3300 :flags (is-3d sp1 sp2) :binding 3301) + (sp-item 3301 :flags (is-3d sp1 sp2) :binding 3302) + (sp-item 3302 :flags (is-3d sp1 sp2)) + (sp-item 3307 :fade-after (meters 40) :period (seconds 3) :length (seconds 0.017) :binding 3303) + (sp-item 3303 :flags (is-3d sp1 sp2) :binding 3304) + (sp-item 3304 :flags (is-3d sp1 sp2) :binding 3305) + (sp-item 3305 :flags (is-3d sp1 sp2)) + (sp-item 3303 :flags (is-3d sp1 sp2) :binding 3304) + (sp-item 3304 :flags (is-3d sp1 sp2) :binding 3305) + (sp-item 3305 :flags (is-3d sp1 sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 3296 + :init-specs ((:texture (hummingbird-body onintent-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0.2)) + (:z (meters 0)) + (:scale-x (meters 0.6)) + (:rot-x (degrees 90)) + (:rot-y (degrees 180)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.6)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 aux-list left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 3297 + :init-specs ((:texture (hummingbird-wing2 onintent-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0.2)) + (:z (meters 0)) + (:scale-x (meters 0.4)) + (:rot-x (degrees -60)) + (:rot-y (degrees 60)) + (:rot-z (degrees -60)) + (:scale-y (meters 1)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:rotvel-x (degrees 0.33333334)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 aux-list left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 3308) + ) + ) + +;; failed to figure out what this is: +(defpart 3298 + :init-specs ((:texture (hummingbird-wing2 onintent-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0.2)) + (:z (meters 0)) + (:scale-x (meters 0.4)) + (:rot-x (degrees 240)) + (:rot-y (degrees -60)) + (:rot-z (degrees 60)) + (:scale-y (meters 1)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:rotvel-x (degrees -0.33333334)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 aux-list left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 3309) + ) + ) + +;; failed to figure out what this is: +(defpart 3308 + :init-specs ((:rotvel-x (degrees -0.31666666))) + ) + +;; failed to figure out what this is: +(defpart 3309 + :init-specs ((:rotvel-x (degrees 0.31666666))) + ) + +;; failed to figure out what this is: +(defpart 3306 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 1.5)) + (:z (meters 0)) + (:scale-x (meters 0.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 3299 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 1.4222223)) + (:z (meters 0.5)) + (:scale-x (meters 0.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:omega (degrees 25.000002)) + (:vel-x (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +;; failed to figure out what this is: +(defpart 3300 + :init-specs ((:texture (hummingbird-body onintent-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.5) (meters 0.1)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +;; failed to figure out what this is: +(defpart 3301 + :init-specs ((:texture (hummingbird-wing onintent-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 135)) + (:rot-y (degrees 90)) + (:rot-z (degrees -60) (degrees 120)) + (:scale-y (meters 0.5)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 64.0 1 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +;; failed to figure out what this is: +(defpart 3302 + :init-specs ((:texture (hummingbird-wing onintent-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 135)) + (:rot-y (degrees 90)) + (:rot-z (degrees 120) (degrees 120)) + (:scale-y (meters 0.5)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 64.0 1 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +;; failed to figure out what this is: +(defpart 3307 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 1)) + (:z (meters 0)) + (:scale-x (meters 0.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:a 128.0) + (:vel-y (meters 0.006666667)) + (:accel-y (meters -0.000144)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1.5)) + (:next-launcher 3310) + ) + ) + +;; failed to figure out what this is: +(defpart 3310 + :init-specs ((:accel-y (meters 0.00013))) + ) + +;; failed to figure out what this is: +(defpart 3303 + :init-specs ((:texture (hummingbird-body onintent-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 0.5) (meters 0.1)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +;; failed to figure out what this is: +(defpart 3304 + :init-specs ((:texture (hummingbird-wing onintent-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 135)) + (:rot-y (degrees 90)) + (:rot-z (degrees -60) (degrees 120)) + (:scale-y (meters 0.5)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 64.0 1 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +;; failed to figure out what this is: +(defpart 3305 + :init-specs ((:texture (hummingbird-wing onintent-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 135)) + (:rot-y (degrees 90)) + (:rot-z (degrees 120) (degrees 120)) + (:scale-y (meters 0.5)) + (:r 64.0) + (:g 48.0) + (:b 48.0) + (:a 64.0 1 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-bugs + :id 924 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3311 :flags (is-3d)) (sp-item 3312 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 3311 + :init-specs ((:texture (onin-spider-02 onintent-sprite)) + (:num 0.04) + (:x (meters 1)) + (:y (meters 0)) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0 16.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-x (meters 0.006666667)) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x48500d00 #x48500e00 #x48500f00 #x48500e00)) + (:func 'check-onintent-bugs) + (:next-time (seconds 1) (seconds 0.997)) + (:next-launcher 3313) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3312 + :init-specs ((:texture (onin-spider-02 onintent-sprite)) + (:num 0.04) + (:x (meters 8)) + (:y (meters 0)) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0 16.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-x (meters -0.006666667)) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x48500d00 #x48500e00 #x48500f00 #x48500e00)) + (:func 'check-onintent-bugs) + (:next-time (seconds 2) (seconds 0.497)) + (:next-launcher 3313) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3313 + :init-specs ((:vel-x (meters -0.006666667) (meters 0.013333334)) + (:vel-z (meters -0.006666667) (meters 0.013333334)) + (:timer (seconds 2.5)) + (:next-time (seconds 0.835) (seconds 1.497)) + (:next-launcher 3313) + ) + ) + +;; definition for function check-onintent-bugs +;; WARN: Function check-onintent-bugs has a return type of none, but the expression builder found a return statement. +(defun check-onintent-bugs ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (let ((a2-1 (-> arg1 key)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (vector-! v1-0 (-> arg2 rvec) (-> a2-1 origin trans)) + (when (or (< 30720.0 (fabs (-> v1-0 x))) (< 45056.0 (fabs (-> v1-0 z)))) + (sp-kill-particle arg0 arg1) + (return #f) + ) + ) + (let ((s3-0 (the-as sprite-vec-data-2d (-> arg1 user-float)))) + (if (nonzero? s3-0) + (set! (-> s3-0 x-y-z-sx w) + (the-as float (the int (lerp-scale 150.0 10.0 (* 300.0 (vector-length (-> arg1 vel-sxvel))) 0.0 4096.0))) + ) + ) + ) + (sparticle-turn-to-vel arg0 arg1 (the-as sprite-vec-data-3d arg2)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/onintent/onintent-scenes_REF.gc b/test/decompiler/reference/jak3/levels/city/onintent/onintent-scenes_REF.gc new file mode 100644 index 0000000000..965468dd6c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/onintent/onintent-scenes_REF.gc @@ -0,0 +1,691 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-onin-clap-effect + :id 925 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3314 :period (seconds 4) :length (seconds 0.267)) + (sp-item 3314 :period (seconds 4) :length (seconds 0.135)) + (sp-item 3314 :period (seconds 4) :length (seconds 0.067)) + (sp-item 3314 :period (seconds 4) :length (seconds 0.035)) + (sp-item 3314 :period (seconds 4) :length (seconds 0.017)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.267)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.135)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.067)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.035)) + (sp-item 3315 :period (seconds 4) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 3314 + :init-specs ((:texture (glow level-default-sprite)) + (:num 6.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:vel-y (meters 0.0033333334) (meters 0.033333335)) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.00008333333)) + (:friction 0.9 0.02) + (:timer (seconds 1) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3316) + (:conerot-x (degrees 30) (degrees 90)) + (:conerot-y (degrees -32) (degrees 64)) + ) + ) + +;; failed to figure out what this is: +(defpart 3315 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 15.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 4.0) + (:vel-y (meters 0.0033333334) (meters 0.033333335)) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.008888889 -0.008888889) + (:accel-y (meters 0) (meters -0.000016666667)) + (:friction 0.9 0.02) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 30) (degrees 90)) + (:conerot-y (degrees -32) (degrees 64)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-big-clap-effect + :id 926 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3317 :period (seconds 4) :length (seconds 0.267)) + (sp-item 3317 :period (seconds 4) :length (seconds 0.135)) + (sp-item 3317 :period (seconds 4) :length (seconds 0.067)) + (sp-item 3317 :period (seconds 4) :length (seconds 0.035)) + (sp-item 3317 :period (seconds 4) :length (seconds 0.017)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.267)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.135)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.067)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.035)) + (sp-item 3318 :period (seconds 4) :length (seconds 0.017)) + (sp-item 3319 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 15) + ) + ) + +;; failed to figure out what this is: +(defpart 3319 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 100.0) + (:omega (degrees 1361.25)) + (:fade-a -1.25) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 3317 + :init-specs ((:texture (glow level-default-sprite)) + (:num 6.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:vel-y (meters 0.1) (meters 0.016666668)) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.00008333333)) + (:friction 0.9 0.01) + (:timer (seconds 1) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3316) + (:conerot-x (degrees 82) (degrees 10)) + (:conerot-y (degrees -10) (degrees 10)) + ) + ) + +;; failed to figure out what this is: +(defpart 3318 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 10.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 4.0) + (:vel-y (meters 0.1) (meters 0.016666668)) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.008888889 -0.008888889) + (:accel-y (meters 0) (meters -0.000016666667)) + (:friction 0.9 0.01) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 82) (degrees 10)) + (:conerot-y (degrees -10) (degrees 10)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-finger-effect + :id 927 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3320 :falloff-to (meters 20)) (sp-item 3321 :falloff-to (meters 20))) + ) + +;; failed to figure out what this is: +(defpart 3320 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.000016666667)) + (:timer (seconds 1) (seconds 2.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3316) + ) + ) + +;; failed to figure out what this is: +(defpart 3316 + :init-specs ((:scale-x (meters 0.01) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.0) + (:next-time (seconds 0.017)) + (:next-launcher 3322) + ) + ) + +;; failed to figure out what this is: +(defpart 3322 + :init-specs ((:r 0.0) (:g 64.0 64.0) (:b 255.0) (:a 64.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 3316)) + ) + +;; failed to figure out what this is: +(defpart 3321 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:timer (seconds 0.5) (seconds 1.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-onin-small-finger-effect + :id 928 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3323 :falloff-to (meters 15)) (sp-item 3324 :falloff-to (meters 15))) + ) + +;; failed to figure out what this is: +(defpart 3323 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.03) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.00013333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters 0) (meters -0.000016666667)) + (:timer (seconds 0.5) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0) (seconds 0.497)) + (:next-launcher 3316) + ) + ) + +;; failed to figure out what this is: +(defpart 3324 + :init-specs ((:texture (onin-magic-bigpuff onintent-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.00033333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:timer (seconds 0.5) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "city-find-catacomb-ent-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-32" + :art-group "scenecamera" + :anim "city-find-catacomb-ent-intro" + :parts 15 + :command-list '((100 + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LindexC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LpinkyC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LthumbC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LringC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LmiddleC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RpinkyC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RthumbC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RringC" + track + #t + duration + (frame-range 100 351) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RmiddleC" + track + #t + duration + (frame-range 100 351) + ) + ) + (640 + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LindexC" + track + #t + duration + (frame-range 640 730) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LpinkyC" + track + #t + duration + (frame-range 640 730) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LthumbC" + track + #t + duration + (frame-range 640 730) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LringC" + track + #t + duration + (frame-range 640 730) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LmiddleC" + track + #t + duration + (frame-range 640 730) + ) + ) + (857 + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LindexC" + track + #t + duration + (frame-range 857 997) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LpinkyC" + track + #t + duration + (frame-range 857 997) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LthumbC" + track + #t + duration + (frame-range 857 997) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LringC" + track + #t + duration + (frame-range 857 997) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "LmiddleC" + track + #t + duration + (frame-range 857 997) + ) + ) + (998 + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 998 1171) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RpinkyC" + track + #t + duration + (frame-range 998 1171) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RthumbC" + track + #t + duration + (frame-range 998 1171) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RringC" + track + #t + duration + (frame-range 998 1171) + ) + (part-tracker + "group-onin-small-finger-effect" + entity + "onin-highres" + joint + "RmiddleC" + track + #t + duration + (frame-range 998 1171) + ) + ) + (1750 (fadeout (frame-time-30 30))) + (10000 (task-close! "palace-ruins-patrol-introduction")) + ) + :cut-list '(44 352 456 509 550 612 640 768 857 998 1241 1342 1485 1660) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'onintent + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min 1241) (1342 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'onintent + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'onintent + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'onintent + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'onintent + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min 768) (857 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "onintent-start" + :end-point "onintent-end" + :borrow '() + :sfx-volume -1.0 + :ambient-volume 0.5 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc new file mode 100644 index 0000000000..61a6508fc2 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc @@ -0,0 +1,640 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *ctyport-attack-bbush-positions*, type (array ctyport-attack-package-info) +(define *ctyport-attack-bbush-positions* (new 'loading-level 'boxed-array ctyport-attack-package-info 64)) + +;; failed to figure out what this is: +(dotimes (gp-0 (-> *ctyport-attack-bbush-positions* allocated-length)) + (set! (-> *ctyport-attack-bbush-positions* gp-0) (new 'loading-level 'ctyport-attack-package-info)) + ) + +;; failed to figure out what this is: +(set! (-> *ctyport-attack-bbush-positions* length) 0) + +;; definition for symbol *ctyport-bbush-mine-positions*, type (array ctyport-mine-layout) +(define *ctyport-bbush-mine-positions* + (new 'static 'boxed-array :type ctyport-mine-layout + (new 'static 'ctyport-mine-layout + :num-mines 7 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1984389.1 :z 6423224.5) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 7 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1924341.8 :z 7077519.5) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1087733.8 :z 7747666.0) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 4 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -262144.0 :z 5992448.0) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 7 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 205496.31 :z 5999370.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 8 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 7 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 965550.06 :z 6243574.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 8 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 507904.0 :z 6541312.0) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 958177.25 :z 7158210.5) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 623411.2 :z 7167959.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -81920.0 :z 5771264.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 81920.0 :z 5578752.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 156999.69 :z 5603287.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 4 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 639508.5 :z 5754306.5) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 3 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1331200.0 :z 5947392.0) + :initial-angle 8192.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 2 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1544192.0 :z 5701632.0) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -593920.0 :z 6385664.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1454080.0 :z 6524928.0) + :initial-angle 8192.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 442368.0 :z 7557120.0) + :initial-angle 10922.667 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + ) + ) + +;; definition of type ctyport-attack-manager-bbush +(deftype ctyport-attack-manager-bbush (ctyport-attack-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (clock-speed float) + (countdown-timer handle :offset 336) + ) + (:state-methods + wait-award + ) + ) + +;; definition for method 3 of type ctyport-attack-manager-bbush +(defmethod inspect ((this ctyport-attack-manager-bbush)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type ctyport-attack-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tclock-speed: ~f~%" (-> this clock-speed)) + (format #t "~2Thud-timer: ~D~%" (-> this hud-timer)) + (format #t "~2Tcountdown-timer: ~D~%" (-> this countdown-timer)) + (label cfg-7) + this + ) + +;; definition for method 20 of type ctyport-attack-manager-bbush +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this ctyport-attack-manager-bbush)) + (local-vars (sv-96 res-tag)) + (let ((t9-0 (method-of-type task-manager init!))) + (t9-0 this) + ) + (set-setting! 'stop-boats? #t 0.0 0) + (set-setting! 'extra-bank '((ctywide2 cityff) (ctywide3 portatk1)) 0.0 0) + (set-setting! 'lock-sound-camera-to-target #t 0.0 0) + (set! (-> this hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to this)) + ) + (send-event (ppointer->process *time-of-day*) 'change 'hour 16) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (set! (-> this inactive-mine-list) (new 'process 'handle-array 80)) + (set! (-> this inactive-mine-list length) 0) + (set! (-> this clock-speed) 1.0) + (dotimes (s5-1 80) + (let ((v1-31 (process-spawn + ctyport-mine + :name "ctyport-mine" + :from (if (>= s5-1 40) + *port-attack-dead-pool* + *default-dead-pool* + ) + :to this + :stack-size 2048 + ) + ) + ) + (push-back (-> this inactive-mine-list) (process->handle (-> v1-31 0))) + ) + ) + (set! (-> this mine-layout) *ctyport-bbush-mine-positions*) + (set! sv-96 (new 'static 'res-tag)) + (let ((v1-40 (res-lump-data (entity-by-name "port-attack-bbush-1") 'actor-groups pointer :tag-ptr (& sv-96)))) + (cond + ((and v1-40 (nonzero? (-> sv-96 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-40)) + (set! (-> this actor-group-count) (the-as int (-> sv-96 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (dotimes (v1-46 (-> *ctyport-package-positions* length)) + (set! (-> *ctyport-attack-bbush-positions* v1-46 pos quad) (-> *ctyport-package-positions* v1-46 pos quad)) + (set! (-> *ctyport-attack-bbush-positions* v1-46 on-water?) (-> *ctyport-package-positions* v1-46 on-water?)) + ) + (set! (-> *ctyport-attack-bbush-positions* length) (-> *ctyport-package-positions* length)) + (when (-> this actor-group) + (let ((v1-53 0)) + (dotimes (a0-35 (-> this actor-group 0 length)) + (let ((a1-36 (-> this actor-group 0 data a0-35 actor))) + (when a1-36 + (set! (-> *ctyport-attack-bbush-positions* v1-53 pos quad) (-> a1-36 extra trans quad)) + (set! (-> *ctyport-attack-bbush-positions* v1-53 on-water?) #f) + (set! (-> *ctyport-attack-bbush-positions* v1-53 probe?) #t) + (+! v1-53 1) + ) + ) + ) + (set! (-> *ctyport-attack-bbush-positions* length) v1-53) + ) + ) + (set! (-> this package-positions) *ctyport-attack-bbush-positions*) + (dotimes (v1-55 (-> this mine-layout length)) + (set! (-> this mine-layout v1-55 active?) #f) + (dotimes (a0-42 (-> this mine-layout v1-55 num-mines)) + (set! (-> this mine-layout v1-55 stored-handles a0-42) (the-as handle #f)) + ) + ) + (none) + ) + +;; definition for method 50 of type ctyport-attack-manager-bbush +(defmethod play-speech ((this ctyport-attack-manager-bbush) (arg0 int)) + (let ((v1-0 arg0)) + (if (or (zero? v1-0) + (= v1-0 1) + (= v1-0 2) + (= v1-0 3) + (= v1-0 4) + (= v1-0 5) + (= v1-0 6) + (= v1-0 7) + (= v1-0 8) + (= v1-0 13) + ) + (the-as int #f) + (call-parent-method this arg0) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait (ctyport-attack-manager-bbush) + :virtual #t + :code (behavior () + (set-setting! 'board #f 0.0 0) + (send-event *target* 'end-mode 'board) + (suspend) + (while (or (not *target*) + (not *spawn-actors*) + (!= (status-of-level-and-borrows *level* 'lpatkcs #f) 'active) + (focus-test? *target* board) + ) + (if *target* + (process-grab? *target* #f) + ) + (suspend) + ) + (process-release? *target*) + (set-time-limit self) + (ctyport-attack-setup) + (set-setting! 'exclusive-load '((ignore all)) 0.0 0) + (let ((a1-7 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-7 9) #f) + (set! (-> a1-7 8) #f) + (set! (-> a1-7 7) #f) + (set! (-> a1-7 6) #f) + (set! (-> a1-7 5) #f) + (set! (-> a1-7 4) #f) + (set! (-> a1-7 3) #f) + (set! (-> a1-7 2) 'ctyinda) + (set! (-> a1-7 1) 'ctyport) + (set! (-> a1-7 0) 'ctywide-ff) + (want-levels *load-state* a1-7) + ) + (want-display-level *load-state* 'ctyport 'display) + (want-display-level *load-state* 'ctyinda 'display) + (set! (-> self current-package-index) 0) + (let* ((a0-15 *setting-control*) + (t9-11 (method-of-object a0-15 set-setting)) + (a2-5 'stop-boats?) + (a3-2 #t) + ) + (t9-11 a0-15 self a2-5 a3-2 0 0) + (let ((t9-12 kill-by-type) + (a0-16 barge) + (a1-11 *active-pool*) + ) + (t9-12 a0-16 a1-11) + (apply-settings *setting-control*) + (let* ((v1-34 (the-as entity-actor (entity-by-name "boat-manager-1"))) + (a0-19 (if v1-34 + (-> v1-34 extra process) + ) + ) + ) + (if a0-19 + (apply-alignment + (the-as process-focusable a0-19) + (the-as align-opts a1-11) + (the-as transformq a2-5) + (the-as vector a3-2) + ) + ) + ) + ) + ) + (ctyport-attack-manager-method-45 self) + (send-event *target* 'change-mode 'pilot-daxter (handle->process (-> self active-torpedo))) + (go-virtual pickup-nukes) + ) + ) + +;; definition for symbol *port-attack-bbush-fail-sphere*, type sphere +(define *port-attack-bbush-fail-sphere* (new 'static 'sphere :x 2651996.2 :y 31539.2 :z 5880709.0 :r 1.0)) + +;; definition for symbol *port-attack-bbush-fail-radius*, type float +(define *port-attack-bbush-fail-radius* 163840.0) + +;; failed to figure out what this is: +(defstate pickup-nukes (ctyport-attack-manager-bbush) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self countdown-timer) (the-as handle (current-time))) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (if (< (vector-vector-xz-distance (target-pos 0) *port-attack-bbush-fail-sphere*) *port-attack-bbush-fail-radius*) + (send-event self 'fail) + ) + (set! (-> *game-info* timer) (- (seconds 140) (- (current-time) (the-as int (-> self countdown-timer))))) + (if (<= (-> *game-info* timer) 0) + (send-event self 'fail) + ) + ) + ) + +;; failed to figure out what this is: +(defstate head-to-wall (ctyport-attack-manager-bbush) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + (set! (-> self state-time) (-> *display* game-clock frame-counter)) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (let ((f30-0 + (fmax + 0.0 + (fmin 1.0 (* 0.0022222223 (the float (- (-> *display* game-clock frame-counter) (-> self state-time))))) + ) + ) + ) + (set! (-> self clock-speed) (lerp 1.0 0.0 f30-0)) + (update-rates! (-> *display* entity-clock) (-> self clock-speed)) + (update-rates! (-> *display* target-clock) (-> self clock-speed)) + (set-setting! 'bg-r 'abs 1.0 0) + (set-setting! 'bg-g 'abs 1.0 0) + (set-setting! 'bg-b 'abs 1.0 0) + (set-setting! 'bg-a 'abs f30-0 0) + (when (= f30-0 1.0) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (let ((a1-10 (get-continue-by-name *game-info* "ctyport-bbush-port-4"))) + (when a1-10 + (start 'play a1-10) + (go-virtual wait-award) + ) + ) + ) + ) + ) + ) + +;; definition for method 51 of type ctyport-attack-manager-bbush +;; INFO: Used lq/sq +;; WARN: Return type mismatch quaternion vs object. +(defmethod ctyport-attack-manager-method-51 ((this ctyport-attack-manager-bbush) (arg0 traffic-object-spawn-params)) + (set! (-> arg0 position quad) (-> (new 'static 'vector :x 2492384.8 :y 34605.055 :z 6578958.5 :w 1.0) quad)) + (quaternion-copy! (-> arg0 rotation) (new 'static 'quaternion :x 0.0002 :y 0.6305 :z 0.0011 :w -0.7761)) + (let ((v1-1 (the-as entity-actor (entity-by-name "port-attack-bbush-1")))) + (when v1-1 + (set! (-> arg0 position quad) (-> v1-1 extra trans quad)) + (quaternion-copy! (-> arg0 rotation) (-> v1-1 quat)) + ) + ) + ) + +;; definition for method 25 of type ctyport-attack-manager-bbush +(defmethod task-manager-method-25 ((this ctyport-attack-manager-bbush)) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate wait-award (ctyport-attack-manager-bbush) + :virtual #t + :event task-manager-event-handler + :code (behavior () + (while (or (not *target*) (not *spawn-actors*) (not (entity-by-name "burning-bush-36"))) + (if *target* + (process-grab? *target* #f) + ) + (suspend) + ) + (remove-setting! 'bg-r) + (remove-setting! 'bg-g) + (remove-setting! 'bg-b) + (remove-setting! 'bg-a) + (remove-setting! 'music) + (until (process-grab? *target* #f) + (suspend) + ) + (until (= (-> *setting-control* user-current bg-a) 0.0) + (suspend) + ) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (process-release? *target*) + (suspend) + ) + (send-event self 'complete) + (sleep-code) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc new file mode 100644 index 0000000000..758bcd8d9a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc @@ -0,0 +1,3307 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *ctyport-attack-speech-list*, type (inline-array talker-speech-class) +(define *ctyport-attack-speech-list* (new 'static 'inline-array talker-speech-class 49 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "torn208" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn209" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn210" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn211" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn212" + :channel (gui-channel voicebox) + :speech #x5 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn213" + :channel (gui-channel voicebox) + :speech #x6 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn214" + :channel (gui-channel voicebox) + :speech #x7 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn215" + :channel (gui-channel voicebox) + :speech #x8 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn216" + :channel (gui-channel voicebox) + :speech #x9 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn217" + :channel (gui-channel voicebox) + :speech #xa + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn218" + :channel (gui-channel voicebox) + :speech #xb + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn219" + :channel (gui-channel voicebox) + :speech #xc + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn220" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #xd + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn221" + :channel (gui-channel voicebox) + :flags (talker-flags tf0) + :speech #xe + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn222" + :channel (gui-channel voicebox) + :speech #xf + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn223" + :channel (gui-channel voicebox) + :speech #x10 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn224" + :channel (gui-channel voicebox) + :speech #x11 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn225" + :channel (gui-channel voicebox) + :speech #x12 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "torn226" + :channel (gui-channel voicebox) + :speech #x13 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax552" + :channel (gui-channel daxter) + :speech #x14 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax553" + :channel (gui-channel daxter) + :speech #x15 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax554" + :channel (gui-channel daxter) + :speech #x16 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax555" + :channel (gui-channel daxter) + :speech #x17 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax556" + :channel (gui-channel daxter) + :speech #x18 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax557" + :channel (gui-channel daxter) + :speech #x19 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax558" + :channel (gui-channel daxter) + :speech #x1a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax559" + :channel (gui-channel daxter) + :speech #x1b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax560" + :channel (gui-channel daxter) + :speech #x1c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax561" + :channel (gui-channel daxter) + :speech #x1d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax562" + :channel (gui-channel daxter) + :speech #x1e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax563" + :channel (gui-channel daxter) + :speech #x1f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax564" + :channel (gui-channel daxter) + :speech #x20 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax565" + :channel (gui-channel daxter) + :speech #x21 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax566" + :channel (gui-channel daxter) + :speech #x22 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax567" + :channel (gui-channel daxter) + :speech #x23 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax568" + :channel (gui-channel daxter) + :speech #x24 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax569" + :channel (gui-channel daxter) + :speech #x25 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax570" + :channel (gui-channel daxter) + :speech #x26 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax571" + :channel (gui-channel daxter) + :speech #x27 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax572" + :channel (gui-channel daxter) + :speech #x28 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax573" + :channel (gui-channel daxter) + :speech #x29 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax574" + :channel (gui-channel daxter) + :speech #x2a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax575" + :channel (gui-channel daxter) + :speech #x2b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax576" + :channel (gui-channel daxter) + :speech #x2c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax577" + :channel (gui-channel daxter) + :speech #x2d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax578" + :channel (gui-channel daxter) + :speech #x2e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax579" + :channel (gui-channel daxter) + :speech #x2f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "port-attack-jump-hint" + :channel (gui-channel message) + :flags (talker-flags tf0) + :speech #x30 + :text-duration (seconds 3) + :neg #x1 + :text-message (text-id text-0408) + :on-close #f + :camera #f + ) + ) + ) + +;; definition of type port-attack-speech-instance +(deftype port-attack-speech-instance (speech-instance) + () + ) + +;; definition for method 3 of type port-attack-speech-instance +(defmethod inspect ((this port-attack-speech-instance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'port-attack-speech-instance) + (format #t "~1Tspeech: ~D~%" (-> this speech)) + (format #t "~1Tnum-play-times: ~D~%" (-> this num-play-times)) + (format #t "~1Tprobability: ~f~%" (-> this probability)) + (label cfg-4) + this + ) + +;; definition for symbol *port-attack-speech*, type (array speech-info) +(define *port-attack-speech* + (new 'static 'boxed-array :type speech-info + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x1 :probability 1.0)) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x2 :probability 1.0)) + :flags (speech-info-flag si0 si3) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #xe :probability 1.0) + (new 'static 'speech-instance :speech #xd :probability 1.0) + ) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x3 :probability 1.0) + (new 'static 'speech-instance :speech #x16 :probability 1.0) + ) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x4 :probability 1.0) + (new 'static 'speech-instance :speech #x18 :probability 1.0) + ) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x5 :probability 1.0) + (new 'static 'speech-instance :speech #xf :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x7 :probability 1.0)) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x6 :probability 1.0) + (new 'static 'speech-instance :speech #x17 :probability 1.0) + ) + :flags (speech-info-flag si0) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x11 :probability 1.0)) + :flags (speech-info-flag si0 si4) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x9 :probability 1.0) + (new 'static 'speech-instance :speech #xa :probability 1.0) + (new 'static 'speech-instance :speech #x10 :probability 1.0) + (new 'static 'speech-instance :speech #x13 :probability 1.0) + (new 'static 'speech-instance :speech #x15 :probability 1.0) + (new 'static 'speech-instance :speech #x2d :probability 1.0) + ) + :flags (speech-info-flag si4) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x1b :probability 1.0) + (new 'static 'speech-instance :speech #x1c :probability 1.0) + (new 'static 'speech-instance :speech #x1e :probability 1.0) + (new 'static 'speech-instance :speech #x24 :probability 1.0) + (new 'static 'speech-instance :speech #x25 :probability 1.0) + (new 'static 'speech-instance :speech #x26 :probability 1.0) + (new 'static 'speech-instance :speech #x2a :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x1f :probability 1.0) + (new 'static 'speech-instance :speech #x20 :probability 1.0) + (new 'static 'speech-instance :speech #x22 :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x27 :probability 1.0) + (new 'static 'speech-instance :speech #x2b :probability 1.0) + (new 'static 'speech-instance :speech #x28 :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x30 :probability 1.0)) + ) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-nuke-fuel + :id 530 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 2082 :flags (sp7)) + (sp-item 2083 :flags (sp7)) + (sp-item 2084 :flags (sp7)) + (sp-item 2085 :flags (sp7)) + (sp-item 2086 :flags (sp3) :binding 2078) + (sp-item 2078 :flags (sp2) :binding 2079) + (sp-item 2086 :flags (sp3) :binding 2080) + (sp-item 2080 :flags (sp2) :binding 2079) + (sp-item 2086 :flags (sp3) :binding 2081) + (sp-item 2081 :flags (sp2) :binding 2079) + (sp-item 2079 :flags (sp2)) + (sp-item 2079 :flags (sp2)) + (sp-item 2079 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 2082 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 40.0 20.0) + (:b 0.0) + (:a 60.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2083 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 30.0) + (:b 0.0) + (:a 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2084 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 9)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 30.0) + (:b 0.0) + (:a 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2086 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 80.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2078 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.016) + (:y (meters 2)) + (:z (meters 4)) + (:scale-x (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds 1)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2080 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.016) + (:y (meters -2)) + (:z (meters 4)) + (:scale-x (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 128.0) + (:omega (degrees 45)) + (:vel-x (meters -0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds 1)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2081 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.016) + (:z (meters 4)) + (:scale-x (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 128.0) + (:omega (degrees 90)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds 1)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2079 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.0) + (:fade-a -1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 2085 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.06 0.06) + (:scale-x (meters 4) (meters 6.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.3)) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.0033333334) (meters 0.0033333334)) + (:scalevel-y (meters 0) (meters 0.00033333333)) + (:fade-a 0.42666668) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 2087) + ) + ) + +;; failed to figure out what this is: +(defpart 2087 + :init-specs ((:scalevel-y (meters -0.0013333333) (meters 0.002)) (:fade-a -0.42666668)) + ) + +;; failed to figure out what this is: +(defpartgroup group-fuel-pickup-pop + :id 531 + :duration (seconds 2) + :linger-duration (seconds 2) + :flags (sp0 sp4 sp12) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 2090 :period (seconds 2) :length (seconds 0.017)) + (sp-item 2091 :period (seconds 2) :length (seconds 0.017) :binding 2088) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2088 :flags (sp2) :binding 2089) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + (sp-item 2089 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 2090 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 64.0) + (:a 128.0) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.05)) + (:next-launcher 2092) + ) + ) + +;; failed to figure out what this is: +(defpart 2092 + :init-specs ((:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.6571429) + (:fade-g -1.8285714) + (:fade-b -1.8285714) + ) + ) + +;; failed to figure out what this is: +(defpart 2091 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.001)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:func 'spt-func-relative-pos) + ) + ) + +;; failed to figure out what this is: +(defpart 2088 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 16.0) + (:y (meters -4) (meters 16)) + (:scale-x (meters 1.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 1 (meters 0.035555556)) + (:vel-z (meters 0.08)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.467)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 ready-to-launch)) + (:func 'spt-func-relative-pos) + ) + ) + +;; failed to figure out what this is: +(defpart 2089 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters -0.002)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334 -0.13333334) + (:accel-y (meters -0.00066666666)) + (:friction 0.6 0.3) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'spt-func-relative-pos) + ) + ) + +;; definition (perm) for symbol *port-attack-dead-pool*, type dead-pool +(define-perm *port-attack-dead-pool* dead-pool #f) + +;; definition of type ctyport-mine-layout +(deftype ctyport-mine-layout (structure) + ((mine-type mine-type) + (num-mines int8) + (inout? symbol) + (spin? symbol) + (active? symbol) + (checked-this-frame? symbol) + (origin vector :inline) + (secondary-pos vector :inline) + (initial-angle float) + (spacing float) + (spinrate float) + (period float) + (offset float) + (stored-handles (pointer handle)) + ) + ) + +;; definition for method 3 of type ctyport-mine-layout +(defmethod inspect ((this ctyport-mine-layout)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctyport-mine-layout) + (format #t "~1Tmine-type: ~D~%" (-> this mine-type)) + (format #t "~1Tnum-mines: ~D~%" (-> this num-mines)) + (format #t "~1Tinout?: ~A~%" (-> this inout?)) + (format #t "~1Tspin?: ~A~%" (-> this spin?)) + (format #t "~1Tactive?: ~A~%" (-> this active?)) + (format #t "~1Tchecked-this-frame?: ~A~%" (-> this checked-this-frame?)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tsecondary-pos: #~%" (-> this secondary-pos)) + (format #t "~1Tinitial-angle: ~f~%" (-> this initial-angle)) + (format #t "~1Tspacing: ~f~%" (-> this spacing)) + (format #t "~1Tspinrate: ~f~%" (-> this spinrate)) + (format #t "~1Tperiod: ~f~%" (-> this period)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tstored-handles: #x~X~%" (-> this stored-handles)) + (label cfg-4) + this + ) + +;; definition of type ctyport-attack-package-info +(deftype ctyport-attack-package-info (structure) + ((pos vector :inline) + (locked? symbol) + (on-water? symbol) + (probe? symbol) + ) + ) + +;; definition for method 3 of type ctyport-attack-package-info +(defmethod inspect ((this ctyport-attack-package-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ctyport-attack-package-info) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tlocked?: ~A~%" (-> this locked?)) + (format #t "~1Ton-water?: ~A~%" (-> this on-water?)) + (format #t "~1Tprobe?: ~A~%" (-> this probe?)) + (label cfg-4) + this + ) + +;; definition of type ctyport-attack-hud +(deftype ctyport-attack-hud (hud) + ((pos-tt float) + (tt-current float) + (tt-prev float) + (tt-next float) + (spike-time time-frame) + ) + ) + +;; definition for method 3 of type ctyport-attack-hud +(defmethod inspect ((this ctyport-attack-hud)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (format #t "~2Tpos-tt: ~f~%" (-> this pos-tt)) + (format #t "~2Ttt-current: ~f~%" (-> this tt-current)) + (format #t "~2Ttt-prev: ~f~%" (-> this tt-prev)) + (format #t "~2Ttt-next: ~f~%" (-> this tt-next)) + (format #t "~2Tspike-time: ~D~%" (-> this spike-time)) + (label cfg-4) + this + ) + +;; definition of type ctyport-attack-manager +(deftype ctyport-attack-manager (task-manager) + ((active-torpedo handle) + (inactive-mine-list handle-array) + (mine-clock time-frame) + (current-package-index int16) + (rod-of-god handle) + (wall-h handle) + (passed-cutscene-trigger? symbol) + (finish-type (array type)) + (mine-layout (array ctyport-mine-layout)) + (package-positions (array ctyport-attack-package-info)) + (h-hud handle) + ) + (:state-methods + pickup-nukes + head-to-wall + undefined0 + watch-approach + nuke-wall + wait-for-cleanup + start-mission + get-on-nuke + exit-naughty-ottsel + play-get-on-movie + ) + (:methods + (ctyport-attack-manager-method-42 (_type_ ctyport-mine-layout) symbol) + (ctyport-attack-manager-method-43 (_type_ ctyport-mine-layout) symbol) + (ctyport-attack-manager-method-44 (_type_ ctyport-mine-layout) symbol) + (ctyport-attack-manager-method-45 (_type_) handle) + (ctyport-attack-manager-method-46 (_type_) float) + (hit-cutscene-trigger? (_type_) symbol) + (ctyport-attack-manager-method-48 (_type_ int) object) + (ctyport-attack-manager-method-49 (_type_) int) + (play-speech (_type_ int) int) + (ctyport-attack-manager-method-51 (_type_ traffic-object-spawn-params) object) + ) + ) + +;; definition for method 3 of type ctyport-attack-manager +(defmethod inspect ((this ctyport-attack-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tactive-torpedo: ~D~%" (-> this active-torpedo)) + (format #t "~2Tinactive-mine-list: ~A~%" (-> this inactive-mine-list)) + (format #t "~2Tmine-clock: ~D~%" (-> this mine-clock)) + (format #t "~2Tcurrent-package-index: ~D~%" (-> this current-package-index)) + (format #t "~2Trod-of-god: ~D~%" (-> this rod-of-god)) + (format #t "~2Twall-h: ~D~%" (-> this wall-h)) + (format #t "~2Tpassed-cutscene-trigger?: ~A~%" (-> this passed-cutscene-trigger?)) + (format #t "~2Tfinish-type: ~A~%" (-> this finish-type)) + (format #t "~2Tmine-layout: ~A~%" (-> this mine-layout)) + (format #t "~2Tpackage-positions: ~A~%" (-> this package-positions)) + (format #t "~2Th-hud: ~D~%" (-> this h-hud)) + (label cfg-4) + this + ) + +;; definition for function ctyport-attack-manager-event-handler +(defbehavior ctyport-attack-manager-event-handler ctyport-attack-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (taskman-event-handler self arg0 arg1 arg2 arg3) + ) + +;; definition of type ctyport-mine +(deftype ctyport-mine (process-drawable) + ((root collide-shape :override) + (bob-scalar float) + (last-play-time time-frame) + ) + (:state-methods + hidden + idle + menacing + ) + (:methods + (update (_type_ float) float) + ) + ) + +;; definition for method 3 of type ctyport-mine +(defmethod inspect ((this ctyport-mine)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tbob-scalar: ~f~%" (-> this bob-scalar)) + (format #t "~2Tlast-play-time: ~D~%" (-> this last-play-time)) + (label cfg-4) + this + ) + +;; definition for function classify-mine-layout +(defun classify-mine-layout () + (math-camera-matrix) + 1 + ) + +;; definition for symbol *recorded-pos*, type (inline-array vector) +(define *recorded-pos* (new 'static 'inline-array vector 100 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + +;; definition for symbol *recorded-length*, type int +(define *recorded-length* 0) + +;; definition for function record-pos +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun record-pos () + (when (cpad-pressed? 0 r1) + (set! (-> *recorded-pos* *recorded-length* quad) (-> (target-pos 0) quad)) + (set! *recorded-length* (+ *recorded-length* 1)) + ) + (none) + ) + +;; definition for function print-record-pos +;; WARN: Return type mismatch symbol vs none. +(defun print-record-pos () + (dotimes (gp-0 *recorded-length*) + (format 0 "~m ~m ~m~%" (-> *recorded-pos* gp-0 x) (-> *recorded-pos* gp-0 y) (-> *recorded-pos* gp-0 z)) + ) + (none) + ) + +;; definition for symbol *ctyport-mine-positions*, type (array ctyport-mine-layout) +(define *ctyport-mine-positions* + (new 'static 'boxed-array :type ctyport-mine-layout + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -466699.88 :z 7545836.5) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 5 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -384163.84 :z 7424286.5) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -229376.0 :z 7364608.0) + :initial-angle 24576.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -98304.0 :z 6156288.0) + :initial-angle 8192.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1515520.0 :z 6443008.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1515520.0 :z 6299648.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1024000.0 :z 6410240.0) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x -184320.0 :z 6348800.0) + :initial-angle 30037.334 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 3 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 348160.0 :z 5816320.0) + :initial-angle 18204.445 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 6 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 688128.0 :z 5763072.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 7 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1560576.0 :z 5939200.0) + :initial-angle 57344.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 8 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 4 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1478656.0 :z 5840896.0) + :initial-angle 8192.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 4 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1372160.0 :z 6758400.0) + :initial-angle 16384.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 4 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 2060288.0 :z 6434816.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1937408.0 :z 6361088.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 1 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1880064.0 :z 6512640.0) + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 2 (new 'static 'handle) (new 'static 'handle)) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1085440.0 :z 7430144.0) + :initial-angle 49152.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + (new 'static 'ctyport-mine-layout + :num-mines 5 + :inout? #f + :spin? #f + :active? #f + :origin (new 'static 'vector :x 1355776.0 :z 7655424.0) + :initial-angle 49152.0 + :spacing 24576.0 + :spinrate 10922.667 + :period 3000.0 + :stored-handles (new 'static 'array handle 6 + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + (new 'static 'handle) + ) + ) + ) + ) + +;; definition for symbol *ctyport-package-positions*, type (array ctyport-attack-package-info) +(define *ctyport-package-positions* (new 'static 'boxed-array :type ctyport-attack-package-info + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 176601.5 :y 9759.949 :z 5997813.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 794268.06 :y 11748.967 :z 6622295.0 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1978120.6 :y 45374.258 :z 6765555.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 2511750.0 :y 43253.76 :z 6474803.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 2282202.8 :y 51744.77 :z 5972653.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1543227.0 :y 43601.92 :z 5386458.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1016602.6 :y 3454.5664 :z 5883377.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 394521.0 :y 43427.02 :z 7135567.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 535983.3 :y 12885.606 :z 7634002.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1529036.0 :y 11782.144 :z 7476193.0 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1898319.9 :y 44371.56 :z 6786346.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1798895.6 :y 43897.242 :z 5534053.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 680631.94 :y 11468.8 :z 5853921.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -29300.326 :y 11419.238 :z 5714965.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -724783.1 :y 66355.2 :z 5979098.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -660525.06 :y 11522.867 :z 6854534.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 397337.4 :y 43441.355 :z 7084683.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 911933.44 :y 82042.88 :z 7137771.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1371545.6 :y 43990.63 :z 6956851.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1733304.4 :y 17202.791 :z 6412861.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1415546.9 :y 11537.613 :z 5855169.5 :w 1.0) + :locked? #t + :on-water? #t + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 836484.3 :y 43537.613 :z 5581822.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -100679.27 :y 10898.228 :z 5999107.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x -220959.55 :y 7761.1006 :z 7171646.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 766397.25 :y 11571.2 :z 7237588.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 1560256.9 :y 11873.895 :z 6397272.5 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + (new 'static 'ctyport-attack-package-info + :pos (new 'static 'vector :x 2526945.2 :y 43130.88 :z 5991219.0 :w 1.0) + :locked? #t + :on-water? #f + :probe? #f + ) + ) + ) + +;; definition for symbol *ctyport-barrier-pos*, type vector +(define *ctyport-barrier-pos* (new 'static 'vector :x 3039846.5 :y 17735.68 :z 5309112.5 :w 1.0)) + +;; definition for function get-ctyport-attack-death-count +(defun get-ctyport-attack-death-count () + (let* ((gp-0 #t) + (v1-0 (cond + ((task-node-closed? (game-task-node city-port-attack-mission)) + 129 + ) + ((not (task-node-closed? (game-task-node city-port-attack-mission))) + 128 + ) + (else + (set! gp-0 #f) + 128 + ) + ) + ) + (v0-2 0) + ) + (if gp-0 + (set! v0-2 (the-as int (-> *game-info* sub-task-list v1-0 death-count))) + ) + v0-2 + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctyport-mine cty-port-mine cty-port-mine-lod0-jg cty-port-mine-idle-ja + ((cty-port-mine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12.5) + ) + +;; definition for function ctyport-mine-init-by-other +(defbehavior ctyport-mine-init-by-other ctyport-mine () + (stack-size-set! (-> self main-thread) 32) + (let ((gp-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> gp-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> gp-0 reaction) cshape-reaction-default) + (set! (-> gp-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid deadly)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 14745.601) + (set! (-> gp-0 total-prims) (the-as uint 1)) + (set! (-> gp-0 root-prim) v1-8) + ) + (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) + (let ((v1-11 (-> gp-0 root-prim))) + (set! (-> gp-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> gp-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> gp-0 event-self) 'touched) + (set! (-> self root) gp-0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self mask) (process-mask crate)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyport-mine" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> self root scale) 2.0 2.0 2.0 1.0) + (let* ((f30-0 819.2) + (f28-0 819.2) + (v1-26 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-27 (the-as number (logior #x3f800000 v1-26))) + ) + (set! (-> self bob-scalar) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-27))))) + ) + (let* ((gp-2 quaternion-rotate-x!) + (s5-1 (-> self root quat)) + (s4-0 (-> self root quat)) + (f30-1 2730.6667) + (v1-33 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-34 (the-as number (logior #x3f800000 v1-33))) + ) + (gp-2 s5-1 s4-0 (* f30-1 (+ -1.0 (the-as float v1-34)))) + ) + (let* ((gp-3 quaternion-rotate-z!) + (s5-2 (-> self root quat)) + (s4-1 (-> self root quat)) + (f30-2 2730.6667) + (v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + ) + (gp-3 s5-2 s4-1 (* f30-2 (+ -1.0 (the-as float v1-41)))) + ) + (let* ((gp-4 quaternion-rotate-y!) + (s5-3 (-> self root quat)) + (s4-2 (-> self root quat)) + (f30-3 65536.0) + (v1-47 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-48 (the-as number (logior #x3f800000 v1-47))) + ) + (gp-4 s5-3 s4-2 (* f30-3 (+ -1.0 (the-as float v1-48)))) + ) + (set! (-> self draw lod-set lod 0 dist) 1638400.0) + (set! (-> self draw lod-set lod 1 dist) 1638400.0) + (go-virtual hidden) + ) + +;; failed to figure out what this is: +(defstate hidden (ctyport-mine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('activate) + (let ((v1-1 (the-as object (-> block param 0)))) + (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual idle) + #t + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + (send-event (ppointer->process (-> self parent)) 'hidden (process->handle self)) + (logior! (-> self mask) (process-mask actor-pause)) + ) + :code sleep-code + ) + +;; definition for method 23 of type ctyport-mine +(defmethod update ((this ctyport-mine) (arg0 float)) + (when (>= (+ (current-time) (seconds -0.5)) (-> this last-play-time)) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (target-pos 0))) + (f1-0 491520.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (sound-play "port-mine-flash" :position (-> this root trans)) + ) + ) + (set-time! (-> this last-play-time)) + ) + (let* ((f0-1 (vector-length (-> this root trans))) + (f1-3 122880.0) + (f0-3 (/ (- f0-1 (* (the float (the int (/ f0-1 f1-3))) f1-3)) f1-3)) + (f1-4 600.0) + ) + 0.0 + (let* ((f2-6 (the float (current-time))) + (f0-4 (+ f0-3 (/ (- f2-6 (* (the float (the int (/ f2-6 f1-4))) f1-4)) f1-4))) + ) + (set! (-> this root trans y) (* (cos (* 65536.0 f0-4)) (-> this bob-scalar) arg0)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (ctyport-mine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hide) + (go-virtual hidden) + ) + (('menace) + (go-virtual menacing) + ) + (('activate) + (let ((v1-5 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-5) quad)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (update self 1.0) + ) + :code transform-and-sleep-code + :post (behavior () + (transform-post) + ) + ) + +;; failed to figure out what this is: +(defstate menacing (ctyport-mine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hide) + (go-virtual hidden) + ) + (('activate) + (let ((v1-3 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-3) quad)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (update self 2.0) + ) + :code transform-and-sleep-code + :post (behavior () + (transform-post) + ) + ) + +;; definition for method 20 of type ctyport-attack-manager +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this ctyport-attack-manager)) + (call-parent-method this) + (speeches-reset *port-attack-speech*) + (send-event (ppointer->process *time-of-day*) 'change 'hour 17) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.1) + (set! (-> this passed-cutscene-trigger?) #f) + (set! (-> this inactive-mine-list) (new 'process 'handle-array 80)) + (set! (-> this inactive-mine-list length) 0) + (set-setting! 'extra-bank '((ctywide2 cityff) (ctywide3 portatk1)) 0.0 0) + (set-setting! 'lock-sound-camera-to-target #t 0.0 0) + (set-setting! 'disable-parking-spots? #t 0.0 0) + (dotimes (s5-0 80) + (let ((v1-25 (process-spawn + ctyport-mine + :name "ctyport-mine" + :from (if (>= s5-0 40) + *port-attack-dead-pool* + *default-dead-pool* + ) + :to this + :stack-size 2048 + ) + ) + ) + (push-back (-> this inactive-mine-list) (process->handle (-> v1-25 0))) + ) + ) + (set! (-> this mine-layout) *ctyport-mine-positions*) + (set! (-> this package-positions) *ctyport-package-positions*) + (dotimes (v1-34 (-> this mine-layout length)) + (set! (-> this mine-layout v1-34 active?) #f) + (dotimes (a0-19 (-> this mine-layout v1-34 num-mines)) + (set! (-> this mine-layout v1-34 stored-handles a0-19) (the-as handle #f)) + ) + ) + (none) + ) + +;; definition for method 21 of type ctyport-attack-manager +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this ctyport-attack-manager)) + (set-setting! 'rain 'abs 0.0 0) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.0 0.0 0.0) + (set-time-for-random-weather! *mood-control* 100000000.0 100000000.0) + (set-setting! 'city-sound '(portatk1) 0.0 2) + (set-setting! 'exclusive-task #f 0.0 (-> this node-info task)) + 0 + (none) + ) + +;; definition for method 7 of type ctyport-attack-manager +(defmethod relocate ((this ctyport-attack-manager) (offset int)) + (if (nonzero? (-> this inactive-mine-list)) + (&+! (-> this inactive-mine-list) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 30 of type ctyport-attack-manager +;; INFO: Used lq/sq +(defmethod taskman-event-handler ((this ctyport-attack-manager) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('pickup) + (+! (-> this current-package-index) 1) + (cond + ((= (-> this current-package-index) 1) + (play-speech this 4) + ) + ((= (-> this current-package-index) 2) + (process-spawn-function + process + (lambda :behavior process + () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.75)) + (suspend) + ) + ) + (let ((a0-0 (ppointer->process (-> self parent)))) + (if a0-0 + (play-speech (the-as ctyport-attack-manager a0-0) 13) + ) + ) + ) + :to this + ) + ) + ((= (-> this current-package-index) (+ (-> this package-positions length) -9)) + (play-speech this 6) + ) + ((= (-> this current-package-index) (+ (-> this package-positions length) -1)) + (play-speech this 7) + ) + ((= (-> this current-package-index) (-> this package-positions length)) + ) + ((and (or (not (logtest? (-> *port-attack-speech* 9 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 9 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 9 play-time) (seconds 10)) + ) + ) + (or (not (logtest? (-> *port-attack-speech* 10 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 10 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 10 play-time) (seconds 4)) + ) + ) + (and (zero? (mod (the-as int (rand-uint31-gen *random-generator*)) 3)) + (< (-> this current-package-index) (+ (-> this package-positions length) -3)) + (< 3 (-> this current-package-index)) + ) + ) + (play-speech this 9) + ) + ) + (set-time! (-> *port-attack-speech* 4 play-time)) + (send-event (handle->process (-> this active-torpedo)) 'boost #x45800000) + (if (< 13 (-> this current-package-index)) + (task-node-close! (game-task-node city-port-attack-mission) 'event) + ) + (cond + ((< (-> this current-package-index) (-> this package-positions length)) + (ctyport-attack-manager-method-45 this) + ) + (else + (let ((a0-42 *ctyport-barrier-pos*) + (s5-1 (new 'stack-no-clear 'task-arrow-params)) + ) + (set! (-> s5-1 pos quad) (-> a0-42 quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags)) + (set! (-> s5-1 map-icon) (the-as uint 12)) + (logior! (-> s5-1 flags) (task-arrow-flags taf3)) + (let ((v0-0 (the-as object (process->handle (task-arrow-spawn s5-1 this))))) + (set! (-> this rod-of-god) (the-as handle v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition of type ctyport-attack-package +(deftype ctyport-attack-package (process-drawable) + ((hum-sound sound-id) + ) + (:state-methods + idle + die + ) + ) + +;; definition for method 3 of type ctyport-attack-package +(defmethod inspect ((this ctyport-attack-package)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Thum-sound: ~D~%" (-> this hum-sound)) + (label cfg-4) + this + ) + +;; definition for function ctyport-attack-package-init-by-other +;; INFO: Used lq/sq +(defbehavior ctyport-attack-package-init-by-other ctyport-attack-package ((arg0 vector)) + (stack-size-set! (-> self main-thread) 128) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self hum-sound) (new-sound-id)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 530) self)) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defstate idle (ctyport-attack-package) + :virtual #t + :trans (behavior () + (let ((f30-0 (vector-vector-xz-distance (-> self root trans) (target-pos 0)))) + (if (< f30-0 245760.0) + (sound-play "rocket-pill" :id (-> self hum-sound) :position (-> self root trans)) + ) + (let* ((f1-0 (lerp-scale-clamp 0.0 1.0 f30-0 204800.0 819200.0)) + (f28-0 (fmax 0.0 (fmin 1.0 f1-0))) + (gp-1 (-> self child)) + ) + (while gp-1 + (send-event (ppointer->process gp-1) 'set-alpha f28-0) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (spawn (-> self part) (-> self root trans)) + (when *target* + (let* ((f26-0 (the float (get-ctyport-attack-death-count))) + (f28-1 (lerp-scale-clamp 61440.0 90112.0 f26-0 5.0 15.0)) + ) + (when (and (>= (lerp-scale-clamp 28672.0 40960.0 f26-0 5.0 15.0) f30-0) + (>= f28-1 (- (-> (target-pos 0) y) (-> self root trans y))) + (>= 16384.0 (- (-> self root trans y) (-> (target-pos 0) y))) + ) + (sound-play "rocket-pickup" :position (target-pos 0)) + (send-event (ppointer->process (-> self parent)) 'notify 'pickup) + (let* ((a0-19 *screen-filter*) + (t9-15 (method-of-object a0-19 setup)) + (a1-9 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-9 x) 128.0) + (set! (-> a1-9 y) 128.0) + (set! (-> a1-9 z) 128.0) + (set! (-> a1-9 w) 128.0) + (let ((a2-5 (new 'stack-no-clear 'vector))) + (set! (-> a2-5 x) 128.0) + (set! (-> a2-5 y) 128.0) + (set! (-> a2-5 z) 128.0) + (set! (-> a2-5 w) 0.0) + (t9-15 a0-19 a1-9 a2-5 (* 2.0 (seconds-per-frame)) (bucket-id tex-hud-pris2) #x3fffff #x33001 #f) + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate die (ctyport-attack-package) + :virtual #t + :code (behavior () + (sound-stop (-> self hum-sound)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (disable *screen-filter*) + (deactivate self) + ) + ) + +;; definition for method 45 of type ctyport-attack-manager +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs handle. +(defmethod ctyport-attack-manager-method-45 ((this ctyport-attack-manager)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this package-positions (-> this current-package-index) pos quad)) + (let ((s4-0 (process-spawn ctyport-attack-package s5-0 :name "ctyport-attack-package" :to this)) + (s3-1 (new 'stack-no-clear 'task-arrow-params)) + ) + (if (-> this package-positions (-> this current-package-index) on-water?) + (set! (-> s5-0 y) 0.0) + ) + (when (-> this package-positions (-> this current-package-index) probe?) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-21 (new 'stack-no-clear 'vector))) + (set! (-> v1-21 quad) (-> s5-0 quad)) + (vector+float*! (-> s2-0 start-pos) v1-21 *up-vector* 24576.0) + ) + (set! (-> s2-0 move-dist quad) (the-as uint128 0)) + (set! (-> s2-0 move-dist y) -163840.0) + (let ((v1-24 s2-0)) + (set! (-> v1-24 radius) 40.96) + (set! (-> v1-24 collide-with) (collide-spec backgnd)) + (set! (-> v1-24 ignore-process0) #f) + (set! (-> v1-24 ignore-process1) #f) + (set! (-> v1-24 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-24 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) + (set! (-> s5-0 y) (-> s2-0 best-other-tri intersect y)) + (set! (-> s5-0 y) 0.0) + ) + ) + ) + (set! (-> s3-1 pos quad) (-> s5-0 quad)) + (quaternion-identity! (-> s3-1 quat)) + (set! (-> s3-1 flags) (task-arrow-flags)) + (set! (-> s3-1 map-icon) (the-as uint 13)) + (logior! (-> s3-1 flags) (task-arrow-flags taf3)) + (let ((v0-6 (process->handle (task-arrow-spawn s3-1 (-> s4-0 0))))) + (set! (-> this rod-of-god) (the-as handle v0-6)) + (the-as handle v0-6) + ) + ) + ) + ) + +;; definition for method 51 of type ctyport-attack-manager +;; INFO: Used lq/sq +(defmethod ctyport-attack-manager-method-51 ((this ctyport-attack-manager) (arg0 traffic-object-spawn-params)) + (cond + ((task-node-closed? (game-task-node city-port-attack-mission)) + (set! (-> arg0 position quad) (-> (new 'static 'vector :x -197263.36 :y 52101.12 :z 5516165.0 :w 1.0) quad)) + (quaternion-identity! (-> arg0 rotation)) + (quaternion-rotate-y! (-> arg0 rotation) (-> arg0 rotation) -9102.223) + ) + (else + (set! (-> arg0 position quad) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans quad)) + (quaternion-copy! + (-> arg0 rotation) + (-> (the-as entity-actor (entity-by-name "cty-dax-missile-launcher-1")) quat) + ) + (set! (-> arg0 position y) (+ 8192.0 (-> arg0 position y))) + ) + ) + ) + +;; definition for function ctyport-attack-setup +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior ctyport-attack-setup ctyport-attack-manager () + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (ctyport-attack-manager-method-51 self gp-0) + (set! (-> gp-0 velocity quad) (the-as uint128 0)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (let ((s5-0 (get-process *default-dead-pool* htorpedo #x4000 1))) + (set! (-> self active-torpedo) + (process->handle + (-> (when s5-0 + (let ((t9-3 (method-of-type htorpedo activate))) + (t9-3 (the-as htorpedo s5-0) *vehicle-manager* "torpedo" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 vehicle-init-by-other 2 gp-0) + (-> s5-0 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (set! (-> self rod-of-god) (the-as handle #f)) + (set-time! (-> self state-time)) + (set-time! (-> self mine-clock)) + (dotimes (v1-15 (-> self mine-layout length)) + (set! (-> self mine-layout v1-15 active?) #f) + ) + (suspend) + (dotimes (gp-1 (-> self mine-layout length)) + (let ((s5-1 (-> self mine-layout gp-1))) + (cond + ((-> s5-1 active?) + (cond + ((zero? (classify-mine-layout)) + (ctyport-attack-manager-method-42 self s5-1) + ) + (else + (if (or (-> s5-1 spin?) (-> s5-1 inout?)) + (ctyport-attack-manager-method-44 self s5-1) + ) + ) + ) + ) + (else + (set! (-> s5-1 checked-this-frame?) #f) + ) + ) + ) + ) + (when (> (-> self inactive-mine-list length) 0) + (dotimes (gp-2 (-> self mine-layout length)) + (let ((s5-2 (-> self mine-layout gp-2))) + (when (and (not (-> s5-2 active?)) + (not (-> s5-2 checked-this-frame?)) + (>= (-> self inactive-mine-list length) (-> s5-2 num-mines)) + ) + (case (classify-mine-layout) + ((1) + (ctyport-attack-manager-method-43 self s5-2) + (ctyport-attack-manager-method-44 self s5-2) + ) + ) + ) + ) + ) + ) + (until *target* + (suspend) + ) + (suspend) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate wait (ctyport-attack-manager) + :virtual #t + :code (behavior () + (while (or (not *target*) (not *spawn-actors*) (!= (status-of-level-and-borrows *level* 'lpatkcs #f) 'active)) + (if *target* + (process-grab? *target* #f) + ) + (suspend) + ) + (process-release? *target*) + (set-time-limit self) + (ctyport-attack-setup) + (while (or (not (level-get-target-inside *level*)) (= (-> (level-get-target-inside *level*) name) 'hiphog)) + (suspend) + ) + (set-setting! 'airlock #f 0.0 0) + (cond + ((or (task-node-closed? (game-task-node city-port-attack-mission)) + (or (task-node-closed? (game-task-node city-port-attack-get-on)) (kiosk?)) + ) + (kill-by-type barge *active-pool*) + (go-virtual start-mission) + ) + (else + (go-virtual exit-naughty-ottsel) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait-for-cleanup (ctyport-attack-manager) + :virtual #t + :event task-manager-event-handler + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (if (not (handle->process (-> self active-torpedo))) + (send-event self (the-as symbol (-> self finish-type))) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer self)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'kill) + (let ((s5-0 send-event-function) + (v1-7 (entity-by-name "krimson-wall-8")) + ) + (s5-0 + (if v1-7 + (-> v1-7 extra process) + ) + gp-1 + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-2 from) (process->ppointer self)) + (set! (-> gp-2 num-params) 0) + (set! (-> gp-2 message) 'kill) + (let ((s5-1 send-event-function) + (v1-12 (entity-by-name "krimson-wall-9")) + ) + (s5-1 + (if v1-12 + (-> v1-12 extra process) + ) + gp-2 + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-3 from) (process->ppointer self)) + (set! (-> gp-3 num-params) 0) + (set! (-> gp-3 message) 'kill) + (let ((s5-2 send-event-function) + (v1-17 (entity-by-name "krimson-wall-10")) + ) + (s5-2 + (if v1-17 + (-> v1-17 extra process) + ) + gp-3 + ) + ) + ) + (suspend) + (until #f + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate nuke-wall (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code (behavior () + (let ((gp-0 (entity-by-name "krimson-wall-10"))) + (when gp-0 + (send-event (-> gp-0 extra process) 'break) + (set! (-> self wall-h) + (ppointer->handle + (process-spawn krimson-wall-break gp-0 'lctypatk :name "krimson-wall-break" :to *entity-pool*) + ) + ) + ) + ) + (suspend) + (send-event (handle->process (-> self wall-h)) 'break) + (while (not (send-event (handle->process (-> self wall-h)) 'done)) + (suspend) + ) + (send-event self 'complete) + ) + ) + +;; definition for method 46 of type ctyport-attack-manager +(defmethod ctyport-attack-manager-method-46 ((this ctyport-attack-manager)) + (when (can-display-query? this (the-as string #f) -99.0) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-1 gp-0)) + (set! (-> v1-1 width) (the float 340)) + ) + (let ((v1-2 gp-0)) + (set! (-> v1-2 height) (the float 80)) + ) + (let ((v1-3 gp-0)) + (set! (-> v1-3 scale) 0.9) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text + (lookup-text! *common-text* (text-id text-0086) #f) + gp-0 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + ) + ) + ) + +;; definition for symbol *cutscene-trigger-plane-normal*, type vector +(define *cutscene-trigger-plane-normal* (new 'static 'vector :x -0.0799 :z -0.9967 :w 1.0)) + +;; definition for symbol *cutscene-trigger-plane-pt*, type vector +(define *cutscene-trigger-plane-pt* (new 'static 'vector :x 3025019.0 :z 5512233.0 :w 1.0)) + +;; definition for method 47 of type ctyport-attack-manager +;; INFO: Used lq/sq +(defmethod hit-cutscene-trigger? ((this ctyport-attack-manager)) + (when (not (-> this passed-cutscene-trigger?)) + (let ((f30-0 (vector-dot *cutscene-trigger-plane-normal* *cutscene-trigger-plane-pt*))) + (when (handle->process (-> this active-torpedo)) + (let* ((s5-0 (handle->process (-> this active-torpedo))) + (a1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (a0-10 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-10 quad) (-> (the-as process-focusable a1-3) rbody position quad)) + (if (and (< f30-0 (vector-dot *cutscene-trigger-plane-normal* a0-10)) + (< (vector-vector-xz-distance a0-10 *cutscene-trigger-plane-pt*) 225280.0) + ) + (set! (-> this passed-cutscene-trigger?) #t) + ) + ) + ) + ) + ) + (-> this passed-cutscene-trigger?) + ) + +;; definition for symbol *approach-camera-pt*, type vector +(define *approach-camera-pt* (new 'static 'vector :x 3040789.8 :y 138802.38 :z 5532802.5 :w 1.0)) + +;; definition for symbol *approach-camera-matrix*, type matrix +(define *approach-camera-matrix* (new 'static 'matrix + :rvec (new 'static 'vector :x 0.0436 :y -0.1756 :z -0.9834) + :uvec (new 'static 'vector :x 0.0077 :y 0.9844 :z -0.1754) + :fvec (new 'static 'vector :x -0.999 :z -0.0443) + ) + ) + +;; failed to figure out what this is: +(defstate watch-approach (ctyport-attack-manager) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (format 0 "Msg is ~s, from ~s~%" message (-> proc name)) + (case message + (('nuke-hit) + (if (or (not (-> block param 0)) (not *target*) (focus-test? *target* pilot-riding)) + (send-event self 'fail) + (go-virtual nuke-wall) + ) + ) + (else + (ctyport-attack-manager-event-handler proc argc message block) + ) + ) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (send-event (handle->process (-> self active-torpedo)) 'override-camera #t) + (if (not (handle->process (-> self active-torpedo))) + (send-event self 'fail) + ) + (when *target* + (cond + ((focus-test? *target* pilot-riding) + ) + (else + ) + ) + ) + ) + :code sleep-code + ) + +;; definition for symbol *port-attack-fail-sphere*, type sphere +(define *port-attack-fail-sphere* (new 'static 'sphere :x -1074094.1 :y 31539.2 :z 5908275.0 :r 1.0)) + +;; definition for symbol *port-attack-fail-radius*, type float +(define *port-attack-fail-radius* 163840.0) + +;; failed to figure out what this is: +(defstate head-to-wall (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + '() + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (if (< (vector-vector-xz-distance (target-pos 0) *port-attack-fail-sphere*) *port-attack-fail-radius*) + (send-event self 'fail) + ) + (let ((gp-1 (handle->process (-> self active-torpedo)))) + (cond + ((focus-test? + (the-as process-focusable (if (type? gp-1 process-focusable) + (the-as process-focusable gp-1) + ) + ) + dead + ) + (send-event self 'fail) + ) + ((hit-cutscene-trigger? self) + (send-event (handle->process (-> self active-torpedo)) 'hide) + (send-event (handle->process (-> self rod-of-god)) 'leave) + (send-event self 'complete) + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate pickup-nukes (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + (set-setting! 'disable-guard-chatter? #t 0.0 0) + (set! (-> self h-hud) + (ppointer->handle + (process-spawn ctyport-attack-hud :init hud-init-by-other :name "ctyport-attack-hud" :to self) + ) + ) + (set-time! (-> self state-time)) + (if (zero? (-> self current-package-index)) + (play-speech self 1) + ) + (dotimes (gp-1 (-> self mine-layout length)) + (let ((s5-0 (-> self mine-layout gp-1))) + (when (-> s5-0 active?) + (dotimes (s4-0 (-> s5-0 num-mines)) + (let ((v1-19 (-> s5-0 stored-handles s4-0))) + (send-event (handle->process v1-19) 'menace) + ) + ) + ) + ) + ) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + ((-> (method-of-type task-manager active) trans)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.2)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + ) + (set-blackout-frames 0) + ) + (let ((v1-12 (-> self package-positions length))) + (set! (-> *game-info* goal) (/ (the float (-> self current-package-index)) (the float (+ v1-12 -1)))) + ) + (ctyport-attack-manager-method-49 self) + (if (and (zero? (-> self current-package-index)) + (> (-> *port-attack-speech* 1 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 1 play-time) (seconds 1)) + ) + (play-speech self 3) + ) + (if (< (vector-vector-xz-distance (target-pos 0) *port-attack-fail-sphere*) *port-attack-fail-radius*) + (send-event self 'fail) + ) + (if (and (> (-> self current-package-index) 0) + (< (-> self current-package-index) (+ (-> self package-positions length) -9)) + (and (> (-> *port-attack-speech* 4 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 4 play-time) (seconds 12)) + ) + (or (not (logtest? (-> *port-attack-speech* 5 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 5 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 5 play-time) (seconds 20)) + ) + ) + ) + (play-speech self 5) + ) + (cond + ((< (-> self current-package-index) (-> self package-positions length)) + (if (or (not *target*) + (not (handle->process (-> self active-torpedo))) + (begin + (let* ((gp-2 #t) + (s5-0 (handle->process (-> self active-torpedo))) + (v1-67 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-67 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + ) + (else + (go-virtual head-to-wall) + ) + ) + ) + :code (behavior () + (sleep-code) + ) + ) + +;; definition for method 48 of type ctyport-attack-manager +(defmethod ctyport-attack-manager-method-48 ((this ctyport-attack-manager) (arg0 int)) + 0.0 + (when (< 2 arg0) + (let ((f30-0 (* -6144.0 (the float (+ arg0 -2))))) + (if (task-node-closed? (game-task-node city-port-attack-mission)) + (set! f30-0 (* 2.0 f30-0)) + ) + (let ((f0-4 (fmax -81920.0 f30-0))) + (send-event (handle->process (-> this active-torpedo)) 'boost f0-4) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate start-mission (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + (set-setting! 'music 'portattk 0.0 0) + (set-setting! 'exclusive-load '((ignore all)) 0.0 0) + (let ((a1-2 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-2 9) #f) + (set! (-> a1-2 8) #f) + (set! (-> a1-2 7) #f) + (set! (-> a1-2 6) #f) + (set! (-> a1-2 5) #f) + (set! (-> a1-2 4) #f) + (set! (-> a1-2 3) #f) + (set! (-> a1-2 2) 'ctyinda) + (set! (-> a1-2 1) 'ctyport) + (set! (-> a1-2 0) 'ctywide-ff) + (want-levels *load-state* a1-2) + ) + (want-display-level *load-state* 'ctyport 'display) + (want-display-level *load-state* 'ctyinda 'display) + (ctyport-attack-manager-method-48 self (get-ctyport-attack-death-count)) + (if (task-node-closed? (game-task-node city-port-attack-mission)) + (send-event (handle->process (-> self active-torpedo)) 'boost 57344.0) + ) + (set! (-> self current-package-index) 0) + (if (task-node-closed? (game-task-node city-port-attack-mission)) + (set! (-> self current-package-index) 14) + ) + (ctyport-attack-manager-method-45 self) + (send-event *target* 'change-mode 'pilot-daxter (handle->process (-> self active-torpedo))) + (go-virtual pickup-nukes) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate exit-naughty-ottsel (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (if (!= (status-of-level-and-borrows *level* 'hiphog #f) 'active) + (go-virtual get-on-nuke) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate get-on-nuke (ctyport-attack-manager) + :virtual #t + :event ctyport-attack-manager-event-handler + :enter (behavior () + (set-setting! 'airlock #f 0.0 0) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (if (and *target* (not (logtest? (focus-status teleporting) (-> *target* focus-status)))) + (play-speech self 0) + ) + (when (and (not (handle->process (-> self rod-of-god))) + (not (task-node-closed? (game-task-node city-port-attack-get-on))) + (handle-command-list *gui-control* (gui-channel voicebox) (the-as gui-connection #f)) + (> (-> *port-attack-speech* 0 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 0 play-time) (seconds 1)) + ) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3 taf8)) + (set! (-> self rod-of-god) (process->handle (task-arrow-spawn gp-0 self))) + ) + ) + (when (and *target* (and (handle-command-list *gui-control* (gui-channel voicebox) (the-as gui-connection #f)) + (not (focus-test? *target* pilot-riding)) + (let ((gp-1 vector-vector-xz-distance) + (s5-1 (target-pos 0)) + (s4-0 (handle->process (-> self active-torpedo))) + ) + (and (< (gp-1 s5-1 (get-trans + (the-as process-focusable (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + 0 + ) + ) + 32768.0 + ) + (> (-> *port-attack-speech* 0 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 0 play-time) (seconds 1)) + ) + ) + ) + ) + (send-event (handle->process (-> self rod-of-god)) 'leave) + (go-virtual play-get-on-movie) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate play-get-on-movie (ctyport-attack-manager) + :virtual #t + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code (behavior () + (set-blackout-frames (seconds 0.05)) + (set-setting! 'stop-boats? #t 0.0 0) + (let ((gp-0 (get-process *default-dead-pool* scene-player #x4000 1))) + (process->handle + (-> (when gp-0 + (let ((t9-3 (method-of-type scene-player activate))) + (t9-3 (the-as scene-player gp-0) *default-pool* "scene-player" (the-as pointer #x70004000)) + ) + (run-now-in-process gp-0 scene-player-init "ctyport-attack-get-on-nuke" #t #f) + (-> gp-0 ppointer) + ) + 0 + ) + ) + ) + (while *scene-player* + (when (< 0.0 (-> *scene-player* 0 last-frame)) + (set-setting! 'stop-boats? #t 0.0 0) + (send-event (handle->process (-> self active-torpedo)) 'hide) + ) + (suspend) + ) + (task-node-close! (game-task-node city-port-attack-get-on) 'event) + (send-event (handle->process (-> self active-torpedo)) 'show) + (set-setting! 'stop-boats? #t 0.0 0) + (apply-settings *setting-control*) + (kill-by-type barge *active-pool*) + (suspend) + (go-virtual start-mission) + ) + ) + +;; definition for method 10 of type ctyport-attack-package +(defmethod deactivate ((this ctyport-attack-package)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this hum-sound)) + (call-parent-method this) + (none) + ) + +;; definition for method 42 of type ctyport-attack-manager +(defmethod ctyport-attack-manager-method-42 ((this ctyport-attack-manager) (arg0 ctyport-mine-layout)) + (set! (-> arg0 active?) #f) + (set! (-> arg0 checked-this-frame?) #t) + (dotimes (s4-0 (-> arg0 num-mines)) + (push-back (-> this inactive-mine-list) (-> arg0 stored-handles s4-0)) + (send-event (handle->process (-> arg0 stored-handles s4-0)) 'hide) + ) + #f + ) + +;; definition for method 44 of type ctyport-attack-manager +;; INFO: Used lq/sq +(defmethod ctyport-attack-manager-method-44 ((this ctyport-attack-manager) (arg0 ctyport-mine-layout)) + (local-vars (sv-208 vector) (sv-224 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + 0.0 + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> *x-vector* quad)) + (let ((f30-0 (-> arg0 initial-angle))) + (cond + ((-> arg0 inout?) + (let* ((f0-2 (* 0.0033333334 (the float (- (current-time) (-> this mine-clock))))) + (f1-3 (* 0.0033333334 (-> arg0 period))) + (f0-5 (+ (/ (- f0-2 (* (the float (the int (/ f0-2 f1-3))) f1-3)) (* 0.0033333334 (-> arg0 period))) + (-> arg0 offset) + ) + ) + (f0-6 (- f0-5 (* (the float (the int (/ f0-5 1.0))) 1.0))) + ) + (if (< 0.5 f0-6) + (set! f0-6 (- 1.0 f0-6)) + ) + (let ((f0-7 (* 2.0 f0-6))) + (vector-lerp! s5-0 (-> arg0 origin) (-> arg0 secondary-pos) f0-7) + ) + ) + ) + (else + (set! (-> s5-0 quad) (-> arg0 origin quad)) + ) + ) + (if (-> arg0 spin?) + (+! f30-0 (* 0.0033333334 (-> arg0 spinrate) (the float (- (current-time) (-> this mine-clock))))) + ) + (vector-rotate-around-y! s4-0 s4-0 f30-0) + ) + (let ((s3-1 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s4-0 *up-vector*))) + (dotimes (s2-0 (-> arg0 num-mines)) + (let ((v1-28 (-> arg0 stored-handles s2-0))) + (send-event (handle->process v1-28) 'activate s5-0) + ) + (let ((s1-0 s5-0) + (s0-0 s5-0) + ) + (set! sv-208 s4-0) + (let* ((f30-1 1.0) + (f28-0 0.29999995) + (v1-33 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-34 (the-as number (logior #x3f800000 v1-33))) + (f0-16 (* (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-34)))) (-> arg0 spacing))) + ) + (vector+float*! s1-0 s0-0 sv-208 f0-16) + ) + ) + (let ((s1-2 s5-0) + (s0-1 s5-0) + ) + (set! sv-224 (-> s3-1 rvec)) + (let* ((f30-2 -10240.0) + (f28-1 20480.0) + (v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + (f0-21 (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-41))))) + ) + (vector+float*! s1-2 s0-1 sv-224 f0-21) + ) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 43 of type ctyport-attack-manager +(defmethod ctyport-attack-manager-method-43 ((this ctyport-attack-manager) (arg0 ctyport-mine-layout)) + (set! (-> arg0 active?) #t) + (dotimes (s4-0 (-> arg0 num-mines)) + (set! (-> arg0 stored-handles s4-0) (-> this inactive-mine-list data0 0)) + (pop-front (-> this inactive-mine-list) 0) + ) + #f + ) + +;; definition for function copy-record-pos +;; INFO: Used lq/sq +(defun copy-record-pos () + (dotimes (v1-0 *recorded-length*) + (set! (-> *ctyport-package-positions* v1-0 pos quad) (-> *recorded-pos* v1-0 quad)) + ) + #f + ) + +;; definition for function print-record-pos-2 +(defun print-record-pos-2 () + (dotimes (gp-0 (-> *ctyport-package-positions* length)) + (format + 0 + "(static-cty-package ~m ~m ~m :locked? #t)~%" + (-> *ctyport-package-positions* gp-0 pos x) + (-> *ctyport-package-positions* gp-0 pos y) + (-> *ctyport-package-positions* gp-0 pos z) + ) + ) + #f + ) + +;; failed to figure out what this is: +(dotimes (v1-116 (-> *ctyport-package-positions* length)) + (when (not (-> *ctyport-package-positions* v1-116 locked?)) + 0 + (goto cfg-14) + ) + (set! *recorded-length* (+ v1-116 1)) + ) + +;; failed to figure out what this is: +(label cfg-14) + +;; definition for method 25 of type ctyport-attack-manager +(defmethod task-manager-method-25 ((this ctyport-attack-manager)) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + (disable *screen-filter*) + (call-parent-method this) + (none) + ) + +;; definition for function lctypatk-login +;; WARN: Return type mismatch clock vs none. +(defun lctypatk-login ((arg0 level)) + (set! *port-attack-dead-pool* (new 'loading-level 'dead-pool 40 2048 "*port-attack-dead-pool*")) + (set! (-> *port-attack-dead-pool* clock) (-> *display* entity-clock)) + (none) + ) + +;; definition for function lctypatk-logout +;; WARN: Return type mismatch symbol vs none. +(defun lctypatk-logout ((arg0 level)) + (set! *port-attack-dead-pool* #f) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-dax-missile-launcher cty-dax-missile-launcher cty-dax-missile-launcher-lod0-jg cty-dax-missile-launcher-idle-ja + ((cty-dax-missile-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12.5) + ) + +;; definition of type cty-dax-missile-launcher +(deftype cty-dax-missile-launcher (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type cty-dax-missile-launcher +(defmethod inspect ((this cty-dax-missile-launcher)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type cty-dax-missile-launcher +(defmethod init-from-entity! ((this cty-dax-missile-launcher) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-4) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-7 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cty-dax-missile-launcher" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (process-drawable-from-entity! this arg0) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defstate idle (cty-dax-missile-launcher) + :virtual #t + :code transform-and-sleep-code + :post ja-post + ) + +;; definition for method 49 of type ctyport-attack-manager +(defmethod ctyport-attack-manager-method-49 ((this ctyport-attack-manager)) + (local-vars (v0-0 int)) + (if (or (< (-> this current-package-index) 2) + (< (+ (-> this package-positions length) -2) (-> this current-package-index)) + ) + (return 0) + ) + (when (or (not (logtest? (-> *port-attack-speech* 9 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 9 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 9 play-time) (seconds 4)) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let* ((s3-0 (handle->process (-> this active-torpedo))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (the-as process-focusable s4-0) + (let ((s3-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable s4-0) root quat)))) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (vector+float*! s5-0 (-> (the-as process-focusable s4-0) root trans) s3-1 122880.0) + ) + (set! (-> s5-0 w) 40960.0) + (when (and (or (not (logtest? (-> *port-attack-speech* 10 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 10 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 10 play-time) (seconds 5)) + ) + ) + (or (not (logtest? (-> *port-attack-speech* 12 flags) (speech-info-flag si6))) + (and (> (-> *port-attack-speech* 12 play-time) 0) + (time-elapsed? (-> *port-attack-speech* 12 play-time) (seconds 2)) + ) + ) + (not (logtest? (rand-uint31-gen *random-generator*) 1)) + ) + (let ((s3-4 0)) + (let ((s2-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s1-0 (fill-actor-list-for-box *actor-hash* s5-0 s2-0 384)) + (let* ((s0-0 (-> s2-0 s1-0)) + (v1-52 (if (type? s0-0 collide-shape) + s0-0 + ) + ) + ) + (when v1-52 + (let* ((s0-1 (-> v1-52 process)) + (v1-53 (if (type? s0-1 process-focusable) + s0-1 + ) + ) + ) + (when v1-53 + (if (and (!= v1-53 *target*) (!= v1-53 s4-0) (logtest? (process-mask guard civilian) (-> v1-53 mask))) + (+! s3-4 1) + ) + ) + ) + ) + ) + ) + ) + (let* ((s1-1 *target*) + (s2-1 (if (type? s1-1 process-focusable) + s1-1 + ) + ) + ) + (when (and s2-1 (< (vector-vector-distance (get-trans s2-1 0) s5-0) (-> s5-0 w))) + (if (and (!= s2-1 *target*) (!= s2-1 s4-0) (logtest? (process-mask guard civilian) (-> s2-1 mask))) + (+! s3-4 1) + ) + ) + ) + (when (< 2 s3-4) + (play-speech this 10) + (return 0) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 50 of type ctyport-attack-manager +(defmethod play-speech ((this ctyport-attack-manager) (arg0 int)) + (speech-play *port-attack-speech* arg0 *ctyport-attack-speech-list* (target-pos 0)) + ) + +;; definition for method 17 of type ctyport-attack-hud +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this ctyport-attack-hud)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-dax-missle-meter-01" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 0 pos z) #xfffff0) + (set! (-> this sprites 1 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-dax-missle-meter-03" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 1 pos z) #xfffff2) + (set! (-> this sprites 2 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-dax-missle-meter-03" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 2 pos z) #xfffff4) + (set! (-> this sprites 3 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-dax-missle-meter-02" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 3 pos z) #xffffff) + 0 + (none) + ) + +;; failed to figure out what this is: +(if #t + (set! *hud-boost-curve* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 5.0 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -8.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for method 15 of type ctyport-attack-hud +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this ctyport-attack-hud)) + (set-hud-piece-position! + (-> this sprites 2) + (the int (+ 65.0 (* 18.0 (-> *video-params* relative-x-scale)) (* -130.0 (-> this offset)))) + (the int (+ 350.0 (* 130.0 (-> this offset)))) + ) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 5 -25) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 5 5) + (logior! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (logior! (-> this sprites 2 flags) (hud-sprite-flags hsf3 hsf4)) + (logior! (-> this sprites 3 flags) (hud-sprite-flags hsf3)) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1110 0) + (logior! (-> this sprites 1 flags) (hud-sprite-flags hsf3 hsf5)) + (set! (-> this sprites 2 scale-x) 1.4) + (set! (-> this sprites 1 scale-x) 1.4) + (set! (-> this sprites 1 scale-y) 1.1) + (set! (-> this sprites 0 color w) 128) + (set! (-> this sprites 2 color w) 128) + (set! (-> this sprites 3 color w) 128) + (set! (-> this sprites 2 color x) 128) + (set! (-> this sprites 2 color y) 128) + (set! (-> this sprites 2 color z) 128) + (set! (-> this sprites 1 color x) 128) + (set! (-> this sprites 1 color y) 128) + (set! (-> this sprites 1 color z) 128) + (set! (-> this sprites 1 color w) 0) + (let ((f0-11 (* 0.011111111 (the float (- (current-time) (-> this spike-time)))))) + 0.0 + (let ((f0-12 (curve2d-method-9 *hud-boost-curve* f0-11 3))) + (set! (-> this tt-current) (lerp (-> this tt-prev) (-> this tt-next) f0-12)) + ) + ) + (let ((f30-0 (-> this tt-current))) + (when (and (not (paused?)) (time-elapsed? (-> this spike-time) (seconds 0.3))) + (let* ((f28-0 -1.0) + (f26-0 2.0) + (v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + ) + (+! f30-0 (* (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-41)))) (lerp 0.01 0.06 (* f30-0 f30-0)))) + ) + ) + (let ((f30-1 (fmax 0.0 (fmin 1.15 f30-0)))) + (when (not (paused?)) + (let* ((f28-2 (* (-> this tt-current) (-> this tt-current))) + (f0-23 (lerp 1.0 0.3 f28-2)) + (f1-16 (* 0.0033333334 (the float (current-time)))) + (f0-24 (/ (- f1-16 (* (the float (the int (/ f1-16 f0-23))) f0-23)) f0-23)) + (f1-18 (* f28-2 (curve2d-method-9 *curve-linear-up-down* f0-24 3))) + (f28-3 (fmax 0.0 (fmin 1.0 f1-18))) + ) + (set! (-> this sprites 3 color x) (the int (lerp 128.0 192.0 f28-3))) + (set! (-> this sprites 3 color y) (the int (lerp 128.0 64.0 f28-3))) + (set! (-> this sprites 3 color z) (the int (lerp 128.0 0.0 f28-3))) + (set! (-> this sprites 0 color x) (the int (lerp 128.0 192.0 f28-3))) + (set! (-> this sprites 0 color y) (the int (lerp 128.0 64.0 f28-3))) + (set! (-> this sprites 0 color z) (the int (lerp 128.0 0.0 f28-3))) + ) + (when (not (time-elapsed? (-> this spike-time) (seconds 0.1))) + (set! (-> this sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 255) + (set! (-> this sprites 3 color z) 255) + (set! (-> this sprites 0 color x) 255) + (set! (-> this sprites 0 color y) 255) + (set! (-> this sprites 0 color z) 255) + ) + ) + (let ((f0-39 (lerp 32403.91 3185.7778 f30-1))) + (set! (-> this sprites 2 angle) f0-39) + (set! (-> this sprites 1 angle) f0-39) + ) + ) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type ctyport-attack-hud +(defmethod update-values! ((this ctyport-attack-hud)) + (set! (-> this values 0 target) (the-as int (-> *game-info* goal))) + (when (and (< 0.0 (-> *game-info* goal)) (< (-> this tt-next) (-> *game-info* goal))) + (set! (-> this tt-prev) (-> this tt-current)) + (set-time! (-> this spike-time)) + (set! (-> this tt-next) (-> *game-info* goal)) + ) + (call-parent-method this) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc new file mode 100644 index 0000000000..d4db65acf1 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc @@ -0,0 +1,2097 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-daxter-missile-heathaze + :id 526 + :flags (sp0 sp4 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2065 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2065 + :init-specs ((:texture (glow level-default-sprite)) + (:num 20.0) + (:x (meters 0) (meters 0.3)) + (:z (meters -0.05)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0 64.0) + (:b 0.0 32.0) + (:a 64.0 64.0) + (:timer (seconds 0.017) (seconds 0.015)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'spt-func-relative-pos) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-nuke-water-wake + :id 527 + :flags (sp0 sp4 sp13) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 2066 :flags (sp7)) (sp-item 2067 :flags (sp7))) + ) + +;; failed to figure out what this is: +(when (or (zero? *growing-curve-torpedo*) (!= loading-level global)) + (set! *growing-curve-torpedo* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *growing-curve-torpedo* 2 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *growing-curve-torpedo* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *growing-curve-torpedo* pts data 0 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *growing-curve-torpedo* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *growing-curve-torpedo* pts data 1 second) 10.0) + +;; failed to figure out what this is: +(when (or (zero? *water-simple-alpha-curve-fade-out-torpedo*) (!= loading-level global)) + (set! *water-simple-alpha-curve-fade-out-torpedo* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *water-simple-alpha-curve-fade-out-torpedo* 2 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *water-simple-alpha-curve-fade-out-torpedo* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *water-simple-alpha-curve-fade-out-torpedo* pts data 0 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *water-simple-alpha-curve-fade-out-torpedo* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *water-simple-alpha-curve-fade-out-torpedo* pts data 1 second) 0.0) + +;; failed to figure out what this is: +(when (or (zero? *color-curve-tan-brown-torpedo*) (!= loading-level global)) + (set! *color-curve-tan-brown-torpedo* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *color-curve-tan-brown-torpedo* 2 'loading-level (the-as uint #f)) + ) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 second y) 1.171875) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 second z) 1.171875) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 0 second w) 0.5) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 second x) 0.78125) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 second y) 1.015625) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 second z) 1.015625) + +;; failed to figure out what this is: +(set! (-> *color-curve-tan-brown-torpedo* pts data 1 second w) 0.5) + +;; failed to figure out what this is: +(when (or (zero? *water-simple-alpha-curve-in-torpedo*) (!= loading-level global)) + (set! *water-simple-alpha-curve-in-torpedo* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *water-simple-alpha-curve-in-torpedo* 2 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *water-simple-alpha-curve-in-torpedo* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *water-simple-alpha-curve-in-torpedo* pts data 0 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *water-simple-alpha-curve-in-torpedo* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *water-simple-alpha-curve-in-torpedo* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(if (or (zero? *torpedo-wake-trail*) (!= loading-level global)) + (set! *torpedo-wake-trail* (new 'loading-level 'light-trail-composition)) + ) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* color-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* color-repeat-dist) 40960.0) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* alpha-1-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* alpha-2-mode) (the-as uint 6)) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* base-alpha) 0.6) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* alpha-repeat-dist) 40960.0) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* width-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* base-width) 10240.0) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* width-repeat-dist) 204800.0) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* uv-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* uv-repeat-dist) 81920.0) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* lie-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* max-age) (seconds 0.3)) + +;; failed to figure out what this is: +(if #f + (set! (-> *torpedo-wake-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *torpedo-wake-trail* tex-id) (the-as uint #x500800)) + ) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* width-curve) *growing-curve-torpedo*) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* color-curve) *color-curve-tan-brown-torpedo*) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* alpha-curve-1) *water-simple-alpha-curve-in-torpedo*) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* alpha-curve-2) #f) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* zbuffer?) #f) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* lie-vector quad) (-> *up-vector* quad)) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* use-tape-mode?) #t) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* blend-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *torpedo-wake-trail* frame-stagger) (the-as uint 1)) + +;; failed to figure out what this is: +(defpartgroup group-nuke-water-splash + :id 528 + :duration (seconds 5) + :flags (sp0 sp4 sp9) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 2068 :flags (sp7) :period (seconds 20) :length (seconds 0.1)) + (sp-item 2069 :flags (sp7) :period (seconds 20) :length (seconds 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 2068 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 60.0) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.01) (meters 0.033333335)) + (:vel-z (meters 0.23333333) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:accel-y (meters -0.0016666667)) + (:friction 0.97 0.02) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 2070) + (:conerot-x (degrees -10) (degrees -10)) + (:conerot-z (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2070 + :init-specs ((:friction 0.9)) + ) + +;; failed to figure out what this is: +(defpart 2069 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 30.0) + (:y (meters 0)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:omega (degrees 0.09)) + (:vel-y (meters 0.01) (meters 0.033333335)) + (:vel-z (meters 0.2) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.97 0.02) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z)) + (:func 'spt-func-nuke-water-splash) + (:next-time (seconds 0.335)) + (:next-launcher 2071) + (:conerot-x (degrees -10) (degrees -10)) + (:conerot-z (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2071 + :init-specs ((:omega (degrees 0.1575)) (:friction 0.9)) + ) + +;; definition for function spt-func-nuke-water-splash +(defun spt-func-nuke-water-splash ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (sparticle-2d-spline-align-instant arg0 arg1 (the-as sprite-vec-data-2d arg2)) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-torpedo-explosion + :id 529 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2072 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2073 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2074 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2075 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2076 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2077 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 2072 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2073 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2074 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2076 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2077 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-torp-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-torp-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 32.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 96.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-torp-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-torp-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-torp-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-torp-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 2.0 :z 2.5 :w 3.5) + :one-over-x-deltas (new 'static 'vector :x 2.5 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-torp-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 2.0 :z 2.5 :w 3.5) + :one-over-x-deltas (new 'static 'vector :x 2.5 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-torpedo-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-torpedo-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2077 init-specs 16 initial-valuef) + (the-as float *part-torpedo-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* color-start) *range-torp-explo-color*) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* alpha-start) *range-torp-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* scale-x-start) *range-torp-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* scale-y-start) *range-torp-explo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* a-scalar) *curve-torp-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* scale-x-scalar) *curve-torp-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-torpedo-explosion-texture-curve-settings* scale-y-scalar) *curve-torp-explo-scale-y*) + +;; failed to figure out what this is: +(defpart 2075 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; definition of type htorpedo +(deftype htorpedo (h-bike-c) + ((speed float) + (target-speed float) + (pitch float) + (target-pitch float) + (max-pitch float) + (roll float) + (target-roll float) + (turn-rate float) + (target-turn-rate float) + (ground-height float) + (ground-offset float) + (down-force float) + (want-jump? symbol) + (jump-state uint8 :offset 1360) + (on-water? symbol) + (cam-pitch float) + (cam-roll float) + (target-cam-roll float) + (based-cam-roll float) + (last-quat quaternion :inline) + (override-camera? symbol) + (under-water? symbol) + (next-bob-cam-time time-frame) + (thrust-sound sound-id) + (ground-sound sound-id) + (reverb-dest float) + (pitch-current float) + (ground-vol-current float) + (last-slice-val float) + (evasive-sound sound-id) + (evasive-volume float) + (stopping-evasive? symbol) + (spawn-splash? symbol) + (wake-sound sound-id) + (heat-haze sparticle-launch-control) + (last-land-speech-time time-frame) + (last-jump-speech-time time-frame) + ) + (:state-methods + undefined0 + hide + ) + (:methods + (htorpedo-method-164 () none) + (find-ground-height (_type_) float) + (htorpedo-method-166 (_type_ float) none) + (htorpedo-method-167 (_type_ float) float) + (htorpedo-method-168 (_type_ float) float) + (probe-ground (_type_ vector float) float) + (update-sound (_type_) none) + ) + ) + +;; definition for method 3 of type htorpedo +(defmethod inspect ((this htorpedo)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-bike-c inspect))) + (t9-0 this) + ) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Ttarget-speed: ~f~%" (-> this target-speed)) + (format #t "~2Tpitch: ~f~%" (-> this pitch)) + (format #t "~2Ttarget-pitch: ~f~%" (-> this target-pitch)) + (format #t "~2Tmax-pitch: ~f~%" (-> this max-pitch)) + (format #t "~2Troll: ~f~%" (-> this roll)) + (format #t "~2Ttarget-roll: ~f~%" (-> this target-roll)) + (format #t "~2Tturn-rate: ~f~%" (-> this turn-rate)) + (format #t "~2Ttarget-turn-rate: ~f~%" (-> this target-turn-rate)) + (format #t "~2Tground-height: ~f~%" (-> this ground-height)) + (format #t "~2Tground-offset: ~f~%" (-> this ground-offset)) + (format #t "~2Tdown-force: ~f~%" (-> this down-force)) + (format #t "~2Twant-jump?: ~A~%" (-> this want-jump?)) + (format #t "~2Tjump-time: ~D~%" (-> this jump-time)) + (format #t "~2Tjump-state: ~D~%" (-> this jump-state)) + (format #t "~2Ton-water?: ~A~%" (-> this on-water?)) + (format #t "~2Tcam-pitch: ~f~%" (-> this cam-pitch)) + (format #t "~2Tcam-roll: ~f~%" (-> this cam-roll)) + (format #t "~2Ttarget-cam-roll: ~f~%" (-> this target-cam-roll)) + (format #t "~2Tbased-cam-roll: ~f~%" (-> this based-cam-roll)) + (format #t "~2Tlast-quat: #~%" (-> this last-quat)) + (format #t "~2Toverride-camera?: ~A~%" (-> this override-camera?)) + (format #t "~2Tunder-water?: ~A~%" (-> this under-water?)) + (format #t "~2Tnext-bob-cam-time: ~D~%" (-> this next-bob-cam-time)) + (format #t "~2Tthrust-sound: ~D~%" (-> this thrust-sound)) + (format #t "~2Tground-sound: ~D~%" (-> this ground-sound)) + (format #t "~2Treverb-dest: ~f~%" (-> this reverb-dest)) + (format #t "~2Tpitch-current: ~f~%" (-> this pitch-current)) + (format #t "~2Tground-vol-current: ~f~%" (-> this ground-vol-current)) + (format #t "~2Tlast-slice-val: ~f~%" (-> this last-slice-val)) + (format #t "~2Tevasive-sound: ~D~%" (-> this evasive-sound)) + (format #t "~2Tevasive-volume: ~f~%" (-> this evasive-volume)) + (format #t "~2Tstopping-evasive?: ~A~%" (-> this stopping-evasive?)) + (format #t "~2Tspawn-splash?: ~A~%" (-> this spawn-splash?)) + (format #t "~2Twake-sound: ~D~%" (-> this wake-sound)) + (format #t "~2Theat-haze: ~A~%" (-> this heat-haze)) + (format #t "~2Tlast-land-speech-time: ~D~%" (-> this last-land-speech-time)) + (format #t "~2Tlast-jump-speech-time: ~D~%" (-> this last-jump-speech-time)) + (label cfg-4) + this + ) + +;; definition for method 165 of type htorpedo +;; INFO: Used lq/sq +(defmethod find-ground-height ((this htorpedo)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((f1-0 225280.0) + (f2-0 8192.0) + (f0-0 1024.0) + ) + (set! (-> s5-0 start-pos quad) (-> this rbody position quad)) + (+! (-> s5-0 start-pos y) f2-0) + (vector-reset! (-> s5-0 move-dist)) + (set! (-> s5-0 move-dist y) (- (+ f2-0 f1-0))) + (let ((v1-6 s5-0)) + (set! (-> v1-6 radius) f0-0) + (set! (-> v1-6 collide-with) (collide-spec backgnd)) + (set! (-> v1-6 ignore-process0) this) + (set! (-> v1-6 ignore-process1) #f) + (set! (-> v1-6 ignore-pat) (-> this root pat-ignore-mask)) + (set! (-> v1-6 action-mask) (collide-action solid)) + ) + ) + (let ((v1-9 (>= (probe-using-line-sphere *collide-cache* s5-0) 0.0))) + (set! (-> this on-water?) #f) + (when (not v1-9) + (let ((s5-1 (new 'stack-no-clear 'water-info))) + (water-info-init! (-> this root) s5-1 (collide-action solid semi-solid)) + (cond + ((logtest? (water-flag over-water) (-> s5-1 flags)) + (set! (-> this ground-height) (-> s5-1 base-height)) + (set! (-> this on-water?) #t) + ) + (else + (set! (-> this ground-height) -40960000.0) + ) + ) + ) + (return 0.0) + ) + ) + (set! (-> this ground-height) (-> s5-0 best-other-tri intersect y)) + ) + ) + +;; definition for method 169 of type htorpedo +;; INFO: Used lq/sq +(defmethod probe-ground ((this htorpedo) (arg0 vector) (arg1 float)) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> s4-0 start-pos) arg0 *up-vector* 24576.0) + (set! (-> s4-0 move-dist quad) (the-as uint128 0)) + (set! (-> s4-0 move-dist y) -49152.0) + (let ((v1-4 s4-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (if (>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (-> s4-0 best-other-tri intersect y) + (- (-> arg0 y) (-> this ground-offset)) + ) + ) + ) + +;; definition for method 166 of type htorpedo +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 166 htorpedo) has a return type of none, but the expression builder found a return statement. +(defmethod htorpedo-method-166 ((this htorpedo) (arg0 float)) + (set! (-> this target-pitch) 0.0) + (+ (-> this ground-height) (-> this ground-offset)) + (-> this rbody position y) + (when #t + (cond + ((< 0.0 (-> this down-force)) + (let* ((f1-3 (* 0.0000024414062 (-> this down-force))) + (f0-7 (fmax 0.0 (fmin 1.0 f1-3))) + ) + (set! (-> this target-pitch) (lerp 0.0 -7281.778 f0-7)) + ) + ) + (else + (let* ((f1-6 (* -0.0000024414062 (-> this down-force))) + (f0-11 (fmax 0.0 (fmin 1.0 f1-6))) + ) + (set! (-> this target-pitch) (lerp 0.0 7281.778 f0-11)) + ) + ) + ) + ) + (when (or (!= (-> this jump-state) 0) (-> this on-water?)) + (set! (-> this pitch) (lerp (-> this pitch) (-> this target-pitch) (* 2.0 arg0))) + (return 0) + ) + (let* ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (f30-0 32768.0) + (s3-0 (new 'stack-no-clear 'vector)) + (v1-16 s3-0) + (a0-7 (-> this rbody position)) + (a1-5 s4-0) + (a2-3 6144.0) + ) + (vector+float*! v1-16 a0-7 a1-5 a2-3) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (let* ((s2-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (* 0.5 f30-0))) + (s1-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (* -0.5 f30-0))) + (f28-0 (probe-ground this s2-1 a2-3)) + (f0-24 (probe-ground this s1-1 a2-3)) + ) + (set! (-> s2-1 y) f28-0) + (set! (-> s1-1 y) f0-24) + (let* ((f0-26 (- (+ f28-0 (-> this ground-offset)) (+ f0-24 (-> this ground-offset)))) + (f0-28 (asin (/ f0-26 f30-0))) + ) + (set! (-> this target-pitch) (- (fmax 0.0 f0-28))) + ) + ) + ) + (set! (-> this pitch) (lerp (-> this pitch) (-> this target-pitch) (* 30.0 arg0))) + (set! (-> this cam-pitch) (lerp (-> this cam-pitch) (-> this target-pitch) (* 3.0 arg0))) + 0 + (none) + ) + +;; definition for symbol PHYSICS_SCALAR, type float +(define PHYSICS_SCALAR 2.0) + +;; definition for method 167 of type htorpedo +(defmethod htorpedo-method-167 ((this htorpedo) (arg0 float)) + (set! (-> this target-pitch) (* (-> this max-pitch) + (-> this controls lean-z) + (fabs (-> this controls lean-z)) + (fabs (-> this controls lean-z)) + ) + ) + (let ((f1-6 (+ 40960.0 (-> this flight-level))) + (f0-6 (+ -49152.0 (-> this flight-level))) + ) + 0.0 + (let* ((f2-2 (-> this rbody position y)) + (f3-1 (* 0.5 (+ f1-6 f0-6))) + (f1-8 (/ (- f1-6 f2-2) (- f1-6 f3-1))) + ) + 0.0 + 0.0 + (let* ((f0-8 (/ (- f2-2 f0-6) (- f3-1 f0-6))) + (f1-9 (fmin 1.0 f1-8)) + (f0-9 (fmin 1.0 f0-8)) + (f30-0 (- 1.0 (* (- 1.0 f1-9) (- 1.0 f1-9)))) + (f0-12 (- 1.0 (* (- 1.0 f0-9) (- 1.0 f0-9)))) + (f28-0 (lerp 0.0 (-> this max-pitch) f0-12)) + (f1-14 (lerp 0.0 (- (-> this max-pitch)) f30-0)) + ) + (set! (-> this target-pitch) (fmax (fmin (-> this target-pitch) f28-0) f1-14)) + (let ((f0-18 1.0)) + (if (or (< f28-0 0.0) (< 0.0 f1-14)) + (set! f0-18 2.0) + ) + (set! (-> this pitch) (lerp (-> this pitch) (-> this target-pitch) (* arg0 PHYSICS_SCALAR f0-18))) + ) + ) + ) + ) + ) + +;; definition for symbol *torpedo-speech-list*, type (inline-array talker-speech-class) +(define *torpedo-speech-list* (new 'static 'inline-array talker-speech-class 5 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "dax563" + :channel (gui-channel daxter) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax564" + :channel (gui-channel daxter) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax566" + :channel (gui-channel daxter) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax578" + :channel (gui-channel daxter) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + ) + ) + +;; definition for symbol *torpedo-jump-speech*, type (array uint16) +(define *torpedo-jump-speech* (new 'static 'boxed-array :type uint16 #x1 #x2 #x3)) + +;; definition for symbol *torpedo-land-speech*, type (array uint16) +(define *torpedo-land-speech* (new 'static 'boxed-array :type uint16 #x4)) + +;; definition for method 168 of type htorpedo +(defmethod htorpedo-method-168 ((this htorpedo) (arg0 float)) + (set! (-> this spawn-splash?) #f) + (find-ground-height this) + (when (logtest? (-> this root status) (collide-status touch-wall)) + ) + (let ((f30-0 (+ (-> this ground-height) (-> this ground-offset))) + (f28-0 (-> this rbody position y)) + ) + (when (and (-> this next-state) (= (-> this next-state name) 'player-control)) + (when (and (-> this want-jump?) + (= (-> this jump-state) 0) + (time-elapsed? (the-as time-frame (the int (-> this jump-time))) (seconds 0.2)) + ) + (set! (-> this down-force) 368640.0) + (set! (-> this jump-state) (the-as uint 1)) + (set! (-> this jump-time) (the float (current-time))) + (set! (-> *target* pilot jumping?) #t) + ) + (when (= (-> this jump-state) 1) + (if (and (cpad-hold? 0 x) (not (time-elapsed? (the-as time-frame (the int (-> this jump-time))) (seconds 0.3)))) + (+! (-> this down-force) (* 245760.0 arg0)) + ) + (when (time-elapsed? (the-as time-frame (the int (-> this jump-time))) (seconds 0.3)) + (when (and (time-elapsed? (-> this last-jump-speech-time) (seconds 10)) + (time-elapsed? (-> this last-land-speech-time) (seconds 4)) + (not (logtest? (rand-uint31-gen *random-generator*) 1)) + (>= (fabs (-> this controls steering)) 1.0) + ) + (talker-spawn-func + (-> *torpedo-speech-list* + (-> *torpedo-jump-speech* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *torpedo-jump-speech* length)) + ) + ) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + (set-time! (-> this last-jump-speech-time)) + ) + (set! (-> *target* pilot jumping?) #f) + (set! (-> this jump-state) (the-as uint 2)) + ) + ) + (when (and (= (-> this jump-state) 2) (< (+ -12288.0 f28-0) f30-0)) + (set! (-> this jump-state) (the-as uint 0)) + (set! (-> this jump-time) (the float (current-time))) + ) + ) + (cond + ((< f30-0 f28-0) + (set! (-> this down-force) (- (-> this down-force) (* 737280.0 arg0))) + (set! (-> this under-water?) #f) + (when (< -8192.0 (-> this down-force)) + (if (< (+ f28-0 (* (-> this down-force) arg0)) f30-0) + (set! (-> this down-force) 0.0) + ) + ) + ) + (else + (if (not (-> this under-water?)) + (set! (-> this down-force) (* 0.6 (-> this down-force))) + ) + (set! (-> this under-water?) #t) + (when (zero? (-> this jump-state)) + (let ((f26-0 5.0)) + (when (not (-> this on-water?)) + (set! f26-0 10.0) + (when (< (-> this down-force) -204800.0) + (let* ((f1-11 (* -0.0000012207031 (-> this down-force))) + (f24-0 (fmax 0.0 (fmin 1.0 f1-11))) + ) + (cpad-set-buzz! + (-> *cpad-list* cpads 0) + 1 + (the int (* 255.0 (lerp 0.6 1.0 f24-0))) + (the-as time-frame (the int (* 120.0 f24-0))) + ) + (let ((f22-2 (fmin 1.0 (lerp 0.6 1.4 f24-0)))) + (sound-play-by-name + (static-sound-name "rocket-bounce") + (new-sound-id) + (the int (* 1024.0 f22-2)) + 0 + 0 + (sound-group) + #t + ) + ) + (when (and (time-elapsed? (-> this last-land-speech-time) (seconds 10)) + (time-elapsed? (-> this last-jump-speech-time) (seconds 4)) + (not (logtest? (rand-uint31-gen *random-generator*) 3)) + ) + (talker-spawn-func + (-> *torpedo-speech-list* + (-> *torpedo-land-speech* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *torpedo-land-speech* length)) + ) + ) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + (set-time! (-> this last-land-speech-time)) + ) + (if (< 0.2 f24-0) + (activate! *camera-smush-control* 819.2 45 75 1.0 0.9 (-> *display* camera-clock)) + ) + ) + ) + ) + (when (-> this on-water?) + (let ((f0-42 (* -0.0000012207031 (-> this down-force)))) + (if (< 0.1 f0-42) + (set! (-> this spawn-splash?) #t) + ) + ) + ) + (when (and (-> this on-water?) (>= (current-time) (-> this next-bob-cam-time))) + (let ((f0-44 (* -0.0000012207031 (-> this down-force)))) + (cond + ((< 0.2 f0-44) + (let ((f24-1 (fmax 0.0 (fmin 1.0 f0-44))) + (s4-6 (+ (logand 0 (rand-uint31-gen *random-generator*)) 450)) + ) + (set! (-> this next-bob-cam-time) (+ (current-time) (the-as time-frame s4-6))) + (activate! + *camera-smush-control* + (* 6553.6 (lerp 0.2 1.0 f24-1)) + (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 61) 180) + (the-as int s4-6) + 1.0 + 0.95 + (-> *display* camera-clock) + ) + ) + ) + (else + 300 + ) + ) + ) + ) + (let ((f1-22 (+ (* 80.0 (- f30-0 f28-0) f26-0) (* -5.0 (-> this down-force) f26-0)))) + (set! (-> this down-force) (+ (-> this down-force) (* arg0 f1-22))) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 31 of type htorpedo +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 31 htorpedo) has a return type of none, but the expression builder found a return statement. +(defmethod apply-gravity! ((this htorpedo) (arg0 float)) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'hide)) + (set! (-> this rbody lin-momentum quad) (the-as uint128 0)) + ) + ((and (-> this next-state) (= (-> this next-state name) 'waiting)) + (set! (-> this rbody lin-momentum quad) (the-as uint128 0)) + (return 0) + ) + ((not (and (-> this next-state) (= (-> this next-state name) 'player-control))) + (call-parent-method this arg0) + ) + (else + (update-sound this) + (cond + (#t + (htorpedo-method-168 this arg0) + (htorpedo-method-166 this arg0) + ) + (else + (htorpedo-method-167 this arg0) + ) + ) + (set! (-> this target-turn-rate) + (* 10922.667 (fabs (-> this controls steering)) (-> this controls steering) PHYSICS_SCALAR) + ) + (seek! (-> this speed) (-> this target-speed) (* 163840.0 (seconds-per-frame) PHYSICS_SCALAR)) + (set! (-> this turn-rate) (lerp (-> this turn-rate) (-> this target-turn-rate) (* 1.5 PHYSICS_SCALAR arg0))) + (set! (-> this target-roll) (* -0.5625 (-> this turn-rate))) + (seek! (-> this roll) (-> this target-roll) (* 10012.444 arg0 PHYSICS_SCALAR)) + (set! (-> this based-cam-roll) + (lerp (-> this based-cam-roll) (-> this target-turn-rate) (* PHYSICS_SCALAR arg0)) + ) + (set! (-> this target-cam-roll) (* -0.75 (/ 1.0 PHYSICS_SCALAR) (-> this based-cam-roll))) + (seek! (-> this cam-roll) (-> this target-cam-roll) (* 10012.444 arg0 PHYSICS_SCALAR)) + (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this last-quat))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (quaternion-look-at! (the-as quaternion (-> this rbody rot)) s3-0 *up-vector*) + (quaternion-rotate-y! + (the-as quaternion (-> this rbody rot)) + (the-as quaternion (-> this rbody rot)) + (* arg0 (-> this turn-rate)) + ) + (quaternion-rotate-local-x! + (the-as quaternion (-> this rbody rot)) + (the-as quaternion (-> this rbody rot)) + (-> this pitch) + ) + (vector-z-quaternion! s4-0 (the-as quaternion (-> this rbody rot))) + (vector-float*! (-> this rbody lin-momentum) s4-0 (* (-> this speed) (-> this info info mass))) + ) + (+! (-> this rbody lin-momentum y) (* 0.5 (-> this down-force) (-> this info info mass))) + (if (< (-> this rbody position y) -6144.0) + (set! (-> this rbody lin-momentum y) (fmax 0.0 (-> this rbody lin-momentum y))) + ) + (quaternion-rotate-local-z! + (the-as quaternion (-> this rbody rot)) + (the-as quaternion (-> this rbody rot)) + (-> this roll) + ) + (quaternion-copy! (-> this last-quat) (the-as quaternion (-> this rbody rot))) + ) + ) + 0 + (none) + ) + +;; definition for method 132 of type htorpedo +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-method-132 ((this htorpedo) (arg0 traffic-object-spawn-params)) + (set! (-> this speed) 0.0) + (set! (-> this target-speed) 286720.0) + (set! (-> this max-pitch) 3640.889) + (set! (-> this roll) 0.0) + (set! (-> this target-roll) 0.0) + (set! (-> this target-pitch) 0.0) + (set! (-> this pitch) 0.0) + (set! (-> this cam-pitch) 0.0) + (set! (-> this down-force) 0.0) + (set! (-> this ground-offset) 12288.0) + (quaternion-copy! (the-as quaternion (-> this rbody rot)) (-> this root quat)) + (quaternion-copy! (-> this last-quat) (the-as quaternion (-> this rbody rot))) + (go (method-of-object this idle)) + (none) + ) + +;; failed to figure out what this is: +(defstate waiting (htorpedo) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('boost) + (set! (-> self target-speed) (+ (-> self target-speed) (the-as float (-> block param 0)))) + ) + (else + (vehicle-event-handler proc argc message block) + ) + ) + ) + :trans (behavior () + '() + ) + ) + +;; failed to figure out what this is: +(defstate hide (htorpedo) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 2)) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate player-control (htorpedo) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('boost) + (+! (-> self target-speed) (the-as float (-> block param 0))) + (set! (-> self target-speed) (fmin 335872.0 (-> self target-speed))) + (format 0 "Current speed is ~f~%" (-> self target-speed)) + ) + (('hide) + (go-virtual hide) + ) + (else + (vehicle-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self speed) 0.0) + (set! (-> self jump-state) (the-as uint 2)) + (set! (-> self jump-time) 0.0) + (set! (-> *target* pilot jumping?) #f) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + ) + :post (behavior () + (control-hook-player self) + (vehicle-method-117 self) + ) + ) + +;; failed to figure out what this is: +(defstate explode (htorpedo) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (dotimes (gp-0 (-> self info rider seat-count)) + (send-event + (handle->process (-> self rider-array gp-0)) + 'attack-invinc + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'instant-death) + ) + ) + ) + (put-rider-in-seat self gp-0 (the-as process #f)) + ) + (logior! (-> *target* draw status) (draw-control-status no-draw)) + (logior! (-> self focus-status) (focus-status dead)) + (set! (-> self crash-level) 3) + (set! (-> self force-level) 3) + (logclear! (-> self v-flags) (vehicle-flag persistent player-driving net-player-driving)) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag lights-dead) (-> self v-flags)))) + (vehicle-method-126 self) + (sound-play "rocket-explode") + (vehicle-method-106 self) + (vehicle-method-100 self) + (sound-stop (-> self thrust-sound)) + (sound-stop (-> self ground-sound)) + (sound-stop (-> self evasive-sound)) + (sound-stop (-> self wake-sound)) + (let ((v1-45 + (cond + ((logtest? (-> *part-group-id-table* 529 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 529)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 529)) + ) + ) + ) + ) + (send-event (ppointer->process v1-45) 'clock self) + ) + (go-virtual die) + ) + ) + +;; definition for symbol *h-torpedo-constants*, type rigid-body-vehicle-constants +(define *h-torpedo-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 50.0 + :inv-mass 0.02 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-torpedo-constants* + :flags #x400 + :object-type (traffic-type civilian-bike-c) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 17294.223 + :max-fov 18204.445 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 3640.889 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :thruster-flame-width (meters 0.25) + :thruster-flame-length (meters 4) + :thruster-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :exhaust-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :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 :w 1.0) (new 'static 'vector :w 1.0)) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 60.0 + :inv-hit-points 0.016666668 + :hit-threshold 122880.0 + :hit-small 122880.0 + :hit-big 122880.0 + :hit-deadly 122880.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 8192.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 8192.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y -327.68 :z 1318.912 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *h-torpedo-constants* explosion) *h-bike-explosion-info*) + +;; failed to figure out what this is: +(defskelgroup skel-h-torpedo cty-dax-missile cty-dax-missile-lod0-jg cty-dax-missile-idle-ja + ((cty-dax-missile-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.4) + :origin-joint-index 3 + ) + +;; definition of type light-trail-tracker-torpedo +(deftype light-trail-tracker-torpedo (light-trail-tracker) + () + ) + +;; definition for method 3 of type light-trail-tracker-torpedo +(defmethod inspect ((this light-trail-tracker-torpedo)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type light-trail-tracker inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 17 of type light-trail-tracker-torpedo +(defmethod light-trail-tracker-method-17 ((this light-trail-tracker-torpedo) (arg0 process-focusable)) + (let ((v1-0 arg0)) + (and (-> (the-as htorpedo v1-0) on-water?) (< (-> v1-0 root trans y) 20480.0)) + ) + ) + +;; definition for method 16 of type light-trail-tracker-torpedo +;; INFO: Used lq/sq +(defmethod light-trail-tracker-method-16 ((this light-trail-tracker-torpedo) (arg0 process-focusable) (arg1 vector)) + (let ((v1-0 arg0)) + (when v1-0 + (set! (-> arg1 quad) (-> v1-0 root trans quad)) + (set! (-> arg1 y) 4505.6) + (vector+float*! arg1 arg1 (-> v1-0 node-list data 0 bone transform fvec) 49152.0) + ) + ) + arg1 + ) + +;; definition for method 35 of type htorpedo +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod init-rbody-control! ((this htorpedo)) + (with-pp + (set! (-> pp level) (level-get *level* 'lctypatk)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-torpedo" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this override-camera?) #f) + (logior! (-> *h-torpedo-constants* flags) 1024) + (alloc-rbody-control! this *h-torpedo-constants*) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this thrust-sound) (new-sound-id)) + (set! (-> this ground-sound) (new-sound-id)) + (set! (-> this evasive-sound) (new-sound-id)) + (set! (-> this wake-sound) (new-sound-id)) + (set! (-> this heat-haze) (create-launch-control (-> *part-group-id-table* 526) this)) + (let* ((s5-1 (-> this heat-haze)) + (s4-1 (method-of-object s5-1 set-local-space-info)) + (s3-0 (add-connection *part-local-space-engine* this local-space-proc-joint 0 0 0)) + ) + (let ((v1-19 (process->handle this))) + (if (= v1-19 #f) + (set! v1-19 (process->handle this)) + ) + (set! (-> (the-as particle-local-space-info s3-0) hand) (the-as handle v1-19)) + ) + (matrix-identity! (-> (the-as particle-local-space-info s3-0) mat-new)) + (matrix-identity! (-> (the-as particle-local-space-info s3-0) mat-prev)) + (set! (-> (the-as particle-local-space-info s3-0) flags) (part-local-space-flags)) + (s4-1 s5-1 (the-as particle-local-space-info s3-0)) + ) + (let ((s5-2 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> s5-2 tracked-obj) (process->handle this)) + (set! (-> s5-2 appearance) *torpedo-wake-trail*) + (set! (-> s5-2 max-num-crumbs) (the int (* 0.5 (the float (-> s5-2 appearance max-age))))) + (set! (-> s5-2 track-immediately?) #t) + (let* ((v1-34 (estimate-light-trail-mem-usage + (the-as uint (-> s5-2 max-num-crumbs)) + (the-as uint (= (-> s5-2 appearance lie-mode) 3)) + ) + ) + (s4-2 (get-process *default-dead-pool* light-trail-tracker-torpedo (+ v1-34 8192) 1)) + ) + (when s4-2 + (let ((t9-15 (method-of-type process activate))) + (t9-15 s4-2 this "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-2 light-trail-tracker-init-by-other s5-2) + (-> s4-2 ppointer) + ) + ) + ) + (none) + ) + ) + +;; definition for method 88 of type htorpedo +;; WARN: Return type mismatch symbol vs none. +(defmethod vehicle-method-88 ((this htorpedo) (arg0 vehicle-controls)) + (call-parent-method this arg0) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag camera-look-mode) (-> this v-flags)))) + (if (cpad-pressed? 0 x) + (set! (-> this want-jump?) #t) + (set! (-> this want-jump?) #f) + ) + (none) + ) + +;; definition for method 78 of type htorpedo +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 78 htorpedo) has a return type of none, but the expression builder found a return statement. +(defmethod vehicle-method-78 ((this htorpedo)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'player-control))) + (return 0) + ) + (when (and (-> this on-water?) (= (-> this jump-state) 0)) + ) + (when (-> this spawn-splash?) + (if (logtest? (-> *part-group-id-table* 528 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 528) + :target this + :mat-joint (the-as object 0) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 528) + :target this + :mat-joint (the-as object 0) + ) + ) + (sound-play "rocket-splash") + (set! (-> this spawn-splash?) #f) + ) + (if (and (-> this on-water?) (< (-> this root trans y) 20480.0)) + (sound-play "rocket-wake" :id (-> this wake-sound)) + (sound-stop (-> this wake-sound)) + ) + (spawn-from-mat (-> this heat-haze) (-> this node-list data 0 bone transform)) + (none) + ) + +;; definition for method 94 of type htorpedo +;; INFO: Used lq/sq +;; WARN: Return type mismatch number vs none. +;; WARN: Function (method 94 htorpedo) has a return type of none, but the expression builder found a return statement. +(defmethod vehicle-method-94 ((this htorpedo)) + (if (-> this override-camera?) + (return 0) + ) + 0.0 + (let ((a0-1 *camera*)) + (when a0-1 + (let ((a0-2 (-> a0-1 slave))) + (if a0-2 + (-> a0-2 0 saved-pt y) + ) + ) + ) + ) + (call-parent-method this) + (when (logtest? (vehicle-flag camera-look-mode) (-> this v-flags)) + (let ((gp-0 *camera*)) + (when gp-0 + (let ((s3-0 (-> gp-0 slave))) + (when s3-0 + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let ((s1-0 (new 'stack-no-clear 'quaternion)) + (s2-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (the-as quaternion (-> this rbody rot)))) + ) + (set! (-> s2-0 y) 0.0) + (vector-normalize! s2-0 1.0) + (quaternion-look-at! s1-0 s2-0 *up-vector*) + (quaternion-rotate-local-x! s1-0 s1-0 (-> this cam-pitch)) + (quaternion-rotate-local-z! s1-0 s1-0 (-> this cam-roll)) + (quaternion-normalize! s1-0) + (quaternion->matrix s5-0 s1-0) + (set! (-> s5-0 trans quad) (-> this rbody matrix trans quad)) + (vector-matrix*! (-> s3-0 0 saved-pt) (the-as vector (-> this info camera look-pos-array)) s5-0) + (vector+float*! (-> s3-0 0 saved-pt) (-> s3-0 0 saved-pt) s2-0 0.0) + ) + (let ((v1-18 (-> s3-0 0 tracking))) + (set! (-> v1-18 inv-mat rvec quad) (-> s5-0 rvec quad)) + (set! (-> v1-18 inv-mat uvec quad) (-> s5-0 uvec quad)) + (set! (-> v1-18 inv-mat fvec quad) (-> s5-0 fvec quad)) + ) + ) + (set! (-> gp-0 slave 0 saved-pt y) (fmax 6144.0 (-> gp-0 slave 0 saved-pt y))) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 49 of type htorpedo +(defmethod rbody-event-handler ((this htorpedo) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (with-pp + (when (= arg2 'pilot-on) + (nop!) + 0 + ) + (case arg2 + (('attack) + (if (not (and (-> this next-state) (= (-> this next-state name) 'player-control))) + (return #f) + ) + (call-parent-method this arg0 arg1 arg2 arg3) + ) + (('hide) + (set! v0-0 (logior (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('show) + (set! v0-0 (logclear (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('touch 'touched) + (cond + ((or (type? arg0 krimson-wall) (type? arg0 blocking-plane)) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer pp)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'nuke-hit) + (set! (-> a1-6 param 0) (the-as uint #t)) + (let ((t9-4 send-event-function) + (v1-23 (-> *game-info* sub-task-list (game-task-node city-port-attack-resolution))) + ) + (t9-4 + (handle->process (if (-> v1-23 manager) + (-> v1-23 manager manager) + (the-as handle #f) + ) + ) + a1-6 + ) + ) + ) + ) + ((type? arg0 crimson-guard) + (sound-play "crims-nuke-hit") + ) + ) + (call-parent-method this arg0 arg1 arg2 arg3) + ) + (('allow-dismount) + (set! v0-0 (logand -1025 (-> *h-torpedo-constants* flags))) + (set! (-> *h-torpedo-constants* flags) (the-as uint v0-0)) + v0-0 + ) + (('override-camera) + (set! v0-0 (-> arg3 param 0)) + (set! (-> this override-camera?) (the-as symbol v0-0)) + v0-0 + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +;; definition for method 34 of type htorpedo +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this htorpedo)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (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 action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 13312.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 4505.6 4300.8) + (set! (-> v1-11 nav-radius) 7577.6) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 9011.2 3686.4) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 170 of type htorpedo +;; WARN: Return type mismatch connection vs none. +(defmethod update-sound ((this htorpedo)) + (let ((f30-0 0.0)) + (set! f30-0 (cond + ((not (-> this on-water?)) + (let ((f30-1 (- (-> this root trans y) (-> this ground-height)))) + 0.0 + (let* ((f1-3 (* 0.000061035156 (+ -12288.0 f30-1))) + (f0-4 (fmax 0.0 (fmin 1.0 f1-3))) + (f0-5 (- 1.0 f0-4)) + (f0-6 (lerp 0.0 0.15 f0-5)) + ) + (seek! (-> this reverb-dest) f0-6 (* 2.0 (seconds-per-frame))) + ) + (let* ((f1-10 (* 0.000013563368 (+ -12288.0 f30-1))) + (f0-12 (fmax 0.0 (fmin 1.0 f1-10))) + ) + (- 1.0 f0-12) + ) + ) + ) + (else + (seek! (-> this reverb-dest) 0.0 (* 0.1 (seconds-per-frame))) + f30-0 + ) + ) + ) + (if (< f30-0 (-> this ground-vol-current)) + (seek! (-> this ground-vol-current) f30-0 (* 0.4 (seconds-per-frame))) + (seek! (-> this ground-vol-current) f30-0 (* 5.4 (seconds-per-frame))) + ) + ) + (let* ((f0-27 (* 0.00000012207032 (-> this rbody lin-momentum y))) + (f0-29 (fmax -1.0 (fmin 1.0 f0-27))) + (f0-30 (* 0.5 f0-29)) + ) + (if (< f0-30 (-> this pitch-current)) + (seek! (-> this pitch-current) f0-30 (* 0.25 (seconds-per-frame))) + (seek! (-> this pitch-current) f0-30 (* 4.0 (seconds-per-frame))) + ) + ) + (let* ((f1-25 (* 0.00000012207032 (-> this rbody lin-momentum y))) + (f30-2 (fmax 0.0 (fmin 1.0 f1-25))) + ) + (sound-play-by-name + (static-sound-name "rocket-ground") + (-> this ground-sound) + (the int (* 1024.0 (-> this ground-vol-current))) + 0 + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "rocket-thrust") + (-> this thrust-sound) + (the int (* 1024.0 (lerp 0.75 1.0 f30-2))) + (the int (* 1524.0 (-> this pitch-current))) + 0 + (sound-group) + #t + ) + ) + (let ((f0-49 (if (< 0.0 (-> this controls steering)) + 1.0 + -1.0 + ) + ) + (f30-3 0.0) + ) + (let ((f1-30 (-> this controls steering))) + (set! f30-3 (cond + ((!= (-> this last-slice-val) 0.0) + (let ((f1-32 (fabs (- (-> this last-slice-val) f1-30)))) + (cond + ((< 1.0 f1-32) + (set! (-> this last-slice-val) 0.0) + f30-3 + ) + (else + (set! (-> this last-slice-val) f0-49) + (lerp 1.0 0.0 f1-32) + ) + ) + ) + ) + (else + (when (< 0.15 (fabs f1-30)) + (set! (-> this last-slice-val) f0-49) + (set! f30-3 1.0) + ) + f30-3 + ) + ) + ) + ) + (cond + ((< 0.0 f30-3) + (let ((f28-1 (lerp 0.0 1.0 f30-3)) + (f30-4 (lerp 0.0 0.2 f30-3)) + ) + (let ((f0-53 (- 1.0 (* (- 1.0 f28-1) (- 1.0 f28-1))))) + (if (< (-> this evasive-volume) f0-53) + (set! (-> this evasive-volume) f0-53) + (seek! (-> this evasive-volume) f0-53 (seconds-per-frame)) + ) + ) + (sound-play-by-name + (static-sound-name "rocket-slice") + (-> this evasive-sound) + (the int (* 1024.0 (-> this evasive-volume))) + (the int (* 1524.0 f30-4)) + 0 + (sound-group) + #t + ) + ) + ) + (else + (seek! (-> this evasive-volume) 0.0 (seconds-per-frame)) + (sound-stop (-> this evasive-sound)) + ) + ) + ) + (set-setting! 'sound-reverb 'abs (-> this reverb-dest) 0) + (none) + ) + +;; definition for method 129 of type htorpedo +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-129 ((this htorpedo)) + (when (and (logtest? (vehicle-flag player-driving) (-> this v-flags)) *target* (!= (-> this crash-level) 3)) + (if (focus-test? *target* pilot-riding) + (vehicle-method-134 this) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type htorpedo +(defmethod deactivate ((this htorpedo)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this heat-haze)) + (kill-particles (-> this heat-haze)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type htorpedo +(defmethod relocate ((this htorpedo) (offset int)) + (if (nonzero? (-> this heat-haze)) + (&+! (-> this heat-haze) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 38 of type htorpedo +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-38 ((this htorpedo)) + 0 + (none) + ) + +;; definition for method 50 of type htorpedo +(defmethod attack-handler ((this htorpedo) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + (local-vars (v0-0 symbol)) + (cond + ((logtest? (penetrate jak-dark-nuke) arg3) + (return #f) + v0-0 + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/port/ctyport-part_REF.gc b/test/decompiler/reference/jak3/levels/city/port/ctyport-part_REF.gc new file mode 100644 index 0000000000..65ddf5fe70 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/port/ctyport-part_REF.gc @@ -0,0 +1,2864 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-roundvent + :id 1030 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3763 :fade-after (meters 250) :falloff-to (meters 180) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-roundvent-small + :id 1031 + :flags (sp4 sp7) + :bounds (static-bspherem 0 0 0 12) + :scale (0.625 0.625 0.625) + :parts ((sp-item 3763 :fade-after (meters 250) :falloff-to (meters 150) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3763 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -2) (meters 4)) + (:y (meters -1.5) 3 (meters 1.5)) + (:z (meters -2) (meters 1)) + (:scale-x (meters 4) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-y (meters -0.083333336) (meters -0.016666668)) + (:vel-z (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668) (meters 0.023333333)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00083333335) (meters 0.00083333335)) + (:friction 0.95 0.025) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3764) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3764 + :init-specs ((:fade-a -0.16 -0.16)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-low-vent + :id 1032 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3765 :fade-after (meters 200) :falloff-to (meters 140) :flags (sp7)) + (sp-item 3766 :fade-after (meters 200) :falloff-to (meters 140) :flags (sp7)) + (sp-item 3767 :fade-after (meters 200) :falloff-to (meters 140) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3765 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0 1.0) + (:x (meters -0.1) 9829 (meters 0.00024414062)) + (:y (meters 0.6) (meters 0.7)) + (:z (meters 1.6)) + (:scale-x (meters 0.75) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.005)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3768) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 45)) + ) + ) + +;; failed to figure out what this is: +(defpart 3766 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0 1.0) + (:x (meters -1.2) 9829 (meters 0.00024414062)) + (:y (meters 0.6) (meters 0.7)) + (:z (meters 1.1)) + (:scale-x (meters 0.75) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.005)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3768) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3767 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0 1.0) + (:x (meters -2.3) 9829 (meters 0.00024414062)) + (:y (meters 0.6) (meters 0.7)) + (:z (meters 1.6)) + (:scale-x (meters 0.75) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.005)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3768) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees -45)) + ) + ) + +;; failed to figure out what this is: +(defpart 3768 + :init-specs ((:fade-a -0.032 -0.032)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-waterspout + :id 1033 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3769 :fade-after (meters 140) :falloff-to (meters 120) :flags (sp7)) + (sp-item 3770 :fade-after (meters 100) :falloff-to (meters 80) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3771 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 3.0 1.0) + (:x (meters -0.05) (meters 0.1)) + (:y (meters -0.05) (meters 0.1)) + (:z (meters -0.5)) + (:scale-x (meters 0.35) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3772) + (:launchrot-x (degrees -7.0000005) (degrees 14.000001)) + (:launchrot-y (degrees -7.0000005) (degrees 14.000001)) + ) + ) + +;; failed to figure out what this is: +(defpart 3772 + :init-specs ((:r 255.0) (:g 128.0) (:b 64.0) (:next-time (seconds 0.017)) (:next-launcher 3773)) + ) + +;; failed to figure out what this is: +(defpart 3773 + :init-specs ((:r 128.0) (:g 64.0) (:b 32.0) (:next-time (seconds 0) (seconds 0.747)) (:next-launcher 3772)) + ) + +;; definition for function check-drop-level-ctyport-drop-userdata +;; INFO: Used lq/sq +(defun check-drop-level-ctyport-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (< (-> arg2 y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 3774) s3-0) + (launch-particles (-> *part-id-table* 3775) s3-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 3776) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 3769 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 1.0) + (:x (meters -0.05) (meters 0.1)) + (:y (meters -0.05) (meters 0.1)) + (:z (meters -0.5)) + (:scale-x (meters 0.35) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-ctyport-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3772) + (:launchrot-x (degrees -7.0000005) (degrees 14.000001)) + (:launchrot-y (degrees -7.0000005) (degrees 14.000001)) + ) + ) + +;; failed to figure out what this is: +(defpart 3770 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.35) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-ctyport-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3772) + (:launchrot-x (degrees -15) (degrees 30)) + (:launchrot-y (degrees -15) (degrees 30)) + ) + ) + +;; failed to figure out what this is: +(defpart 3774 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.25) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.0675)) + (:vel-y (meters 0.026666667) (meters 0.026666667)) + (:fade-a -0.21333334) + (:accel-y (meters -0.002) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3772) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3775 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -2) (meters 4)) + (:y (meters 0.25) (meters 0.75)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 8) (meters 0.3)) + (:scale-y (meters 4) (meters 0.3)) + (:r 64.0 64.0) + (:g 32.0 32.0) + (:b 16.0) + (:a 0.0) + (:vel-y (meters 0)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-y (meters 0) (meters 0.00006666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.2) (seconds 0.047)) + (:next-launcher 3777) + ) + ) + +;; failed to figure out what this is: +(defpart 3777 + :init-specs ((:fade-a -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 3776 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 1.0) + (:y (meters -0.2)) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 32.0 32.0) + (:b 16.0 16.0) + (:a 96.0 32.0) + (:vel-y (meters 0) (meters -0.006666667)) + (:scalevel-x (meters 0.026666667) (meters 0.013333334)) + (:scalevel-y (meters 0.026666667) (meters 0.013333334)) + (:fade-a -0.96 -0.96) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-chimney + :id 1034 + :flags (sp8) + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 3778 :fade-after (meters 950) :falloff-to (meters 950)) + (sp-item 3779 :fade-after (meters 900) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 3779 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 20263.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3778 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3780) + ) + ) + +;; failed to figure out what this is: +(defpart 3780 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3781)) + ) + +;; failed to figure out what this is: +(defpart 3781 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3782) + ) + ) + +;; failed to figure out what this is: +(defpart 3782 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3783) + ) + ) + +;; failed to figure out what this is: +(defpart 3783 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-chimney-smoke + :id 1035 + :flags (sp8) + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 3784 :fade-after (meters 950) :falloff-to (meters 950))) + ) + +;; failed to figure out what this is: +(defpart 3784 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3785) + ) + ) + +;; failed to figure out what this is: +(defpart 3785 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3786) + ) + ) + +;; failed to figure out what this is: +(defpart 3786 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-drip + :id 1036 + :duration (seconds 0.017) + :flags (sp0 sp4 sp6) + :bounds (static-bspherem 0 -12 0 24) + :rotate ((degrees 0) (degrees 180) (degrees 0)) + :parts ((sp-item 3787 :fade-after (meters 160) :falloff-to (meters 60) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3787 + :init-specs ((:texture (ctyport-muddrop ctyport-sprite)) + (:num 0.1) + (:y (meters 0.3)) + (:z (meters -0.45)) + (:scale-x (meters 0.3) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.03375)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'check-drop-level-ctyport-drop-userdata) + (:next-time (seconds 0) (seconds 1.997)) + (:next-launcher 3788) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3788 + :init-specs ((:accel-y (meters -0.0013333333)) (:friction 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-floor-vent + :id 1037 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3789 :fade-after (meters 200) :flags (sp6)) + (sp-item 3790 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 3789 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 12)) + (:rot-x (degrees 67.5)) + (:scale-y (meters 24)) + (:r 32.0) + (:g 192.0 16.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3790 + :init-specs ((:num 0.5) + (:x (meters 1) (meters 2.5)) + (:rot-x 7) + (:r 4096.0) + (:g 3072.0) + (:b 2867.2) + (:vel-y (meters 0.016666668) (meters 0.006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3791) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3791 + :init-specs ((:fade-b 1.3653333)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-floor-vent-small + :id 1038 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3792 :fade-after (meters 200) :flags (sp6)) + (sp-item 3793 :fade-after (meters 100) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 3792 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 8)) + (:rot-x (degrees 67.5)) + (:scale-y (meters 16)) + (:r 32.0) + (:g 192.0 16.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3793 + :init-specs ((:num 0.5) + (:x (meters -2) (meters 4)) + (:rot-x 7) + (:r 2457.6) + (:g 1843.2) + (:b 1720.32) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3791) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-red-big-lights-1 + :id 1039 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-red-big-lights-2 + :id 1040 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-red-big-lights-3 + :id 1041 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-red-big-lights-4 + :id 1042 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-red-big-lights-5 + :id 1043 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-red-big-lights-6 + :id 1044 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3794 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000) + ) + ) + +;; failed to figure out what this is: +(defpart 3794 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 27015.748)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3795) + ) + ) + +;; failed to figure out what this is: +(defpart 3795 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 3796) + ) + ) + +;; failed to figure out what this is: +(defpart 3796 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 3797) + ) + ) + +;; failed to figure out what this is: +(defpart 3797 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-big-lights-1 + :id 1045 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-big-lights-2 + :id 1046 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-big-lights-3 + :id 1047 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-big-lights-4 + :id 1048 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-big-lights-5 + :id 1049 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-big-lights-6 + :id 1050 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3798 :fade-after (meters 300) :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000) + ) + ) + +;; failed to figure out what this is: +(defpart 3798 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 0.0) + (:g 128.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 27015.748)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3795) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-red-lights + :id 1051 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3799 :fade-after (meters 80) :flags (sp6)) (sp-item 3800 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3799 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 32.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3800 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-lights + :id 1052 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3801 :fade-after (meters 80) :flags (sp6)) (sp-item 3802 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3801 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.05)) + (:scale-x (meters 1.4) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3802 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-long-blue-lights + :id 1053 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3803 :fade-after (meters 60) :flags (sp6 sp7)) + (sp-item 3804 :fade-after (meters 100) :flags (sp6 sp7)) + (sp-item 3805 :fade-after (meters 60) :flags (sp6 sp7)) + (sp-item 3806 :fade-after (meters 100) :flags (sp6 sp7)) + (sp-item 3807 :fade-after (meters 60) :flags (sp6 sp7)) + (sp-item 3808 :fade-after (meters 100) :flags (sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3803 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters 1.5)) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3804 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters 1.5)) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3805 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3806 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3807 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters -1.5)) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 32.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3808 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:z (meters -1.5)) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-green-lights + :id 1054 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3809 :fade-after (meters 100) :flags (sp6)) (sp-item 3810 :fade-after (meters 140) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3809 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.4)) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y (meters 3) (meters 0.1)) + (:r 0.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 24.0 4.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3810 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.05)) + (:scale-x (meters 6.5) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y (meters 12) (meters 0.1)) + (:r 0.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 8.0) + (:omega (degrees 3165.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-green-lights-2 + :id 1055 + :flags (sp8) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 3811 :fade-after (meters 100) :flags (sp6)) (sp-item 3812 :fade-after (meters 140) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3811 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.1)) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y (meters 2) (meters 0.1)) + (:r 0.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 24.0 4.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3812 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.01)) + (:scale-x (meters 4.3) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y (meters 8) (meters 0.1)) + (:r 0.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 6.0) + (:omega (degrees 3165.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-sign-arrows-8x4 + :id 1056 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3813 :flags (is-3d sp3 sp7)) + (sp-item 3814 :flags (is-3d sp3 sp7)) + (sp-item 3815 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3813 + :init-specs ((:texture (sign-arrows ctyport-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x10c00e00 -2139062144 0 1 #x10c00e00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3814 + :init-specs ((:texture (sign-arrows ctyport-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x10c00e00 -2139062144 0 1 #x10c00e00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for symbol *hiphog-exterior-marquee*, type (array (array object)) +(define *hiphog-exterior-marquee* + (the-as (array (array object)) + (new 'static 'boxed-array :type object + (the binteger 25) + (new 'static 'boxed-array :type object (the binteger 1) (new 'static 'vector4w :x #x1ffffff)) + (new 'static 'boxed-array :type object (the binteger 1) (new 'static 'vector4w)) + (new 'static 'boxed-array :type object + (the binteger 5) + (new 'static 'vector4w) + (new 'static 'vector4w :x #x1000001) + (new 'static 'vector4w :x #x1800003) + (new 'static 'vector4w :x #x1c00007) + (new 'static 'vector4w :x #x1e0000f) + (new 'static 'vector4w :x #x1f0001f) + (new 'static 'vector4w :x #x1f8003f) + (new 'static 'vector4w :x #x1fc007f) + (new 'static 'vector4w :x #x1fe00ff) + (new 'static 'vector4w :x #x1ff01ff) + (new 'static 'vector4w :x #x1ff83ff) + (new 'static 'vector4w :x #x1ffc7ff) + (new 'static 'vector4w :x #x1ffcfff) + (new 'static 'vector4w :x #x1ffffff) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'vector4w) + (new 'static 'vector4w :x #x3000) + (new 'static 'vector4w :x #x7800) + (new 'static 'vector4w :x #xcc00) + (new 'static 'vector4w :x #xc600) + (new 'static 'vector4w :x #x18300) + (new 'static 'vector4w :x #x30180) + (new 'static 'vector4w :x #x600c0) + (new 'static 'vector4w :x #xc0060) + (new 'static 'vector4w :x #x180030) + (new 'static 'vector4w :x #x300018) + (new 'static 'vector4w :x #x60000c) + (new 'static 'vector4w :x #xc00006) + (new 'static 'vector4w :x #x1800003) + (new 'static 'vector4w :x #x1000001) + (new 'static 'vector4w) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'vector4w :x #x8008) + (new 'static 'vector4w :x #x200100) + (new 'static 'vector4w :x #x4002) + (new 'static 'vector4w :x #x420400) + (new 'static 'vector4w :x #x80040) + (new 'static 'vector4w :x #x802004) + (new 'static 'vector4w :x #x100800) + (new 'static 'vector4w :x #x1010020) + (new 'static 'vector4w :x #x40081) + (new 'static 'vector4w :x #x1210) + ) + (new 'static 'boxed-array :type object + (the binteger 5) + (new 'static 'vector4w) + (new 'static 'vector4w :x 64) + (new 'static 'vector4w :x #xe0) + (new 'static 'vector4w :x #x1f0) + (new 'static 'vector4w :x #x3f8) + (new 'static 'vector4w :x #x7fc) + (new 'static 'vector4w :x #xffe) + (new 'static 'vector4w :x #x1fff) + (new 'static 'vector4w :x #x1fff) + ) + (new 'static 'boxed-array :type object + (the binteger 5) + (new 'static 'vector4w :x #x222000) + (new 'static 'vector4w :x #x444000) + (new 'static 'vector4w :x #x888000) + (new 'static 'vector4w :x #x1110000) + ) + (new 'static 'boxed-array :type object + (the binteger 15) + (new 'static 'vector4w :x #x1ffe000) + (new 'static 'vector4w :x #x1fff) + ) + ) + ) + ) + +;; definition for function ctyport-sparticle-mode-animate +;; WARN: Return type mismatch int vs none. +(defun ctyport-sparticle-mode-animate ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let ((a0-1 (-> arg1 key)) + (v1-0 (the-as object (-> arg1 user-float))) + ) + (when (nonzero? (the-as float v1-0)) + (let ((a1-2 (-> (the-as (array symbol) v1-0) 0 value))) + (when (nonzero? a1-2) + (let* ((a1-4 + (the-as + object + (-> (the-as + (pointer uint32) + (+ (* (min (the-as int (+ (-> a0-1 state-mode 0) 1)) (+ (-> (the-as (array int32) a1-2) length) -1)) 4) + (the-as int a1-2) + ) + ) + 3 + ) + ) + ) + (a1-5 + (-> (the-as + (array int32) + (+ (* (+ (mod + (the-as int (/ (-> a0-1 state-counter) (the-as uint (/ (-> (the-as (array int32) a1-4) 0) 8)))) + (+ (-> (the-as (array int32) a1-4) length) -1) + ) + 1 + ) + 4 + ) + (the-as uint a1-4) + ) + ) + 0 + ) + ) + (a0-9 (/ (-> (the-as (array int32) v1-0) 1) 8)) + (a1-7 (-> (the-as (pointer uint64) (+ a1-5 (the-as int (* (/ a0-9 64) 8)))) 0)) + (s3-1 (logtest? a1-7 (ash 1 (logand a0-9 63)))) + (s4-0 (if s3-1 + (-> (the-as (pointer int32) v1-0) 6) + (-> (the-as (pointer int32) v1-0) 5) + ) + ) + ) + (if (= a0-9 24) + (reset-marquee-color!) + ) + (cond + (s3-1 + (set! (-> arg2 r-g-b-a x) (rand-vu-float-range 64.0 192.0)) + (add-marquee-color! 0.044375 0.03 0.0) + ) + (else + (set! (-> arg2 r-g-b-a x) (rand-vu-float-range 32.0 48.0)) + ) + ) + (set! (-> arg2 r-g-b-a y) (-> arg2 r-g-b-a x)) + (set! (-> arg2 r-g-b-a z) (-> arg2 r-g-b-a x)) + (if (nonzero? s4-0) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id s4-0)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-hiphog-marquee-daxter + :id 1057 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 24) + :rotate ((degrees 0) (degrees -88.7) (degrees 0)) + :parts ((sp-item 3816 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3817 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3818 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3819 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3820 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3821 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3822 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3823 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3824 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3825 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3826 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3827 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3828 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3829 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3830 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3831 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3832 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3833 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3834 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3835 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3836 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3837 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3838 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3839 :flags (is-3d sp3 sp6 sp7)) + (sp-item 3840 :flags (is-3d sp3 sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3816 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + 0 + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -54.000004)) + ) + ) + +;; failed to figure out what this is: +(defpart 3817 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 1) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -45)) + ) + ) + +;; failed to figure out what this is: +(defpart 3818 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 2) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -36)) + ) + ) + +;; failed to figure out what this is: +(defpart 3819 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 3) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -27.000002)) + ) + ) + +;; failed to figure out what this is: +(defpart 3820 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 4) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -18)) + ) + ) + +;; failed to figure out what this is: +(defpart 3821 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 5) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -9)) + ) + ) + +;; failed to figure out what this is: +(defpart 3822 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 6) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3823 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 7) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 9)) + ) + ) + +;; failed to figure out what this is: +(defpart 3824 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 8) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 18)) + ) + ) + +;; failed to figure out what this is: +(defpart 3825 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 9) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 27.000002)) + ) + ) + +;; failed to figure out what this is: +(defpart 3826 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 10) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 36)) + ) + ) + +;; failed to figure out what this is: +(defpart 3827 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 11) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 45)) + ) + ) + +;; failed to figure out what this is: +(defpart 3828 + :init-specs ((:texture (hiphog-exterior-orange-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g 64.0 128.0) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 12) + (the binteger 35127552) + (the binteger 35127584) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 54.000004)) + ) + ) + +;; failed to figure out what this is: +(defpart 3829 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 13) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -49.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3830 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 14) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -40.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3831 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 15) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -31.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3832 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 16) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -22.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3833 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 17) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -13.500001)) + ) + ) + +;; failed to figure out what this is: +(defpart 3834 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 18) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees -4.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3835 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 19) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 4.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3836 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 20) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 13.500001)) + ) + ) + +;; failed to figure out what this is: +(defpart 3837 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 21) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 22.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3838 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 22) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 31.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3839 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 23) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 40.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3840 + :init-specs ((:texture (hiphog-exterior-yellow-on ctyport-sprite)) + (:num 1.0) + (:x (meters 15.5)) + (:y (meters 0.5)) + (:z (meters 0)) + (:scale-x (meters 2)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type object + '*hiphog-exterior-marquee* + (the binteger 24) + (the binteger 35127680) + (the binteger 35127712) + ) + ) + (:func 'ctyport-sparticle-mode-animate) + (:rotate-y (degrees 49.5)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-rubble-crater-smoke + :id 1058 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3841 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3841 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 1)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.005925926)) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.000033333334) (meters 0.00006666667)) + (:accel-y (meters 0.00033333333) (meters 0.000033333334)) + (:accel-z (meters -0.000033333334) (meters 0.00006666667)) + (:friction 0.94) + (:timer (seconds 10.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3842) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3842 + :init-specs ((:fade-a -0.024615385 -0.024615385)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-wreckage-smoke + :id 1059 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3843 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3843 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3844) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3844 + :init-specs ((:fade-a -0.11636364)) + ) + +;; definition for symbol *hiphog-exterior-marquee-group-ids*, type (array int32) +(define *hiphog-exterior-marquee-group-ids* (new 'static 'boxed-array :type int32 #x424)) + +;; definition for symbol *hiphog-exterior-marquee-daxter-group-ids*, type (array int32) +(define *hiphog-exterior-marquee-daxter-group-ids* (new 'static 'boxed-array :type int32 #x421)) + +;; definition of type hiphog-exterior-marquee +(deftype hiphog-exterior-marquee (process-drawable) + ((rot vector :inline) + (master-enable uint32) + (mode uint32 :offset 240) + (counter int32) + (parts sparticle-launch-control 1) + ) + (:state-methods + idle + ) + (:methods + (hiphog-exterior-marquee-method-21 (_type_) none) + ) + ) + +;; definition for method 3 of type hiphog-exterior-marquee +(defmethod inspect ((this hiphog-exterior-marquee)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Trot: ~`vector`P~%" (-> this rot)) + (format #t "~2Tmaster-enable: ~D~%" (-> this master-enable)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tmode: ~D~%" (-> this mode)) + (format #t "~2Tcounter: ~D~%" (-> this counter)) + (format #t "~2Tparts[1] @ #x~X~%" (-> this parts)) + (label cfg-4) + this + ) + +;; definition for method 10 of type hiphog-exterior-marquee +(defmethod deactivate ((this hiphog-exterior-marquee)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (dotimes (s5-0 1) + (let ((a0-1 (-> this parts s5-0))) + (if (nonzero? a0-1) + (kill-particles a0-1) + ) + ) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for method 7 of type hiphog-exterior-marquee +;; WARN: Return type mismatch process-drawable vs hiphog-exterior-marquee. +(defmethod relocate ((this hiphog-exterior-marquee) (offset int)) + (dotimes (v1-0 1) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) offset) + ) + ) + (the-as hiphog-exterior-marquee ((method-of-type process-drawable relocate) this offset)) + ) + +;; definition for method 21 of type hiphog-exterior-marquee +;; WARN: Return type mismatch symbol vs none. +(defmethod hiphog-exterior-marquee-method-21 ((this hiphog-exterior-marquee)) + (+! (-> this parts 0 state-counter) 1) + (when (!= (-> this parts 0 state-mode 0) (-> this mode)) + (set! (-> this parts 0 state-mode 0) (-> this mode)) + (set! (-> this parts 0 state-counter) (the-as uint 0)) + 0 + ) + (let ((s5-0 (-> this master-enable))) + (dotimes (s4-0 1) + (if (logtest? s5-0 1) + (spawn (-> this parts s4-0) (-> this root trans)) + ) + (set! s5-0 (shr s5-0 1)) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (hiphog-exterior-marquee) + :virtual #t + :code (behavior () + (until #f + (when (<= (-> self counter) 0) + (set! (-> self mode) (the-as uint (rand-vu-int-count 8))) + (let ((v0-1 (rand-vu-int-range 3 6)) + (a0-3 (-> *hiphog-exterior-marquee* (+ (-> self mode) 1))) + ) + (set! (-> self counter) (* v0-1 (* (+ (-> a0-3 length) -1) (the-as int (/ (the-as int (-> a0-3 0)) 8))))) + ) + (while (< (-> self counter) 120) + (set! (-> self counter) (* (-> self counter) 2)) + ) + ) + (+! (-> self counter) -1) + (hiphog-exterior-marquee-method-21 self) + (suspend) + ) + #f + ) + :post ja-post + ) + +;; definition for method 11 of type hiphog-exterior-marquee +(defmethod init-from-entity! ((this hiphog-exterior-marquee) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause enemy)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this master-enable) (the-as uint -1)) + (set! (-> this mode) (the-as uint (rand-vu-int-count 8))) + (let ((s5-1 *hiphog-exterior-marquee-daxter-group-ids*)) + (dotimes (s4-0 1) + (set! (-> this parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-0)) this)) + ) + ) + (go (method-of-object this idle)) + ) + +;; definition of type farthy +(deftype farthy (process-drawable) + ((new-trans-hook (function none)) + (cur-trans-hook (function none)) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type farthy +(defmethod inspect ((this farthy)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tnew-trans-hook: ~A~%" (-> this new-trans-hook)) + (format #t "~2Tcur-trans-hook: ~A~%" (-> this cur-trans-hook)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-farthy farthy -1 -1 ((-1 (meters 999999))) :bounds (static-spherem 0 8 0 11)) + +;; failed to figure out what this is: +(defskelgroup skel-mecha-daxter mecha-daxter mecha-daxter-lod0-jg mecha-daxter-idle-ja + ((mecha-daxter-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 0 11) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-broken-mdaxter broken-mdaxter broken-mdaxter-lod0-jg broken-mdaxter-idle-ja + ((broken-mdaxter-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 0 11) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (farthy) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans-hook) + (let ((v0-0 (-> block param 0))) + (set! (-> self new-trans-hook) (the-as (function none) v0-0)) + v0-0 + ) + ) + ) + ) + :trans (behavior () + (if (!= (-> self cur-trans-hook) (-> self new-trans-hook)) + (set! (-> self cur-trans-hook) (-> self new-trans-hook)) + ) + ((-> self cur-trans-hook)) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + ) + ) + +;; definition for method 11 of type farthy +(defmethod init-from-entity! ((this farthy) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this root pause-adjust-distance) 1228800.0) + (if (task-node-closed? (game-task-node city-hijack-vehicle-resolution)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-broken-mdaxter" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mecha-daxter" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (set! (-> this new-trans-hook) nothing) + (set! (-> this cur-trans-hook) nothing) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blinking-red-glow + :id 1061 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3845 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3845 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-citylights-blue-1 + :id 1062 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3846 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-citylights-blue-2 + :id 1063 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3846 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-citylights-blue-3 + :id 1064 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3846 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 800 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-citylights-blue-4 + :id 1065 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 3846 :flags (sp6) :period (seconds 5.335) :length (seconds 0.017) :offset 1200 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3846 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 3)) + (:r 0.0) + (:g 128.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.035)) + (:scalevel-y (meters 0.03)) + (:fade-a 0.08) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 3847) + ) + ) + +;; failed to figure out what this is: +(defpart 3847 + :init-specs ((:scale-y (meters 6)) + (:a 16.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 3848) + ) + ) + +;; failed to figure out what this is: +(defpart 3848 + :init-specs ((:scalevel-x (meters -0.035)) + (:scalevel-y (meters -0.03)) + (:fade-a -0.08) + (:next-time (seconds 0.335)) + (:next-launcher 3849) + ) + ) + +;; failed to figure out what this is: +(defpart 3849 + :init-specs ((:scale-y (meters 3)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-rubble-fire + :id 1066 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3850 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 3851 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7)) + (sp-item 3852 :falloff-to (meters 40) :flags (sp7)) + (sp-item 3843 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3851 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0 1.0) + (:x (meters -5) (meters 10)) + (:y (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 155.0) + (:g 164.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:accel-y (meters 0.0033333334) (meters 0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-color-rubble-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.6 :z -0.9 :w -1.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 30.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 120.0 :z 30.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.6666666 :y 3.333334 :z 9.999998 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-alpha-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 255.0 :z 256.0 :w 257.0) + :one-over-x-deltas (new 'static 'vector :x 127.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-rubble-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-rubble-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *r-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *g-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.7 :y 0.5 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x -0.19999999 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *b-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.6 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -1.6666666 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-alpha-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.5 :w -1.0) + :ys (new 'static 'vector :y 0.5 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6666666 :y 2.5000002 :z -2.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-scale-rubble-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 0.3 :w 1.3) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y -1.4 :z 0.99999994 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-scale-rubble-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 2.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-ctyport-rubble-fire-flame-curve-settings*, type particle-curve-settings +(define *part-ctyport-rubble-fire-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.4) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 3851 init-specs 16 initial-valuef) + (the-as float *part-ctyport-rubble-fire-flame-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* color-start) *range-color-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* alpha-start) *range-alpha-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* scale-x-start) *range-scale-rubble-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* scale-y-start) *range-scale-rubble-flame-y*) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* r-scalar) *r-curve-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* g-scalar) *g-curve-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* b-scalar) *b-curve-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* a-scalar) *curve-alpha-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* scale-x-scalar) *curve-scale-rubble-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-ctyport-rubble-fire-flame-curve-settings* scale-y-scalar) *curve-scale-rubble-flame-y*) + +;; failed to figure out what this is: +(defpart 3853 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:y (meters -1)) + (:scale-x (meters 7) (meters 7)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-y (meters -0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters -0.016666668)) + (:fade-r 0.33333334) + (:fade-g -0.083333336) + (:fade-b -1.875) + (:fade-a 0.42666668) + (:accel-y (meters 0.00033333333) (meters 0.005)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 3854) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 1) (meters 10)) + ) + ) + +;; failed to figure out what this is: +(defpart 3854 + :init-specs ((:scalevel-x (meters -0.016666668)) (:fade-a -0.425 -0.425)) + ) + +;; failed to figure out what this is: +(defpart 3852 + :init-specs ((:num 1.0) + (:x (meters -6) (meters 12)) + (:y (meters -1) (meters 6)) + (:z (meters -3) (meters 6)) + (:rot-x 8) + (:r 12288.0) + (:g 2048.0) + (:b 2048.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:fade-g 6.826667) + (:accel-y (meters 0.0016666667) (meters 0.00033333333)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 3855) + ) + ) + +;; failed to figure out what this is: +(defpart 3855 + :init-specs ((:fade-g -6.826667)) + ) + +;; failed to figure out what this is: +(defpart 3850 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.2) + (:y (meters 2)) + (:scale-x (meters 20)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 10.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-red-tits-glow + :id 1067 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3856 :fade-after (meters 500) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3856 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5.5) (meters 0.2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-yellow-glow-pulse + :id 1068 + :flags (sp0) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3857 :fade-after (meters 500) :flags (sp6) :period (seconds 2) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 3857 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.4)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 120.0) + (:b 0.0) + (:a 1.0) + (:omega (degrees 11261.25)) + (:fade-a 0.13) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:next-time (seconds 1)) + (:next-launcher 3858) + ) + ) + +;; failed to figure out what this is: +(defpart 3858 + :init-specs ((:fade-a -0.13333334)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-blue-glow + :id 1069 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 3859 :fade-after (meters 500) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 3859 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 158.0) + (:a 40.0 10.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/city/port/ctyport-scenes_REF.gc b/test/decompiler/reference/jak3/levels/city/port/ctyport-scenes_REF.gc new file mode 100644 index 0000000000..23293de273 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/port/ctyport-scenes_REF.gc @@ -0,0 +1,1784 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-broken-mdaxter-movie broken-mdaxter broken-mdaxter-lod0-jg broken-mdaxter-idle-ja + ((broken-mdaxter-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 300) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-missile-launcher-movie cty-dax-missile-launcher cty-dax-missile-launcher-lod0-jg cty-dax-missile-launcher-idle-ja + ((cty-dax-missile-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "city-port-attack-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-125" + :art-group "scenecamera" + :anim "city-port-attack-res" + :parts 7 + :command-list '((0 + (kill "tpl-glider-broken-1") + (send-event "krimson-wall-8" 'kill) + (send-event "krimson-wall-9" 'kill) + (send-event "krimson-wall-10" 'kill) + (part-tracker + "group-fma-missile-thruster-fire" + entity + "h-torpedo" + joint + "main" + track + #t + duration + (frame-range 0 93) + ) + (part-tracker + "group-hijak-fma-missile-trail" + entity + "h-torpedo" + joint + "main" + track + #t + duration + (frame-range 0 93) + subsample-num + (new 'static 'bfloat :data 10.0) + ) + ) + (65 + (part-tracker + "group-krimson-wall-fma" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-range 65 66) + ) + ) + (93 + (part-tracker + "group-fma-barrier-explosion-big" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 93 123) + ) + ) + (384 + (part-tracker + "group-scenes-daxter-crush-dust" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 384 385) + ) + ) + (410 (fadeout (frame-time-30 10))) + (10000 + (task-close! "city-port-attack-resolution") + (apply + ,(lambda :behavior scene-player + () + (send-event *target* 'change-mode 'normal) + (logclear! (-> *target* draw status) (draw-control-status no-draw)) + (none) + ) + ) + ) + ) + :cut-list '(65 176 284) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'lpatkcs + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'lpatkcs + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-torpedo" + :level 'lctypatk + :art-group "skel-h-torpedo" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'lctypatk + :art-group "skel-krimson-wall-break" + :prefix "" + :draw-frames '((65 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'lctypatk + :art-group "skel-krimson-wall-break" + :prefix "a-" + :draw-frames '((65 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "krimson-wall-break" + :level 'lctypatk + :art-group "skel-krimson-wall-break" + :prefix "b-" + :draw-frames '((65 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctyport-attack-res" + :end-point "ctyport-attack-res" + :borrow '((ctywide 4 lctypatk special) + (ctywide-ff alias ctywide copy ctypesa special ctycarb special lpatkcs special) + ) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "city-hijack-vehicle-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-93" + :art-group "scenecamera" + :anim "city-hijack-vehicle-res" + :parts 4 + :command-list '((0 (apply ,(lambda :behavior scene-player () (kill-by-type h-kg-pickup *active-pool*) (none)))) + (10 + (part-tracker + "group-fma-missile-thruster-fire" + entity + "cty-hijack-missile" + joint + "main" + track + #t + duration + (frame-range 0 239) + ) + (part-tracker + "group-hijak-fma-missile-trail" + entity + "cty-hijack-missile" + joint + "main" + track + #t + duration + (frame-range 0 239) + subsample-num + (new 'static 'bfloat :data 10.0) + ) + (kill "farthy-1") + ) + (70 + (send-event + "mecha-daxter" + 'trans-hook + ,(lambda :behavior scene-player + () + (vector-seek! + (-> self draw color-emissive) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (* 4.0 (seconds-per-frame)) + ) + (none) + ) + ) + ) + (180 + (send-event + "mecha-daxter" + 'trans-hook + ,(lambda :behavior scene-player () (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) (none)) + ) + ) + (239 + (part-tracker + "group-daxter-sign-explosion" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 239 290) + ) + ) + (240) + (415 (fadeout (frame-time-30 10))) + (10000 (task-close! "city-hijack-vehicle-resolution")) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'citycast + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '((min max)) + :cloth-commands '(((min max) hide)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'citycast + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'citycast + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-kg-pickup" + :level 'lctyhijk + :art-group "skel-h-kg-pickup" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "cty-hijack-missile" + :level 'lctyhijk + :art-group "skel-cty-hijack-missile" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "palmpilot-b" + :level 'citycast + :art-group "skel-palmpilot-b" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "broken-mdaxter-movie" + :level 'ctyport + :art-group "skel-broken-mdaxter-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'citycast + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "mecha-daxter" + :level 'ctyport + :art-group "skel-mecha-daxter" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctyhijack-res" + :end-point "ctyport-hiphog" + :borrow '((ctywide 4 lctyhijk special) + (ctywide-kg alias ctywide copy ctypesc special) + (ctywide-ff-kg alias ctywide copy ctypesc special) + (ctywide-ff alias ctywide copy ctypepa special ctypesa special) + ) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #x9c + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "ctyport-attack-get-on-nuke" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-93" + :art-group "scenecamera" + :anim "city-port-attack-intro-b" + :parts 1 + :command-list '((0 (kill "cty-dax-missile-launcher-1")) + (78 + (part-tracker + "group-fma-missile-launch-trail" + entity + "h-torpedo" + joint + "main" + track + #t + duration + (frame-range 78 100) + subsample-num + (new 'static 'bfloat :data 10.0) + ) + ) + (81 + (part-tracker + "group-fma-missile-launch-thruster" + entity + "h-torpedo" + joint + "main" + track + #t + duration + (frame-range 81 84) + ) + ) + ) + :cut-list '(46) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'hiphog + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x1e + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'hiphog + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x1e + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "missile-launcher-movie" + :level 'lpatkcs + :art-group "skel-missile-launcher-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-torpedo" + :level 'lctypatk + :art-group "skel-h-torpedo" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "ctyport-hiphog" + :end-point #f + :borrow '((ctywide 4 lctypatk display) + (ctywide-ff alias ctywide copy ctypesa auto ctycarb auto ctycara auto lpatkcs display) + ) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-missile-launch-thruster + :id 1070 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 3860 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 3861 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 3860 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -0.7)) + (:scale-x (meters 1)) + (:rot-x (degrees 190)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3861 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 3.0) + (:x (meters -1)) + (:scale-x (meters 5) (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 60.0 20.0) + (:b 0.0) + (:a 30.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-missile-launch-trail + :id 1071 + :flags (sp0 sp13) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 3862)) + ) + +;; failed to figure out what this is: +(defpart 3862 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:z (meters 0)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 30.0) + (:g :copy r) + (:b :copy r) + (:a 20.0 20.0) + (:vel-z (meters -0.06666667) (meters -0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.06666667 -0.06666667) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405c00 #x409b00)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-krimson-wall-fma + :id 1072 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 3863 :flags (is-3d sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 3863 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:x (meters 1)) + (:y (meters 0)) + (:z (meters 16)) + (:scale-x (meters 18)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-z (degrees 90)) + (:scale-y (meters 54)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.735)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 + 20 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 90)) + ) + ) + +;; definition for function spt-birth-func-brightness-daxter-crush-dust +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-daxter-crush-dust ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 140)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 30)) + (v1-3 (+ (logand 0 (rand-uint31-gen *random-generator*)) 75)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 s3-0))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-3))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-scenes-daxter-crush-dust + :id 1073 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 3864 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3864 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-daxter-crush-dust) + (:num 30.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.064 -0.064) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.82) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 80) (degrees 10)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-missile-thruster-fire + :id 1074 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 3865 :flags (is-3d sp7)) (sp-item 3866 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 3865 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 6.0) + (:z (meters -0.9)) + (:scale-x (meters 0.8) (meters 0.5)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 2) (meters 1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 30.0 30.0) + (:fade-a -0.6) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3866 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 80.0 2.0) + (:fade-a -0.12) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hijak-fma-missile-trail + :id 1075 + :flags (sp0 sp13) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 3867)) + ) + +;; failed to figure out what this is: +(defpart 3867 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 50.0 80.0) + (:g :copy r) + (:b :copy r) + (:a 10.0 40.0) + (:scalevel-x (meters 0.0033333334) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.083333336 -0.083333336) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x40a000 #x405c00 #x409b00)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-daxter-sign-explosion + :id 1076 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 3869 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3870 :period (seconds 30) :length (seconds 0.035)) + (sp-item 3871 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3872 :period (seconds 30) :length (seconds 0.035)) + (sp-item 3873 :period (seconds 30) :length (seconds 0.035)) + (sp-item 3874 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3875 :period (seconds 30) :length (seconds 0.167)) + (sp-item 3876 :period (seconds 30) :length (seconds 0.5)) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3877 :flags (sp3) :binding 3868) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3868 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 3869 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3870 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3871 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3872 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3873 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-dax-sign-explo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-dax-sign-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-dax-sign-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-dax-sign-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-dax-sign-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-dax-sign-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-dax-sign-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-daxter-sign-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-daxter-sign-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 3873 init-specs 14 initial-valuef) + (the-as float *part-daxter-sign-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* color-start) *range-dax-sign-explo-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* alpha-start) *range-dax-sign-explo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* scale-x-start) + *range-dax-sign-explo-dust-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* scale-y-start) + *range-dax-sign-explo-dust-scale-y* + ) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* a-scalar) *curve-dax-sign-explo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* scale-x-scalar) + *curve-dax-sign-explo-dust-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-dust-in-curve-settings* scale-y-scalar) + *curve-dax-sign-explo-dust-scale-y* + ) + +;; failed to figure out what this is: +(defpart 3875 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3876 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-dax-sign-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-dax-sign-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-dax-sign-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-dax-sign-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-dax-sign-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-dax-sign-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-dax-sign-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-daxter-sign-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-daxter-sign-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 3876 init-specs 16 initial-valuef) + (the-as float *part-daxter-sign-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* color-start) *range-dax-sign-explo-color*) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* alpha-start) *range-dax-sign-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* scale-x-start) *range-dax-sign-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* scale-y-start) *range-dax-sign-explo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* a-scalar) *curve-dax-sign-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* scale-x-scalar) *curve-dax-sign-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-daxter-sign-explosion-texture-curve-settings* scale-y-scalar) *curve-dax-sign-explo-scale-y*) + +;; failed to figure out what this is: +(defpart 3874 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3877 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.033333335) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3868 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-barrier-explosion-big + :id 1077 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 3879 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3880 :period (seconds 30) :length (seconds 0.035)) + (sp-item 3881 :flags (sp3) :period (seconds 30)) + (sp-item 3882 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3883 :period (seconds 30) :length (seconds 0.335)) + (sp-item 3884 :period (seconds 30) :length (seconds 0.5)) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3885 :flags (sp3) :binding 3878) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 3878 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 3879 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3880 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3881 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.12307692) + (:fade-b -0.046153847) + (:fade-a -0.19692308 -0.19692308) + (:accel-x (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.93) + (:timer (seconds 2.167)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:next-time (seconds 0.335)) + (:next-launcher 3886) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3886 + :init-specs ((:friction 0.7)) + ) + +;; failed to figure out what this is: +(defpart 3883 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.5) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.10666667) + (:fade-b -0.04) + (:fade-a -0.17066666 -0.17066666) + (:accel-x (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.7) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.335)) + (:next-launcher 3887) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3887 + :init-specs ((:friction 0.7)) + ) + +;; failed to figure out what this is: +(defpart 3884 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.13333334)) + (:accel-x (meters -0.013333334) 1 (meters 0.026666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:next-time (seconds 0.335)) + (:next-launcher 3888) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3888 + :init-specs ((:friction 0.7)) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fma-barrier-explo-big-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fma-barrier-explo-big-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fma-barrier-explo-big-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fma-barrier-explo-big-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fma-barrier-explo-big-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fma-barrier-explo-big-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fma-barrier-explo-big-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fma-barrier-explosion-big-texture-curve-settings*, type particle-curve-settings +(define *part-fma-barrier-explosion-big-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.7) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 3884 init-specs 17 initial-valuef) + (the-as float *part-fma-barrier-explosion-big-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* color-start) + *range-fma-barrier-explo-big-color* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* alpha-start) + *range-fma-barrier-explo-big-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* scale-x-start) + *range-fma-barrier-explo-big-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* scale-y-start) + *range-fma-barrier-explo-big-scale-y* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* a-scalar) + *curve-fma-barrier-explo-big-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* scale-x-scalar) + *curve-fma-barrier-explo-big-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-fma-barrier-explosion-big-texture-curve-settings* scale-y-scalar) + *curve-fma-barrier-explo-big-scale-y* + ) + +;; failed to figure out what this is: +(defpart 3882 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3885 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.1)) + (:scalevel-x (meters -0.05) (meters -0.05)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3878 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.17066666 -0.17066666) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; definition of type port-board-vent +(deftype port-board-vent (bouncer) + () + ) + +;; definition for method 3 of type port-board-vent +(defmethod inspect ((this port-board-vent)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bouncer inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 24 of type port-board-vent +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this port-board-vent)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action)) + (set-vector! (-> v1-2 local-sphere) 0.0 4096.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 23 of type port-board-vent +;; WARN: Return type mismatch int vs none. +(defmethod init-skel! ((this port-board-vent)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc new file mode 100644 index 0000000000..720cc55607 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc @@ -0,0 +1,1548 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-flying-turret kg-flying-turret kg-flying-turret-lod0-jg kg-flying-turret-idle-ja + ((kg-flying-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defpart 4709 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.4)) + (:scale-y (meters 3)) + (:r 128.0 128.0) + (:g 32.0 96.0) + (:b :copy g) + (:a 128.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; definition for symbol *flying-turret-nav-enemy-info*, type nav-enemy-info +(define *flying-turret-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 2 + :hit-anim 2 + :knocked-anim 2 + :knocked-land-anim 2 + :die-anim 2 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :notice-distance (meters 30) + :notice-distance-delta (meters 10) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 2 + :turn-anim -1 + :run-anim 2 + :taunt-anim -1 + :run-travel-speed (meters 25) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 2) + :walk-travel-speed (meters 25) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 1) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 1) + :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! (-> *flying-turret-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for symbol *flying-turret-debris-params*, type debris-static-params +(define *flying-turret-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 7 :group "skel-kg-debris-a") + ) + ) + ) + +;; definition of type ft-gun-info +(deftype ft-gun-info (structure) + ((gun-position float) + (fire? symbol) + ) + ) + +;; definition for method 3 of type ft-gun-info +(defmethod inspect ((this ft-gun-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ft-gun-info) + (format #t "~1Tgun-position: ~f~%" (-> this gun-position)) + (format #t "~1Tfire?: ~A~%" (-> this fire?)) + (label cfg-4) + this + ) + +;; definition of type flying-turret +(deftype flying-turret (kg-squad-member) + ((thrust-dir vector :inline) + (speed float) + (speed-target float) + (ground-height float) + (last-heading-quat quaternion :inline) + (last-roll-quat quaternion :inline) + (thrust-mode uint8) + (pursuit-start-time time-frame) + (chase-mode uint8) + (last-check-chase-pos-time time-frame) + (circle-angle float) + (last-fire-time time-frame) + (num-shots-fired int8) + (ground-point vector :inline) + (guns ft-gun-info 2 :inline) + (turret-aim-blend float) + (hit-player? symbol) + (desired-height-offset float) + (float-height float) + (bob-velocity float) + (bouncing? symbol) + (bounce-start-time time-frame) + (changed-targets? symbol) + (thruster-intensity float) + (up-bobbing? symbol) + (bob-scale-factor float) + (bob-scale-target float) + (bob-t float) + (thruster-intensity-scalar float) + (engine-sound sound-id) + (tilt-sound sound-id) + (roll-sound-amount float) + ) + (:state-methods + flying-turret-base-state + fire + exit-transport + ) + (:methods + (flying-turret-method-225 (_type_) float) + (flying-turret-method-226 (_type_) none) + (flying-turret-method-227 (_type_) quaternion) + (fire-shot-from-joint-idx (_type_ int) (pointer process)) + (flying-turret-method-229 (_type_) none) + (flying-turret-method-230 (_type_ uint) uint) + ) + ) + +;; definition for method 3 of type flying-turret +(defmethod inspect ((this flying-turret)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type kg-squad-member inspect))) + (t9-0 this) + ) + (format #t "~2Tthrust-dir: #~%" (-> this thrust-dir)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Tspeed-target: ~f~%" (-> this speed-target)) + (format #t "~2Tground-height: ~f~%" (-> this ground-height)) + (format #t "~2Tlast-heading-quat: #~%" (-> this last-heading-quat)) + (format #t "~2Tlast-roll-quat: #~%" (-> this last-roll-quat)) + (format #t "~2Tthrust-mode: ~D~%" (-> this thrust-mode)) + (format #t "~2Tpursuit-start-time: ~D~%" (-> this pursuit-start-time)) + (format #t "~2Tchase-mode: ~D~%" (-> this chase-mode)) + (format #t "~2Tlast-check-chase-pos-time: ~D~%" (-> this last-check-chase-pos-time)) + (format #t "~2Tcircle-angle: ~f~%" (-> this circle-angle)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Tnum-shots-fired: ~D~%" (-> this num-shots-fired)) + (format #t "~2Tground-point: #~%" (-> this ground-point)) + (format #t "~2Tguns[2] @ #x~X~%" (-> this guns)) + (format #t "~2Tturret-aim-blend: ~f~%" (-> this turret-aim-blend)) + (format #t "~2Thit-player?: ~A~%" (-> this hit-player?)) + (format #t "~2Tdesired-height-offset: ~f~%" (-> this desired-height-offset)) + (format #t "~2Tfloat-height: ~f~%" (-> this float-height)) + (format #t "~2Tbob-velocity: ~f~%" (-> this bob-velocity)) + (format #t "~2Tbouncing?: ~A~%" (-> this bouncing?)) + (format #t "~2Tbounce-start-time: ~D~%" (-> this bounce-start-time)) + (format #t "~2Tchanged-targets?: ~A~%" (-> this changed-targets?)) + (format #t "~2Tthruster-intensity: ~f~%" (-> this thruster-intensity)) + (format #t "~2Tup-bobbing?: ~A~%" (-> this up-bobbing?)) + (format #t "~2Tbob-scale-factor: ~f~%" (-> this bob-scale-factor)) + (format #t "~2Tbob-scale-target: ~f~%" (-> this bob-scale-target)) + (format #t "~2Tbob-t: ~f~%" (-> this bob-t)) + (format #t "~2Tthruster-intensity-scalar: ~f~%" (-> this thruster-intensity-scalar)) + (format #t "~2Tengine-sound: ~D~%" (-> this engine-sound)) + (format #t "~2Ttilt-sound: ~D~%" (-> this tilt-sound)) + (format #t "~2Troll-sound-amount: ~f~%" (-> this roll-sound-amount)) + (label cfg-4) + this + ) + +;; definition for method 120 of type flying-turret +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this flying-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + (set! (-> v1-7 prim-core action) (collide-action solid semi-solid no-standon)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) 40.96) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 140 of type flying-turret +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs process. +(defmethod update-focus ((this flying-turret)) + (the-as process (when (handle->process (-> this focus handle)) + (let* ((s5-1 (handle->process (-> this focus handle))) + (a0-9 (if (type? s5-1 process-focusable) + (the-as process-focusable s5-1) + ) + ) + (s5-0 (-> this focus-pos)) + ) + (set! (-> s5-0 quad) (-> (get-trans a0-9 3) quad)) + s5-0 + ) + ) + ) + ) + +;; definition for method 226 of type flying-turret +;; WARN: Return type mismatch int vs none. +(defmethod flying-turret-method-226 ((this flying-turret)) + (when (not (handle->process (-> this current-enemy))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + (let ((a0-6 (get-current-enemy this))) + (cond + (a0-6 + (let ((v1-8 (process->handle a0-6))) + (when (!= (-> this current-enemy) v1-8) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag persistent in-pursuit)) + (set! (-> this changed-targets?) #t) + ) + (set! (-> this current-enemy) (the-as handle v1-8)) + ) + ) + (else + (set! (-> this current-enemy) (the-as handle #f)) + ) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 3))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (if (time-elapsed? (-> this pursuit-start-time) (seconds 5)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit)) + ) + (let* ((s5-0 (handle->process (-> this current-enemy))) + (a0-27 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and a0-27 + (not (logtest? (-> (the-as process-focusable a0-27) focus-status) (focus-status disable dead inactive))) + ) + (let* ((s5-1 this) + (s4-0 (method-of-object s5-1 enemy-method-70)) + (s3-0 (handle->process (-> this current-enemy))) + ) + (s4-0 + s5-1 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus this) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (f1-0 204800.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag persistent in-pursuit)) + ) + ) + ) + (else + (set! (-> this current-enemy) (the-as handle #f)) + (set! (-> this focus handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (when (not (and (-> this next-state) (= (-> this next-state name) 'active))) + (citizen-method-208 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 219 of type flying-turret +(defmethod kg-squad-member-method-219 ((this flying-turret) (arg0 process-focusable)) + (let* ((s4-0 (get-trans arg0 0)) + (f0-0 (vector-vector-xz-distance-squared (-> this root trans) s4-0)) + (f1-0 245760.0) + ) + (or (and (< f0-0 (* f1-0 f1-0)) + (< (fabs (- (-> s4-0 y) (-> this root trans y))) 61440.0) + (< (-> s4-0 y) (-> this root trans y)) + ) + (< 0.0 (get-hatred-val-for-target this (process->handle arg0))) + ) + ) + ) + +;; definition for method 227 of type flying-turret +;; INFO: Used lq/sq +(defmethod flying-turret-method-227 ((this flying-turret)) + (set! (-> this roll-sound-amount) 0.0) + (if (zero? (-> this thrust-mode)) + (vector-float*! (-> this root transv) (-> this root transv) (- 1.0 (* 0.1 (seconds-per-frame)))) + (vector-float*! (-> this root transv) (-> this root transv) (- 1.0 (seconds-per-frame))) + ) + (let ((v1-8 (vector-float*! (new 'stack-no-clear 'vector) (-> this thrust-dir) (-> this speed-target))) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-6 quad) (-> this root transv quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) v1-8 a0-6)) + (f30-0 0.0) + ) + (cond + ((zero? (-> this thrust-mode)) + 1.0 + (vector-length (-> this root transv)) + (set! f30-0 (vector-length s5-1)) + (let* ((f1-3 (/ f30-0 (-> this enemy-info run-travel-speed))) + (f0-10 (fmax 0.0 (fmin 1.0 f1-3))) + (f0-11 (* f0-10 f0-10)) + (f0-12 (* f0-11 f0-11)) + ) + (when (!= (-> this chase-mode) 3) + (let ((f1-5 (vector-length (-> this root transv)))) + (set! f0-12 (* f0-12 (fmax 0.2 (fmin 1.0 (/ f1-5 (-> this enemy-info run-travel-speed)))))) + ) + ) + (let ((f28-0 (lerp 2.0 10.0 f0-12))) + (let* ((s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (closest-point-on-mesh (-> this nav) s4-0 (-> this ground-point) (the-as nav-poly #f))) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> this root transv quad)) + (when s1-0 + (set! (-> s3-0 y) 0.0) + (clamp-vector-to-mesh-no-gaps (-> this nav) s4-0 s1-0 s3-0 s2-0) + (if (and (-> s2-0 found-boundary) (< (vector-length s3-0) 20480.0)) + (set! f28-0 (* 4.0 f28-0)) + ) + ) + ) + (vector+float*! (-> this root transv) (-> this root transv) s5-1 (* f28-0 (seconds-per-frame))) + (let* ((f0-19 (fmax 61440.0 (* (vector-length s5-1) f28-0))) + (f28-1 (* 0.000008138021 f0-19)) + (f26-0 0.8) + (f24-0 0.40000004) + (v1-53 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-54 (the-as number (logior #x3f800000 v1-53))) + (f0-25 (* f28-1 (+ f26-0 (* f24-0 (+ -1.0 (the-as float v1-54)))))) + ) + (seek! (-> this thruster-intensity) f0-25 (* 2.0 (seconds-per-frame))) + ) + ) + ) + ) + (else + (let* ((f0-30 (fmax 61440.0 (* 3.0 (vector-length (-> this root transv))))) + (f28-2 (* 0.000008138021 f0-30)) + (f26-1 0.8) + (f24-1 0.40000004) + (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-69 (the-as number (logior #x3f800000 v1-68))) + (f0-36 (* f28-2 (+ f26-1 (* f24-1 (+ -1.0 (the-as float v1-69)))))) + ) + (seek! (-> this thruster-intensity) f0-36 (* 2.0 (seconds-per-frame))) + ) + ) + ) + (let ((s4-2 (vector-float*! (new 'stack-no-clear 'vector) (-> this root transv) (seconds-per-frame)))) + (let* ((s1-1 (new 'stack-no-clear 'vector)) + (s0-0 (closest-point-on-mesh (-> this nav) s1-1 (-> this ground-point) (the-as nav-poly #f))) + (s2-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> s4-2 quad)) + (when s0-0 + (set! (-> s3-1 y) 0.0) + (clamp-vector-to-mesh-no-gaps (-> this nav) s1-1 s0-0 s3-1 s2-1) + (when (-> s2-1 found-boundary) + (let ((s1-3 (vector-! (new 'stack-no-clear 'vector) s4-2 s3-1))) + 0.0 + (let ((f0-43 (vector-normalize-ret-len! s1-3 1.0))) + (let ((f1-23 (vector-dot s1-3 (-> s2-1 boundary-normal)))) + (vector-float*! (-> s2-1 boundary-normal) (-> s2-1 boundary-normal) f1-23) + ) + (vector-! s1-3 s1-3 (-> s2-1 boundary-normal)) + (vector-normalize! s1-3 f0-43) + ) + (vector+! s4-2 s3-1 s1-3) + ) + ) + ) + ) + (vector+! (-> this root trans) (-> this root trans) s4-2) + ) + (let ((s2-2 (new 'stack-no-clear 'vector)) + (s4-3 (quaternion-identity! (new 'stack-no-clear 'quaternion))) + ) + (set! (-> s2-2 quad) (-> this thrust-dir quad)) + (set! (-> s2-2 y) 0.0) + (vector-normalize! s2-2 1.0) + (let ((s3-2 (new 'stack-no-clear 'quaternion)) + (f28-3 0.75) + ) + (quaternion-set! s3-2 0.0 (-> s2-2 x) 0.0 (+ 1.0 (-> s2-2 z))) + (quaternion-normalize! s3-2) + (if (= (-> this thrust-mode) 2) + (set! f28-3 1.5) + ) + (quaternion-slerp! (-> this last-heading-quat) (-> this last-heading-quat) s3-2 (* f28-3 (seconds-per-frame))) + ) + (when (zero? (-> this thrust-mode)) + (let ((s3-3 (new 'stack-no-clear 'vector))) + (set! (-> s3-3 quad) (-> s5-1 quad)) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (let ((s2-3 *up-vector*)) + (set! (-> s3-3 y) 0.0) + (vector-normalize! s3-3 1.0) + (vector-cross! s5-2 s3-3 s2-3) + ) + (vector-normalize! s5-2 1.0) + 0.0 + 0.0 + (let* ((f1-25 (/ f30-0 (-> this enemy-info run-travel-speed))) + (f1-28 (- 1.0 (* (- 1.0 f1-25) (- 1.0 f1-25)))) + (f0-56 (- 1.0 (* (- 1.0 f1-28) (- 1.0 f1-28)))) + (f0-57 (lerp 0.0 11832.889 f0-56)) + ) + (set! (-> this roll-sound-amount) f0-57) + (let ((f0-58 (* -1.0 f0-57))) + (quaternion-vector-angle! s4-3 s5-2 f0-58) + ) + ) + ) + ) + ) + (quaternion-slerp! (-> this last-roll-quat) (-> this last-roll-quat) s4-3 (* 2.0 (seconds-per-frame))) + ) + ) + ) + (quaternion*! (-> this root quat) (-> this last-roll-quat) (-> this last-heading-quat)) + (quaternion-normalize! (-> this root quat)) + ) + +;; definition for method 229 of type flying-turret +;; INFO: Used lq/sq +(defmethod flying-turret-method-229 ((this flying-turret)) + (let ((s4-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> this root trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector+float*! gp-0 gp-0 (-> s4-0 fvec) -3276.8) + (vector+float*! gp-0 gp-0 (-> s4-0 uvec) -409.6) + (vector+float*! gp-0 gp-0 (-> s4-0 rvec) -614.4) + (vector-float*! s5-0 (-> s4-0 uvec) -1.0) + 0.0 + 0.0 + (let ((f0-6 (-> this thruster-intensity))) + (if (< f0-6 1.0) + (set! f0-6 (* f0-6 f0-6)) + ) + (let ((f0-8 (* (lerp 3072.0 8601.6 f0-6) (-> this thruster-intensity-scalar)))) + (set! (-> *part-id-table* 4709 init-specs 4 initial-valuef) f0-8) + (set! (-> *part-id-table* 4709 init-specs 3 initial-valuef) (* 0.5 f0-8)) + ) + ) + (draw-beam (-> *part-id-table* 4709) gp-0 s5-0 #f) + (vector+float*! gp-0 gp-0 (-> s4-0 rvec) 1228.8) + (draw-beam (-> *part-id-table* 4709) gp-0 s5-0 #f) + ) + ) + (none) + ) + +;; definition for method 59 of type flying-turret +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this flying-turret)) + (with-pp + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'exit-transport))) + (flying-turret-method-226 this) + ) + (flying-turret-method-227 this) + (let* ((f0-0 (vector-length (-> this root transv))) + (f0-1 (* 0.000016276043 f0-0)) + ) + 0.0 + 0.0 + (let* ((f28-0 (fmax 0.0 (fmin 1.0 f0-1))) + (f30-0 (lerp 0.5 1.0 f28-0)) + (f0-3 (lerp 0.0 0.25 f28-0)) + ) + (sound-play-by-name + (static-sound-name "f-turret-engine") + (-> this engine-sound) + (the int (* 1024.0 f30-0)) + (the int (* 1524.0 f0-3)) + 0 + (sound-group) + #t + ) + ) + ) + (let* ((f1-9 (* 0.00008451022 (-> this roll-sound-amount))) + (f0-8 (* (-> this thruster-intensity) (-> this thruster-intensity-scalar))) + (f1-11 (fmax 0.0 (fmin 1.0 f1-9))) + (f28-1 (fmax 0.0 (fmin 1.0 f0-8))) + (f30-1 (lerp 0.0 0.2 f1-11)) + (f0-10 (lerp 0.5 1.0 f28-1)) + ) + (sound-play-by-name + (static-sound-name "fly-turret-jets") + (-> this tilt-sound) + (the int (* 1024.0 f0-10)) + (the int (* 1524.0 f30-1)) + 0 + (sound-group) + #t + ) + ) + (if (= (-> this thrust-mode) 2) + (seek! (-> this turret-aim-blend) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this turret-aim-blend) 0.0 (* 2.0 (seconds-per-frame))) + ) + (seek! (-> this bob-scale-factor) (-> this bob-scale-target) (* 3.0 (seconds-per-frame))) + (let ((f0-30 (* 0.0016666667 (the float (- (current-time) (-> pp clock old-frame-counter)))))) + (cond + ((-> this up-bobbing?) + (+! (-> this bob-t) f0-30) + (+! (-> this root trans y) (* 2048.0 (seconds-per-frame) (-> this bob-scale-factor))) + (seek! (-> this thruster-intensity-scalar) (lerp 1.0 1.1 (-> this bob-scale-factor)) (seconds-per-frame)) + (when (< 1.0 (-> this bob-t)) + (let ((f0-39 1.0) + (f1-23 (-> this bob-t)) + ) + (set! (-> this bob-t) (- f0-39 (- f1-23 (* (the float (the int (/ f1-23 1.0))) 1.0)))) + ) + (set! (-> this up-bobbing?) #f) + ) + ) + (else + (set! (-> this bob-t) (- (-> this bob-t) f0-30)) + (set! (-> this root trans y) + (- (-> this root trans y) (* 2048.0 (seconds-per-frame) (-> this bob-scale-factor))) + ) + (seek! (-> this thruster-intensity-scalar) (lerp 1.0 0.7 (-> this bob-scale-factor)) (seconds-per-frame)) + (when (< (-> this bob-t) 0.0) + (set! (-> this bob-t) (fabs (-> this bob-t))) + (set! (-> this up-bobbing?) #t) + ) + ) + ) + ) + (flying-turret-method-225 this) + (set-vector! (-> this ground-point) (-> this root trans x) (-> this ground-height) (-> this root trans z) 1.0) + (let ((a1-13 (new 'stack-no-clear 'vector))) + (set! (-> a1-13 quad) (-> this ground-point quad)) + (set-virtual-cur-pos! (-> this nav state) a1-13) + ) + (let ((f0-56 (+ (-> this desired-height-offset) (-> this ground-height)))) + (if (< 4096.0 (fabs (- (-> this root trans y) f0-56))) + (seek! (-> this root trans y) f0-56 (* 2867.2 (seconds-per-frame))) + ) + ) + (set! (-> this root trans y) + (fmax (fmin (-> this root trans y) (+ 73728.0 (-> this ground-height))) (+ 12288.0 (-> this ground-height))) + ) + (flying-turret-method-229 this) + (call-parent-method this) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate flying-turret-base-state (flying-turret) + :virtual #t + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate active (flying-turret) + :virtual #t + :enter (behavior () + (set! (-> self chase-mode) (the-as uint 3)) + (flying-turret-method-230 self (the-as uint 0)) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :trans (behavior () + (when (handle->process (-> self current-enemy)) + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (type? gp-0 process-focusable) + (empty) + ) + ) + (set! (-> self chase-mode) (the-as uint 0)) + (go-virtual hostile) + ) + ) + :code sleep-code + ) + +;; definition for method 176 of type flying-turret +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-176 ((this flying-turret)) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 sphere-mask) (the-as uint 65)) + ) + 0 + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 acceleration) 409600000.0) + ) + 0 + (none) + ) + +;; definition for method 177 of type flying-turret +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-177 ((this flying-turret)) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 sphere-mask) (the-as uint 65)) + ) + 0 + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 acceleration) 409600000.0) + ) + 0 + (none) + ) + +;; definition for method 121 of type flying-turret +(defmethod init-enemy! ((this flying-turret)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-flying-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *flying-turret-nav-enemy-info*) + (call-parent-method this) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this anim-shuffle) 2) + (set! (-> this anim-walk) 2) + (set! (-> this speed-walk) 102400.0) + (set! (-> this dist-walk-anim) 8192.0) + (set! (-> this dist-run-anim) 16384.0) + (set! (-> this anim-run) 2) + (set! (-> this speed-run) 102400.0) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) + (set! (-> this draw lod-set lod 0 dist) 409600.0) + (set! (-> this engine-sound) (new-sound-id)) + (set! (-> this tilt-sound) (new-sound-id)) + (citizen-method-194 this) + (none) + ) + +;; definition for method 160 of type flying-turret +;; WARN: Return type mismatch int vs none. +(defmethod normalize-heading! ((this flying-turret) (arg0 nav-control)) + 0 + (none) + ) + +;; definition for method 161 of type flying-turret +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defmethod nav-enemy-method-161 ((this flying-turret) (arg0 nav-control)) + (cond + ((and (logtest? (enemy-flag ef37) (-> this enemy-flags)) + (not (logtest? (enemy-flag ef39) (-> this enemy-flags))) + (= (-> this thrust-mode) 0) + ) + (let ((a2-0 (-> arg0 state)) + (v1-8 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-8 quad) (-> a2-0 heading quad)) + (let ((f30-0 (-> arg0 state speed))) + (set! (-> this thrust-dir quad) (-> v1-8 quad)) + (let ((t9-0 vector-vector-xz-distance) + (a0-7 (-> this root trans)) + (a2-3 (-> this nav state)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-3 target-pos quad)) + (let ((f0-1 (t9-0 a0-7 a1-1))) + (set! (-> this speed-target) f30-0) + (if (!= (-> this chase-mode) 3) + (set! (-> this speed-target) (fmin f30-0 f0-1)) + ) + ) + ) + ) + ) + ) + ((= (-> this thrust-mode) 2) + (vector-! (-> this thrust-dir) (-> this focus-pos) (-> this root trans)) + (set! (-> this thrust-dir y) 0.0) + (vector-normalize! (-> this thrust-dir) 1.0) + (set! (-> this speed-target) 0.0) + ) + (else + (set! (-> this speed-target) 0.0) + ) + ) + (none) + ) + +;; definition for method 225 of type flying-turret +;; WARN: Return type mismatch number vs float. +(defmethod flying-turret-method-225 ((this flying-turret)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (if (not (above-ground? (-> this root) s5-0 (-> this root trans) (collide-spec backgnd) 8192.0 102400.0 1024.0)) + (return 0.0) + ) + (set! (-> this ground-height) (-> s5-0 best-other-tri intersect y)) + ) + ) + +;; definition for function flying-turret-gun-aim-func +;; INFO: Used lq/sq +(defun flying-turret-gun-aim-func ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (the-as flying-turret (-> arg0 param1))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> s4-0 focus-pos quad)) + (cspace<-parented-transformq-joint! arg0 arg1) + (vector-! s2-0 s3-0 (-> arg0 bone transform trans)) + ) + (vector-normalize! s2-0 1.0) + (let ((s3-1 (new 'stack-no-clear 'quaternion))) + (let* ((f0-2 (- (asin (-> s2-0 y)))) + (f0-3 (+ -3640.889 f0-2)) + (f0-5 (fmax -4004.9778 (fmin 11286.756 f0-3))) + ) + (quaternion-vector-angle! s3-1 *x-vector* f0-5) + ) + (quaternion-slerp! s3-1 *unity-quaternion* s3-1 (-> s4-0 turret-aim-blend)) + (quaternion*! (-> arg1 quat) (-> arg1 quat) s3-1) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +;; definition for function flying-turret-gun-recoil-jmod-func +(defun flying-turret-gun-recoil-jmod-func ((arg0 cspace) (arg1 transformq)) + (-> arg0 param1) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +;; definition of type flying-turret-shot +(deftype flying-turret-shot (guard-shot) + () + ) + +;; definition for method 3 of type flying-turret-shot +(defmethod inspect ((this flying-turret-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type guard-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 28 of type flying-turret-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this flying-turret-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "fly-turret-shot") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "guard-shot-hit") + ) + ) + ) + 0 + (none) + ) + +;; definition for function spawn-turret-projectile +;; INFO: Used lq/sq +(defun spawn-turret-projectile ((arg0 flying-turret) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 1.0) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-damage-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po15)) + (set! (-> gp-0 vehicle-impulse-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po16)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (spawn-projectile flying-turret-shot gp-0 arg0 *default-dead-pool*) + ) + ) + +;; definition for method 228 of type flying-turret +;; INFO: Used lq/sq +(defmethod fire-shot-from-joint-idx ((this flying-turret) (arg0 int)) + (local-vars (a0-12 city-attacker-info)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this node-list data arg0 bone transform uvec quad)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0)))) + (set! (-> s5-0 y) 0.0) + (when (or (< (-> this num-shots-fired) 3) (not (logtest? (-> this draw status) (draw-control-status on-screen)))) + (when (handle->process (-> this focus handle)) + (when (and (-> this attacker-info) + (-> this mission-squad) + (begin (set! a0-12 (get-attacker-at-idx (-> this mission-squad) (-> this attacker-info enemy-index))) a0-12) + (logtest? (-> a0-12 flags) (city-attacker-info-flag cai4)) + ) + (let ((s2-2 (logand (rand-uint31-gen *random-generator*) 1)) + (s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (if (= s2-2 1) + (vector-float*! s3-0 s3-0 -1.0) + ) + (let* ((s2-3 s5-0) + (s1-0 s5-0) + (f30-0 0.1) + (f28-0 0.1) + (v1-28 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-29 (the-as number (logior #x3f800000 v1-28))) + ) + (vector+float*! s2-3 s1-0 s3-0 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-29))))) + ) + ) + ) + ) + ) + (vector-normalize! s5-0 (vector-vector-xz-distance s4-0 (-> this focus-pos))) + (set! (-> s5-0 y) (- (-> this focus-pos y) (-> s4-0 y))) + (vector-normalize! s5-0 40960.0) + (spawn-turret-projectile + this + s4-0 + (vector+! (new 'stack-no-clear 'vector) s4-0 s5-0) + 819200.0 + (the-as vector #f) + ) + ) + ) + ) + +;; definition for function update-ft-gun +(defun update-ft-gun ((arg0 ft-gun-info) (arg1 float) (arg2 float) (arg3 float)) + (local-vars (f0-5 float)) + (let ((f0-2 (/ (- arg3 arg1) arg2))) + (cond + ((< f0-2 0.0) + (set! (-> arg0 fire?) #f) + (set! (-> arg0 gun-position) 1.0) + ) + ((begin (set! (-> arg0 fire?) #t) (set! f0-5 (fmax 0.0 (fmin 1.0 f0-2))) 0.0 (< f0-5 0.1)) + (set! (-> arg0 gun-position) (- 1.0 (* 10.0 f0-5))) + ) + (else + (set! (-> arg0 gun-position) (* 1.1111112 (+ -0.1 f0-5))) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate fire (flying-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self guns 0 fire?) #f) + (set! (-> self guns 1 fire?) #f) + (if (< (vector-length (-> self root transv)) 4096.0) + (set! (-> self bob-scale-target) 0.3) + ) + ) + :exit (behavior () + (set! (-> self bob-scale-target) 1.0) + ) + :trans (behavior () + (let ((f30-0 (* 0.0044444446 (the float (- (current-time) (-> self state-time))))) + (f0-1 0.01) + (f28-0 0.26) + (f26-0 0.75) + (gp-0 (new 'stack-no-clear 'ft-gun-info)) + ) + (update-ft-gun gp-0 f0-1 f26-0 f30-0) + (if (and (not (-> self guns 0 fire?)) (-> gp-0 fire?)) + (fire-shot-from-joint-idx self 5) + ) + (mem-copy! (the-as pointer (-> self guns)) (the-as pointer gp-0) 8) + (update-ft-gun gp-0 f28-0 f26-0 f30-0) + (if (and (not (-> self guns 1 fire?)) (-> gp-0 fire?)) + (fire-shot-from-joint-idx self 6) + ) + (mem-copy! (the-as pointer (-> self guns 1)) (the-as pointer gp-0) 8) + ) + (when (or (time-elapsed? (-> self state-time) (seconds 1)) + (let ((v1-24 (ja-group))) + (and (and v1-24 (= v1-24 (-> self draw art-group data 4))) (ja-done? 0)) + ) + ) + (set-time! (-> self last-fire-time)) + (+! (-> self num-shots-fired) 1) + (go-virtual hostile) + ) + ) + :code (behavior () + (when (< (vector-length (-> self root transv)) 4096.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + ) + (set-time! (-> self last-fire-time)) + (+! (-> self num-shots-fired) 1) + (sleep-code) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for method 82 of type flying-turret +(defmethod event-handler ((this flying-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if #t + (set! (-> this hit-player?) #t) + ) + ) + ) + ) + ) + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + +;; definition for method 230 of type flying-turret +(defmethod flying-turret-method-230 ((this flying-turret) (arg0 uint)) + (when (!= (-> this thrust-mode) arg0) + (let ((v1-2 arg0)) + (cond + ((= v1-2 2) + (set! (-> this bob-scale-target) 1.0) + ) + ((zero? v1-2) + (set! (-> this bob-scale-target) 0.0) + ) + ) + ) + ) + (set! (-> this thrust-mode) arg0) + arg0 + ) + +;; failed to figure out what this is: +(defstate hostile (flying-turret) + :virtual #t + :enter (behavior () + (nav-enemy-method-181 self) + ) + :trans (behavior () + (local-vars (a0-34 city-attacker-info) (a0-39 city-attacker-info) (a0-48 city-attacker-info) (s4-1 object)) + (when (not (handle->process (-> self focus handle))) + (flying-turret-method-226 self) + (if (not (handle->process (-> self focus handle))) + (go-virtual active) + ) + ) + (let ((f0-0 (vector-vector-xz-distance-squared (-> self root trans) (-> self focus-pos))) + (f1-0 245760.0) + ) + (cond + ((< (* f1-0 f1-0) f0-0) + (set! (-> self move-dest quad) (-> self focus-pos quad)) + (set! (-> self chase-mode) (the-as uint 0)) + 0 + ) + ((and (= (-> self chase-mode) 0) (let ((f1-3 163840.0)) + (< f0-0 (* f1-3 f1-3)) + ) + ) + (set! (-> self chase-mode) (the-as uint 1)) + (set! (-> self move-dest quad) (-> self root trans quad)) + ) + ) + ) + (when (= (-> self chase-mode) 1) + (let ((f0-1 (vector-vector-xz-distance-squared (-> self root trans) (-> self move-dest))) + (f1-6 20480.0) + ) + (cond + ((or (< f0-1 (* f1-6 f1-6)) (= (-> self thrust-mode) 2)) + (set-time! (-> self last-check-chase-pos-time)) + (let ((a1-5 (get-handle-pos (-> self squad) (-> self focus handle) (new 'stack-no-clear 'vector))) + (f0-2 245760.0) + ) + (cond + ((or (< (* f0-2 f0-2) (vector-vector-xz-distance-squared (-> self move-dest) a1-5)) (-> self hit-player?)) + (set! (-> self hit-player?) #f) + (squad-control-method-31 (-> self squad) (-> self move-dest) self (-> self current-enemy) 81920.0 0.0) + (flying-turret-method-230 self (the-as uint 0)) + ) + (else + (when (!= (-> self thrust-mode) 2) + (flying-turret-method-230 self (the-as uint 2)) + (set! (-> self num-shots-fired) 0) + (set! (-> self hit-player?) #f) + ) + (set! (-> self move-dest quad) (-> self root trans quad)) + ) + ) + ) + ) + ((time-elapsed? (-> self last-check-chase-pos-time) (seconds 1)) + (set-time! (-> self last-check-chase-pos-time)) + (let ((a1-10 (get-handle-pos (-> self squad) (-> self focus handle) (new 'stack-no-clear 'vector))) + (f0-5 204800.0) + ) + (if (< (* f0-5 f0-5) (vector-vector-xz-distance-squared (-> self move-dest) a1-10)) + (squad-control-method-31 (-> self squad) (-> self move-dest) self (-> self current-enemy) 81920.0 0.0) + ) + ) + ) + ) + ) + ) + (when (and (= (-> self thrust-mode) 2) + (or (and (and (-> self attacker-info) + (-> self mission-squad) + (begin (set! a0-34 (get-attacker-at-idx (-> self mission-squad) (-> self attacker-info enemy-index))) a0-34) + (logtest? (-> a0-34 flags) (city-attacker-info-flag cai4)) + ) + (time-elapsed? (-> self last-fire-time) (seconds 1.2)) + ) + (and (not (and (-> self attacker-info) + (-> self mission-squad) + (begin (set! a0-39 (get-attacker-at-idx (-> self mission-squad) (-> self attacker-info enemy-index))) a0-39) + (logtest? (-> a0-39 flags) (city-attacker-info-flag cai4)) + ) + ) + (time-elapsed? (-> self last-fire-time) (seconds 0.75)) + ) + ) + ) + (let ((s5-0 #t) + (gp-0 #f) + ) + (when (and (handle->process (-> self focus handle)) + (-> self attacker-info) + (-> self mission-squad) + (begin (set! a0-48 (get-attacker-at-idx (-> self mission-squad) (-> self attacker-info enemy-index))) a0-48) + (logtest? (-> a0-48 flags) (city-attacker-info-flag cai4)) + ) + (let ((s4-0 (handle->process (-> self focus handle)))) + (cond + ((not (and (if (type? s4-0 process-focusable) + s4-0 + ) + (begin + (let* ((s4-2 #t) + (s3-0 (handle->process (-> self focus handle))) + (v1-106 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s3-0 process-focusable) + (the-as process-focusable s3-0) + ) + ) + focus-status + ) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + (cmove-#f-nonzero s4-1 v1-106 s4-2) + ) + s4-1 + ) + ) + ) + (set! s5-0 #f) + ) + ((>= (-> self num-shots-fired) 4) + (set! gp-0 #t) + ) + ((< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 40960.0) + (set! gp-0 #t) + ) + ((let ((a0-60 (new 'stack-no-clear 'sphere))) + (set! (-> a0-60 quad) (-> self root trans quad)) + (set! (-> a0-60 r) (-> self root root-prim local-sphere w)) + (or (not (sphere-in-view-frustum? a0-60)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + ) + (+! (-> self num-shots-fired) 1) + (set! s5-0 #f) + ) + ) + ) + ) + (cond + (gp-0 + (squad-control-method-31 (-> self squad) (-> self move-dest) self (-> self current-enemy) 81920.0 0.0) + (flying-turret-method-230 self (the-as uint 0)) + ) + ((not s5-0) + (set-time! (-> self last-fire-time)) + ) + (else + (let ((s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-2 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans))) + ) + (set! (-> s5-1 y) 0.0) + (set! (-> gp-2 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-normalize! gp-2 1.0) + (if (< 0.5 (vector-dot s5-1 gp-2)) + (go-virtual fire) + ) + ) + ) + ) + ) + ) + (let ((a0-71 (-> self nav state)) + (v1-142 (-> self move-dest)) + ) + (logclear! (-> a0-71 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-71 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-71 target-pos quad) (-> v1-142 quad)) + ) + 0 + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for method 194 of type flying-turret +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defmethod citizen-method-194 ((this flying-turret)) + (call-parent-method this) + (set! (-> this turret-aim-blend) 0.0) + (set! (-> this hit-player?) #f) + (set! (-> this bob-velocity) 0.0) + (let* ((f30-0 14336.0) + (f28-0 10240.0) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (set! (-> this desired-height-offset) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-4))))) + ) + (set! (-> this changed-targets?) #f) + (set! (-> this bob-scale-target) 0.0) + (set! (-> this bob-scale-factor) 0.0) + (set! (-> this up-bobbing?) #t) + (set! (-> this bob-t) 0.0) + (set! (-> this thruster-intensity-scalar) 1.0) + (ja-channel-push! 1 0) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) + ) + (set! (-> this up-bobbing?) #t) + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 1.0) + (logior! (-> this fact options) (actor-option dont-override-fact)) + (set! (-> this fact pickup-spawn-amount) 5.0) + (set! (-> this enemy-flags) + (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag auto-death-phase-out))) + ) + (let ((a0-13 (-> this node-list data 5))) + (set! (-> a0-13 param0) flying-turret-gun-recoil-jmod-func) + (set! (-> a0-13 param1) this) + ) + (let ((a0-14 (-> this node-list data 6))) + (set! (-> a0-14 param0) flying-turret-gun-recoil-jmod-func) + (set! (-> a0-14 param1) this) + ) + (let ((a0-15 (-> this node-list data 4))) + (set! (-> a0-15 param0) flying-turret-gun-aim-func) + (set! (-> a0-15 param1) this) + ) + (set! (-> this last-fire-time) 0) + (set! (-> this pursuit-start-time) 0) + (logclear! (-> this focus-status) (focus-status dangerous)) + (set! (-> this speed) 0.0) + (set! (-> this speed-target) 0.0) + (set! (-> this thrust-dir quad) (the-as uint128 0)) + (quaternion-copy! (-> this last-heading-quat) (-> this root quat)) + (quaternion-identity! (-> this last-roll-quat)) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this thrust-mode) (the-as uint 0)) + (set! (-> this last-check-chase-pos-time) 0) + (let* ((f30-1 65536.0) + (v1-38 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-39 (the-as number (logior #x3f800000 v1-38))) + ) + (set! (-> this circle-angle) (* f30-1 (+ -1.0 (the-as float v1-39)))) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate knocked (flying-turret) + :virtual #t + :parent (flying-turret flying-turret-base-state) + :code (behavior () + (cond + ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 221)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 221)) + ) + ) + (when (kg-squad-member-method-220 self) + (let ((v1-36 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> v1-36 hit-xz-reaction) 0.5) + (set! (-> v1-36 hit-y-reaction) 0.6) + (set! (-> v1-36 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + ) + ) + (if (not (-> *setting-control* user-current gun-special-mode)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + ) + (sound-play "fly-turret-die") + (cleanup-for-death self) + ) + ) + +;; definition for method 10 of type flying-turret +(defmethod deactivate ((this flying-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this engine-sound)) + (sound-stop (-> this tilt-sound)) + (call-parent-method this) + (none) + ) + +;; definition for method 196 of type flying-turret +(defmethod go-inactive ((this flying-turret)) + (sound-stop (-> this engine-sound)) + (sound-stop (-> this tilt-sound)) + (call-parent-method this) + (none) + ) + +;; definition for method 215 of type flying-turret +(defmethod citizen-method-215 ((this flying-turret)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 10) + ) + ) + (none) + ) + +;; definition for method 212 of type flying-turret +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod go-from-behavior ((this flying-turret) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((6) + (set! (-> this root trans quad) (-> arg0 position quad)) + (when (handle->process (-> arg0 handle)) + (let ((s5-1 (vector+float*! + (new 'stack-no-clear 'vector) + (-> this root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 rotation)) + 49152.0 + ) + ) + ) + (nav-mesh-method-10 (-> this nav state mesh) s5-1 s5-1 (the-as nav-poly #f)) + (let ((v1-13 (-> this nav state))) + (logclear! (-> v1-13 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-13 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-13 target-pos quad) (-> s5-1 quad)) + ) + ) + 0 + ) + (go (method-of-object this exit-transport)) + ) + (else + (call-parent-method this arg0) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate exit-transport (flying-turret) + :virtual #t + :enter (behavior () + (set! (-> self chase-mode) (the-as uint 3)) + (flying-turret-method-230 self (the-as uint 0)) + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (nav-enemy-method-176 self) + (let ((v1-12 (-> self nav state))) + (set! (-> v1-12 speed) 0.0) + ) + 0 + (let ((a0-4 (-> self nav state)) + (v1-15 *null-vector*) + ) + (set! (-> a0-4 velocity quad) (-> v1-15 quad)) + ) + 0 + (let ((v1-18 (-> self nav))) + (set! (-> v1-18 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + ) + :trans (behavior () + (let ((t9-0 add-debug-sphere) + (a0-0 #t) + (a1-0 583) + (a3-0 (-> self nav state)) + (a2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-0 quad) (-> a3-0 target-pos quad)) + (t9-0 a0-0 (the-as bucket-id a1-0) a2-0 (meters 2) *color-red*) + ) + (let ((t9-1 vector-vector-xz-distance) + (a0-1 (-> self root trans)) + (a2-1 (-> self nav state)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-1 target-pos quad)) + (if (< (t9-1 a0-1 a1-1) 16384.0) + (go-virtual active) + ) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for method 21 of type flying-turret +;; INFO: Used lq/sq +(defmethod get-trans ((this flying-turret) (arg0 int)) + "Get the `trans` for this process." + (case arg0 + ((3) + (let ((s5-1 (new 'static 'vector))) + (set! (-> s5-1 quad) (-> this root trans quad)) + (vector<-cspace! s5-1 (-> this node-list data (-> this enemy-info bullseye-joint))) + (set! (-> s5-1 w) 10240.0) + s5-1 + ) + ) + (else + (call-parent-method this arg0) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc new file mode 100644 index 0000000000..f6fc601f5e --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc @@ -0,0 +1,2508 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-roboguard-city roboguard-city roboguard-city-lod0-jg roboguard-city-idle0-ja + ((roboguard-city-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow roboguard-city-shadow-mg + :origin-joint-index 3 + ) + +;; definition for symbol *roboguard-city-debris-params*, type debris-static-params +(define *roboguard-city-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 15 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 27 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 18 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 17 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-c") + ) + ) + ) + +;; definition of type roboguard-city +(deftype roboguard-city (kg-squad-member) + ((los los-control :inline) + (rotation-matrix matrix :inline) + (me-to-focus-dir vector :inline) + (me-to-focus-angle float) + (robo-flags robo-flag) + (torso-aim-blend float) + (torso-angle float) + (torso-seek-speed float) + (torso-to-focus-angle float) + (last-torso-frame-num float) + (stand-angle-threshold float) + (attack-distance float) + (attack-dist-scalar float) + (fire-time time-frame) + (last-attack-time time-frame) + (fired-this-time? symbol) + (last-roll-time time-frame) + (cannot-reach-target? symbol) + (cannot-reach-target-start-time time-frame) + (frustrate-roll-time time-frame) + (target-status squad-target-status :inline) + (last-update-chase-pos-time time-frame) + (random-offset-search float) + (pursuit-start-time time-frame) + (dizzy-start-time time-frame) + (roll-sound sound-id) + ) + (:state-methods + hostile-stand + close-attack + shoot-attack + explode + roll-enter + roll-exit + roll-chase + reposition + dizzy + exit-transport + giant-hostile + ) + (:methods + (roboguard-city-method-233 (_type_ vector vector) symbol) + (fire-shot-from-joint-idx (_type_ int) none) + (roboguard-city-method-235 (_type_) int) + (roboguard-city-method-236 (_type_) int) + (roboguard-city-method-237 (_type_) object) + (roboguard-city-method-238 (_type_ symbol) robo-flag) + (roboguard-city-method-239 (_type_) robo-flag) + (init-draw-params (_type_) none) + ) + ) + +;; definition for method 3 of type roboguard-city +(defmethod inspect ((this roboguard-city)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type kg-squad-member inspect))) + (t9-0 this) + ) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Trotation-matrix: #~%" (-> this rotation-matrix)) + (format #t "~2Tme-to-focus-dir: #~%" (-> this me-to-focus-dir)) + (format #t "~2Tme-to-focus-angle: ~f~%" (-> this me-to-focus-angle)) + (format #t "~2Trobo-flags: ~D~%" (-> this robo-flags)) + (format #t "~2Ttorso-aim-blend: ~f~%" (-> this torso-aim-blend)) + (format #t "~2Ttorso-angle: ~f~%" (-> this torso-angle)) + (format #t "~2Ttorso-seek-speed: ~f~%" (-> this torso-seek-speed)) + (format #t "~2Ttorso-to-focus-angle: ~f~%" (-> this torso-to-focus-angle)) + (format #t "~2Tlast-torso-frame-num: ~f~%" (-> this last-torso-frame-num)) + (format #t "~2Tstand-angle-threshold: ~f~%" (-> this stand-angle-threshold)) + (format #t "~2Tattack-distance: ~f~%" (-> this attack-distance)) + (format #t "~2Tattack-dist-scalar: ~f~%" (-> this attack-dist-scalar)) + (format #t "~2Tfire-time: ~D~%" (-> this fire-time)) + (format #t "~2Tlast-attack-time: ~D~%" (-> this last-attack-time)) + (format #t "~2Tfired-this-time?: ~A~%" (-> this fired-this-time?)) + (format #t "~2Tlast-roll-time: ~D~%" (-> this last-roll-time)) + (format #t "~2Tcannot-reach-target?: ~A~%" (-> this cannot-reach-target?)) + (format #t "~2Tcannot-reach-target-start-time: ~D~%" (-> this cannot-reach-target-start-time)) + (format #t "~2Tfrustrate-roll-time: ~D~%" (-> this frustrate-roll-time)) + (format #t "~2Ttarget-status: #~%" (-> this target-status)) + (format #t "~2Tlast-update-chase-pos-time: ~D~%" (-> this last-update-chase-pos-time)) + (format #t "~2Trandom-offset-search: ~f~%" (-> this random-offset-search)) + (format #t "~2Tpursuit-start-time: ~D~%" (-> this pursuit-start-time)) + (format #t "~2Tdizzy-start-time: ~D~%" (-> this dizzy-start-time)) + (format #t "~2Troll-sound: ~D~%" (-> this roll-sound)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 43) (new 'static 'lightning-spec + :name "lightning-shock-roboguard-city" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 15.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 819.2 + :duration 90.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +;; definition for symbol *roboguard-city-nav-enemy-info*, type nav-enemy-info +(define *roboguard-city-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 #f + :idle-anim 4 + :notice-anim -1 + :hostile-anim 11 + :hit-anim 4 + :knocked-anim 23 + :knocked-land-anim 24 + :die-anim -1 + :die-falling-anim 25 + :victory-anim 4 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint -1 + :look-at-joint 6 + :bullseye-joint 4 + :notice-distance (meters 50) + :notice-distance-delta (meters 20) + :proximity-notice-distance (meters 30) + :default-hit-points 10.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 20480.0 + :knocked-soft-vxz-hi 28672.0 + :knocked-soft-vy-lo 36864.0 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 49152.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 57344.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 28672.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 114688.0 + :knocked-red-vy-lo 53248.0 + :knocked-red-vy-hi 69632.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 20480.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 10 + :turn-anim 3 + :run-anim 11 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 360) + :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! (-> *roboguard-city-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; failed to figure out what this is: +(defpart 4696 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 40)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 4697 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 4698 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; definition for method 120 of type roboguard-city +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this roboguard-city)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy los-blocker)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid deadly 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-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list) + ) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set-vector! (-> v1-12 local-sphere) 0.0 6144.0 0.0 6144.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 4) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core action) (collide-action)) + (set! (-> v1-16 transform-index) 11) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 10240.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-18 prim-core action) (collide-action semi-solid)) + (set-vector! (-> v1-18 local-sphere) 0.0 8192.0 0.0 11468.8) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-20 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for function roboguard-city-turn-torso-post +;; INFO: Used lq/sq +(defbehavior roboguard-city-turn-torso-post roboguard-city () + (seek! (-> self torso-aim-blend) 1.0 (* 5.0 (seconds-per-frame))) + (let ((v1-3 (joint-node roboguard-city-lod0-jg chest)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) + (set! (-> gp-0 y) 0.0) + (set! (-> s5-1 y) 0.0) + (vector-xz-normalize! gp-0 1.0) + (vector-xz-normalize! s5-1 1.0) + (set! (-> self torso-to-focus-angle) (acos (vector-dot gp-0 s5-1))) + ) + ) + (if (>= 2730.6667 (-> self torso-to-focus-angle)) + (seek! (-> self torso-seek-speed) 0.0 (* 36408.89 (seconds-per-frame))) + (seek! (-> self torso-seek-speed) 21845.334 (* 36408.89 (seconds-per-frame))) + ) + (nav-enemy-simple-post) + (none) + ) + +;; definition for function roboguard-city-turret-code +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior roboguard-city-turret-code roboguard-city () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! roboguard-city-idle-shoot0-loop-ja :num! zero) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.2)) + (suspend) + ) + ) + (let ((gp-1 + (lambda :behavior process + ((arg0 roboguard-city) (arg1 symbol)) + (quaternion-rotate-y! (-> arg0 root quat) (-> arg0 root quat) (* 20480.0 (seconds-per-frame) (if arg1 + 1.0 + -1.0 + ) + ) + ) + ) + ) + (f30-0 (-> self stand-angle-threshold)) + ) + (until #f + (when (< (fabs (-> self me-to-focus-angle)) f30-0) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.5)) + (suspend) + ) + ) + (while (< (fabs (-> self me-to-focus-angle)) f30-0) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-20 (if (< 0.0 (-> self me-to-focus-angle)) + 6 + 8 + ) + ) + (s5-1 (< 0.0 (-> self me-to-focus-angle))) + ) + (ja-no-eval :group! (-> self draw art-group data v1-20) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-1 self s5-1) + (suspend) + (ja :num! (seek!)) + ) + ) + (when (< (fabs (-> self me-to-focus-angle)) f30-0) + (let ((s5-2 (current-time))) + (until (time-elapsed? s5-2 (seconds 0.5)) + (suspend) + ) + ) + (while (< (fabs (-> self me-to-focus-angle)) f30-0) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-40 (if (< 0.0 (-> self me-to-focus-angle)) + 7 + 9 + ) + ) + (s5-3 (< 0.0 (-> self me-to-focus-angle))) + ) + (ja-no-eval :group! (-> self draw art-group data v1-40) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-1 self s5-3) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + (none) + ) + +;; definition for function roboguard-city-idle-code +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior roboguard-city-idle-code roboguard-city () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15)) :frame-num 2.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15)) :frame-num 3.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15)) :frame-num 4.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15)) :frame-num 5.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 7.0 0.07) :frame-num 6.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 7.0 0.07)) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 8.0 0.07) :frame-num 7.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 8.0 0.07)) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 9.0 0.07) :frame-num 8.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 9.0 0.07)) + ) + (ja-no-eval :group! roboguard-city-idle0-ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05)) :frame-num 9.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05))) + ) + ) + #f + (none) + ) + +;; failed to figure out what this is: +(defstate wait (roboguard-city) + :virtual #t + :code roboguard-city-idle-code + ) + +;; failed to figure out what this is: +(defstate active (roboguard-city) + :virtual #t + :trans (behavior () + (nav-enemy-method-181 self) + (let ((t9-2 (-> (find-parent-state) trans))) + (if t9-2 + (t9-2) + ) + ) + (let ((gp-0 (get-current-enemy self))) + (when gp-0 + (let* ((s5-0 self) + (s4-0 (method-of-object s5-0 enemy-method-70)) + (s3-0 (handle->process (-> self target-status handle))) + ) + (s4-0 + s5-0 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus self) + (set! (-> self target-status handle) (process->handle gp-0)) + (go-hostile self) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (roboguard-city) + :virtual #t + :code sleep-code + :post (behavior () + (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) + (set-time! (-> self last-draw-time)) + ) + (update-focus self) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate stare (roboguard-city) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self stand-angle-threshold) 9102.223) + ) + :code roboguard-city-turret-code + :post roboguard-city-turn-torso-post + ) + +;; definition for method 233 of type roboguard-city +;; INFO: Used lq/sq +(defmethod roboguard-city-method-233 ((this roboguard-city) (arg0 vector) (arg1 vector)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> this root trans quad)) + (set! (-> a1-1 w) (-> this root nav-radius)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-1 255)) + (let* ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (closest-point-on-mesh (-> this nav) s3-0 arg0 (the-as nav-poly #f))) + (s4-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (when s2-0 + (clamp-vector-to-mesh-no-gaps (-> this nav) s3-0 s2-0 arg1 s4-1) + (not (-> s4-1 found-boundary)) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate dizzy (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (break!) + (logclear! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (if (= (-> self hit-points) 0.0) + (go-virtual explode) + ) + ) + :trans (behavior () + (if (time-elapsed? (-> self dizzy-start-time) (seconds 3)) + (go-virtual hostile) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (let* ((s5-0 (-> *part-id-table* 160)) + (gp-0 (get-field-spec-by-id s5-0 (sp-field-id spt-scale-x))) + (v1-13 (get-field-spec-by-id s5-0 (sp-field-id spt-scale-y))) + ) + (when (and gp-0 v1-13) + (let ((f30-0 (-> gp-0 initial-valuef)) + (f28-0 (-> gp-0 random-rangef)) + ) + (set! (-> gp-0 initial-valuef) (* 0.4 f30-0)) + (set! (-> gp-0 random-rangef) (* 0.4 f28-0)) + (let* ((v1-18 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-19 (the-as number (logior #x3f800000 v1-18))) + ) + (if (< (+ -1.0 (the-as float v1-19)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 10 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-27 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-28 (the-as number (logior #x3f800000 v1-27))) + ) + (if (< (+ -1.0 (the-as float v1-28)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 14 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-36 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-37 (the-as number (logior #x3f800000 v1-36))) + ) + (if (< (+ -1.0 (the-as float v1-37)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 8 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-45 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-46 (the-as number (logior #x3f800000 v1-45))) + ) + (if (< (+ -1.0 (the-as float v1-46)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 12 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-54 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-55 (the-as number (logior #x3f800000 v1-54))) + ) + (if (< (+ -1.0 (the-as float v1-55)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 19 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-63 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-64 (the-as number (logior #x3f800000 v1-63))) + ) + (if (< (+ -1.0 (the-as float v1-64)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 22 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-72 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-73 (the-as number (logior #x3f800000 v1-72))) + ) + (if (< (+ -1.0 (the-as float v1-73)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 18 + 0 + 40960.0 + ) + ) + ) + (let* ((v1-81 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-82 (the-as number (logior #x3f800000 v1-81))) + ) + (if (< (+ -1.0 (the-as float v1-82)) 0.1) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 21 + 0 + 40960.0 + ) + ) + ) + (set! (-> gp-0 initial-valuef) f30-0) + (set! (-> gp-0 random-rangef) f28-0) + ) + ) + ) + (set-time! (-> self state-time)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! roboguard-city-dizzy-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + (update-transforms (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate roll-enter (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-play "robo-roll" :id (-> self roll-sound)) + (logior! (-> self robo-flags) (robo-flag r2)) + (logclear! (-> self robo-flags) (robo-flag r3)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! roboguard-city-idle-to-ball-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual roll-chase) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f)) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate roll-exit (roboguard-city) + :virtual #t + :event enemy-event-handler + :exit (behavior () + (logclear! (-> self robo-flags) (robo-flag r2)) + (logior! (-> self robo-flags) (robo-flag r7)) + (set! (-> self attack-dist-scalar) 1.0) + (set-time! (-> self last-roll-time)) + ) + :trans (behavior () + (sound-stop (-> self roll-sound)) + ) + :code (behavior () + (ja-channel-push! 1 0) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans)))) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (ja-no-eval :group! roboguard-city-ball-to-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y-to-vector! + (-> self root quat) + (-> self root quat) + (the-as quaternion gp-1) + (* 32768.0 (seconds-per-frame)) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-virtual hostile-stand) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f)) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate roll-chase (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self flags) (citizen-flag in-pursuit)) + (if (not (logtest? (-> self squad alert-state flags) (squad-alert-flag war))) + (logior! (-> self flags) (citizen-flag persistent)) + ) + (set! (-> self attack-dist-scalar) 0.5) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 acceleration) 16384.0) + ) + 0 + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((gp-0 (-> self nav state)) + (v1-19 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-0 heading quad) (-> v1-19 quad)) + ) + 0 + (let ((gp-1 (-> self nav state)) + (v1-24 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-1 velocity quad) (-> v1-24 quad)) + ) + 0 + (set-time! (-> self state-time)) + (set! (-> self frustrate-roll-time) + (the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 451) 1050)) + ) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self frustrate-roll-time)) + (should-check-los? (-> self los) (seconds 0.6)) + ) + (go-virtual roll-exit) + ) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) 81920.0) + ) + 0 + (let ((v1-11 (-> self nav))) + (set! (-> v1-11 turning-acceleration) 20480.0) + ) + 0 + (when (time-elapsed? (-> self last-update-chase-pos-time) (seconds 1)) + (squad-control-method-31 + (-> self squad) + (-> self move-dest) + self + (-> self target-status handle) + (* 0.5 (-> self attack-distance)) + (-> self random-offset-search) + ) + (roboguard-city-method-239 self) + (set-time! (-> self last-update-chase-pos-time)) + ) + (let ((a0-9 (-> self nav state)) + (v1-25 (-> self move-dest)) + ) + (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-9 target-pos quad) (-> v1-25 quad)) + ) + 0 + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (case (roboguard-city-method-235 self) + ((2 3) + (go-virtual roll-exit) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja :group! roboguard-city-ball-ja) + (until #f + (let ((a0-4 (-> self skel root-channel 0))) + (let ((f0-0 0.000024414063) + (a2-0 (-> self nav state)) + (v1-7 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-7 quad) (-> a2-0 velocity quad)) + (set! (-> a0-4 param 0) (* f0-0 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z)))))) + ) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) + ) + (suspend) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for method 235 of type roboguard-city +(defmethod roboguard-city-method-235 ((this roboguard-city)) + (let ((f30-0 (vector-vector-xz-distance (-> this root trans) (-> this move-dest)))) + (vector-vector-xz-distance (-> this root trans) (-> this focus-pos)) + (let ((v1-2 #f) + (s5-0 0) + ) + #t + (cond + ((< 143360.0 f30-0) + (set! s5-0 1) + ) + ((< f30-0 8192.0) + (set! v1-2 (should-check-los? (-> this los) (seconds 0.6))) + ) + ) + (cond + (v1-2 + 2 + ) + ((< 8192.0 f30-0) + (roboguard-city-method-238 this #f) + (if (and (= s5-0 1) + (logtest? (-> this robo-flags) (robo-flag r10)) + (time-elapsed? (-> this last-roll-time) (seconds 1)) + ) + 1 + 0 + ) + ) + (else + (roboguard-city-method-238 this #t) + 2 + ) + ) + ) + ) + ) + +;; definition for method 236 of type roboguard-city +(defmethod roboguard-city-method-236 ((this roboguard-city)) + (local-vars (a0-7 city-attacker-info)) + (vector-vector-xz-distance (-> this root trans) (-> this move-dest)) + (let ((f30-0 (vector-vector-xz-distance (-> this root trans) (-> this focus-pos))) + (s5-0 (get-focus! this)) + ) + (cond + ((and (or (< f30-0 (* (-> this attack-distance) (-> this attack-dist-scalar))) + (not (time-elapsed? (-> this last-roll-time) (seconds 1))) + ) + (and s5-0 + (should-check-los? (-> this los) (seconds 0.6)) + (or (logtest? (-> this draw status) (draw-control-status on-screen)) + (not (and (-> this attacker-info) + (-> this mission-squad) + (begin (set! a0-7 (get-attacker-at-idx (-> this mission-squad) (-> this attacker-info enemy-index))) a0-7) + (logtest? (-> a0-7 flags) (city-attacker-info-flag cai4)) + ) + ) + ) + ) + ) + (cond + ((< (fabs (-> this torso-to-focus-angle)) 3640.889) + (if (>= 24576.0 (vector-vector-xz-distance (-> this root trans) (-> this focus-pos))) + 4 + 5 + ) + ) + (else + 2 + ) + ) + ) + (s5-0 + (cond + ((< f30-0 (* (-> this attack-distance) (-> this attack-dist-scalar))) + (roboguard-city-method-238 this #t) + (when (logtest? (-> this robo-flags) (robo-flag r8)) + (squad-control-method-31 + (-> this squad) + (-> this move-dest) + this + (-> this target-status handle) + (* 0.5 (-> this attack-distance)) + (-> this random-offset-search) + ) + (roboguard-city-method-239 this) + (roboguard-city-method-235 this) + ) + ) + (else + (roboguard-city-method-239 this) + (let* ((f30-2 65536.0) + (v1-37 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-38 (the-as number (logior #x3f800000 v1-37))) + ) + (set! (-> this random-offset-search) (* f30-2 (+ -1.0 (the-as float v1-38)))) + ) + (squad-control-method-31 + (-> this squad) + (-> this move-dest) + this + (-> this target-status handle) + (* 0.5 (-> this attack-distance)) + (-> this random-offset-search) + ) + (roboguard-city-method-235 this) + ) + ) + ) + (else + 6 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate giant-hostile (roboguard-city) + :virtual #t + :enter (behavior () + (nav-enemy-method-176 self) + (when (-> self nav) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (* (-> self speed-scale) (-> self enemy-info run-travel-speed))) + ) + 0 + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 turning-acceleration) 32768.0) + ) + 0 + (let ((v1-8 (-> self nav))) + (set! (-> v1-8 acceleration) 4096.0) + ) + 0 + (let ((gp-0 (-> self nav state)) + (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-0 heading quad) (-> v1-12 quad)) + ) + 0 + (let ((gp-1 (-> self nav state)) + (v1-17 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-1 velocity quad) (-> v1-17 quad)) + ) + 0 + (let ((v1-20 (-> self nav))) + (set! (-> v1-20 max-rotation-rate) 10922.667) + ) + 0 + (logclear! (-> self nav state nav flags) (nav-control-flag limit-rotation-rate)) + ) + (nav-enemy-method-181 self) + (set! (-> self nav callback-info) *default-nav-callback-info*) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (logior! (-> self nav state nav flags) (nav-control-flag limit-rotation-rate)) + (let ((gp-0 (-> self nav state)) + (v1-5 (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-pos quad) (-> v1-5 quad)) + ) + 0 + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 60) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for method 160 of type roboguard-city +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; failed to figure out what this is: +(defstate hostile (roboguard-city) + :virtual #t + :enter (behavior () + (if (logtest? (-> self robo-flags) (robo-flag r9)) + (go-virtual giant-hostile) + ) + (nav-enemy-method-176 self) + (when (-> self nav) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 target-speed) (* (-> self speed-scale) (-> self enemy-info run-travel-speed))) + ) + 0 + (let ((v1-12 (-> self nav))) + (set! (-> v1-12 turning-acceleration) 8192.0) + ) + 0 + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 acceleration) 4096.0) + ) + 0 + (let ((gp-0 (-> self nav state)) + (v1-18 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-0 heading quad) (-> v1-18 quad)) + ) + 0 + (let ((gp-1 (-> self nav state)) + (v1-23 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (set! (-> gp-1 velocity quad) (-> v1-23 quad)) + ) + 0 + ) + (nav-enemy-method-181 self) + (set-time! (-> self state-time)) + (set! (-> self attack-dist-scalar) 0.75) + ) + :exit (behavior () + (set! (-> self attack-dist-scalar) 1.0) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (roboguard-city-method-235 self))) + (cond + ((= v1-5 1) + (cond + ((time-elapsed? (-> self last-roll-time) (seconds 1)) + (go-virtual roll-enter) + ) + ((should-check-los? (-> self los) (seconds 0.6)) + (go-virtual shoot-attack) + ) + ) + ) + ((= v1-5 2) + (if (time-elapsed? (-> self state-time) (-> self reaction-time)) + (go-virtual hostile-stand) + ) + ) + ((= v1-5 3) + (go-virtual reposition) + ) + ((zero? v1-5) + (if (time-elapsed? (-> self state-time) (seconds 2)) + (go-virtual hostile-stand) + ) + ) + ) + ) + (logior! (-> self enemy-flags) (enemy-flag vulnerable)) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 60) + ) + :post (behavior () + (seek! (-> self torso-aim-blend) 0.0 (seconds-per-frame)) + (let ((v1-1 (-> self move-dest)) + (a0-2 (-> self nav state)) + ) + (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-2 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate hostile-stand (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self stand-angle-threshold) 9102.223) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + (set! (-> self attack-dist-scalar) 2.0) + ) + :exit (behavior () + (nav-enemy-method-179 self) + (set! (-> self attack-dist-scalar) 1.0) + ) + :trans (behavior () + (let ((v1-1 (roboguard-city-method-236 self))) + (cond + ((= v1-1 4) + (go-virtual close-attack) + ) + ((= v1-1 5) + (go-virtual shoot-attack) + ) + ((= v1-1 1) + (go-virtual roll-enter) + ) + ((zero? v1-1) + (if (time-elapsed? (-> self state-time) (-> self reaction-time)) + (go-virtual hostile) + ) + ) + ) + ) + ) + :code roboguard-city-turret-code + :post roboguard-city-turn-torso-post + ) + +;; failed to figure out what this is: +(defstate reposition (roboguard-city) + :virtual #t + :parent (roboguard-city hostile-stand) + ) + +;; failed to figure out what this is: +(defstate close-attack (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-time! (-> self fire-time)) + (nav-enemy-method-180 self 12288.0 (the-as float #f)) + (let* ((v1-6 *game-info*) + (v0-1 (+ (-> v1-6 attack-id) 1)) + ) + (set! (-> v1-6 attack-id) v0-1) + (set! (-> self persistent-attack-id) v0-1) + ) + ) + :exit (behavior () + (nav-enemy-method-179 self) + (logclear! (-> self robo-flags) (robo-flag r7)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (when #t + (let ((s5-0 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 2))) + (when (logtest? (-> s5-0 prim-core action) (collide-action deadly)) + (let ((gp-0 (new 'stack 'sphere))) + (set! (-> gp-0 quad) (-> s5-0 prim-core world-sphere quad)) + (let ((s5-1 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-1 384)) + (let* ((s3-0 (-> s5-1 s4-0)) + (v1-12 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-12 + (let* ((s2-0 (-> v1-12 process)) + (s3-1 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when s3-1 + (if (and (!= *target* s3-1) + (!= self s3-1) + (not (focus-test? (the-as process-focusable s3-1) disable dead inactive)) + (logtest? (process-mask crate guard vehicle civilian metalhead) (-> s3-1 mask)) + (let ((f0-0 (vector-vector-xz-distance-squared gp-0 (get-trans (the-as process-focusable s3-1) 3))) + (f1-0 10240.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (send-attack self s3-1 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) + ) + ) + ) + ) + ) + ) + ) + (let* ((s4-1 *target*) + (s5-2 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (when (and s5-2 (< (vector-vector-distance (get-trans s5-2 0) gp-0) (-> gp-0 r))) + (if (and (!= *target* s5-2) + (!= self s5-2) + (not (focus-test? s5-2 disable dead inactive)) + (logtest? (process-mask crate guard vehicle civilian metalhead) (-> s5-2 mask)) + (let ((f0-2 (vector-vector-xz-distance-squared gp-0 (get-trans s5-2 3))) + (f1-4 10240.0) + ) + (< f0-2 (* f1-4 f1-4)) + ) + ) + (send-attack self s5-2 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) + ) + ) + ) + ) + ) + ) + ) + ) + :code (behavior () + (let ((f30-0 + (lerp-scale 0.0 1.0 (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 12288.0 20480.0) + ) + ) + (ja-channel-push! 2 (seconds 0.3)) + (ja-no-eval :group! roboguard-city-punch-close-rotate-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-city-punch-far-rotate-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (seek-to-point-toward-point! + (-> self root) + (-> self focus-pos) + (* 1.2 (-> self nav max-rotation-rate)) + (seconds 0.02) + ) + (seek! (-> self torso-aim-blend) 0.0 (* 3.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (let ((f28-0 8192.0)) + (let* ((a0-10 (-> self root root-prim)) + (v1-53 (-> (the-as collide-shape-prim-group a0-10) child 2)) + ) + (+! (-> a0-10 local-sphere w) f28-0) + (set! (-> v1-53 prim-core action) (collide-action solid deadly)) + (set! (-> v1-53 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-53 prim-core collide-with) + (collide-spec jak bot civilian enemy obstacle hit-by-others-list player-list) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! roboguard-city-punch-close-go-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-city-punch-far-go-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 2 prim-core action) + (collide-action) + ) + (logclear! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! roboguard-city-punch-close-hold-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-city-punch-far-hold-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (suspend) + (ja :num! (seek! max 0.75)) + ) + (let* ((v1-147 (the-as collide-shape-prim-group (-> self root root-prim))) + (a0-26 (-> v1-147 child 2)) + ) + (set! (-> v1-147 local-sphere w) (- (-> v1-147 local-sphere w) f28-0)) + (set! (-> a0-26 prim-core collide-as) (collide-spec)) + (set! (-> a0-26 prim-core collide-with) (collide-spec)) + ) + ) + ) + 0 + (go-virtual hostile-stand) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate shoot-attack (roboguard-city) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self fired-this-time?) #f) + (set-time! (-> self state-time)) + (set-time! (-> self fire-time)) + (set! (-> self last-torso-frame-num) 0.0) + (set! (-> self stand-angle-threshold) 16384.0) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + (nav-enemy-method-181 self) + ) + :exit (behavior () + (when (> (-> self skel float-channels) 0) + (let ((a0-1 (joint-control-method-12 (-> self skel) 0))) + (joint-channel-float-delete! a0-1) + ) + ) + (logclear! (-> self robo-flags) (robo-flag r7)) + (set! (-> self fired-this-time?) #f) + (nav-enemy-method-179 self) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self fire-time) (seconds 0.6)) (zero? (-> self skel float-channels))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (-> self fired-this-time?)) + (let ((v1-12 (roboguard-city-method-236 self))) + (cond + ((= v1-12 4) + (go-virtual close-attack) + ) + ((= v1-12 1) + (go-virtual roll-enter) + ) + ((= v1-12 6) + (go-virtual hostile-stand) + ) + ((zero? v1-12) + (go-virtual hostile) + ) + ) + ) + ) + (let ((v1-28 (ja-channel-float! (the-as art-joint-anim roboguard-city-idle-shoot0-loop-ja) 0.0 0.0 0.0))) + (when v1-28 + (set! (-> self skel interp-select 0) #x13bb8) + (set! (-> self skel interp-select 1) 0) + (set! (-> v1-28 param 0) 1.0) + (set! (-> v1-28 param 1) 1.0) + (set! (-> v1-28 param 2) 2.0) + (set! (-> v1-28 num-func) num-func-interp1-play!) + ) + ) + (set-time! (-> self fire-time)) + ) + (let ((gp-0 (joint-control-method-12 (-> self skel) 0))) + (when gp-0 + (let ((f1-0 (-> gp-0 frame-num)) + (f0-3 (-> self last-torso-frame-num)) + ) + (cond + ((and (< 0.0 f1-0) (>= 0.0 f0-3)) + (fire-shot-from-joint-idx self 11) + ) + ((and (< 3.0 f1-0) (>= 3.0 f0-3)) + (fire-shot-from-joint-idx self 15) + ) + ) + ) + (set! (-> self last-torso-frame-num) (-> gp-0 frame-num)) + ) + ) + ) + :code roboguard-city-turret-code + :post roboguard-city-turn-torso-post + ) + +;; failed to figure out what this is: +(defstate knocked (roboguard-city) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self robo-flags) (robo-flag r7)) + (logclear! (-> self robo-flags) (robo-flag r2)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) + ) + (when (and (< 0.0 (-> self hit-points)) (logtest? (-> self draw status) (draw-control-status on-screen)) #f) + (let* ((s5-0 (-> *part-id-table* 160)) + (gp-1 (get-field-spec-by-id s5-0 (sp-field-id spt-scale-x))) + (v1-19 (get-field-spec-by-id s5-0 (sp-field-id spt-scale-y))) + ) + (when (and gp-1 v1-19) + (let ((f30-0 (-> gp-1 initial-valuef)) + (f28-0 (-> gp-1 random-rangef)) + ) + (set! (-> gp-1 initial-valuef) (* 0.4 f30-0)) + (set! (-> gp-1 random-rangef) (* 0.4 f28-0)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 10 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 14 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 8 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 12 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 19 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 22 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 18 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 43) + lightning-probe-callback + (-> *part-id-table* 160) + 21 + 0 + 40960.0 + ) + (set! (-> gp-1 initial-valuef) f30-0) + (set! (-> gp-1 random-rangef) f28-0) + ) + ) + ) + ) + ) + ) + +;; definition for method 81 of type roboguard-city +(defmethod go-die ((this roboguard-city)) + (go (method-of-object this explode)) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (roboguard-city) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member knocked-recover) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +;; definition for method 78 of type roboguard-city +(defmethod go-hostile ((this roboguard-city)) + (local-vars (v1-3 enemy-flag) (v1-5 enemy-flag)) + (logior! (-> this enemy-flags) (enemy-flag vulnerable)) + (let ((v1-2 (-> this enemy-flags))) + (if (logtest? v1-2 (enemy-flag attackable-backup)) + (set! v1-3 (logior v1-2 (enemy-flag attackable))) + (set! v1-3 (logclear v1-2 (enemy-flag attackable))) + ) + ) + (set! (-> this enemy-flags) v1-3) + (let ((v1-4 (-> this enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-4) + (set! v1-5 (logior (enemy-flag trackable) v1-4)) + (set! v1-5 (logclear v1-4 (enemy-flag trackable))) + ) + ) + (set! (-> this enemy-flags) v1-5) + (cond + ((handle->process (-> this focus handle)) + (logior! (-> this flags) (citizen-flag hostile)) + (go (method-of-object this hostile)) + ) + (else + (go (method-of-object this active)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (roboguard-city) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (go-virtual explode) + ) + ) + +;; failed to figure out what this is: +(defstate explode (roboguard-city) + :virtual #t + :enter (behavior () + (sound-play "robo-explode") + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + ) + :code (behavior () + (let ((v1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node roboguard-city-lod0-jg chest)))) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) + ) + ) + ) + (when (kg-squad-member-method-220 self) + (let ((v1-32 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> v1-32 hit-xz-reaction) 0.95) + (set! (-> v1-32 hit-y-reaction) 0.6) + (set! (-> v1-32 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + ) + ) + (cleanup-for-death self) + ) + ) + +;; definition of type roboguard-shot +(deftype roboguard-shot (guard-shot) + () + ) + +;; definition for method 3 of type roboguard-shot +(defmethod inspect ((this roboguard-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type guard-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 28 of type roboguard-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this roboguard-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "robo-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "guard-shot-hit") + ) + ) + ) + 0 + (none) + ) + +;; definition for function spawn-roboguard-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer roboguard-shot). +(defun spawn-roboguard-projectile ((arg0 roboguard-city) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 1.0) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-damage-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po15)) + (set! (-> gp-0 vehicle-impulse-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po16)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as (pointer roboguard-shot) (spawn-projectile roboguard-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; definition for method 234 of type roboguard-city +;; WARN: Return type mismatch int vs none. +(defmethod fire-shot-from-joint-idx ((this roboguard-city) (arg0 int)) + (let ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0))) + (s4-0 (-> this rotation-matrix fvec)) + ) + (set! (-> s4-0 y) 0.0) + (let ((f0-1 (vector-vector-xz-distance s5-0 (-> this focus-pos)))) + (vector-normalize! s4-0 f0-1) + ) + (set! (-> s4-0 y) (- (-> this focus-pos y) (-> s5-0 y))) + (vector-normalize! s4-0 40960.0) + (vector-rotate-around-y! s4-0 s4-0 (-> this torso-angle)) + (spawn-roboguard-projectile + this + s5-0 + (vector+! (new 'stack-no-clear 'vector) s5-0 s4-0) + 819200.0 + (the-as vector #f) + ) + ) + (set! (-> this fired-this-time?) #t) + 0 + (none) + ) + +;; definition for method 85 of type roboguard-city +(defmethod knocked-anim ((this roboguard-city) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 0) + (let ((v1-0 #t)) + (case (-> this incoming knocked-type) + (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) + (set! v1-0 #f) + ) + ) + (if (logtest? (-> this robo-flags) (robo-flag r2)) + (set! v1-0 #t) + ) + (cond + (v1-0 + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 25))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 25)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 25)) num-func-seek!) + ) + ) + (else + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-11 param 1) (-> arg0 anim-speed)) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) + ) + ) + ) + ) + #t + ) + +;; definition for method 86 of type roboguard-city +(defmethod knocked-land-anim ((this roboguard-city) (arg0 enemy-knocked-info)) + (let ((v1-0 #t)) + (case (-> this incoming knocked-type) + (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) + (set! v1-0 #f) + ) + ) + (if (logtest? (-> this robo-flags) (robo-flag r2)) + (set! v1-0 #t) + ) + (cond + (v1-0 + (let ((v1-3 (-> this skel root-channel 0))) + (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 26))) + (set! (-> v1-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 26)) frames num-frames) -1)) + ) + (set! (-> v1-3 param 1) (-> arg0 anim-speed)) + (set! (-> v1-3 frame-num) 0.0) + (joint-control-channel-group! v1-3 (the-as art-joint-anim (-> this draw art-group data 26)) num-func-seek!) + ) + ) + (else + (let ((v1-7 (-> this skel root-channel 0))) + (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 24))) + (set! (-> v1-7 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1)) + ) + (set! (-> v1-7 param 1) (-> arg0 anim-speed)) + (set! (-> v1-7 frame-num) 0.0) + (joint-control-channel-group! v1-7 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!) + ) + ) + ) + ) + #t + ) + +;; definition for method 82 of type roboguard-city +(defmethod event-handler ((this roboguard-city) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((or (= (-> this hit-points) 0.0) + (and (>= 1.0 (-> this hit-points)) (= (-> this incoming knocked-type) (knocked-type blue-shot))) + ) + (on-dying this) + (go (method-of-object this explode)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (else + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 140 of type roboguard-city +;; WARN: Return type mismatch int vs process. +(defmethod update-focus ((this roboguard-city)) + (the-as process 0) + ) + +;; definition for method 59 of type roboguard-city +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this roboguard-city)) + (roboguard-city-method-237 this) + (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) + (when s5-0 + (set! (-> this focus-pos quad) (-> (get-trans s5-0 3) quad)) + (los-control-method-9 (-> this los) s5-0 (-> this focus-pos) 819.2 4096.0) + ) + ) + (vector-! (-> this me-to-focus-dir) (-> this focus-pos) (-> this root trans)) + (set! (-> this me-to-focus-dir y) 0.0) + (vector-xz-normalize! (-> this me-to-focus-dir) 1.0) + (let* ((a1-6 (-> this rotation-matrix fvec)) + (s5-1 (-> this rotation-matrix)) + (f0-1 (vector-vector-angle-safe (-> this me-to-focus-dir) a1-6)) + ) + (if (< (vector-dot (-> this me-to-focus-dir) (the-as vector s5-1)) 0.0) + (set! f0-1 (* -1.0 f0-1)) + ) + (set! (-> this me-to-focus-angle) f0-1) + ) + (if (= (-> this faction-mode) 1) + (logclear! (-> this flags) (citizen-flag persistent)) + ) + (when (logtest? (-> this robo-flags) (robo-flag r8)) + (squad-control-method-31 + (-> this squad) + (-> this move-dest) + this + (-> this target-status handle) + (* 0.5 (-> this attack-distance)) + (-> this random-offset-search) + ) + (roboguard-city-method-239 this) + ) + (cond + ((logtest? (-> this robo-flags) (robo-flag r2)) + (let ((s5-3 (vector-! (new 'stack-no-clear 'vector) (math-camera-pos) (-> this root trans)))) + (set! (-> s5-3 y) 0.0) + (vector-normalize! s5-3 1.0) + (let ((a1-9 (-> this nav state)) + (v1-35 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-35 quad) (-> a1-9 heading quad)) + 0.0 + (let* ((f0-8 (vector-dot s5-3 v1-35)) + (f0-9 (+ 1.0 f0-8)) + (f0-10 (* 0.5 f0-9)) + (f0-11 (lerp -0.2 0.0 f0-10)) + ) + (sound-play-by-name + (static-sound-name "robo-roll") + (-> this roll-sound) + 1024 + (the int (* 1524.0 f0-11)) + 0 + (sound-group) + #t + ) + ) + ) + ) + ) + (else + (sound-stop (-> this roll-sound)) + ) + ) + (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) + ((method-of-type kg-squad-member enemy-common-post) this) + (none) + ) + +;; definition for method 10 of type roboguard-city +(defmethod deactivate ((this roboguard-city)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this roll-sound)) + (call-parent-method this) + (none) + ) + +;; definition for method 67 of type roboguard-city +(defmethod coin-flip? ((this roboguard-city)) + #f + ) + +;; definition for method 240 of type roboguard-city +;; WARN: Return type mismatch vector vs none. +(defmethod init-draw-params ((this roboguard-city)) + (logior! (-> this robo-flags) (robo-flag r9)) + (setup-masks (-> this draw) -1 0) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.1 1.0) + (set-vector! (-> this draw color-emissive) 0.1 0.5 0.5 1.5) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (none) + ) + +;; definition for method 194 of type roboguard-city +;; WARN: Return type mismatch focus-status vs none. +(defmethod citizen-method-194 ((this roboguard-city)) + (local-vars (a0-21 int)) + (set! (-> this kg-type) (the-as uint 6)) + (call-parent-method this) + (set! (-> this fired-this-time?) #f) + (set! (-> this dizzy-start-time) 0) + (set! (-> this target-status handle) (the-as handle #f)) + (set! (-> this robo-flags) (robo-flag)) + (set! (-> this cannot-reach-target?) #f) + (set! (-> this cannot-reach-target-start-time) 0) + (let* ((f30-0 65536.0) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (set! (-> this random-offset-search) (* f30-0 (+ -1.0 (the-as float v1-4)))) + ) + (logior! (-> this robo-flags) (robo-flag r10)) + (set! (-> this torso-aim-blend) 0.0) + (set! (-> this torso-angle) 0.0) + (set! (-> this torso-seek-speed) 0.0) + (set! (-> this torso-to-focus-angle) 0.0) + (let* ((v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + (f0-10 (+ -1.0 (the-as float v1-10))) + ) + (cond + ((< f0-10 0.1) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + ((< f0-10 0.26) + (set! (-> this fact pickup-type) (pickup-type health)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + (else + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 10.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + ) + ) + (set! (-> this attack-distance) (rnd-float-range this 49152.0 106496.0)) + (set! (-> this attack-dist-scalar) 1.0) + (set! (-> this last-attack-time) 0) + (let ((v1-37 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 3) 2)) + (s5-0 0) + ) + 0 + (let* ((a0-15 10) + (s3-0 0) + (s4-0 (+ a0-15 -3)) + ) + (dotimes (a0-16 v1-37) + (set! s3-0 (logior s3-0 (ash 1 a0-16))) + ) + (dotimes (s2-0 s4-0) + (let ((a0-18 (mod (the-as int (rand-uint31-gen *random-generator*)) s4-0)) + (a1-5 (logtest? s3-0 (ash 1 s2-0))) + ) + (let ((v1-45 (logtest? s3-0 (ash 1 a0-18)))) + (if a1-5 + (set! a0-21 (logior s3-0 (ash 1 a0-18))) + (set! a0-21 (logclear s3-0 (ash 1 a0-18))) + ) + (if v1-45 + (set! s3-0 (logior a0-21 (ash 1 s2-0))) + (set! s3-0 (logclear a0-21 (ash 1 s2-0))) + ) + ) + ) + ) + (let ((v1-55 0)) + (dotimes (a0-25 s4-0) + (while (or (= v1-55 0) (= v1-55 1) (= v1-55 4)) + (+! v1-55 1) + ) + (if (logtest? s3-0 (ash 1 a0-25)) + (set! s5-0 (logior s5-0 (ash 1 v1-55))) + ) + (+! v1-55 1) + ) + ) + ) + (let* ((f30-1 0.2) + (v1-60 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-61 (the-as number (logior #x3f800000 v1-60))) + (f0-21 (+ -1.0 (the-as float v1-61))) + ) + (cond + ((< f0-21 (* 0.5 f30-1)) + (set! s5-0 (logior s5-0 2)) + ) + ((< f0-21 f30-1) + (set! s5-0 (logior s5-0 16)) + ) + ) + ) + (setup-masks (-> this draw) -1 0) + (setup-masks (-> this draw) 0 s5-0) + ) + (logclear! (-> this focus-status) (focus-status dangerous)) + (none) + ) + +;; definition for method 121 of type roboguard-city +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this roboguard-city)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-city" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this roll-sound) (new-sound-id)) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) + ) + (init-enemy-defaults! this *roboguard-city-nav-enemy-info*) + (let ((t9-4 (method-of-type kg-squad-member init-enemy!))) + (t9-4 this) + ) + (set! (-> this last-update-chase-pos-time) 0) + (init-los! + (-> this los) + this + (seconds 0.1) + 327680.0 + (collide-spec backgnd obstacle hit-by-others-list los-blocker) + ) + (set! (-> this water-anim) 3) + (let ((v1-13 (-> this node-list data 4))) + (set! (-> v1-13 param0) + (lambda ((arg0 cspace) (arg1 transformq)) + (let ((s3-0 (the-as roboguard-city (-> arg0 param1))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s1-0 (-> s3-0 rotation-matrix)) + (s2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 focus-pos) (-> arg0 bone transform trans))) + ) + (set! (-> s2-1 y) 0.0) + (set! (-> s1-0 fvec y) 0.0) + (set! (-> s1-0 rvec y) 0.0) + (vector-xz-normalize! s2-1 1.0) + (vector-xz-normalize! (-> s1-0 fvec) 1.0) + (vector-xz-normalize! (-> s1-0 rvec) 1.0) + (let ((f0-6 (acos (fmax (vector-dot (-> s1-0 fvec) s2-1) (cos 18204.445))))) + (if (< (vector-dot (-> s1-0 rvec) s2-1) 0.0) + (set! f0-6 (* -1.0 f0-6)) + ) + (set! (-> s3-0 torso-angle) + (* (-> s3-0 torso-aim-blend) + (seek (-> s3-0 torso-angle) f0-6 (* (-> s3-0 torso-seek-speed) (seconds-per-frame))) + ) + ) + ) + ) + (quaternion-vector-angle! gp-0 *y-vector* (-> s3-0 torso-angle)) + (quaternion*! (-> arg1 quat) (-> arg1 quat) gp-0) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + (set! (-> v1-13 param1) this) + ) + (set! (-> this anim-shuffle) 10) + (set! (-> this anim-walk) 10) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this dist-run-anim) 26624.0) + (set! (-> this anim-run) 11) + (set! (-> this speed-run) 49152.0) + (set! (-> this draw lod-set lod 0 dist) 491520.0) + 0 + (none) + ) + +;; definition for method 75 of type roboguard-city +(defmethod go-stare ((this roboguard-city)) + (go (method-of-object this reposition)) + ) + +;; definition for method 221 of type roboguard-city +;; WARN: disable def twice: 6. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod get-current-enemy ((this roboguard-city)) + (if #t + (handle->process (-> this attacker-info enemy)) + (squad-control-city-method-35 (-> this squad) this (-> this target-status handle)) + ) + ) + +;; definition for method 237 of type roboguard-city +;; INFO: Used lq/sq +(defmethod roboguard-city-method-237 ((this roboguard-city)) + (when (not (handle->process (-> this target-status handle))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this target-status handle) (the-as handle #f)) + ) + (let ((a0-6 (get-current-enemy this))) + (cond + (a0-6 + (let ((v1-9 (process->handle a0-6))) + (when (!= v1-9 (-> this target-status handle)) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + ) + (logior! (-> this flags) (citizen-flag hostile)) + (set! (-> this target-status handle) (the-as handle v1-9)) + (set! (-> this current-enemy) (the-as handle v1-9)) + ) + ) + (else + (set! (-> this target-status handle) (the-as handle #f)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 3))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (if (time-elapsed? (-> this pursuit-start-time) (seconds 5)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit)) + ) + (let ((v1-26 (new 'stack-no-clear 'vector))) + (set! (-> v1-26 quad) (-> this root trans quad)) + (+! (-> v1-26 y) 8192.0) + ) + (let* ((s5-0 (handle->process (-> this target-status handle))) + (a0-36 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and a0-36 + (not (logtest? (-> (the-as process-focusable a0-36) focus-status) (focus-status disable dead inactive))) + ) + (let* ((s5-1 this) + (s4-0 (method-of-object s5-1 enemy-method-70)) + (s3-0 (handle->process (-> this target-status handle))) + ) + (s4-0 + s5-1 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus this) + (let ((f0-2 (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (f1-1 204800.0) + ) + (when (< f0-2 (* f1-1 f1-1)) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + (when (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (let ((v0-6 (the-as object (logior (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + ) + ) + ) + ((!= (-> this target-status handle) #f) + (set! (-> this target-status handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-208 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) + ) + ) + ) + ) + +;; definition for method 238 of type roboguard-city +(defmethod roboguard-city-method-238 ((this roboguard-city) (arg0 symbol)) + (cond + ((or arg0 (logtest? (-> this nav state flags) (nav-state-flag blocked avoiding-sphere))) + (when (not (-> this cannot-reach-target?)) + (set! (-> this cannot-reach-target?) #t) + (set-time! (-> this cannot-reach-target-start-time)) + ) + ) + (else + (set! (-> this cannot-reach-target?) #f) + (set! (-> this cannot-reach-target-start-time) 0) + 0 + ) + ) + (when (and (-> this cannot-reach-target?) (time-elapsed? (-> this cannot-reach-target-start-time) (seconds 0.5))) + (let* ((f30-0 65536.0) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> this random-offset-search) (* f30-0 (+ -1.0 (the-as float v1-16)))) + ) + (let ((v0-0 (logior (-> this robo-flags) (robo-flag r8)))) + (set! (-> this robo-flags) v0-0) + v0-0 + ) + ) + ) + +;; definition for method 239 of type roboguard-city +(defmethod roboguard-city-method-239 ((this roboguard-city)) + (set! (-> this cannot-reach-target?) #f) + (set! (-> this cannot-reach-target-start-time) 0) + (let ((v0-0 (logclear (-> this robo-flags) (robo-flag r8)))) + (set! (-> this robo-flags) v0-0) + v0-0 + ) + ) + +;; definition for method 65 of type roboguard-city +(defmethod penetrate->next-state ((this roboguard-city) (arg0 process) (arg1 event-message-block) (arg2 float)) + (cond + ((logtest? (penetrate emp-blast) (-> this incoming penetrate-using)) + (set-time! (-> this dizzy-start-time)) + (if #t + 'hit-knocked + 'nothing + ) + ) + (else + (call-parent-method this arg0 arg1 arg2) + ) + ) + ) + +;; definition for method 215 of type roboguard-city +(defmethod citizen-method-215 ((this roboguard-city)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 9) + ) + ) + (none) + ) + +;; definition for method 212 of type roboguard-city +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod go-from-behavior ((this roboguard-city) (arg0 traffic-object-spawn-params)) + (if (= (-> arg0 guard-type) 7) + (init-draw-params this) + ) + (case (-> arg0 behavior) + ((6) + (set! (-> this root trans quad) (-> arg0 position quad)) + (go (method-of-object this exit-transport)) + ) + (else + (call-parent-method this arg0) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate exit-transport (roboguard-city) + :virtual #t + :enter (behavior () + (nav-enemy-method-182 self) + (logclear! (-> self root status) (collide-status on-surface touch-surface impact-surface)) + ) + :trans (behavior () + (when (logtest? (-> self root status) (collide-status on-surface touch-surface impact-surface)) + (sound-play "robo-roll" :id (-> self roll-sound)) + (logior! (-> self robo-flags) (robo-flag r2)) + (go-virtual roll-chase) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja :group! roboguard-city-ball-ja :num! zero) + (sleep-code) + ) + :post (behavior () + (enemy-falling-post) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/slums/ctysluma-part_REF.gc b/test/decompiler/reference/jak3/levels/city/slums/ctysluma-part_REF.gc new file mode 100644 index 0000000000..b7ce3e335c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/slums/ctysluma-part_REF.gc @@ -0,0 +1,1792 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-barrel-fire + :id 951 + :bounds (static-bspherem 0 3 0 4) + :parts ((sp-item 3389 :fade-after (meters 50) :falloff-to (meters 80)) + (sp-item 3390 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 0.335) :length (seconds 0.167)) + (sp-item 3391 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.4) :length (seconds 0.185) :offset 20) + (sp-item 3392 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 0.535) :length (seconds 0.1) :offset 35) + (sp-item 3390 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.85) :length (seconds 0.2) :offset 65) + (sp-item 3391 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 1.25) :length (seconds 0.135) :offset 15) + (sp-item 3392 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 1.435) :length (seconds 0.167) :offset 85) + (sp-item 3390 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 2) :length (seconds 0.235) :offset 100) + (sp-item 3391 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 4.167) :length (seconds 0.15) :offset 450) + (sp-item 3392 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 5) :length (seconds 0.085) :offset 115) + (sp-item 3390 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 7) :length (seconds 0.185) :offset 80) + (sp-item 3393 :fade-after (meters 20) :falloff-to (meters 10) :binding 3388) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3388 :flags (sp1 sp2 sp3)) + (sp-item 3394 :fade-after (meters 50) :falloff-to (meters 50)) + (sp-item 3395 :fade-after (meters 30) :falloff-to (meters 30)) + (sp-item 3396 :fade-after (meters 70) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 3396 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 12.0) + (:fade-a -0.4) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 10240.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3393 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 0.8) + (:sound (static-sound-spec "fire-pop" :group 0 :volume 10000.0)) + (:x (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:accel-y (meters -0.000033333334) (meters -0.00006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3388 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.1) (meters 0.3)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 128.0) + (:b 128.0) + (:a 96.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.026666667) (meters 0.053333335)) + (:vel-y (meters 0)) + (:vel-z (meters -0.0013333333) (meters 0.0026666666)) + (:fade-r 0.0) + (:fade-g -0.7111111) + (:fade-b -0.7111111) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.6)) + (:next-launcher 3397) + ) + ) + +;; failed to figure out what this is: +(defpart 3397 + :init-specs ((:fade-r -1.0666667) (:fade-g 1.0666667) (:fade-b 1.0666667)) + ) + +;; failed to figure out what this is: +(defpart 3390 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3398) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 87)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3391 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3398) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 120) (degrees 90)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3392 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3398) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 240) (degrees 110)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3398 + :init-specs ((:b 0.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.4 -0.2) + (:next-time (seconds 0.135) (seconds 0.03)) + (:next-launcher 3399) + ) + ) + +;; failed to figure out what this is: +(defpart 3399 + :init-specs ((:fade-r -0.125) (:fade-g 0.4) (:fade-b 0.4)) + ) + +;; failed to figure out what this is: +(defpart 3389 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 4.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3394 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.4) + (:x (meters -0.25) (meters 0.5)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.64) + (:fade-g -0.32) + (:fade-b -0.32) + (:fade-a -0.017777778 -0.026666667) + (:accel-y (meters -0.000006666667)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.5) (seconds 0.165)) + (:next-launcher 3400) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3400 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpart 3395 + :init-specs ((:num 0.4) + (:x (meters 0) (meters 0.2)) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-x (meters 0) (meters 0.006666667)) + (:vel-y (meters 0.02) (meters 0.013333334)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3401) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3401 + :init-specs ((:fade-b -0.68266666)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-streetlight-glows + :id 952 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 3 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 3402 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 2 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 3 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 30.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 3402 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 10.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-steamescape + :id 953 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3403 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3404 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3403 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 1.0) + (:x (meters -0.8) 4 (meters 0.4)) + (:y (meters -0.1) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3405) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3404 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -0.4) 1 (meters 0.4)) + (:y (meters 0) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3405) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3405 + :init-specs ((:fade-a -0.064 -0.064)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-steam-drift + :id 954 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3406 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3406 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.1) + (:z (meters 1)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.53333336) + (:accel-y (meters 0.00006666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x405c00 #x400000)) + (:next-time (seconds 0.5)) + (:next-launcher 3407) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3407 + :init-specs ((:fade-a -0.07619048 -0.07619048)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-steamvent + :id 955 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3408 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + (sp-item 3409 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3408 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.0 5.0) + (:scale-x (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b :copy g) + (:a 64.0 32.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.083333336) (meters 0.033333335)) + (:fade-a -0.64 -0.64) + (:friction 0.93 0.025) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:launchrot-x (degrees -7.5) (degrees 15)) + (:launchrot-y (degrees -7.5) (degrees 15)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3409 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.083333336) (meters 0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.016666668)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.96) + (:friction 0.93 0.025) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3410) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3410 + :init-specs ((:fade-a -0.48 -0.48)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-shootout-fire-blue + :id 956 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 3411 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3411 + :init-specs ((:texture (blue-tracer ctysluma-sprite)) + (:num 0.0 0.02) + (:scale-x (meters 10)) + (:rot-x 4) + (:scale-y (meters 1) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.0675)) + (:vel-z (meters 0.5)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -5) (degrees 10)) + (:conerot-y (degrees -30) (degrees 60)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-shootout-fire-red + :id 957 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 3412 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3412 + :init-specs ((:texture (red-tracer ctysluma-sprite)) + (:num 0.0 0.02) + (:scale-x (meters 10)) + (:rot-x 4) + (:scale-y (meters 1) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.0675)) + (:vel-z (meters 0.5)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -5) (degrees 10)) + (:conerot-y (degrees -30) (degrees 60)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-rubble-crater-smoke + :id 958 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3413 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3413 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 1)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.005925926)) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.000033333334) (meters 0.00006666667)) + (:accel-y (meters 0.00033333333) (meters 0.000033333334)) + (:accel-z (meters -0.000033333334) (meters 0.00006666667)) + (:friction 0.94) + (:timer (seconds 10.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3414) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3414 + :init-specs ((:fade-a -0.024615385 -0.024615385)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-rubble-smoke + :id 959 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3415 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3415 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.0014814815)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3416) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3416 + :init-specs ((:fade-a -0.11636364)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-rubble-smoke-lit + :id 960 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3417 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 3417 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 6)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 160) (degrees 40)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 10.0) + (:a 0.0) + (:vel-y (meters 0.0014814815)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.26666668 0.26666668) + (:accel-y (meters 0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 5.167)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 3418) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3418 + :init-specs ((:fade-a -0.14545454)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslum-rubble-fire + :id 961 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 3419 :fade-after (meters 100) :flags (sp6 sp7)) + (sp-item 3420 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + (sp-item 3421 :falloff-to (meters 40) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3420 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0 1.0) + (:x (meters -5) (meters 10)) + (:y (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 155.0) + (:g 164.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:accel-y (meters 0.0033333334) (meters 0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-color-rubble-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.6 :z -0.9 :w -1.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 30.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 120.0 :z 30.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.6666666 :y 3.333334 :z 9.999998 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-alpha-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 255.0 :z 256.0 :w 257.0) + :one-over-x-deltas (new 'static 'vector :x 127.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-rubble-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-rubble-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *r-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *g-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.7 :y 0.5 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x -0.19999999 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *b-curve-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.6 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -1.6666666 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-alpha-rubble-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.5 :w -1.0) + :ys (new 'static 'vector :y 0.5 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6666666 :y 2.5000002 :z -2.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-scale-rubble-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 0.3 :w 1.3) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y -1.4 :z 0.99999994 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-scale-rubble-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 2.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-ctyslum-rubble-fire-flame-curve-settings*, type particle-curve-settings +(define *part-ctyslum-rubble-fire-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.4) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 3420 init-specs 16 initial-valuef) + (the-as float *part-ctyslum-rubble-fire-flame-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* color-start) *range-color-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* alpha-start) *range-alpha-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* scale-x-start) *range-scale-rubble-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* scale-y-start) *range-scale-rubble-flame-y*) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* r-scalar) *r-curve-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* g-scalar) *g-curve-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* b-scalar) *b-curve-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* a-scalar) *curve-alpha-rubble-flame*) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* scale-x-scalar) *curve-scale-rubble-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-ctyslum-rubble-fire-flame-curve-settings* scale-y-scalar) *curve-scale-rubble-flame-y*) + +;; failed to figure out what this is: +(defpart 3422 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:y (meters -1)) + (:scale-x (meters 7) (meters 7)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-y (meters -0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters -0.016666668)) + (:fade-r 0.33333334) + (:fade-g -0.083333336) + (:fade-b -1.875) + (:fade-a 0.42666668) + (:accel-y (meters 0.00033333333) (meters 0.005)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 3423) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 1) (meters 10)) + ) + ) + +;; failed to figure out what this is: +(defpart 3423 + :init-specs ((:scalevel-x (meters -0.016666668)) (:fade-a -0.425 -0.425)) + ) + +;; failed to figure out what this is: +(defpart 3421 + :init-specs ((:num 1.0) + (:x (meters -6) (meters 12)) + (:y (meters -1) (meters 6)) + (:z (meters -3) (meters 6)) + (:rot-x 8) + (:r 12288.0) + (:g 2048.0) + (:b 2048.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:fade-g 6.826667) + (:accel-y (meters 0.0016666667) (meters 0.00033333333)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 3424) + ) + ) + +;; failed to figure out what this is: +(defpart 3424 + :init-specs ((:fade-g -6.826667)) + ) + +;; failed to figure out what this is: +(defpart 3419 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.2) + (:y (meters 2)) + (:scale-x (meters 30)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 60.0 20.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-spray + :id 962 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3425 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3426 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3425 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 2.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + ) + ) + +;; failed to figure out what this is: +(defpart 3427 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 3428)) + ) + +;; failed to figure out what this is: +(defpart 3428 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 3427)) + ) + +;; failed to figure out what this is: +(defpart 3426 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-spray-check-userdata-8 + :id 963 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3429 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3430 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; definition for function check-drop-level-ctysluma-drop-userdata +;; INFO: Used lq/sq +(defun check-drop-level-ctysluma-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (< (-> arg2 y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 3431) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 3429 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctysluma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + ) + ) + +;; failed to figure out what this is: +(defpart 3430 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctysluma-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + ) + ) + +;; failed to figure out what this is: +(defpart 3431 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.05625)) + (:vel-y (meters 0.01) (meters 0.026666667)) + (:fade-a -0.21333334) + (:accel-y (meters -0.001) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3427) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-chimney + :id 964 + :bounds (static-bspherem 0 0 -10 24) + :parts ((sp-item 3432 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 3433 :fade-after (meters 200) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 3433 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 6144.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3432 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3434) + ) + ) + +;; failed to figure out what this is: +(defpart 3434 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3435)) + ) + +;; failed to figure out what this is: +(defpart 3435 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3436) + ) + ) + +;; failed to figure out what this is: +(defpart 3436 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3437) + ) + ) + +;; failed to figure out what this is: +(defpart 3437 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-chimney-smoke + :id 965 + :bounds (static-bspherem 0 0 -12 24) + :parts ((sp-item 3438 :fade-after (meters 200) :falloff-to (meters 300))) + ) + +;; failed to figure out what this is: +(defpart 3438 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.4) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3439) + ) + ) + +;; failed to figure out what this is: +(defpart 3439 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3440) + ) + ) + +;; failed to figure out what this is: +(defpart 3440 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-sign-m5-8x4 + :id 966 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3441 :flags (is-3d sp3 sp7)) + (sp-item 3442 :flags (is-3d sp3 sp7)) + (sp-item 3443 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3443 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 48) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3441 + :init-specs ((:texture (sign-m5 ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504c00 -2139062144 0 1 #x8504c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3442 + :init-specs ((:texture (sign-m5 ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504c00 -2139062144 0 1 #x8504c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-sign-metalhead-8x4 + :id 967 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3444 :flags (is-3d sp3 sp7)) + (sp-item 3445 :flags (is-3d sp3 sp7)) + (sp-item 3443 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3444 + :init-specs ((:texture (sign-metalhead ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504d00 -2139062144 0 1 #x8504d00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3445 + :init-specs ((:texture (sign-metalhead ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.1)) + (:scale-x (meters 16)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504d00 -2139062144 0 1 #x8504d00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-sign-crimson-4x8 + :id 968 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3446 :flags (is-3d sp3 sp7)) + (sp-item 3447 :flags (is-3d sp3 sp7)) + (sp-item 3448 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3448 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 48) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3446 + :init-specs ((:texture (sign-crimson ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504900 -2139062144 0 1 #x8504900 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3447 + :init-specs ((:texture (sign-crimson ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504900 -2139062144 0 1 #x8504900 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-sign-doctors-4x4 + :id 969 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3449 :flags (is-3d sp3 sp7)) + (sp-item 3450 :flags (is-3d sp3 sp7)) + (sp-item 3451 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3451 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3449 + :init-specs ((:texture (sign-doctors ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504a00 -2139062144 0 1 #x8504a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3450 + :init-specs ((:texture (sign-doctors ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504a00 -2139062144 0 1 #x8504a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-sign-hiphog-4x4 + :id 970 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3452 :flags (is-3d sp3 sp7)) + (sp-item 3453 :flags (is-3d sp3 sp7)) + (sp-item 3451 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3452 + :init-specs ((:texture (sign-hiphog ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504b00 -2139062144 0 1 #x8504b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3453 + :init-specs ((:texture (sign-hiphog ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504b00 -2139062144 0 1 #x8504b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctysluma-sign-blank-4x4 + :id 971 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3454 :flags (is-3d sp3 sp7)) + (sp-item 3455 :flags (is-3d sp3 sp7)) + (sp-item 3451 :fade-after (meters 200) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3454 + :init-specs ((:texture (sign-blank ctysluma-sprite)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504800 -2139062144 0 1 #x8504800 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3455 + :init-specs ((:texture (sign-blank ctysluma-sprite)) + (:num 1.0) + (:z (meters -0.05)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:rot-z (degrees 180)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #x8504800 -2139062144 0 1 #x8504800 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/slums/ctyslumb-part_REF.gc b/test/decompiler/reference/jak3/levels/city/slums/ctyslumb-part_REF.gc new file mode 100644 index 0000000000..aa38cff8ac --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/slums/ctyslumb-part_REF.gc @@ -0,0 +1,1462 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumb-barrel-fire + :id 973 + :bounds (static-bspherem 0 3 0 4) + :parts ((sp-item 3555 :fade-after (meters 50) :falloff-to (meters 80)) + (sp-item 3556 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 0.335) :length (seconds 0.167)) + (sp-item 3557 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.4) :length (seconds 0.185) :offset 20) + (sp-item 3558 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 0.535) :length (seconds 0.1) :offset 35) + (sp-item 3556 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 0.85) :length (seconds 0.2) :offset 65) + (sp-item 3557 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 1.25) :length (seconds 0.135) :offset 15) + (sp-item 3558 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 1.435) :length (seconds 0.167) :offset 85) + (sp-item 3556 :fade-after (meters 40) :falloff-to (meters 40) :period (seconds 2) :length (seconds 0.235) :offset 100) + (sp-item 3557 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 4.167) :length (seconds 0.15) :offset 450) + (sp-item 3558 :fade-after (meters 60) :falloff-to (meters 90) :period (seconds 5) :length (seconds 0.085) :offset 115) + (sp-item 3556 :fade-after (meters 20) :falloff-to (meters 20) :period (seconds 7) :length (seconds 0.185) :offset 80) + (sp-item 3559 :fade-after (meters 20) :falloff-to (meters 10) :binding 3554) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3554 :flags (sp1 sp2 sp3)) + (sp-item 3560 :fade-after (meters 50) :falloff-to (meters 50)) + (sp-item 3561 :fade-after (meters 30) :falloff-to (meters 30)) + (sp-item 3562 :fade-after (meters 70) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 3562 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 12.0) + (:fade-a -0.4) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 10240.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3559 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 0.8) + (:sound (static-sound-spec "fire-pop" :group 0 :volume 10000.0)) + (:x (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:accel-y (meters -0.000033333334) (meters -0.00006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3554 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.1) (meters 0.3)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 128.0) + (:b 128.0) + (:a 96.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.026666667) (meters 0.053333335)) + (:vel-y (meters 0)) + (:vel-z (meters -0.0013333333) (meters 0.0026666666)) + (:fade-r 0.0) + (:fade-g -0.7111111) + (:fade-b -0.7111111) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-1 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.6)) + (:next-launcher 3563) + ) + ) + +;; failed to figure out what this is: +(defpart 3563 + :init-specs ((:fade-r -1.0666667) (:fade-g 1.0666667) (:fade-b 1.0666667)) + ) + +;; failed to figure out what this is: +(defpart 3556 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3564) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 87)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3557 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3564) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 120) (degrees 90)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3558 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0 6.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.3) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 240.0 15.0) + (:g 200.0 16.0) + (:b 160.0 16.0) + (:a 32.0 32.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-r -2.1333334 -1.0666667) + (:fade-g -4.266667 -2.1333334) + (:fade-b -5.3333335) + (:accel-y (meters -0.0001)) + (:timer (seconds 0.535) (seconds 0.265)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 3564) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 240) (degrees 110)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3564 + :init-specs ((:b 0.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.4 -0.2) + (:next-time (seconds 0.135) (seconds 0.03)) + (:next-launcher 3565) + ) + ) + +;; failed to figure out what this is: +(defpart 3565 + :init-specs ((:fade-r -0.125) (:fade-g 0.4) (:fade-b 0.4)) + ) + +;; failed to figure out what this is: +(defpart 3555 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 4.0) + (:x (meters 0) (meters -0.25)) + (:y (meters -0.8)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-x (meters 0.00033333333)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees -8) 4 (degrees 4)) + (:conerot-y (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 3560 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.4) + (:x (meters -0.25) (meters 0.5)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.64) + (:fade-g -0.32) + (:fade-b -0.32) + (:fade-a -0.017777778 -0.026666667) + (:accel-y (meters -0.000006666667)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.5) (seconds 0.165)) + (:next-launcher 3566) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3566 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpart 3561 + :init-specs ((:num 0.4) + (:x (meters 0) (meters 0.2)) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-x (meters 0) (meters 0.006666667)) + (:vel-y (meters 0.02) (meters 0.013333334)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 3567) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 3567 + :init-specs ((:fade-b -0.68266666)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumb-streetlight-glows + :id 974 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 5 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 4 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 5 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumb-chimney + :id 975 + :bounds (static-bspherem 0 0 -10 24) + :parts ((sp-item 3568 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 3569 :fade-after (meters 200) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 3569 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 6144.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3568 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3570) + ) + ) + +;; failed to figure out what this is: +(defpart 3570 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3571)) + ) + +;; failed to figure out what this is: +(defpart 3571 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3572) + ) + ) + +;; failed to figure out what this is: +(defpart 3572 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3573) + ) + ) + +;; failed to figure out what this is: +(defpart 3573 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumb-chimney-smoke + :id 976 + :bounds (static-bspherem 0 0 -12 24) + :parts ((sp-item 3574 :fade-after (meters 200) :falloff-to (meters 300))) + ) + +;; failed to figure out what this is: +(defpart 3574 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.4) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3575) + ) + ) + +;; failed to figure out what this is: +(defpart 3575 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3576) + ) + ) + +;; failed to figure out what this is: +(defpart 3576 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumb-square-a + :id 977 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3577 :flags (is-3d sp3 sp7)) + (sp-item 3578 :flags (is-3d sp3 sp7)) + (sp-item 3579 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3577 + :init-specs ((:texture (sign-square-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 9)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200700 -2139062144 0 1 #xa200700 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3578 + :init-specs ((:texture (sign-square-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 9)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200700 -2139062144 0 1 #xa200700 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3579 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumb-square-b + :id 978 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3580 :flags (is-3d sp3 sp7)) + (sp-item 3581 :flags (is-3d sp3 sp7)) + (sp-item 3582 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3580 + :init-specs ((:texture (sign-square-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 9)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200800 -2139062144 0 1 #xa200800 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3581 + :init-specs ((:texture (sign-square-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 9)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200800 -2139062144 0 1 #xa200800 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3582 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumb-wide-a + :id 979 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3583 :flags (is-3d sp3 sp7)) + (sp-item 3584 :flags (is-3d sp3 sp7)) + (sp-item 3585 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3583 + :init-specs ((:texture (sign-wide-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 17)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200b00 -2139062144 0 1 #xa200b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3584 + :init-specs ((:texture (sign-wide-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 17)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200b00 -2139062144 0 1 #xa200b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3585 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumb-wide-b + :id 980 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3586 :flags (is-3d sp3 sp7)) + (sp-item 3587 :flags (is-3d sp3 sp7)) + (sp-item 3588 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3586 + :init-specs ((:texture (sign-wide-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 15)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200c00 -2139062144 0 1 #xa200c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3587 + :init-specs ((:texture (sign-wide-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 15)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200c00 -2139062144 0 1 #xa200c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3588 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumb-tall-a + :id 981 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3589 :flags (is-3d sp3 sp7)) + (sp-item 3590 :flags (is-3d sp3 sp7)) + (sp-item 3591 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3589 + :init-specs ((:texture (sign-tall-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200900 -2139062144 0 1 #xa200900 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3590 + :init-specs ((:texture (sign-tall-a ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200900 -2139062144 0 1 #xa200900 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3591 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumb-tall-b + :id 982 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3592 :flags (is-3d sp3 sp7)) + (sp-item 3593 :flags (is-3d sp3 sp7)) + (sp-item 3594 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3592 + :init-specs ((:texture (sign-tall-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters 0.1)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200a00 -2139062144 0 1 #xa200a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3593 + :init-specs ((:texture (sign-tall-b ctyslumb-sprite)) + (:num 1.0) + (:x (meters -0.05)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xa200a00 -2139062144 0 1 #xa200a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3594 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumb-steamescape + :id 983 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 3595 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3596 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3595 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 1.0) + (:x (meters -0.8) 4 (meters 0.4)) + (:y (meters -0.1) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3597) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3596 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -0.4) 1 (meters 0.4)) + (:y (meters 0) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 3597) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3597 + :init-specs ((:fade-a -0.064 -0.064)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumb-spray + :id 984 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3598 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3599 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 3598 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 2.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + ) + ) + +;; failed to figure out what this is: +(defpart 3600 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 3601)) + ) + +;; failed to figure out what this is: +(defpart 3601 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 3600)) + ) + +;; failed to figure out what this is: +(defpart 3599 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumb-spray-check-userdata-8 + :id 985 + :flags (sp4) + :bounds (static-bspherem 0 -8 0 24) + :parts ((sp-item 3602 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 3603 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; definition for function check-drop-level-ctyslumb-drop-userdata +;; INFO: Used lq/sq +(defun check-drop-level-ctyslumb-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (< (-> arg2 y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 3604) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 3602 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyslumb-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + ) + ) + +;; failed to figure out what this is: +(defpart 3603 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.1) (meters 0.013333334)) + (:fade-a -0.14222223 -0.42666668) + (:accel-y (meters -0.0033333334) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 32768.0) + (:func 'check-drop-level-ctyslumb-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + ) + ) + +;; failed to figure out what this is: +(defpart 3604 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 64.0 32.0) + (:omega (degrees 0.05625)) + (:vel-y (meters 0.01) (meters 0.026666667)) + (:fade-a -0.21333334) + (:accel-y (meters -0.001) (meters -0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 3600) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; definition for symbol *ctyslumb-water-texture-anim-array*, type texture-anim-array +(define *ctyslumb-water-texture-anim-array* + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func-id 'texture-anim-overide-size-init + :tex #f + :tex-name "ctyslumb-water-dest" + :extra (new 'static 'vector :x 128.0 :y 128.0 :z 4.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 2100.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + :data (new 'static 'array texture-anim-layer 6 + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 2100.0 + :tex-name "ctyslumb-water" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.33 0.33)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-st-rot (degrees 180) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.33 1.33)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-st-rot (degrees 180) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 2100.0 + :tex-name "ctyslumb-water" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.67 0.67)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-st-rot (degrees 90) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.67 1.67)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-st-rot (degrees 90) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 2100.0 + :tex-name "ctyslumb-water" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.0)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 1.0)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func-id 'texture-anim-overide-size-init + :tex #f + :tex-name "ctyslumb-fountain-fall-dest" + :extra (new 'static 'vector :x 128.0 :y 128.0 :z 1.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 600.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + :data (new 'static 'array texture-anim-layer 6 + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "ctyslumb-fountain-fall" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -0.3 0.0)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -1.3 -1.0)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "ctyslumb-fountain-fall" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.3 -0.5)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.3 -2.5)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "ctyslumb-fountain-fall" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -0.25)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -3.25)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-obs_REF.gc new file mode 100644 index 0000000000..e44a7cb3be --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-obs_REF.gc @@ -0,0 +1,317 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type cty-elevator +(deftype cty-elevator (elevator) + () + ) + +;; definition for method 3 of type cty-elevator +(defmethod inspect ((this cty-elevator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-elevator cty-elevator cty-elevator-lod0-jg cty-elevator-idle-ja + ((cty-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +;; definition for method 31 of type cty-elevator +(defmethod get-art-group ((this cty-elevator)) + (art-group-get-by-name *level* "skel-cty-elevator" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type cty-elevator +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this cty-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; definition for method 44 of type cty-elevator +(defmethod init-sound! ((this cty-elevator)) + (set! (-> this sound-running-loop) (static-sound-spec "hqlift-loop" :group 0)) + (set! (-> this sound-arrived) (static-sound-spec "hqlift-stop" :group 0)) + (set! (-> this sound-start) (static-sound-spec "hqlift-start" :group 0)) + (call-parent-method this) + (none) + ) + +;; definition for symbol *ctyslumc-water-texture-anim-array*, type texture-anim-array +(define *ctyslumc-water-texture-anim-array* + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func-id 'texture-anim-overide-size-init + :tex #f + :tex-name "ctyslumc-water-dest" + :extra (new 'static 'vector :x 128.0 :y 128.0 :z 4.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 2100.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + :data (new 'static 'array texture-anim-layer 6 + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 2100.0 + :tex-name "ctyslumc-water" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.33 0.33)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-st-rot (degrees 180) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.33 1.33)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-st-rot (degrees 180) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 2100.0 + :tex-name "ctyslumc-water" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.67 0.67)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-st-rot (degrees 90) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.67 1.67)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-st-rot (degrees 90) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 2100.0 + :tex-name "ctyslumc-water" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.0)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 1.0)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func-id 'texture-anim-overide-size-init + :tex #f + :tex-name "ctyslumc-fountain-fall-dest" + :extra (new 'static 'vector :x 128.0 :y 128.0 :z 1.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 600.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + :data (new 'static 'array texture-anim-layer 6 + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "ctyslumc-fountain-fall" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -0.3 0.0)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -1.3 -1.0)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "ctyslumc-fountain-fall" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.3 -0.5)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.3 -2.5)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "ctyslumc-fountain-fall" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -0.25)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -3.25)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + ) + ) + +;; definition of type ctyslumc-flag +(deftype ctyslumc-flag (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type ctyslumc-flag +(defmethod inspect ((this ctyslumc-flag)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctyslumc-flag ctyslumc-flag ctyslumc-flag-lod0-jg ctyslumc-flag-idle-ja + ((ctyslumc-flag-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -7 0 12) + ) + +;; failed to figure out what this is: +(defstate idle (ctyslumc-flag) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for method 11 of type ctyslumc-flag +(defmethod init-from-entity! ((this ctyslumc-flag) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyslumc-flag" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +;; definition for function ctyslumc-flag-init-by-other +;; INFO: Used lq/sq +(defbehavior ctyslumc-flag-init-by-other ctyslumc-flag ((arg0 vector) (arg1 entity-actor)) + (process-entity-set! self arg1) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyslumc-flag" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go-virtual idle) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-part_REF.gc b/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-part_REF.gc new file mode 100644 index 0000000000..516f6936fd --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-part_REF.gc @@ -0,0 +1,898 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumc-streetlight-glows + :id 986 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 6 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 7 :fade-after (meters 120) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 6 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 7 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumc-chimney + :id 987 + :bounds (static-bspherem 0 0 -10 24) + :parts ((sp-item 3605 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 3606 :fade-after (meters 200) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 3606 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 6144.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3605 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 3607) + ) + ) + +;; failed to figure out what this is: +(defpart 3607 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 3608)) + ) + +;; failed to figure out what this is: +(defpart 3608 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3609) + ) + ) + +;; failed to figure out what this is: +(defpart 3609 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 3610) + ) + ) + +;; failed to figure out what this is: +(defpart 3610 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyslumc-chimney-smoke + :id 988 + :bounds (static-bspherem 0 0 -12 24) + :parts ((sp-item 3611 :fade-after (meters 200) :falloff-to (meters 300))) + ) + +;; failed to figure out what this is: +(defpart 3611 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.4) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 3612) + ) + ) + +;; failed to figure out what this is: +(defpart 3612 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 3613) + ) + ) + +;; failed to figure out what this is: +(defpart 3613 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumc-big-a + :id 989 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 20) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3614 :flags (is-3d sp3 sp7)) + (sp-item 3615 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3614 + :init-specs ((:texture (sign-wide-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0)) + (:scale-x (meters 34)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 19)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00c00 -2139062144 0 1 #xaa00c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3615 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumc-big-b + :id 990 + :flags (sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 3616 :flags (is-3d sp7)) + (sp-item 3617 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3616 + :init-specs ((:texture (sign-wide-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:y (meters 0)) + (:z (meters -0.5)) + (:scale-x (meters 31.5)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 9.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00c00 -2139062144 0 1 #xaa00c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3617 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumc-square-a + :id 991 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3618 :flags (is-3d sp3 sp7)) + (sp-item 3619 :flags (is-3d sp3 sp7)) + (sp-item 3620 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3618 + :init-specs ((:texture (sign-square-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00100 -2139062144 0 1 #xaa00100 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3619 + :init-specs ((:texture (sign-square-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 180)) + (:rot-z (degrees 90)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00100 -2139062144 0 1 #xaa00100 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3620 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumc-square-b + :id 992 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3621 :flags (is-3d sp3 sp7)) + (sp-item 3622 :flags (is-3d sp3 sp7)) + (sp-item 3623 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3621 + :init-specs ((:texture (sign-square-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00300 -2139062144 0 1 #xaa00300 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3622 + :init-specs ((:texture (sign-square-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00300 -2139062144 0 1 #xaa00300 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3623 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumc-wide-a + :id 993 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3624 :flags (is-3d sp3 sp7)) + (sp-item 3625 :flags (is-3d sp3 sp7)) + (sp-item 3626 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3624 + :init-specs ((:texture (sign-wide-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 17)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00c00 -2139062144 0 1 #xaa00c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3625 + :init-specs ((:texture (sign-wide-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 17)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00c00 -2139062144 0 1 #xaa00c00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3626 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumc-wide-b + :id 994 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3627 :flags (is-3d sp3 sp7)) + (sp-item 3628 :flags (is-3d sp3 sp7)) + (sp-item 3629 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3627 + :init-specs ((:texture (sign-wide-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 15)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00d00 -2139062144 0 1 #xaa00d00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3628 + :init-specs ((:texture (sign-wide-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 15)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 7)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00d00 -2139062144 0 1 #xaa00d00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3629 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumc-tall-a + :id 995 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3630 :flags (is-3d sp3 sp7)) + (sp-item 3631 :flags (is-3d sp3 sp7)) + (sp-item 3632 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3630 + :init-specs ((:texture (sign-tall-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00a00 -2139062144 0 1 #xaa00a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3631 + :init-specs ((:texture (sign-tall-a ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00a00 -2139062144 0 1 #xaa00a00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3632 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sign-ctyslumc-tall-b + :id 996 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 10) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 3633 :flags (is-3d sp3 sp7)) + (sp-item 3634 :flags (is-3d sp3 sp7)) + (sp-item 3635 :fade-after (meters 200) :flags (sp6) :hour-mask #b11111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 3633 + :init-specs ((:texture (sign-tall-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters 0.1)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees -90)) + (:scale-y (meters 14)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00b00 -2139062144 0 1 #xaa00b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3634 + :init-specs ((:texture (sign-tall-b ctyslumc-sprite)) + (:num 1.0) + (:x (meters -0.05)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 14)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 0 0 #xaa00b00 -2139062144 0 1 #xaa00b00 -2143272896 #x404040 0) + ) + (:func 'sparticle-texture-day-night) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3635 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 32) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 8.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gunship-target-explode + :id 997 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 3636 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 3637 :flags (sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 3638 :flags (sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 3639 :flags (is-3d sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 3640 :period (seconds 30) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 3640 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 50.0) + (:y (meters 2)) + (:scale-x (meters 0.4) (meters 0.6)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 30.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.00083333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.008333334)) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 3636 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 10)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 200.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3637 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3638 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 32.0) + (:b 128.0) + (:a 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 3639 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc new file mode 100644 index 0000000000..f615a608ef --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc @@ -0,0 +1,1057 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-cty-sniper-battery-glow + :id 1463 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4829 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000)) + ) + +;; failed to figure out what this is: +(defpart 4829 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 160.0) + (:b 240.0) + (:a 40.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; definition of type cty-sniper-button-top +(deftype cty-sniper-button-top (process-drawable) + ((is-up symbol) + (colormode handle) + ) + (:state-methods + idle + going-up + going-down + ) + ) + +;; definition for method 3 of type cty-sniper-button-top +(defmethod inspect ((this cty-sniper-button-top)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tis-up: ~A~%" (-> this is-up)) + (format #t "~2Tcolormode: ~D~%" (-> this colormode)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-sniper-button-top cty-sniper-button-top cty-sniper-button-top-lod0-jg cty-sniper-button-top-idle-ja + ((cty-sniper-button-top-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; definition for function cty-sniper-button-top-handler +(defbehavior cty-sniper-button-top-handler cty-sniper-button-top ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('get-colormode) + (-> self colormode) + ) + (('up) + (set! (-> self colormode) (new 'static 'handle)) + (set! (-> self is-up) #t) + (go-virtual going-up) + ) + (('down) + (set! (-> self colormode) (new 'static 'handle :process #x2 :u64 #x2)) + (set! (-> self is-up) #f) + (go-virtual going-down) + ) + (('vulnerable) + (set! v0-0 1) + (set! (-> self colormode) (the-as handle v0-0)) + v0-0 + ) + (('invulnerable) + (set! v0-0 (if (-> self is-up) + 0 + 2 + ) + ) + (set! (-> self colormode) (the-as handle v0-0)) + v0-0 + ) + ) + ) + +;; definition for function cty-sniper-button-top-genpost +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defbehavior cty-sniper-button-top-genpost cty-sniper-button-top () + (let ((v1-0 (-> self colormode))) + (cond + ((= v1-0 1) + (let ((v1-2 (-> (new 'static 'vector :y 1.0 :w 1.0) quad))) + (set! (-> self draw color-emissive quad) v1-2) + ) + (let ((v1-4 (-> (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0) quad))) + (set! (-> self draw color-mult quad) v1-4) + ) + ) + ((zero? v1-0) + (let ((v1-6 (-> (new 'static 'vector :x 1.0 :w 1.0) quad))) + (set! (-> self draw color-emissive quad) v1-6) + ) + (let ((v1-8 (-> (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0) quad))) + (set! (-> self draw color-mult quad) v1-8) + ) + ) + ((= v1-0 2) + (let ((v1-11 (-> (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0) quad))) + (set! (-> self draw color-mult quad) v1-11) + ) + (let ((v1-16 (-> (if (< (mod (current-time) 150) 75) + (new 'static 'vector :x 0.8 :w 1.0) + (new 'static 'vector :y 0.8 :w 1.0) + ) + quad + ) + ) + ) + (set! (-> self draw color-emissive quad) v1-16) + ) + ) + ) + ) + (ja-post) + ) + +;; failed to figure out what this is: +(defstate idle (cty-sniper-button-top) + :virtual #t + :event cty-sniper-button-top-handler + :code sleep-code + :post cty-sniper-button-top-genpost + ) + +;; failed to figure out what this is: +(defstate going-up (cty-sniper-button-top) + :virtual #t + :event cty-sniper-button-top-handler + :code (behavior () + (ja-no-eval :group! cty-sniper-button-top-popup-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (go-virtual idle) + ) + :post cty-sniper-button-top-genpost + ) + +;; failed to figure out what this is: +(defstate going-down (cty-sniper-button-top) + :virtual #t + :event cty-sniper-button-top-handler + :code (behavior () + (ja-no-eval :group! cty-sniper-button-top-pushdown-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (go-virtual idle) + ) + :post cty-sniper-button-top-genpost + ) + +;; definition for method 11 of type cty-sniper-button-top +(defmethod init-from-entity! ((this cty-sniper-button-top) (arg0 entity-actor)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cty-sniper-button-top" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> this is-up) #t) + (go (method-of-object this idle)) + ) + +;; definition for function cty-sniper-button-top-init-by-other +;; INFO: Used lq/sq +(defbehavior cty-sniper-button-top-init-by-other cty-sniper-button-top ((arg0 vector) (arg1 quaternion)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cty-sniper-button-top" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> self colormode) (new 'static 'handle)) + (go-virtual idle) + ) + +;; definition of type cty-sniper-button +(deftype cty-sniper-button (process-drawable) + ((stay-down-time time-frame) + (lid handle) + ) + (:state-methods + idle-up + going-down + idle-down + bail-up + moribund + ) + (:methods + (cty-sniper-button-method-25 (_type_) object) + ) + ) + +;; definition for method 3 of type cty-sniper-button +(defmethod inspect ((this cty-sniper-button)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tstay-down-time: ~D~%" (-> this stay-down-time)) + (format #t "~2Tlid: ~D~%" (-> this lid)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-sniper-button cty-sniper-button cty-sniper-button-lod0-jg cty-sniper-button-idle-ja + ((cty-sniper-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; definition for method 12 of type cty-sniper-button +(defmethod run-logic? ((this cty-sniper-button)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; failed to figure out what this is: +(defstate idle-up (cty-sniper-button) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (logtest? (-> (the-as attack-info (-> block param 1)) penetrate-using) (penetrate flop)) + (go-virtual going-down) + #f + ) + ) + (('die) + (go-virtual moribund) + ) + (('vulnerable) + (send-event (handle->process (-> self lid)) 'vulnerable) + ) + (('invulnerable) + (send-event (handle->process (-> self lid)) 'invulnerable) + ) + ) + ) + :enter (behavior () + '() + ) + :exit (behavior () + '() + ) + :trans (behavior () + '() + ) + :code transform-and-sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate going-down (cty-sniper-button) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual moribund) + ) + (('vulnerable) + (send-event (handle->process (-> self lid)) 'vulnerable) + ) + (('invulnerable) + (send-event (handle->process (-> self lid)) 'invulnerable) + (go-virtual bail-up) + ) + ) + ) + :enter (behavior () + '() + ) + :code (behavior () + (sound-play "activate-button") + (send-event (handle->process (-> self lid)) 'down 0.25) + (ja-no-eval :group! cty-sniper-button-pushdown-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (go-virtual idle-down) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate idle-down (cty-sniper-button) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual moribund) + ) + (('vulnerable) + (send-event (handle->process (-> self lid)) 'vulnerable) + ) + (('invulnerable) + (send-event (handle->process (-> self lid)) 'invulnerable) + (go-virtual bail-up) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (ja-channel-set! 1) + (ja :group! cty-sniper-button-pushdown-ja :num! (identity (the float (ja-num-frames 0)))) + (ja-post) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (-> self stay-down-time)) + (suspend) + ) + ) + (send-event (handle->process (-> self lid)) 'up #x3e800000) + (ja-no-eval :group! cty-sniper-button-popup-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (go-virtual idle-up) + (sleep-code) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate bail-up (cty-sniper-button) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual moribund) + ) + (('vulnerable) + (send-event (handle->process (-> self lid)) 'vulnerable) + ) + (('invulnerable) + (send-event (handle->process (-> self lid)) 'invulnerable) + ) + ) + ) + :enter (behavior () + '() + ) + :code (behavior () + (send-event (handle->process (-> self lid)) 'up #x3e800000) + (ja-no-eval :group! cty-sniper-button-popup-ja :num! (seek! max 0.25) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.25)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (go-virtual idle-up) + (sleep-code) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate moribund (cty-sniper-button) + :virtual #t + :code sleep-code + :post (behavior () + (let ((a0-0 (new 'stack-no-clear 'vector))) + (vector+! a0-0 (-> self draw origin) (-> self draw bounds)) + (set! (-> a0-0 w) (-> self draw bounds w)) + (when (not (sphere-in-view-frustum? (the-as sphere a0-0))) + (cleanup-for-death self) + (go empty-state) + ) + ) + (ja-post) + ) + ) + +;; definition for method 25 of type cty-sniper-button +(defmethod cty-sniper-button-method-25 ((this cty-sniper-button)) + (and (-> this next-state) (let ((v1-2 (-> this next-state name))) + (or (= v1-2 'going-down) (= v1-2 'idle-down)) + ) + ) + ) + +;; definition for method 11 of type cty-sniper-button +(defmethod init-from-entity! ((this cty-sniper-button) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-button" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this stay-down-time) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'button-down-time :default 1.0)))) + ) + (set! (-> this lid) (process->handle (ppointer->process (process-spawn + cty-sniper-button-top + (-> this root trans) + (-> this root quat) + :name "cty-sniper-button-top" + :to this + ) + ) + ) + ) + (set! (-> this root pause-adjust-distance) 409600.0) + (if #f + (go (method-of-object this idle-down)) + (go (method-of-object this idle-up)) + ) + ) + +;; definition for method 10 of type cty-sniper-button +(defmethod deactivate ((this cty-sniper-button)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (while (-> this child) + (deactivate (ppointer->process (-> this child))) + ) + ((method-of-type process-focusable deactivate) (the-as process-focusable this)) + (none) + ) + +;; definition of type cty-sniper-battery +(deftype cty-sniper-battery (process-focusable) + ((incoming-attack-id uint32) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (known-vulnerable-this-frame symbol) + (during-movement-sound sound-id) + (run-once symbol) + (halted symbol) + ) + (:state-methods + idle + vulnerable + die + explode + ) + (:methods + (cty-sniper-battery-method-32 (_type_) symbol) + ) + ) + +;; definition for method 3 of type cty-sniper-battery +(defmethod inspect ((this cty-sniper-battery)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tknown-vulnerable-this-frame: ~A~%" (-> this known-vulnerable-this-frame)) + (format #t "~2Tduring-movement-sound: ~D~%" (-> this during-movement-sound)) + (format #t "~2Trun-once: ~A~%" (-> this run-once)) + (format #t "~2Thalted: ~A~%" (-> this halted)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-sniper-battery cty-sniper-core cty-sniper-core-lod0-jg cty-sniper-core-idle-ja + ((cty-sniper-core-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-sniper-battery-explode cty-sniper-core cty-sniper-core-explode-lod0-jg cty-sniper-core-explode-idle-ja + ((cty-sniper-core-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *cty-sniper-battery-exploder-params*, type joint-exploder-static-params +(define *cty-sniper-battery-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 4 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 3) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sniper-battery-explosion + :id 1464 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4830 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4831 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4832 :period (seconds 30) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 4830 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 10)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 220.0) + (:g 200.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4831 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 50.0) + (:y (meters 2)) + (:scale-x (meters 0.4) (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.16666667)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4832 + :init-specs ((:texture (specs level-default-sprite)) + (:num 10.0 10.0) + (:y (meters 2)) + (:scale-x (meters 2) (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.13333334)) + (:scalevel-x (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.512 -0.512) + (:accel-y (meters -0.0016666667)) + (:friction 0.75) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function cty-sniper-battery-handler +;; INFO: Used lq/sq +(defbehavior cty-sniper-battery-handler cty-sniper-battery ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('get-buttons-actor-group) + (&-> (-> self actor-group) 0) + ) + (('move-trans) + (let ((v0-0 (the-as object (-> self root trans)))) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + ) + (('attack) + (cond + ((zero? (-> self actor-group-count)) + (let ((a1-7 (the-as object (-> arg3 param 1)))) + (when (!= (-> (the-as attack-info a1-7) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-7) id)) + (let ((f30-0 (-> (the-as attack-info a1-7) damage))) + (find-offending-process-focusable arg0 (the-as attack-info a1-7)) + (if (>= f30-0 2.0) + (go-virtual die) + ) + ) + ) + ) + ) + (else + (when (-> self known-vulnerable-this-frame) + (let ((a1-8 (the-as object (-> arg3 param 1)))) + (when (!= (-> (the-as attack-info a1-8) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-8) id)) + (let ((f30-1 (-> (the-as attack-info a1-8) damage))) + (find-offending-process-focusable arg0 (the-as attack-info a1-8)) + (if (>= f30-1 0.0) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + (('alive) + #t + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (cty-sniper-battery) + :virtual #t + :event cty-sniper-battery-handler + :trans (behavior () + (set! (-> self known-vulnerable-this-frame) (cty-sniper-battery-method-32 self)) + (if (ja-done? 0) + (sound-stop (-> self during-movement-sound)) + (sound-play "bigbutton-move" :id (-> self during-movement-sound) :position #f) + ) + (if (-> self known-vulnerable-this-frame) + (go-virtual vulnerable) + ) + ) + :code (behavior () + (cond + ((-> self run-once) + (ja-no-eval :group! cty-sniper-battery-explode-lod0-mg :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (set! (-> self run-once) #t) + ) + ) + (suspend) + (setup-masks (-> self draw) 0 2) + (sleep-code) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate vulnerable (cty-sniper-battery) + :virtual #t + :event cty-sniper-battery-handler + :enter (behavior () + (dotimes (gp-0 (length (-> self actor-group 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) 'vulnerable) + (let ((t9-0 send-event-function) + (v1-5 (-> self actor-group 0 data gp-0 actor)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + ) + (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) 'battery-extend) + (let ((t9-2 send-event-function) + (v1-17 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-2 + (handle->process (if (-> v1-17 manager) + (-> v1-17 manager manager) + (the-as handle #f) + ) + ) + a1-1 + ) + ) + ) + ) + :exit (behavior () + (dotimes (gp-0 (length (-> self actor-group 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) 'invulnerable) + (let ((t9-0 send-event-function) + (v1-5 (-> self actor-group 0 data gp-0 actor)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + :trans (behavior () + (set! (-> self known-vulnerable-this-frame) (cty-sniper-battery-method-32 self)) + (if (ja-done? 0) + (sound-stop (-> self during-movement-sound)) + (sound-play "bigbutton-move" :id (-> self during-movement-sound) :position #f) + ) + (spawn-from-cspace (-> self part) (-> self node-list data 6)) + (when (not (-> self known-vulnerable-this-frame)) + (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) 'battery-retract) + (let ((t9-5 send-event-function) + (v1-14 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-5 + (handle->process (if (-> v1-14 manager) + (-> v1-14 manager manager) + (the-as handle #f) + ) + ) + a1-2 + ) + ) + ) + (go-virtual idle) + ) + ) + :code (behavior () + (setup-masks (-> self draw) 2 0) + (ja-no-eval :group! cty-sniper-battery-explode-lod0-jg :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (suspend) + (sleep-code) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate die (cty-sniper-battery) + :virtual #t + :event cty-sniper-battery-handler + :trans (behavior () + (spawn-from-cspace (-> self part) (-> self node-list data 6)) + ) + :code (behavior () + (sound-stop (-> self during-movement-sound)) + (when (> (-> self actor-group-count) 0) + (dotimes (gp-0 (length (-> self actor-group 0))) + (let ((v1-5 (-> self actor-group 0 data gp-0 actor))) + (send-event + (if v1-5 + (-> v1-5 extra process) + ) + 'die + ) + ) + ) + ) + (suspend) + (go-virtual explode) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate explode (cty-sniper-battery) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('alive) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + #f + #t + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (sound-play "destroy-battery") + (cond + ((logtest? (-> *part-group-id-table* 1464 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1464)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1464)) + ) + ) + (let ((v1-35 (-> self root root-prim))) + (set! (-> v1-35 prim-core collide-as) (collide-spec)) + (set! (-> v1-35 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self root root-prim local-sphere w) 491520.0) + (let ((gp-3 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set-vector! (-> gp-3 fountain-rand-transv-lo) -40960.0 40960.0 -40960.0 1.0) + (set-vector! (-> gp-3 fountain-rand-transv-hi) 40960.0 122880.0 40960.0 1.0) + (let ((v1-47 (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cty-sniper-battery-explode" (the-as (pointer level) #f)) + 7 + gp-3 + *cty-sniper-battery-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + ) + (set! (-> (the-as process-drawable (-> v1-47 0)) root pause-adjust-distance) 409600.0) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +;; definition for method 32 of type cty-sniper-battery +(defmethod cty-sniper-battery-method-32 ((this cty-sniper-battery)) + (local-vars (s5-0 symbol)) + (cond + ((< (-> this actor-group-count) 1) + (set! s5-0 #t) + ) + (else + (set! s5-0 #t) + (dotimes (s4-0 (length (-> this actor-group 0))) + (let ((a0-2 (-> this actor-group 0 data s4-0 actor))) + (if (and a0-2 (not (logtest? (-> a0-2 extra perm status) (entity-perm-status subtask-complete)))) + (set! s5-0 #f) + ) + ) + ) + ) + ) + s5-0 + ) + +;; definition for method 11 of type cty-sniper-battery +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this cty-sniper-battery) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 7) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 24576.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-17 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-battery" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-25 (res-lump-data arg0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-25 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-25)) + ) + (else + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this during-movement-sound) (new-sound-id)) + (set! (-> this run-once) #f) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data 4)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 4)) frames num-frames) -1)) + ) + ) + (set! (-> this halted) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1463) this)) + (logior! (-> this mask) (process-mask enemy)) + (go (method-of-object this idle)) + ) + +;; definition for function cty-sniper-battery-init-by-other +;; INFO: Used lq/sq +(defbehavior cty-sniper-battery-init-by-other cty-sniper-battery ((arg0 vector) (arg1 quaternion)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-battery" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self during-movement-sound) (new-sound-id)) + (go-virtual idle) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc new file mode 100644 index 0000000000..e1d5641d2f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc @@ -0,0 +1,3657 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *cty-sniper-fight-kg-squad-member-settings*, type (inline-array kg-squad-member-settings) +(define *cty-sniper-fight-kg-squad-member-settings* (new 'static 'inline-array kg-squad-member-settings 4 + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-a) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type roboguard) + :max-target-count #x7f + :enemy-type (traffic-type guard-b) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type flying-turret) + :max-target-count #x7f + :enemy-type (traffic-type metalhead-grunt) + ) + (new 'static 'kg-squad-member-settings + :object-type (traffic-type spydroid) + :max-target-count #x7f + :target-count 7 + :enemy-type (traffic-type metalhead-flitter) + ) + ) + ) + +;; definition of type task-manager-city-sniper-fight +(deftype task-manager-city-sniper-fight (task-manager) + ((sniper-turrets-marker-entity entity-actor) + (check-timer time-frame) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (cur-group int8) + (win-time time-frame) + (music-started symbol) + (torn-said-turret-rising symbol) + (torn-said-dodge symbol) + (torn-said-battery-retract symbol) + (torn-speech-one-down symbol) + (dax-said-bop-the-core symbol) + (last-torn-speech-time time-frame) + (battery-retractions-since-last-kaboom int32) + (minimap connection-minimap) + ) + (:methods + (task-manager-city-sniper-fight-method-32 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-city-sniper-fight +(defmethod inspect ((this task-manager-city-sniper-fight)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tsniper-turrets-marker-entity: ~A~%" (-> this sniper-turrets-marker-entity)) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tcur-group: ~D~%" (-> this cur-group)) + (format #t "~2Twin-time: ~D~%" (-> this win-time)) + (format #t "~2Tmusic-started: ~A~%" (-> this music-started)) + (format #t "~2Ttorn-said-turret-rising: ~A~%" (-> this torn-said-turret-rising)) + (format #t "~2Ttorn-said-dodge: ~A~%" (-> this torn-said-dodge)) + (format #t "~2Ttorn-said-battery-retract: ~A~%" (-> this torn-said-battery-retract)) + (format #t "~2Ttorn-speech-one-down: ~A~%" (-> this torn-speech-one-down)) + (format #t "~2Tdax-said-bop-the-core: ~A~%" (-> this dax-said-bop-the-core)) + (format #t "~2Tlast-torn-speech-time: ~D~%" (-> this last-torn-speech-time)) + (format #t "~2Tbattery-retractions-since-last-kaboom: ~D~%" (-> this battery-retractions-since-last-kaboom)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate active (task-manager-city-sniper-fight) + :virtual #t + :code (behavior () + (local-vars (v1-4 object) (v1-20 symbol)) + (until #f + (when *debug-segment* + ) + (set! v1-4 + (and (-> self actor-group) + (begin + (dotimes (v1-5 (-> self actor-group 0 length)) + (when (not (logtest? (-> self actor-group 0 data v1-5 actor extra perm status) (entity-perm-status subtask-complete)) + ) + (if (-> self minimap) + (set! (-> self minimap position quad) (-> self actor-group 0 data v1-5 actor trans quad)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (the-as vector #f) 0)) + ) + (set! v1-4 #f) + (goto cfg-14) + ) + ) + #t + ) + ) + ) + (label cfg-14) + (when v1-4 + (talker-spawn-func (-> *talker-speech* 94) *entity-pool* (target-pos 0) (the-as region #f)) + (until v1-20 + (suspend) + (let ((v1-19 (-> self level bsp actors))) + (when (nonzero? v1-19) + (dotimes (a0-18 (-> v1-19 length)) + (let* ((a2-2 (-> v1-19 data a0-18 actor)) + (a1-7 (if a2-2 + (-> a2-2 extra process) + ) + ) + ) + (when a1-7 + (when (logtest? (-> (the-as process-drawable a1-7) draw status) (draw-control-status on-screen)) + (set! v1-20 #f) + (goto cfg-28) + ) + ) + ) + ) + ) + ) + (set! v1-20 #t) + (label cfg-28) + ) + (send-event self 'complete) + ) + (suspend) + ) + #f + ) + ) + +;; definition for method 30 of type task-manager-city-sniper-fight +;; WARN: disable def twice: 121. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 181. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 241. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 53. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod taskman-event-handler ((this task-manager-city-sniper-fight) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-2 object)) + (case arg2 + (('start-music) + (if (not (-> this music-started)) + (set-setting! 'music 'citysnpr 0.0 0) + ) + (set-setting! 'pilot #f 0.0 0) + (send-event *target* 'end-mode 'pilot) + ) + (('turret-awakens) + (when (and (< (+ (-> this last-torn-speech-time) (seconds 8)) (current-time)) + (not (-> this torn-said-turret-rising)) + ) + (set! (-> this torn-said-turret-rising) #t) + (let ((v1-16 (rand-vu-int-range 0 2))) + (cond + ((zero? v1-16) + (talker-spawn-func (-> *talker-speech* 143) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-16 1) + (talker-spawn-func (-> *talker-speech* 144) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-16 2) + (talker-spawn-func (-> *talker-speech* 145) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! v0-2 (current-time)) + (set! (-> this last-torn-speech-time) (the-as time-frame v0-2)) + v0-2 + ) + ) + (('battery-extend) + (when (and (not (-> this dax-said-bop-the-core)) (>= (-> this battery-retractions-since-last-kaboom) 2)) + (let ((v1-28 (rand-vu-int-range 0 1))) + (cond + ((zero? v1-28) + (talker-spawn-func (-> *talker-speech* 156) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-28 1) + (talker-spawn-func (-> *talker-speech* 157) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! v0-2 #t) + (set! (-> this dax-said-bop-the-core) (the-as symbol v0-2)) + v0-2 + ) + ) + (('battery-retract) + (+! (-> this battery-retractions-since-last-kaboom) 1) + (when (and (< (+ (-> this last-torn-speech-time) (seconds 8)) (current-time)) + (or (not (-> this torn-said-battery-retract)) (rand-vu-percent? 0.15)) + ) + (set! (-> this torn-said-battery-retract) #t) + (let ((v1-41 (rand-vu-int-range 0 1))) + (cond + ((zero? v1-41) + (talker-spawn-func (-> *talker-speech* 151) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-41 1) + (talker-spawn-func (-> *talker-speech* 152) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! v0-2 (current-time)) + (set! (-> this last-torn-speech-time) (the-as time-frame v0-2)) + v0-2 + ) + ) + (('turret-firing) + (when (and (< (+ (-> this last-torn-speech-time) (seconds 8)) (current-time)) + (or (not (-> this torn-said-dodge)) (rand-vu-percent? 0.05)) + ) + (set! (-> this torn-said-dodge) #t) + (talker-spawn-func (-> *talker-speech* 154) *entity-pool* (target-pos 0) (the-as region #f)) + (set! v0-2 (current-time)) + (set! (-> this last-torn-speech-time) (the-as time-frame v0-2)) + v0-2 + ) + ) + (('turret-killed) + (set! (-> this battery-retractions-since-last-kaboom) 0) + (when (not (-> this torn-speech-one-down)) + (set! (-> this torn-speech-one-down) #t) + (talker-spawn-func (-> *talker-speech* 147) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 26 of type task-manager-city-sniper-fight +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-city-sniper-fight)) + (local-vars (v1-10 object) (sv-16 res-tag)) + (when (not (-> this sniper-turrets-marker-entity)) + (let ((s5-0 (entity-by-name "cty-sniper-fight-turret-manager-1"))) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data s5-0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-3 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! v1-10 (and (-> this actor-group) (begin + (dotimes (v1-11 (-> this actor-group 0 length)) + (when (not (-> this actor-group 0 data v1-11)) + (set! v1-10 #f) + (goto cfg-16) + ) + ) + #t + ) + ) + ) + (label cfg-16) + (if v1-10 + (set! (-> this sniper-turrets-marker-entity) (the-as entity-actor s5-0)) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate wait (task-manager-city-sniper-fight) + :virtual #t + :code (behavior () + (while (or (not *target*) (not *spawn-actors*)) + (suspend) + ) + (set-time-limit self) + (while (and (= (status-of-level-and-borrows *level* 'hiphog #t) 'active) + (or (not (level-get-target-inside *level*)) (!= (-> (level-get-target-inside *level*) name) 'ctyport)) + ) + (suspend) + ) + (set-setting! 'airlock #f 0.0 0) + (go-virtual active) + ) + ) + +;; definition for method 21 of type task-manager-city-sniper-fight +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-city-sniper-fight)) + (set! (-> this sniper-turrets-marker-entity) #f) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'city-sound '(ctysnip1) 0.0 2) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 15) (the-as int #f) (the-as vector #f) 0)) + (set! (-> this music-started) #f) + (set-time! (-> this last-torn-speech-time)) + (set! (-> this torn-said-turret-rising) #f) + (set! (-> this torn-said-dodge) #f) + (set! (-> this torn-speech-one-down) #f) + (set! (-> this torn-said-battery-retract) #f) + (set! (-> this dax-said-bop-the-core) #f) + (set! (-> this battery-retractions-since-last-kaboom) 0) + (set-setting! 'kg-enemy-settings #f 0.0 *cty-sniper-fight-kg-squad-member-settings*) + (none) + ) + +;; definition for method 25 of type task-manager-city-sniper-fight +(defmethod task-manager-method-25 ((this task-manager-city-sniper-fight)) + '() + ((method-of-type task-manager task-manager-method-25) this) + (none) + ) + +;; definition of type hud-cty-sniper-fight +(deftype hud-cty-sniper-fight (hud) + ((buttons (pointer actor-group)) + (num-buttons int8) + ) + (:methods + (draw-hud-buttons (_type_ (pointer actor-group)) symbol) + ) + ) + +;; definition for method 3 of type hud-cty-sniper-fight +(defmethod inspect ((this hud-cty-sniper-fight)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (format #t "~2Tbuttons: #x~X~%" (-> this buttons)) + (format #t "~2Tnum-buttons: ~D~%" (-> this num-buttons)) + (label cfg-4) + this + ) + +;; definition for method 27 of type hud-cty-sniper-fight +(defmethod draw-hud-buttons ((this hud-cty-sniper-fight) (arg0 (pointer actor-group))) + (let ((s5-0 (length (-> arg0 0)))) + (set! (-> this num-buttons) s5-0) + (set! (-> this buttons) arg0) + (dotimes (s4-1 s5-0) + (set! (-> this sprites s4-1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xc0f))) + ) + (set! (-> this sprites s4-1 scale-x) 1.0) + (set! (-> this sprites s4-1 scale-y) 1.0) + (set! (-> this sprites s4-1 flags) (hud-sprite-flags hsf3 hsf4)) + ) + ) + #f + ) + +;; definition for method 15 of type hud-cty-sniper-fight +(defmethod draw ((this hud-cty-sniper-fight)) + (with-pp + (if (odd? (-> this num-buttons)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (- 256 (* 48 (/ (+ (-> this num-buttons) -1) 2))) + (- 32 (the int (* 48.0 (-> this offset)))) + ) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (- 232 (* 48 (+ (/ (-> this num-buttons) 2) -1))) + (- 32 (the int (* 48.0 (-> this offset)))) + ) + ) + (let ((s5-0 1)) + (while (< s5-0 (-> this num-buttons)) + (set-as-offset-from! (-> this sprites s5-0) (the-as vector4w (-> this sprites)) (* 48 s5-0) 0) + (+! s5-0 1) + ) + ) + (let ((s2-0 0) + (s4-0 0) + (s5-1 0) + (s3-0 (mod (current-time) 150)) + ) + (dotimes (s1-0 (-> this num-buttons)) + (let* ((a0-8 (-> this buttons 0 data s1-0 actor)) + (v1-15 (if a0-8 + (-> a0-8 extra process) + ) + ) + ) + (when v1-15 + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer pp)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'get-colormode) + (case (send-event-function (handle->process (-> (the-as cty-sniper-button-top v1-15) colormode)) a1-7) + ((1) + (+! s2-0 1) + ) + ((2) + (+! s4-0 1) + ) + (else + (+! s5-1 1) + ) + ) + ) + ) + ) + ) + (let ((s1-1 0)) + (while (> s2-0 0) + (set! (-> this sprites s1-1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xc0f))) + ) + (+! s1-1 1) + (+! s2-0 -1) + ) + (while (> s4-0 0) + (set! (-> this sprites s1-1 tid) + (if (< s3-0 75) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xc0f))) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xc0f))) + ) + ) + (+! s1-1 1) + (+! s4-0 -1) + ) + (while (> s5-1 0) + (set! (-> this sprites s1-1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xc0f))) + ) + (+! s1-1 1) + (+! s5-1 -1) + ) + ) + ) + ((method-of-type hud draw) this) + (none) + ) + ) + +;; definition for method 17 of type hud-cty-sniper-fight +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-callback ((this hud-cty-sniper-fight)) + (set! (-> this level) (level-get *level* 'lctysnpr)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-sniper-turret-explosion + :id 1465 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4834 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4835 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4836 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4837 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4838 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4839 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4840 :period (seconds 30) :length (seconds 0.167)) + (sp-item 4841 :period (seconds 30) :length (seconds 0.5)) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4842 :flags (sp3) :binding 4833) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 4833 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 4834 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 60.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4835 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0 20.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4836 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0 20.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4837 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4838 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-sniper-turret-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-sniper-turret-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4838 init-specs 14 initial-valuef) + (the-as float *part-sniper-turret-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* color-start) *range-ftexplo-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* alpha-start) *range-ftexplo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* scale-x-start) *range-ftexplo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* scale-y-start) *range-ftexplo-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* a-scalar) *curve-ftexplo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* scale-x-scalar) *curve-ftexplo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-dust-in-curve-settings* scale-y-scalar) *curve-ftexplo-dust-scale-y*) + +;; failed to figure out what this is: +(defpart 4840 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4841 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-sniper-turret-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-sniper-turret-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4841 init-specs 16 initial-valuef) + (the-as float *part-sniper-turret-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* color-start) *range-ftexplo-color*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* alpha-start) *range-ftexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* scale-x-start) *range-ftexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* scale-y-start) *range-ftexplo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* a-scalar) *curve-ftexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* scale-x-scalar) *curve-ftexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-sniper-turret-explosion-texture-curve-settings* scale-y-scalar) *curve-ftexplo-scale-y*) + +;; failed to figure out what this is: +(defpart 4839 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4842 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.02) (meters -0.02)) + (:rotvel-z (degrees -300) (degrees 600)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.001)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 70)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4833 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 100.0) + (:a 128.0) + (:fade-r -1.7) + (:fade-g -1.3333334) + (:fade-b -1.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defpart 4843 + :init-specs ((:texture (common-white common)) + (:num 10.0 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 4844 + :init-specs ((:texture (gun-blue-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 16)) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 4845 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.15) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 4846 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 4847 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0 10.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b 1.6) + (:fade-a -0.375) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4848 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 2)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 255.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 4849 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.10666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-cty-sniper-turret-shot-hit-object + :id 1466 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4850 :flags (sp3)) (sp-item 4851 :flags (sp7) :period (seconds 4) :length (seconds 0.1))) + ) + +;; failed to figure out what this is: +(defpart 4850 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.21333334) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4851 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.15)) + (:r 0.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 128.0 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.33333334) (meters 0.16666667)) + (:fade-b -0.21333334 -0.21333334) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.8 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-x (degrees -45)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-cty-sniper-turret-shot-hit + :id 1467 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4852 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4852 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1.5) (meters 0.66)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 30.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters -0.033333335)) + (:scalevel-x (meters 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -4.25) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-cty-sniper-turret-shot-die + :id 1468 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +;; definition of type cty-sniper-turret-shot +(deftype cty-sniper-turret-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + +;; definition for method 3 of type cty-sniper-turret-shot +(defmethod inspect ((this cty-sniper-turret-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (label cfg-4) + this + ) + +;; definition for method 37 of type cty-sniper-turret-shot +(defmethod deal-damage! ((this cty-sniper-turret-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +;; definition for method 24 of type cty-sniper-turret-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this cty-sniper-turret-shot)) + (draw-beam (-> *part-id-table* 4848) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 4849)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +;; definition for method 25 of type cty-sniper-turret-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this cty-sniper-turret-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 4844 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 4844 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 4844) a1-0 s5-1 #f) + (set! (-> *part-id-table* 4844 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 4845) s4-0) + (launch-particles (-> *part-id-table* 4846) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f28-1 (* 0.000015258789 f30-0)) + (f30-1 (-> *part-id-table* 4847 init-specs 3 initial-valuef)) + ) + (-> *part-id-table* 4847 init-specs 4 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) (* f28-1 f30-1)) + (launch-particles (-> *part-id-table* 4847) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) f30-1) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type cty-sniper-turret-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this cty-sniper-turret-shot)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 1466 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1466) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1466) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 1467 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1467) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1467) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type cty-sniper-turret-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this cty-sniper-turret-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "tank-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate impact (cty-sniper-turret-shot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type projectile impact) enter))) + (if t9-0 + (t9-0) + ) + ) + (when *traffic-manager* + (let ((v1-5 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-5 sphere quad) (-> self root trans quad)) + (set! (-> v1-5 sphere r) 40960.0) + (set! (-> v1-5 velocity quad) (-> self root transv quad)) + (set! (-> v1-5 notify-radius) 122880.0) + (set! (-> v1-5 danger-level) 1.0) + (set! (-> v1-5 decay-rate) 0.0) + (set! (-> v1-5 flags) (the-as uint 1)) + (set! (-> v1-5 danger-type) (the-as uint 0)) + (set! (-> v1-5 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere v1-5) + ) + ) + ) + ) + +;; definition for function cty-sniper-turret-shot-move +;; WARN: Return type mismatch int vs none. +(defun cty-sniper-turret-shot-move ((arg0 cty-sniper-turret-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 65536.0 f0-0) + (vector-normalize! s4-0 65536.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for method 38 of type cty-sniper-turret-shot +(defmethod made-impact? ((this cty-sniper-turret-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +;; definition for method 30 of type cty-sniper-turret-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this cty-sniper-turret-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (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 projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (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 projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot crate hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type cty-sniper-turret-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this cty-sniper-turret-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'fac-robotank-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) cty-sniper-turret-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this damage) 2.0) + (set! (-> this vehicle-damage-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + 0 + (none) + ) + +;; definition for function spawn-cty-sniper-turret-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer cty-sniper-turret-shot). +(defun spawn-cty-sniper-turret-projectile ((arg0 cty-sniper-turret) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as + (pointer cty-sniper-turret-shot) + (spawn-projectile cty-sniper-turret-shot gp-0 arg0 *default-dead-pool*) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 49) (new 'static 'lightning-spec + :name "lightning-trail-cty-sniper-turret-cty-sniper-turret" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 50) (new 'static 'lightning-spec + :name "lightning-fractal-cty-sniper-turret-cty-sniper-turret" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(defpart 4853 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 4854 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup part-cty-sniper-turret-lightning-glow + :id 1469 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4854 :fade-after (meters 100) :flags (sp6)) (sp-item 4853 :fade-after (meters 100) :flags (sp6))) + ) + +;; definition of type cty-sniper-turret +(deftype cty-sniper-turret (process-focusable) + ((los los-control :inline) + (reticle handle) + (tank-quat quaternion :inline) + (rotate-quat quaternion :inline) + (rotate-rate float) + (rotate-mult float) + (shot-range float) + (fov-mult float) + (offset vector :inline) + (sight-pos vector :inline) + (firing-sight-pos vector :inline) + (gun-timer time-frame) + (gun-elev-jmod joint-mod-rotate-world :inline) + (gun-elev-joint-index int32) + (gun-elev-desired-rotation quaternion :inline) + (gun-azimuth-jmod joint-mod-rotate-world :inline) + (gun-azimuth-joint-index int32) + (gun-azimuth-desired-rotation quaternion :inline) + (gun-elev float) + (gun-elev-cam float) + (gun-aims-from-joint int32) + (gun-spread float) + (gun-current-aim-location vector :inline) + (gun-elbow-jmod joint-mod-rotate-local :inline) + (gun-shoulder-jmod joint-mod-rotate-local :inline) + (pos-cam-offset vector :inline) + (flags cty-sniper-turret-flag) + (turn-sound-id sound-id) + (h-reticle-strip handle) + (minimap connection-minimap) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (hud-buttons handle) + ) + (:state-methods + waiting-for-batteries + asleep + (ready symbol) + fire + locked-on + die + explode + ) + (:methods + (cty-sniper-turret-method-35 (_type_) none) + (fire-shot (_type_) (pointer process)) + (cty-sniper-turret-method-37 (_type_ vector float) symbol) + (cty-sniper-turret-method-38 (_type_ vector quaternion vector float) object) + (cty-sniper-turret-method-39 (_type_) symbol) + (cty-sniper-turret-method-40 (_type_) symbol) + (cty-sniper-turret-method-41 (_type_) symbol) + ) + ) + +;; definition for method 3 of type cty-sniper-turret +(defmethod inspect ((this cty-sniper-turret)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Treticle: ~D~%" (-> this reticle)) + (format #t "~2Ttank-quat: #~%" (-> this tank-quat)) + (format #t "~2Trotate-quat: #~%" (-> this rotate-quat)) + (format #t "~2Trotate-rate: ~f~%" (-> this rotate-rate)) + (format #t "~2Trotate-mult: ~f~%" (-> this rotate-mult)) + (format #t "~2Tshot-range: ~f~%" (-> this shot-range)) + (format #t "~2Tfov-mult: ~f~%" (-> this fov-mult)) + (format #t "~2Toffset: #~%" (-> this offset)) + (format #t "~2Tsight-pos: #~%" (-> this sight-pos)) + (format #t "~2Tfiring-sight-pos: #~%" (-> this firing-sight-pos)) + (format #t "~2Tgun-timer: ~D~%" (-> this gun-timer)) + (format #t "~2Tgun-elev-jmod: #~%" (-> this gun-elev-jmod)) + (format #t "~2Tgun-elev-joint-index: ~D~%" (-> this gun-elev-joint-index)) + (format #t "~2Tgun-elev-desired-rotation: #~%" (-> this gun-elev-desired-rotation)) + (format #t "~2Tgun-azimuth-jmod: #~%" (-> this gun-azimuth-jmod)) + (format #t "~2Tgun-azimuth-joint-index: ~D~%" (-> this gun-azimuth-joint-index)) + (format #t "~2Tgun-azimuth-desired-rotation: #~%" (-> this gun-azimuth-desired-rotation)) + (format #t "~2Tgun-elev: ~f~%" (-> this gun-elev)) + (format #t "~2Tgun-elev-cam: ~f~%" (-> this gun-elev-cam)) + (format #t "~2Tgun-aims-from-joint: ~D~%" (-> this gun-aims-from-joint)) + (format #t "~2Tgun-spread: ~f~%" (-> this gun-spread)) + (format #t "~2Tgun-current-aim-location: #~%" (-> this gun-current-aim-location)) + (format #t "~2Tgun-elbow-jmod: #~%" (-> this gun-elbow-jmod)) + (format #t "~2Tgun-shoulder-jmod: #~%" (-> this gun-shoulder-jmod)) + (format #t "~2Tpos-cam-offset: #~%" (-> this pos-cam-offset)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tturn-sound-id: ~D~%" (-> this turn-sound-id)) + (format #t "~2Th-reticle-strip: ~D~%" (-> this h-reticle-strip)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Thud-buttons: ~D~%" (-> this hud-buttons)) + (label cfg-7) + this + ) + +;; definition of type simple-prim-turret-reticle +(deftype simple-prim-turret-reticle (simple-prim) + ((h-parent-turret handle) + ) + ) + +;; definition for method 3 of type simple-prim-turret-reticle +(defmethod inspect ((this simple-prim-turret-reticle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type simple-prim inspect))) + (t9-0 this) + ) + (format #t "~2Th-parent-turret: ~D~%" (-> this h-parent-turret)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate active (simple-prim-turret-reticle) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go empty-state) + ) + ) + ) + ) + +;; definition for method 22 of type simple-prim-turret-reticle +;; WARN: Return type mismatch int vs none. +(defmethod strip-setup ((this simple-prim-turret-reticle)) + (cond + ((logtest? (-> (the-as cty-sniper-turret (-> this h-parent-turret process 0)) flags) + (cty-sniper-turret-flag cst7) + ) + (set! (-> this strip num-verts) (the-as uint 4)) + (set! (-> this strip alpha) *simple-prim-additive*) + (set! (-> this strip data0) (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (set! (-> this strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip bucket) (bucket-id generic-sprite-1)) + (set! (-> this strip sink) (the-as uint 65)) + ) + (else + (set! (-> this strip num-verts) (the-as uint 0)) + 0 + ) + ) + (none) + ) + +;; definition for method 25 of type simple-prim-turret-reticle +;; WARN: Return type mismatch int vs rgba. +(defmethod get-color ((this simple-prim-turret-reticle)) + (the-as rgba #x20808070) + ) + +;; definition for method 23 of type simple-prim-turret-reticle +(defmethod get-alpha ((this simple-prim-turret-reticle)) + 32 + ) + +;; definition of type cty-sniper-turret-reticle +(deftype cty-sniper-turret-reticle (process) + ((ring-inner prim-strip) + (ring-middle prim-strip) + (ring-outer prim-strip) + (ring-inner-radius float) + (ring-middle-radius float) + (ring-outer-radius float) + (h-parent-turret handle) + (root collide-shape) + (wander-offset vector 2 :inline) + (wander-offset-reset-time time-frame) + (inner-ring-offset float) + (middle-ring-offset float) + (outer-ring-offset float) + (ring-scale-multiplier float) + (reticle-looping-sound sound-id) + (reticle-lockon-sound sound-id) + (current-color rgba) + (current-alpha uint8) + (lockon-start-time time-frame) + (flags cty-sniper-turret-reticle-flag) + ) + (:state-methods + idle + lock + ) + (:methods + (gen-prim-verts (_type_) none) + (init-strips (_type_) none) + (get-alpha (_type_) uint) + (cty-sniper-turret-reticle-method-19 (_type_) none) + (get-curr-color (_type_) rgba) + ) + ) + +;; definition for method 3 of type cty-sniper-turret-reticle +(defmethod inspect ((this cty-sniper-turret-reticle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tring-inner: ~A~%" (-> this ring-inner)) + (format #t "~2Tring-middle: ~A~%" (-> this ring-middle)) + (format #t "~2Tring-outer: ~A~%" (-> this ring-outer)) + (format #t "~2Tring-inner-radius: ~f~%" (-> this ring-inner-radius)) + (format #t "~2Tring-middle-radius: ~f~%" (-> this ring-middle-radius)) + (format #t "~2Tring-outer-radius: ~f~%" (-> this ring-outer-radius)) + (format #t "~2Th-parent-turret: ~D~%" (-> this h-parent-turret)) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Twander-offset[2] @ #x~X~%" (-> this wander-offset)) + (format #t "~2Twander-offset-reset-time: ~D~%" (-> this wander-offset-reset-time)) + (format #t "~2Tinner-ring-offset: ~f~%" (-> this inner-ring-offset)) + (format #t "~2Tmiddle-ring-offset: ~f~%" (-> this middle-ring-offset)) + (format #t "~2Touter-ring-offset: ~f~%" (-> this outer-ring-offset)) + (format #t "~2Tring-scale-multiplier: ~f~%" (-> this ring-scale-multiplier)) + (format #t "~2Treticle-looping-sound: ~D~%" (-> this reticle-looping-sound)) + (format #t "~2Treticle-lockon-sound: ~D~%" (-> this reticle-lockon-sound)) + (format #t "~2Tcurrent-color: ~D~%" (-> this current-color)) + (format #t "~2Tcurrent-alpha: ~D~%" (-> this current-alpha)) + (format #t "~2Tlockon-start-time: ~D~%" (-> this lockon-start-time)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (label cfg-4) + this + ) + +;; definition for method 19 of type cty-sniper-turret-reticle +;; WARN: Return type mismatch quaternion vs none. +(defmethod cty-sniper-turret-reticle-method-19 ((this cty-sniper-turret-reticle)) + (set! (-> this root) (the-as collide-shape (new 'process 'trsq))) + (quaternion-identity! (-> this root quat)) + (none) + ) + +;; definition for function cty-sniper-turret-reticle-init-by-other +;; INFO: Used lq/sq +(defbehavior cty-sniper-turret-reticle-init-by-other cty-sniper-turret-reticle ((arg0 vector) (arg1 vector) (arg2 texture-id)) + (cty-sniper-turret-reticle-method-19 self) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root scale quad) (-> arg1 quad)) + (matrix->quaternion (-> self root quat) (math-camera-matrix)) + (set! (-> self wander-offset 0 quad) (the-as uint128 0)) + (set! (-> self wander-offset 1 quad) (the-as uint128 0)) + (set! (-> self ring-inner) (new 'process 'prim-strip 4 arg2 (the-as string #f))) + (set! (-> self ring-middle) (new 'process 'prim-strip 4 arg2 (the-as string #f))) + (set! (-> self ring-outer) (new 'process 'prim-strip 4 arg2 (the-as string #f))) + (set! (-> self ring-scale-multiplier) 1.0) + (set! (-> self flags) (cty-sniper-turret-reticle-flag)) + (set! (-> self inner-ring-offset) 0.0) + (set! (-> self middle-ring-offset) 0.0) + (set! (-> self outer-ring-offset) 0.0) + (set! (-> self reticle-looping-sound) (new-sound-id)) + (set! (-> self reticle-lockon-sound) (new-sound-id)) + (go-virtual idle) + ) + +;; definition for method 17 of type cty-sniper-turret-reticle +;; WARN: Return type mismatch int vs none. +(defmethod init-strips ((this cty-sniper-turret-reticle)) + (set! (-> this ring-inner alpha) *simple-prim-additive*) + (set! (-> this ring-inner data0) (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (set! (-> this ring-inner adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this ring-inner bucket) (bucket-id generic-sprite-1)) + (set! (-> this ring-inner sink) (the-as uint 65)) + (set! (-> this ring-middle alpha) *simple-prim-additive*) + (set! (-> this ring-middle data0) (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (set! (-> this ring-middle adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this ring-middle bucket) (bucket-id generic-sprite-1)) + (set! (-> this ring-middle sink) (the-as uint 65)) + (set! (-> this ring-outer alpha) *simple-prim-additive*) + (set! (-> this ring-outer data0) (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (set! (-> this ring-outer adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this ring-outer bucket) (bucket-id generic-sprite-1)) + (set! (-> this ring-outer sink) (the-as uint 65)) + (none) + ) + +;; definition for method 20 of type cty-sniper-turret-reticle +(defmethod get-curr-color ((this cty-sniper-turret-reticle)) + (-> this current-color) + ) + +;; definition for method 18 of type cty-sniper-turret-reticle +(defmethod get-alpha ((this cty-sniper-turret-reticle)) + (-> this current-alpha) + ) + +;; definition for method 16 of type cty-sniper-turret-reticle +;; INFO: Used lq/sq +;; WARN: Return type mismatch rgba vs none. +(defmethod gen-prim-verts ((this cty-sniper-turret-reticle)) + (when (logtest? (-> this flags) (cty-sniper-turret-reticle-flag cstr0)) + (let ((gp-0 (new-stack-vector0))) + (let ((f30-0 + (- 1.0 + (* 0.0033333334 (the float (- (-> this wander-offset-reset-time) (-> *display* game-clock frame-counter)))) + ) + ) + ) + (set! (-> gp-0 x) (lerp-clamp (-> this wander-offset 0 x) (-> this wander-offset 1 x) f30-0)) + (set! (-> gp-0 y) (lerp-clamp (-> this wander-offset 0 y) (-> this wander-offset 1 y) f30-0)) + ) + (vector-orient-by-quat! gp-0 gp-0 (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let* ((s4-0 + (quaternion-rotate-local-z! (new 'stack-no-clear 'quaternion) (-> this root quat) (-> this inner-ring-offset)) + ) + (s0-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)) + (s1-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-0)) + (s4-1 (get-alpha this)) + (s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (get-curr-color this)) + ) + (vector-normalize! s0-0 (* 4096.0 (-> this ring-scale-multiplier))) + (vector-normalize! s1-0 (* 4096.0 (-> this ring-scale-multiplier))) + (let ((v1-14 (-> this ring-inner data))) + (vector+! s2-0 gp-0 s0-0) + (vector+! s2-0 s2-0 s1-0) + (set! (-> v1-14 0 pos quad) (-> s2-0 quad)) + (set! (-> v1-14 0 stq z) 0.0) + (set! (-> v1-14 0 stq x) 0.0) + (set! (-> v1-14 0 stq y) 0.0) + (set! (-> v1-14 0 col) s3-0) + (set! (-> v1-14 0 col a) s4-1) + (let ((v1-15 (-> v1-14 1))) + (vector+float*! s2-0 gp-0 s0-0 -1.0) + (vector+! s2-0 s2-0 s1-0) + (set! (-> v1-15 pos quad) (-> s2-0 quad)) + (set! (-> v1-15 stq z) 0.0) + (set! (-> v1-15 stq x) 1.0) + (set! (-> v1-15 stq y) 0.0) + (set! (-> v1-15 col) s3-0) + (set! (-> v1-15 col a) s4-1) + (let ((v1-16 (&+ v1-15 32))) + (vector+! s2-0 gp-0 s0-0) + (vector+float*! s2-0 s2-0 s1-0 -1.0) + (set! (-> v1-16 pos quad) (-> s2-0 quad)) + (set! (-> v1-16 stq z) 0.0) + (set! (-> v1-16 stq x) 0.0) + (set! (-> v1-16 stq y) 1.0) + (set! (-> v1-16 col) s3-0) + (set! (-> v1-16 col a) s4-1) + (let ((v1-17 (&+ v1-16 32))) + (vector+float*! s2-0 gp-0 s0-0 -1.0) + (vector+float*! s2-0 s2-0 s1-0 -1.0) + (set! (-> v1-17 pos quad) (-> s2-0 quad)) + (set! (-> v1-17 stq z) 0.0) + (set! (-> v1-17 stq x) 1.0) + (set! (-> v1-17 stq y) 1.0) + (set! (-> v1-17 col) s3-0) + (set! (-> v1-17 col a) s4-1) + ) + ) + ) + ) + ) + (let* ((s4-2 (quaternion-rotate-local-z! + (new 'stack-no-clear 'quaternion) + (-> this root quat) + (- (-> this middle-ring-offset)) + ) + ) + (s0-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-2)) + (s1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-2)) + (s4-3 (get-alpha this)) + (s2-1 (new 'stack-no-clear 'vector)) + (s3-1 (get-curr-color this)) + ) + (vector-normalize! s0-1 (* 6553.6 (-> this ring-scale-multiplier))) + (vector-normalize! s1-1 (* 6553.6 (-> this ring-scale-multiplier))) + (let ((v1-24 (-> this ring-middle data))) + (vector+! s2-1 gp-0 s0-1) + (vector+! s2-1 s2-1 s1-1) + (set! (-> v1-24 0 pos quad) (-> s2-1 quad)) + (set! (-> v1-24 0 stq z) 0.0) + (set! (-> v1-24 0 stq x) 0.0) + (set! (-> v1-24 0 stq y) 0.0) + (set! (-> v1-24 0 col) s3-1) + (set! (-> v1-24 0 col a) s4-3) + (let ((v1-25 (-> v1-24 1))) + (vector+float*! s2-1 gp-0 s0-1 -1.0) + (vector+! s2-1 s2-1 s1-1) + (set! (-> v1-25 pos quad) (-> s2-1 quad)) + (set! (-> v1-25 stq z) 0.0) + (set! (-> v1-25 stq x) 1.0) + (set! (-> v1-25 stq y) 0.0) + (set! (-> v1-25 col) s3-1) + (set! (-> v1-25 col a) s4-3) + (let ((v1-26 (&+ v1-25 32))) + (vector+! s2-1 gp-0 s0-1) + (vector+float*! s2-1 s2-1 s1-1 -1.0) + (set! (-> v1-26 pos quad) (-> s2-1 quad)) + (set! (-> v1-26 stq z) 0.0) + (set! (-> v1-26 stq x) 0.0) + (set! (-> v1-26 stq y) 1.0) + (set! (-> v1-26 col) s3-1) + (set! (-> v1-26 col a) s4-3) + (let ((v1-27 (&+ v1-26 32))) + (vector+float*! s2-1 gp-0 s0-1 -1.0) + (vector+float*! s2-1 s2-1 s1-1 -1.0) + (set! (-> v1-27 pos quad) (-> s2-1 quad)) + (set! (-> v1-27 stq z) 0.0) + (set! (-> v1-27 stq x) 1.0) + (set! (-> v1-27 stq y) 1.0) + (set! (-> v1-27 col) s3-1) + (set! (-> v1-27 col a) s4-3) + ) + ) + ) + ) + ) + (let* ((s4-4 + (quaternion-rotate-local-z! (new 'stack-no-clear 'quaternion) (-> this root quat) (-> this outer-ring-offset)) + ) + (s0-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) s4-4)) + (s1-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-4)) + (s4-5 (get-alpha this)) + (s2-2 (new 'stack-no-clear 'vector)) + (s3-2 (get-curr-color this)) + ) + (vector-normalize! s0-2 (* 9420.8 (-> this ring-scale-multiplier))) + (vector-normalize! s1-2 (* 9420.8 (-> this ring-scale-multiplier))) + (let ((v1-34 (-> this ring-outer data))) + (vector+! s2-2 gp-0 s0-2) + (vector+! s2-2 s2-2 s1-2) + (set! (-> v1-34 0 pos quad) (-> s2-2 quad)) + (set! (-> v1-34 0 stq z) 0.0) + (set! (-> v1-34 0 stq x) 0.0) + (set! (-> v1-34 0 stq y) 0.0) + (set! (-> v1-34 0 col) s3-2) + (set! (-> v1-34 0 col a) s4-5) + (let ((v1-35 (-> v1-34 1))) + (vector+float*! s2-2 gp-0 s0-2 -1.0) + (vector+! s2-2 s2-2 s1-2) + (set! (-> v1-35 pos quad) (-> s2-2 quad)) + (set! (-> v1-35 stq z) 0.0) + (set! (-> v1-35 stq x) 1.0) + (set! (-> v1-35 stq y) 0.0) + (set! (-> v1-35 col) s3-2) + (set! (-> v1-35 col a) s4-5) + (let ((v1-36 (&+ v1-35 32))) + (vector+! s2-2 gp-0 s0-2) + (vector+float*! s2-2 s2-2 s1-2 -1.0) + (set! (-> v1-36 pos quad) (-> s2-2 quad)) + (set! (-> v1-36 stq z) 0.0) + (set! (-> v1-36 stq x) 0.0) + (set! (-> v1-36 stq y) 1.0) + (set! (-> v1-36 col) s3-2) + (set! (-> v1-36 col a) s4-5) + (let ((v1-37 (&+ v1-36 32))) + (vector+float*! s2-2 gp-0 s0-2 -1.0) + (vector+float*! s2-2 s2-2 s1-2 -1.0) + (set! (-> v1-37 pos quad) (-> s2-2 quad)) + (set! (-> v1-37 stq z) 0.0) + (set! (-> v1-37 stq x) 1.0) + (set! (-> v1-37 stq y) 1.0) + (set! (-> v1-37 col) s3-2) + (set! (-> v1-37 col a) s4-5) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 7 of type simple-prim +(defmethod relocate ((this simple-prim) (offset int)) + (if (nonzero? (-> this strip)) + (&+! (-> this strip) offset) + ) + (call-parent-method this offset) + ) + +;; definition for function sloppy-lead-player-location +(defun sloppy-lead-player-location ((arg0 vector) (arg1 vector) (arg2 float)) + (let* ((s4-0 (get-trans *target* 0)) + (f30-1 (+ 0.49 (/ (vector-vector-distance s4-0 arg1) arg2))) + ) + (vector-! arg0 (vector+float*! (new 'stack-no-clear 'vector) s4-0 (get-transv *target*) f30-1) arg1) + ) + ) + +;; definition for function cty-sniper-turret-reticle-post +(defbehavior cty-sniper-turret-reticle-post cty-sniper-turret-reticle () + (if (logtest? (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (sound-play "reticle-steady" :id (-> self reticle-looping-sound)) + ) + (init-strips self) + (gen-prim-verts self) + (none) + ) + +;; definition for function cty-sniper-turret-reticle-handler +;; INFO: Used lq/sq +(defbehavior cty-sniper-turret-reticle-handler cty-sniper-turret-reticle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('update) + (-> arg3 param 0) + (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (matrix->quaternion (-> self root quat) (math-camera-matrix)) + ) + (('collide-dist) + #f + ) + (('on) + (logior! (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (set! (-> self ring-inner num-verts) (the-as uint 4)) + (set! (-> self ring-middle num-verts) (the-as uint 4)) + (let ((v0-1 (the-as object 4))) + (set! (-> self ring-outer num-verts) (the-as uint v0-1)) + v0-1 + ) + ) + (('off) + (logclear! (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (set! (-> self ring-inner num-verts) (the-as uint 0)) + (set! (-> self ring-middle num-verts) (the-as uint 0)) + (set! (-> self ring-outer num-verts) (the-as uint 0)) + (sound-stop (-> self reticle-looping-sound)) + (sound-stop (-> self reticle-lockon-sound)) + ) + (('lock) + (go-virtual lock) + ) + (('unlock) + (go-virtual idle) + ) + (('die) + (sound-stop (-> self reticle-looping-sound)) + (sound-stop (-> self reticle-lockon-sound)) + (go empty-state) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (cty-sniper-turret-reticle) + :virtual #t + :event cty-sniper-turret-reticle-handler + :enter (behavior () + (set! (-> self current-color) (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x10)) + (set! (-> self ring-scale-multiplier) 1.3) + (set! (-> self current-alpha) (the-as uint 16)) + (set! (-> self wander-offset 0 quad) (the-as uint128 0)) + (let ((gp-0 (-> self wander-offset 1))) + (let* ((f30-0 -16384.0) + (f28-0 32768.0) + (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-8 (the-as number (logior #x3f800000 v1-7))) + ) + (set! (-> gp-0 x) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-8))))) + ) + (let* ((f30-1 -16384.0) + (f28-1 32768.0) + (v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-14 (the-as number (logior #x3f800000 v1-13))) + ) + (set! (-> gp-0 y) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-14))))) + ) + (set! (-> gp-0 z) 0.0) + (set! (-> gp-0 w) 1.0) + ) + (set! (-> self wander-offset-reset-time) (+ (-> *display* game-clock frame-counter) (seconds 1))) + (sound-stop (-> self reticle-lockon-sound)) + ) + :trans (behavior () + (let ((v1-1 (current-time))) + (set! (-> self inner-ring-offset) (* 312.0762 (the float (mod v1-1 210)))) + (set! (-> self middle-ring-offset) (* 43.690666 (the float (mod v1-1 1500)))) + (set! (-> self outer-ring-offset) (* 70.46882 (the float (mod v1-1 930)))) + ) + (when (< (-> self wander-offset-reset-time) (-> *display* game-clock frame-counter)) + (set! (-> self wander-offset 0 quad) (-> self wander-offset 1 quad)) + (let ((gp-0 (-> self wander-offset 1))) + (let* ((f30-0 -16384.0) + (f28-0 32768.0) + (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-11 (the-as number (logior #x3f800000 v1-10))) + ) + (set! (-> gp-0 x) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-11))))) + ) + (let* ((f30-1 -16384.0) + (f28-1 32768.0) + (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-17 (the-as number (logior #x3f800000 v1-16))) + ) + (set! (-> gp-0 y) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-17))))) + ) + (set! (-> gp-0 z) 0.0) + (set! (-> gp-0 w) 1.0) + ) + (set! (-> self wander-offset-reset-time) (+ (-> *display* game-clock frame-counter) (seconds 1))) + ) + (if (logtest? (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (sound-play "turret-scan" :id (-> self reticle-lockon-sound)) + ) + ) + :code sleep-code + :post cty-sniper-turret-reticle-post + ) + +;; failed to figure out what this is: +(defstate lock (cty-sniper-turret-reticle) + :virtual #t + :event cty-sniper-turret-reticle-handler + :enter (behavior () + (set-time! (-> self lockon-start-time)) + (let ((gp-0 (new-stack-vector0))) + (let ((f30-0 + (- 1.0 + (* 0.0033333334 (the float (- (-> self wander-offset-reset-time) (-> *display* game-clock frame-counter)))) + ) + ) + ) + (set! (-> gp-0 x) (lerp-clamp (-> self wander-offset 0 x) (-> self wander-offset 1 x) f30-0)) + (set! (-> gp-0 y) (lerp-clamp (-> self wander-offset 0 y) (-> self wander-offset 1 y) f30-0)) + ) + (set! (-> self wander-offset 0 quad) (-> gp-0 quad)) + ) + (set-vector! (-> self wander-offset 1) 0.0 0.0 0.0 1.0) + (set! (-> self wander-offset-reset-time) (+ (-> *display* game-clock frame-counter) (seconds 1))) + ) + :trans (behavior () + 450 + (let ((v1-3 (- (current-time) (+ (-> self lockon-start-time) (seconds 1.5))))) + (cond + ((< v1-3 0) + (set! (-> self current-color) (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x18)) + ) + ((< v1-3 (seconds 0.49)) + (let ((f30-0 (* 0.006802721 (the float v1-3)))) + (set! (-> self current-color) (rgba-lerp + (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x18) + (new 'static 'rgba :r #x10 :g #x40 :b #xf0 :a #x80) + (the-as rgba f30-0) + ) + ) + (set! (-> self current-alpha) (the-as uint (the int (lerp 24.0 128.0 f30-0)))) + ) + ) + (else + (set! (-> self current-color) (new 'static 'rgba :r #x10 :g #x40 :b #xf0 :a #x80)) + (set! (-> self current-alpha) (the-as uint 128)) + ) + ) + ) + ) + :code (behavior () + (let ((f30-0 (-> self inner-ring-offset)) + (f28-0 (-> self middle-ring-offset)) + (f26-0 (-> self outer-ring-offset)) + (gp-0 450) + ) + (while (< (current-time) (+ gp-0 (-> self lockon-start-time))) + (let ((f24-0 (/ (the float (- (current-time) (-> self lockon-start-time))) (the float gp-0)))) + (set! (-> self inner-ring-offset) (lerp-clamp f30-0 0.0 (* 3.0 f24-0))) + (set! (-> self middle-ring-offset) (lerp-clamp f28-0 0.0 (* 2.0 f24-0))) + (set! (-> self outer-ring-offset) (lerp-clamp f26-0 0.0 f24-0)) + ) + (suspend) + ) + ) + (sound-stop (-> self reticle-lockon-sound)) + (let ((gp-1 (current-time)) + (f30-1 147.0) + ) + (while (< (the float (current-time)) (+ f30-1 (the float gp-1))) + (set! (-> self ring-scale-multiplier) + (lerp-clamp 1.3 0.5 (/ (- (the float (current-time)) (the float gp-1)) f30-1)) + ) + (if (logtest? (-> self flags) (cty-sniper-turret-reticle-flag cstr0)) + (sound-play "turret-lock" :id (-> self reticle-lockon-sound)) + ) + (suspend) + ) + ) + (sleep-code) + ) + :post cty-sniper-turret-reticle-post + ) + +;; definition for method 7 of type cty-sniper-turret-reticle +;; WARN: Return type mismatch process vs cty-sniper-turret-reticle. +(defmethod relocate ((this cty-sniper-turret-reticle) (offset int)) + (if (nonzero? (-> this ring-inner)) + (&+! (-> this ring-inner) offset) + ) + (if (nonzero? (-> this ring-middle)) + (&+! (-> this ring-middle) offset) + ) + (if (nonzero? (-> this ring-outer)) + (&+! (-> this ring-outer) offset) + ) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (the-as cty-sniper-turret-reticle ((method-of-type process relocate) this offset)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-sniper-turret cty-sniper-turret cty-sniper-turret-lod0-jg cty-sniper-turret-idle-ja + ((cty-sniper-turret-lod0-mg (meters 20)) (cty-sniper-turret-lod1-mg (meters 999999))) + :bounds (static-spherem 0 36864 0 36864) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-cty-sniper-turret-explode cty-sniper-turret cty-sniper-turret-explode-lod0-jg cty-sniper-turret-explode-idle-ja + ((cty-sniper-turret-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *cty-sniper-turret-exploder-params*, type joint-exploder-static-params +(define *cty-sniper-turret-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 4 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 28 :parent-joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index 3) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; failed to figure out what this is: +(defpart 4855 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 0.0) + (:b :copy g) + (:a 96.0 64.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; definition for function citysniper-draw-2d-hud +;; INFO: Used lq/sq +;; WARN: Return type mismatch pointer vs symbol. +;; ERROR: Failed load: (set! t0-6 (l.d (+ a0-28 8))) at op 170 +(defun citysniper-draw-2d-hud ((arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector4w 4)) + (gp-0 (new 'stack-no-clear 'vector4w)) + ) + (set! (-> arg0 w) 1.0) + (the-as + symbol + (when (transform-point-qword! (-> s5-0 0) arg0) + (set! (-> s5-0 1 quad) (-> s5-0 0 quad)) + (set! (-> s5-0 2 quad) (-> s5-0 0 quad)) + (set! (-> s5-0 3 quad) (-> s5-0 0 quad)) + (let ((v1-5 160)) + (set! (-> s5-0 0 x) (- (-> s5-0 0 x) v1-5)) + (set! (-> s5-0 0 y) (- (-> s5-0 0 y) v1-5)) + (+! (-> s5-0 1 x) v1-5) + (set! (-> s5-0 1 y) (- (-> s5-0 1 y) v1-5)) + (+! (-> s5-0 2 x) v1-5) + (+! (-> s5-0 2 y) v1-5) + (set! (-> s5-0 3 x) (- (-> s5-0 3 x) v1-5)) + (+! (-> s5-0 3 y) v1-5) + ) + (set! (-> gp-0 x) 0) + (set! (-> gp-0 y) 128) + (set! (-> gp-0 z) 128) + (set! (-> gp-0 w) 128) + (with-dma-buffer-add-bucket ((v1-15 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id debug-no-zbuf1) + ) + (let ((a1-1 (-> s5-0 0)) + (t3-0 (-> s5-0 1)) + (t2-0 (-> s5-0 2)) + (a3-0 (-> s5-0 3)) + (t0-0 (make-u128 0 (the-as uint #x4024c00000008001))) + (t1-0 #x4141) + ) + (+! (-> a1-1 z) -8192) + (+! (-> t3-0 z) -8192) + (+! (-> t2-0 z) -8192) + (+! (-> a3-0 z) -8192) + (let ((a0-28 (-> v1-15 base))) + (let* ((t4-0 v1-15) + (t5-0 (-> t4-0 base)) + ) + (set! (-> (the-as (pointer int64) t5-0)) #x10000000) + (s.w! (+ t5-0 8) 0) + (let ((t6-1 #x50000000)) + (s.w! (+ t5-0 12) t6-1) + ) + (set! (-> t4-0 base) (&+ t5-0 16)) + ) + (let* ((t4-1 v1-15) + (t5-2 (-> t4-1 base)) + ) + (set! (-> (the-as (pointer uint64) t5-2)) t0-0) + (s.d! (+ t5-2 8) t1-0) + (set! (-> t4-1 base) (&+ t5-2 16)) + ) + (let* ((t4-2 v1-15) + (t5-4 (-> t4-2 base)) + ) + (set! (-> (the-as (pointer uint128) t5-4)) (-> gp-0 quad)) + (let ((t6-3 (-> a1-1 quad))) + (s.q! (+ t5-4 16) t6-3) + ) + (let ((t6-4 (-> gp-0 quad))) + (s.q! (+ t5-4 32) t6-4) + ) + (let ((t6-5 (-> t3-0 quad))) + (s.q! (+ t5-4 48) t6-5) + ) + (set! (-> t4-2 base) (&+ t5-4 64)) + ) + (let* ((t4-3 v1-15) + (t5-6 (-> t4-3 base)) + ) + (set! (-> (the-as (pointer uint64) t5-6)) t0-0) + (s.d! (+ t5-6 8) t1-0) + (set! (-> t4-3 base) (&+ t5-6 16)) + ) + (let* ((t4-4 v1-15) + (t5-8 (-> t4-4 base)) + ) + (set! (-> (the-as (pointer uint128) t5-8)) (-> gp-0 quad)) + (let ((t3-1 (-> t3-0 quad))) + (s.q! (+ t5-8 16) t3-1) + ) + (let ((t3-2 (-> gp-0 quad))) + (s.q! (+ t5-8 32) t3-2) + ) + (let ((t3-3 (-> t2-0 quad))) + (s.q! (+ t5-8 48) t3-3) + ) + (set! (-> t4-4 base) (&+ t5-8 64)) + ) + (let* ((t3-5 v1-15) + (t4-5 (-> t3-5 base)) + ) + (set! (-> (the-as (pointer uint64) t4-5)) t0-0) + (s.d! (+ t4-5 8) t1-0) + (set! (-> t3-5 base) (&+ t4-5 16)) + ) + (let* ((t3-6 v1-15) + (t4-7 (-> t3-6 base)) + ) + (set! (-> (the-as (pointer uint128) t4-7)) (-> gp-0 quad)) + (let ((t2-1 (-> t2-0 quad))) + (s.q! (+ t4-7 16) t2-1) + ) + (let ((t2-2 (-> gp-0 quad))) + (s.q! (+ t4-7 32) t2-2) + ) + (let ((t2-3 (-> a3-0 quad))) + (s.q! (+ t4-7 48) t2-3) + ) + (set! (-> t3-6 base) (&+ t4-7 64)) + ) + (let* ((t2-5 v1-15) + (t3-7 (-> t2-5 base)) + ) + (set! (-> (the-as (pointer uint64) t3-7)) t0-0) + (s.d! (+ t3-7 8) t1-0) + (set! (-> t2-5 base) (&+ t3-7 16)) + ) + (let* ((t0-2 v1-15) + (t1-1 (-> t0-2 base)) + ) + (set! (-> (the-as (pointer uint128) t1-1)) (-> gp-0 quad)) + (let ((a3-1 (-> a3-0 quad))) + (s.q! (+ t1-1 16) a3-1) + ) + (let ((a3-2 (-> gp-0 quad))) + (s.q! (+ t1-1 32) a3-2) + ) + (let ((a1-2 (-> a1-1 quad))) + (s.q! (+ t1-1 48) a1-2) + ) + (set! (-> t0-2 base) (&+ t1-1 64)) + ) + (let ((a3-6 (/ (the-as int (+ (- -16 (the-as int a0-28)) (the-as int (-> v1-15 base)))) 16))) + (cond + ((nonzero? a3-6) + (logior! (-> (the-as (pointer uint64) a0-28)) (shr (shl a3-6 48) 48)) + (let ((a3-10 (logior (l.d (&+ a0-28 8)) (shl (shr (shl a3-6 48) 48) 32)))) + (s.d! (+ a0-28 8) a3-10) + ) + ) + (else + (set! (-> v1-15 base) a0-28) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 36 of type cty-sniper-turret +;; INFO: Used lq/sq +(defmethod fire-shot ((this cty-sniper-turret)) + (let* ((s5-0 (-> this node-list data (-> this gun-aims-from-joint))) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) s5-0)) + (s5-1 (-> s5-0 bone transform fvec)) + (v1-5 (rand-vu-sphere-point-uniform! (new 'stack-no-clear 'vector) (* 0.05 (rand-vu)))) + (s3-2 (vector+! (new 'stack-no-clear 'vector) s5-1 v1-5)) + (s5-2 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (vector-normalize! s3-2 512000.0) + (set! (-> s5-2 ent) (-> this entity)) + (set! (-> s5-2 charge) 1.0) + (set! (-> s5-2 options) (projectile-options)) + (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) + (set! (-> s5-2 pos quad) (-> s4-0 quad)) + (set! (-> s5-2 vel quad) (-> s3-2 quad)) + (set! (-> s5-2 notify-handle) (process->handle this)) + (set! (-> s5-2 owner-handle) (the-as handle #f)) + (set! (-> s5-2 target-handle) (the-as handle #f)) + (set! (-> s5-2 target-pos quad) (the-as uint128 0)) + (set! (-> s5-2 ignore-handle) (process->handle this)) + (let* ((v1-19 *game-info*) + (a0-17 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-17) + (set! (-> s5-2 attack-id) a0-17) + ) + (set! (-> s5-2 timeout) (seconds 4)) + (spawn-projectile cty-sniper-turret-shot s5-2 this *default-dead-pool*) + ) + ) + +;; definition for method 21 of type cty-sniper-turret +(defmethod get-trans ((this cty-sniper-turret) (arg0 int)) + "Get the `trans` for this process." + (case arg0 + ((2 3) + (let ((v1-2 (new 'static 'vector :w 1.0))) + (vector<-cspace! v1-2 (-> this node-list data (-> this gun-aims-from-joint))) + ) + ) + (else + (vector+! + (new 'static 'vector :w 1.0) + (the-as vector (-> this root root-prim prim-core)) + (-> this pos-cam-offset) + ) + ) + ) + ) + +;; definition for method 40 of type cty-sniper-turret +(defmethod cty-sniper-turret-method-40 ((this cty-sniper-turret)) + (and (should-check-los? (-> this los) 0) + (< (vector-vector-xz-distance (-> this root trans) (target-pos 0)) 163840.0) + (< -16384.0 (- (-> (target-pos 0) y) (-> this root trans y))) + ) + ) + +;; definition for method 41 of type cty-sniper-turret +(defmethod cty-sniper-turret-method-41 ((this cty-sniper-turret)) + (and (logtest? (-> this flags) (cty-sniper-turret-flag cst7)) + (or (los-control-method-11 (-> this los) 0) + (< 204800.0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) + (< (- (-> (target-pos 0) y) (-> this root trans y)) -24576.0) + ) + ) + ) + +;; definition for function sniper-turret-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior sniper-turret-post cty-sniper-turret () + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 *target*) + (a1-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (cond + ((and (logtest? (-> self flags) (cty-sniper-turret-flag cst0)) a1-1) + (if (logtest? (-> self flags) (cty-sniper-turret-flag cst9)) + (los-control-method-9 (-> self los) a1-1 (the-as vector #f) 819.2 4096.0) + ) + (when (or (logtest? (-> self flags) (cty-sniper-turret-flag cst12)) (cty-sniper-turret-method-41 self)) + (cond + ((logtest? (-> self flags) (cty-sniper-turret-flag cst12)) + (logclear! (-> self flags) (cty-sniper-turret-flag cst12)) + (remove-setting! 'pov-offset) + (send-event self 'pov-cam-off) + (send-event (handle->process (-> self reticle)) 'off) + '(go (ready)) + ) + (else + (remove-setting! 'interp-time) + (logior! (-> self flags) (cty-sniper-turret-flag cst12)) + ) + ) + ) + (when *target* + (let ((f30-0 (if *target* + (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + ) + ) + (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self gun-aims-from-joint)))) + ) + (let* ((v1-43 (sloppy-lead-player-location (new 'stack-no-clear 'vector) gp-1 512000.0)) + (s4-1 (vector+! (new 'stack-no-clear 'vector) v1-43 gp-1)) + ) + (set! s4-1 (cond + ((logtest? (-> self flags) (cty-sniper-turret-flag cst11)) + (empty) + s4-1 + ) + (else + (get-trans *target* 3) + ) + ) + ) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> self gun-current-aim-location))) + (f28-0 (vector-length s5-1)) + ) + (if *target* + (look-at! (-> *target* neck) gp-1 'attacking self) + ) + (if (< (* 98304.0 (seconds-per-frame)) f28-0) + (vector+! + (-> self gun-current-aim-location) + (-> self gun-current-aim-location) + (vector-normalize! s5-1 (* 98304.0 (seconds-per-frame))) + ) + (set! (-> self gun-current-aim-location quad) (-> s4-1 quad)) + ) + ) + ) + (let ((t9-13 quaternion-look-at!) + (a0-21 (-> self gun-elev-jmod rotation)) + (a1-14 (vector-! (new 'stack-no-clear 'vector) (-> self gun-current-aim-location) gp-1)) + ) + (let ((f0-4 1.0)) + (.lvf vf1 (&-> a1-14 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((v1-63 f0-4)) + (.mov vf3 v1-63) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a1-14 quad) vf1) + (t9-13 a0-21 a1-14 *up-vector*) + ) + ) + (when (logtest? (-> self flags) (cty-sniper-turret-flag cst7)) + (send-event (handle->process (-> self reticle)) 'update (-> self gun-current-aim-location)) + (let ((f0-6 (* 0.000018780049 (+ -20480.0 f30-0)))) + (set! (-> self pos-cam-offset y) (lerp-clamp 53248.0 106496.0 f0-6)) + ) + (set-setting! 'pov-offset 'abs (-> self pos-cam-offset) 0) + (let ((a1-20 (vector-xz-normalize-copy! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self gun-current-aim-location)) + 1.0 + ) + ) + ) + (quaternion-look-at! (-> self gun-azimuth-jmod rotation) a1-20 *up-vector*) + ) + (quaternion-copy! (-> self gun-shoulder-jmod rotation) (new 'static 'quaternion :x 0.5 :w 0.8660254)) + (quaternion-copy! (-> self gun-elbow-jmod rotation) (new 'static 'quaternion :x -0.5 :w 0.8660254)) + (set! (-> self fov-mult) (lerp-clamp 1.3 0.45 (* 0.0000048828124 f30-0))) + (set-setting! 'fov 'rel (-> self fov-mult) 0) + ) + ) + ) + ) + (else + (send-event (handle->process (-> self reticle)) 'off) + ) + ) + ) + (transform-post) + (none) + ) + ) + +;; definition for function cty-sniper-turret-handler +(defbehavior cty-sniper-turret-handler cty-sniper-turret ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('fire-suppress) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (cty-sniper-turret-flag cst4))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (cty-sniper-turret-flag cst4))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('set-spread) + (set! (-> self gun-spread) (the-as float (-> arg3 param 0))) + ) + (('use-los) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (cty-sniper-turret-flag cst9))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (cty-sniper-turret-flag cst9))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('limit-reticle-elev) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (cty-sniper-turret-flag cst10))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (cty-sniper-turret-flag cst10))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('pov-cam-on) + (sound-play "interface-open") + (remove-setting! 'entity-name) + (let ((v1-18 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + ) + (persist-with-delay *setting-control* 'rapid-tracking (seconds 0.5) 'rapid-tracking #f 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-pov-track 0.0 0) + (set-setting! 'allow-look-around #f 0.0 0) + (let ((v1-27 (process->ppointer self))) + (set-setting! 'pov-handle v1-27 3.0 (-> v1-27 0 pid)) + ) + (set-setting! 'pov-offset 'abs (-> self pos-cam-offset) 0) + (set-setting! 'scanlines 'abs 0.2 0) + (set-setting! 'matrix-blend-max-angle 'abs (degrees 360.0) 0) + (setup-masks (-> self draw) 0 1) + (let ((gp-1 (process-spawn hud-cty-sniper-fight :init hud-init-by-other :name "hud-cty-sniper-fight" :to self))) + (set! (-> self hud-buttons) (ppointer->handle gp-1)) + (send-event (handle->process (-> self hud-buttons)) 'enable) + (send-event (handle->process (-> self hud-buttons)) 'force-show) + (let ((a1-18 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-18 from) (process->ppointer self)) + (set! (-> a1-18 num-params) 0) + (set! (-> a1-18 message) 'get-buttons-actor-group) + (let* ((t9-17 send-event-function) + (v1-60 (-> self actor-group 0 data 0 actor)) + (a1-19 (the-as (pointer actor-group) (t9-17 + (if v1-60 + (-> v1-60 extra process) + ) + a1-18 + ) + ) + ) + ) + (if a1-19 + (draw-hud-buttons (the-as hud-cty-sniper-fight (-> gp-1 0)) a1-19) + ) + ) + ) + ) + (logior! (-> self flags) (cty-sniper-turret-flag cst7)) + (set! v0-0 (logclear (-> self flags) (cty-sniper-turret-flag cst12))) + (set! (-> self flags) (the-as cty-sniper-turret-flag v0-0)) + v0-0 + ) + (('pov-cam-off) + (let ((v1-71 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-71 prim-core collide-as) (collide-spec)) + (set! (-> v1-71 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "interface-close") + (let ((v1-76 (-> *camera* slave))) + (when (and (-> v1-76 0 next-state) (= (-> v1-76 0 next-state name) 'cam-pov-track)) + (set! (-> v1-76 0 blend-from-type) (camera-blend-from-type unknown-0)) + 0 + ) + ) + (remove-setting! 'interp-time) + (remove-setting! 'pov-handle) + (remove-setting! 'mode-name) + (remove-setting! 'allow-look-around) + (remove-setting! 'pov-offset) + (remove-setting! 'scanlines) + (remove-setting! 'matrix-blend-max-angle) + (setup-masks (-> self draw) 1 0) + (quaternion-identity! (-> self gun-azimuth-jmod rotation)) + (quaternion-identity! (-> self gun-shoulder-jmod rotation)) + (quaternion-identity! (-> self gun-elbow-jmod rotation)) + (send-event (handle->process (-> self hud-buttons)) 'hide-and-die) + (logclear! (-> *target* focus-status) (focus-status ignore)) + (logclear! (-> self flags) (cty-sniper-turret-flag cst7)) + (remove-setting! 'fov) + ) + (('get-rotate-quat) + (-> self rotate-quat) + ) + (('get-gun-elevation-cam) + (-> self gun-elev-cam) + ) + (('update) + (-> arg3 param 1) + (new 'stack-no-clear 'vector) + (let ((gp-3 (new 'stack-no-clear 'quaternion)) + (s5-3 (the-as cspace (-> arg3 param 2))) + ) + (vector<-cspace+vector! (-> self root trans) s5-3 (-> self offset)) + (matrix->quaternion gp-3 (-> s5-3 bone transform)) + ) + ) + (('die) + (go-virtual die) + ) + ) + ) + +;; definition for method 37 of type cty-sniper-turret +;; INFO: Used lq/sq +(defmethod cty-sniper-turret-method-37 ((this cty-sniper-turret) (arg0 vector) (arg1 float)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> s4-1 quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s3-0 s5-0) (cos arg1)) + ) + ) + +;; failed to figure out what this is: +(defstate waiting-for-batteries (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :enter (behavior () + '() + ) + :trans (behavior () + (dotimes (gp-0 (length (-> self actor-group 0))) + (let ((v1-2 (-> self actor-group 0 data gp-0)) + (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) 'alive) + (let ((t9-0 send-event-function) + (v1-3 (-> v1-2 actor)) + ) + (if (t9-0 + (if v1-3 + (-> v1-3 extra process) + ) + a1-0 + ) + (go-virtual asleep) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate asleep (cty-sniper-turret) + :virtual #t + :enter (behavior () + (send-event self 'pov-cam-off) + (send-event (handle->process (-> self reticle)) 'unlock) + ) + :exit (behavior () + (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) 'start-music) + (let ((t9-0 send-event-function) + (v1-4 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-0 + (handle->process (if (-> v1-4 manager) + (-> v1-4 manager manager) + (the-as handle #f) + ) + ) + a1-0 + ) + ) + ) + (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) 'turret-awakens) + (let ((t9-1 send-event-function) + (v1-14 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-1 + (handle->process (if (-> v1-14 manager) + (-> v1-14 manager manager) + (the-as handle #f) + ) + ) + a1-1 + ) + ) + ) + ) + :code (behavior () + (ja-no-eval :group! cty-sniper-turret-deactivate-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + :post (behavior () + (if (and (ja-done? 0) (< (if *target* + (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 266240.0 + ) + ) + (go-virtual ready #t) + ) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate locked-on (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :exit (behavior () + (logclear! (-> self flags) (cty-sniper-turret-flag cst3)) + ) + :trans (behavior () + (if (cty-sniper-turret-method-39 self) + (go-virtual die) + ) + ) + :code (behavior () + (logior! (-> self flags) (cty-sniper-turret-flag cst3)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.49)) + (suspend) + ) + ) + (let ((gp-1 (rand-vu-int-range 3 6))) + (dotimes (s5-0 gp-1) + (fire-shot self) + (ja-no-eval :group! cty-sniper-turret-barrelfire-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (suspend) + (if (and *target* (logtest? (-> *target* target-flags) (target-flags tf2 tinvuln1))) + (go-virtual fire) + ) + ) + ) + (go-virtual fire) + ) + :post (behavior () + (let* ((gp-0 *target*) + (a1-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (if a1-1 + (los-control-method-9 (-> self los) a1-1 (the-as vector #f) 819.2 4096.0) + ) + ) + (when (or (cty-sniper-turret-method-41 self) (logtest? (-> self flags) (cty-sniper-turret-flag cst12))) + (cond + ((logtest? (-> self flags) (cty-sniper-turret-flag cst12)) + (logclear! (-> self flags) (cty-sniper-turret-flag cst12)) + (remove-setting! 'pov-offset) + (send-event self 'pov-cam-off) + (send-event (handle->process (-> self reticle)) 'off) + (go-virtual fire) + ) + (else + (remove-setting! 'interp-time) + (logior! (-> self flags) (cty-sniper-turret-flag cst12)) + ) + ) + ) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate ready (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :enter (behavior ((arg0 symbol)) + (logior! (-> self flags) (cty-sniper-turret-flag cst0)) + (set-time! (-> self gun-timer)) + (send-event (handle->process (-> self reticle)) 'unlock) + (set! (-> self gun-current-aim-location quad) (-> *target* control trans quad)) + (send-event (handle->process (-> self reticle)) 'update (-> self gun-current-aim-location)) + ) + :trans (behavior () + (if (cty-sniper-turret-method-39 self) + (go-virtual die) + ) + ) + :code (behavior ((arg0 symbol)) + (when arg0 + (ja-no-eval :group! cty-sniper-turret-activate-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! cty-sniper-turret-activate-ja :num! max) + ) + (if (not (cty-sniper-turret-method-39 self)) + (go-virtual fire) + ) + (until #f + (ja-no-eval :group! cty-sniper-turret-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post sniper-turret-post + ) + +;; failed to figure out what this is: +(defstate fire (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :enter (behavior () + (logior! (-> self flags) (cty-sniper-turret-flag cst8)) + (send-event (handle->process (-> self reticle)) 'unlock) + (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) + ) + :exit (behavior () + (disable *screen-filter*) + ) + :trans (behavior () + (cond + ((cty-sniper-turret-method-39 self) + (go-virtual die) + ) + ((< 266240.0 (if *target* + (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + ) + (go-virtual asleep) + ) + ) + ) + :code (behavior () + (local-vars (v1-56 time-frame) (a0-17 int) (gp-5 time-frame) (f30-1 float)) + (until #f + (while (not (logtest? (-> self flags) (cty-sniper-turret-flag cst7))) + (until (cty-sniper-turret-method-40 self) + (suspend) + ) + 1.0 + (remove-setting! 'entity-name) + (set-setting! 'interp-time 'abs 450.0 0) + (set-setting! 'allow-look-around #f 0.0 0) + (suspend) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0))) + (s5-2 (vector-! (new 'stack-no-clear 'vector) (camera-pos) (target-pos 0))) + ) + (set! (-> gp-1 y) 0.0) + (set! (-> s5-2 y) 0.0) + (let ((f30-0 (vector-dot gp-1 s5-2))) + (when (and (< f30-0 0.0) (not (-> *setting-control* user-current freeze-screen))) + (set-setting! 'mode-name 'cam-no-trans 0.0 0) + (suspend) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 (seconds 0.5)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (the-as uint128 0)) + (cond + ((< (* (-> s5-2 x) (-> gp-1 z)) (* (-> s5-2 z) (-> gp-1 x))) + (set! (-> s3-0 z) (- (-> s5-2 x))) + (set! (-> s3-0 x) (-> s5-2 z)) + ) + (else + (set! (-> s3-0 z) (-> s5-2 x)) + (set! (-> s3-0 x) (- (-> s5-2 z))) + ) + ) + (vector+! s3-0 s3-0 (target-pos 0)) + (+! (-> s3-0 y) 20480.0) + (set! (-> *camera* slave 0 trans quad) (-> s3-0 quad)) + ) + (vector-! gp-1 (-> self root trans) (target-pos 0)) + (vector-! s5-2 (camera-pos) (target-pos 0)) + (set-setting! 'interp-time 'abs 300.0 0) + (suspend) + ) + ) + ) + (set-setting! 'mode-name 'cam-pov-track 0.0 0) + (let ((v1-43 (process->ppointer self))) + (set-setting! 'pov-handle v1-43 3.0 (-> v1-43 0 pid)) + ) + (set-setting! 'pov-offset 'abs (-> self pos-cam-offset) 0) + (when (not (-> *setting-control* user-current freeze-screen)) + (set-setting! 'matrix-blend-max-angle 'abs (degrees 10.0) 0) + (let ((gp-2 (current-time))) + (until (>= v1-56 a0-17) + (suspend) + (set! v1-56 (- (current-time) gp-2)) + (set! a0-17 (if (< 0.0 f30-0) + 450 + 300 + ) + ) + ) + ) + (remove-setting! 'matrix-blend-max-angle) + ) + ) + ) + (cond + ((not (-> *setting-control* user-current freeze-screen)) + (setup + *screen-filter* + (new 'static 'vector) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 0.08 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (logior! (-> *target* focus-status) (focus-status ignore)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.08)) + (suspend) + ) + ) + (send-event self 'pov-cam-on) + (send-event (handle->process (-> self reticle)) 'on) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector) + (* 0.08 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 0.08)) + (suspend) + ) + ) + (disable *screen-filter*) + ) + (else + (suspend) + 0 + ) + ) + ) + (until (not (focus-test? *target* grabbed)) + (until (not (focus-test? *target* grabbed)) + (suspend) + (set! f30-1 (rand-vu-float-range 2.0 4.5)) + (set! gp-5 (current-time)) + (label cfg-43) + ) + (label cfg-44) + (suspend) + (b! (not (time-elapsed? gp-5 (the int (* 300.0 f30-1)))) cfg-43) + (logclear! (-> *target* focus-status) (focus-status ignore)) + ) + (logior! (-> self flags) (cty-sniper-turret-flag cst11)) + (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) + (send-event (handle->process (-> self reticle)) 'lock) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) (process->ppointer self)) + (set! (-> a1-17 num-params) 0) + (set! (-> a1-17 message) 'turret-firing) + (let ((t9-25 send-event-function) + (v1-126 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-25 + (handle->process (if (-> v1-126 manager) + (-> v1-126 manager manager) + (the-as handle #f) + ) + ) + a1-17 + ) + ) + ) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 1.5)) + (when (focus-test? *target* grabbed) + (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) + (send-event (handle->process (-> self reticle)) 'unlock) + (goto cfg-44) + ) + (suspend) + ) + ) + (if (and (logtest? (-> self flags) (cty-sniper-turret-flag cst7)) (not (cty-sniper-turret-method-39 self))) + (go-virtual locked-on) + ) + (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) + (send-event (handle->process (-> self reticle)) 'unlock) + ) + #f + ) + :post sniper-turret-post + ) + +;; failed to figure out what this is: +(defstate die (cty-sniper-turret) + :virtual #t + :event cty-sniper-turret-handler + :code (behavior () + (set-setting! 'faction-command '((faction-strength kg -5)) 0.0 0) + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (quaternion-identity! (-> self gun-azimuth-jmod rotation)) + (quaternion-identity! (-> self gun-shoulder-jmod rotation)) + (quaternion-identity! (-> self gun-elbow-jmod rotation)) + (remove-setting! 'interp-time) + (suspend) + (send-event self 'pov-cam-off) + (send-event (handle->process (-> self reticle)) 'off) + (set-setting! 'mode-name 'cam-no-trans 0.0 0) + (persist-with-delay *setting-control* 'rapid-tracking (seconds 0.1) 'rapid-tracking #f 0.0 0) + (suspend) + (let ((a3-4 (res-lump-struct (-> self entity) 'cutaway-camera structure))) + (when a3-4 + (set-setting! 'entity-name a3-4 0.0 0) + (suspend) + (suspend) + (suspend) + (suspend) + (suspend) + (remove-setting! 'interp-time) + (suspend) + (remove-setting! 'entity-name) + ) + ) + (suspend) + (ja-no-eval :group! cty-sniper-turret-collapse-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (suspend) + (set-setting! 'interp-time 'abs 600.0 0) + (remove-setting! 'mode-name) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.25)) + (suspend) + ) + ) + (send-event (handle->process (-> self reticle)) 'die) + (let ((v1-71 (-> self root root-prim))) + (set! (-> v1-71 prim-core collide-as) (collide-spec)) + (set! (-> v1-71 prim-core collide-with) (collide-spec)) + ) + 0 + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (go-virtual explode) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate explode (cty-sniper-turret) + :virtual #t + :enter (behavior () + (sound-play "turret-explode") + (let ((v1-3 (-> self root 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)) + (set! (-> self root root-prim local-sphere w) 491520.0) + ) + :exit (behavior () + (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) 'turret-killed) + (let ((t9-0 send-event-function) + (v1-4 (-> *game-info* sub-task-list (game-task-node city-sniper-fight-resolution))) + ) + (t9-0 + (handle->process (if (-> v1-4 manager) + (-> v1-4 manager manager) + (the-as handle #f) + ) + ) + a1-0 + ) + ) + ) + ) + :code (behavior () + (cond + ((logtest? (-> *part-group-id-table* 1465 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1465)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1465)) + ) + ) + (suspend) + (let ((gp-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *up-vector* quad)) + (vector-normalize-copy! (-> gp-2 fountain-rand-transv-lo) s5-0 81920.0) + (vector-normalize-copy! (-> gp-2 fountain-rand-transv-hi) s5-0 245760.0) + ) + (set! (-> gp-2 fountain-rand-transv-lo x) -61440.0) + (set! (-> gp-2 fountain-rand-transv-lo z) -61440.0) + (set! (-> gp-2 fountain-rand-transv-hi x) 61440.0) + (set! (-> gp-2 fountain-rand-transv-hi z) 61440.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cty-sniper-turret-explode" (the-as (pointer level) #f)) + 10 + gp-2 + *cty-sniper-turret-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 39 of type cty-sniper-turret +(defmethod cty-sniper-turret-method-39 ((this cty-sniper-turret)) + (with-pp + (cond + ((and (= (length (-> this actor-group 0)) 1) (not (-> this actor-group 0 data 0 actor))) + #f + ) + (else + (dotimes (s5-0 (length (-> this actor-group 0))) + (let ((v1-10 (-> this actor-group 0 data s5-0)) + (a1-0 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'alive) + (let ((t9-1 send-event-function) + (v1-11 (-> v1-10 actor)) + ) + (if (t9-1 + (if v1-11 + (-> v1-11 extra process) + ) + a1-0 + ) + (return #f) + ) + ) + ) + ) + #t + ) + ) + ) + ) + +;; definition for method 10 of type cty-sniper-turret +(defmethod deactivate ((this cty-sniper-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (logclear! (-> this flags) (cty-sniper-turret-flag cst6)) + (sound-stop (-> this turn-sound-id)) + (disable *screen-filter*) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 7 of type cty-sniper-turret +;; WARN: Return type mismatch process-focusable vs cty-sniper-turret. +(defmethod relocate ((this cty-sniper-turret) (offset int)) + (the-as cty-sniper-turret ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for method 38 of type cty-sniper-turret +;; INFO: Used lq/sq +(defmethod cty-sniper-turret-method-38 ((this cty-sniper-turret) (arg0 vector) (arg1 quaternion) (arg2 vector) (arg3 float)) + (let ((s1-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s1-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s1-0 reaction) cshape-reaction-default) + (set! (-> s1-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s0-0 (new 'process 'collide-shape-prim-group s1-0 (the-as uint 5) 0))) + (set! (-> s1-0 total-prims) (the-as uint 6)) + (set! (-> s0-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s0-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s0-0 prim-core action) (collide-action solid)) + (set-vector! (-> s0-0 local-sphere) 0.0 0.0 0.0 32768.0) + (set! (-> s1-0 root-prim) s0-0) + ) + (pusher-init s1-0) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 5) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 6) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 7) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s1-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid)) + (set! (-> v1-22 transform-index) 8) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (set! (-> s1-0 nav-radius) (* 0.75 (-> s1-0 root-prim local-sphere w))) + (let ((v1-25 (-> s1-0 root-prim))) + (set! (-> s1-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s1-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> this root) s1-0) + ) + (set! (-> this root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> this root quat) arg1) + (set! (-> this offset quad) (-> arg2 quad)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 10)) + (init-los! (-> this los) this (seconds 0.3) 327680.0 (collide-spec backgnd)) + (init (-> this gun-elev-jmod) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this gun-azimuth-jmod) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this gun-elbow-jmod) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this gun-shoulder-jmod) this (the-as uint 5) (joint-mod-base-flags attached)) + (set! (-> this gun-elev) 0.0) + (set! (-> this gun-elev-cam) 0.0) + (set! (-> this gun-spread) 728.1778) + (set! (-> this gun-elev-joint-index) 8) + (set! (-> this gun-azimuth-joint-index) 4) + (quaternion-zero! (-> this tank-quat)) + (quaternion-copy! (-> this rotate-quat) arg1) + (set! (-> this rotate-rate) 0.0) + (set! (-> this rotate-mult) arg3) + (set! (-> this pos-cam-offset quad) (-> (new 'static 'vector :y 61440.0 :w 1.0) quad)) + (set-time! (-> this gun-timer)) + (set! (-> this flags) (cty-sniper-turret-flag)) + (set! (-> this fov-mult) 1.0) + (set! (-> this shot-range) 327680.0) + (set! (-> this gun-aims-from-joint) 10) + (set! (-> this reticle) + (process->handle (ppointer->process (process-spawn + cty-sniper-turret-reticle + arg0 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (lookup-texture-id-by-name "holo-curve" (the-as string #f)) + :name "cty-sniper-turret-reticle" + :to this + ) + ) + ) + ) + (let ((a0-62 (-> this skel root-channel 0))) + (set! (-> a0-62 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-62 frame-num) 0.0) + (joint-control-channel-group! a0-62 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (set! (-> this turn-sound-id) (new-sound-id)) + (logior! (-> this flags) (cty-sniper-turret-flag cst9)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 129) (the-as int #f) (the-as vector #t) 0)) + (go (method-of-object this waiting-for-batteries)) + ) + +;; definition for method 11 of type cty-sniper-turret +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this cty-sniper-turret) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set! (-> this entity) arg0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-1 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) v1-1) + ) + ) + (set! (-> this hud-buttons) (the-as handle #f)) + (let ((t9-1 (method-of-object this cty-sniper-turret-method-38)) + (a1-6 (-> arg0 extra trans)) + (a2-1 (-> arg0 quat)) + (a3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a3-1 x) 0.0) + (set! (-> a3-1 y) 0.0) + (set! (-> a3-1 z) 0.0) + (set! (-> a3-1 w) 1.0) + (t9-1 this a1-6 a2-1 a3-1 0.0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-chick_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-chick_REF.gc new file mode 100644 index 0000000000..77299d957c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-chick_REF.gc @@ -0,0 +1,1010 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-citizen-chick citizen-chick citizen-chick-lod0-jg -1 + ((citizen-chick-lod0-mg (meters 20)) (citizen-chick-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow citizen-chick-shadow-mg + ) + +;; definition for symbol *citizen-chick-global-info*, type civilian-global-info +(define *citizen-chick-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 20 22) + :knocked-land (new 'static 'array int32 2 21 23) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 20 22)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 19 18)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 19 18)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 19 18)) + ) + :anim-cover-head-start 14 + :anim-cover-head-loop 15 + :anim-cover-head-end 16 + :speech-ambient 27 + :speech-alert 28 + :speech-cower 29 + :speech-touched-by-player 30 + :speech-shot-by-player 31 + :speech-avoiding-player-vehicle 32 + :speech-hit-by-player-vehicle 33 + ) + ) + +;; definition of type citizen-chick +(deftype citizen-chick (civilian) + () + ) + +;; definition for method 3 of type citizen-chick +(defmethod inspect ((this citizen-chick)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type civilian inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *citizen-chick-nav-enemy-info*, type nav-enemy-info +(define *citizen-chick-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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 10 + :notice-anim 10 + :hostile-anim -1 + :hit-anim 10 + :knocked-anim 20 + :knocked-land-anim 21 + :die-anim 10 + :die-falling-anim 10 + :victory-anim 10 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance-delta (meters 0.1) + :default-hit-points 1.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 4.5) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 20480.0 + :knocked-soft-vy-hi 40960.0 + :knocked-medium-vxz-lo 40960.0 + :knocked-medium-vxz-hi 73728.0 + :knocked-medium-vy-lo 24576.0 + :knocked-medium-vy-hi 53248.0 + :knocked-hard-vxz-lo 53248.0 + :knocked-hard-vxz-hi 102400.0 + :knocked-hard-vy-lo 40960.0 + :knocked-hard-vy-hi 81920.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 8192.0 + :knocked-yellow-vxz-hi 16384.0 + :knocked-yellow-vy-lo 12288.0 + :knocked-yellow-vy-hi 24576.0 + :knocked-red-vxz-lo 12288.0 + :knocked-red-vxz-hi 24576.0 + :knocked-red-vy-lo 20480.0 + :knocked-red-vy-hi 36864.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 32768.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :z 1.0 :w 14.399715) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 776.6016 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :z 1.0 :w 32759.936) + :geo-tform (new 'static 'vector :x -0.0132 :y 0.103 :z 0.9945 :w 32703.047) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 892.5184 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.998 :z -0.0627 :w 1005.7045) + :geo-tform (new 'static 'vector :x -0.0174 :y 0.085 :z 0.9962 :w 32364.498) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 763.4944 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.0652 :z 0.9978 :w 7454.156) + :geo-tform (new 'static 'vector :x -0.0365 :y 0.214 :z 0.9761 :w 23936.934) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 561.9712 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3949 :z 0.9186 :w 22918.867) + :geo-tform (new 'static 'vector :x -0.5186 :y 0.8187 :z 0.2463 :w 10966.448) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6318 :z 0.7751 :w 6096.8506) + :geo-tform (new 'static 'vector :x 0.2578 :y 0.9617 :z 0.0926 :w 15893.045) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.0947 :z -0.9955 :w 7977.8794) + :geo-tform (new 'static 'vector :x 0.1172 :y 0.3467 :z 0.9305 :w 41298.84) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5223 :z -0.8527 :w 21621.0) + :geo-tform (new 'static 'vector :x -0.3996 :y -0.859 :z -0.3197 :w 15644.244) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2192 :z -0.9756 :w 7433.6577) + :geo-tform (new 'static 'vector :x 0.7974 :y 0.0095 :z 0.6032 :w 34256.594) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint 3 + :pre-tform (new 'static 'vector :z 1.0 :w 17.640106) + :geo-tform (new 'static 'vector :z 1.0 :w 1112.1277) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 832.3072 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :z -1.0 :w 13150.417) + :geo-tform (new 'static 'vector :x -0.1671 :y -0.0657 :z 0.9837 :w 12017.9) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 524.288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2094 :z 0.9778 :w 11988.609) + :geo-tform (new 'static 'vector :x 0.9887 :y -0.1433 :z 0.0422 :w 6040.7266) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9963 :z 0.0852 :w 5976.6104) + :geo-tform (new 'static 'vector :x -0.8827 :y -0.4697 :z 0.0099 :w 11882.987) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9608 :z -0.2772 :w 10351.757) + :geo-tform (new 'static 'vector :x -0.826 :y -0.5058 :z -0.2485 :w 11192.42) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 12 + :pre-tform (new 'static 'vector :z 1.0 :w 15361.583) + :geo-tform (new 'static 'vector :x -0.0332 :y 0.1941 :z -0.9804 :w 15875.422) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 594.3296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.215 :z -0.9766 :w 15500.575) + :geo-tform (new 'static 'vector :x 0.7755 :y 0.6147 :z -0.1434 :w 6094.921) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9338 :z -0.3575 :w 4780.7783) + :geo-tform (new 'static 'vector :x -0.9242 :y 0.3246 :z 0.201 :w 9991.874) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9282 :z 0.372 :w 9409.367) + :geo-tform (new 'static 'vector :x -0.934 :y 0.3205 :z 0.1574 :w 10100.427) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 562.7904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint 5 + :pre-tform (new 'static 'vector :x 0.9806 :z -0.1956 :w 1580.9104) + :geo-tform (new 'static 'vector :x -0.0195 :y 0.2824 :z 0.959 :w 32647.85) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 696.7296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.3059 :z 0.952 :w 7279.739) + :geo-tform (new 'static 'vector :x 0.344 :y 0.9317 :z 0.1158 :w 25729.506) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 371.9168 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.4303 :z 0.9026 :w 6036.6484) + :geo-tform (new 'static 'vector :x 0.2319 :y 0.9724 :z 0.0232 :w 30738.059) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 289.9968 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.922 :z -0.3869 :w 3968.6052) + :geo-tform (new 'static 'vector :x 0.0273 :y 0.8678 :z 0.4961 :w 31513.57) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 280.576 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 11 + :pre-tform (new 'static 'vector :x -0.1937 :z -0.981 :w 7246.88) + :geo-tform (new 'static 'vector :x -0.014 :y 0.9998 :z 0.0019 :w 38307.16) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 335.4624 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 11 + :pre-tform (new 'static 'vector :x -0.1631 :z -0.9865 :w 5719.964) + :geo-tform (new 'static 'vector :x -0.2341 :y 0.9715 :z 0.0353 :w 35807.234) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 299.008 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint 11 + :pre-tform (new 'static 'vector :x 0.7102 :z 0.7039 :w 1501.9758) + :geo-tform (new 'static 'vector :x 0.0925 :y 0.7746 :z 0.6255 :w 34903.016) + :axial-slop 1721.3394 + :max-angle 3810.445 + :coll-rad 316.2112 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim 4 + :run-anim 7 + :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 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *citizen-chick-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 67 of type citizen-chick +(defmethod coin-flip? ((this citizen-chick)) + #f + ) + +;; definition for method 27 of type citizen-chick +(defmethod get-inv-mass ((this citizen-chick)) + 0.5 + ) + +;; definition for method 55 of type citizen-chick +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this citizen-chick)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-5 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-5 + (get-trans a0-5 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f30-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) + (vector-negate-in-place! s5-1) + ) + (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f1-2 (deg- f30-0 f28-0)) + (f2-0 (fabs f1-2)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) + ) + (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) + (set! f30-0 (+ (cond + ((< f2-0 16384.0) + (if (>= f1-2 0.0) + f0-8 + (- f0-8) + ) + ) + ((>= f1-2 0.0) + (- 32768.0 f0-8) + ) + (else + (+ -32768.0 f0-8) + ) + ) + f28-0 + ) + ) + (if (< f30-0 0.0) + (set! f30-0 (+ 65536.0 f30-0)) + ) + ) + ) + ) + ) + ) + (the-as degrees f30-0) + ) + ) + +;; definition for method 87 of type citizen-chick +(defmethod knocked-anim-handler ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-0 (ja-done? 0))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + (when s5-0 + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + ) + (set! (-> a0-6 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-6 param 1) (-> arg1 anim-speed)) + (set! (-> a0-6 frame-num) 3.0) + (joint-control-channel-group! + a0-6 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + num-func-seek! + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +;; definition for method 85 of type citizen-chick +(defmethod knocked-anim ((this citizen-chick) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-131 this 1 a2-0)) + (a1-7 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) + yellow-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) + (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) + (set! (-> a0-15 param 1) (-> arg0 anim-speed)) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim a1-7) num-func-seek!) + ) + ) + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-131 this 3 a2-2)) + (a1-14 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) + blue-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) + (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) + (set! (-> a0-30 param 1) 1.0) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim a1-14) num-func-seek!) + ) + ) + ) + (else + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-39 (-> this skel root-channel 0))) + (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-39 param 1) (-> arg0 anim-speed)) + (set! (-> a0-39 frame-num) 0.0) + (joint-control-channel-group! a0-39 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + ) + #t + ) + +;; definition for method 86 of type citizen-chick +(defmethod knocked-land-anim ((this citizen-chick) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + ) + (set! (-> a0-2 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! + a0-2 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + num-func-seek! + ) + ) + #t + ) + +;; failed to figure out what this is: +(defstate knocked (citizen-chick) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (the-as collide-shape-prim-group (-> self root root-prim)))) + (logior! (-> v1-5 child 0 prim-core action) (collide-action no-standon)) + (logclear! (-> v1-5 child 1 prim-core action) (collide-action no-standon)) + (set! (-> v1-5 child 1 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate get-up-front (citizen-chick) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-front) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-back (citizen-chick) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-back) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait (citizen-chick) + :virtual #t + :code (behavior () + (let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0)))) + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! citizen-chick-idle-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + #f + ) + ) + +;; definition for method 120 of type citizen-chick +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this citizen-chick)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 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 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 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) 4096.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type citizen-chick +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this citizen-chick)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-chick" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *citizen-chick-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *citizen-chick-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 26) + (let ((v1-18 (rnd-int this 3))) + (cond + ((zero? v1-18) + (set! (-> this anim-walk) 4) + (set! (-> this dist-walk-anim) 15728.64) + (set! (-> this speed-walk) 14745.6) + ) + ((= v1-18 1) + (set! (-> this anim-walk) 5) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 8192.0) + ) + ((= v1-18 2) + (set! (-> this anim-walk) 6) + (set! (-> this dist-walk-anim) 15728.64) + (set! (-> this speed-walk) 12288.0) + ) + ) + ) + (let ((v1-33 (rnd-int this 3))) + (cond + ((zero? v1-33) + (set! (-> this anim-panic-run) 11) + ) + ((= v1-33 1) + (set! (-> this anim-panic-run) 11) + ) + ((= v1-33 2) + (set! (-> this anim-panic-run) 7) + ) + ) + ) + (let ((v1-39 (rnd-int this 3))) + (cond + ((zero? v1-39) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) + ) + ((= v1-39 1) + (set! (-> this dist-run-anim) 28385.28) + (set! (-> this anim-run) 8) + ) + ((= v1-39 2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 9) + ) + ) + ) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 13) + (set! (-> this anim-dive) 17) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (rnd-float-range this 1.0 1.25)) + (f0-17 (rnd-float-range this 1.0 1.25)) + ) + (set-vector! (-> this root scale) f0-17 f30-0 f0-17 1.0) + ) + (let ((f0-19 (rnd-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-19 f0-19 f0-19 1.0) + ) + (set! (-> this water-anim) 12) + (logior! (-> this flags) (citizen-flag female)) + 0 + (none) + ) + +;; definition for method 194 of type citizen-chick +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this citizen-chick)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (rnd-int this 3))) + (cond + ((zero? v1-11) + (setup-masks (-> this draw) 32 0) + ) + ((= v1-11 1) + (setup-masks (-> this draw) #x4000 0) + ) + ((= v1-11 2) + (setup-masks (-> this draw) #x8000 0) + ) + ) + ) + (let ((v1-20 (rnd-int this 3))) + (cond + ((zero? v1-20) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-20 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-20 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + (let ((v1-29 (rnd-int this 3))) + (cond + ((zero? v1-29) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-29 1) + (setup-masks (-> this draw) 512 0) + ) + ((= v1-29 2) + (setup-masks (-> this draw) 4096 0) + ) + ) + ) + (let ((v1-38 (rnd-int this 3))) + (cond + ((zero? v1-38) + (setup-masks (-> this draw) 2 0) + (let ((v1-42 (rnd-int this 2))) + (cond + ((zero? v1-42) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-42 1) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + ) + ((= v1-38 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-38 2) + (setup-masks (-> this draw) 2048 0) + (let ((v1-54 (rnd-int this 2))) + (cond + ((zero? v1-54) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-54 1) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + ) + ) + ) + (logior! (-> this flags) (citizen-flag female)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-enemy_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-enemy_REF.gc new file mode 100644 index 0000000000..0be089f7c9 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-enemy_REF.gc @@ -0,0 +1,321 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type citizen-enemy +(deftype citizen-enemy (citizen) + ((next-update-target time-frame) + (minimap connection-minimap) + ) + (:methods + (set-traffic-danger (_type_) none) + (find-new-focus (_type_) object) + ) + ) + +;; definition for method 3 of type citizen-enemy +(defmethod inspect ((this citizen-enemy)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type citizen inspect))) + (t9-0 this) + ) + (format #t "~2Tnext-update-target: ~D~%" (-> this next-update-target)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-4) + this + ) + +;; definition for method 59 of type citizen-enemy +(defmethod enemy-common-post ((this citizen-enemy)) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-0) + ) + (when (and (not (focus-test? this disable dead ignore inactive)) + (< (-> this next-update-target) (current-time)) + (not (logtest? (enemy-flag lock-focus) (-> this enemy-flags))) + (-> this next-state) + (= (-> this next-state name) 'active) + ) + (find-new-focus this) + (set! (-> this next-update-target) (+ (current-time) (seconds 0.2))) + (set-traffic-danger this) + ) + ((method-of-type citizen enemy-common-post) this) + (none) + ) + +;; definition for method 84 of type citizen-enemy +(defmethod send-attack-on-jump-or-knocked ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) + (cond + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) + ) + ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-6 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask guard civilian) (-> arg0 mask)) + (and v1-6 + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 82 of type citizen-enemy +(defmethod event-handler ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('event-death) + #f + ) + (('effect-control) + (let ((a0-3 (-> arg3 param 0))) + (cond + ((string= (the-as string a0-3) "death-default") + (cond + ((< 0.0 (-> this hit-points)) + #t + ) + (else + (let ((v1-2 (-> this root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + #f + ) + ) + ) + (else + #f + ) + ) + ) + ) + (('end-task) + (let ((v0-0 (the-as object (logclear (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-0)) + v0-0 + ) + ) + (else + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 216 of type citizen-enemy +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-traffic-danger ((this citizen-enemy)) + (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) + (set! (-> a1-0 sphere r) 40960.0) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (set! (-> a1-0 notify-radius) 122880.0) + (set! (-> a1-0 danger-level) 1.0) + (set! (-> a1-0 decay-rate) 0.0) + (set! (-> a1-0 flags) (the-as uint 1)) + (set! (-> a1-0 danger-type) (the-as uint 7)) + (set! (-> a1-0 handle) (process->handle this)) + (add-danger (-> this controller traffic) a1-0) + ) + 0 + (none) + ) + +;; definition for method 217 of type citizen-enemy +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs object. +(defmethod find-new-focus ((this citizen-enemy)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (set! (-> s5-0 w) 122880.0) + (let ((s4-0 (the-as process-drawable #f))) + (let ((f30-0 122880.0)) + (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 64))) + (countdown (s2-0 (fill-actor-list-for-box *actor-hash* s5-0 s3-0 64)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-6 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-6 + (let* ((s0-0 (-> a0-6 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (!= this s1-1) + (not (focus-test? (the-as process-focusable s1-1) inactive)) + (not (focus-test? (the-as process-focusable s1-1) disable)) + (not (logtest? (process-mask enemy) (-> s1-1 mask))) + (not (logtest? (process-mask crate) (-> s1-1 mask))) + (not (logtest? (process-mask vehicle) (-> s1-1 mask))) + s1-1 + (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((f0-1 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) + (when (or (not s4-0) (< f0-1 f30-0)) + (set! s4-0 s1-1) + (set! f30-0 f0-1) + ) + ) + ) + ) + ) + ) + ) + ) + (if (and *target* (< (vector-vector-distance (target-pos 0) s5-0) f30-0)) + (set! s4-0 *target*) + ) + ) + (when s4-0 + (try-update-focus (-> this focus) (the-as process-focusable s4-0) this) + (go-hostile this) + ) + ) + ) + 0 + ) + +;; failed to figure out what this is: +(defstate active (citizen-enemy) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate inactive (citizen-enemy) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((t9-0 (-> (method-of-type citizen inactive) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +;; definition for method 194 of type citizen-enemy +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this citizen-enemy)) + (let ((t9-0 (method-of-type citizen citizen-method-194))) + (t9-0 this) + ) + (if (-> this skel effect) + (logior! (-> this skel effect flags) (effect-control-flag ecf0)) + ) + (logior! (-> this mask) (process-mask enemy)) + (reset-to-collide-spec (-> this focus) (collide-spec jak civilian player-list bot-targetable jak-vehicle)) + (let ((v1-12 (-> this nav))) + (set! (-> v1-12 sphere-mask) (the-as uint #x1000e8)) + ) + 0 + (set! (-> this anim-shuffle) (-> this enemy-info walk-anim)) + (set! (-> this anim-walk) (-> this enemy-info walk-anim)) + (set! (-> this speed-walk) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-walk-anim) (-> this enemy-info walk-travel-speed)) + (set! (-> this anim-run) (-> this enemy-info run-anim)) + (set! (-> this dist-run-anim) (-> this enemy-info run-travel-speed)) + (set! (-> this speed-run) (-> this enemy-info run-travel-speed)) + (set! (-> this fated-time) 0) + (logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this enemy-flags) (enemy-flag trackable trackable-backup)) + (logclear! (-> this focus-status) (focus-status dead)) + (logior! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0)) + ) + (ja-channel-set! 0) + 0 + (none) + ) + +;; definition for method 81 of type citizen-enemy +(defmethod go-die ((this citizen-enemy)) + ((method-of-type nav-enemy go-die) this) + ) + +;; definition for method 78 of type citizen-enemy +(defmethod go-hostile ((this citizen-enemy)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) + ) + ) + +;; definition for method 75 of type citizen-enemy +(defmethod go-stare ((this citizen-enemy)) + (go (method-of-object this active)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-fat_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-fat_REF.gc new file mode 100644 index 0000000000..58bec21f12 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-fat_REF.gc @@ -0,0 +1,1059 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-citizen-fat citizen-fat citizen-fat-lod0-jg -1 + ((citizen-fat-lod0-mg (meters 20)) (citizen-fat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow citizen-fat-shadow-mg + ) + +;; definition for symbol *citizen-fat-global-info*, type civilian-global-info +(define *citizen-fat-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 20 22) + :knocked-land (new 'static 'array int32 2 21 23) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 20 22)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + ) + :anim-cover-head-start 28 + :anim-cover-head-loop 29 + :anim-cover-head-end 30 + :speech-ambient 19 + :speech-alert 20 + :speech-cower 21 + :speech-touched-by-player 22 + :speech-shot-by-player 23 + :speech-avoiding-player-vehicle 24 + :speech-hit-by-player-vehicle 25 + ) + ) + +;; definition of type citizen-fat +(deftype citizen-fat (civilian) + () + ) + +;; definition for method 3 of type citizen-fat +(defmethod inspect ((this citizen-fat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type civilian inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *citizen-fat-nav-enemy-info*, type nav-enemy-info +(define *citizen-fat-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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 20 + :knocked-land-anim 21 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 11 + :jump-in-air-anim 11 + :jump-land-anim 11 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance-delta (meters 0.1) + :default-hit-points 1.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 4.5) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 20480.0 + :knocked-soft-vy-hi 40960.0 + :knocked-medium-vxz-lo 40960.0 + :knocked-medium-vxz-hi 73728.0 + :knocked-medium-vy-lo 24576.0 + :knocked-medium-vy-hi 53248.0 + :knocked-hard-vxz-lo 53248.0 + :knocked-hard-vxz-hi 102400.0 + :knocked-hard-vy-lo 40960.0 + :knocked-hard-vy-hi 81920.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 8192.0 + :knocked-yellow-vxz-hi 16384.0 + :knocked-yellow-vy-lo 12288.0 + :knocked-yellow-vy-hi 24576.0 + :knocked-red-vxz-lo 12288.0 + :knocked-red-vxz-hi 24576.0 + :knocked-red-vy-lo 20480.0 + :knocked-red-vy-hi 36864.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 32768.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9956 :y 0.0755 :z -0.0549 :w 34275.477) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :y -0.1262 :z -0.9919 :w 14.399715) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1925.12 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9223 :y -0.0007 :z -0.3862 :w 32775.19) + :geo-tform (new 'static 'vector :x 0.9203 :y -0.1312 :z -0.3683 :w 34427.207) + :axial-slop 965.27246 + :max-angle 5853.9307 + :coll-rad 2340.4543 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2005 :z -0.9796 :w 2271.4595) + :geo-tform (new 'static 'vector :x 0.1581 :y 0.9865 :z -0.0421 :w 8845.103) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1692.0576 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7243 :z -0.6893 :w 2846.8657) + :geo-tform (new 'static 'vector :x -0.1479 :y 0.9867 :z 0.066 :w 8858.61) + :axial-slop 965.27246 + :max-angle 4573.776 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.8955 :z -0.445 :w 13969.198) + :geo-tform (new 'static 'vector :x -0.7036 :y -0.676 :z 0.2186 :w 20755.123) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1223.8848 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8754 :z -0.4832 :w 13897.382) + :geo-tform (new 'static 'vector :x -0.3584 :y -0.8556 :z -0.3732 :w 18419.002) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 901.5296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.0404 :z -0.9991 :w 8581.703) + :geo-tform (new 'static 'vector :x 0.2116 :y -0.9532 :z 0.2155 :w 17374.959) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 949.0432 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0279 :z 0.9996 :w 3558.259) + :geo-tform (new 'static 'vector :x -0.9963 :y -0.085 :z -0.0097 :w 9371.43) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1292.6976 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4821 :z 0.876 :w 10845.134) + :geo-tform (new 'static 'vector :x -0.5782 :y 0.7328 :z 0.3585 :w 34858.27) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1266.0736 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6376 :z 0.7703 :w 15514.556) + :geo-tform (new 'static 'vector :x 0.0502 :y 0.9291 :z 0.3662 :w 35412.96) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1164.9023 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.963 :z -0.2693 :w 7833.773) + :geo-tform (new 'static 'vector :x -0.0243 :y 0.0434 :z 0.9987 :w 31253.5) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1002.7008 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2155 :z -0.9764 :w 1509.913) + :geo-tform (new 'static 'vector :x -0.2514 :y 0.9548 :z 0.1584 :w 16456.654) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1101.0048 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.9221 :y -0.0002 :z -0.3868 :w 16.09273) + :geo-tform (new 'static 'vector :x -0.9217 :y 0.0096 :z 0.3876 :w 10.176285) + :axial-slop 965.27246 + :max-angle 2330.5146 + :coll-rad 1939.456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :z -1.0 :w 12461.907) + :geo-tform (new 'static 'vector :x -0.3106 :y -0.4242 :z 0.8505 :w 16421.393) + :axial-slop 965.27246 + :max-angle 2253.4373 + :coll-rad 983.8592 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6836 :z 0.7298 :w 14527.329) + :geo-tform (new 'static 'vector :x 0.6717 :y -0.6833 :z 0.286 :w 11624.775) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1144.4224 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.693 :z 0.7208 :w 8269.915) + :geo-tform (new 'static 'vector :x -0.693 :y -0.5965 :z -0.4047 :w 14961.978) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1106.3296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5333 :z -0.8459 :w 11592.299) + :geo-tform (new 'static 'vector :x -0.6362 :y -0.6968 :z -0.331 :w 13379.302) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1120.6656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint 13 + :pre-tform (new 'static 'vector :z 1.0 :w 12451.658) + :geo-tform (new 'static 'vector :x -0.5073 :y 0.5962 :z -0.6221 :w 12900.307) + :axial-slop 965.27246 + :max-angle 2242.4417 + :coll-rad 829.44 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8844 :z -0.4666 :w 10098.569) + :geo-tform (new 'static 'vector :x 0.7665 :y 0.5537 :z -0.3251 :w 13637.15) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 889.6512 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6949 :z -0.719 :w 11076.858) + :geo-tform (new 'static 'vector :x -0.8013 :y 0.5535 :z 0.2267 :w 15242.5625) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1168.1792 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7409 :z 0.6715 :w 12293.717) + :geo-tform (new 'static 'vector :x -0.6542 :y 0.6831 :z 0.3245 :w 13102.194) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1168.1792 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 11 + :turn-anim 11 + :run-anim 15 + :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 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *citizen-fat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 67 of type citizen-fat +(defmethod coin-flip? ((this citizen-fat)) + #f + ) + +;; definition for method 27 of type citizen-fat +(defmethod get-inv-mass ((this citizen-fat)) + 0.5 + ) + +;; definition for method 55 of type citizen-fat +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this citizen-fat)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-5 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-5 + (get-trans a0-5 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f30-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) + (vector-negate-in-place! s5-1) + ) + (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f1-2 (deg- f30-0 f28-0)) + (f2-0 (fabs f1-2)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) + ) + (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) + (set! f30-0 (+ (cond + ((< f2-0 16384.0) + (if (>= f1-2 0.0) + f0-8 + (- f0-8) + ) + ) + ((>= f1-2 0.0) + (- 32768.0 f0-8) + ) + (else + (+ -32768.0 f0-8) + ) + ) + f28-0 + ) + ) + (if (< f30-0 0.0) + (set! f30-0 (+ 65536.0 f30-0)) + ) + ) + ) + ) + ) + ) + (the-as degrees f30-0) + ) + ) + +;; definition for method 87 of type citizen-fat +(defmethod knocked-anim-handler ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-0 (ja-done? 0))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + (when s5-0 + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + ) + (set! (-> a0-6 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-6 param 1) (-> arg1 anim-speed)) + (set! (-> a0-6 frame-num) 3.0) + (joint-control-channel-group! + a0-6 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + num-func-seek! + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +;; definition for method 85 of type citizen-fat +(defmethod knocked-anim ((this citizen-fat) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-131 this 1 a2-0)) + (a1-7 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) + yellow-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) + (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) + (set! (-> a0-15 param 1) (-> arg0 anim-speed)) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim a1-7) num-func-seek!) + ) + ) + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-131 this 3 a2-2)) + (a1-14 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) + blue-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) + (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) + (set! (-> a0-30 param 1) 1.0) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim a1-14) num-func-seek!) + ) + ) + ) + (else + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-39 (-> this skel root-channel 0))) + (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-39 param 1) (-> arg0 anim-speed)) + (set! (-> a0-39 frame-num) 0.0) + (joint-control-channel-group! a0-39 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + ) + #t + ) + +;; definition for method 86 of type citizen-fat +(defmethod knocked-land-anim ((this citizen-fat) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + ) + (set! (-> a0-2 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! + a0-2 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + num-func-seek! + ) + ) + #t + ) + +;; failed to figure out what this is: +(defstate knocked (citizen-fat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (the-as collide-shape-prim-group (-> self root root-prim)))) + (logior! (-> v1-5 child 0 prim-core action) (collide-action no-standon)) + (logclear! (-> v1-5 child 1 prim-core action) (collide-action no-standon)) + (set! (-> v1-5 child 1 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate get-up-front (citizen-fat) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-front) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-back (citizen-fat) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-back) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait (citizen-fat) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (until #f + (let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0))) + (gp-0 (rand-vu-int-range 1 5)) + (s5-0 (rand-vu-int-count 2)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (if (zero? s5-0) + (ja-no-eval :group! citizen-fat-idle-to-arms-hips-ja :num! min) + (ja-no-eval :group! citizen-fat-idle-to-arms-crossed-ja :num! min) + ) + (let ((f28-0 0.0)) + (while (< f28-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f28-0 f28-0 f28-0) (* 3.0 f28-0 f28-0)) 0.0 1.0) + ) + (suspend) + (+! f28-0 (seconds-per-frame)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (while (> gp-0 0) + (+! gp-0 -1) + (cond + ((zero? s5-0) + (ja-no-eval :group! citizen-fat-arms-hips-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (else + (ja-no-eval :group! citizen-fat-arms-crossed-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + ) + ) + (if (-> self wait-return-state) + (go (-> self wait-return-state)) + ) + ) + #f + ) + ) + +;; definition for method 120 of type citizen-fat +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this citizen-fat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 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 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 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) 4096.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type citizen-fat +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this citizen-fat)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-fat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *citizen-fat-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *citizen-fat-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 12) + (let ((v1-18 (rnd-int this 3))) + (cond + ((zero? v1-18) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 1) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 2) + (set! (-> this anim-walk) 14) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ) + ) + (let ((v1-33 (rnd-int this 3))) + (cond + ((zero? v1-33) + (set! (-> this anim-panic-run) 17) + ) + ((= v1-33 1) + (set! (-> this anim-panic-run) 17) + ) + ((= v1-33 2) + (set! (-> this anim-panic-run) 15) + ) + ) + ) + (set! (-> this dist-run-anim) 20480.0) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (set! (-> this anim-run) 15) + ) + ((= v1-40 1) + (set! (-> this anim-run) 16) + ) + ((= v1-40 2) + (set! (-> this anim-run) 16) + ) + ) + ) + (set! (-> this speed-run) 32768.0) + (set! (-> this anim-on-ground) 19) + (set! (-> this anim-dive) 18) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (rnd-float-range this 1.0 1.25)) + (f0-15 (rnd-float-range this 1.0 1.25)) + ) + (set-vector! (-> this root scale) f0-15 f30-0 f0-15 1.0) + ) + (let ((f0-17 (rnd-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-17 f0-17 f0-17 1.0) + ) + (set! (-> this water-anim) 32) + 0 + (none) + ) + +;; definition for method 194 of type citizen-fat +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this citizen-fat)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (let ((v1-7 (rnd-int this 2))) + (cond + ((zero? v1-7) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (rnd-int this 3))) + (cond + ((zero? v1-11) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-11 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-11 2) + (setup-masks (-> this draw) #x8000 0) + ) + ) + ) + (let ((v1-20 (rnd-int this 4))) + (cond + ((zero? v1-20) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-20 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-20 2) + (setup-masks (-> this draw) 130 0) + ) + ) + ) + (setup-masks (-> this draw) 512 0) + (let ((v1-31 (rnd-int this 3))) + (cond + ((zero? v1-31) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-31 1) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-31 2) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (setup-masks (-> this draw) 32 0) + ) + ((= v1-40 1) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-40 2) + (setup-masks (-> this draw) #x20000 0) + ) + ) + ) + (let ((v1-49 (rnd-int this 3))) + (cond + ((zero? v1-49) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-49 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-49 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ((= v1-7 1) + (setup-masks (-> this draw) #x400000 0) + (setup-masks (-> this draw) #x200000 0) + (let ((v1-63 (rnd-int this 2))) + (cond + ((zero? v1-63) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-63 1) + (setup-masks (-> this draw) #x80000 0) + ) + ) + ) + (let ((v1-70 (rnd-int this 2))) + (cond + ((zero? v1-70) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-70 1) + (setup-masks (-> this draw) #x100000 0) + ) + ) + ) + (let ((v1-77 (rnd-int this 4))) + (cond + ((zero? v1-77) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-77 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-77 2) + (setup-masks (-> this draw) 130 0) + ) + ) + ) + (if (zero? (rnd-int this 1)) + (setup-masks (-> this draw) #x20000 0) + ) + (let ((v1-91 (rnd-int this 3))) + (cond + ((zero? v1-91) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-91 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-91 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-h_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-h_REF.gc new file mode 100644 index 0000000000..fb7f3d31b0 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-h_REF.gc @@ -0,0 +1,188 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type citizen +(deftype citizen (nav-enemy) + ((self citizen :override) + (ppointer (pointer citizen) :override) + (flags citizen-flag) + (traffic-id int8) + (hit-by-player-count int8) + (gnd-height float) + (speed-scale float) + (controller vehicle-controller :inline) + (squad squad-control) + (danger-pos sphere :inline) + (dest-point vector :inline :overlay-at (-> controller turn-exit-point)) + (vehicle handle) + (formation handle :overlay-at vehicle) + (formation-index int8) + (anim-shuffle int32) + (dist-walk-anim float) + (speed-walk float) + (anim-walk int32) + (dist-run-anim float) + (speed-run float) + (anim-run int32) + (travel-anim-scale-speed float) + (water-anim int32) + (interp float) + (last-danger-time time-frame) + (next-time-look-at time-frame) + (stop-time-look-at time-frame) + (wait-return-state (state citizen)) + (wait-time time-frame) + (shield-handle handle) + (cp-valid? symbol) + (cp-sphere sphere :inline) + (cp-vec vector :inline) + (cp-next-time time-frame) + (cp-exit-time time-frame) + (cp-force vector :inline) + (cp-plane plane :inline) + (cp-factor float) + (faction-mode uint8) + (attacker-info city-attacker-info) + (mission-squad mission-squad-control) + (probe-counter uint32) + ) + (:state-methods + wait + inactive + in-ditch + ) + (:methods + (init-enemy-defaults! (_type_ nav-enemy-info) none :replace) + (set-squad (_type_) none) + (citizen-method-194 (_type_) none) + (citizen-method-195 (_type_) none) + (go-inactive (_type_) none) + (find-segment (_type_ vector vector) nav-segment) + (nav-segment-callback (_type_ vector traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (citizen-method-199 (_type_ nav-segment) none) + (citizen-method-200 (_type_) symbol) + (citizen-method-201 (_type_ vector) none) + (citizen-method-202 (_type_ vector vector) none) + (citizen-method-203 (_type_ vector) none) + (gen-clear-path (_type_) nav-segment) + (citizen-method-205 (_type_) none) + (citizen-method-206 (_type_) none) + (citizen-method-207 (_type_ vector float) nav-segment) + (citizen-method-208 (_type_ vector) none) + (get-run-anim (_type_) int) + (citizen-method-210 (_type_ int process) none) + (set-alert-level (_type_ int) none) + (go-from-behavior (_type_ traffic-object-spawn-params) none) + (citizen-method-213 (_type_) none) + (citizen-method-214 (_type_ nav-control vector) none) + (citizen-method-215 (_type_) none) + ) + ) + +;; definition for method 3 of type citizen +(defmethod inspect ((this citizen)) + (when (not this) + (set! this this) + (goto cfg-34) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tflags: #x~X : (citizen-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (citizen-flag neck-no-auto-look-at)) (citizen-flag neck-no-auto-look-at)) + (format #t "neck-no-auto-look-at ") + ) + (if (= (logand s5-0 (citizen-flag in-formation)) (citizen-flag in-formation)) + (format #t "in-formation ") + ) + (if (= (logand s5-0 (citizen-flag talking)) (citizen-flag talking)) + (format #t "talking ") + ) + (if (= (logand s5-0 (citizen-flag female)) (citizen-flag female)) + (format #t "female ") + ) + (if (= (logand s5-0 (citizen-flag knocked-out-car)) (citizen-flag knocked-out-car)) + (format #t "knocked-out-car ") + ) + (if (= (logand s5-0 (citizen-flag sticky-weapon)) (citizen-flag sticky-weapon)) + (format #t "sticky-weapon ") + ) + (if (= (logand s5-0 (citizen-flag in-pursuit)) (citizen-flag in-pursuit)) + (format #t "in-pursuit ") + ) + (if (= (logand s5-0 (citizen-flag dark-guard)) (citizen-flag dark-guard)) + (format #t "dark-guard ") + ) + (if (= (logand s5-0 (citizen-flag hostile)) (citizen-flag hostile)) + (format #t "hostile ") + ) + (if (= (logand s5-0 (citizen-flag persistent)) (citizen-flag persistent)) + (format #t "persistent ") + ) + (if (= (logand s5-0 (citizen-flag shuffle-mode)) (citizen-flag shuffle-mode)) + (format #t "shuffle-mode ") + ) + (if (= (logand s5-0 (citizen-flag knocked-out-bike)) (citizen-flag knocked-out-bike)) + (format #t "knocked-out-bike ") + ) + (if (= (logand s5-0 (citizen-flag target-in-sight)) (citizen-flag target-in-sight)) + (format #t "target-in-sight ") + ) + (if (= (logand s5-0 (citizen-flag in-mission)) (citizen-flag in-mission)) + (format #t "in-mission ") + ) + (if (= (logand s5-0 (citizen-flag run-mode)) (citizen-flag run-mode)) + (format #t "run-mode ") + ) + ) + (format #t ")~%") + (format #t "~2Ttraffic-id: ~D~%" (-> this traffic-id)) + (format #t "~2Thit-by-player-count: ~D~%" (-> this hit-by-player-count)) + (format #t "~2Tgnd-height: ~f~%" (-> this gnd-height)) + (format #t "~2Tspeed-scale: ~f~%" (-> this speed-scale)) + (format #t "~2Tcontroller: #~%" (-> this controller)) + (format #t "~2Tsquad: ~A~%" (-> this squad)) + (format #t "~2Tdanger-pos: #~%" (-> this danger-pos)) + (format #t "~2Tdest-point: #~%" (-> this dest-point)) + (format #t "~2Tvehicle: ~D~%" (-> this vehicle)) + (format #t "~2Tformation: ~D~%" (-> this vehicle)) + (format #t "~2Tformation-index: ~D~%" (-> this formation-index)) + (format #t "~2Tanim-shuffle: ~D~%" (-> this anim-shuffle)) + (format #t "~2Tdist-walk-anim: ~f~%" (-> this dist-walk-anim)) + (format #t "~2Tspeed-walk: ~f~%" (-> this speed-walk)) + (format #t "~2Tanim-walk: ~D~%" (-> this anim-walk)) + (format #t "~2Tdist-run-anim: ~f~%" (-> this dist-run-anim)) + (format #t "~2Tspeed-run: ~f~%" (-> this speed-run)) + (format #t "~2Tanim-run: ~D~%" (-> this anim-run)) + (format #t "~2Ttravel-anim-scale-speed: ~f~%" (-> this travel-anim-scale-speed)) + (format #t "~2Twater-anim: ~D~%" (-> this water-anim)) + (format #t "~2Tinterp: ~f~%" (-> this interp)) + (format #t "~2Tlast-danger-time: ~D~%" (-> this last-danger-time)) + (format #t "~2Tnext-time-look-at: ~D~%" (-> this next-time-look-at)) + (format #t "~2Tstop-time-look-at: ~D~%" (-> this stop-time-look-at)) + (format #t "~2Twait-return-state: ~A~%" (-> this wait-return-state)) + (format #t "~2Twait-time: ~D~%" (-> this wait-time)) + (format #t "~2Tshield-handle: ~D~%" (-> this shield-handle)) + (format #t "~2Tcp-valid?: ~A~%" (-> this cp-valid?)) + (format #t "~2Tcp-sphere: #~%" (-> this cp-sphere)) + (format #t "~2Tcp-vec: #~%" (-> this cp-vec)) + (format #t "~2Tcp-next-time: ~D~%" (-> this cp-next-time)) + (format #t "~2Tcp-exit-time: ~D~%" (-> this cp-exit-time)) + (format #t "~2Tcp-force: #~%" (-> this cp-force)) + (format #t "~2Tcp-plane: #~%" (-> this cp-plane)) + (format #t "~2Tcp-factor: ~f~%" (-> this cp-factor)) + (format #t "~2Tfaction-mode: ~D~%" (-> this faction-mode)) + (format #t "~2Tattacker-info: #~%" (-> this attacker-info)) + (format #t "~2Tmission-squad: ~A~%" (-> this mission-squad)) + (format #t "~2Tprobe-counter: ~D~%" (-> this probe-counter)) + (label cfg-34) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc new file mode 100644 index 0000000000..747f9006c0 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc @@ -0,0 +1,1174 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-citizen-norm citizen-norm citizen-norm-lod0-jg -1 + ((citizen-norm-lod0-mg (meters 20)) (citizen-norm-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow citizen-norm-shadow-mg + ) + +;; definition for symbol *citizen-norm-global-info*, type civilian-global-info +(define *citizen-norm-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 18 20) + :knocked-land (new 'static 'array int32 2 19 21) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 18 20)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 24 24)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 24 24)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 24 24)) + ) + :anim-cover-head-start 26 + :anim-cover-head-loop 27 + :anim-cover-head-end 28 + :car-stance-anim 31 + :bike-stance-anim 30 + :get-in-car-anim 32 + :seat-flag #x2 + :speech-ambient 19 + :speech-alert 20 + :speech-cower 21 + :speech-touched-by-player 22 + :speech-shot-by-player 23 + :speech-avoiding-player-vehicle 24 + :speech-hit-by-player-vehicle 25 + ) + ) + +;; definition of type citizen-norm +(deftype citizen-norm (civilian) + () + (:state-methods + knocked-off-vehicle + ) + ) + +;; definition for method 3 of type citizen-norm +(defmethod inspect ((this citizen-norm)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type civilian inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *citizen-norm-nav-enemy-info*, type nav-enemy-info +(define *citizen-norm-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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 18 + :knocked-land-anim 19 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 12 + :jump-in-air-anim 12 + :jump-land-anim 12 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance (meters 10) + :notice-distance-delta (meters 0.1) + :default-hit-points 1.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 4.5) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 49152.0 + :knocked-soft-vy-lo 36864.0 + :knocked-soft-vy-hi 73728.0 + :knocked-medium-vxz-lo 81920.0 + :knocked-medium-vxz-hi 143360.0 + :knocked-medium-vy-lo 49152.0 + :knocked-medium-vy-hi 102400.0 + :knocked-hard-vxz-lo 102400.0 + :knocked-hard-vxz-hi 122880.0 + :knocked-hard-vy-lo 81920.0 + :knocked-hard-vy-hi 102400.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 16384.0 + :knocked-yellow-vxz-hi 32768.0 + :knocked-yellow-vy-lo 24576.0 + :knocked-yellow-vy-hi 49152.0 + :knocked-red-vxz-lo 40960.0 + :knocked-red-vxz-hi 61440.0 + :knocked-red-vy-lo 36864.0 + :knocked-red-vy-hi 73728.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 32768.0 + :knocked-blue-vy-hi 49152.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 1.0 :w 35283.07) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.0076 :y 0.9921 :z 0.1239) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 944.9472 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.0794 :z 0.9967 :w 32767.965) + :geo-tform (new 'static 'vector :x 0.0726 :y 0.1093 :z 0.9912 :w 32708.4) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 1220.1984 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9988 :z 0.0451 :w 2259.0806) + :geo-tform (new 'static 'vector :x -0.0157 :y 0.9998 :z -0.012 :w 34465.492) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 1045.7087 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5419 :z 0.8402 :w 415.13416) + :geo-tform (new 'static 'vector :x 0.0009 :y 0.9998 :z 0.0122 :w 34465.676) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 369.4592 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.1383 :z 0.9902 :w 15972.161) + :geo-tform (new 'static 'vector :x 0.1734 :y 0.2732 :z 0.946 :w 15088.391) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 757.3504 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.406 :z 0.9137 :w 14397.095) + :geo-tform (new 'static 'vector :x -0.8824 :y 0.419 :z 0.2128 :w 10897.436) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 943.3088 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8899 :z 0.4559 :w 9807.463) + :geo-tform (new 'static 'vector :x 0.5839 :y 0.806 :z 0.0945 :w 7551.8223) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.3207 :z -0.947 :w 15692.25) + :geo-tform (new 'static 'vector :x 0.1676 :y -0.0297 :z -0.9852 :w 16216.993) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1965 :z -0.9803 :w 16207.8545) + :geo-tform (new 'static 'vector :x -0.9965 :y -0.0765 :z -0.0291 :w 7626.661) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9981 :z -0.0585 :w 7603.1772) + :geo-tform (new 'static 'vector :x 0.9672 :y 0.0993 :z 0.2329 :w 33489.59) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :z -1.0 :w 10.15808) + :geo-tform (new 'static 'vector :x 0.2392 :y 0.0404 :z -0.9699) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 1006.3872 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :z -1.0 :w 10839.891) + :geo-tform (new 'static 'vector :x -0.253 :y -0.0825 :z 0.9637 :w 11579.046) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3032 :z 0.9528 :w 11534.791) + :geo-tform (new 'static 'vector :x 0.9808 :y -0.1876 :z 0.0501 :w 5559.5283) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9946 :z 0.1021 :w 5458.348) + :geo-tform (new 'static 'vector :x -0.8838 :y -0.4355 :z -0.1697 :w 10838.162) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9071 :z -0.4205 :w 9664.376) + :geo-tform (new 'static 'vector :x -0.8646 :y -0.4535 :z -0.2154 :w 10479.789) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 471.04 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint 13 + :pre-tform (new 'static 'vector :z 1.0 :w 10820.357) + :geo-tform (new 'static 'vector :x -0.0785 :y 0.0487 :z -0.9956 :w 9567.073) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1026 :z -0.9946 :w 9554.785) + :geo-tform (new 'static 'vector :x 0.9932 :y 0.1129 :z -0.0238 :w 4384.3403) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9987 :z -0.048 :w 4355.8506) + :geo-tform (new 'static 'vector :x -0.8653 :y 0.5006 :z 0.0132 :w 11708.225) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 758.9888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9489 :z 0.3149 :w 9987.923) + :geo-tform (new 'static 'vector :x -0.8062 :y 0.5342 :z 0.2537 :w 11107.588) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 572.2112 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 9 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0151 :w 3411.8406) + :geo-tform (new 'static 'vector :x -0.3858 :y 0.7112 :z 0.5872 :w 20326.883) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 538.624 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.4594 :z 0.888 :w 1846.4587) + :geo-tform (new 'static 'vector :x 0.2602 :y 0.8098 :z 0.5256 :w 42878.53) + :axial-slop 1758.7496 + :max-angle 3957.2275 + :coll-rad 548.864 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 12 + :turn-anim 12 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 2) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 10) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *citizen-norm-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 67 of type citizen-norm +(defmethod coin-flip? ((this citizen-norm)) + #f + ) + +;; definition for method 55 of type citizen-norm +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this citizen-norm)) + (the-as + degrees + (cond + ((logtest? (-> this flags) (citizen-flag knocked-out-car knocked-out-bike)) + ((method-of-type nav-enemy get-knockback-angle) this) + ) + (else + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-6 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-6 + (get-trans a0-6 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f30-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) + (vector-negate-in-place! s5-1) + ) + (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f1-2 (deg- f30-0 f28-0)) + (f2-0 (fabs f1-2)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) + ) + (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) + (set! f30-0 (+ (cond + ((< f2-0 16384.0) + (if (>= f1-2 0.0) + f0-8 + (- f0-8) + ) + ) + ((>= f1-2 0.0) + (- 32768.0 f0-8) + ) + (else + (+ -32768.0 f0-8) + ) + ) + f28-0 + ) + ) + (if (< f30-0 0.0) + (set! f30-0 (+ 65536.0 f30-0)) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + ) + ) + ) + +;; definition for method 87 of type citizen-norm +(defmethod knocked-anim-handler ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-0 (ja-done? 0))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + (when s5-0 + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + ) + (set! (-> a0-6 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-6 param 1) (-> arg1 anim-speed)) + (set! (-> a0-6 frame-num) 3.0) + (joint-control-channel-group! + a0-6 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + num-func-seek! + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +;; definition for method 85 of type citizen-norm +(defmethod knocked-anim ((this citizen-norm) (arg0 enemy-knocked-info)) + (local-vars (v1-36 knocked-type)) + (cond + ((logtest? (-> this flags) (citizen-flag knocked-out-car)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) + ) + (logclear! (-> this flags) (citizen-flag knocked-out-car)) + ) + ((logtest? (-> this flags) (citizen-flag knocked-out-bike)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 34))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 34)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 34)) num-func-seek!) + ) + (logclear! (-> this flags) (citizen-flag knocked-out-bike)) + ) + ((begin (set! v1-36 (-> this incoming knocked-type)) (= v1-36 (knocked-type yellow-shot))) + (ja-channel-push! 1 (seconds 0.1)) + (let* ((a2-2 (ash 1 (-> this info prev-yellow-hit))) + (v1-39 (enemy-method-131 this 1 a2-2)) + (a1-11 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-39 8)) (the-as uint (-> this info)))) + yellow-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-yellow-hit) v1-39) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim a1-11)) + (set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) + (set! (-> a0-21 param 1) (-> arg0 anim-speed)) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim a1-11) num-func-seek!) + ) + ) + ) + ((= v1-36 (knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-4 (ash 1 (-> this info prev-blue-hit))) + (v1-48 (enemy-method-131 this 3 a2-4)) + (a1-18 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-48 8)) (the-as uint (-> this info)))) + blue-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-blue-hit) v1-48) + (let ((a0-36 (-> this skel root-channel 0))) + (set! (-> a0-36 frame-group) (the-as art-joint-anim a1-18)) + (set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-18) frames num-frames) -1))) + (set! (-> a0-36 param 1) 1.0) + (set! (-> a0-36 frame-num) 0.0) + (joint-control-channel-group! a0-36 (the-as art-joint-anim a1-18) num-func-seek!) + ) + ) + ) + (else + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (if (or (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (= (-> this incoming knocked-type) (knocked-type dark-shot)) + ) + (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + ) + (let ((a0-47 (-> this skel root-channel 0))) + (set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-47 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-47 param 1) (-> arg0 anim-speed)) + (set! (-> a0-47 frame-num) 0.0) + (joint-control-channel-group! a0-47 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + ) + #t + ) + +;; definition for method 86 of type citizen-norm +(defmethod knocked-land-anim ((this citizen-norm) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> arg0 anim-speed) 1.0) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + ) + (set! (-> a0-2 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! + a0-2 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + num-func-seek! + ) + ) + #t + ) + +;; failed to figure out what this is: +(defstate knocked (citizen-norm) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (the-as collide-shape-prim-group (-> self root root-prim)))) + (logior! (-> v1-5 child 0 prim-core action) (collide-action no-standon)) + (logclear! (-> v1-5 child 1 prim-core action) (collide-action no-standon)) + (set! (-> v1-5 child 1 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate get-up-front (citizen-norm) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-front) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-back (citizen-norm) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-back) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait (citizen-norm) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (until #f + (let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0))) + (gp-0 (rand-vu-int-range 1 5)) + (s5-0 (rand-vu-int-count 2)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (if (zero? s5-0) + (ja-no-eval :group! citizen-norm-idle-to-arms-hips-ja :num! min) + (ja-no-eval :group! citizen-norm-idle-to-arms-crossed-ja :num! min) + ) + (let ((f28-0 0.0)) + (while (< f28-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f28-0 f28-0 f28-0) (* 3.0 f28-0 f28-0)) 0.0 1.0) + ) + (suspend) + (+! f28-0 (seconds-per-frame)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (while (> gp-0 0) + (+! gp-0 -1) + (cond + ((zero? s5-0) + (ja-no-eval :group! citizen-norm-arms-hips-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (else + (ja-no-eval :group! citizen-norm-arms-crossed-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + ) + ) + (if (-> self wait-return-state) + (go (-> self wait-return-state)) + ) + ) + #f + ) + ) + +;; definition for method 212 of type citizen-norm +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod go-from-behavior ((this citizen-norm) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((11) + (speech-control-method-12 *speech-control* this (speech-type civ-m-player-stealing-vehicle)) + (set! (-> this root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> this root quat) (-> arg0 rotation)) + (set! (-> this vehicle) (-> arg0 handle)) + (ja-channel-set! 1) + (case (-> (the-as vehicle (handle->process (-> this vehicle))) info object-type) + (((traffic-type civilian-bike-a) (traffic-type civilian-bike-b) (traffic-type civilian-bike-c)) + (logior! (-> this flags) (citizen-flag knocked-out-bike)) + (let ((v1-16 (-> this skel root-channel 0))) + (set! (-> v1-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) + ) + ) + (((traffic-type civilian-car-a) (traffic-type civilian-car-b) (traffic-type civilian-car-c)) + (logior! (-> this flags) (citizen-flag knocked-out-car)) + (let ((v1-22 (-> this skel root-channel 0))) + (set! (-> v1-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) + ) + ) + ) + (ja-post) + (setup-masks (-> this draw) 0 -1) + (let ((s5-1 (-> arg0 user-data))) + (if (not (logtest? s5-1 32)) + (setup-masks (-> this draw) 32 0) + ) + (if (not (logtest? s5-1 16)) + (setup-masks (-> this draw) 16 0) + ) + (if (not (logtest? s5-1 2)) + (setup-masks (-> this draw) 2 0) + ) + (if (not (logtest? s5-1 4096)) + (setup-masks (-> this draw) 8192 0) + ) + (if (not (logtest? s5-1 8)) + (setup-masks (-> this draw) 8 0) + ) + (if (not (logtest? s5-1 512)) + (setup-masks (-> this draw) 1024 0) + ) + (if (not (logtest? s5-1 #x4000)) + (setup-masks (-> this draw) #x8000 0) + ) + (if (not (logtest? s5-1 4)) + (setup-masks (-> this draw) 4 0) + ) + (if (not (logtest? s5-1 256)) + (setup-masks (-> this draw) 512 0) + ) + (if (not (logtest? s5-1 8192)) + (setup-masks (-> this draw) #x4000 0) + ) + (if (not (logtest? s5-1 64)) + (setup-masks (-> this draw) 128 0) + ) + (if (not (logtest? s5-1 2048)) + (setup-masks (-> this draw) 4096 0) + ) + (if (not (logtest? #x10000 s5-1)) + (setup-masks (-> this draw) #x20000 0) + ) + (if (not (logtest? s5-1 128)) + (setup-masks (-> this draw) 256 0) + ) + (if (logtest? #x40000 s5-1) + (setup-masks (-> this draw) 2048 0) + (setup-masks (-> this draw) 2048 0) + ) + ) + (go (method-of-object this knocked-off-vehicle)) + ) + (else + ((method-of-type civilian go-from-behavior) this arg0) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate knocked-off-vehicle (citizen-norm) + :virtual #t + :event enemy-event-handler + :enter (behavior () + '() + ) + :code (behavior () + (suspend) + (citizen-method-206 self) + ) + ) + +;; definition for method 120 of type citizen-norm +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this citizen-norm)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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) 4096.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type citizen-norm +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this citizen-norm)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *citizen-norm-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (try-update-focus (-> this focus) *target* this) + (-> this neck) + (set! (-> this info) *citizen-norm-global-info*) + (set! (-> this anim-shuffle) 11) + (let ((v1-18 (rnd-int this 3))) + (cond + ((zero? v1-18) + (set! (-> this anim-walk) 12) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 10240.0) + ) + ((= v1-18 1) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 2) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 4370.432) + (set! (-> this speed-walk) 4096.0) + ) + ) + ) + (let ((v1-33 (rnd-int this 3))) + (cond + ((zero? v1-33) + (set! (-> this anim-panic-run) 15) + ) + ((= v1-33 1) + (set! (-> this anim-panic-run) 15) + ) + ((= v1-33 2) + (set! (-> this anim-panic-run) 14) + ) + ) + ) + (set! (-> this dist-run-anim) 28672.0) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (set! (-> this anim-run) 14) + ) + ((= v1-40 1) + (set! (-> this anim-run) 14) + ) + ((= v1-40 2) + (set! (-> this anim-run) 14) + ) + ) + ) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 17) + (set! (-> this anim-dive) 16) + (set! (-> this anim-get-up-front) 22) + (set! (-> this anim-get-up-back) 23) + (let ((f30-0 (rnd-float-range this 1.0 1.25)) + (f0-11 (rnd-float-range this 1.0 1.25)) + ) + (set-vector! (-> this root scale) f0-11 f30-0 f0-11 1.0) + ) + (let ((f0-13 (rnd-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-13 f0-13 f0-13 1.0) + ) + (set! (-> this water-anim) 29) + 0 + (none) + ) + +;; definition for method 194 of type citizen-norm +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this citizen-norm)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (set! (-> this dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 32 0) + (let ((v1-10 (rnd-int this 4))) + (cond + ((zero? v1-10) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-10 1) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-10 2) + (setup-masks (-> this draw) #x10000 0) + ) + ((= v1-10 3) + (setup-masks (-> this draw) #x200000 0) + ) + ) + ) + (let ((v1-21 (rnd-int this 3))) + (cond + ((zero? v1-21) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-21 1) + (setup-masks (-> this draw) 8192 0) + ) + ((= v1-21 2) + (setup-masks (-> this draw) #x40000 0) + ) + ) + ) + (let ((v1-30 (rnd-int this 4))) + (cond + ((zero? v1-30) + (setup-masks (-> this draw) 8 0) + ) + ((= v1-30 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-30 2) + (setup-masks (-> this draw) #x8000 0) + ) + ((= v1-30 3) + (setup-masks (-> this draw) #x100000 0) + ) + ) + ) + (let ((v1-41 (rnd-int this 5))) + (cond + ((zero? v1-41) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-41 1) + (setup-masks (-> this draw) 512 0) + ) + ((= v1-41 2) + (setup-masks (-> this draw) #x4000 0) + ) + ((= v1-41 3) + (setup-masks (-> this draw) #x80000 0) + ) + ) + ) + (let ((v1-52 (rnd-int this 4))) + (cond + ((zero? v1-52) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-52 1) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-52 2) + (setup-masks (-> this draw) #x20000 0) + ) + ((= v1-52 3) + (setup-masks (-> this draw) #x400000 0) + ) + ) + ) + (setup-masks (-> this draw) 16 0) + (let ((v1-65 (rnd-int this 4))) + (cond + ((zero? v1-65) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-65 1) + (setup-masks (-> this draw) #x800000 0) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc new file mode 100644 index 0000000000..4126fbcdfe --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc @@ -0,0 +1,1949 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *citizen-debug*, type symbol +(define *citizen-debug* #f) + +;; definition for method 193 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod set-squad ((this citizen)) + (set! (-> this squad) #f) + 0 + (none) + ) + +;; definition for method 195 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-195 ((this citizen)) + (let ((v1-0 (-> this nav))) + (logclear! (-> v1-0 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) + (let ((a1-6 v1-0)) + (set! (-> a1-6 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + (let ((a1-8 v1-0)) + (set! (-> a1-8 nav-cull-radius) 12288.0) + ) + 0 + (logclear! (-> v1-0 flags) (nav-control-flag output-sphere-hash)) + ) + (set! (-> this enemy-info callback-info) *physics-nav-callback-info*) + (let ((v1-2 this)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + 0 + (none) + ) + +;; definition for method 194 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this citizen)) + (remove-from-process *part-engine* this) + (set! (-> this faction-mode) (the-as uint 0)) + (logior! (-> this fact enemy-options) (enemy-option knocked-into-water)) + (if (-> this skel effect) + (logclear! (-> this skel effect flags) (effect-control-flag ecf2)) + ) + (set! (-> this draw death-draw-overlap) (the-as uint 0)) + (set! (-> this draw death-timer) (the-as uint 0)) + (set! (-> this draw death-timer-org) (the-as uint 0)) + (set! (-> this draw death-vertex-skip) (the-as uint 0)) + (set! (-> this draw death-effect) (the-as uint 0)) + (logclear! (-> this focus-status) (focus-status disable dead inactive hit)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (clear-focused (-> this focus)) + (logand! (-> this enemy-flags) (enemy-flag drawn-mirrored)) + (logclear! (-> this draw status) (draw-control-status no-draw lod-set)) + (set! (-> this draw death-timer) (the-as uint 0)) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let ((v1-29 (-> this root root-prim))) + (set! (-> v1-29 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-29 prim-core collide-with) (-> this root backup-collide-with)) + ) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (enemy-setup-gem) + (logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this enemy-flags) (enemy-flag trackable trackable-backup)) + (logior! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) + (set! (-> this fated-time) 0) + (set! (-> this probe-counter) (the-as uint 0)) + (set! (-> this hit-by-player-count) 0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 0.0 0.0 1.0) + (update-transforms (-> this root)) + (citizen-method-215 this) + 0 + (none) + ) + +;; definition for method 64 of type citizen +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod update-awareness! ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) + (when arg1 + (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans)))) + (when (< f0-0 (-> arg1 rating)) + (set! (-> arg1 rating) f0-0) + (set! (-> arg1 proc) arg0) + (set! (-> arg1 aware) (enemy-aware ea3)) + ) + ) + ) + (the-as enemy-aware 3) + ) + +;; definition for method 68 of type citizen +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod get-enemy-aware ((this citizen) (arg0 enemy-aware)) + (the-as enemy-aware 3) + ) + +;; definition for method 75 of type citizen +(defmethod go-stare ((this citizen)) + (go (method-of-object this flee)) + ) + +;; definition for method 78 of type citizen +;; WARN: Return type mismatch none vs object. +(defmethod go-hostile ((this citizen)) + (go-inactive this) + ) + +;; definition for method 79 of type citizen +(defmethod go-flee ((this citizen)) + (go (method-of-object this flee)) + ) + +;; definition for method 80 of type citizen +(defmethod go-best-state ((this citizen)) + (go (method-of-object this active)) + ) + +;; definition for method 65 of type citizen +(defmethod penetrate->next-state ((this citizen) (arg0 process) (arg1 event-message-block) (arg2 float)) + (if (logtest? (penetrate jak-dark-nuke) (-> this incoming penetrate-using)) + 'traffic-off-force + (call-parent-method this arg0 arg1 arg2) + ) + ) + +;; definition for method 81 of type citizen +;; WARN: Return type mismatch none vs object. +(defmethod go-die ((this citizen)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (go-inactive this) + ) + +;; definition for method 17 of type citizen +(defmethod cleanup-for-death ((this citizen)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (go-inactive this) + (none) + ) + +;; definition for method 196 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod go-inactive ((this citizen)) + (cond + ((and (-> this mission-squad) (-> this attacker-info)) + (remove-attacker (-> this mission-squad) (-> this attacker-info)) + (set! (-> this attacker-info) #f) + (set! (-> this mission-squad) #f) + ) + (else + ) + ) + (vehicle-controller-method-11 (-> this controller)) + (logclear! (-> this flags) (citizen-flag persistent in-formation)) + (set! (-> this vehicle) (the-as handle #f)) + (let ((s5-0 (-> this child))) + (while s5-0 + (send-event (ppointer->process s5-0) 'notice 'die) + (set! s5-0 (-> s5-0 0 brother)) + ) + ) + (set! (-> this shield-handle) (the-as handle #f)) + (logior! (-> this focus-status) (focus-status inactive)) + (set! (-> this event-hook) (-> (method-of-object this inactive) event)) + (go (method-of-object this inactive)) + 0 + (none) + ) + +;; definition for method 63 of type citizen +(defmethod enemy-method-63 ((this citizen) (arg0 float)) + (let ((v0-1 (call-parent-method this arg0))) + (when (and (logtest? (-> this incoming penetrate-using) (penetrate board)) + (not (logtest? (-> this incoming penetrate-using) (penetrate spin))) + ) + (let ((v1-6 (handle->process (-> this incoming attacker-handle)))) + (when (= (-> (the-as target v1-6) type) target) + (cond + ((and (-> this next-state) (let ((a0-14 (-> this next-state name))) + (or (= a0-14 'get-up-front) (= a0-14 'get-up-back) (= a0-14 'knocked)) + ) + ) + (set! v0-1 0.000000000000000000000000000000000000000000001) + ) + ((and (logtest? (-> (the-as target v1-6) control mod-surface flags) (surface-flag air)) + (not (logtest? (-> (the-as target v1-6) control status) (collide-status on-surface))) + ) + (set! v0-1 0.0) + ) + ) + ) + ) + ) + v0-1 + ) + ) + +;; definition for method 210 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-210 ((this citizen) (arg0 int) (arg1 process)) + (let ((a0-1 (-> this squad))) + (when (and a0-1 arg1) + (if #t + (squad-control-method-18 a0-1 arg0 arg1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 211 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod set-alert-level ((this citizen) (arg0 int)) + (let ((a0-1 (-> this squad))) + (if a0-1 + (set-alert-level0 a0-1 arg0) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type citizen +(defmethod get-inv-mass ((this citizen)) + 1.0 + ) + +;; definition for method 197 of type citizen +(defmethod find-segment ((this citizen) (arg0 vector) (arg1 vector)) + (find-best-segment (-> this controller traffic) arg0 arg1 1) + ) + +;; definition for method 198 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod nav-segment-callback ((this citizen) + (arg0 vector) + (arg1 traffic-find-segment-struct) + (arg2 (function traffic-find-segment-struct nav-segment none)) + ) + (callback-on-nav-segments-in-sphere (-> this controller traffic) arg0 1 arg1 arg2) + 0 + (none) + ) + +;; definition for method 199 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-199 ((this citizen) (arg0 nav-segment)) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-controller-method-13 (-> this controller) (-> arg0 branch) (the-as vector (-> arg0 vertex))) + 0 + (none) + ) + +;; definition for method 200 of type citizen +(defmethod citizen-method-200 ((this citizen)) + (let* ((v1-0 (-> this controller)) + (gp-1 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 turn-exit-point) (-> v1-0 path-prev-point))) + (s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> v1-0 turn-exit-point))) + ) + (set! (-> s5-1 y) 0.0) + (set! (-> gp-1 y) 0.0) + (vector-xz-normalize! gp-1 1.0) + (< -16384.0 (vector-dot s5-1 gp-1)) + ) + ) + +;; definition for method 212 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod go-from-behavior ((this citizen) (arg0 traffic-object-spawn-params)) + (let ((v1-0 (-> arg0 behavior))) + (cond + ((zero? v1-0) + (go (method-of-object this idle)) + ) + ((= v1-0 2) + (go (method-of-object this active)) + ) + ((= v1-0 3) + (go (method-of-object this hostile)) + ) + (else + (go-inactive this) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 82 of type citizen +;; INFO: Used lq/sq +;; WARN: disable def twice: 164. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-3 object)) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (let ((v1-1 #f)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) + (knocked-type blue-shot) + (knocked-type red-shot) + (knocked-type explode-or-darkjak) + ) + (set! v1-1 #t) + ) + (((knocked-type none)) + (+! (-> this hit-by-player-count) 1) + (set! v1-1 (>= (-> this hit-by-player-count) 2)) + ) + ) + (when v1-1 + (let* ((s5-0 (handle->process (-> this incoming attacker-handle))) + (a2-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if a2-5 + (citizen-method-210 this 1 a2-5) + ) + ) + ) + ) + (freeze-hit-begin) + (go (method-of-object this knocked)) + ) + (('traffic-off) + (if (not (logtest? (-> this flags) (citizen-flag persistent))) + (go-inactive this) + ) + ) + (('formation-set-destination) + (when (and (-> this next-state) (let ((v1-20 (-> this next-state name))) + (or (= v1-20 'active) (= v1-20 'wait)) + ) + ) + (let ((v1-21 (the-as object (-> arg3 param 0))) + (a0-20 (-> this nav state)) + ) + (logclear! (-> a0-20 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-20 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-20 target-pos quad) (-> (the-as vector v1-21) quad)) + ) + 0 + (if (and (and (-> this next-state) (= (-> this next-state name) 'wait)) (-> this wait-return-state)) + (go (-> this wait-return-state)) + ) + ) + ) + (('formation-exit) + (logclear! (-> this flags) (citizen-flag in-formation)) + (set! (-> this vehicle) (the-as handle #f)) + #f + ) + (('go-invulnerable) + (set! v0-3 (logclear (-> this enemy-flags) (enemy-flag vulnerable))) + (set! (-> this enemy-flags) (the-as enemy-flag v0-3)) + v0-3 + ) + (('go-vulnerable) + (when (not (and (-> this next-state) + (let ((v1-36 (-> this next-state name))) + (or (= v1-36 'inactive) (= v1-36 'dying) (= v1-36 'die-falling) (= v1-36 'die-fast)) + ) + ) + ) + (set! v0-3 (logior (-> this enemy-flags) (enemy-flag vulnerable))) + (set! (-> this enemy-flags) (the-as enemy-flag v0-3)) + v0-3 + ) + ) + (('impact-impulse) + #f + ) + (('traffic-off-force) + (go-inactive this) + ) + (('traffic-activate) + (if (not (focus-test? this inactive)) + (return #f) + ) + (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (let ((s5-1 (the-as traffic-object-spawn-params (-> arg3 param 0)))) + (cond + ((logtest? (-> s5-1 flags) (traffic-spawn-flags tsf4)) + (logior! (-> this flags) (citizen-flag in-formation)) + (set! (-> this vehicle) (-> s5-1 handle-parent)) + (set! (-> this formation-index) (the-as int (-> s5-1 user-data))) + (set! (-> this speed-scale) 1.0) + ) + (else + (logclear! (-> this flags) (citizen-flag in-formation)) + (set! (-> this speed-scale) (rnd-float-range this 0.9 1.1)) + ) + ) + (if (logtest? (-> s5-1 flags) (traffic-spawn-flags tsf7)) + (logior! (-> this flags) (citizen-flag in-mission)) + (logclear! (-> this flags) (citizen-flag in-mission)) + ) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (set! (-> this root trans quad) (-> s5-1 position quad)) + (quaternion-copy! (-> this root quat) (-> s5-1 rotation)) + (set! (-> this root transv quad) (-> s5-1 velocity quad)) + (let ((a0-46 (-> s5-1 nav-mesh))) + (when a0-46 + (change-to a0-46 this) + (if (not (-> this nav)) + (go-inactive this) + ) + (let ((v1-77 (-> this nav state))) + (set! (-> v1-77 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a1-20 (-> s5-1 nav-branch))) + (when a1-20 + (vehicle-controller-method-13 (-> this controller) a1-20 (-> this root trans)) + (let ((a0-50 (-> this nav state)) + (v1-84 (-> this dest-point)) + ) + (logclear! (-> a0-50 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-50 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-50 target-pos quad) (-> v1-84 quad)) + ) + 0 + ) + ) + (citizen-method-195 this) + (citizen-method-194 this) + (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (set! (-> this gnd-height) (-> this root gspot-pos y)) + (go-from-behavior this s5-1) + ) + ) + ) + ) + (('nav-mesh-kill) + (remove-process-drawable (-> this nav state mesh) this) + (set! (-> this nav) #f) + (go-inactive this) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 213 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-213 ((this citizen)) + (set! (-> this root transv x) 0.0) + (set! (-> this root transv z) 0.0) + (when (-> this enemy-info move-to-ground) + (if (focus-test? this under-water) + (accelerate-fall! this (-> this root transv)) + (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) + ) + ) + (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) + (let ((v1-15 (-> this enemy-info))) + (set! (-> a2-0 gnd-collide-with) (-> this gnd-collide-with)) + (set! (-> a2-0 popup) 8192.0) + (set! (-> a2-0 dont-move-if-overlaps?) #t) + (set! (-> a2-0 hover-if-no-ground?) (-> v1-15 hover-if-no-ground)) + (set! (-> a2-0 overlaps-params options) (overlaps-others-options oo0 oo2)) + (set! (-> a2-0 overlaps-params collide-with-filter) (-> v1-15 overlaps-others-collide-with-filter)) + ) + (set! (-> a2-0 overlaps-params tlist) *touching-list*) + (-> a2-0 overlaps-params) + (move-above-ground! this (-> this root transv) a2-0) + ) + 0 + (none) + ) + +;; definition for method 59 of type citizen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod enemy-common-post ((this citizen)) + (with-pp + (when (and (not (logtest? (-> this flags) (citizen-flag in-mission))) + *cty-faction-manager* + (and (or (not (-> this draw)) + (not (logtest? (-> this draw status) (draw-control-status on-screen))) + (let ((f0-0 450560.0)) + (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> this root trans) (math-camera-pos))) + ) + ) + (nonzero? (-> this controller branch)) + (or (not (cty-faction-manager-method-23 *cty-faction-manager* (the-as uint (-> this controller branch clock-mask))) + ) + (not (logtest? (cty-faction-manager-method-9 + *cty-faction-manager* + (the-as int (-> this controller branch clock-type)) + (-> pp level name) + ) + 1 + ) + ) + ) + ) + ) + (format + 0 + "Going inactive (~s). Terr ~d, level ~s~%" + (-> this name) + (-> this controller branch clock-type) + (-> pp level name) + ) + (go-inactive this) + ) + (+! (-> this probe-counter) 1) + (when (< (-> this next-time-look-at) (current-time)) + (when (and (nonzero? (-> this neck)) (not (logtest? (-> this flags) (citizen-flag neck-no-auto-look-at)))) + (let ((a0-11 (the-as process-focusable (handle->process (-> this focus handle)))) + (s5-3 (new 'stack-no-clear 'vector)) + ) + (cond + (a0-11 + (set! (-> s5-3 quad) (-> (get-trans a0-11 2) quad)) + ) + (*target* + (set! (-> s5-3 quad) (-> (get-trans *target* 2) quad)) + ) + (else + (set! (-> s5-3 quad) (-> (camera-pos) quad)) + ) + ) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (set! (-> s5-3 quad) (-> this danger-pos quad)) + ) + (when (< (vector-vector-distance s5-3 (-> this root trans)) 122880.0) + (set-look-at-mode! this 1) + (target-set! (-> this neck) s5-3) + ) + ) + (when (< (-> this stop-time-look-at) (current-time)) + (shut-down (-> this neck)) + (set! (-> this next-time-look-at) (+ (current-time) (the int (* 300.0 (rnd-float-range this 0.0 20.0))))) + (set! (-> this stop-time-look-at) + (+ (-> this next-time-look-at) (the int (* 300.0 (rnd-float-range this 5.0 10.0)))) + ) + ) + ) + ) + (let ((a0-26 (-> this enemy-flags))) + (when (and (logtest? a0-26 (enemy-flag auto-reset-penetrate)) + (time-elapsed? (-> this auto-reset-penetrate-time) (seconds 0.1)) + ) + (set! (-> this enemy-flags) (logclear a0-26 (enemy-flag auto-reset-penetrate))) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (let ((v1-84 0)) + (if (logtest? (penetrate knocked) (-> this root penetrate-using)) + (set! v1-84 (logior (shl 2 32) v1-84)) + ) + (set! (-> this root penetrate-using) (the-as penetrate v1-84)) + ) + ) + ) + (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) + (set-time! (-> this last-draw-time)) + ) + (let ((s5-6 (-> this draw shadow-ctrl))) + (when (!= *nav-enemy-dummy-shadow-control* s5-6) + (let ((f0-10 (vector-vector-distance (camera-pos) (-> this root trans)))) + (cond + ((< 163840.0 f0-10) + (logior! (-> s5-6 settings flags) (shadow-flags disable-draw)) + 0 + ) + ((not (handle->process (-> this ragdoll-proc))) + (let ((v1-104 s5-6)) + (logclear! (-> v1-104 settings flags) (shadow-flags disable-draw)) + ) + 0 + (let* ((f0-11 (lerp-scale 0.0 1.0 f0-10 163840.0 40960.0)) + (f0-14 (fmax 0.01 (+ (* -2.0 f0-11 f0-11 f0-11) (* 3.0 f0-11 f0-11)))) + ) + (set! (-> s5-6 settings shadow-dir w) (* 614400.0 f0-14)) + ) + ) + ) + ) + ) + ) + (when (logtest? (enemy-flag check-water checking-water) (-> this enemy-flags)) + (check-water this) + (when (and (focus-test? this touch-water) (< (-> this root trans y) (+ -11468.8 (-> this water-surface-height)))) + (set! (-> this root trans y) (+ -11468.8 (-> this water-surface-height))) + (if (not (and (-> this next-state) (= (-> this next-state name) 'in-ditch))) + (go (method-of-object this in-ditch)) + ) + ) + ) + (ja-post) + 0 + (none) + ) + ) + +;; definition for method 139 of type citizen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod move-above-ground! ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> this root))) + (set! (-> arg1 on-ground?) #f) + (set! (-> arg1 do-move?) #t) + (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) + (set! (-> arg1 old-gspot-normal quad) (-> gp-0 gspot-normal quad)) + (set! (-> gp-0 trans-old-old-old quad) (-> gp-0 trans-old-old quad)) + (set! (-> gp-0 trans-old-old quad) (-> gp-0 trans-old quad)) + (set! (-> gp-0 trans-old quad) (-> gp-0 trans quad)) + (set! (-> gp-0 prev-status) (-> gp-0 status)) + (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) + (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) + (when (not (logtest? (logxor (-> this traffic-id) (the-as int (-> this probe-counter))) 7)) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (logclear! (-> gp-0 status) (collide-status on-ground)) + (let* ((a0-10 this) + (t9-1 (method-of-object a0-10 enemy-above-ground?)) + (a1-2 s2-0) + (a2-2 (new 'stack-no-clear 'vector)) + ) + (let ((v1-15 (-> gp-0 trans))) + (let ((a3-0 (-> gp-0 transv))) + (let ((t0-1 0.15)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a3-0 quad)) + ) + (.lvf vf4 (&-> v1-15 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 (&-> a2-2 quad) vf6) + (when (t9-1 a0-10 a1-2 a2-2 (-> arg1 gnd-collide-with) 16384.0 81920.0 1024.0) + (set! (-> gp-0 gspot-pos quad) (-> gp-0 trans quad)) + (set! (-> gp-0 gspot-pos y) (-> s2-0 best-other-tri intersect y)) + (set! (-> gp-0 gspot-normal quad) (-> s2-0 best-other-tri normal quad)) + (logior! (-> gp-0 status) (collide-status on-ground)) + (set! (-> gp-0 ground-pat) (-> s2-0 best-other-tri pat)) + ) + ) + ) + (set! (-> this gnd-height) (-> gp-0 gspot-pos y)) + (set! (-> gp-0 gspot-pos y) (-> arg1 old-gspot-pos y)) + ) + (let ((f0-5 (- (-> this gnd-height) (-> gp-0 gspot-pos y)))) + (cond + ((< 0.0 f0-5) + (+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5)) + ) + (else + (+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5)) + (if (< (-> gp-0 gspot-pos y) (-> this gnd-height)) + (set! (-> gp-0 gspot-pos y) (-> this gnd-height)) + ) + ) + ) + ) + (set! (-> arg1 on-ground?) #t) + (set! (-> arg1 pat) (-> gp-0 ground-pat)) + (when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y)) + (set! (-> arg1 new-pos y) (-> gp-0 gspot-pos y)) + (set! (-> gp-0 ground-impact-vel) (- (vector-dot arg0 (-> gp-0 dynam gravity-normal)))) + (set! (-> arg0 y) 0.0) + ) + (set! (-> gp-0 trans quad) (-> arg1 new-pos quad)) + (when (-> arg1 do-move?) + (cond + ((-> arg1 on-ground?) + (let ((a1-3 (-> gp-0 gspot-pos)) + (a0-18 (-> gp-0 gspot-normal)) + (v1-42 (-> arg1 pat)) + ) + (set! (-> gp-0 ground-touch-point quad) (-> a1-3 quad)) + (set! (-> gp-0 poly-normal quad) (-> a0-18 quad)) + (set! (-> gp-0 surface-normal quad) (-> a0-18 quad)) + (set! (-> gp-0 local-normal quad) (-> a0-18 quad)) + (set! (-> gp-0 ground-poly-normal quad) (-> a0-18 quad)) + (set! (-> gp-0 poly-pat) v1-42) + (set! (-> gp-0 cur-pat) v1-42) + (set! (-> gp-0 ground-pat) v1-42) + ) + (logior! (-> gp-0 status) (collide-status on-surface on-ground touch-surface)) + ) + (else + (logclear! (-> gp-0 status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> gp-0 root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-52 (-> gp-0 dynam gravity-normal))) + (set! (-> gp-0 local-normal quad) (-> v1-52 quad)) + (set! (-> gp-0 surface-normal quad) (-> v1-52 quad)) + (set! (-> gp-0 poly-normal quad) (-> v1-52 quad)) + ) + (set! (-> gp-0 coverage) 0.0) + (set! (-> gp-0 touch-angle) 0.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 160 of type citizen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod normalize-heading! ((this citizen) (arg0 nav-control)) + (let ((t9-0 (method-of-object this citizen-method-214)) + (v1-1 arg0) + (a3-0 (-> arg0 state)) + (a2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (t9-0 this v1-1 a2-0) + ) + 0 + (none) + ) + +;; definition for method 214 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-214 ((this citizen) (arg0 nav-control) (arg1 vector)) + (set! (-> arg1 y) 0.0) + (vector-normalize! arg1 1.0) + (let ((gp-0 (new 'stack-no-clear 'quaternion)) + (s5-1 (-> this root quat)) + ) + (quaternion-set! gp-0 0.0 (-> arg1 x) 0.0 (+ 1.0 (-> arg1 z))) + (quaternion-normalize! gp-0) + (quaternion-smooth-seek! + s5-1 + s5-1 + gp-0 + (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + ) + ) + 0 + (none) + ) + +;; definition for method 187 of type citizen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-187 ((this citizen)) + (nav-enemy-method-188 this) + (let ((a0-2 this)) + (when (logtest? (enemy-flag ef37) (-> a0-2 enemy-flags)) + (cond + ((logtest? (enemy-flag ef39) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) + (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (set! (-> this gnd-height) (-> this root gspot-pos y)) + ) + (else + (normalize-heading! this (-> this nav)) + (nav-enemy-method-161 this (-> this nav)) + ) + ) + ) + ) + (enemy-common-post this) + (update-transforms (-> this root)) + 0 + (none) + ) + +;; definition for method 122 of type citizen +;; WARN: Return type mismatch int vs object. +(defmethod go-idle2 ((this citizen)) + (go (method-of-object this active)) + 0 + ) + +;; definition for method 119 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-defaults! ((this citizen) (arg0 nav-enemy-info)) + (set-squad this) + (if (not (-> this squad)) + (format 0 "citizen::initialize-enemy: error: no squad-control~%") + ) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) + (let ((t9-2 (method-of-type nav-enemy init-enemy-defaults!))) + (t9-2 this arg0) + ) + (set! (-> this speed-scale) (rnd-float-range this 0.9 1.1)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (vehicle-controller-method-9 (-> this controller)) + (citizen-method-194 this) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) + ) + (set! (-> this travel-anim-scale-speed) 1.0) + 0 + (none) + ) + +;; definition for method 11 of type citizen +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this citizen) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; definition for function citizen-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defbehavior citizen-init-by-other citizen ((arg0 traffic-object-spawn-params)) + (stack-size-set! (-> self main-thread) 512) + (logclear! (-> self mask) (process-mask enemy)) + (init-enemy-collision! self) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 rotation)) + (if (not (logtest? (-> arg0 flags) (traffic-spawn-flags tsf0))) + (traffic-entity-hack (-> arg0 object-type)) + ) + (set! (-> self vehicle) (-> arg0 handle)) + (set! (-> self interp) 0.0) + (logclear! (-> self flags) (citizen-flag run-mode)) + (logclear! (-> self flags) (citizen-flag shuffle-mode)) + (set! (-> self shield-handle) (the-as handle #f)) + (if (logtest? (-> arg0 flags) (traffic-spawn-flags tsf3)) + (logior! (-> self flags) (citizen-flag dark-guard)) + ) + (set! (-> self attacker-info) #f) + (set! (-> self mission-squad) #f) + (init-enemy! self) + (set! (-> self traffic-id) (the-as int (-> arg0 id))) + (go-inactive self) + ) + +;; definition for method 209 of type citizen +(defmethod get-run-anim ((this citizen)) + (-> this anim-run) + ) + +;; definition for function citizen-travel-anim +;; WARN: new jak 2 until loop case, check carefully +(defbehavior citizen-travel-anim citizen ((arg0 int) (arg1 int)) + (local-vars (f28-0 float)) + (logclear! (-> self flags) (citizen-flag shuffle-mode)) + (logclear! (-> self flags) (citizen-flag run-mode)) + (let ((v1-6 (ja-group))) + (when (not (and v1-6 (= v1-6 (-> self draw art-group data (-> self anim-walk))))) + (ja-channel-push! 2 (the-as time-frame arg1)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-walk)) + :num! (loop!) + :dist (-> self dist-walk-anim) + :frame-num (ja-aframe 4.0 0) + ) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-3 (-> self interp))) + (set! (-> gp-1 frame-interp 1) f0-3) + (set! (-> gp-1 frame-interp 0) f0-3) + ) + (set! (-> gp-1 dist) (-> self dist-run-anim)) + (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data (get-run-anim self)))) + (set! (-> gp-1 param 0) 0.0) + (joint-control-channel-group! + gp-1 + (the-as art-joint-anim (-> self draw art-group data (get-run-anim self))) + num-func-chan + ) + ) + ) + ) + (until #f + (let ((f30-0 (-> self nav state speed))) + (lerp-scale 0.0 1.0 f30-0 (-> self speed-walk) (-> self speed-run)) + (set! f28-0 + (cond + ((< f30-0 4096.0) + (cond + ((logtest? (-> self flags) (citizen-flag shuffle-mode)) + (set! f28-0 1.0) + (ja :chan 1 :group! (-> self draw art-group data (-> self anim-shuffle)) :dist 4096.0) + ) + (else + (set! f28-0 0.0) + (when (= (-> self interp) 0.0) + (logclear! (-> self flags) (citizen-flag run-mode)) + (logior! (-> self flags) (citizen-flag shuffle-mode)) + ) + ) + ) + f28-0 + ) + ((< 24576.0 f30-0) + (cond + ((logtest? (-> self flags) (citizen-flag run-mode)) + (set! f28-0 1.0) + (ja :chan 1 :group! (-> self draw art-group data (get-run-anim self)) :dist (-> self dist-run-anim)) + ) + (else + (set! f28-0 0.0) + (when (= (-> self interp) 0.0) + (logior! (-> self flags) (citizen-flag run-mode)) + (logclear! (-> self flags) (citizen-flag shuffle-mode)) + ) + ) + ) + f28-0 + ) + ((or (logtest? (-> self flags) (citizen-flag run-mode)) (logtest? (-> self flags) (citizen-flag shuffle-mode))) + (set! f28-0 0.0) + (when (= (-> self interp) 0.0) + (logclear! (-> self flags) (citizen-flag run-mode)) + (logclear! (-> self flags) (citizen-flag shuffle-mode)) + ) + f28-0 + ) + (else + 0.0 + ) + ) + ) + (seek! (-> self interp) f28-0 (* 4.0 (seconds-per-frame))) + (let ((v1-76 (-> self skel root-channel 1)) + (f0-21 (-> self interp)) + ) + (set! (-> v1-76 frame-interp 1) f0-21) + (set! (-> v1-76 frame-interp 0) f0-21) + ) + (let* ((f0-22 (current-cycle-distance (-> self skel))) + (f0-25 (/ (/ (* 16.0 f30-0) (* 15.0 f0-22)) (-> self root scale x))) + ) + (if (logtest? (-> self flags) (citizen-flag shuffle-mode)) + (set! f0-25 1.0) + ) + (let ((f0-26 (* f0-25 (-> self travel-anim-scale-speed)))) + (ja :num! (loop! f0-26)) + ) + ) + ) + (ja :chan 1 :num! (chan 0)) + (suspend) + ) + #f + ) + +;; definition for method 201 of type citizen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-201 ((this citizen) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((s1-0 (-> this nav state current-poly))) + (let ((a1-2 (-> this nav state))) + (set! (-> s5-0 quad) (-> a1-2 heading quad)) + ) + (set! (-> s5-0 y) 0.0) + (vector-xz-normalize! s5-0 20480.0) + (set! (-> s4-0 quad) (-> s5-0 quad)) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s1-0 s4-0 s2-0) + ) + (cond + ((-> s2-0 found-boundary) + (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> this dest-point) (-> this controller path-prev-point))) + (s0-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 intersection) (-> this controller path-prev-point))) + ) + (vector-! (new 'stack-no-clear 'vector) s5-0 s4-0) + (set! (-> s1-2 y) 0.0) + (vector-xz-normalize! s1-2 1.0) + (vector-rotate90-around-y! s1-2 s1-2) + (if (< 0.0 (vector-dot s1-2 s0-1)) + (vector-negate! arg0 s1-2) + (set! (-> arg0 quad) (-> s1-2 quad)) + ) + ) + (vector-xz-normalize! arg0 8192.0) + ) + (else + (set! (-> arg0 quad) (the-as uint128 0)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 202 of type citizen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-202 ((this citizen) (arg0 vector) (arg1 vector)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> this root trans quad)) + (let ((a1-1 (-> this nav state))) + (set! (-> s2-0 quad) (-> a1-1 heading quad)) + ) + (set! (-> s2-0 y) 0.0) + (vector-xz-normalize! s2-0 20480.0) + (set! (-> s5-0 y) (-> arg0 y)) + (cond + ((< (vector-vector-xz-distance arg0 s5-0) (-> arg0 w)) + (vector-! (new 'stack-no-clear 'vector) arg0 s5-0) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + 0.0 + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> this dest-point) (-> this controller path-prev-point))) + (s1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this controller path-prev-point))) + ) + (set! (-> s2-2 y) 0.0) + (vector-xz-normalize! s2-2 1.0) + (vector-rotate90-around-y! s2-2 s2-2) + (if (< 0.0 (vector-dot s2-2 s1-1)) + (vector-negate! arg1 s2-2) + (set! (-> arg1 quad) (-> s2-2 quad)) + ) + ) + (vector-xz-normalize! arg1 (* 5.0 (- (-> arg0 w) (vector-vector-xz-distance arg0 s5-0)))) + ) + ((line-sphere-intersection? arg0 s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s2-0)) + (let ((s3-3 (vector-! (new 'stack-no-clear 'vector) arg0 s5-0)) + (s5-1 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + 0.0 + (vector-rotate90-around-y! s5-1 s2-0) + (vector-xz-normalize! s5-1 1.0) + (let ((f30-1 (vector-dot s5-1 s3-3))) + (vector-*! s4-1 s3-3 s5-1 f30-1) + (vector-xz-normalize! s5-1 20480.0) + (if (< 0.0 f30-1) + (vector-negate! arg1 s5-1) + (set! (-> arg1 quad) (-> s5-1 quad)) + ) + ) + ) + ) + (else + (set! (-> arg1 quad) (the-as uint128 0)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 203 of type citizen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-203 ((this citizen) (arg0 vector)) + (local-vars (sv-288 nav-poly) (sv-304 clamp-travel-vector-to-mesh-return-info) (sv-320 vector)) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (the-as vector (-> this cp-sphere)))) + (s4-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (set! (-> arg0 quad) (the-as uint128 0)) + (when (-> this cp-valid?) + (set! (-> this cp-valid?) #f) + (set! (-> s2-0 quad) (-> this cp-vec quad)) + (set! (-> s2-0 y) 0.0) + (vector-xz-normalize! s2-0 1.0) + (vector-rotate90-around-y! s2-0 s2-0) + (set! (-> s3-1 y) 0.0) + (vector-*! s4-0 s3-1 s2-0 (vector-dot s3-1 s2-0)) + (let ((f30-0 (- 1.0 (/ (vector-length s4-0) (vector-length (-> this cp-vec)))))) + (vector+! s4-0 s4-0 (the-as vector (-> this cp-sphere))) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! sv-320 (new 'stack-no-clear 'vector)) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (set! sv-304 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (set! sv-288 (-> this nav state current-poly)) + (let ((f28-0 (+ (-> this cp-sphere r) (-> this nav-radius-backup)))) + (when sv-288 + (vector-normalize-copy! s0-0 s2-0 f28-0) + (vector-normalize-copy! sv-320 s2-0 (- f28-0)) + (clamp-vector-to-mesh-no-gaps (-> this nav) s4-0 sv-288 s0-0 sv-304) + (let ((a0-12 (-> this nav)) + (t9-7 (method-of-type nav-control clamp-vector-to-mesh-no-gaps)) + (a1-10 s4-0) + (a3-3 sv-320) + ) + (t9-7 a0-12 a1-10 sv-288 a3-3 sv-304) + ) + (let* ((v1-22 s0-0) + (f0-11 (sqrtf (+ (* (-> v1-22 x) (-> v1-22 x)) (* (-> v1-22 z) (-> v1-22 z))))) + (v1-24 sv-320) + (f1-10 (sqrtf (+ (* (-> v1-24 x) (-> v1-24 x)) (* (-> v1-24 z) (-> v1-24 z))))) + ) + (cond + ((< 0.0 (vector-dot s2-0 s3-1)) + (if (< 4096.0 f0-11) + (set! (-> s1-0 quad) (-> s0-0 quad)) + (set! (-> s1-0 quad) (-> sv-320 quad)) + ) + ) + ((< 4096.0 f1-10) + (set! (-> s1-0 quad) (-> sv-320 quad)) + ) + (else + (set! (-> s1-0 quad) (-> s0-0 quad)) + ) + ) + ) + (set! (-> arg0 quad) (-> s1-0 quad)) + (let ((a1-11 (new 'stack-no-clear 'vector))) + (set! (-> a1-11 quad) (-> this root trans quad)) + (set! (-> a1-11 y) 0.0) + (let ((f0-15 (- f28-0 (vector-vector-xz-distance s4-0 a1-11)))) + (if (< f0-15 0.0) + (set! f0-15 0.0) + ) + (vector-normalize! arg0 (* (-> this cp-factor) f0-15 f30-0)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type iter-seg +(deftype iter-seg (structure) + ((self citizen) + (score float) + (seg nav-segment) + (cp-plane plane :inline) + (desired-dir vector :inline) + ) + ) + +;; definition for method 3 of type iter-seg +(defmethod inspect ((this iter-seg)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'iter-seg) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tscore: ~f~%" (-> this score)) + (format #t "~1Tseg: #~%" (-> this seg)) + (format #t "~1Tcp-plane: #~%" (-> this cp-plane)) + (format #t "~1Tdesired-dir: #~%" (-> this desired-dir)) + (label cfg-4) + this + ) + +;; definition for function iter-seg-clear-path +;; INFO: Used lq/sq +(defun iter-seg-clear-path ((arg0 iter-seg) (arg1 nav-segment)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s2-0 (-> arg0 self)) + (a0-1 (-> arg1 branch src-node)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> a0-1 position quad)) + (set! (-> s4-0 w) 1.0) + (let ((a0-4 (-> arg1 branch dest-node)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> a0-4 position quad)) + (set! (-> s3-0 w) 1.0) + (set! (-> s4-0 y) 0.0) + (set! (-> s3-0 y) 0.0) + (set! (-> s4-0 w) 1.0) + (set! (-> s3-0 w) 1.0) + (when *citizen-debug* + ) + (when #t + (cond + ((< 0.0 (vector4-dot (the-as vector (-> arg0 cp-plane)) s3-0)) + (let ((s0-1 (vector-! (new 'stack-no-clear 'vector) s3-0 s4-0)) + (s1-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 root trans) s4-0)) + ) + (set! (-> s1-1 y) 0.0) + (vector-rotate90-around-y! s0-1 s0-1) + (vector-normalize! s0-1 1.0) + (let ((a1-3 s1-1)) + (let ((v1-17 s1-1)) + (let ((a0-12 s0-1)) + (let ((a2-2 (- (vector-dot s0-1 s1-1)))) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-12 quad)) + ) + (.lvf vf4 (&-> v1-17 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 (&-> a1-3 quad) vf6) + ) + (vector+! s1-1 s1-1 s4-0) + (cond + ((< 0.0 (vector-dot (the-as vector (-> arg0 cp-plane)) (vector-! (new 'stack-no-clear 'vector) s3-0 s1-1))) + (vector-vector-xz-distance s3-0 (-> s2-0 cp-sphere)) + (let ((s1-3 (vector-! (new 'stack-no-clear 'vector) s3-0 (the-as vector (-> s2-0 cp-sphere)))) + (s0-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s0-2 quad) (-> s2-0 cp-vec quad)) + (set! (-> s0-2 y) 0.0) + (vector-normalize! s0-2 1.0) + (set! (-> s1-3 y) 0.0) + (let ((f30-0 (vector-dot s0-2 s1-3))) + (if (and *cty-faction-manager* (not (logtest? (cty-faction-manager-method-9 + *cty-faction-manager* + (the-as int (-> arg1 branch clock-type)) + (-> pp level name) + ) + 1 + ) + ) + ) + (set! f30-0 (+ -409600.0 f30-0)) + ) + (when (< (-> arg0 score) f30-0) + (set! (-> arg0 score) f30-0) + (set! (-> arg0 seg) arg1) + ) + ) + ) + (if *citizen-debug* + (add-debug-line #t (bucket-id debug-no-zbuf1) s4-0 s3-0 *color-black* #f *color-white*) + ) + ) + (else + (if *citizen-debug* + (add-debug-line #t (bucket-id debug-no-zbuf1) s1-1 s3-0 *color-red* #f (the-as rgba -1)) + ) + ) + ) + ) + ) + (else + #f + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 204 of type citizen +;; INFO: Used lq/sq +(defmethod gen-clear-path ((this citizen)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'iter-seg)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this cp-vec quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) + (set! (-> s4-0 w) 81920.0) + (set! (-> gp-0 seg) #f) + (set! (-> gp-0 score) (the-as float #xff800000)) + (set! (-> s3-0 y) 0.0) + (vector-rotate90-around-y! s3-0 s3-0) + (vector-normalize! s3-0 1.0) + (set! (-> gp-0 cp-plane quad) (-> s3-0 quad)) + (set! (-> gp-0 cp-plane w) (- (vector-dot s3-0 (the-as vector (-> this cp-sphere))))) + ) + (when (< (vector4-dot (the-as vector (-> gp-0 cp-plane)) (-> this root trans)) 0.0) + (set! (-> gp-0 cp-plane x) (- (-> gp-0 cp-plane x))) + (set! (-> gp-0 cp-plane y) (- (-> gp-0 cp-plane y))) + (set! (-> gp-0 cp-plane z) (- (-> gp-0 cp-plane z))) + (set! (-> gp-0 cp-plane w) (- (-> gp-0 cp-plane w))) + ) + (set! (-> gp-0 self) this) + (nav-segment-callback + this + s4-0 + (the-as traffic-find-segment-struct gp-0) + (the-as (function traffic-find-segment-struct nav-segment none) iter-seg-clear-path) + ) + (when *citizen-debug* + (if (-> gp-0 seg) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> gp-0 seg vertex)) + (-> gp-0 seg vertex 1) + *color-blue* + #f + *color-white* + ) + ) + ) + (-> gp-0 seg) + ) + ) + +;; definition for method 205 of type citizen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-205 ((this citizen)) + (when (-> this cp-valid?) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> this cp-force quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((a1-0 (-> this nav state))) + (set! (-> s5-0 quad) (-> a1-0 heading quad)) + ) + (set! (-> s5-0 y) 0.0) + (vector-xz-normalize! s5-0 1.0) + (vector-xz-normalize! s4-0 1.0) + (when (< (fabs (vector-dot s4-0 s5-0)) (cos 14563.556)) + (vector-negate! (new 'stack-no-clear 'vector) s5-0) + (let ((a1-6 (gen-clear-path this))) + (if a1-6 + (citizen-method-199 this a1-6) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function iter-seg-new-dir +;; INFO: Used lq/sq +(defun iter-seg-new-dir ((arg0 iter-seg) (arg1 nav-segment)) + (with-pp + (-> 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 ((f30-0 (vector-dot s4-1 (-> arg0 desired-dir)))) + (when (and (< (-> arg0 score) f30-0) + (or (not *cty-faction-manager*) (logtest? (cty-faction-manager-method-9 + *cty-faction-manager* + (the-as int (-> arg1 branch clock-type)) + (-> pp level name) + ) + 1 + ) + ) + ) + (set! (-> arg0 score) f30-0) + (set! (-> arg0 seg) arg1) + arg1 + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 207 of type citizen +;; INFO: Used lq/sq +(defmethod citizen-method-207 ((this citizen) (arg0 vector) (arg1 float)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'iter-seg)) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> this cp-vec quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) + (set! (-> s4-0 w) arg1) + (set! (-> gp-0 seg) #f) + (set! (-> gp-0 score) (the-as float #xff800000)) + (set! (-> gp-0 desired-dir quad) (-> arg0 quad)) + (vector-normalize! (-> gp-0 desired-dir) 1.0) + (set! (-> gp-0 self) this) + (nav-segment-callback + this + s4-0 + (the-as traffic-find-segment-struct gp-0) + (the-as (function traffic-find-segment-struct nav-segment none) iter-seg-new-dir) + ) + (when *citizen-debug* + (if (-> gp-0 seg) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> gp-0 seg vertex)) + (-> gp-0 seg vertex 1) + *color-blue* + #f + *color-white* + ) + ) + ) + (-> gp-0 seg) + ) + ) + +;; definition for method 208 of type citizen +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 208 citizen) has a return type of none, but the expression builder found a return statement. +(defmethod citizen-method-208 ((this citizen) (arg0 vector)) + (dotimes (s4-0 6) + (let ((a1-2 (citizen-method-207 this arg0 (* 81920.0 (the float (+ s4-0 1)))))) + (when a1-2 + (citizen-method-199 this a1-2) + (return #f) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 206 of type citizen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-206 ((this citizen)) + (let ((s4-0 (the-as vehicle (handle->process (-> this vehicle))))) + (let ((v1-4 (-> this root root-prim))) + (set! (-> v1-4 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-4 prim-core collide-with) (-> this root backup-collide-with)) + ) + (when s4-0 + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> s4-0 root trans)))) + (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root quat))) + (v1-10 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root quat))) + ) + (if (< 0.0 (vector-dot s5-1 s3-0)) + (vector+! s5-1 v1-10 s3-0) + (vector-! s5-1 v1-10 s3-0) + ) + ) + (vector-normalize! s5-1 32768.0) + (set! (-> s5-1 y) 71680.0) + (vector+! s5-1 s5-1 (-> s4-0 root transv)) + (send-event + this + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 0.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (vector s5-1) + (knock (knocked-type vehicle)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate in-ditch (citizen) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self wait-time) (set-reaction-time! self (seconds 1) (seconds 5))) + (if (= (-> self water-anim) -1) + (go-inactive self) + ) + (when (focus-test? self touch-water) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (set! (-> a1-3 quad) (-> self root trans quad)) + (set! (-> a1-3 y) (+ 40.96 (-> self water-surface-height))) + (splash-spawn 0.2 a1-3 1) + ) + ) + ) + :exit (behavior () + '() + ) + :trans #f + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (cond + ((focus-test? self touch-water) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self water-anim)) :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (set! (-> gp-0 y) (+ 40.96 (-> self water-surface-height))) + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) (zero? (-> self draw cur-lod))) + (let ((f0-6 (y-angle (-> self root)))) + (rings-water-spawn f0-6 gp-0 *null-vector* 3072.0 4096.0) + ) + ) + ) + (suspend) + (ja :num! (seek! max 0.5)) + ) + ) + #f + ) + (else + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max 0.1) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + ) + #f + ) + ) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate wait (citizen) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :exit (behavior () + '() + ) + :trans (behavior () + (cond + ((not (logtest? (-> self flags) (citizen-flag in-formation))) + (if (and (-> self wait-return-state) (time-elapsed? (-> self state-time) (-> self wait-time))) + (go (-> self wait-return-state)) + ) + ) + (else + (let ((a0-3 (handle->process (-> self vehicle)))) + (if (and a0-3 (= (process->handle self) (get-leader-handle (the-as formation-object a0-3)))) + (go (-> self wait-return-state)) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + ) + #f + ) + :post (behavior () + (when (not (logtest? (-> self flags) (citizen-flag in-formation))) + (let ((a1-1 (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (-> self root trans)))) + (seek-toward-heading-vec! (-> self root) a1-1 32768.0 (seconds 0.05)) + ) + ) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate active (citizen) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (when (logtest? (-> self nav state flags) (nav-state-flag directional-mode)) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (let ((a0-18 (-> self nav state)) + (v1-17 (-> self dest-point)) + ) + (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-18 target-pos quad) (-> v1-17 quad)) + ) + 0 + ) + (nav-enemy-method-176 self) + (let ((v1-23 (-> self nav state))) + (set! (-> v1-23 speed) 0.0) + ) + 0 + (let ((a0-21 (-> self nav state)) + (v1-26 *null-vector*) + ) + (set! (-> a0-21 velocity quad) (-> v1-26 quad)) + ) + 0 + (let ((v1-29 (-> self nav))) + (set! (-> v1-29 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + (set! (-> self wait-time) (set-reaction-time! self (seconds 4) (seconds 30))) + (if (zero? (-> self controller branch)) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (if (and *cty-faction-manager* + (nonzero? (-> self controller branch)) + (not (logtest? (cty-faction-manager-method-9 + *cty-faction-manager* + (the-as int (-> self controller branch clock-type)) + (-> self level name) + ) + 1 + ) + ) + ) + (citizen-method-208 self (vector-float*! + (new 'stack-no-clear 'vector) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + -1.0 + ) + ) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) + (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) + (< (-> self root trans y) 4096.0) + ) + (go-virtual in-ditch) + ) + (when (and (time-elapsed? (-> self state-time) (-> self wait-time)) + (not (logtest? (-> self flags) (citizen-flag in-formation))) + ) + (let ((f0-2 (-> self nav state speed))) + (set! (-> self nav target-speed) (seek f0-2 0.0 (* 12288.0 (seconds-per-frame)))) + ) + 0 + (when (= (-> self nav state speed) 0.0) + (set! (-> self wait-return-state) (the-as (state citizen) (-> self state))) + (set! (-> self wait-time) (set-reaction-time! self (seconds 1) (seconds 5))) + (go-virtual wait) + ) + ) + (when (logtest? (-> self flags) (citizen-flag in-formation)) + (let ((a0-10 (handle->process (-> self vehicle)))) + 1.0 + (when a0-10 + (let ((f0-9 (get-target-speed (the-as formation-object a0-10) self (-> self formation-index))) + (v1-46 (-> self nav)) + ) + (set! (-> v1-46 target-speed) (* (-> self speed-scale) (-> self speed-walk) f0-9)) + ) + 0 + ) + ) + ) + (let ((f0-11 2867.2) + (v1-50 (-> self root transv)) + ) + (if (< f0-11 (sqrtf (+ (* (-> v1-50 x) (-> v1-50 x)) (* (-> v1-50 z) (-> v1-50 z))))) + (set-time! (-> self cp-next-time)) + ) + ) + (when (< (+ (-> self cp-next-time) (seconds 2)) (current-time)) + (let ((a1-5 (vector-! (new 'stack-no-clear 'vector) (-> self controller path-prev-point) (-> self dest-point)))) + (set-time! (-> self cp-next-time)) + (citizen-method-208 self a1-5) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) + ) + :post (behavior () + (cond + ((not (logtest? (-> self flags) (citizen-flag in-formation))) + (when (and (nonzero? (-> self controller branch)) + (let ((f0-0 (vector-vector-xz-distance-squared (-> self root trans) (-> self dest-point))) + (f1-0 16384.0) + ) + (or (< f0-0 (* f1-0 f1-0)) (logtest? (-> self nav state flags) (nav-state-flag at-target))) + ) + ) + (let ((gp-0 (-> self controller branch))) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (when (= gp-0 (-> self controller branch)) + (let ((a0-5 (-> self nav state)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 quad) (-> a0-5 heading quad)) + (vector-float*! a1-2 a1-2 -1.0) + (citizen-method-208 self a1-2) + ) + ) + ) + ) + (let ((a0-10 (-> self nav state)) + (v1-21 (-> self dest-point)) + ) + (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-10 target-pos quad) (-> v1-21 quad)) + ) + 0 + ) + (else + (let ((a0-13 (handle->process (-> self vehicle)))) + (when (and a0-13 (!= (process->handle self) (get-leader-handle (the-as formation-object a0-13)))) + (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) + (let ((t9-4 vector-vector-xz-distance-squared) + (a0-16 (-> self root trans)) + (a2-2 (-> self nav state)) + (a1-12 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-12 quad) (-> a2-2 target-pos quad)) + (let ((f0-2 (t9-4 a0-16 a1-12)) + (f1-3 4096.0) + ) + (< f0-2 (* f1-3 f1-3)) + ) + ) + ) + (-> self nav state speed) + (set! (-> self wait-return-state) (the-as (state citizen) (-> self state))) + (go-virtual wait) + ) + ) + ) + ) + ) + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate inactive (citizen) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('nav-mesh-kill 'traffic-activate 'traffic-off-force 'traffic-off 'change-guard-type 'handle-gem-pickup) + (event-handler self proc argc message block) + ) + ) + ) + :enter (behavior () + (when (-> self nav) + (citizen-method-195 self) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + ) + (let ((a0-5 (handle->process (-> self ragdoll-proc)))) + (when a0-5 + (deactivate a0-5) + (set! (-> self ragdoll-proc) (the-as handle #f)) + ) + ) + (logior! (-> self focus-status) (focus-status disable inactive)) + (let ((v1-17 (-> self root root-prim))) + (set! (-> v1-17 prim-core collide-as) (collide-spec)) + (set! (-> v1-17 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (vehicle-controller-method-11 (-> self controller)) + ) + :exit (behavior () + '() + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate knocked (citizen) + :virtual #t + :trans (behavior () + (let ((a1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-from-two-vectors-max-angle! gp-0 a1-1 *up-vector* (* 7281.778 (seconds-per-frame))) + (quaternion*! (-> self root quat) gp-0 (-> self root quat)) + ) + (let ((t9-3 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + +;; definition for method 143 of type citizen +(defmethod on-dying ((this citizen)) + (when (handle->process (-> this shield-handle)) + (let ((a0-6 (handle->process (-> this shield-handle)))) + (send-event a0-6 'shield-detach) + ) + ) + ((method-of-type nav-enemy on-dying) this) + (none) + ) + +;; definition for method 10 of type citizen +(defmethod deactivate ((this citizen)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (nop!) + (call-parent-method this) + (none) + ) + +;; definition for method 215 of type citizen +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-215 ((this citizen)) + 0 + (none) + ) + +;; definition for method 66 of type citizen +(defmethod get-penetrated-by ((this citizen)) + (logior (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (the int (-> this hit-points))) + (penetrate vehicle) + ) + ) + +;; definition for method 153 of type citizen +(defmethod get-gem-pool-idx ((this citizen)) + (if (zero? (-> *setting-control* user-current gem-pool-index)) + -1 + (-> *setting-control* user-current gem-pool-index) + ) + ) + +;; definition for method 152 of type citizen +(defmethod enemy-method-152 ((this citizen)) + 0.5 + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc new file mode 100644 index 0000000000..0ce09f0db9 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc @@ -0,0 +1,2246 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type civilian-anim-info +(deftype civilian-anim-info (structure) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) + ) + :pack-me + ) + +;; definition for method 3 of type civilian-anim-info +(defmethod inspect ((this civilian-anim-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'civilian-anim-info) + (format #t "~1Tanim-index[2] @ #x~X~%" (-> this anim-index)) + (format #t "~1Tanim-index-front: ~D~%" (-> this anim-index-front)) + (format #t "~1Tanim-index-back: ~D~%" (-> this anim-index-back)) + (label cfg-4) + this + ) + +;; definition of type civilian-global-info +(deftype civilian-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (knocked-land int32 2) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim civilian-anim-info 1 :inline) + (blue-hit-anim civilian-anim-info 3 :inline) + (anim-cover-head-start int32) + (anim-cover-head-loop int32) + (anim-cover-head-end int32) + (car-stance-anim int32) + (bike-stance-anim int32) + (get-in-car-anim int32) + (get-on-bike-anim int32) + (seat-flag uint8) + (speech-ambient int8) + (speech-alert int8) + (speech-cower int8) + (speech-touched-by-player int8) + (speech-shot-by-player int8) + (speech-avoiding-player-vehicle int8) + (speech-hit-by-player-vehicle int8) + (speech-player-stealing-vehicle int8) + ) + ) + +;; definition for method 3 of type civilian-global-info +(defmethod inspect ((this civilian-global-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tknocked[2] @ #x~X~%" (-> this knocked)) + (format #t "~1Tanim-knocked-front: ~D~%" (-> this anim-knocked-front)) + (format #t "~1Tanim-knocked-back: ~D~%" (-> this anim-knocked-back)) + (format #t "~1Tknocked-land[2] @ #x~X~%" (-> this knocked-land)) + (format #t "~1Tanim-knocked-front-land: ~D~%" (-> this anim-knocked-front-land)) + (format #t "~1Tanim-knocked-back-land: ~D~%" (-> this anim-knocked-back-land)) + (format #t "~1Tyellow-hit-anim[1] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) + (format #t "~1Tanim-cover-head-start: ~D~%" (-> this anim-cover-head-start)) + (format #t "~1Tanim-cover-head-loop: ~D~%" (-> this anim-cover-head-loop)) + (format #t "~1Tanim-cover-head-end: ~D~%" (-> this anim-cover-head-end)) + (format #t "~1Tcar-stance-anim: ~D~%" (-> this car-stance-anim)) + (format #t "~1Tbike-stance-anim: ~D~%" (-> this bike-stance-anim)) + (format #t "~1Tget-in-car-anim: ~D~%" (-> this get-in-car-anim)) + (format #t "~1Tget-on-bike-anim: ~D~%" (-> this get-on-bike-anim)) + (format #t "~1Tseat-flag: ~D~%" (-> this seat-flag)) + (format #t "~1Tspeech-ambient: ~D~%" (-> this speech-ambient)) + (format #t "~1Tspeech-alert: ~D~%" (-> this speech-alert)) + (format #t "~1Tspeech-cower: ~D~%" (-> this speech-cower)) + (format #t "~1Tspeech-touched-by-player: ~D~%" (-> this speech-touched-by-player)) + (format #t "~1Tspeech-shot-by-player: ~D~%" (-> this speech-shot-by-player)) + (format #t "~1Tspeech-avoiding-player-vehicle: ~D~%" (-> this speech-avoiding-player-vehicle)) + (format #t "~1Tspeech-hit-by-player-vehicle: ~D~%" (-> this speech-hit-by-player-vehicle)) + (format #t "~1Tspeech-player-stealing-vehicle: ~D~%" (-> this speech-player-stealing-vehicle)) + (label cfg-4) + this + ) + +;; definition of type civilian +(deftype civilian (citizen) + ((info civilian-global-info) + (anim-panic-run int32) + (anim-on-ground int32) + (anim-dive int32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (last-second-pos vector :inline) + (last-distance float) + (next-time time-frame) + (dive-target-point vector :inline) + (dive-reaction float) + (allow-dive symbol) + (dive-finished? symbol) + (hit-face uint32) + (seat int32) + ) + (:state-methods + avoid-danger + clear-path + on-ground + dive + get-up-front + get-up-back + cower-ground + wait-for-ride + move-to-vehicle + board-vehicle + ride + exit-vehicle + wait-at-dest + ) + (:methods + (civilian-method-229 (_type_ nav-branch int vector float) float) + (civilian-method-230 (_type_ vector) nav-segment) + (civilian-method-231 (_type_) none) + (civilian-method-232 (_type_ vector) symbol) + (start-ragdoll (_type_ art-joint-anim) none) + ) + ) + +;; definition for method 3 of type civilian +(defmethod inspect ((this civilian)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type citizen inspect))) + (t9-0 this) + ) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Tanim-panic-run: ~D~%" (-> this anim-panic-run)) + (format #t "~2Tanim-on-ground: ~D~%" (-> this anim-on-ground)) + (format #t "~2Tanim-dive: ~D~%" (-> this anim-dive)) + (format #t "~2Tanim-get-up-front: ~D~%" (-> this anim-get-up-front)) + (format #t "~2Tanim-get-up-back: ~D~%" (-> this anim-get-up-back)) + (format #t "~2Tlast-second-pos: #~%" (-> this last-second-pos)) + (format #t "~2Tlast-distance: ~f~%" (-> this last-distance)) + (format #t "~2Tnext-time: ~D~%" (-> this next-time)) + (format #t "~2Tdive-target-point: #~%" (-> this dive-target-point)) + (format #t "~2Tdive-reaction: ~f~%" (-> this dive-reaction)) + (format #t "~2Tallow-dive: ~A~%" (-> this allow-dive)) + (format #t "~2Tdive-finished?: ~A~%" (-> this dive-finished?)) + (format #t "~2Thit-face: ~D~%" (-> this hit-face)) + (format #t "~2Tseat: ~D~%" (-> this seat)) + (label cfg-4) + this + ) + +;; definition for method 193 of type civilian +;; WARN: Return type mismatch int vs none. +(defmethod set-squad ((this civilian)) + (set! (-> this squad) *ff-squad-control*) + 0 + (none) + ) + +;; definition for method 209 of type civilian +(defmethod get-run-anim ((this civilian)) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (-> this anim-panic-run) + (-> this anim-run) + ) + ) + +;; definition for method 89 of type civilian +(defmethod within-gspot-range? ((this civilian)) + #f + ) + +;; definition for method 17 of type civilian +;; INFO: Used lq/sq +(defmethod cleanup-for-death ((this civilian)) + (logclear! (-> this flags) (citizen-flag persistent)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (let ((a1-1 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-1 sphere quad) (-> this root trans quad)) + (set! (-> a1-1 sphere r) 40960.0) + (set! (-> a1-1 velocity quad) (-> this root transv quad)) + (set! (-> a1-1 notify-radius) 122880.0) + (set! (-> a1-1 danger-level) 1.0) + (set! (-> a1-1 decay-rate) 0.0) + (set! (-> a1-1 flags) (the-as uint 1)) + (set! (-> a1-1 danger-type) (the-as uint 7)) + (set! (-> a1-1 handle) (process->handle this)) + (set! (-> a1-1 handle) (the-as handle #f)) + (add-danger (-> this controller traffic) a1-1) + ) + (go-inactive this) + (none) + ) + +;; definition for method 114 of type civilian +(defmethod send-attack-to-all-tshapes ((this civilian) (arg0 process-focusable) (arg1 event-message-block)) + 0 + ) + +;; definition for method 78 of type civilian +;; WARN: Return type mismatch none vs object. +(defmethod go-hostile ((this civilian)) + (cleanup-for-death this) + ) + +;; definition for method 81 of type civilian +;; WARN: Return type mismatch none vs object. +(defmethod go-die ((this civilian)) + (cleanup-for-death this) + ) + +;; definition for method 212 of type civilian +;; WARN: Return type mismatch int vs none. +(defmethod go-from-behavior ((this civilian) (arg0 traffic-object-spawn-params)) + (let ((v1-0 (-> arg0 behavior))) + (cond + ((zero? v1-0) + (go (method-of-object this idle)) + ) + ((= v1-0 2) + (go (method-of-object this active)) + ) + ((= v1-0 3) + (go (method-of-object this hostile)) + ) + ((= v1-0 7) + (logior! (-> this flags) (citizen-flag persistent)) + (go (method-of-object this wait-for-ride)) + ) + (else + (go-inactive this) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 194 of type civilian +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this civilian)) + (let ((t9-0 (method-of-type citizen citizen-method-194))) + (t9-0 this) + ) + (logior! (-> this mask) (process-mask civilian)) + (set! (-> this hit-points) (the float (rand-vu-int-range 1 4))) + (set! (-> this hit-points) 4.0) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) + (set! (-> this fact pickup-spawn-amount) 0.0) + (when (zero? (mod (the-as int (rand-uint31-gen *random-generator*)) 11)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + ) + 0 + (none) + ) + +;; definition for method 230 of type civilian +;; INFO: Used lq/sq +(defmethod civilian-method-230 ((this civilian) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> this root trans quad)) + (set! (-> v1-0 w) 81920.0) + (let ((s5-0 (find-segment this v1-0 arg0))) + (if s5-0 + (citizen-method-199 this s5-0) + ) + s5-0 + ) + ) + ) + +;; definition for method 20 of type civilian +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this civilian)) + (the-as search-info-flag 0) + ) + +;; definition for method 82 of type civilian +;; INFO: Used lq/sq +(defmethod event-handler ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('combo) + #f + ) + (('touched) + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + (('panic) + (let ((a0-5 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this danger-pos quad) (-> a0-5 sphere quad)) + ) + (if (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) + ) + ) + (go (method-of-object this flee)) + ) + ) + (('event-death) + (if (= (-> this hit-points) 0.0) + (do-effect (-> this skel effect) "death-default" 0.0 -1) + ) + ) + (('avoid) + (set-time! (-> this last-danger-time)) + (let ((a0-14 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this danger-pos quad) (-> a0-14 sphere quad)) + ) + (if (and (-> this next-state) (let ((v1-17 (-> this next-state name))) + (or (= v1-17 'active) (= v1-17 'wait)) + ) + ) + (go (method-of-object this avoid-danger)) + ) + ) + (('clear-path) + (set-time! (-> this last-danger-time)) + (let ((v1-22 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-22 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-22 velocity quad)) + (let ((v1-23 (-> v1-22 danger-type))) + (cond + ((zero? v1-23) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 20.0) + ) + ((= v1-23 1) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 20.0) + ) + ((or (= v1-23 2) (= v1-23 8)) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) + ) + ((= v1-23 3) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) + ) + ((= v1-23 4) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 2.0) + ) + ((= v1-23 5) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) + ) + ((= v1-23 6) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) + ) + ) + ) + ) + (let ((s5-1 (-> this cp-plane))) + (set! (-> s5-1 quad) (-> this cp-vec quad)) + (set! (-> s5-1 y) 0.0) + (vector-rotate90-around-y! s5-1 s5-1) + (vector-normalize! s5-1 1.0) + (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> this cp-sphere))))) + ) + (set! (-> this cp-exit-time) (+ (current-time) (seconds 4))) + (if (and (-> this next-state) (let ((v1-53 (-> this next-state name))) + (or (= v1-53 'active) (= v1-53 'wait) (= v1-53 'avoid-danger)) + ) + ) + (go (method-of-object this clear-path)) + ) + ) + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-14 *speech-control* (the-as handle this)) + (if (logtest? (-> this flags) (citizen-flag female)) + (speech-control-method-12 *speech-control* this (speech-type civ-f-shot-by-player)) + (speech-control-method-12 *speech-control* this (speech-type civ-m-shot-by-player)) + ) + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + (('end-task) + (let ((v0-0 (the-as object (logclear (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-0)) + v0-0 + ) + ) + (else + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 229 of type civilian +;; INFO: Used lq/sq +(defmethod civilian-method-229 ((this civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) + (when (nonzero? arg1) + (-> arg0 src-node) + (let* ((s3-0 (-> arg0 dest-node)) + (t9-0 vector-vector-xz-distance) + (a0-1 arg2) + (a2-1 s3-0) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-1 position quad)) + (set! (-> a1-1 w) 1.0) + (let ((s1-0 (t9-0 a0-1 a1-1)) + (s2-0 (-> s3-0 branch-count)) + (f30-0 0.0) + ) + (dotimes (s0-0 s2-0) + (+! f30-0 (civilian-method-229 this (-> s3-0 branch-array s0-0) (+ arg1 -1) arg2 s1-0)) + ) + (set! arg3 (+ s1-0 (the float (/ (the int f30-0) s2-0)))) + ) + ) + ) + arg3 + ) + +;; failed to figure out what this is: +(defstate wait (civilian) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type citizen wait) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +;; definition for function civilian-flee-post +;; INFO: Used lq/sq +(defbehavior civilian-flee-post civilian () + (let* ((gp-0 (-> self controller)) + (s4-0 (-> gp-0 branch dest-node)) + (s5-0 (the-as nav-branch #f)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (-> self controller path-prev-point))) + ) + 0.0 + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self dest-point)))) + (set! (-> s2-1 y) 0.0) + (set! (-> s3-1 y) 0.0) + (vector-xz-normalize! s3-1 1.0) + (let ((f0-4 (vector-dot s2-1 s3-1))) + (when (< -16384.0 f0-4) + (cond + ((zero? (-> s4-0 branch-count)) + ) + (else + (let ((s3-2 (-> s4-0 branch-count)) + (f30-0 0.0) + ) + (dotimes (s2-2 s3-2) + (let* ((s1-0 (-> s4-0 branch-array s2-2)) + (f0-5 (civilian-method-229 self s1-0 4 (-> self danger-pos) 0.0)) + ) + (when (< f30-0 f0-5) + (set! f30-0 f0-5) + (set! s5-0 s1-0) + ) + ) + ) + ) + ) + ) + (when s5-0 + (vehicle-controller-method-11 gp-0) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> gp-0 turn-exit-point quad)) + (vehicle-controller-method-10 gp-0 s5-0) + (set! (-> gp-0 path-prev-point quad) (-> s4-1 quad)) + ) + (set! (-> gp-0 branch) s5-0) + (let ((a1-3 (-> s5-0 dest-node)) + (v1-23 (-> gp-0 turn-exit-point)) + ) + (set! (-> v1-23 quad) (-> a1-3 position quad)) + (set! (-> v1-23 w) 1.0) + ) + ) + ) + ) + ) + ) + (when (< (-> self cp-next-time) (current-time)) + (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 2) (seconds 4)))) + (citizen-method-203 self (-> self cp-force)) + ) + (add-offset-to-target! (-> self nav state) (-> self cp-force)) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (-> self cp-force)) + *color-red* + #f + (the-as rgba -1) + ) + ) + (let ((a0-18 (-> self nav state)) + (v1-42 (-> self dest-point)) + ) + (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-18 target-pos quad) (-> v1-42 quad)) + ) + 0 + (set! (-> (new 'stack-no-clear 'vector) quad) (-> self nav state target-pos quad)) + (nav-enemy-method-187 self) + (none) + ) + +;; failed to figure out what this is: +(defstate flee (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (nav-enemy-method-177 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((a1-5 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self danger-pos))))) + (civilian-method-230 self a1-5) + ) + (if (zero? (-> self controller branch)) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (if (zero? (-> self controller branch)) + (civilian-method-231 self) + ) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.0 0.0 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (< (vector-vector-distance (-> self root trans) (camera-pos)) 204800.0) + ) + (if (logtest? (-> self flags) (citizen-flag female)) + (speech-control-method-12 *speech-control* self (speech-type civ-f-alert)) + (speech-control-method-12 *speech-control* self (speech-type civ-m-alert)) + ) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) + (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) + (< (-> self root trans y) 4096.0) + ) + (go-virtual in-ditch) + ) + (citizen-method-205 self) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self anim-panic-run))) 30) + ) + :post (behavior () + (civilian-flee-post) + ) + ) + +;; definition for function civilian-avoid-danger-post +;; INFO: Used lq/sq +(defbehavior civilian-avoid-danger-post civilian () + (local-vars (sv-352 nav-poly)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self danger-pos))))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (-> self root trans)))) + (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (the-as vector (-> self danger-pos))) + (let ((s1-1 (vector-! (new 'stack-no-clear 'vector) (-> self dest-point) (-> self controller path-prev-point)))) + (set! (-> s5-1 y) 0.0) + (set! (-> s1-1 y) 0.0) + (vector-xz-normalize! s1-1 1.0) + (vector-rotate90-around-y! s1-1 s1-1) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((v1-6 (-> self nav)) + (a0-8 (-> self danger-pos)) + (a1-5 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-5 vertex)) (the-as vector a0-8) (the-as vector (-> v1-6 state mesh bounds))) + (set! (-> a1-5 vertex1 x) (-> v1-6 nearest-y-threshold)) + (set! (-> a1-5 data 20) (the-as uint 2)) + (set! sv-352 (nav-mesh-method-45 (-> v1-6 state mesh) a1-5)) + ) + (when sv-352 + (vector-normalize-copy! s3-0 s1-1 40960.0) + (clamp-vector-to-mesh-no-gaps (-> self nav) (-> self danger-pos) sv-352 s3-0 s0-0) + (vector-normalize-copy! s2-0 s1-1 -40960.0) + (let ((a0-14 (-> self nav)) + (t9-7 (method-of-type nav-control clamp-vector-to-mesh-no-gaps)) + (a1-9 (-> self danger-pos)) + (a3-3 s2-0) + ) + (t9-7 a0-14 a1-9 sv-352 a3-3 s0-0) + ) + (let* ((v1-12 s3-0) + (f0-7 (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z))))) + (v1-14 s2-0) + (f1-7 (sqrtf (+ (* (-> v1-14 x) (-> v1-14 x)) (* (-> v1-14 z) (-> v1-14 z))))) + ) + (cond + ((< 0.0 (vector-dot s1-1 gp-1)) + (if (< 8192.0 f0-7) + (set! (-> s4-0 quad) (-> s3-0 quad)) + (set! (-> s4-0 quad) (-> s2-0 quad)) + ) + ) + ((< 8192.0 f1-7) + (set! (-> s4-0 quad) (-> s2-0 quad)) + ) + (else + (set! (-> s4-0 quad) (-> s3-0 quad)) + ) + ) + ) + (let* ((v1-24 gp-1) + (f0-13 (sqrtf (+ (* (-> v1-24 x) (-> v1-24 x)) (* (-> v1-24 z) (-> v1-24 z))))) + ) + (let ((f1-12 0.8) + (v1-27 s5-1) + ) + (* f1-12 (sqrtf (+ (* (-> v1-27 x) (-> v1-27 x)) (* (-> v1-27 z) (-> v1-27 z))))) + ) + (let ((f0-15 (/ (- (-> self danger-pos r) f0-13) (-> self danger-pos r)))) + (if (< f0-15 0.0) + (set! f0-15 0.0) + ) + (if (< 0.8 f0-15) + (set! f0-15 0.8) + ) + (set! (-> gp-1 quad) (-> s4-0 quad)) + (vector-xz-normalize! gp-1 (* 16384.0 f0-15)) + ) + ) + (vector-xz-normalize! s5-1 16384.0) + ) + ) + ) + (vector+! gp-1 gp-1 s5-1) + ) + (vector-xz-normalize! gp-1 4096.0) + (let ((a0-27 (-> self nav state)) + (v1-41 (vector+! (new 'stack-no-clear 'vector) gp-1 (-> self root trans))) + ) + (logclear! (-> a0-27 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-27 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-27 target-pos quad) (-> v1-41 quad)) + ) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +;; definition for function civilian-avoid-danger-post2 +;; INFO: Used lq/sq +(defbehavior civilian-avoid-danger-post2 civilian () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (citizen-method-202 self (-> self danger-pos) gp-0) + (add-offset-to-target! (-> self nav state) gp-0) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) gp-0) + *color-blue* + #f + (the-as rgba -1) + ) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (citizen-method-201 self gp-1) + (add-offset-to-target! (-> self nav state) gp-1) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) gp-1) + *color-green* + #f + (the-as rgba -1) + ) + ) + ) + (let ((a0-6 (-> self nav state)) + (v1-23 (-> self dest-point)) + ) + (logclear! (-> a0-6 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-6 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-6 target-pos quad) (-> v1-23 quad)) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +;; failed to figure out what this is: +(defstate avoid-danger (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + (set! (-> self next-time) (+ (current-time) (set-reaction-time! self (seconds 1) (seconds 2)))) + (set! (-> self last-second-pos quad) (-> self root trans quad)) + (set! (-> self last-distance) (vector-vector-xz-distance (-> self dest-point) (-> self root trans))) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.0 0.0 1.0 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) + (go-virtual active) + ) + (when (citizen-method-200 self) + (cond + ((< (* 2.0 (-> self danger-pos r)) (vector-vector-xz-distance (-> self danger-pos) (-> self dest-point))) + (go-virtual active) + ) + (else + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (set! (-> self last-distance) (vector-vector-xz-distance (-> self dest-point) (-> self root trans))) + ) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (civilian-avoid-danger-post2) + ) + ) + +;; definition for function civilian-clear-path-post +;; INFO: Used lq/sq +(defbehavior civilian-clear-path-post civilian () + (local-vars (sv-304 nav-poly)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self cp-sphere)))) + (s1-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> self cp-vec quad)) + (set! (-> gp-0 y) 0.0) + (vector-xz-normalize! gp-0 1.0) + (vector-rotate90-around-y! gp-0 gp-0) + (set! (-> s5-1 y) 0.0) + (vector-*! s1-0 s5-1 gp-0 (vector-dot s5-1 gp-0)) + (vector+! s1-0 s1-0 (the-as vector (-> self cp-sphere))) + (vector-xz-normalize! s5-1 1.0) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (set! sv-304 (-> self nav state current-poly)) + (let ((f30-0 (+ 4096.0 (-> self cp-sphere r)))) + (when sv-304 + (vector-normalize-copy! s3-0 gp-0 f30-0) + (vector-normalize-copy! s2-0 gp-0 (- f30-0)) + (clamp-vector-to-mesh-no-gaps (-> self nav) s1-0 sv-304 s3-0 s0-0) + (let ((a0-12 (-> self nav)) + (t9-8 (method-of-type nav-control clamp-vector-to-mesh-no-gaps)) + (a3-3 s2-0) + ) + (t9-8 a0-12 s1-0 sv-304 a3-3 s0-0) + ) + (let* ((v1-14 s3-0) + (f0-9 (sqrtf (+ (* (-> v1-14 x) (-> v1-14 x)) (* (-> v1-14 z) (-> v1-14 z))))) + (v1-16 s2-0) + (f1-8 (sqrtf (+ (* (-> v1-16 x) (-> v1-16 x)) (* (-> v1-16 z) (-> v1-16 z))))) + ) + (cond + ((< 0.0 (vector-dot gp-0 s5-1)) + (if (< 4096.0 f0-9) + (set! (-> s4-0 quad) (-> s3-0 quad)) + (set! (-> s4-0 quad) (-> s2-0 quad)) + ) + ) + ((< 4096.0 f1-8) + (set! (-> s4-0 quad) (-> s2-0 quad)) + ) + (else + (set! (-> s4-0 quad) (-> s3-0 quad)) + ) + ) + ) + (set! (-> gp-0 quad) (-> s4-0 quad)) + ) + ) + ) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) gp-0) + *color-blue* + #f + (the-as rgba -1) + ) + ) + (let ((a0-21 (-> self nav state)) + (v1-34 (vector+! (new 'stack-no-clear 'vector) gp-0 (-> self root trans))) + ) + (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-21 target-pos quad) (-> v1-34 quad)) + ) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +;; definition for function civilian-clear-path-post2 +;; INFO: Used lq/sq +(defbehavior civilian-clear-path-post2 civilian () + (citizen-method-205 self) + (when (< (-> self cp-next-time) (current-time)) + (citizen-method-203 self (-> self cp-force)) + (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 4) (seconds 8)))) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (citizen-method-201 self gp-1) + (add-offset-to-target! (-> self nav state) gp-1) + ) + (if *citizen-debug* + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (-> self cp-force)) + *color-blue* + #f + (the-as rgba -1) + ) + ) + (add-offset-to-target! (-> self nav state) (-> self cp-force)) + (let ((a0-9 (-> self nav state)) + (v1-25 (-> self dest-point)) + ) + (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-9 target-pos quad) (-> v1-25 quad)) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +;; failed to figure out what this is: +(defstate clear-path (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 4) (seconds 8)))) + (set! (-> self cp-force quad) (the-as uint128 0)) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.0 1.0 0.0 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + (when (citizen-method-200 self) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (set! (-> self last-distance) (vector-vector-xz-distance (-> self dest-point) (-> self root trans))) + ) + (let ((v1-8 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self cp-sphere))))) + (cond + ((< (* 0.5 (vector-length (-> self cp-vec))) (vector-length v1-8)) + (let ((a0-10 (-> self nav))) + (set! (-> a0-10 target-speed) (* (-> self speed-scale) (-> self speed-walk))) + ) + 0 + (let ((a0-12 (-> self nav))) + (set! (-> a0-12 acceleration) (-> self enemy-info walk-acceleration)) + ) + 0 + (let ((a0-14 (-> self nav))) + (set! (-> a0-14 turning-acceleration) (-> self enemy-info walk-turning-acceleration)) + ) + 0 + ) + (else + (let ((a0-16 (-> self nav))) + (set! (-> a0-16 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((a0-18 (-> self nav))) + (set! (-> a0-18 acceleration) (-> self enemy-info run-acceleration)) + ) + 0 + (let ((a0-20 (-> self nav))) + (set! (-> a0-20 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + ) + ) + (if (and (-> self allow-dive) + (< (vector-length v1-8) (* (-> self dive-reaction) (vector-length (-> self cp-vec)))) + (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (* 0.5 (-> self cp-sphere r))) + ) + (civilian-method-231 self) + ) + ) + (if (< (-> self cp-exit-time) (current-time)) + (go-virtual active) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 30) + ) + :post (behavior () + (civilian-clear-path-post2) + ) + ) + +;; definition for method 231 of type civilian +;; WARN: Return type mismatch object vs none. +(defmethod civilian-method-231 ((this civilian)) + (if (< (-> this nav state speed) 8192.0) + (go (method-of-object this on-ground)) + (go (method-of-object this dive)) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate on-ground (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-8 (-> self root root-prim))) + (set! (-> v1-8 prim-core collide-as) (collide-spec)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) + ) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) + ) + :trans (behavior () + (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) + (go-virtual get-up-front) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-on-ground)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate dive (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (let ((v1-8 (-> self root root-prim))) + (set! (-> v1-8 prim-core collide-as) (collide-spec)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (let ((v1-12 (-> self nav))) + (set! (-> v1-12 sphere-mask) (the-as uint 0)) + ) + 0 + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 target-speed) 32768.0) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 acceleration) 32768.0) + ) + 0 + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-4 (-> self nav state))) + (set! (-> gp-0 quad) (-> a1-4 heading quad)) + ) + (vector-normalize! gp-0 614400.0) + (vector+! (-> self dive-target-point) (-> self root trans) gp-0) + (set! (-> self dive-target-point quad) (-> gp-0 quad)) + ) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) + ) + (set! (-> self dive-finished?) #f) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) + ) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) + (when (-> self nav) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-dive)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (add-offset-to-target! (-> self nav state) (-> self dive-target-point)) + (if (>= (ja-frame-num 0) 6.0) + (vector-v*float++! (-> self dive-target-point) (-> self dive-target-point) -20.0) + ) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (set! (-> self dive-finished?) #t) + (set! (-> self root transv quad) (the-as uint128 0)) + (go-virtual cower-ground) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 *null-vector*) + ) + (logior! (-> a0-0 flags) (nav-state-flag directional-mode)) + (set! (-> a0-0 travel quad) (-> v1-1 quad)) + ) + 0 + (if (-> self dive-finished?) + (enemy-common-post self) + (nav-enemy-method-187 self) + ) + ) + ) + +;; failed to figure out what this is: +(defstate cower-ground (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-8 (-> self root root-prim))) + (set! (-> v1-8 prim-core collide-as) (collide-spec)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (let ((v1-12 (-> self nav))) + (set! (-> v1-12 sphere-mask) (the-as uint 0)) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 0.2 0.2 0.2 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) + ) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) + (when (-> self nav) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self info anim-cover-head-start)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self info anim-cover-head-loop)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) + (goto cfg-9) + ) + ) + #f + (label cfg-9) + (ja-no-eval :group! (-> self draw art-group data (-> self info anim-cover-head-end)) + :num! (seek! max (-> self speed-scale)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + (go-virtual get-up-front) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 *null-vector*) + ) + (logior! (-> a0-0 flags) (nav-state-flag directional-mode)) + (set! (-> a0-0 travel quad) (-> v1-1 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +;; definition for method 233 of type civilian +;; WARN: Return type mismatch int vs none. +(defmethod start-ragdoll ((this civilian) (arg0 art-joint-anim)) + (cond + ((handle->process (-> this ragdoll-proc)) + (ja-channel-push! 1 0) + (let ((s4-0 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! s4-0 arg0 num-func-identity) + (set! (-> s4-0 frame-num) 0.0) + ) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))) ragdoll) this) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! gp-1 arg0 num-func-identity) + (set! (-> gp-1 frame-num) 0.0) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (civilian) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((a0-3 (-> self nav state)) + (v1-5 *null-vector*) + ) + (logior! (-> a0-3 flags) (nav-state-flag directional-mode)) + (set! (-> a0-3 travel quad) (-> v1-5 quad)) + ) + 0 + (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (vector-reset! (-> self root transv)) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :code (behavior () + (let ((v1-1 (if (zero? (-> self hit-face)) + (-> self anim-get-up-front) + (-> self anim-get-up-back) + ) + ) + ) + (start-ragdoll self (the-as art-joint-anim (-> self draw art-group data v1-1))) + ) + (ja-no-eval :num! (seek! max (-> self speed-scale))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (if (enemy-method-109 self) + (go-die self) + (go-virtual flee) + ) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-front (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (start-ragdoll self (the-as art-joint-anim (-> self draw art-group data (-> self anim-get-up-front)))) + (ja-no-eval :num! (seek! max (-> self speed-scale))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (go-virtual flee) + ) + :post (behavior () + (reset-penetrate! self) + (let ((a0-1 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-3 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-back (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) + ) + ) + :exit (behavior () + (if *citizen-debug* + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (start-ragdoll self (the-as art-joint-anim (-> self draw art-group data (-> self anim-get-up-back)))) + (ja-no-eval :num! (seek! max (-> self speed-scale))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (go-virtual flee) + ) + :post (behavior () + (reset-penetrate! self) + (let ((a0-1 (-> self nav state)) + (v1-3 *null-vector*) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-3 quad)) + ) + 0 + (enemy-common-post self) + ) + ) + +;; definition for function civilian-falling-post +;; INFO: Used lq/sq +(defbehavior civilian-falling-post civilian () + (let ((gp-0 (-> self root))) + (cond + ((focus-test? self under-water) + (accelerate-fall! self (-> gp-0 transv)) + ) + (else + (let ((a1-1 (new-stack-vector0))) + (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 a1-1 (-> self enemy-info slip-factor))) + ) + ) + ) + (let ((a2-1 (new 'stack-no-clear 'collide-query))) + (set! (-> a2-1 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> a2-1 ignore-process0) self) + (set! (-> a2-1 ignore-process1) (-> self vehicle process 0)) + (set! (-> a2-1 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> gp-0 pat-ignore-mask))) + (set! (-> a2-1 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide gp-0 (-> gp-0 transv) a2-1 (meters 0)) + ) + ) + (apply-friction self) + (enemy-common-post self) + (none) + ) + +;; definition for method 90 of type civilian +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-90 ((this civilian) (arg0 ragdoll-proc)) + (let* ((s3-0 (-> arg0 ragdoll)) + (s2-0 (-> s3-0 ragdoll-joints)) + (s1-0 + (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (-> s3-0 orient-tform) (-> s3-0 orient-tform w)) + ) + (s4-0 (new 'stack-no-clear 'matrix)) + (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + ) + (quaternion-normalize! (quaternion*! s1-0 (the-as quaternion (-> s2-0 0)) s1-0)) + (quaternion->matrix s4-0 s1-0) + (if (logtest? (-> s3-0 ragdoll-flags) (ragdoll-flag mirror)) + (matrix*! s4-0 s4-0 (-> s3-0 mirror)) + ) + (cond + ((>= (vector-dot (-> s5-0 uvec) (-> s4-0 fvec)) 0.0) + (set! (-> this hit-face) (the-as uint 1)) + (vector-negate! (-> s4-0 uvec) (-> s4-0 uvec)) + ) + (else + (set! (-> this hit-face) (the-as uint 0)) + 0 + ) + ) + (vector-flatten! (-> s5-0 fvec) (-> s4-0 uvec) (-> s5-0 uvec)) + (vector-normalize! (-> s5-0 fvec) 1.0) + (vector-cross! (-> s5-0 rvec) (-> s5-0 uvec) (-> s5-0 fvec)) + (matrix->quaternion (-> this root quat) s5-0) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate knocked (civilian) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type citizen knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self hit-face) + (the-as + uint + (if (< (vector-dot (-> self root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + 0.0 + ) + 1 + 0 + ) + ) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type citizen knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (reset-penetrate! self) + ) + ) + +;; failed to figure out what this is: +(defstate wait-for-ride (civilian) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('board-vehicle) + (let ((a0-1 (the-as process (-> block param 0)))) + (when a0-1 + (let ((v0-0 (the-as object (process->handle a0-1)))) + (set! (-> self vehicle) (the-as handle v0-0)) + v0-0 + ) + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((a0-5 (-> self nav state)) + (v1-10 *null-vector*) + ) + (logior! (-> a0-5 flags) (nav-state-flag directional-mode)) + (set! (-> a0-5 travel quad) (-> v1-10 quad)) + ) + 0 + (set! (-> self vehicle) (the-as handle #f)) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + ) + :trans (behavior () + (if (and (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) (< (-> self root trans y) 4096.0)) + (go-virtual in-ditch) + ) + (when (-> self vehicle) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info object-type) + (((traffic-type civilian-car-a) + (traffic-type civilian-car-b) + (traffic-type civilian-car-c) + (traffic-type civilian-bike-a) + (traffic-type civilian-bike-b) + (traffic-type civilian-bike-c) + ) + (go-virtual move-to-vehicle) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max 0.1) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; definition for method 232 of type civilian +(defmethod civilian-method-232 ((this civilian) (arg0 vector)) + (let ((s3-0 (the-as vehicle (handle->process (-> this vehicle)))) + (s4-0 (new 'stack 'collide-query)) + ) + (vehicle-method-66 s3-0 arg0 (-> this seat)) + (vector-! arg0 arg0 (-> s3-0 root trans)) + (vector-normalize! arg0 (+ 14336.0 (vector-length arg0))) + (vector+! arg0 arg0 (-> s3-0 root trans)) + (when (enemy-above-ground? this s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> arg0 y) (-> s4-0 best-other-tri intersect y)) + (let ((v1-14 (-> this nav)) + (a1-10 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-10 vertex)) arg0 (the-as vector (-> v1-14 state mesh bounds))) + (set! (-> a1-10 vertex1 x) (-> v1-14 nearest-y-threshold)) + (set! (-> a1-10 data 20) (the-as uint 2)) + (if (nav-mesh-method-45 (-> v1-14 state mesh) a1-10) + (return #t) + ) + ) + ) + ) + #f + ) + +;; definition for function do-spline2 +(defun do-spline2 ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate move-to-vehicle (civilian) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (enemy-event-handler proc argc message block) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-4 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-4 enemy-flags))) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-4 enemy-flags)))) + ) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-4 enemy-flags)))) + (set! (-> v1-4 nav callback-info) (-> v1-4 enemy-info callback-info)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-7 enemy-flags)))) + ) + 0 + (nav-enemy-method-177 self) + (let ((v1-12 (-> self nav state))) + (set! (-> v1-12 speed) 0.0) + ) + 0 + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 sphere-mask) (the-as uint #x1000f8)) + ) + 0 + ) + :exit (behavior () + (let ((v1-0 (-> self nav))) + (set! (-> v1-0 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + (logclear! (-> self flags) (citizen-flag persistent)) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s0-0 (the-as vehicle (handle->process (-> self vehicle))))) + (cond + (s0-0 + (set! (-> self seat) + (get-best-seat s0-0 (-> self root trans) (the-as vehicle-seat-flag (-> self info seat-flag)) 1) + ) + (cond + ((!= (-> self seat) -1) + (vehicle-method-66 s0-0 gp-0 (-> self seat)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (set! (-> s2-0 quad) (-> self root trans quad)) + (set! (-> s1-0 quad) (-> gp-0 quad)) + (vector-! s5-0 gp-0 (-> s0-0 root trans)) + (vector-z-quaternion! s4-0 (-> self root quat)) + (let ((f30-1 (* 0.5 (vector-vector-xz-distance s2-0 s1-0)))) + (vector-normalize! s4-0 (* 2.0 f30-1)) + (vector-normalize! s5-0 (* 4.0 f30-1)) + ) + (do-spline2 s3-0 s2-0 s4-0 s1-0 s5-0 0.8) + (let ((v1-21 (-> self nav state))) + (logclear! (-> v1-21 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-21 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-21 target-pos quad) (-> s3-0 quad)) + ) + ) + 0 + (if (and (< (vector-dot (vector-normalize! s4-0 1.0) (vector-normalize! s5-0 1.0)) -0.5) + (< (vector-vector-xz-distance gp-0 (-> self root trans)) 18432.0) + (< (fabs (- (-> gp-0 y) (-> self root trans y))) 20480.0) + ) + (go-virtual board-vehicle) + ) + ) + ) + (else + (go-virtual wait-for-ride) + ) + ) + ) + (else + (go-virtual wait-for-ride) + ) + ) + ) + (if (< 73728.0 (vector-vector-xz-distance gp-0 (-> self root trans))) + (go-virtual wait-for-ride) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate board-vehicle (civilian) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('vehicle-crash) + #f + ) + (('end-task) + (go-die self) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-7 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot)) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (local-vars (sv-128 float) (sv-144 float)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) :num! min) + (let ((f30-0 0.0)) + (while (< f30-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 1.0 (+ (* -2.0 f30-0 f30-0 f30-0) (* 3.0 f30-0 f30-0)) 0.0 1.0) + ) + (suspend) + (+! f30-0 (* 3.0 (seconds-per-frame))) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (set! (-> gp-2 quad) (-> self root trans quad)) + (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) + :num! (seek! (ja-aframe 5.0 0) 0.86956525) + :frame-num (ja-aframe 1.0 0) + ) + (until (ja-done? 0) + (let ((s2-0 (the-as vehicle (handle->process (-> self vehicle)))) + (s1-0 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s2-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! s3-0 (-> s2-0 root quat)) + (vehicle-method-66 s2-0 s1-0 (-> self seat)) + (vector-! s4-1 s1-0 gp-2) + (let ((s2-1 lerp-scale) + (s1-1 0.0) + (s0-0 1.0) + ) + (set! sv-128 (ja-aframe-num 0)) + (set! sv-144 (ja-aframe 1.0 0)) + (let* ((t0-1 (ja-aframe 5.0 0)) + (f30-1 (s2-1 s1-1 s0-0 sv-128 sv-144 t0-1)) + ) + (quaternion-rotate-local-y! s3-0 s3-0 (* f30-1 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + (quaternion-slerp! (-> self root quat) s5-0 s3-0 f30-1) + (vector+float*! (-> self root trans) gp-2 s4-1 f30-1) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 5.0 0) 0.86956525)) + ) + ) + ) + (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) + :num! (seek! (ja-aframe 12.0 0) 0.4) + :frame-num (ja-aframe 5.0 0) + ) + (until (ja-done? 0) + (let ((s5-1 (the-as vehicle (handle->process (-> self vehicle)))) + (gp-4 (new 'stack-no-clear 'quaternion)) + ) + (if (not s5-1) + (go-virtual wait-for-ride) + ) + (quaternion-copy! gp-4 (-> s5-1 root quat)) + (vehicle-method-66 s5-1 (-> self root trans) (-> self seat)) + (let ((f0-22 (lerp-scale 0.0 1.0 (ja-aframe-num 0) (ja-aframe 7.0 0) (ja-aframe 10.0 0)))) + (quaternion-rotate-local-y! (-> self root quat) gp-4 (* (- 1.0 f0-22) (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 0.4)) + ) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate ride (civilian) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit-vehicle) + (let ((a0-1 (the-as object (-> block param 0)))) + (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) + ) + (if (time-elapsed? (-> self state-time) (seconds 1)) + (go-virtual exit-vehicle) + ) + ) + (('end-task) + (go-die self) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-7 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (when (-> self nav) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-5 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-8 self)) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logclear (-> v1-8 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate exit-vehicle (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (change-to (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)) self) + (if (not (-> self nav)) + (go-inactive self) + ) + (let ((v1-8 (-> self nav state))) + (set! (-> v1-8 current-poly) (the-as nav-poly #f)) + ) + 0 + (citizen-method-208 + self + (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (let ((a0-7 (-> self nav state)) + (v1-14 (-> self dest-point)) + ) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-pos quad) (-> v1-14 quad)) + ) + 0 + (citizen-method-195 self) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (logior! (-> self flags) (citizen-flag persistent)) + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + (set-time! (-> self state-time)) + (let ((v1-28 (-> self root root-prim))) + (set! (-> v1-28 prim-core collide-as) (collide-spec)) + (set! (-> v1-28 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-30 self)) + (set! (-> v1-30 enemy-flags) (the-as enemy-flag (logclear (-> v1-30 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-30 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-33 self)) + (set! (-> v1-33 enemy-flags) (the-as enemy-flag (logclear (-> v1-33 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (local-vars (sv-128 float) (sv-144 float)) + (ja-channel-push! 1 (seconds 0.1)) + (remove-riders (the-as vehicle (handle->process (-> self vehicle))) (the-as handle self)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) + :num! (seek! (ja-aframe 5.0 0) 0.5) + :frame-num (ja-aframe 12.0 0) + ) + (until (ja-done? 0) + (let ((s5-0 (the-as vehicle (handle->process (-> self vehicle)))) + (gp-1 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! gp-1 (-> s5-0 root quat)) + (vehicle-method-66 s5-0 (-> self root trans) (-> self seat)) + (let ((f0-3 (lerp-scale 0.0 1.0 (ja-aframe-num 0) (ja-aframe 10.0 0) (ja-aframe 7.0 0)))) + (quaternion-rotate-local-y! (-> self root quat) gp-1 (* f0-3 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 5.0 0) 0.5)) + ) + (let ((gp-3 (new 'stack-no-clear 'vector)) + (s5-2 (new 'stack-no-clear 'quaternion)) + ) + (while (not (civilian-method-232 self gp-3)) + (let ((s4-1 (the-as vehicle (handle->process (-> self vehicle)))) + (s3-1 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s3-1 (-> s4-1 root quat)) + (vehicle-method-66 s4-1 (-> self root trans) (-> self seat)) + (quaternion-rotate-local-y! (-> self root quat) s3-1 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + ) + (suspend) + ) + (let ((v1-43 (the-as vehicle (handle->process (-> self vehicle))))) + (quaternion-copy! s5-2 (-> v1-43 root quat)) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) + :num! (seek! (ja-aframe 1.0 0) 0.5) + :frame-num (ja-aframe 5.0 0) + ) + (until (ja-done? 0) + (let ((a0-46 (the-as vehicle (handle->process (-> self vehicle)))) + (s2-1 (new 'stack-no-clear 'vector)) + (s4-3 (new 'stack-no-clear 'vector)) + (s3-2 (new 'stack-no-clear 'quaternion)) + ) + (vehicle-method-66 a0-46 s2-1 (-> self seat)) + (vector-! s4-3 s2-1 gp-3) + (let ((s2-2 lerp-scale) + (s1-1 0.0) + (s0-0 1.0) + ) + (set! sv-128 (ja-aframe-num 0)) + (set! sv-144 (ja-aframe 5.0 0)) + (let* ((t0-1 (ja-aframe 1.0 0)) + (f0-12 (s2-2 s1-1 s0-0 sv-128 sv-144 t0-1)) + (f30-0 (- 1.0 f0-12)) + ) + (quaternion-rotate-local-y! s3-2 s5-2 (if (zero? (-> self seat)) + -16384.0 + 16384.0 + ) + ) + (quaternion-copy! (-> self root quat) s3-2) + (vector+float*! (-> self root trans) gp-3 s4-3 f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 1.0 0) 0.5)) + ) + ) + (let ((v1-74 (-> self root root-prim))) + (set! (-> v1-74 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-74 prim-core collide-with) (-> self root backup-collide-with)) + ) + (go-virtual active) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate wait-at-dest (civilian) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max 0.1) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; definition for method 215 of type civilian +;; WARN: Return type mismatch city-attacker-info-flag vs none. +(defmethod citizen-method-215 ((this civilian)) + (when (and *cty-attack-controller* (nonzero? *cty-attack-controller*)) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 1) + (logior! (-> this attacker-info flags) (city-attacker-info-flag cai1)) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/guard_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/guard_REF.gc new file mode 100644 index 0000000000..98af2d26c7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/guard_REF.gc @@ -0,0 +1,2337 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *guard-died-recently?*, type symbol +(define *guard-died-recently?* #f) + +;; failed to figure out what this is: +(defskelgroup skel-crimson-guard crimson-guard crimson-guard-lod0-jg -1 + ((crimson-guard-lod0-mg (meters 20)) (crimson-guard-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow crimson-guard-shadow-mg + :origin-joint-index 3 + ) + +;; definition for symbol *crimson-guard-global-info*, type guard-global-info +(define *crimson-guard-global-info* + (new 'static 'guard-global-info + :knocked (new 'static 'array int32 2 31 8) + :knocked-land (new 'static 'array int32 2 32 9) + :yellow-hit-anim (new 'static 'inline-array guard-anim-info 2 + (new 'static 'guard-anim-info :anim-index (new 'static 'array int32 2 13 15)) + (new 'static 'guard-anim-info :anim-index (new 'static 'array int32 2 15 13)) + ) + :yellow-land-anim (new 'static 'inline-array guard-anim-info 2 + (new 'static 'guard-anim-info :anim-index (new 'static 'array int32 2 14 16)) + (new 'static 'guard-anim-info :anim-index (new 'static 'array int32 2 16 14)) + ) + :blue-hit-anim (new 'static 'array int32 1 10) + :pad (new 'static 'array uint8 4 #xa #x0 #x0 #x0) + ) + ) + +;; definition for symbol *crimson-guard-nav-enemy-info*, type nav-enemy-info +(define *crimson-guard-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 8 + :knocked-land-anim 9 + :die-anim 17 + :die-falling-anim 8 + :victory-anim 4 + :jump-wind-up-anim 7 + :jump-in-air-anim 4 + :jump-land-anim 7 + :neck-joint 30 + :look-at-joint 6 + :bullseye-joint 5 + :sound-hit (static-sound-name "guard-hit") + :sound-die (static-sound-name "guard-die") + :notice-distance (meters 100) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 100) + :default-hit-points 4.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 4.5) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 61440.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim 5 + :run-anim 6 + :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 8) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 3) + :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! (-> *crimson-guard-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 193 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod set-squad ((this crimson-guard)) + (set! (-> this squad) *ff-squad-control*) + 0 + (none) + ) + +;; definition for method 259 of type crimson-guard +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod crimson-guard-method-259 ((this crimson-guard) (arg0 vector)) + (local-vars + (sv-240 vector) + (sv-256 (function vector vector vector)) + (sv-272 vector) + (sv-288 vector) + (sv-304 vector) + (sv-320 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! sv-240 arg0) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (let ((v1-1 (-> this root trans))) + (let ((a0-1 *y-vector*)) + (let ((a1-2 8192.0)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-1 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 (&-> s0-0 quad) vf6) + (set! sv-320 (new 'stack-no-clear 'vector)) + (set! sv-304 (new 'stack-no-clear 'vector)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (-> this node-list data 4 bone transform) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (set! (-> s0-0 quad) (-> this root trans quad)) + (cond + ((logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags)) + (let ((a1-6 s0-0)) + (let ((v1-13 s0-0)) + (let ((a0-9 s4-0)) + (let ((a2-1 4096.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.lvf vf4 (&-> v1-13 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 (&-> a1-6 quad) vf6) + ) + ) + (else + (let ((a1-7 s0-0)) + (let ((v1-14 s0-0)) + (let ((a0-10 s4-0)) + (let ((a2-3 2048.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.lvf vf4 (&-> v1-14 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 (&-> a1-7 quad) vf6) + ) + ) + ) + (let ((a1-8 s0-0)) + (let ((v1-15 s0-0)) + (let ((a0-11 s3-0)) + (let ((a2-5 8540.16)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-11 quad)) + ) + (.lvf vf4 (&-> v1-15 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 (&-> a1-8 quad) vf6) + ) + (vector-normalize! (vector-! sv-320 sv-240 s0-0) 1.0) + (set! sv-288 (new 'stack-no-clear 'vector)) + (let ((v1-19 (-> sv-240 quad))) + (set! (-> sv-288 quad) v1-19) + ) + (set! sv-256 vector-rotate90-around-y!) + (set! sv-272 (new 'stack-no-clear 'vector)) + (let* ((a1-13 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) sv-288 s0-0) -2998.272)) + (v0-5 (sv-256 sv-272 a1-13)) + ) + (vector+! sv-288 sv-288 v0-5) + ) + (vector-normalize! (vector-! sv-320 sv-288 s0-0) 1.0) + (vector-z-quaternion! sv-304 (-> this root quat)) + (rot-zxy-from-vector! s2-0 sv-304) + (rot-zxy-from-vector! s1-0 sv-320) + (set! (-> s5-0 x) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 x) (-> s2-0 x))))) + (set! (-> s5-0 y) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 y) (-> s2-0 y))))) + (set! (-> s5-0 z) 0.0) + (let ((s2-1 (new 'stack-no-clear 'quaternion))) + (let ((s1-1 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s2-1 s4-0 (-> s5-0 x)) + (quaternion-vector-angle! s1-1 s3-0 (-> s5-0 y)) + (quaternion*! s2-1 s1-1 s2-1) + ) + (quaternion-slerp! (-> this joint quat) (-> this joint quat) s2-1 (* 5.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 260 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod crimson-guard-method-260 ((this crimson-guard)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) + 0 + (none) + ) + +;; definition for symbol *guard-min-id-hack*, type int +(define *guard-min-id-hack* 255) + +;; definition for method 59 of type crimson-guard +;; WARN: Return type mismatch time-frame vs none. +(defmethod enemy-common-post ((this crimson-guard)) + (when (nonzero? (-> this controller branch)) + (let* ((v1-2 *cty-faction-manager*) + (a1-0 (-> this controller branch clock-type)) + (s5-0 (-> v1-2 territory-faction-modes 0 data (+ 0 (* a1-0 16)))) + ) + (when (!= (-> this faction-mode) s5-0) + (if (not (send-event this 'change-faction-mode s5-0 (-> this faction-mode))) + (set! (-> this faction-mode) (the-as uint s5-0)) + ) + ) + ) + ) + (crimson-guard-method-261 this) + (if (= (-> this faction-mode) 1) + (logclear! (-> this flags) (citizen-flag persistent)) + ) + (let ((t9-2 (method-of-type citizen enemy-common-post))) + (t9-2 this) + ) + (update-transforms (-> this root)) + (if (< (-> this traffic-id) *guard-min-id-hack*) + (set! *guard-min-id-hack* (-> this traffic-id)) + ) + (if (-> this joint-enable) + (crimson-guard-method-259 this (-> this target-pos-predict-miss)) + (crimson-guard-method-260 this) + ) + (if (logtest? (-> this draw status) (draw-control-status on-screen)) + (set-time! (-> this last-onscreen-time)) + ) + (none) + ) + +;; definition for method 81 of type crimson-guard +(defmethod go-die ((this crimson-guard)) + (set! *guard-died-recently?* #t) + ((method-of-type nav-enemy go-die) this) + ) + +;; definition for method 80 of type crimson-guard +(defmethod go-best-state ((this crimson-guard)) + (if (not (logtest? (-> this flags) (citizen-flag hostile))) + (go (method-of-object this active)) + (go-hostile this) + ) + ) + +;; definition for method 62 of type crimson-guard +(defmethod get-damage-from-attack ((this crimson-guard) (arg0 object) (arg1 event-message-block)) + (let ((v0-0 ((method-of-type nav-enemy get-damage-from-attack) this arg0 arg1))) + (-> arg1 param 1) + v0-0 + ) + ) + +;; definition for method 20 of type crimson-guard +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this crimson-guard)) + (the-as search-info-flag (cond + ((not (-> *setting-control* user-current gun-target-guards?)) + 1 + ) + ((and (-> this next-state) (let ((v1-5 (-> this next-state name))) + (or (= v1-5 'exit-transport) (= v1-5 'jump)) + ) + ) + 0 + ) + (else + (the-as int (call-parent-method this)) + ) + ) + ) + ) + +;; definition for method 82 of type crimson-guard +;; INFO: Used lq/sq +;; WARN: disable def twice: 182. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('victory) + (when (= (-> this faction-mode) 1) + (crimson-guard-method-285 this 100) + (set! (-> this hit-points) (fmax 2.0 (-> this hit-points))) + (+! (-> this hit-points) 2.0) + (set! (-> this hit-points) (fmin 8.0 (-> this hit-points))) + ) + ) + (('member-attacked) + (set! v0-0 (lambda ((arg0 process) (arg1 city-attacker-info)) + (if (zero? (-> arg1 self-type)) + (-> *cty-attack-controller* guard-angry-hatred-info-index) + -1 + ) + ) + ) + (set! (-> this attacker-info hatred-map-callback) (the-as (function process city-attacker-info int) v0-0)) + v0-0 + ) + (('change-faction-mode) + (let ((a0-6 (-> arg3 param 1)) + (v1-8 (-> arg3 param 0)) + ) + (when (and (= a0-6 0) (= v1-8 1)) + (crimson-guard-method-285 this 100) + (set! (-> this hit-points) 7.0) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this target-status handle) (the-as handle #f)) + ) + ) + #f + ) + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-14 *speech-control* (the-as handle this)) + (if (>= (-> this hit-points) 1.0) + (speech-control-method-13 *speech-control* this (speech-type guard-hit) (-> this traffic-id)) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('event-death) + (if (= (-> this hit-points) 0.0) + (do-effect (-> this skel effect) "death-default" 0.0 -1) + ) + ) + (('change-guard-type) + (crimson-guard-method-267 this (the-as guard-type (-> arg3 param 0)) #f) + ) + (('bouncing-off) + (when (or (and (-> this next-state) (= (-> this next-state name) 'active)) + (and (-> this next-state) (= (-> this next-state name) 'wait)) + ) + (speech-control-method-17 *speech-control* (speech-type guard-chatter) 0.3) + (speech-control-method-17 *speech-control* (speech-type guard-chatter-jak) 0.3) + (speech-control-method-13 *speech-control* this (speech-type guard-bumped-by-jak) (-> this traffic-id)) + (go (method-of-object this close-attack-active)) + ) + ) + (('combo) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (!= (-> this hit-points) 0.0)) + ) + ) + (('avoid) + #f + ) + (('panic) + (set-time! (-> this last-danger-time)) + (let ((s5-1 (the-as object (-> arg3 param 0)))) + (case (-> (the-as traffic-danger-info s5-1) danger-type) + ((7) + (set! (-> this cp-factor) 20.0) + (let ((s4-1 (method-of-object this citizen-method-210)) + (s3-1 1) + (s5-2 (handle->process (-> (the-as traffic-danger-info s5-1) handle))) + ) + (s4-1 this s3-1 (if (type? s5-2 process-focusable) + s5-2 + ) + ) + ) + ) + ((6) + (when (and (< 1.5 (-> (the-as traffic-danger-info s5-1) danger-level)) + (and (and (-> this next-state) (let ((v1-61 (-> this next-state name))) + (or (= v1-61 'hostile) + (= v1-61 'grenade-throw) + (= v1-61 'grenade-throw-post-reloading) + (= v1-61 'search) + (= v1-61 'active) + (= v1-61 'idle) + (= v1-61 'tazer-hostile) + (= v1-61 'grenade-hostile) + (= v1-61 'rifle-hostile) + ) + ) + ) + (< (vector-vector-xz-distance (-> this root trans) (the-as vector (+ (the-as uint s5-1) 0))) 32768.0) + ) + ) + (set! (-> this danger-pos quad) (-> (the-as traffic-danger-info s5-1) sphere quad)) + (go (method-of-object this flee-danger)) + ) + ) + ) + ) + ) + (('clear-path) + (set-time! (-> this last-danger-time)) + (let ((v1-69 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-69 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-69 velocity quad)) + (let ((v1-70 (-> v1-69 danger-type))) + (cond + ((zero? v1-70) + (citizen-method-210 this 1 *target*) + ) + ((= v1-70 1) + ) + ((= v1-70 2) + ) + ((= v1-70 3) + ) + ((= v1-70 4) + ) + ((= v1-70 5) + ) + ((= v1-70 6) + ) + ((= v1-70 7) + (citizen-method-210 this 1 *target*) + ) + ) + ) + ) + (let ((s5-3 (-> this cp-plane))) + (set! (-> s5-3 quad) (-> this cp-vec quad)) + (set! (-> s5-3 y) 0.0) + (vector-rotate90-around-y! s5-3 s5-3) + (vector-normalize! s5-3 1.0) + (set! (-> s5-3 w) (- (vector-dot (the-as vector s5-3) (the-as vector (-> this cp-sphere))))) + ) + (set! v0-0 (+ (current-time) (seconds 1))) + (set! (-> this cp-exit-time) (the-as time-frame v0-0)) + v0-0 + ) + (('end-pursuit) + (when *debug-segment* + (when (focus-test? this inactive) + (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> this pid)) + (break!) + 0 + ) + ) + (when (not (focus-test? this dead)) + (when (logtest? (-> this flags) (citizen-flag hostile)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-208 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) + ) + ) + ) + (('alert-begin) + (when *debug-segment* + (when (focus-test? this inactive) + (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> this pid)) + (break!) + 0 + ) + ) + ) + (('alert-end) + (when *debug-segment* + (when (focus-test? this inactive) + (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> this pid)) + (break!) + 0 + ) + ) + ) + (('notify) + (let ((a0-86 (-> arg3 param 0)) + (v1-111 (the-as object (-> arg3 param 1))) + ) + (when (= a0-86 'attack) + (when (not (logtest? (-> (the-as process-focusable v1-111) mask) (process-mask target))) + (when (focus-test? (the-as process-focusable v1-111) dead) + (format #t "guard killed target~%") + (speech-control-method-13 *speech-control* this (speech-type guard-battle-victory) (-> this traffic-id)) + ) + ) + ) + ) + ) + (else + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 27 of type crimson-guard +(defmethod get-inv-mass ((this crimson-guard)) + 0.6666667 + ) + +;; definition for method 86 of type crimson-guard +(defmethod knocked-land-anim ((this crimson-guard) (arg0 enemy-knocked-info)) + (cond + ((>= 0.0 (-> this hit-points)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + (a0-5 (-> this skel root-channel 0)) + ) + (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim a1-2) num-func-seek!) + ) + (set! (-> this hit-face) (the-as uint -1)) + #t + ) + (else + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type red-shot) (knocked-type vehicle)) + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((= (-> this small-hit) 1) + (let ((a1-7 (-> this + draw + art-group + data + (-> (the-as + guard-global-info + (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim) 8)) (the-as uint (-> this info))) + ) + yellow-land-anim + 0 + anim-index-front + ) + ) + ) + (a0-16 (-> this skel root-channel 0)) + ) + (set! (-> a0-16 frame-group) (the-as art-joint-anim a1-7)) + (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) + (set! (-> a0-16 param 1) (-> arg0 anim-speed)) + (set! (-> a0-16 frame-num) 0.0) + (joint-control-channel-group! a0-16 (the-as art-joint-anim a1-7) num-func-seek!) + ) + (set! (-> this hit-face) (the-as uint -1)) + #t + ) + (else + (let ((a1-8 (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + (a0-20 (-> this skel root-channel 0)) + ) + (set! (-> a0-20 frame-group) (the-as art-joint-anim a1-8)) + (set! (-> a0-20 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) + (set! (-> a0-20 param 1) (-> arg0 anim-speed)) + (set! (-> a0-20 frame-num) 0.0) + (joint-control-channel-group! a0-20 (the-as art-joint-anim a1-8) num-func-seek!) + ) + #t + ) + ) + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-23 (-> this skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) + (set! (-> a0-23 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) + ) + (set! (-> a0-23 param 1) (-> arg0 anim-speed)) + (set! (-> a0-23 frame-num) 0.0) + (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) + ) + (set! (-> this hit-face) (the-as uint -1)) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-12 (-> this draw art-group data (-> this info knocked-land (-> this hit-face))))) + (set! (-> arg0 anim-speed) 1.0) + (let ((a0-28 (-> this skel root-channel 0))) + (set! (-> a0-28 frame-group) (the-as art-joint-anim a1-12)) + (set! (-> a0-28 param 0) (the float (+ (-> (the-as art-joint-anim a1-12) frames num-frames) -1))) + (set! (-> a0-28 param 1) (-> arg0 anim-speed)) + (set! (-> a0-28 frame-num) 0.0) + (joint-control-channel-group! a0-28 (the-as art-joint-anim a1-12) num-func-seek!) + ) + ) + #t + ) + ) + ) + ) + ) + +;; definition for method 212 of type crimson-guard +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod go-from-behavior ((this crimson-guard) (arg0 traffic-object-spawn-params)) + (let ((a1-1 (-> arg0 guard-type))) + (if (or (and (!= a1-1 11) (!= a1-1 (-> this guard-type))) (= (-> arg0 behavior) 11)) + (crimson-guard-method-267 this (the-as guard-type a1-1) (= (-> arg0 behavior) 11)) + ) + ) + (when #f + (let ((s4-0 (new 'stack-no-clear 'shield-sphere-spawn-params))) + (set! (-> s4-0 owner) (process->handle this)) + (set! (-> s4-0 sphere-size) 3.4) + (set! (-> s4-0 shield-strength) 3) + (set! (-> s4-0 shield-type) (shield-type shield-type-0)) + (set! (-> s4-0 enable-time) (seconds 3)) + (set! (-> s4-0 disable-time) (seconds 1.5)) + (set! (-> s4-0 offset-vec quad) (-> *up-vector* quad)) + (vector-float*! (-> s4-0 offset-vec) (-> s4-0 offset-vec) 8192.0) + (let ((s3-0 (the-as process #f))) + (let* ((s2-0 (get-process *default-dead-pool* shield-sphere #x4000 1)) + (v1-22 (when s2-0 + (let ((t9-2 (method-of-type process activate))) + (t9-2 s2-0 this "process" (the-as pointer #x70004000)) + ) + (run-now-in-process s2-0 shield-sphere-init-by-other s4-0) + (-> s2-0 ppointer) + ) + ) + ) + (if v1-22 + (set! s3-0 (-> v1-22 0)) + ) + ) + (if s3-0 + (set! (-> this shield-handle) (process->handle s3-0)) + ) + ) + ) + ) + (case (-> arg0 behavior) + ((5) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + (let ((s4-1 (-> this focus)) + (s3-1 (method-of-type enemy-focus enemy-focus-method-13)) + (s5-1 (handle->process (-> arg0 handle))) + ) + (s3-1 + s4-1 + (the-as process-focusable (if (type? s5-1 process-focusable) + s5-1 + ) + ) + (enemy-aware ea3) + ) + ) + (go (method-of-object this arrest)) + ) + ((6) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + (logior! (-> this flags) (citizen-flag hostile)) + (set! (-> this transport) (-> arg0 handle)) + (set! (-> this transport-side) (-> arg0 user-data)) + (crimson-guard-method-265 this 0.0) + (let* ((s4-2 (-> this squad)) + (s5-2 (get-focus s4-2)) + ) + (if (and (>= (the-as uint (get-alert-level s4-2)) (the-as uint 1)) s5-2) + (try-update-focus (-> this focus) s5-2 this) + ) + ) + (go (method-of-object this exit-transport)) + ) + ((9) + (if (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (logior! (-> this flags) (citizen-flag persistent)) + ) + (set! (-> this focus handle) (-> arg0 handle)) + (set! (-> this target-status handle) (-> arg0 handle)) + (go (method-of-object this waiting-ambush)) + ) + ((3) + (set! (-> this focus handle) (-> arg0 handle)) + (set! (-> this target-status handle) (-> arg0 handle)) + (go-hostile this) + ) + ((11) + (set! (-> this root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> this root quat) (-> arg0 rotation)) + (set! (-> this vehicle) (-> arg0 handle)) + (ja-channel-set! 1) + (case (-> (the-as vehicle (handle->process (-> this vehicle))) info object-type) + (((traffic-type civilian-bike-a) + (traffic-type civilian-bike-b) + (traffic-type civilian-bike-c) + (traffic-type guard-bike) + ) + (logior! (-> this flags) (citizen-flag knocked-out-bike)) + (let ((v1-93 (-> this skel root-channel 0))) + (set! (-> v1-93 frame-group) (the-as art-joint-anim (-> this draw art-group data 35))) + ) + ) + (((traffic-type civilian-car-a) + (traffic-type civilian-car-b) + (traffic-type civilian-car-c) + (traffic-type guard-car) + ) + (logior! (-> this flags) (citizen-flag knocked-out-car)) + (let ((v1-99 (-> this skel root-channel 0))) + (set! (-> v1-99 frame-group) (the-as art-joint-anim (-> this draw art-group data 36))) + ) + ) + ) + (ja-post) + (go (method-of-object this knocked-off-vehicle)) + ) + (else + ((method-of-type citizen go-from-behavior) this arg0) + ) + ) + 0 + (none) + ) + +;; definition for method 258 of type crimson-guard +;; INFO: Used lq/sq +(defmethod crimson-guard-method-258 ((this crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((f0-0 1228.8) + (f30-0 6144.0) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> s5-0 move-dist) arg1 arg0) + (let ((v1-4 s5-0)) + (set! (-> v1-4 radius) f0-0) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (cond + ((>= f0-1 0.0) + (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) f0-1) + (cond + ((< (vector-dot + (-> s5-0 best-other-tri normal) + (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri))) + ) + 0.0 + ) + (return 1) + ) + (else + ) + ) + ) + (else + (vector-! (-> s5-0 move-dist) arg1 arg0) + ) + ) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (let ((a0-19 (-> s5-0 start-pos))) + (let ((v1-15 (-> s5-0 move-dist))) + (let ((a1-10 -0.1)) + (.mov vf7 a1-10) + ) + (.lvf vf5 (&-> v1-15 quad)) + ) + (.lvf vf4 (&-> arg0 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 (&-> a0-19 quad) vf6) + ) + (let ((a1-11 (-> s5-0 move-dist))) + (let ((v1-16 (-> s5-0 move-dist))) + (let ((a0-20 (-> s5-0 move-dist))) + (let ((a2-4 0.1)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-20 quad)) + ) + (.lvf vf4 (&-> v1-16 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 (&-> a1-11 quad) vf6) + ) + (let ((v1-17 s5-0)) + (set! (-> v1-17 radius) f30-0) + (set! (-> v1-17 collide-with) (collide-spec civilian enemy hit-by-player-list hit-by-others-list)) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) (handle->process (-> this focus handle))) + (set! (-> v1-17 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + ) + (cond + ((< (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) + 0 + ) + (else + (let* ((s4-1 (-> s5-0 best-other-tri collide-ptr)) + (v1-20 (if (type? s4-1 collide-shape-prim) + s4-1 + ) + ) + ) + (cond + ((and v1-20 (< (vector-dot + (-> s5-0 best-other-tri normal) + (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri))) + ) + 0.0 + ) + ) + (let ((v1-22 (-> (the-as collide-shape-prim v1-20) cshape process))) + (if (and v1-22 (= (-> v1-22 type) target)) + 1 + 2 + ) + ) + ) + (else + 0 + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 290 of type crimson-guard +;; WARN: disable def twice: 6. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod crimson-guard-method-290 ((this crimson-guard)) + (if #t + (handle->process (-> this attacker-info enemy)) + (squad-control-city-method-35 (-> this squad) this (-> this focus handle)) + ) + ) + +;; definition for method 261 of type crimson-guard +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod crimson-guard-method-261 ((this crimson-guard)) + (when (not (handle->process (-> this target-status handle))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this target-status handle) (the-as handle #f)) + ) + (let ((s5-0 #f)) + (let ((s4-0 (crimson-guard-method-290 this))) + (cond + (s4-0 + (when (!= (-> this target-status handle) (process->handle s4-0)) + (if (handle->process (-> this target-status handle)) + (speech-control-method-13 *speech-control* this (speech-type guard-change-targets) (-> this traffic-id)) + ) + (set! (-> this target-status handle) (process->handle s4-0)) + (crimson-guard-method-289 this 0.0) + (set-time! (-> this last-choose-new-enemy-time)) + (set! s5-0 #t) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + ) + ) + (else + (when (!= (-> this target-status handle) #f) + (set! s5-0 #t) + (set! (-> this target-status handle) (the-as handle #f)) + ) + ) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 0.5))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (if (and (= (-> this faction-mode) 1) (time-elapsed? (-> this pursuit-start-time) (seconds 5))) + (logclear! (-> this flags) (citizen-flag in-pursuit)) + ) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> this root trans quad)) + (+! (-> a1-4 y) 8192.0) + (let ((s4-1 (squad-control-method-17 (-> this squad) a1-4 (-> this traffic-id) (-> this target-status)))) + (let* ((s3-0 this) + (s2-0 (method-of-object s3-0 enemy-method-70)) + (s1-0 (handle->process (-> this target-status handle))) + ) + (s2-0 + s3-0 + (the-as process-focusable (if (type? s1-0 process-focusable) + s1-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (let ((v1-58 (handle->process (-> this focus handle)))) + (b! + (not (and v1-58 + (not (logtest? (-> (the-as process-focusable v1-58) focus-status) (focus-status disable dead inactive))) + ) + ) + cfg-65 + :delay (nop!) + ) + ) + (set! (-> this target-pos quad) (-> this target-status position quad)) + (set! (-> this target-vel-vec quad) (-> this target-status velocity quad)) + (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) + (when (logtest? (-> s4-1 flags) (squad-target-flag updated)) + (if (crimson-guard-method-256 this) + (logior! (-> this flags) (citizen-flag target-in-sight)) + (logclear! (-> this flags) (citizen-flag target-in-sight)) + ) + ) + (set! (-> this target-flags) (the-as uint (-> s4-1 flags))) + ) + ) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> this target-pos) (-> this root trans)))) + (let ((s4-2 (new 'stack-no-clear 'vector))) + (rnd-float-range this -16384.0 16384.0) + (rnd-float-range this -1820.4445 1820.4445) + (let ((s0-0 (new 'stack-no-clear 'quaternion)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (vector-normalize-copy! s4-2 s5-2 1.0) + (quaternion-vector-angle! s0-0 s4-2 (rnd-float-range this -32768.0 32768.0)) + (vector-orient-by-quat! s3-1 *y-vector* s0-0) + (vector-rotate-around-axis! s5-2 (the-as quaternion s5-2) (rnd-float-range this -910.2222 910.2222) s3-1) + ) + ) + (vector+! (-> this target-pos-predict-miss) (-> this root trans) s5-2) + ) + (vector-! (-> this target-self) (-> this target-pos) (-> this root trans)) + (set! (-> this target-self-xz quad) (-> this target-self quad)) + (set! (-> this target-self-xz y) 0.0) + (set! (-> this target-self-dist) (vector-length (-> this target-self))) + (set! (-> this target-self-xz-dist) (vector-length (-> this target-self-xz))) + (when (and (< (-> this target-self-xz-dist) 163840.0) (= (-> this faction-mode) 1)) + (set-time! (-> this pursuit-start-time)) + (logior! (-> this flags) (citizen-flag in-pursuit)) + ) + (set! (-> this target-y-angle) + (deg-diff (quaternion-y-angle (-> this root quat)) (vector-y-angle (-> this target-self))) + ) + (b! #t cfg-78 :delay (nop!)) + (label cfg-65) + (set! (-> this target-status handle) (the-as handle #f)) + (set! (-> this attacker-info next-update-target-time) 0) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (when (and s5-0 + (not (and (-> this next-state) (let ((v1-109 (-> this next-state name))) + (or (= v1-109 'active) (= v1-109 'knocked) (= v1-109 'knocked-recover)) + ) + ) + ) + ) + ) + ) + (label cfg-78) + 0 + (none) + ) + +;; definition for method 280 of type crimson-guard +(defmethod crimson-guard-method-280 ((this crimson-guard)) + #f + ) + +;; definition for method 284 of type crimson-guard +(defmethod crimson-guard-method-284 ((this crimson-guard) (arg0 vector)) + (case (-> this guard-type) + (((guard-type rifle)) + (set! (-> arg0 x) 81920.0) + (set! (-> arg0 y) 184320.0) + ) + (((guard-type grenade)) + (set! (-> arg0 x) 81920.0) + (set! (-> arg0 y) 143360.0) + ) + (else + (set! (-> arg0 x) 0.0) + (set! (-> arg0 y) 122880.0) + ) + ) + arg0 + ) + +;; definition for method 286 of type crimson-guard +(defmethod crimson-guard-method-286 ((this crimson-guard)) + (case (-> this guard-type) + (((guard-type grenade)) + 2 + ) + (((guard-type rifle)) + 6 + ) + (((guard-type tazer)) + 0 + ) + ) + ) + +;; definition for method 285 of type crimson-guard +(defmethod crimson-guard-method-285 ((this crimson-guard) (arg0 int)) + (+! (-> this ammo-count) arg0) + (set! (-> this ammo-count) (max 0 (min (-> this ammo-count) (crimson-guard-method-286 this)))) + ) + +;; definition for method 283 of type crimson-guard +(defmethod crimson-guard-method-283 ((this crimson-guard)) + (* 0.8 (cond + ((and (crimson-guard-method-280 this) (not (crimson-guard-method-272 this))) + 4096000.0 + ) + (else + (case (-> this guard-type) + (((guard-type rifle)) + 143360.0 + ) + (((guard-type grenade)) + (if (or (> (-> this ammo-count) 0) (not (-> this urgent-fire))) + 81920.0 + 8192.0 + ) + ) + (else + 32768.0 + ) + ) + ) + ) + ) + ) + +;; definition for method 289 of type crimson-guard +(defmethod crimson-guard-method-289 ((this crimson-guard) (arg0 float)) + (let ((f30-0 (crimson-guard-method-283 this))) + (let* ((f28-0 30037.334) + (f26-0 5461.334) + (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-6 (the-as number (logior #x3f800000 v1-5))) + ) + (set! (-> this last-quick-target-spot-angle) (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-6))) arg0)) + ) + (squad-control-method-31 + (-> this squad) + (-> this move-position) + this + (-> this target-status handle) + f30-0 + (-> this last-quick-target-spot-angle) + ) + ) + (none) + ) + +;; definition for method 282 of type crimson-guard +;; INFO: Used lq/sq +(defmethod crimson-guard-method-282 ((this crimson-guard) (arg0 vector) (arg1 traffic-target-formation) (arg2 (pointer float)) (arg3 int)) + (local-vars (sv-16 int) (sv-24 float) (sv-28 float) (sv-32 float)) + (set! sv-16 -1) + (set! sv-24 (the-as float (gpr->fpr #x7f800000))) + (set! sv-28 (crimson-guard-method-283 this)) + (let ((v1-4 (-> this guard-type))) + (set! sv-32 (the-as float (if (or (= v1-4 (guard-type rifle)) (= v1-4 (guard-type grenade))) + #x47200000 + #x46000000 + ) + ) + ) + ) + (dotimes (s1-0 arg3) + (when (>= (-> arg1 circle-range s1-0) sv-32) + (let* ((a1-3 (vector-rotate-around-y! + (new 'stack-no-clear 'vector) + *x-vector* + (* 182.04445 (/ (* 360.0 (the float s1-0)) (the float arg3))) + ) + ) + (a0-6 (vector+float*! (new 'stack-no-clear 'vector) arg0 a1-3 (fmin sv-28 (-> arg1 circle-range s1-0)))) + (f0-8 (vector-vector-distance a0-6 (-> this root trans))) + ) + (when (and (< f0-8 sv-24) (= (-> arg2 s1-0) 0.0)) + (set! sv-16 s1-0) + (set! sv-24 f0-8) + ) + ) + ) + ) + (cond + ((!= sv-16 -1) + (let ((v1-26 (vector-rotate-around-y! + (new 'stack-no-clear 'vector) + *x-vector* + (* 182.04445 (/ (* 360.0 (the float sv-16)) (the float arg3))) + ) + ) + ) + (vector+float*! (-> this move-position) arg0 v1-26 (fmin sv-28 (-> arg1 circle-range sv-16))) + ) + (set! (-> arg2 sv-16) (fmin sv-28 (-> arg1 circle-range sv-16))) + ) + (else + (set! (-> this move-position quad) (-> this root trans quad)) + ) + ) + (!= sv-16 -1) + ) + +;; definition for method 262 of type crimson-guard +;; INFO: Used lq/sq +(defmethod crimson-guard-method-262 ((this crimson-guard)) + (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) + (set! (-> a1-0 sphere r) 40960.0) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (set! (-> a1-0 notify-radius) 122880.0) + (set! (-> a1-0 danger-level) 1.0) + (set! (-> a1-0 decay-rate) 0.0) + (set! (-> a1-0 flags) (the-as uint 1)) + (set! (-> a1-0 danger-type) (the-as uint 0)) + (add-danger (-> this controller traffic) a1-0) + ) + (none) + ) + +;; definition for method 256 of type crimson-guard +;; INFO: Used lq/sq +(defmethod crimson-guard-method-256 ((this crimson-guard)) + (let ((s5-0 (get-trans this 3)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> this target-pos quad)) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0))) + (vector-normalize! s3-1 409600.0) + (set! (-> this los-status) + (the-as uint (crimson-guard-method-258 this s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) + ) + ) + ) + (zero? (-> this los-status)) + ) + +;; definition for function do-spline +(defun do-spline ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +;; definition for method 268 of type crimson-guard +(defmethod crimson-guard-method-268 ((this crimson-guard)) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (-> this root)) + (s3-0 (lambda ((arg0 crimson-guard) (arg1 collide-shape) (arg2 vector)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (vector+! s3-0 (-> arg1 trans) arg2) + (closest-point-on-mesh (-> arg0 nav) s4-0 s3-0 (the-as nav-poly #f)) + (cond + ((< 409.6 (vector-vector-distance s3-0 s4-0)) + #f + ) + ((let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> s4-0 quad)) + (set! (-> a1-4 w) (-> arg0 root nav-radius)) + (add-root-sphere-to-hash! (-> arg0 nav) a1-4 #x10046e) + ) + #f + ) + (else + (let ((a1-5 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-5 start-pos quad) (-> arg1 trans quad)) + (vector-! (-> a1-5 move-dist) s4-0 (-> a1-5 start-pos)) + (let ((v1-10 a1-5)) + (set! (-> v1-10 radius) 2048.0) + (set! (-> v1-10 collide-with) (-> arg1 root-prim prim-core collide-with)) + (set! (-> v1-10 ignore-process0) arg0) + (set! (-> v1-10 ignore-process1) #f) + (set! (-> v1-10 ignore-pat) (-> arg1 pat-ignore-mask)) + (set! (-> v1-10 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* a1-5) 0.0) + #f + #t + ) + ) + ) + ) + ) + ) + ) + ) + (cond + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) + (go (method-of-object this roll-right)) + ) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) + (go (method-of-object this roll-left)) + ) + (else + (go-hostile this) + ) + ) + ) + ) + +;; definition for method 265 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod crimson-guard-method-265 ((this crimson-guard) (arg0 float)) + (let* ((s3-0 (handle->process (-> this transport))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s4-0 + (let ((s2-0 (matrix<-transformq! + (new 'stack-no-clear 'matrix) + (the-as transformq (-> (the-as process-focusable s4-0) root trans)) + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 x) (if (zero? (-> this transport-side)) + -8192.0 + 8192.0 + ) + ) + (set! (-> s3-1 y) 12288.0) + (set! (-> s3-1 z) (lerp-scale -16384.0 -49152.0 arg0 0.0 1.0)) + (set! (-> s3-1 w) 1.0) + (quaternion-rotate-local-y! (-> this root quat) (-> (the-as process-focusable s4-0) root quat) 32768.0) + (vector-matrix*! (-> this root trans) s3-1 s2-0) + ) + ) + ) + (let ((f0-5 (fmax 0.0 (fmin 1.0 (* 3.3333333 arg0))))) + (set-vector! (-> this draw color-mult) f0-5 f0-5 f0-5 1.0) + ) + 0 + (none) + ) + +;; definition for method 266 of type crimson-guard +;; INFO: Used lq/sq +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] +(defmethod crimson-guard-method-266 ((this crimson-guard) (arg0 vector)) + (local-vars + (f0-8 float) + (sv-768 vector) + (sv-784 vector) + (sv-800 nav-control) + (sv-816 nav-poly) + (sv-832 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (f30-0 0.0) + ) + (dotimes (s3-0 2) + (vector-normalize! s4-0 (* 4096.0 (+ 4.0 (* 2.0 (the float s3-0))))) + (dotimes (s2-0 6) + (set! sv-768 (new 'stack-no-clear 'vector)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack 'collide-query)) + ) + (vector-rotate-around-y! sv-768 s4-0 (* 182.04445 (the float (+ (* 23 s2-0) -70)))) + (let ((v1-10 s1-0)) + (let ((a0-6 (-> this root trans))) + (let ((a1-5 sv-768)) + (let ((a2-2 1.0)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a1-5 quad)) + ) + (.lvf vf4 (&-> a0-6 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 (&-> v1-10 quad) vf6) + ) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) + ) + (let ((v1-14 (-> this nav)) + (a0-8 s1-0) + (a1-7 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-7 vertex)) a0-8 (the-as vector (-> v1-14 state mesh bounds))) + (set! (-> a1-7 vertex1 x) (-> v1-14 nearest-y-threshold)) + (set! (-> a1-7 data 20) (the-as uint 2)) + (set! sv-816 (nav-mesh-method-45 (-> v1-14 state mesh) a1-7)) + ) + (when sv-816 + (let* ((v1-18 s4-0) + (f0-7 (-> sv-768 x)) + (f1-4 (-> sv-768 y)) + (f2-2 (-> sv-768 z)) + (f3-2 (-> v1-18 x)) + (f4-0 (-> v1-18 y)) + (f5-0 (-> v1-18 z)) + ) + (.mula.s f0-7 f3-2) + (.madda.s f1-4 f4-0) + (.madd.s f0-8 f2-2 f5-0) + ) + (let ((f28-0 f0-8)) + (new 'stack-no-clear 'vector) + (let ((a1-8 (new 'stack-no-clear 'vector))) + (set! (-> a1-8 quad) (-> s1-0 quad)) + (set! (-> a1-8 w) 8192.0) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-8 32)) + (when (< f30-0 f28-0) + (set! f30-0 f28-0) + (set! sv-784 (new 'stack-no-clear 'vector)) + (let ((a3-3 (new 'stack-no-clear 'vector))) + (set! sv-800 (-> this nav)) + (set! sv-832 sv-784) + (let* ((v1-29 s1-0) + (a0-18 (-> sv-800 state mesh)) + (t9-7 (method-of-object a0-18 project-point-onto-plane-of-poly-local)) + (a2-7 sv-832) + (t0-2 (vector-! (new 'stack-no-clear 'vector) v1-29 (the-as vector (-> sv-800 state mesh bounds)))) + ) + (t9-7 a0-18 sv-816 a2-7 a3-3 t0-2) + ) + ) + (let ((v1-30 sv-832)) + (let ((a0-21 (-> sv-800 state mesh bounds))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-832 quad)) + (.lvf vf5 (&-> a0-21 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-30 quad) vf6) + ) + 0 + (set! (-> s1-0 y) (-> sv-784 y)) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) + ) + (set! (-> arg0 quad) (-> s1-0 quad)) + ) + ) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + ) + +;; definition for method 102 of type crimson-guard +;; INFO: Used lq/sq +(defmethod go-directed2 ((this crimson-guard)) + (let ((s5-0 (-> this nav state)) + (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (set! (-> s5-0 heading quad) (-> v1-2 quad)) + ) + 0 + (let ((s5-1 (-> this nav state)) + (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (logior! (-> s5-1 flags) (nav-state-flag directional-mode)) + (set! (-> s5-1 travel quad) (-> v1-7 quad)) + ) + 0 + (let ((s5-2 (-> this nav state)) + (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (set! (-> s5-2 velocity quad) (-> v1-12 quad)) + ) + 0 + (crimson-guard-method-261 this) + (set! (-> this move-position quad) (-> this target-pos quad)) + (go-hostile this) + ) + +;; definition for method 98 of type crimson-guard +(defmethod jump-wind-up-anim ((this crimson-guard) (arg0 enemy-jump-info)) + #f + ) + +;; definition for method 96 of type crimson-guard +(defmethod jump-in-air-anim ((this crimson-guard) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this 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 ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) + (set! (-> s4-0 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-0 param 1) (-> arg0 anim-speed)) + (set! (-> s4-0 frame-num) (ja-aframe 0.0 0)) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) + ) + #t + ) + +;; definition for method 97 of type crimson-guard +(defmethod jump-land-anim ((this crimson-guard) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this 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.01)) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) + (set! (-> s4-0 param 0) (ja-aframe 9.0 0)) + (set! (-> s4-0 param 1) (-> arg0 anim-speed)) + (set! (-> s4-0 frame-num) (ja-aframe 4.0 0)) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) + ) + #t + ) + +;; definition for method 99 of type crimson-guard +(defmethod jump-anim-handler ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) + (local-vars (s5-0 symbol)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (not (jump-wind-up-anim this arg1)) + ) + ((= v1-0 1) + (set! s5-0 (ja-done? 0)) + (let ((s4-1 (-> this skel root-channel 0))) + (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-1 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja-blend-eval) + s5-0 + ) + ((= v1-0 2) + (jump-in-air-anim this arg1) + #f + ) + ((= v1-0 3) + (set! s5-0 (ja-done? 0)) + (let ((s4-2 (-> this skel root-channel 0))) + (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-2 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja-blend-eval) + s5-0 + ) + ((= v1-0 4) + (not (jump-land-anim this arg1)) + ) + ((= v1-0 5) + (set! s5-0 (ja-done? 0)) + (let ((s4-3 (-> this skel root-channel 0))) + (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) + (set! (-> s4-3 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja-blend-eval) + s5-0 + ) + (else + #t + ) + ) + ) + ) + +;; definition for method 120 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this crimson-guard)) + (let ((s5-0 (new 'process 'crimson-guard-collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (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 10240.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 hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 6144.0 0.0 6144.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 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 6144.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec civilian)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak civilian enemy hit-by-others-list player-list)) + (set! (-> v1-17 transform-index) 14) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 2048.0 4096.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec civilian)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak civilian enemy hit-by-others-list player-list)) + (set! (-> v1-19 transform-index) 14) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 -12288.0 6144.0) + ) + (set! (-> s5-0 nav-radius) 6144.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 7 of type crimson-guard +(defmethod relocate ((this crimson-guard) (offset int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) offset) + ) + (if (nonzero? (-> this l-control)) + (&+! (-> this l-control) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 121 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this crimson-guard)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode polar-look-at) this 4)) + (set! (-> this state-stack) (new 'process 'boxed-array state 6)) + (set! (-> this state-stack length) 0) + (set! (-> this info) *crimson-guard-global-info*) + (init-enemy-defaults! this *crimson-guard-nav-enemy-info*) + (let ((v1-9 (-> this nav))) + (set! (-> v1-9 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 143360.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this anim-shuffle) 5) + (set! (-> this anim-walk) 5) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 12288.0) + (set! (-> this dist-run-anim) 34078.72) + (set! (-> this anim-run) 6) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-get-up-front) 33) + (set! (-> this anim-get-up-back) 34) + (set! (-> this l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 19) this 0.0)) + (set! (-> this l-control state points-to-draw) 0) + (set! (-> this water-anim) -1) + (set! (-> this minimap) #f) + 0 + (none) + ) + +;; definition for function guard-type->city-target-type +;; WARN: Return type mismatch int vs city-target-type. +(defun guard-type->city-target-type ((arg0 guard-type)) + (let ((v1-0 arg0)) + (the-as city-target-type (cond + ((= v1-0 (guard-type grenade)) + (the-as city-target-type (city-target-type guard-grenade)) + ) + ((= v1-0 (guard-type rifle)) + (the-as city-target-type (city-target-type guard-rifle)) + ) + ((= v1-0 (guard-type tazer)) + (the-as city-target-type (city-target-type guard-tazer)) + ) + (else + (the-as city-target-type (city-target-type guard-tazer)) + ) + ) + ) + ) + ) + +;; definition for method 267 of type crimson-guard +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 267 crimson-guard) has a return type of none, but the expression builder found a return statement. +(defmethod crimson-guard-method-267 ((this crimson-guard) (arg0 guard-type) (arg1 symbol)) + (if (= arg0 (-> this guard-type)) + (return 0) + ) + (set! (-> this guard-type) arg0) + (set! (-> this settings) (get-unit-settings-by-idx (-> this squad) (the-as int (-> this guard-type)))) + (setup-masks (-> this draw) 0 30) + (case (-> this guard-type) + (((guard-type tazer) (guard-type grenade)) + (setup-masks (-> this draw) 16 0) + (set! (-> this root nav-radius) 8192.0) + ) + (else + (setup-masks (-> this draw) 8 0) + (set! (-> this root nav-radius) 6144.0) + ) + ) + (set! (-> this ammo-count) (crimson-guard-method-286 this)) + (if (and (or (= (-> this guard-type) (guard-type rifle)) (= (-> this guard-type) (guard-type grenade))) + (not (or (= (-> this faction-mode) 1) (logtest? (-> this flags) (citizen-flag in-mission)))) + ) + (set! (-> this ammo-count) (/ (-> this ammo-count) 2)) + ) + (if (-> this attacker-info) + (set! (-> this attacker-info self-type) (the-as int (guard-type->city-target-type (-> this guard-type)))) + ) + (cond + ((and (not arg1) (logtest? (-> this flags) (citizen-flag dark-guard))) + (setup-masks (-> this draw) 5 0) + (set-vector! (-> this root scale) 1.1 1.1 1.1 1.0) + (set-vector! (-> this joint scale) 1.1 1.0 1.1 1.0) + (let* ((a0-24 (-> this neck)) + (t9-7 (method-of-object a0-24 trs-set!)) + (a1-6 #f) + (a2-5 #f) + (a3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a3-0 x) 0.9090909) + (set! (-> a3-0 y) 1.0) + (set! (-> a3-0 z) 0.9090909) + (set! (-> a3-0 w) 1.0) + (t9-7 a0-24 (the-as vector a1-6) (the-as quaternion a2-5) a3-0) + ) + (mode-set! (-> this neck) (joint-mod-mode rotate2)) + (set! (-> this joint parented-scale?) #t) + (set! (-> this neck parented-scale?) #t) + ) + (else + (setup-masks (-> this draw) 3 0) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> this joint scale) 1.0 1.0 1.0 1.0) + (let* ((a0-37 (-> this neck)) + (t9-10 (method-of-object a0-37 trs-set!)) + (a1-9 #f) + (a2-7 #f) + (a3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a3-1 x) 1.0) + (set! (-> a3-1 y) 1.0) + (set! (-> a3-1 z) 1.0) + (set! (-> a3-1 w) 1.0) + (t9-10 a0-37 (the-as vector a1-9) (the-as quaternion a2-7) a3-1) + ) + (mode-set! (-> this neck) (joint-mod-mode reset)) + ) + ) + 0 + (none) + ) + +;; definition for method 194 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this crimson-guard)) + (let ((t9-0 (method-of-type citizen citizen-method-194))) + (t9-0 this) + ) + (set! (-> this player-attack-count) 0) + (set! (-> this next-update-target-time) 0) + (set! (-> this pursuit-start-time) 0) + (set! (-> this last-choose-new-enemy-time) 0) + (if (logtest? (-> this flags) (citizen-flag dark-guard)) + (set! (-> this hit-points) (* 2.0 (-> this enemy-info default-hit-points))) + ) + (set! (-> this hit-face) (the-as uint -1)) + (if (not (logtest? (-> this flags) (citizen-flag in-mission))) + (crimson-guard-method-267 this (the-as guard-type (ff-squad-control-method-54 (-> this squad) 6)) #f) + (crimson-guard-method-267 this (guard-type tazer) #f) + ) + (let ((v1-15 (-> this nav))) + (set! (-> v1-15 sphere-mask) (the-as uint #x1000de)) + ) + 0 + (set! (-> this last-fire-time) 0) + (set! (-> this total-flee-time) 0) + (set! (-> this num-times-reloading-interrupted) 0) + (set! (-> this joint-enable) #f) + (set! (-> this urgent-fire) #f) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask guard)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) + (set! (-> this fact pickup-spawn-amount) 0.0) + (let* ((v1-25 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-26 (the-as number (logior #x3f800000 v1-25))) + (f0-6 (+ -1.0 (the-as float v1-26))) + ) + (cond + ((< f0-6 0.1) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + ) + ((< f0-6 0.2) + (set! (-> this fact pickup-amount) 10.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + ) + ) + ) + (set! (-> this fact fade-time) (seconds 10)) + (set! (-> this target-status handle) (the-as handle #f)) + (let ((v1-44 (rnd-int this 2))) + (cond + ((zero? v1-44) + (set! (-> this anim-shoot 0 anim-index) 19) + (set! (-> this anim-shoot 0 start) 1.0) + (set! (-> this anim-shoot 0 end) 12.0) + (set! (-> this anim-shoot 1 anim-index) 26) + (set! (-> this anim-shoot 1 start) 12.0) + (set! (-> this anim-shoot 1 end) 22.0) + (set! (-> this anim-shoot 2 anim-index) 24) + (set! (-> this anim-shoot 2 start) 20.0) + (set! (-> this anim-shoot 2 end) 30.0) + ) + ((= v1-44 1) + (set! (-> this anim-shoot 0 anim-index) 27) + (set! (-> this anim-shoot 0 start) 2.0) + (set! (-> this anim-shoot 0 end) 9.0) + (set! (-> this anim-shoot 1 anim-index) 29) + (set! (-> this anim-shoot 1 start) 18.0) + (set! (-> this anim-shoot 1 end) 26.0) + (set! (-> this anim-shoot 2 anim-index) 30) + (set! (-> this anim-shoot 2 start) 26.0) + (set! (-> this anim-shoot 2 end) 35.0) + ) + ) + ) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (reset-to-collide-spec + (-> this focus) + (collide-spec jak enemy hit-by-others-list player-list bot-targetable jak-vehicle) + ) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 25) (the-as int #f) (the-as vector #t) 0)) + ) + (set! (-> this move-index) -1) + (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.15))) + (ja-channel-set! 0) + 0 + (none) + ) + +;; definition for function orient-towards-code +(defbehavior orient-towards-code crimson-guard ((arg0 degrees)) + (when (< arg0 (fabs (-> self target-y-angle))) + (ja-channel-push! 1 (seconds 0.1)) + (while (< arg0 (fabs (-> self target-y-angle))) + (let ((f0-1 (-> self target-y-angle)) + (f30-0 24576.0) + ) + (if (< f0-1 0.0) + (set! f30-0 (- f30-0)) + ) + (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (set! f0-1 (- f0-1)) + ) + (cond + ((< f0-1 0.0) + (ja-no-eval :group! crimson-guard-stab-shuffle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* f30-0 (seconds-per-frame))) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! crimson-guard-stab-shuffle-ja :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* f30-0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 269 of type crimson-guard +(defmethod crimson-guard-method-269 ((this crimson-guard) (arg0 process-focusable)) + (let ((f0-0 (if (and (zero? (-> this ammo-count)) (-> this urgent-fire)) + 32768.0 + 16384.0 + ) + ) + ) + (and (< (-> this target-self-xz-dist) f0-0) + (< (fabs (-> this target-y-angle)) 7281.778) + (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) + (logtest? (-> this flags) (citizen-flag target-in-sight)) + (or (zero? (-> this ammo-count)) (not (-> this urgent-fire))) + ) + ) + ) + +;; definition for method 270 of type crimson-guard +(defmethod crimson-guard-method-270 ((this crimson-guard)) + (when (and (not (logtest? (-> this flags) (citizen-flag in-formation))) + (not (logtest? (-> this flags) (citizen-flag in-mission))) + ) + (when (and (not (logtest? (-> this draw status) (draw-control-status on-screen))) + (let ((a1-0 (-> this clock)) + (a0-3 (-> this traffic-id)) + ) + (not (logtest? (logxor a0-3 (-> a1-0 integral-frame-counter)) 15)) + ) + (not (logtest? (-> this flags) (citizen-flag sticky-weapon))) + ) + (let ((a1-3 (ff-squad-control-method-55 + (-> this squad) + (the-as int (-> this guard-type)) + (the-as int (-> this faction-mode)) + ) + ) + ) + (when (!= a1-3 (-> this guard-type)) + (crimson-guard-method-267 this (the-as guard-type a1-3) #f) + (return #t) + ) + ) + ) + ) + #f + ) + +;; definition for method 114 of type crimson-guard +(defmethod send-attack-to-all-tshapes ((this crimson-guard) (arg0 process-focusable) (arg1 event-message-block)) + (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) + (when s4-0 + (let ((s3-0 (-> s4-0 head))) + (while s3-0 + (get-touched-prim s3-0 (-> arg0 root) s4-0) + (when (logtest? (-> (get-touched-prim s3-0 (-> this root) s4-0) prim-core action) (collide-action deadly)) + (let* ((a0-3 this) + (t9-2 (method-of-object a0-3 send-attack)) + (a1-3 arg0) + (a2-3 s4-0) + (v1-10 *game-info*) + (a3-1 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a3-1) + (if (t9-2 a0-3 a1-3 a2-3 a3-1) + (return 0) + ) + ) + ) + (set! s3-0 (-> s3-0 next)) + ) + ) + ) + ) + 0 + ) + +;; definition for method 112 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod get-incoming-attack! ((this crimson-guard) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + (call-parent-method this arg0 arg1 arg2 arg3 arg4) + 0 + (none) + ) + +;; definition for method 66 of type crimson-guard +(defmethod get-penetrated-by ((this crimson-guard)) + (let ((gp-0 4160)) + (if (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'get-up-front) (= v1-3 'get-up-back)) + ) + ) + (set! gp-0 0) + ) + (logior (logclear + (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (the int (-> this hit-points))) + gp-0 + ) + (penetrate vehicle) + ) + ) + ) + +;; definition for method 196 of type crimson-guard +;; WARN: Return type mismatch symbol vs none. +(defmethod go-inactive ((this crimson-guard)) + (call-parent-method this) + (set! (-> this guard-riot-shield) (the-as handle #f)) + (none) + ) + +;; definition for method 160 of type crimson-guard +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod normalize-heading! ((this crimson-guard) (arg0 nav-control)) + (let ((t9-0 (method-of-object this citizen-method-214)) + (v1-1 arg0) + (a3-0 (-> arg0 state)) + (a2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (t9-0 this v1-1 a2-0) + ) + 0 + (none) + ) + +;; definition for method 50 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-50 ((this crimson-guard) (arg0 int)) + 0 + (none) + ) + +;; definition for method 288 of type crimson-guard +(defmethod crimson-guard-method-288 ((this crimson-guard) (arg0 process-focusable)) + (crimson-guard-method-287 this arg0) + ) + +;; definition for method 287 of type crimson-guard +(defmethod crimson-guard-method-287 ((this crimson-guard) (arg0 process-focusable)) + (cond + ((logtest? (process-mask guard) (-> arg0 mask)) + -1.0 + ) + ((logtest? (process-mask metalhead) (-> arg0 mask)) + 0.5 + ) + ((= (-> arg0 type) target) + -0.01 + ) + ((logtest? (process-mask civilian) (-> arg0 mask)) + -1.0 + ) + ((logtest? (process-mask kg-robot) (-> arg0 mask)) + (case (-> arg0 stack 968) + ((8) + (case (-> this guard-type) + (((guard-type grenade)) + 0.4 + ) + (((guard-type rifle)) + 0.6 + ) + (else + 0.5 + ) + ) + ) + ((6) + (case (-> this guard-type) + (((guard-type grenade)) + 0.6 + ) + (else + 0.5 + ) + ) + ) + (else + 0.5 + ) + ) + ) + ((and (logtest? (process-mask vehicle) (-> arg0 mask)) (not (logtest? (process-mask enemy) (-> arg0 mask)))) + -1.0 + ) + (else + -1.0 + ) + ) + ) + +;; definition for method 69 of type crimson-guard +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-69 ((this crimson-guard)) + 0 + (none) + ) + +;; definition for function go-active-if-necessary +(defbehavior go-active-if-necessary crimson-guard () + (when (not (handle->process (-> self target-status handle))) + (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (go-virtual active) + ) + ) + +;; definition for method 215 of type crimson-guard +(defmethod citizen-method-215 ((this crimson-guard)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this (the-as int (guard-type->city-target-type (-> this guard-type)))) + ) + ) + (none) + ) + +;; definition for method 52 of type crimson-guard +(defmethod damage-enemy! ((this crimson-guard) (arg0 object) (arg1 event-message-block)) + (when (-> *setting-control* user-current gun-target-guards?) + (let ((v1-4 (handle->process (-> this incoming attacker-handle)))) + (when v1-4 + (when (= (-> v1-4 type) target) + (when (time-elapsed? (-> this last-player-attack-time) (seconds 0.5)) + (+! (-> this player-attack-count) 1) + (set-time! (-> this last-player-attack-time)) + ) + (when (or (< 1 (-> this player-attack-count)) + (not (logtest? (-> this incoming penetrate-using) (penetrate board))) + (logtest? (-> this incoming penetrate-using) (penetrate spin)) + ) + (if (logtest? (-> this flags) (citizen-flag in-formation)) + (send-event (handle->process (-> this vehicle)) 'member-attacked) + (send-event this 'member-attacked) + ) + ) + ) + ) + ) + ) + (call-parent-method this arg0 arg1) + ) + +;; definition for method 272 of type crimson-guard +(defmethod crimson-guard-method-272 ((this crimson-guard)) + #f + ) + +;; definition for method 271 of type crimson-guard +(defmethod crimson-guard-method-271 ((this crimson-guard)) + #f + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc new file mode 100644 index 0000000000..c29147034d --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc @@ -0,0 +1,1111 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-mh-flitter city-flitter city-flitter-lod0-jg -1 + ((city-flitter-lod0-mg (meters 20)) (city-flitter-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + :shadow city-flitter-shadow-mg + :origin-joint-index 3 + ) + +;; definition of type metalhead-flitter +(deftype metalhead-flitter (mh-squad-member) + ((move-angle float) + (heading symbol) + (change-dir-time time-frame) + (last-change-dir time-frame) + (off-screen-timer time-frame) + (amb-sound-timer time-frame) + (attack-time time-frame) + (target-pos vector :inline) + (attack-pos vector :inline) + (base-height float) + ) + (:state-methods + attack + ambush-jumping + ) + (:methods + (metalhead-flitter-method-224 (_type_) none) + (metalhead-flitter-method-225 (_type_) none) + (metalhead-flitter-method-226 (_type_ process-focusable) symbol) + (metalhead-flitter-method-227 (_type_ symbol) none) + (metalhead-flitter-method-228 (_type_) float) + ) + ) + +;; definition for method 3 of type metalhead-flitter +(defmethod inspect ((this metalhead-flitter)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type mh-squad-member inspect))) + (t9-0 this) + ) + (format #t "~2Tmove-angle: ~f~%" (-> this move-angle)) + (format #t "~2Theading: ~A~%" (-> this heading)) + (format #t "~2Tchange-dir-time: ~D~%" (-> this change-dir-time)) + (format #t "~2Tlast-change-dir: ~D~%" (-> this last-change-dir)) + (format #t "~2Toff-screen-timer: ~D~%" (-> this off-screen-timer)) + (format #t "~2Tamb-sound-timer: ~D~%" (-> this amb-sound-timer)) + (format #t "~2Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tattack-pos: #~%" (-> this attack-pos)) + (format #t "~2Tbase-height: ~f~%" (-> this base-height)) + (label cfg-4) + this + ) + +;; definition for symbol *fact-info-mh-flitter-defaults*, type fact-info-enemy-defaults +(define *fact-info-mh-flitter-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 4) + ) + +;; definition for symbol *metalhead-flitter-nav-enemy-info*, type nav-enemy-info +(define *metalhead-flitter-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 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 3 + :param1 6 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim 8 + :hit-anim 4 + :knocked-anim 14 + :knocked-land-anim 15 + :die-anim 13 + :die-falling-anim 12 + :victory-anim 4 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint -1 + :look-at-joint 28 + :bullseye-joint 3 + :sound-hit (static-sound-name "mh-flitter-hit") + :sound-die (static-sound-name "mh-flitter-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 6) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 1 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 275251.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 28 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 696.32 :z 1843.2 :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 7 + :turn-anim 9 + :run-anim 8 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 120) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 5) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 5) + :frustration-distance (meters 12) + :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! (-> *metalhead-flitter-nav-enemy-info* fact-defaults) *fact-info-mh-flitter-defaults*) + +;; definition for method 226 of type metalhead-flitter +(defmethod metalhead-flitter-method-226 ((this metalhead-flitter) (arg0 process-focusable)) + (and (logtest? (-> this draw status) (draw-control-status on-screen)) + (let ((s4-0 (camera-matrix))) + (camera-pos) + (let* ((s3-0 (get-trans arg0 0)) + (s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 fvec) 1.0)) + (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s3-0) 1.0)) + ) + (< 0.0 (vector-dot s5-1 v1-7)) + ) + ) + ) + ) + +;; definition for method 85 of type metalhead-flitter +(defmethod knocked-anim ((this metalhead-flitter) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) + ) + #t + ) + (((knocked-type blue-shot)) + (let ((v1-17 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-17 (= v1-17 (-> this draw art-group data 15))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 17))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 17)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) 1.0) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 17)) num-func-seek!) + ) + #t + ) + (else + ((method-of-type nav-enemy knocked-anim) this arg0) + ) + ) + ) + +;; definition for method 86 of type metalhead-flitter +(defmethod knocked-land-anim ((this metalhead-flitter) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> v1-4 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> v1-4 param 1) 1.0) + (set! (-> v1-4 frame-num) 0.0) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + #t + ) + ) + (else + ((method-of-type mh-squad-member knocked-land-anim) this arg0) + ) + ) + ) + +;; definition for method 76 of type metalhead-flitter +(defmethod go-stare2 ((this metalhead-flitter)) + (if (and (= (-> this focus aware) (enemy-aware ea2)) (not (nav-enemy-method-174 this))) + (go (method-of-object this pacing)) + (go (method-of-object this stare)) + ) + ) + +;; failed to figure out what this is: +(defstate ambush (metalhead-flitter) + :virtual #t + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (set! (-> self base-height) (-> self root trans y)) + (let ((v1-13 (-> self root root-prim))) + (set! (-> v1-13 prim-core collide-as) (collide-spec)) + (set! (-> v1-13 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((a0-4 (the-as process-focusable (handle->process (-> self focus handle))))) + (when a0-4 + (let* ((gp-1 (-> self root)) + (s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-1 trans)) 1.0)) + (f0-1 (deg-diff (quaternion-y-angle (-> gp-1 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-1 quat) (-> gp-1 quat) f0-1) + ) + ) + ) + ) + :code (behavior () + (case (-> self level name) + (('ruins) + (cond + ((logtest? (-> *part-group-id-table* 255 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 255)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 255)) + ) + ) + ) + (('strip) + (cond + ((logtest? (-> *part-group-id-table* 256 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 256)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 256)) + ) + ) + ) + ) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 0.6)) + (suspend) + ) + ) + (+! (-> self root trans y) -8192.0) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) + (suspend) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (go-virtual ambush-jumping) + ) + ) + +;; failed to figure out what this is: +(defstate ambush-jumping (metalhead-flitter) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (set-look-at-mode! self 1) + (set-time! (-> self state-time)) + (let ((gp-0 (-> self root))) + (vector-reset! (-> gp-0 transv)) + (set! (-> gp-0 transv y) (* 4096.0 (rnd-float-range self 34.0 38.0))) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!)) + (until #f + (when (< (-> self base-height) (-> self root trans y)) + (cond + ((logtest? (-> *part-group-id-table* 257 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 257)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 257)) + ) + ) + (goto cfg-14) + ) + (suspend) + (ja :num! (seek!)) + ) + #f + (until #f + (when (< (+ 204.8 (-> self base-height)) (-> self root trans y)) + (let ((v1-64 (-> self root root-prim))) + (set! (-> v1-64 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-64 prim-core collide-with) (-> self root backup-collide-with)) + ) + (goto cfg-15) + ) + (label cfg-14) + (suspend) + (ja :num! (seek!)) + ) + #f + (until #f + (label cfg-15) + (if (or (and (>= 0.0 (-> self root transv y)) (>= (+ 1638.4 (-> self base-height)) (-> self root trans y))) + (logtest? (-> self root status) (collide-status on-ground)) + ) + (goto cfg-30) + ) + (suspend) + (if (not (ja-done? 0)) + (ja :num! (seek!)) + ) + ) + #f + (label cfg-30) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (if (logtest? (-> self root status) (collide-status on-ground)) + (goto cfg-37) + ) + (suspend) + ) + #f + (label cfg-37) + (go-virtual hostile) + ) + :post nav-enemy-falling-post + ) + +;; definition for method 108 of type metalhead-flitter +(defmethod enemy-method-108 ((this metalhead-flitter) (arg0 process-focusable)) + (focus-test? arg0 mech) + ) + +;; definition for method 224 of type metalhead-flitter +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod metalhead-flitter-method-224 ((this metalhead-flitter)) + (let* ((s5-0 (handle->process (-> this focus handle))) + (s3-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when s3-0 + (let* ((s5-1 (get-trans s3-0 0)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this root trans))) + (f30-0 (vector-length s4-1)) + ) + (cond + ((enemy-method-108 this s3-0) + (go-flee this) + ) + ((and (< f30-0 32768.0) (not (metalhead-flitter-method-226 this s3-0))) + (go (method-of-object this circling)) + ) + ((and (< f30-0 (-> this enemy-info notice-nav-radius)) (time-elapsed? (-> this state-time) (seconds 0.2))) + (set! (-> this target-pos quad) (-> s5-1 quad)) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> s4-1 quad)) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> this root transv quad)) + (vector-normalize! s5-2 f30-0) + (if (>= (vector-dot s3-1 s5-2) 0.98) + (go (method-of-object this attack)) + ) + ) + ) + ) + ((< f30-0 32768.0) + (set! (-> this target-pos quad) (-> s5-1 quad)) + ) + ((or (time-elapsed? (-> this last-change-dir) (-> this change-dir-time)) + (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) + ) + (set-time! (-> this last-change-dir)) + (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (if (-> this heading) + (set-vector! s3-2 (-> s4-1 z) (-> s4-1 y) (- (-> s4-1 x)) 1.0) + (set-vector! s3-2 (- (-> s4-1 z)) (-> s4-1 y) (-> s4-1 x) 1.0) + ) + (set! (-> this heading) (not (-> this heading))) + (let ((f28-1 (rand-vu-float-range (* 0.75 f0-9) f0-9)) + (s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 (* -0.6 f30-0))) + ) + (vector-normalize! s3-2 f28-1) + (vector+! s3-2 s3-2 s4-2) + ) + (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) + (vector+! s2-0 s5-1 s3-2) + (set! (-> this target-pos quad) (-> s2-0 quad)) + ) + ) + ) + ) + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 225 of type metalhead-flitter +;; WARN: Return type mismatch time-frame vs none. +(defmethod metalhead-flitter-method-225 ((this metalhead-flitter)) + (when (time-elapsed? (-> this amb-sound-timer) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) + (sound-play "flitter-amb" :position (-> this root trans)) + (set-time! (-> this amb-sound-timer)) + ) + (none) + ) + +;; definition for function metalhead-flitter-fall-and-play-death-anim +;; WARN: Return type mismatch int vs none. +(defbehavior metalhead-flitter-fall-and-play-death-anim metalhead-flitter ((arg0 int) (arg1 float) (arg2 time-frame)) + (local-vars (v1-29 symbol)) + (stop-look-at! self) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim arg0)) + (let ((s4-1 (get-knockback-dir! self (new 'stack-no-clear 'vector))) + (s3-0 (-> self root)) + ) + (when (if (type? s3-0 collide-shape-moving) + s3-0 + ) + (set! (-> self root transv y) 33775.48) + (ja :num-func num-func-identity :frame-num 0.0) + (set-time! (-> self state-time)) + (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) + (until v1-29 + (let ((f0-2 102400.0)) + (set! (-> self root transv x) (* (-> s4-1 x) f0-2)) + (set! (-> self root transv z) (* (-> s4-1 z) f0-2)) + ) + (suspend) + (ja :num! (seek! max arg1)) + (set! v1-29 (or (ja-done? 0) (time-elapsed? (-> self state-time) arg2))) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (metalhead-flitter) + :virtual #t + :post (behavior () + (metalhead-flitter-method-225 self) + (let ((t9-1 (-> (method-of-type mh-squad-member active) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate stare (metalhead-flitter) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (until #f + (when (not (enemy-method-105 self 2730.6667 #t)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 9)) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75)) + ) + (let ((v1-25 self)) + (set! (-> v1-25 enemy-flags) (the-as enemy-flag (logclear (-> v1-25 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-29 (ja-group))) + (if (not (and v1-29 (= v1-29 (-> self draw art-group data (-> self enemy-info idle-anim))))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (metalhead-flitter-method-225 self) + (let ((t9-1 (-> (method-of-type mh-squad-member stare) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (metalhead-flitter) + :virtual #t + :enter (behavior () + (set-time! (-> self last-change-dir)) + (set! (-> self change-dir-time) 0) + (set! (-> self attack-time) (+ (current-time) (seconds 0.35))) + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (metalhead-flitter-method-224 self) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self target-pos)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate die (metalhead-flitter) + :virtual #t + :enter (behavior () + (sound-play "flitter-die") + (let ((t9-2 (-> (method-of-type mh-squad-member die) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (metalhead-flitter-fall-and-play-death-anim + (the-as int (-> self draw art-group data (-> self enemy-info die-anim))) + 1.0 + (seconds 2) + ) + (send-event self 'death-end) + (cleanup-for-death self) + ) + ) + +;; definition for method 228 of type metalhead-flitter +(defmethod metalhead-flitter-method-228 ((this metalhead-flitter)) + (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) + ) + +;; failed to figure out what this is: +(defstate attack (metalhead-flitter) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (set! (-> self amb-sound-timer) 0) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-7 *game-info*) + (a0-13 (+ (-> v1-7 attack-id) 1)) + ) + (set! (-> v1-7 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (metalhead-flitter-method-227 self #t) + ) + :exit (behavior () + (metalhead-flitter-method-227 self #f) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (local-vars (s5-2 object)) + (let* ((s5-0 (handle->process (-> self focus handle))) + (gp-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (set! s5-2 (cond + ((and gp-0 + (not (time-elapsed? (-> self state-time) (seconds 1.5))) + gp-0 + (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((s5-1 (-> self nav state)) + (v1-10 (get-trans gp-0 0)) + ) + (logclear! (-> s5-1 flags) (nav-state-flag directional-mode)) + (logior! (-> s5-1 flags) (nav-state-flag target-poly-dirty)) + (set! (-> s5-1 target-pos quad) (-> v1-10 quad)) + ) + 0 + (set! s5-2 (-> self attack-pos)) + (set! (-> (the-as vector s5-2) quad) (-> (get-trans gp-0 3) quad)) + s5-2 + ) + (else + (go-stare self) + ) + ) + ) + ) + ) + :code (behavior () + (sound-play "flitter-attack") + (ja-channel-push! 2 (seconds 0.1)) + (let ((f30-0 (metalhead-flitter-method-228 self))) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! max 0.8) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! (-> self draw art-group data 11) + :num! (chan 0) + :frame-interp0 f30-0 + :frame-interp1 f30-0 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (set! f30-0 (seek f30-0 (metalhead-flitter-method-228 self) (* 0.2 (seconds-per-frame)))) + (ja :num! (seek! max 0.8)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + ) + ) + (let ((v1-41 self)) + (set! (-> v1-41 enemy-flags) (the-as enemy-flag (logclear (-> v1-41 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-41 nav callback-info) *null-nav-callback-info*) + ) + 0 + (ja-channel-push! 1 (seconds 0.1)) + (metalhead-flitter-method-227 self #f) + (logclear! (-> self focus-status) (focus-status dangerous)) + (dotimes (gp-2 (rnd-int self 3)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-best-state self) + ) + :post nav-enemy-travel-post + ) + +;; failed to figure out what this is: +(defstate victory (metalhead-flitter) + :virtual #t + :post (behavior () + (metalhead-flitter-method-225 self) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate stare (metalhead-flitter) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (until #f + (when (not (enemy-method-105 self 2730.6667 #t)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 9)) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75)) + ) + (let ((v1-25 self)) + (set! (-> v1-25 enemy-flags) (the-as enemy-flag (logclear (-> v1-25 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-29 (ja-group))) + (if (not (and v1-29 (= v1-29 (-> self draw art-group data (-> self enemy-info idle-anim))))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (metalhead-flitter-method-225 self) + (let ((t9-1 (-> (method-of-type nav-enemy stare) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate circling (metalhead-flitter) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy circling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-time! (-> self off-screen-timer)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (the-as process-focusable gp-0) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (let ((v1-11 (-> self focus aware))) + (cond + ((= v1-11 (enemy-aware ea3)) + (cond + ((when gp-0 + (let* ((gp-1 self) + (s5-1 (method-of-object gp-1 metalhead-flitter-method-226)) + (s4-0 (handle->process (-> self focus handle))) + ) + (s5-1 gp-1 (the-as process-focusable (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + ) + ) + (if (and (get-focus! self) (time-elapsed? (-> self off-screen-timer) (seconds 0.3))) + (go-hostile self) + ) + ) + (else + (set-time! (-> self off-screen-timer)) + ) + ) + ) + ((= v1-11 (enemy-aware ea2)) + (go-stare self) + ) + ((>= 1 (the-as int v1-11)) + (go-virtual active) + ) + ) + ) + (if (or (nav-enemy-method-174 self) (logtest? (enemy-flag ef42) (-> self enemy-flags))) + (go-stare2 self) + ) + ) + ) + ) + :code (behavior () + (nav-enemy-method-177 self) + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info run-anim)) + :num! (seek! max (rnd-float-range self 0.9 1.1)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (rnd-float-range self 0.9 1.1))) + ) + ) + #f + ) + ) + +;; definition for method 227 of type metalhead-flitter +;; WARN: Return type mismatch int vs none. +(defmethod metalhead-flitter-method-227 ((this metalhead-flitter) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) + (if arg0 + (logior! (-> a2-1 prim-core action) (collide-action deadly)) + (logclear! (-> a2-1 prim-core action) (collide-action deadly)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 120 of type metalhead-flitter +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this metalhead-flitter)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 10240.0 0.0 15360.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-12 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> v1-12 local-sphere) 0.0 5734.4 0.0 5734.4) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot crate civilian hit-by-others-list player-list)) + (set! (-> v1-14 prim-core action) (collide-action deadly)) + (set! (-> v1-14 transform-index) 34) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 3481.6) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot crate civilian hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action deadly)) + (set! (-> v1-16 transform-index) 35) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 3481.6) + ) + (set! (-> s5-0 nav-radius) 3686.4) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type metalhead-flitter +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this metalhead-flitter)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-flitter" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *metalhead-flitter-nav-enemy-info*) + (set! (-> this move-angle) 10922.667) + (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) + #t + #f + ) + ) + (set! (-> this change-dir-time) 0) + (set! (-> this off-screen-timer) 0) + (set! (-> this amb-sound-timer) 0) + (set-gravity-length (-> this root dynam) 491520.0) + (set! (-> this minimap) #f) + (set! (-> this water-anim) 8) + (none) + ) + +;; definition for method 194 of type metalhead-flitter +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this metalhead-flitter)) + (let ((t9-0 (method-of-type mh-squad-member citizen-method-194))) + (t9-0 this) + ) + (add-connection + *part-engine* + this + 28 + this + 468 + (new 'static 'vector :x 942.08 :y -860.16 :z 1269.76 :w 163840.0) + ) + (add-connection + *part-engine* + this + 28 + this + 468 + (new 'static 'vector :x -942.08 :y -860.16 :z 1269.76 :w 163840.0) + ) + (set! (-> this speed-walk) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-walk-anim) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-run-anim) (-> this enemy-info run-travel-speed)) + 0 + (none) + ) + +;; definition for method 215 of type metalhead-flitter +(defmethod citizen-method-215 ((this metalhead-flitter)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 7) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate in-ditch (metalhead-flitter) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + +;; failed to figure out what this is: +(defstate die-fast (metalhead-flitter) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-grunt_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-grunt_REF.gc new file mode 100644 index 0000000000..de59e378ba --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-grunt_REF.gc @@ -0,0 +1,1633 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-mh-grunt city-grunt city-grunt-lod0-jg -1 + ((city-grunt-lod0-mg (meters 20)) (city-grunt-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow city-grunt-shadow-mg + :origin-joint-index 16 + ) + +;; definition of type mh-grunt-anim-info +(deftype mh-grunt-anim-info (structure) + ((anim-index int32) + (travel-speed meters) + ) + :pack-me + ) + +;; definition for method 3 of type mh-grunt-anim-info +(defmethod inspect ((this mh-grunt-anim-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mh-grunt-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~1Ttravel-speed: (meters ~m)~%" (-> this travel-speed)) + (label cfg-4) + this + ) + +;; definition of type mh-grunt-global-info +(deftype mh-grunt-global-info (basic) + ((patrol-anim mh-grunt-anim-info 2 :inline) + (charge-anim mh-grunt-anim-info 1 :inline) + (attack-anim mh-grunt-anim-info 1 :inline) + ) + ) + +;; definition for method 3 of type mh-grunt-global-info +(defmethod inspect ((this mh-grunt-global-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tpatrol-anim[2] @ #x~X~%" (-> this patrol-anim)) + (format #t "~1Tcharge-anim[1] @ #x~X~%" (-> this charge-anim)) + (format #t "~1Tattack-anim[1] @ #x~X~%" (-> this attack-anim)) + (label cfg-4) + this + ) + +;; definition for symbol *fact-info-mh-grunt-defaults*, type fact-info-enemy-defaults +(define *fact-info-mh-grunt-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 43) + ) + +;; definition for symbol *metalhead-grunt-nav-enemy-info*, type nav-enemy-info +(define *metalhead-grunt-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 6 + :hostile-anim -1 + :hit-anim -1 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim -1 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim 10 + :jump-in-air-anim 11 + :jump-land-anim 12 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 16 + :sound-hit (static-sound-name "mh-grunt-hit") + :sound-die (static-sound-name "mh-grunt-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.5) + :ragdoll-rotate-velocity-mult 0.5 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 51609.6 + :knocked-soft-vxz-hi 87654.4 + :knocked-soft-vy-lo 49152.0 + :knocked-soft-vy-hi 73728.0 + :knocked-medium-vxz-lo 73728.0 + :knocked-medium-vxz-hi 98304.0 + :knocked-medium-vy-lo 65536.0 + :knocked-medium-vy-hi 73728.0 + :knocked-hard-vxz-lo 41779.2 + :knocked-hard-vxz-hi 60620.8 + :knocked-hard-vy-lo 93388.8 + :knocked-hard-vy-hi 103219.2 + :knocked-huge-vxz-lo 82739.2 + :knocked-huge-vxz-hi 126156.8 + :knocked-huge-vy-lo 101580.8 + :knocked-huge-vy-hi 111411.2 + :knocked-yellow-vxz-lo 20480.0 + :knocked-yellow-vxz-hi 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 12288.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 49152.0 + :knocked-red-vy-hi 73728.0 + :knocked-blue-vxz-lo 20480.0 + :knocked-blue-vxz-hi 24576.0 + :knocked-blue-vy-lo 12288.0 + :knocked-blue-vy-hi 40960.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 1.0 :w 10625.897) + :scale (new 'static 'vector :x 0.6399 :y 0.6399 :z 0.6399) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0 :w 1170.3455) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 2268.7744 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 4000.9365) + :geo-tform (new 'static 'vector :x 1.0 :w 12817.95) + :axial-slop 2169.078 + :max-angle 2296.8184 + :coll-rad 2867.2 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10540.374) + :geo-tform (new 'static 'vector :x -1.0 :w 12551.108) + :axial-slop 2169.078 + :max-angle 2226.3489 + :coll-rad 2209.3823 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 13046.233) + :geo-tform (new 'static 'vector :x 1.0 :w 18078.088) + :axial-slop 2169.078 + :max-angle 3210.7178 + :coll-rad 1644.544 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4178 :z -0.9083 :w 11487.004) + :geo-tform (new 'static 'vector :x -0.5907 :y -0.4565 :z 0.665 :w 25388.248) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1641.6768 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1565 :z -0.9875 :w 12747.589) + :geo-tform (new 'static 'vector :x -0.0123 :y 0.7268 :z 0.6864 :w 28823.824) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1295.1552 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z 0.3463 :w 15464.585) + :geo-tform (new 'static 'vector :x 0.0404 :y 0.9991 :z 0.0016 :w 26660.428) + :axial-slop 2169.078 + :max-angle 2671.921 + :coll-rad 1899.3152 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z 0.346 :w 14.381512) + :geo-tform (new 'static 'vector :x 0.5827 :y 0.8005 :z 0.1389 :w 27752.074) + :axial-slop 2169.078 + :max-angle 2077.3455 + :coll-rad 1787.904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.418 :z 0.9082 :w 11484.565) + :geo-tform (new 'static 'vector :x 0.5908 :y -0.4564 :z 0.665 :w 40148.812) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1563.8528 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1563 :z 0.9875 :w 12751.085) + :geo-tform (new 'static 'vector :x 0.0122 :y 0.7266 :z 0.6866 :w 36713.688) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z -0.3461 :w 15469.664) + :geo-tform (new 'static 'vector :x -0.0404 :y 0.9991 :z 0.0015 :w 38877.887) + :axial-slop 2169.078 + :max-angle 2330.5876 + :coll-rad 1610.1376 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9377 :z -0.3468 :w 16.074524) + :geo-tform (new 'static 'vector :x -0.2371 :y 0.2169 :z -0.9468 :w 20556.623) + :axial-slop 2169.078 + :max-angle 1879.882 + :coll-rad 1629.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 42847.234) + :geo-tform (new 'static 'vector :x -1.0 :w 16468.232) + :axial-slop 2169.078 + :max-angle 2508.973 + :coll-rad 1812.0704 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 3567.2522) + :geo-tform (new 'static 'vector :x 1.0 :w 42973.14) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1858.3552 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2349 :z -0.9718 :w 18020.252) + :geo-tform (new 'static 'vector :x 0.3808 :y 0.3151 :z 0.8691 :w 29486.395) + :axial-slop 2169.078 + :max-angle 3698.87 + :coll-rad 877.3632 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9998 :z 0.0086 :w 4412.9214) + :geo-tform (new 'static 'vector :x 0.3995 :y -0.4805 :z 0.7804 :w 25729.781) + :axial-slop 2169.078 + :max-angle 3691.5154 + :coll-rad 1524.9408 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7835 :z 0.621 :w 14960.958) + :geo-tform (new 'static 'vector :x 0.2887 :y 0.6587 :z 0.6945 :w 40555.97) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7644 :z -0.6445 :w 17272.176) + :geo-tform (new 'static 'vector :x 0.5513 :y 0.3614 :z 0.7516 :w 33063.24) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9734 :z 0.2283 :w 7149.304) + :geo-tform (new 'static 'vector :x -0.7224 :y -0.6901 :z -0.0373 :w 15253.522) + :axial-slop 2169.078 + :max-angle 1294.1176 + :coll-rad 659.456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 43 + :parent-joint 20 + :pre-tform (new 'static 'vector :x 0.4934 :z 0.8696 :w 6514.1875) + :geo-tform (new 'static 'vector :x -0.0332 :y 0.8825 :z 0.4687 :w 37613.457) + :axial-slop 2169.078 + :max-angle 1411.5544 + :coll-rad 605.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -1.0 :w 9863.842) + :geo-tform (new 'static 'vector :x -1.0 :w 12698.965) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1488.0768 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -1.0 :w 1462.5452) + :geo-tform (new 'static 'vector :x 0.9995 :y -0.0161 :z -0.0185 :w 7921.737) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1285.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9958 :z -0.09 :w 1956.7229) + :geo-tform (new 'static 'vector :x 0.9998 :y 0.0041 :z 0.0071 :w 33050.805) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1801.8304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6114.891) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0127 :z 0.0043 :w 8018.73) + :axial-slop 2169.078 + :max-angle 2497.213 + :coll-rad 794.2144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6305.8555) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0172 :z 0.0018 :w 6908.7324) + :axial-slop 2169.078 + :max-angle 1846.1127 + :coll-rad 556.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 44 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6830.7266) + :geo-tform (new 'static 'vector :x 0.9993 :y -0.0365 :z -0.006 :w 3790.2383) + :axial-slop 2169.078 + :max-angle 1491.563 + :coll-rad 542.3104 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.2352 :z 0.9718 :w 18022.729) + :geo-tform (new 'static 'vector :x -0.3537 :y 0.3542 :z 0.8654 :w 34566.508) + :axial-slop 2169.078 + :max-angle 3739.2292 + :coll-rad 1540.096 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8967 :z -0.4423 :w 5274.7744) + :geo-tform (new 'static 'vector :x -0.0105 :y 0.862 :z -0.5065 :w 24694.367) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8194 :z -0.573 :w 13110.112) + :geo-tform (new 'static 'vector :x -0.2576 :y 0.7211 :z 0.6428 :w 24504.475) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1751.4496 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8027 :z 0.596 :w 15135.011) + :geo-tform (new 'static 'vector :x -0.5895 :y 0.2007 :z 0.7821 :w 36329.734) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 45 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8262 :z 0.5632 :w 7707.525) + :geo-tform (new 'static 'vector :x -0.6943 :y 0.7184 :z -0.0381 :w 14762.858) + :axial-slop 2169.078 + :max-angle 2015.6871 + :coll-rad 573.0304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 46 + :parent-joint 29 + :pre-tform (new 'static 'vector :x 0.9975 :z -0.0684 :w 3277.692) + :geo-tform (new 'static 'vector :x -0.2795 :y 0.7979 :z 0.5336 :w 35258.77) + :axial-slop 2169.078 + :max-angle 1851.9927 + :coll-rad 468.992 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5769 :z -0.8166 :w 8297.695) + :geo-tform (new 'static 'vector :x -0.6954 :y -0.0651 :z 0.7153 :w 9511.8955) + :axial-slop 2169.078 + :max-angle 2863.5044 + :coll-rad 1868.5952 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5774 :z 0.8162 :w 8293.489) + :geo-tform (new 'static 'vector :x 0.948 :y -0.2986 :z 0.1083 :w 34953.68) + :axial-slop 2169.078 + :max-angle 2569.885 + :coll-rad 1893.9904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.3449 :z -0.9384 :w 16372.404) + :geo-tform (new 'static 'vector :x 0.088 :y -0.8342 :z 0.5442 :w 20057.604) + :axial-slop 2169.078 + :max-angle 3185.0312 + :coll-rad 1327.9232 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6081 :z 0.7936 :w 10429.526) + :geo-tform (new 'static 'vector :x 0.213 :y -0.975 :z -0.061 :w 19499.654) + :axial-slop 2169.078 + :max-angle 2031.8344 + :coll-rad 423.1168 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.9512 :z -0.3084 :w 2006.2573) + :geo-tform (new 'static 'vector :x -0.0464 :y 0.9956 :z 0.0799 :w 26746.152) + :axial-slop 2169.078 + :max-angle 2505.2957 + :coll-rad 533.7088 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7105 :z 0.7034 :w 3017.6597) + :geo-tform (new 'static 'vector :x 0.0381 :y 0.9847 :z -0.1692 :w 26846.422) + :axial-slop 2169.078 + :max-angle 2064.8572 + :coll-rad 408.3712 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.9371 :z 0.3486 :w 15668.893) + :geo-tform (new 'static 'vector :x -0.2897 :y 0.1004 :z 0.9516 :w 31568.328) + :axial-slop 2169.078 + :max-angle 2784.2424 + :coll-rad 1593.7535 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.3452 :z 0.9383 :w 16373.424) + :geo-tform (new 'static 'vector :x 0.1347 :y 0.823 :z -0.5515 :w 19233.342) + :axial-slop 2169.078 + :max-angle 2773.2288 + :coll-rad 1373.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4593 :z -0.888 :w 10428.289) + :geo-tform (new 'static 'vector :x 0.1971 :y 0.977 :z 0.079 :w 17810.5) + :axial-slop 2169.078 + :max-angle 1984.8488 + :coll-rad 616.448 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.9998 :z -0.0063 :w 3668.4868) + :geo-tform (new 'static 'vector :x 0.0529 :y 0.9969 :z 0.056 :w 38759.062) + :axial-slop 2169.078 + :max-angle 1981.1897 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7207 :z -0.6929 :w 3011.8708) + :geo-tform (new 'static 'vector :x -0.0298 :y 0.9808 :z -0.1918 :w 38536.098) + :axial-slop 2169.078 + :max-angle 2276.2654 + :coll-rad 534.528 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint 12 + :pre-tform (new 'static 'vector :x 0.9375 :z -0.3477 :w 15673.973) + :geo-tform (new 'static 'vector :x 0.2894 :y 0.1005 :z 0.9517 :w 33957.168) + :axial-slop 2169.078 + :max-angle 2685.1372 + :coll-rad 1853.0304 + ) + ) + ) + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 6 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 614.4 :z -3276.8 :r 327680.0) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim -1 + :run-anim 7 + :taunt-anim 4 + :run-travel-speed (meters 7) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *metalhead-grunt-nav-enemy-info* fact-defaults) *fact-info-mh-grunt-defaults*) + +;; definition of type metalhead-grunt +(deftype metalhead-grunt (mh-squad-member) + ((patrol-anim mh-grunt-anim-info) + (charge-anim mh-grunt-anim-info) + (attack-anim mh-grunt-anim-info) + (intro-path path-control) + (use-charge-anim-index int8 :offset 1100) + (jumping-ambush-path-pt int8) + (mh-grunt-flags mh-grunt-flag) + (state-timeout2 time-frame) + (next-warn-time time-frame) + (dest vector :inline) + (pad uint8 16) + ) + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) + (:methods + (metalhead-grunt-method-228 (_type_ float) process-focusable) + (get-nav-info (_type_) nav-enemy-info) + (metalhead-grunt-method-230 (_type_ symbol) object) + ) + ) + +;; definition for method 3 of type metalhead-grunt +(defmethod inspect ((this metalhead-grunt)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type mh-squad-member inspect))) + (t9-0 this) + ) + (format #t "~2Tpatrol-anim: #~%" (-> this patrol-anim)) + (format #t "~2Tcharge-anim: #~%" (-> this charge-anim)) + (format #t "~2Tattack-anim: #~%" (-> this attack-anim)) + (format #t "~2Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~2Tcircle-radial-dist: ~f~%" (-> this desired-angle)) + (format #t "~2Tuse-charge-anim-index: ~D~%" (-> this use-charge-anim-index)) + (format #t "~2Tjumping-ambush-path-pt: ~D~%" (-> this jumping-ambush-path-pt)) + (format #t "~2Tmh-grunt-flags: ~D~%" (-> this mh-grunt-flags)) + (format #t "~2Tstate-timeout2: ~D~%" (-> this state-timeout2)) + (format #t "~2Tnext-warn-time: ~D~%" (-> this next-warn-time)) + (format #t "~2Tdest: #~%" (-> this dest)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (label cfg-4) + this + ) + +;; definition for symbol *mh-grunt-global-info*, type mh-grunt-global-info +(define *mh-grunt-global-info* (new 'static 'mh-grunt-global-info + :patrol-anim (new 'static 'inline-array mh-grunt-anim-info 2 + (new 'static 'mh-grunt-anim-info :anim-index 5 :travel-speed (meters 7)) + (new 'static 'mh-grunt-anim-info :anim-index 7 :travel-speed (meters 7)) + ) + :charge-anim (new 'static 'inline-array mh-grunt-anim-info 1 + (new 'static 'mh-grunt-anim-info :anim-index 7 :travel-speed (meters 7)) + ) + :attack-anim (new 'static 'inline-array mh-grunt-anim-info 1 + (new 'static 'mh-grunt-anim-info :anim-index 8 :travel-speed (meters 12)) + ) + ) + ) + +;; definition for method 82 of type metalhead-grunt +(defmethod event-handler ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((= (-> this hit-points) 0.0) + (let ((s5-1 (-> this incoming knocked-type))) + (cond + ((and (= s5-1 (knocked-type yellow-shot)) + (not (and (-> this next-state) (let ((v1-31 (-> this next-state name))) + (or (= v1-31 'knocked) (= v1-31 'jump) (= v1-31 'jump-land)) + ) + ) + ) + (zero? (rnd-int this 3)) + (let ((f0-2 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (f1-2 32768.0) + ) + (>= f0-2 (* f1-2 f1-2)) + ) + ) + (go-die this) + ) + ((or (= s5-1 (knocked-type yellow-shot)) (= s5-1 (knocked-type blue-shot))) + (set! (-> this incoming knocked-type) (knocked-type none)) + (go (method-of-object this knocked)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + ) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (else + ((method-of-type mh-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 74 of type metalhead-grunt +(defmethod go-ambush-delay ((this metalhead-grunt)) + (cond + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) + ) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) + ) + (else + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) + ) + ) + ) + +;; failed to figure out what this is: +(defstate falling-ambush (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let* ((gp-1 *target*) + (a0-4 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (when a0-4 + (let* ((gp-2 (-> self root)) + (s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-2 trans)) 1.0)) + (f0-0 (deg-diff (quaternion-y-angle (-> gp-2 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-2 quat) (-> gp-2 quat) f0-0) + ) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let* ((v1-17 *game-info*) + (v0-9 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) v0-9) + (set! (-> self attack-id) v0-9) + ) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek!) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sound-play "grunt-notice") + (go-virtual hostile) + ) + :post nav-enemy-falling-post + ) + +;; definition for method 102 of type metalhead-grunt +(defmethod go-directed2 ((this metalhead-grunt)) + (case (-> this jump-why) + ((2) + (go (method-of-object this jumping-ambush-cont)) + ) + (else + ((method-of-type mh-squad-member go-directed2) this) + ) + ) + ) + +;; failed to figure out what this is: +(defstate jumping-ambush (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy ambush) enter)) + (when (zero? (-> self intro-path)) + (format 0 "ERROR: ~A has no intro path, skipping jumping-ambush~%" (-> self name)) + (go-virtual notice) + ) + (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) + ) + :code (behavior () + (set! (-> self jumping-ambush-path-pt) 1) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 1.0 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-1 from) v1-5) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate jumping-ambush-cont (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((a0-0 (-> self intro-path)) + (v1-1 (+ (-> self jumping-ambush-path-pt) 1)) + ) + (if (< v1-1 (-> a0-0 curve num-cverts)) + (set! (-> self jumping-ambush-path-pt) v1-1) + (go-best-state self) + ) + ) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 (the float (-> self jumping-ambush-path-pt)) 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-9 (process->ppointer self))) + (set! (-> a1-1 from) v1-9) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate active (metalhead-grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (or (and v1-2 (= v1-2 (-> self draw art-group data 7))) + (let ((v1-8 (ja-group))) + (and v1-8 (or (= v1-8 (-> self draw art-group data 5)) (= v1-8 (-> self draw art-group data 7)))) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (set! (-> self patrol-anim) (-> *mh-grunt-global-info* patrol-anim (rnd-int self 2))) + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + ) + (let ((v1-37 (ja-group))) + (if (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (when (nonzero? (-> self patrol-anim anim-index)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (set! (-> self patrol-anim) (the-as mh-grunt-anim-info (-> *mh-grunt-global-info* patrol-anim))) + (let ((v1-67 (-> self nav))) + (set! (-> v1-67 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + ) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (dotimes (s4-1 s5-1) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (zero? (rnd-int self 3)) + (let ((v1-107 self)) + (set! (-> v1-107 enemy-flags) (the-as enemy-flag (logclear (-> v1-107 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-107 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-171 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-171 enemy-flags))) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-171 enemy-flags)))) + ) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-171 enemy-flags)))) + (set! (-> v1-171 nav callback-info) (-> v1-171 enemy-info callback-info)) + ) + 0 + ) + ) + ) + #f + ) + ) + +;; definition for method 228 of type metalhead-grunt +(defmethod metalhead-grunt-method-228 ((this metalhead-grunt) (arg0 float)) + (local-vars (v1-5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (get-focus! this))) + (when gp-0 + (let ((v1-3 (get-trans gp-0 0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s4-0 v1-3 (-> this root trans)) + (.lvf vf1 (&-> s4-0 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-5 vf1) + (let* ((f30-0 v1-5) + (f0-0 arg0) + (f28-0 (* f0-0 f0-0)) + (f0-2 12288.0) + ) + (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) + (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) + (f1-0 1228.8) + ) + (cond + ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) + (go (method-of-object this attack)) + ) + ((let ((f0-10 12288.0)) + (< f30-0 (* f0-10 f0-10)) + ) + (go (method-of-object this spin-attack)) + ) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (metalhead-grunt) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (metalhead-grunt-method-228 self 13312.0)) + (gp-0 (current-time)) + ) + (when (and (>= gp-0 (-> self next-warn-time)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + (when (and a0-1 (let ((f0-0 65536.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans a0-1 0) (-> self root trans))) + ) + ) + (sound-play "grunt-warn") + (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + ) + ) + ) + ) + :code (behavior () + (let ((f30-0 1.0)) + (until #f + (metalhead-grunt-method-228 self 22528.0) + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-9 (ja-group))) + (when (not (and v1-9 (= v1-9 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((v1-13 (-> self nav))) + (set! (-> v1-13 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate attack (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self nav state))) + (set! (-> v1-1 speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-10 *game-info*) + (a0-5 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a0-5) + (set! (-> self attack-id) a0-5) + ) + (metalhead-grunt-method-230 self #t) + ) + :exit (behavior () + (metalhead-grunt-method-230 self #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (reset-penetrate! self) + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *mh-grunt-global-info* attack-anim (rnd-int self 1))) + (let ((v1-5 (-> self nav))) + (set! (-> v1-5 target-speed) (-> self attack-anim travel-speed)) + ) + 0 + (let ((v1-7 (-> self nav))) + (set! (-> v1-7 turning-acceleration) 49152.0) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-17 (ja-group))) + (if (not (and v1-17 (= v1-17 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self charge-anim anim-index)))) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe 3.0 0)) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (let ((v1-57 0)) + (let ((a0-22 (the-as object (-> *mh-grunt-global-info* charge-anim))) + (a1-7 (-> self charge-anim)) + ) + (dotimes (a2-3 1) + (when (= (the-as mh-grunt-anim-info a0-22) a1-7) + (set! v1-57 a2-3) + (goto cfg-21) + ) + (set! a0-22 (&+ (the-as mh-grunt-anim-info a0-22) 8)) + ) + ) + (label cfg-21) + (set! (-> self use-charge-anim-index) v1-57) + ) + (go-virtual hostile) + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate spin-attack (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (if (not gp-0) + (go-stare self) + ) + (set! (-> self focus-pos quad) (-> (get-trans gp-0 0) quad)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-21 *game-info*) + (a0-13 (+ (-> v1-21 attack-id) 1)) + ) + (set! (-> v1-21 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (metalhead-grunt-method-230 self #t) + ) + :exit (behavior () + (metalhead-grunt-method-230 self #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *mh-grunt-global-info* attack-anim (rnd-int self 1))) + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-13 (ja-group))) + (if (not (and v1-13 (= v1-13 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a0-9 (the-as process-focusable (handle->process (-> self focus handle))))) + (if a0-9 + (set! (-> self focus-pos quad) (-> (get-trans a0-9 0) quad)) + ) + ) + (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (go-virtual hostile) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate stop-chase (metalhead-grunt) + :virtual #t + :code (behavior () + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self patrol-anim) (-> *mh-grunt-global-info* patrol-anim (rnd-int self 2))) + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-24 (ja-group))) + (if (not (and v1-24 (= v1-24 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate wait-for-focus (metalhead-grunt) + :virtual #t + :event enemy-event-handler + :enter (-> (method-of-type nav-enemy idle) enter) + :trans (behavior () + (let ((s5-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when s5-0 + (let ((gp-0 (get-trans s5-0 0))) + (when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))) + (>= 163840.0 (vector-vector-distance (-> self root trans) gp-0)) + ) + (or (not (logtest? (-> self fact enemy-options) (enemy-option user8))) + (and (not (focus-test? s5-0 in-air)) (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root trans y))))) + ) + ) + (cond + ((and (logtest? (-> self fact enemy-options) (enemy-option user9)) + (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector-! s5-1 gp-0 (-> self root trans)) + (let ((f0-2 32768.0) + (v1-26 s5-1) + ) + (if (or (>= f0-2 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) + (>= 20024.889 (fabs (deg- (y-angle (-> self root)) (atan (-> s5-1 x) (-> s5-1 z))))) + ) + (go-virtual notice) + ) + ) + ) + ) + (else + (go-virtual notice) + ) + ) + ) + ) + ) + ) + ) + :code (-> (method-of-type nav-enemy idle) code) + :post (-> (method-of-type nav-enemy idle) post) + ) + +;; definition for method 230 of type metalhead-grunt +;; WARN: Return type mismatch int vs object. +(defmethod metalhead-grunt-method-230 ((this metalhead-grunt) (arg0 symbol)) + 0 + ) + +;; definition for method 7 of type metalhead-grunt +;; WARN: Return type mismatch mh-squad-member vs metalhead-grunt. +(defmethod relocate ((this metalhead-grunt) (offset int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) offset) + ) + (the-as metalhead-grunt ((method-of-type mh-squad-member relocate) this offset)) + ) + +;; definition for method 120 of type metalhead-grunt +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this metalhead-grunt)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 6144.0 0.0 17408.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 9830.4 0.0 4915.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action semi-solid)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 4915.2) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid)) + (set! (-> v1-19 transform-index) 16) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 2252.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 14) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set! (-> v1-23 transform-index) 10) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-25 prim-core action) (collide-action semi-solid)) + (set! (-> v1-25 transform-index) 6) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-27 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-27 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-27 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 229 of type metalhead-grunt +(defmethod get-nav-info ((this metalhead-grunt)) + *metalhead-grunt-nav-enemy-info* + ) + +;; definition for method 194 of type metalhead-grunt +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this metalhead-grunt)) + (let ((t9-0 (method-of-type mh-squad-member citizen-method-194))) + (t9-0 this) + ) + (add-connection + *part-engine* + this + 6 + this + 468 + (new 'static 'vector :x 1433.6 :y 2785.28 :z -1761.28 :w 163840.0) + ) + (add-connection + *part-engine* + this + 6 + this + 468 + (new 'static 'vector :x -1433.6 :y 2785.28 :z -1761.28 :w 163840.0) + ) + 0 + (none) + ) + +;; definition for method 121 of type metalhead-grunt +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this metalhead-grunt)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-grunt" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this (get-nav-info this)) + (let ((v1-6 (-> this neck))) + (set! (-> v1-6 up) (the-as uint 1)) + (set! (-> v1-6 nose) (the-as uint 2)) + (set! (-> v1-6 ear) (the-as uint 0)) + (set-vector! (-> v1-6 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-6 ignore-angle) 30947.555) + ) + (let ((v1-8 (-> this nav))) + (set! (-> v1-8 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (let ((s5-2 *mh-grunt-global-info*)) + (set! (-> this patrol-anim) (-> s5-2 patrol-anim (rnd-int this 2))) + (set! (-> this charge-anim) (-> s5-2 charge-anim (rnd-int this 1))) + (set! (-> this attack-anim) (-> s5-2 attack-anim (rnd-int this 1))) + ) + (set! (-> this use-charge-anim-index) -1) + (if (zero? (rnd-int this 2)) + (logior! (-> this mh-grunt-flags) (mh-grunt-flag mg0)) + ) + (if (zero? (rnd-int this 2)) + (logior! (-> this mh-grunt-flags) (mh-grunt-flag mg2)) + ) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) + (set! (-> this water-anim) -1) + (set! (-> this minimap) #f) + (set! (-> this water-anim) 7) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (metalhead-grunt) + :virtual #t + :code (behavior () + (ja-channel-push! 1 0) + (let ((gp-0 (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll))) + (when gp-0 + (let ((a0-5 (-> gp-0 ragdoll-joints))) + (if (< 0.0 (vector-dot (-> self node-list data (-> a0-5 0 joint-index) bone transform fvec) *y-vector*)) + (ja-no-eval :group! (-> self draw art-group data 13) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! (-> self draw art-group data 14) :num! (seek!) :frame-num 0.0) + ) + ) + (enable-ragdoll! gp-0 self) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +;; definition for method 215 of type metalhead-grunt +(defmethod citizen-method-215 ((this metalhead-grunt)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 6) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate in-ditch (metalhead-grunt) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + +;; failed to figure out what this is: +(defstate die-fast (metalhead-grunt) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc new file mode 100644 index 0000000000..06f39d9d8f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc @@ -0,0 +1,1265 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type metalhead-predator-shot +(deftype metalhead-predator-shot (metalhead-shot) + () + ) + +;; definition for method 3 of type metalhead-predator-shot +(defmethod inspect ((this metalhead-predator-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type metalhead-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 28 of type metalhead-predator-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this metalhead-predator-shot) (arg0 projectile-options)) + (case arg0 + (((projectile-options po0)) + (sound-play "pred-shot-hit") + ) + (((projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-8 (static-sound-spec "pred-shot-loop" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-8 volume) 1024) + (set! (-> a0-8 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-8 (-> this sound-id) (-> this root trans)) + ) + ) + ) + (none) + ) + +;; definition for method 30 of type metalhead-predator-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this metalhead-predator-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate jak-yellow-shot)) + (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 projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (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 projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec jak bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +;; definition for method 31 of type metalhead-predator-shot +;; INFO: Used lq/sq +(defmethod init-proj-settings! ((this metalhead-predator-shot)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'predator-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.767)) + (set! (-> this sound-id) (new-sound-id)) + (set-gravity-length (-> this root dynam) 573440.0) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-metalhead-predator predator predator-lod0-jg predator-idle-ja + ((predator-lod0-mg (meters 20)) (predator-lod1-mg (meters 40)) (predator-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 4) + ) + +;; definition for symbol *metalhead-predator-nav-enemy-info*, type nav-enemy-info +(define *metalhead-predator-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 5 + :hostile-anim -1 + :hit-anim 5 + :knocked-anim 12 + :knocked-land-anim 13 + :die-anim 11 + :die-falling-anim 11 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 7 + :look-at-joint 8 + :bullseye-joint 6 + :sound-hit (static-sound-name "metalhead-preda") + :sound-die (static-sound-name "metalhead-preda") + :notice-distance-delta (meters 0.1) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 81920.0 + :knocked-soft-vxz-hi 81920.0 + :knocked-soft-vy-lo 69632.0 + :knocked-soft-vy-hi 69632.0 + :knocked-medium-vxz-lo 81920.0 + :knocked-medium-vxz-hi 81920.0 + :knocked-medium-vy-lo 69632.0 + :knocked-medium-vy-hi 69632.0 + :knocked-hard-vxz-lo 81920.0 + :knocked-hard-vxz-hi 81920.0 + :knocked-hard-vy-lo 69632.0 + :knocked-hard-vy-hi 69632.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 40960.0 + :knocked-yellow-vxz-hi 53248.0 + :knocked-yellow-vy-lo 40960.0 + :knocked-yellow-vy-hi 53248.0 + :knocked-red-vxz-lo 102400.0 + :knocked-red-vxz-hi 102400.0 + :knocked-red-vy-lo 81920.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 32768.0 + :knocked-blue-vy-hi 49152.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 6 + :turn-anim 5 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 3) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *metalhead-predator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition of type metalhead-predator +(deftype metalhead-predator (mh-squad-member) + ((los los-control :inline) + (want-stop symbol) + (target-pos vector :inline) + (curr-node int32) + (hide-pos vector :inline) + (next-change time-frame) + (shoot-angle float) + (miss-amount float) + (ambient-sound-id sound-id) + (shock-effect-time time-frame) + (shock-effect-end time-frame) + (fade float) + (dest-fade float) + ) + (:state-methods + fire + close-attack + ) + (:methods + (toggle-collide-deadly (_type_ symbol) none) + (metalhead-predator-method-225 (_type_ int float) none) + (metalhead-predator-method-226 (_type_ vector vector vector) symbol) + (metalhead-predator-method-227 (_type_) none) + ) + ) + +;; definition for method 3 of type metalhead-predator +(defmethod inspect ((this metalhead-predator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type mh-squad-member inspect))) + (t9-0 this) + ) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Twant-stop: ~A~%" (-> this want-stop)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tcurr-node: ~D~%" (-> this curr-node)) + (format #t "~2Thide-pos: #~%" (-> this hide-pos)) + (format #t "~2Tnext-change: ~D~%" (-> this next-change)) + (format #t "~2Tshoot-angle: ~f~%" (-> this shoot-angle)) + (format #t "~2Tmiss-amount: ~f~%" (-> this miss-amount)) + (format #t "~2Tambient-sound-id: ~D~%" (-> this ambient-sound-id)) + (format #t "~2Tshock-effect-time: ~D~%" (-> this shock-effect-time)) + (format #t "~2Tshock-effect-end: ~D~%" (-> this shock-effect-end)) + (format #t "~2Tfade: ~f~%" (-> this fade)) + (format #t "~2Tdest-fade: ~f~%" (-> this dest-fade)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 42) (new 'static 'lightning-spec + :name "lightning-metalhead-predator-shock-skel" + :flags (lightning-spec-flags lsf0) + :rand-func #x2 + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.5 + :num-points 32 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "predator-zap" :group 0) + ) + ) + +;; definition for method 227 of type metalhead-predator +;; WARN: Return type mismatch int vs none. +(defmethod metalhead-predator-method-227 ((this metalhead-predator)) + (cond + ((< (-> this hit-points) 2.0) + (when (!= (-> this dest-fade) 128.0) + (sound-play "pred-uncloak") + (set! (-> this sound) (the-as ambient-sound 0)) + 0 + ) + (set! (-> this dest-fade) 128.0) + ) + (else + (set! (-> this dest-fade) 0.0) + ) + ) + (seek! (-> this fade) (-> this dest-fade) (* 60.0 (seconds-per-frame))) + (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) + (cond + ((zero? (-> this draw force-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + ) + ((= (-> this draw force-fade) 128) + (setup-masks (-> this draw) 0 8) + (setup-masks (-> this draw) 4 0) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + ) + (else + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 4 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + ) + ) + (if (< 245760.0 (vector-vector-distance (-> this root trans) (camera-pos))) + (setup-masks (-> this draw) 0 8) + ) + (when (< (current-time) (-> this shock-effect-end)) + (when (time-elapsed? (-> this shock-effect-time) (seconds 0.04)) + (set-time! (-> this shock-effect-time)) + (process-drawable-shock-skel-effect + this + (-> *lightning-spec-id-table* 42) + lightning-probe-callback + (-> *part-id-table* 160) + 2048.0 + -1 + -1 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 59 of type metalhead-predator +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this metalhead-predator)) + (when (< 1 (the-as int (-> this focus aware))) + (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) + (when s5-0 + (set! (-> this focus-pos quad) (-> (get-trans s5-0 5) quad)) + (los-control-method-9 (-> this los) s5-0 (-> this focus-pos) 819.2 4096.0) + ) + ) + ) + (let ((t9-2 (method-of-type mh-squad-member enemy-common-post))) + (t9-2 this) + ) + (metalhead-predator-method-227 this) + (none) + ) + +;; definition for method 82 of type metalhead-predator +;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (set! (-> this shock-effect-end) (+ (current-time) (seconds 1))) + ((method-of-type mh-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + (('combo) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (!= (-> this hit-points) 0.0)) + ) + ) + (else + ((method-of-type mh-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 85 of type metalhead-predator +(defmethod knocked-anim ((this metalhead-predator) (arg0 enemy-knocked-info)) + (cond + ((= (-> this hit-points) 0.0) + (case (-> this incoming knocked-type) + (((knocked-type red-shot)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) + ) + ) + ) + #t + ) + (else + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let ((v1-31 (rnd-int this 2))) + (cond + ((zero? v1-31) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) + ) + ) + ((= v1-31 1) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) + (set! (-> a0-12 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) + ) + (set! (-> a0-12 param 1) (-> arg0 anim-speed)) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) + ) + ) + ) + ) + ) + (((knocked-type red-shot)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> a0-15 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> a0-15 param 1) (-> arg0 anim-speed)) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-17 (-> this skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) + (set! (-> a0-17 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) + ) + (set! (-> a0-17 param 1) (-> arg0 anim-speed)) + (set! (-> a0-17 frame-num) 0.0) + (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) + ) + ) + ) + #t + ) + ) + ) + +;; definition for method 86 of type metalhead-predator +(defmethod knocked-land-anim ((this metalhead-predator) (arg0 enemy-knocked-info)) + (cond + ((= (-> this hit-points) 0.0) + (case (-> this incoming knocked-type) + (((knocked-type red-shot)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) + ) + ) + ) + #t + ) + (else + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) + (set! (-> a0-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-8 param 1) (-> arg0 anim-speed)) + (set! (-> a0-8 frame-num) 0.0) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) + ) + ) + (((knocked-type red-shot)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) + ) + (set! (-> a0-11 param 1) (-> arg0 anim-speed)) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) + (set! (-> a0-13 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) + ) + (set! (-> a0-13 param 1) (-> arg0 anim-speed)) + (set! (-> a0-13 frame-num) 0.0) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) + ) + ) + ) + #t + ) + ) + ) + +;; definition for method 27 of type metalhead-predator +(defmethod get-inv-mass ((this metalhead-predator)) + 0.5 + ) + +;; definition for method 226 of type metalhead-predator +;; INFO: Used lq/sq +(defmethod metalhead-predator-method-226 ((this metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((f0-0 1228.8) + (f30-0 6144.0) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> s5-0 move-dist) arg1 arg0) + (let ((v1-4 s5-0)) + (set! (-> v1-4 radius) f0-0) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (cond + ((>= f0-1 0.0) + (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) f0-1) + (cond + ((< (vector-dot + (-> s5-0 best-other-tri normal) + (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri))) + ) + 0.0 + ) + ) + (else + ) + ) + ) + (else + (vector-! (-> s5-0 move-dist) arg1 arg0) + ) + ) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (let ((v1-14 s5-0)) + (set! (-> v1-14 radius) f30-0) + (set! (-> v1-14 collide-with) (collide-spec enemy hit-by-player-list hit-by-others-list)) + (set! (-> v1-14 ignore-process0) this) + (set! (-> v1-14 ignore-process1) (handle->process (-> this focus handle))) + (set! (-> v1-14 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-14 action-mask) (collide-action solid)) + ) + ) + (cond + ((< (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) + #t + ) + (else + (let ((s4-1 (-> s5-0 best-other-tri collide-ptr))) + (if (and (if (type? s4-1 collide-shape-prim) + s4-1 + ) + (< (vector-dot + (-> s5-0 best-other-tri normal) + (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri))) + ) + 0.0 + ) + ) + #f + ) + ) + ) + ) + ) + ) + +;; definition for method 225 of type metalhead-predator +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod metalhead-predator-method-225 ((this metalhead-predator) (arg0 int) (arg1 float)) + (local-vars (sv-272 vector) (sv-288 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((a1-1 (-> this node-list data arg0)) + (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (set! (-> s5-0 ent) (-> this entity)) + (set! (-> s5-0 charge) 1.0) + (set! (-> s5-0 options) (projectile-options)) + (logclear! (-> s5-0 options) (projectile-options po14 po15 po16)) + (set! (-> s5-0 notify-handle) (process->handle this)) + (set! (-> s5-0 owner-handle) (the-as handle #f)) + (set! (-> s5-0 target-handle) (the-as handle #f)) + (set! (-> s5-0 target-pos quad) (the-as uint128 0)) + (set! (-> s5-0 ignore-handle) (process->handle this)) + (let* ((v1-13 *game-info*) + (a0-12 (+ (-> v1-13 attack-id) 1)) + ) + (set! (-> v1-13 attack-id) a0-12) + (set! (-> s5-0 attack-id) a0-12) + ) + (set! (-> s5-0 timeout) (seconds 4)) + (vector<-cspace! (-> s5-0 pos) a1-1) + (let ((s3-0 (the-as process-focusable (handle->process (-> this focus handle)))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (when s3-0 + (seek! (-> this miss-amount) (* 0.2 (vector-length (-> s3-0 root transv))) 4096.0) + (set! (-> s2-0 quad) (-> (get-trans s3-0 3) quad)) + (set! sv-272 (new 'stack-no-clear 'vector)) + (let ((v1-28 (-> s5-0 pos)) + (a0-19 s2-0) + ) + (.lvf vf4 (&-> v1-28 quad)) + (.lvf vf5 (&-> a0-19 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-272 quad) vf6) + (let* ((f0-5 (vector-length sv-272)) + (f0-6 (* 0.0000018780048 f0-5)) + ) + (set! sv-288 (new 'stack-no-clear 'vector)) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (let ((a0-20 s2-0)) + (let ((v1-34 s2-0)) + (let ((a1-6 (-> s3-0 root transv))) + (let ((a2-2 f0-6)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a1-6 quad)) + ) + (.lvf vf4 (&-> v1-34 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 (&-> a0-20 quad) vf6) + ) + (vector-normalize! sv-272 1.0) + (vector-flatten! sv-288 *up-vector* sv-272) + (vector-normalize! sv-288 1.0) + (vector-cross! s0-0 sv-272 sv-288) + (vector-normalize! s0-0 1.0) + (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-272 (-> this shoot-angle)))) + (vector-orient-by-quat! sv-288 sv-288 a2-5) + ) + (let* ((t9-9 quaternion-vector-angle!) + (a0-28 (new 'stack-no-clear 'quaternion)) + (a2-6 (-> this shoot-angle)) + (a2-7 (t9-9 a0-28 sv-272 a2-6)) + ) + (vector-orient-by-quat! s0-0 s0-0 a2-7) + ) + (let ((a0-30 s1-1)) + (let ((v1-36 s2-0)) + (let ((a1-17 (-> this miss-amount))) + (.mov vf7 a1-17) + ) + (.lvf vf5 (&-> sv-288 quad)) + (.lvf vf4 (&-> v1-36 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 (&-> a0-30 quad) vf6) + ) + (let ((v1-37 s2-0)) + (let ((a0-31 (* arg1 (-> this miss-amount)))) + (.mov vf7 a0-31) + ) + (.lvf vf5 (&-> s0-0 quad)) + (.lvf vf4 (&-> s1-1 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 (&-> v1-37 quad) vf6) + ) + ) + ) + (vector-! (-> s5-0 vel) s2-0 (-> s5-0 pos)) + (vector-normalize! (-> s5-0 vel) 409600.0) + (when (metalhead-predator-method-226 + this + (-> s5-0 pos) + (vector+! (new 'stack-no-clear 'vector) (-> s5-0 pos) (-> s5-0 vel)) + (get-trans s3-0 3) + ) + (vector-normalize! (-> s5-0 vel) 532480.0) + (spawn-projectile metalhead-predator-shot s5-0 this *default-dead-pool*) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate active (metalhead-predator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member active) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member active) trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (metalhead-predator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self want-stop) #f) + (set-time! (-> self state-time)) + (set! (-> self next-change) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 4.0 8.0))))) + (if (zero? (rnd-int self 3)) + (sound-play "pred-talk") + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type mh-squad-member hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (if (and gp-0 (or (focus-test? gp-0 inactive) (focus-test? gp-0 disable))) + (set! gp-0 (the-as process-focusable #f)) + ) + (when (not gp-0) + (set! (-> self current-enemy) (the-as handle #f)) + (go-virtual active) + ) + (when (get-focus! self) + (when (and gp-0 (time-elapsed? (-> self state-time) (-> self reaction-time))) + (cond + ((< (vector-vector-xz-distance (get-trans gp-0 0) (-> self root trans)) 16384.0) + (go-virtual close-attack) + ) + ((should-check-los? (-> self los) 0) + (go-virtual fire) + ) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 6.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate fire (metalhead-predator) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-2 *game-info*) + (a0-1 (+ (-> v1-2 attack-id) 1)) + ) + (set! (-> v1-2 attack-id) a0-1) + (set! (-> self attack-id) a0-1) + ) + (set-traffic-danger self) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :exit (behavior () + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (let ((v1-2 (the-as process-focusable (handle->process (-> self focus handle))))) + (if (and v1-2 (or (focus-test? v1-2 inactive) (focus-test? v1-2 disable))) + (set! v1-2 (the-as process-focusable #f)) + ) + (when (not v1-2) + (set! (-> self current-enemy) (the-as handle #f)) + (go-virtual active) + ) + ) + ) + :code (behavior () + (label cfg-0) + 1.0 + (let ((gp-0 0)) + (set! (-> self shoot-angle) (* 182.04445 (rand-vu-float-range -45.0 45.0))) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (< 9.0 (ja-frame-num 0)) (zero? gp-0)) + (set! gp-0 1) + (metalhead-predator-method-225 self 12 1.0) + ) + (when (and (< 11.0 (ja-frame-num 0)) (= gp-0 1)) + (set! gp-0 2) + (metalhead-predator-method-225 self 16 -1.0) + ) + (let ((s5-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when s5-0 + (seek-toward-heading-vec! + (-> self root) + (vector-! (new 'stack-no-clear 'vector) (get-trans s5-0 0) (-> self root trans)) + 32768.0 + (seconds 0.05) + ) + (if (< (vector-vector-distance (-> self root trans) (get-trans s5-0 0)) 24576.0) + (go-virtual close-attack) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (b! #t cfg-26 :delay (nop!)) + (b! (not #f) cfg-0 :delay (empty-form)) + (label cfg-26) + (go-hostile self) + ) + :post enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate close-attack (metalhead-predator) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-traffic-danger self) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-9 *game-info*) + (a0-5 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a0-5) + (set! (-> self attack-id) a0-5) + ) + (let ((v1-10 (-> self nav))) + (set! (-> v1-10 target-speed) 4096.0) + ) + 0 + ) + :exit (behavior () + (toggle-collide-deadly self #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-0 #f)) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (< 4.0 (ja-frame-num 0)) (not gp-0)) + (toggle-collide-deadly self #t) + (set! gp-0 #t) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-32 (-> self nav state))) + (set! (-> v1-32 speed) 0.0) + ) + 0 + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (zero? (rnd-int self 3)) + (sound-play "pred-talk") + ) + (go-hostile self) + ) + :post nav-enemy-chase-post + ) + +;; definition for method 224 of type metalhead-predator +;; WARN: Return type mismatch int vs none. +(defmethod toggle-collide-deadly ((this metalhead-predator) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (+ (-> (the-as collide-shape-prim-group v1-1) num-children) -2))) + (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child (+ a0-1 2)))) + (if arg0 + (logior! (-> a2-1 prim-core action) (collide-action deadly)) + (logclear! (-> a2-1 prim-core action) (collide-action deadly)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 120 of type metalhead-predator +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this metalhead-predator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (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 11264.0 0.0 17203.2) + (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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak civilian hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 5120.0 0.0 5120.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 enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd jak civilian 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 9216.0 0.0 5120.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-17 transform-index) 7) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-19 transform-index) 16) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 3276.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak civilian hit-by-others-list player-list)) + (set! (-> v1-21 transform-index) 12) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 3276.8) + ) + (set! (-> s5-0 nav-radius) 6144.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! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 7 of type metalhead-predator +(defmethod relocate ((this metalhead-predator) (offset int)) + (call-parent-method this offset) + ) + +;; definition for method 121 of type metalhead-predator +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this metalhead-predator)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-metalhead-predator" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *metalhead-predator-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (set! (-> this draw lod-set lod 1 dist) 573440.0) + (set! (-> this anim-shuffle) 6) + (set! (-> this anim-walk) 6) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 16179.2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) + (set! (-> this speed-run) 49152.0) + (set! (-> this water-anim) 7) + (init-los! + (-> this los) + this + (seconds 0.1) + 327680.0 + (collide-spec backgnd obstacle hit-by-others-list los-blocker) + ) + (set! (-> this minimap) #f) + 0 + (none) + ) + +;; definition for method 194 of type metalhead-predator +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this metalhead-predator)) + (let ((t9-0 (method-of-type mh-squad-member citizen-method-194))) + (t9-0 this) + ) + (add-connection *part-engine* this 8 this 468 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) + (add-connection + *part-engine* + this + 8 + this + 468 + (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0) + ) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> this draw force-fade) (the-as uint 0)) + (set! (-> this fade) 0.0) + (set! (-> this dest-fade) 0.0) + (set! (-> this curr-node) -1) + (set! (-> this next-change) 0) + (set! (-> this miss-amount) 16384.0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + 0 + (none) + ) + +;; definition for method 215 of type metalhead-predator +(defmethod citizen-method-215 ((this metalhead-predator)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 8) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate in-ditch (metalhead-predator) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + +;; failed to figure out what this is: +(defstate die-fast (metalhead-predator) + :virtual #t + :enter (behavior () + (go-inactive self) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine-h_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine-h_REF.gc index 393bad13fb..72a1e352f7 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine-h_REF.gc @@ -51,8 +51,8 @@ (nav-territories uint32) ) (:methods - (vis-cell-method-9 () none) - (vis-cell-method-10 () none) + (reset-segment-counts (_type_) none) + (debug-draw (_type_) none) ) ) @@ -185,9 +185,9 @@ (cell-size vector :inline) ) (:methods - (grid-info-method-9 () none) - (grid-info-method-10 () none) - (grid-info-method-11 () none) + (setup-grid-from-bounding-box (_type_ (pointer bounding-box) int int) none) + (lookup-cell-for-point (_type_ vis-grid-pos vector) none) + (lookup-box-for-sphere (_type_ vis-grid-box vector) none) (debug-draw-grid (_type_ rgba) none) (debug-draw-cell (_type_ vis-grid-pos rgba) none) ) @@ -221,16 +221,16 @@ (pad-array int8 56) ) (:methods - (city-level-info-method-9 () none) - (city-level-info-method-10 () none) - (city-level-info-method-11 () none) - (city-level-info-method-12 () none) - (city-level-info-method-13 () none) - (city-level-info-method-14 () none) - (city-level-info-method-15 () none) - (city-level-info-method-16 () none) - (city-level-info-method-17 () none) - (city-level-info-method-18 () none) + (city-level-info-method-9 (_type_) object) + (init-vis-ray (_type_ vis-ray vector vector) none) + (city-level-info-method-11 (_type_ vis-ray) none) + (city-level-info-method-12 (_type_ vector nav-branch vector) vector) + (lookup-cell-by-position (_type_ vector) vis-cell) + (get-first-cell-in-box (_type_ vis-grid-box) vis-cell) + (sphere-in-grid? (_type_ vector int) symbol) + (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (update-suppressions-from-traffic-engine (_type_ traffic-engine) none) + (city-level-info-method-18 (_type_) none) ) ) @@ -263,12 +263,12 @@ (active-cell-box bounding-box :inline) ) (:methods - (traffic-level-data-method-9 () none) - (traffic-level-data-method-10 () none) - (traffic-level-data-method-11 () none) - (traffic-level-data-method-12 () none) - (traffic-level-data-method-13 () none) - (traffic-level-data-method-14 () none) + (reset! (_type_) none) + (add-active-cell (_type_ vis-cell) none) + (remove-active-cell (_type_ int) none) + (add-newly-active-cell (_type_ vis-cell) none) + (per-frame-cell-update (_type_) none) + (debug-draw (_type_) none) ) ) @@ -315,7 +315,7 @@ ;; definition of type traffic-object-type-info (deftype traffic-object-type-info (structure) - ((flags uint8) + ((flags traffic-type-flag) (active-count int8) (inactive-count int8) (reserve-count uint16) @@ -366,11 +366,11 @@ (array traffic-suppression-box 16 :inline) ) (:methods - (traffic-suppressor-method-9 () none) - (traffic-suppressor-method-10 () none) - (traffic-suppressor-method-11 () none) - (traffic-suppressor-method-12 () none) - (traffic-suppressor-method-13 () none) + (reset-boxes (_type_) none) + (add-new-supression-box (_type_ traffic-suppression-params) none) + (remove-box-by-id (_type_ int) none) + (update-box-from-params (_type_ traffic-suppression-params) none) + (debug-draw (_type_) none) ) ) @@ -400,24 +400,24 @@ (active-object-type-list traffic-type 126) ) (:methods - (traffic-tracker-method-9 () none) - (traffic-tracker-method-10 () none) - (traffic-tracker-method-11 () none) - (traffic-tracker-method-12 () none) - (traffic-tracker-method-13 () none) - (traffic-tracker-method-14 () none) + (traffic-tracker-method-9 (_type_) none) + (traffic-tracker-method-10 (_type_) none) + (traffic-tracker-method-11 (_type_) none) + (add-active-process (_type_ traffic-type handle) none) + (remove-active-process (_type_ int) handle) + (add-reserved-process (_type_ traffic-type handle) none) (get-from-inactive-by-type (_type_ traffic-type) handle) - (traffic-tracker-method-16 () none) - (traffic-tracker-method-17 () none) - (traffic-tracker-method-18 () none) - (traffic-tracker-method-19 () none) - (traffic-tracker-method-20 () none) - (traffic-tracker-method-21 () none) - (traffic-tracker-method-22 () none) - (traffic-tracker-method-23 () none) - (traffic-tracker-method-24 () none) - (traffic-tracker-method-25 () none) - (traffic-tracker-method-26 () none) + (get-from-inactive-by-handle (_type_ traffic-type handle) handle) + (deactivate-object (_type_ int symbol) none) + (set-process-to-killed (_type_ process) none) + (deactivate-all (_type_ symbol) none) + (deactivate-all-of-type (_type_ traffic-type symbol) none) + (activate-from-params (_type_ traffic-object-spawn-params) none) + (activate-by-type (_type_ traffic-type nav-segment float) none) + (activate-by-handle (_type_ traffic-object-spawn-params) none) + (reset (_type_ uint traffic-engine) none) + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) + (for-all-active-processes-of-type (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none) ) ) @@ -455,63 +455,65 @@ (level-data-array traffic-level-data 2 :inline) (object-type-info-array traffic-object-type-info 29 :inline) (tracker-array traffic-tracker 2 :inline) - (inactive-object-array handle 580 :offset 7456) + (tracker0 traffic-tracker :inline :overlay-at (-> tracker-array 0)) + (tracker1 traffic-tracker :inline :offset 6304) + (inactive-object-array handle 580 :offset 7456) (suppressor traffic-suppressor :inline) - (danger-sphere-count int8 :offset 12656) + (danger-sphere-count int8 :offset 12656) (danger-sphere-array traffic-danger-info 4 :inline) - (allow-spawning? symbol :offset 12928) + (allow-spawning? symbol :offset 12928) ) (:methods (new (symbol type) _type_) - (traffic-engine-method-9 () none) + (update-traffic (_type_) none) (reset-and-init-from-manager (_type_ process) none) - (traffic-engine-method-11 () none) - (traffic-engine-method-12 () none) - (traffic-engine-method-13 () none) - (traffic-engine-method-14 () none) - (traffic-engine-method-15 () none) - (traffic-engine-method-16 () none) - (traffic-engine-method-17 () none) - (traffic-engine-method-18 () none) - (traffic-engine-method-19 () none) + (squad-stop-alarm-sound (_type_) none) + (stub (_type_) none) + (add-object (_type_ traffic-type process) none) + (sphere-in-loaded-city-infos? (_type_ vector int) symbol) + (activate-one-citizen (_type_ nav-segment float) none) + (activate-one-vehicle (_type_ nav-segment float) none) + (can-dest-be-used? (_type_ nav-branch) symbol) + (child-killed (_type_ process) none) + (deactivate-all-from-level (_type_ symbol) none) (find-best-segment (_type_ vector vector int) nav-segment) (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) (add-danger (_type_ traffic-danger-info) none) - (traffic-engine-method-23 () none) - (traffic-engine-method-24 () none) - (traffic-engine-method-25 () none) - (traffic-engine-method-26 () none) - (traffic-engine-method-27 () none) - (traffic-engine-method-28 () none) - (traffic-engine-method-29 () none) - (traffic-engine-method-30 () none) - (traffic-engine-method-31 () none) - (traffic-engine-method-32 () none) - (traffic-engine-method-33 () none) - (traffic-engine-method-34 () none) - (traffic-engine-method-35 () none) - (traffic-engine-method-36 () none) - (traffic-engine-method-37 () none) - (traffic-engine-method-38 () none) - (traffic-engine-method-39 () none) - (traffic-engine-method-40 () none) - (traffic-engine-method-41 () none) - (traffic-engine-method-42 () none) - (traffic-engine-method-43 () none) - (traffic-engine-method-44 () none) - (traffic-engine-method-45 () none) - (traffic-engine-method-46 () none) - (traffic-engine-method-47 () none) - (traffic-engine-method-48 () none) - (traffic-engine-method-49 () none) - (traffic-engine-method-50 () none) - (traffic-engine-method-51 () none) - (traffic-engine-method-52 () none) - (traffic-engine-method-53 () none) - (traffic-engine-method-54 () none) - (traffic-engine-method-55 () none) - (traffic-engine-method-56 () none) - (traffic-engine-method-57 () none) + (target-count (_type_ float) none) + (deactivate-all (_type_) none) + (deactivate-by-type (_type_ traffic-type) none) + (restore-default-settings (_type_) none) + (set-object-target-level (_type_ int float) none) + (set-object-target-count (_type_ int int) none) + (set-object-reserve-count (_type_ int uint) none) + (get-object-reserve-count (_type_ int) uint) + (get-object-remaining-count (_type_ int) int) + (activate-object (_type_ traffic-object-spawn-params) none) + (activate-by-handle (_type_ traffic-object-spawn-params) none) + (set-parking-spot-prob (_type_ int float) none) + (get-random-parking-spot-type (_type_) traffic-type) + (new-suppression-box (_type_ traffic-suppression-params) none) + (remove-suppression-box (_type_ traffic-suppression-params) none) + (update-suppression-box (_type_ traffic-suppression-params) none) + (stub1 (_type_) none) + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) + (set-object-auto-activate (_type_ int symbol) none) + (check-proc-in-tracker (_type_ process int) none) + (kill-traffic-sphere (_type_ vector) none) + (level-link (_type_ level) none) + (level-unlink (_type_ level) none) + (add-squad-ctrl (_type_ squad-control) none) + (stub2 (_type_) none) + (stub3 (_type_) none) + (handle-new-vis-cell (_type_ vis-cell) none) + (init-sync-masks (_type_) none) + (stub4 (_type_) none) + (update-traffic-amount (_type_) none) + (update-danger (_type_) none) + (update-danger-from-target (_type_) none) + (stub5 (_type_) none) + (update-suppressor (_type_) none) + (recompute-suppressions (_type_) none) ) ) @@ -534,7 +536,7 @@ (format #t "~1Tsquad-control-array[4] @ #x~X~%" (-> this squad-control-array)) (format #t "~1Tlevel-data-array[2] @ #x~X~%" (-> this level-data-array)) (format #t "~1Tobject-type-info-array[29] @ #x~X~%" (-> this object-type-info-array)) - (format #t "~1Ttracker-array[2] @ #x~X~%" (-> this tracker-array)) + (format #t "~1Ttracker-array[2] @ #x~X~%" (-> this tracker0)) (format #t "~1Tinactive-object-array[580] @ #x~X~%" (-> this inactive-object-array)) (format #t "~1Tsuppressor: #~%" (-> this suppressor)) (format #t "~1Tdanger-sphere-count: ~D~%" (-> this danger-sphere-count)) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc new file mode 100644 index 0000000000..f6586ae482 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc @@ -0,0 +1,1935 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *traffic-suppress-activation*, type symbol +(define *traffic-suppress-activation* #f) + +;; definition for function get-level-nav-graph-by-id +(defun get-level-nav-graph-by-id ((arg0 int)) + (dotimes (v1-0 (-> *level* length)) + (let ((a1-3 (-> *level* level v1-0))) + (when (= (-> a1-3 status) 'active) + (when (and (!= (-> a1-3 bsp city-level-info) 0) (!= (-> a1-3 bsp city-level-info nav-graph) 0)) + (let ((a1-6 (-> a1-3 bsp city-level-info nav-graph))) + (if (and (!= a1-6 0) (= (-> a1-6 id) arg0)) + (return a1-6) + ) + ) + ) + ) + ) + ) + (the-as nav-graph #f) + ) + +;; definition for method 25 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod for-all-active-processes ((this traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) + (let ((s4-0 (-> this traffic))) + (countdown (s3-0 (-> this active-object-count)) + (let ((a1-1 (-> s4-0 object-type-info-array (-> this active-object-type-list s3-0))) + (a0-2 (handle->process (-> this active-object-list s3-0))) + ) + (if (not (focus-test? (the-as process-focusable a0-2) inactive)) + (arg0 (the-as process-focusable a0-2) a1-1) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 26 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod for-all-active-processes-of-type ((this traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) + (let ((s3-0 (-> this traffic))) + (countdown (s2-0 (-> this active-object-count)) + (let ((a0-1 (-> this active-object-type-list s2-0))) + (when (= a0-1 arg0) + (let ((a1-1 (-> s3-0 object-type-info-array a0-1)) + (a0-3 (handle->process (-> this active-object-list s2-0))) + ) + (if (not (focus-test? (the-as process-focusable a0-3) inactive)) + (arg1 (the-as process-focusable a0-3) a1-1) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod add-active-process ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) + (let ((v1-0 (-> this active-object-count))) + (when (< v1-0 (the-as uint 126)) + (set! (-> this active-object-list v1-0) arg1) + (set! (-> this active-object-type-list v1-0) arg0) + (+! (-> this active-object-count) 1) + (let ((v1-6 (-> this traffic object-type-info-array arg0))) + (+! (-> v1-6 active-count) 1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type traffic-tracker +(defmethod remove-active-process ((this traffic-tracker) (arg0 int)) + (let ((v0-0 (-> this active-object-list arg0))) + (let ((v1-3 (-> this active-object-type-list arg0)) + (a2-1 (+ (-> this active-object-count) -1)) + ) + (when (>= a2-1 0) + (set! (-> this active-object-list arg0) (-> this active-object-list a2-1)) + (set! (-> this active-object-type-list arg0) (-> this active-object-type-list a2-1)) + (+! (-> this active-object-count) -1) + (let ((v1-6 (-> this traffic object-type-info-array v1-3))) + (+! (-> v1-6 active-count) -1) + ) + ) + ) + v0-0 + ) + ) + +;; definition for method 14 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod add-reserved-process ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) + (let* ((v1-2 (-> this traffic object-type-info-array arg0)) + (a1-2 (-> v1-2 inactive-count)) + ) + (when (< a1-2 20) + (set! (-> v1-2 array a1-2) arg1) + (+! (-> v1-2 inactive-count) 1) + (+! (-> v1-2 reserve-count) 1) + (+! (-> this inactive-object-count) 1) + ) + ) + 0 + (none) + ) + +;; definition for method 15 of type traffic-tracker +(defmethod get-from-inactive-by-type ((this traffic-tracker) (arg0 traffic-type)) + (let ((v1-2 (-> this traffic object-type-info-array arg0)) + (a1-2 0) + (v0-0 (the-as handle #f)) + ) + (let ((a2-1 (+ (-> v1-2 inactive-count) -1))) + (when (>= a2-1 0) + (set! v0-0 (-> v1-2 array a1-2)) + (set! (-> v1-2 array a1-2) (-> v1-2 array a2-1)) + (+! (-> v1-2 inactive-count) -1) + (+! (-> v1-2 reserve-count) -1) + (+! (-> this inactive-object-count) -1) + ) + ) + v0-0 + ) + ) + +;; definition for method 16 of type traffic-tracker +(defmethod get-from-inactive-by-handle ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) + (let ((v1-2 (-> this traffic object-type-info-array arg0)) + (v0-0 (the-as handle #f)) + ) + (let* ((a3-0 (+ (-> v1-2 inactive-count) -1)) + (a1-3 a3-0) + ) + (while (and (>= a1-3 0) (!= (-> v1-2 array a1-3) arg1)) + (+! a1-3 -1) + ) + (when (>= a1-3 0) + (set! v0-0 (-> v1-2 array a1-3)) + (set! (-> v1-2 array a1-3) (-> v1-2 array a3-0)) + (+! (-> v1-2 inactive-count) -1) + (+! (-> this inactive-object-count) -1) + ) + ) + v0-0 + ) + ) + +;; definition for method 17 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod deactivate-object ((this traffic-tracker) (arg0 int) (arg1 symbol)) + (with-pp + (let* ((s3-0 (-> this active-object-type-list arg0)) + (s5-0 'traffic-off) + (s2-0 (remove-active-process this arg0)) + (s1-0 (handle->process s2-0)) + (v1-5 (the-as object #t)) + ) + (when s1-0 + (when (not (focus-test? (the-as process-focusable s1-0) inactive)) + (if arg1 + (set! s5-0 'traffic-off-force) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) s5-0) + (set! v1-5 (send-event-function s1-0 a1-2)) + ) + ) + (cond + (v1-5 + (add-reserved-process this s3-0 s2-0) + ) + (else + (add-active-process this s3-0 s2-0) + (when *debug-segment* + (when arg1 + (format 0 "traffic-engine::deactivate-object: ~s event refused~%" s5-0) + (format 0 "obj ~s~%" s1-0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 18 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod set-process-to-killed ((this traffic-tracker) (arg0 process)) + (let ((v1-0 -1)) + (let ((a0-3 (process->handle arg0)) + (a1-4 (-> this active-object-count)) + ) + (b! #t cfg-8 :delay (nop!)) + (label cfg-6) + (+! a1-4 -1) + (b! (!= (-> this active-object-list a1-4) a0-3) cfg-8 :delay (empty-form)) + (set! v1-0 (the-as int a1-4)) + (b! #t cfg-10 :delay (nop!)) + (label cfg-8) + (b! (nonzero? a1-4) cfg-6 :delay (nop!)) + ) + (label cfg-10) + (when (!= v1-0 -1) + (let ((s5-0 (-> this active-object-type-list v1-0))) + (let ((a2-4 (remove-active-process this v1-0))) + (add-reserved-process this s5-0 a2-4) + ) + (let ((v1-5 (-> this traffic object-type-info-array s5-0))) + (+! (-> v1-5 killed-count) 1) + (+! (-> v1-5 reserve-count) -1) + ) + ) + #t + ) + ) + 0 + (none) + ) + +;; definition for method 20 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod deactivate-all-of-type ((this traffic-tracker) (arg0 traffic-type) (arg1 symbol)) + (countdown (s3-0 (-> this active-object-count)) + (if (= (-> this active-object-type-list s3-0) arg0) + (deactivate-object this (the-as int s3-0) arg1) + ) + ) + 0 + (none) + ) + +;; definition for method 19 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod deactivate-all ((this traffic-tracker) (arg0 symbol)) + (countdown (s4-0 (-> this active-object-count)) + (deactivate-object this (the-as int s4-0) arg0) + ) + 0 + (none) + ) + +;; definition for method 21 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 21 traffic-tracker) has a return type of none, but the expression builder found a return statement. +(defmethod activate-from-params ((this traffic-tracker) (arg0 traffic-object-spawn-params)) + (local-vars (sv-16 handle)) + (let ((gp-0 (-> arg0 object-type))) + (b! (logtest? (process-mask enemy guard) (-> *kernel-context* prevent-from-run)) cfg-21 :delay (nop!)) + (set! (-> arg0 proc) #f) + (let ((v1-5 (-> this traffic object-type-info-array gp-0))) + (when (and (> (-> v1-5 inactive-count) 0) (> (-> v1-5 reserve-count) 0)) + (set! sv-16 (get-from-inactive-by-type this gp-0)) + (let ((s3-0 (handle->process sv-16))) + (when s3-0 + (when (= gp-0 (traffic-type formation)) + (when (not (rigid-body-object-method-30 (the-as vehicle s3-0))) + (add-reserved-process this gp-0 sv-16) + (return 0) + ) + ) + (cond + ((send-event s3-0 'traffic-activate arg0 (-> this traffic)) + (set! (-> arg0 proc) s3-0) + (add-active-process this gp-0 sv-16) + 0 + ) + (else + (add-reserved-process this gp-0 sv-16) + ) + ) + ) + ) + 0 + ) + ) + ) + (label cfg-21) + 0 + (none) + ) + +;; definition for method 22 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 22 traffic-tracker) has a return type of none, but the expression builder found a return statement. +(defmethod activate-by-type ((this traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) + (let ((s1-0 (-> this traffic object-type-info-array arg0))) + (when (and (> (-> s1-0 inactive-count) 0) + (> (-> s1-0 reserve-count) 0) + (or (< (-> s1-0 active-count) (-> s1-0 target-count)) (< (the-as uint arg0) (the-as uint 17))) + (logtest? (-> s1-0 flags) (traffic-type-flag ttf2)) + (logtest? (-> s1-0 flags) (traffic-type-flag ttf3)) + (not (logtest? (-> s1-0 flags) (traffic-type-flag ttf4))) + (< (-> s1-0 active-count) (-> s1-0 want-count)) + ) + (when *cty-faction-manager* + (if (not (cty-faction-manager-method-23 *cty-faction-manager* (the-as uint (-> arg1 branch clock-mask)))) + (return #f) + ) + (if (not (logtest? (cty-faction-manager-method-9 *cty-faction-manager* (the-as int (-> arg1 branch clock-type)) (-> s1-0 level)) + 2 + ) + ) + (return #f) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'traffic-engine-stack-var0))) + (let ((s0-0 (-> arg1 branch))) + (set! (-> s4-0 params object-type) arg0) + (set! (-> s4-0 params flags) (traffic-spawn-flags)) + (set! (-> s4-0 params guard-type) (-> s1-0 guard-type)) + (set! (-> s4-0 params nav-branch) s0-0) + (let ((v1-29 s0-0)) + (set! (-> s4-0 vec2 x) (* 1024.0 (the float (-> v1-29 speed-limit)))) + ) + (vector-! (-> s4-0 vec0) (-> arg1 vertex 1) (the-as vector (-> arg1 vertex))) + (vector-normalize! (-> s4-0 vec0) 1.0) + (vector+float*! (-> s4-0 params position) (the-as vector (-> arg1 vertex)) (-> s4-0 vec0) arg2) + (let ((f0-6 (* (+ -0.5 (rand-vu)) (* 256.0 (the float (-> s0-0 width)))))) + (+! (-> s4-0 params position x) (* -1.0 (-> s4-0 vec0 z) f0-6)) + (+! (-> s4-0 params position z) (* (-> s4-0 vec0 x) f0-6)) + ) + ) + (set! (-> s4-0 vec2 y) + (+ (* 0.5 (-> s4-0 vec2 x)) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) + ) + (vector-float*! (-> s4-0 params velocity) (-> s4-0 vec0) (-> s4-0 vec2 x)) + (vector-float*! (-> s4-0 vec1) (-> s4-0 vec0) (-> s4-0 vec2 y)) + (when (not (add-sphere-with-mask-and-id (-> this object-hash) (-> s4-0 params position) (-> s4-0 vec1) 20480.0 -1)) + (set! (-> s4-0 params behavior) (the-as uint 2)) + (set! (-> s4-0 params nav-mesh) #f) + (-> arg1 nav-mesh-id) + (if (= (-> arg1 tracker-id) 1) + (set! (-> s4-0 params nav-mesh) (get-nav-mesh (the-as actor-id (-> arg1 nav-mesh-id)))) + ) + (forward-up-nopitch->quaternion (-> s4-0 params rotation) (-> s4-0 vec0) (new 'static 'vector :y 1.0 :w 1.0)) + (set! (-> this rand) (rand-vu)) + (activate-from-params this (-> s4-0 params)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 23 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod activate-by-handle ((this traffic-tracker) (arg0 traffic-object-spawn-params)) + (local-vars (sv-16 handle)) + (let ((gp-0 (-> arg0 object-type))) + (set! (-> arg0 proc) #f) + (when (> (-> this traffic object-type-info-array gp-0 inactive-count) 0) + (set! sv-16 (get-from-inactive-by-handle this gp-0 (-> arg0 handle))) + (let ((s3-0 (handle->process sv-16))) + (when s3-0 + (cond + ((send-event s3-0 'traffic-activate arg0 (-> this traffic)) + (set! (-> arg0 proc) s3-0) + (add-active-process this gp-0 sv-16) + 0 + ) + (else + (add-reserved-process this gp-0 sv-16) + ) + ) + ) + ) + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 24 of type traffic-tracker +;; WARN: Return type mismatch int vs none. +(defmethod reset ((this traffic-tracker) (arg0 uint) (arg1 traffic-engine)) + (set! (-> this traffic) arg1) + (set! (-> this object-hash) (-> arg1 object-hash)) + (set! (-> this rand) 0.5) + (set! (-> this id) arg0) + (set! (-> this active-object-count) (the-as uint 0)) + (set! (-> this inactive-object-count) 0) + 0 + (none) + ) + +;; definition for method 10 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod reset-and-init-from-manager ((this traffic-engine) (arg0 process)) + (set! (-> this allow-spawning?) #t) + (set! (-> this manager) (process->handle arg0)) + (set! (-> this flags) (the-as uint 0)) + (set! (-> this danger-sphere-count) 0) + (set! (-> *game-info* wanted-flash) #f) + (let ((v1-5 (-> this inactive-object-array))) + (dotimes (a0-5 29) + (let ((a1-3 (-> this object-type-info-array a0-5))) + (set! (-> a1-3 flags) (traffic-type-flag ttf1 ttf2)) + (set! (-> a1-3 inactive-count) 0) + (set! (-> a1-3 active-count) 0) + (set! (-> a1-3 target-count) 20) + (set! (-> a1-3 reserve-count) (the-as uint #x7d00)) + (set! (-> a1-3 killed-count) (the-as uint 0)) + (set! (-> a1-3 array) v1-5) + (set! (-> a1-3 level) #f) + ) + (set! v1-5 (&-> v1-5 20)) + ) + ) + (set! (-> this object-type-info-array 6 guard-type) (the-as uint 0)) + (set! (-> this object-type-info-array 14 guard-type) (the-as uint 6)) + (set! (-> this object-type-info-array 15 guard-type) (the-as uint 9)) + (set! (-> this object-type-info-array 16 guard-type) (the-as uint 8)) + (set! (-> this object-type-info-array 26 level) 'ctywide) + (set! (-> this object-type-info-array 28 level) 'ctywide) + (let ((v1-13 17)) + (dotimes (a0-6 12) + (set! (-> this object-type-info-array v1-13 tracker-index) (the-as uint 0)) + (+! v1-13 1) + ) + ) + (let ((v1-16 0)) + (dotimes (a0-7 17) + (set! (-> this object-type-info-array v1-16 tracker-index) (the-as uint 1)) + (+! v1-16 1) + ) + ) + (dotimes (s5-0 2) + (reset (-> this tracker-array s5-0) (the-as uint s5-0) this) + ) + (reset-boxes (-> this suppressor)) + (set! (-> this object-hash object-count) 0) + (clear-bucket-array (-> this object-hash)) + (dotimes (s5-1 2) + (reset! (-> this level-data-array s5-1)) + ) + (dotimes (s5-2 (-> *level* length)) + (let ((a1-9 (-> *level* level s5-2))) + (if (= (-> a1-9 status) 'active) + (level-link this a1-9) + ) + ) + ) + (dotimes (v1-49 4) + (set! (-> this squad-control-array v1-49) #f) + ) + 0 + (none) + ) + +;; definition for method 11 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod squad-stop-alarm-sound ((this traffic-engine)) + (dotimes (s5-0 4) + (let ((a0-1 (-> this squad-control-array s5-0))) + (if a0-1 + (stop-alarm-sound a0-1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 44 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod level-link ((this traffic-engine) (arg0 level)) + (format #t "traffic-engine: level birth ~S~%" (-> arg0 nickname)) + (cond + ((or (not *debug-segment*) + (not (and (get-nav-graph-editor) (= (-> (get-nav-graph-editor) nav-graph nav_graph_id) 1))) + ) + (when (and (nonzero? (-> arg0 bsp city-level-info)) (nonzero? (-> arg0 bsp city-level-info nav-graph))) + (let ((s4-0 (-> arg0 bsp city-level-info))) + (let ((v1-13 (-> arg0 bsp city-level-info nav-graph))) + (when (not (-> v1-13 patched)) + (dotimes (a0-8 (the-as int (-> s4-0 cell-count))) + (let ((a1-3 (-> s4-0 cell-array a0-8))) + (set! (-> a1-3 nav-territories) (the-as uint 0)) + (set! (-> a1-3 segment-array) + (the-as (inline-array nav-segment) (-> s4-0 segment-array (the-as int (the-as uint (-> a1-3 segment-array))))) + ) + ) + ) + (dotimes (a0-11 (-> s4-0 segment-count)) + (let ((a1-6 (-> s4-0 segment-array a0-11))) + (set! (-> a1-6 branch) + (the-as + nav-branch + (+ (the-as uint (the-as nav-branch (-> v1-13 branch-array))) (* (the-as int (-> a1-6 branch)) 16)) + ) + ) + (logior! + (-> s4-0 cell-array (-> a1-6 cell-id) nav-territories) + (ash 1 (the-as int (-> a1-6 branch clock-type))) + ) + ) + ) + (dotimes (a0-14 (-> v1-13 node-count)) + (let ((a1-12 (-> v1-13 node-array a0-14))) + (set! (-> a1-12 branch-array) + (the-as + (inline-array nav-branch) + (+ (the-as uint (-> v1-13 branch-array)) (* (the-as int (-> a1-12 branch-array)) 16)) + ) + ) + ) + ) + (dotimes (a0-17 (-> v1-13 branch-count)) + (let* ((a1-15 (-> v1-13 branch-array a0-17)) + (t0-4 (the-as object (-> a1-15 src-node))) + (a2-17 (the-as object (-> a1-15 dest-node))) + ) + (set! (-> a1-15 src-node) (the-as nav-node (+ (the-as uint (-> v1-13 node-array)) (* (the-as int t0-4) 32)))) + (cond + ((< #x186a0 (the-as int a2-17)) + (let ((a2-18 (- (the-as uint #xffffffff) (the-as uint a2-17)))) + (set! (-> a1-15 dest-node) (-> v1-13 link-array a2-18 dummy-node)) + ) + ) + (else + (set! (-> a1-15 dest-node) + (the-as nav-node (+ (the-as uint (-> v1-13 node-array)) (* (the-as int a2-17) 32))) + ) + ) + ) + ) + ) + (set! (-> v1-13 patched) #t) + ) + (dotimes (a0-21 (-> v1-13 branch-count)) + (set! (-> v1-13 branch-array a0-21 user-count) (the-as uint 0)) + 0 + ) + ) + (dotimes (v1-16 (the-as int (-> s4-0 cell-count))) + (let ((a0-23 (-> s4-0 cell-array v1-16))) + (set! (-> a0-23 flags) (vis-cell-flag)) + (set! (-> a0-23 prev-flags) (vis-cell-flag)) + ) + 0 + ) + (let ((s3-0 0)) + (dotimes (s2-0 (-> s4-0 segment-count)) + (let ((s1-0 (-> s4-0 segment-array s2-0))) + (vector-vector-distance (the-as vector (-> s1-0 vertex)) (-> s1-0 vertex 1)) + (when (< (-> s1-0 spawn-spacing) 0.0) + (inspect s1-0) + #t + (+! s3-0 1) + (set! (-> s1-0 spawn-spacing) (fabs (-> s1-0 spawn-spacing))) + ) + ) + ) + (format #t "birth-level ~s found ~d bad segs~%" arg0 s3-0) + ) + ) + ) + ) + (else + 0 + ) + ) + (let ((s4-1 (the-as traffic-level-data #f))) + (dotimes (v1-31 2) + (let ((a0-34 (-> this level-data-array v1-31))) + (if (zero? (-> a0-34 city-info)) + (set! s4-1 a0-34) + ) + ) + ) + (if (not s4-1) + (format 0 "level-data not found~%") + ) + (when s4-1 + (set! (-> s4-1 city-info) (-> arg0 bsp city-level-info)) + (set! (-> s4-1 active-cell-count) (the-as uint 0)) + 0 + ) + ) + (dotimes (gp-1 (-> *level* length)) + (let ((v1-43 (-> *level* level gp-1))) + (when (= (-> v1-43 status) 'active) + (when (nonzero? (-> v1-43 bsp city-level-info)) + (let ((s5-1 (-> v1-43 bsp city-level-info nav-graph))) + (when (and (nonzero? s5-1) (-> s5-1 patched)) + (dotimes (s4-2 (-> s5-1 link-count)) + (let ((s3-1 (-> s5-1 link-array s4-2))) + (when (not (-> s3-1 dest-graph)) + (let ((s2-1 (get-level-nav-graph-by-id (the-as int (-> s3-1 dest-graph-id))))) + (when (and s2-1 (-> s2-1 patched)) + (dotimes (s1-1 (-> s2-1 node-count)) + (when (= (-> s3-1 dest-node-id) (-> s2-1 node-array s1-1 id)) + (set! (-> s3-1 dest-graph) s2-1) + (set-dst-node (-> s5-1 branch-array (-> s3-1 src-branch-id)) (-> s2-1 node-array s1-1)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 45 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod level-unlink ((this traffic-engine) (arg0 level)) + (let ((s4-0 (-> arg0 bsp city-level-info nav-graph))) + (dotimes (v1-2 2) + (let ((a0-4 (-> this level-data-array v1-2))) + (when (= (-> a0-4 city-info) (-> arg0 bsp city-level-info)) + (set! (-> a0-4 city-info) (the-as city-level-info 0)) + 0 + ) + ) + ) + (when (nonzero? s4-0) + (dotimes (s3-0 (-> *level* length)) + (let ((v1-9 (-> *level* level s3-0))) + (when (= (-> v1-9 status) 'active) + (when (and (!= arg0 v1-9) (!= (-> v1-9 bsp city-level-info) 0)) + (let ((s2-0 (-> v1-9 bsp city-level-info nav-graph))) + (when (nonzero? s2-0) + (dotimes (s1-0 (-> s2-0 link-count)) + (let ((s0-0 (-> s2-0 link-array s1-0))) + (when (= (-> s0-0 dest-graph) s4-0) + (set! (-> s0-0 dest-graph) (get-level-nav-graph-by-id (the-as int (-> s0-0 dest-graph-id)))) + (when (-> s0-0 dest-graph) + (set-dst-node (-> s2-0 branch-array (-> s0-0 src-branch-id)) (-> s0-0 dummy-node)) + (set! (-> s0-0 dest-graph) #f) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((s4-1 (-> arg0 bsp city-level-info nav-graph))) + (dotimes (s3-1 (-> s4-1 link-count)) + (let ((s2-1 (-> s4-1 link-array s3-1))) + (set-dst-node (-> s4-1 branch-array (-> s2-1 src-branch-id)) (-> s2-1 dummy-node)) + (set! (-> s2-1 dest-graph) #f) + ) + ) + ) + (deactivate-all-from-level this (-> arg0 name)) + 0 + (none) + ) + +;; definition for method 40 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod for-all-active-processes ((this traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) + (dotimes (s4-0 2) + (for-all-active-processes (-> this tracker-array s4-0) arg0) + ) + 0 + (none) + ) + +;; definition for method 13 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod add-object ((this traffic-engine) (arg0 traffic-type) (arg1 process)) + (add-reserved-process + (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) + arg0 + (process->handle arg1) + ) + 0 + (none) + ) + +;; definition for method 18 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod child-killed ((this traffic-engine) (arg0 process)) + (cond + ((type? arg0 citizen) + (set-process-to-killed (-> this tracker1) arg0) + ) + ((type? arg0 vehicle) + (set-process-to-killed (-> this tracker0) arg0) + ) + (else + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 15 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod activate-one-citizen ((this traffic-engine) (arg0 nav-segment) (arg1 float)) + (let ((a1-1 (+ (rand-vu-int-count 12) 17))) + (activate-by-type (-> this tracker0) (the-as traffic-type a1-1) arg0 arg1) + ) + 0 + (none) + ) + +;; definition for method 16 of type traffic-engine +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 16 traffic-engine) has a return type of none, but the expression builder found a return statement. +(defmethod activate-one-vehicle ((this traffic-engine) (arg0 nav-segment) (arg1 float)) + (if (-> *setting-control* user-current nuke-active?) + (return 0) + ) + (when (not *cty-faction-manager*) + (let ((a1-1 0)) + (dotimes (v1-6 17) + (let ((a0-3 (-> this object-type-info-array v1-6))) + (if (or (zero? (-> a0-3 inactive-count)) (zero? (-> a0-3 reserve-count))) + (set! a1-1 (logior a1-1 (ash 1 v1-6))) + ) + ) + ) + (let ((a1-2 (rand-vu-int-count-excluding 17 a1-1))) + (activate-by-type (-> this tracker1) (the-as traffic-type a1-2) arg0 arg1) + ) + ) + (return 0) + ) + (let ((s3-0 -1)) + (let ((f30-0 -1.0)) + (dotimes (s2-0 17) + (let ((v1-15 (-> this object-type-info-array s2-0))) + (when (and (> (-> v1-15 inactive-count) 0) (> (-> v1-15 reserve-count) 0)) + (let ((s1-0 (-> this object-type-info-array s2-0))) + (when (-> s1-0 level) + (let ((s0-0 + (-> s1-0 + target-counts + (cty-faction-manager-method-10 *cty-faction-manager* (the-as int (-> arg0 branch clock-type)) (-> s1-0 level)) + ) + ) + ) + (when (< (-> s1-0 active-count) s0-0) + (when (logtest? (cty-faction-manager-method-9 *cty-faction-manager* (the-as int (-> arg0 branch clock-type)) (-> s1-0 level)) + 2 + ) + (let* ((f0-2 (/ (the float (-> s1-0 active-count)) (the float s0-0))) + (f0-3 (- 1.0 f0-2)) + ) + (when (< f30-0 f0-3) + (set! f30-0 f0-3) + (set! s3-0 s2-0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (if (>= s3-0 0) + (activate-by-type (-> this tracker1) (the-as traffic-type s3-0) arg0 arg1) + ) + ) + 0 + (none) + ) + +;; definition for method 49 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod handle-new-vis-cell ((this traffic-engine) (arg0 vis-cell)) + (dotimes (s4-0 (-> arg0 segment-count)) + (let* ((s3-0 (-> arg0 segment-array s4-0)) + (s1-0 (-> s3-0 tracker-id)) + ) + (when (and (logtest? (logxor (-> arg0 flags) (the-as uint (-> arg0 prev-flags))) (ash 1 s1-0)) + (and (not (logtest? (-> arg0 flags) (vis-cell-flag suppress))) + (not (or (can-dest-be-used? this (-> s3-0 branch)) (let ((a0-7 (-> s3-0 branch))) + (>= (-> a0-7 user-count) (-> a0-7 max-user-count)) + ) + ) + ) + ) + ) + (let* ((s2-0 (-> this tracker-array s1-0)) + (f30-0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing))) + ) + (cond + ((= s1-0 1) + (when (nonzero? (-> s3-0 nav-mesh-id)) + (while (and (< f30-0 (-> s3-0 length)) + (> (-> s2-0 inactive-object-count) 0) + (< (-> s3-0 branch density) (the-as uint 128)) + ) + (activate-one-vehicle this s3-0 f30-0) + (set! f30-0 (+ 24576.0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) + ) + ) + ) + (else + (while (and (< f30-0 (-> s3-0 length)) + (> (-> s2-0 inactive-object-count) 0) + (< (-> s3-0 branch density) (the-as uint 128)) + ) + (activate-one-citizen this s3-0 f30-0) + (set! f30-0 (+ 49152.0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) + ) + ) + ) + (if (>= f30-0 (-> s3-0 length)) + (set! (-> s2-0 rand) + (fmax 0.0 (- (-> s2-0 rand) (/ (-> s3-0 length) (* (-> s3-0 spawn-spacing) (-> this inv-density-factor))))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod stub ((this traffic-engine)) + (when #f + ) + 0 + (none) + ) + +;; definition for method 14 of type traffic-engine +(defmethod sphere-in-loaded-city-infos? ((this traffic-engine) (arg0 vector) (arg1 int)) + (dotimes (s3-0 2) + (let ((v1-3 (-> this level-data-array s3-0))) + (when (nonzero? (-> v1-3 city-info)) + (if (sphere-in-grid? (-> v1-3 city-info) arg0 arg1) + (return #t) + ) + ) + ) + ) + #f + ) + +;; definition for method 17 of type traffic-engine +(defmethod can-dest-be-used? ((this traffic-engine) (arg0 nav-branch)) + (let ((v1-0 (-> arg0 src-node))) + (or (logtest? (-> arg0 flags) (nav-branch-flags nabflags-0)) + (logtest? (-> v1-0 flags) (nav-node-flag-byte blocked)) + (not (-> arg0 dest-node)) + (>= (-> arg0 user-count) (-> arg0 max-user-count)) + ) + ) + ) + +;; definition for method 50 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod init-sync-masks ((this traffic-engine)) + (+! (-> this sync-clock) 1) + (set! (-> this sync-mask-8) (the-as uint (ash 1 (the-as int (logand (-> this sync-clock) 7))))) + (set! (-> this sync-mask-16) (the-as uint (ash 1 (the-as int (logand (-> this sync-clock) 15))))) + (set! (-> this sync-mask-32) (the-as uint (ash 1 (the-as int (logand (-> this sync-clock) 31))))) + (let ((v1-10 (/ (current-time) 300))) + (set! (-> this sync-array 0) (the-as uint 255)) + (let ((a1-12 (mod v1-10 20))) + (set! (-> this sync-array 1) (the-as uint (cond + ((>= 6 a1-12) + 1 + ) + ((>= 9 a1-12) + 2 + ) + ((>= 16 a1-12) + 4 + ) + (else + 8 + ) + ) + ) + ) + ) + (let ((a1-15 (mod v1-10 30))) + (set! (-> this sync-array 2) (the-as uint (cond + ((>= 6 a1-15) + 1 + ) + ((>= 9 a1-15) + 2 + ) + ((>= 16 a1-15) + 4 + ) + ((>= 19 a1-15) + 8 + ) + ((>= 26 a1-15) + 16 + ) + (else + 32 + ) + ) + ) + ) + ) + (let ((v1-11 (mod v1-10 40))) + (set! (-> this sync-array 3) (the-as uint (cond + ((>= 6 v1-11) + 1 + ) + ((>= 9 v1-11) + 2 + ) + ((>= 16 v1-11) + 4 + ) + ((>= 19 v1-11) + 8 + ) + ((>= 26 v1-11) + 16 + ) + ((>= 29 v1-11) + 32 + ) + ((>= 36 v1-11) + 64 + ) + (else + 128 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 54 of type traffic-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod update-danger-from-target ((this traffic-engine)) + (local-vars (v1-20 float) (v1-32 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 *target*)) + (when s5-0 + (let ((v1-1 (-> this danger-sphere-array))) + (set! (-> v1-1 0 handle) (process->handle s5-0)) + (let ((a0-4 (-> s5-0 focus-status)) + (f0-0 0.0) + (f1-0 0.0) + (f3-0 1.0) + (f2-0 0.0) + ) + (cond + ((logtest? (focus-status mech dark shooting) a0-4) + (set! f0-0 245760.0) + (set! f1-0 163840.0) + (set! f2-0 1.0) + (set! f3-0 0.0) + ) + ((logtest? (focus-status gun) a0-4) + (set! f0-0 102400.0) + (set! f1-0 61440.0) + (set! f2-0 0.5) + (set! f3-0 0.5) + ) + ((logtest? (focus-status flut board pilot) a0-4) + (set! f0-0 40960.0) + (set! f1-0 24576.0) + (set! f2-0 0.5) + ) + ((logtest? a0-4 (focus-status dangerous)) + (set! f0-0 61440.0) + (set! f1-0 40960.0) + (set! f3-0 0.0) + (set! f2-0 0.5) + ) + (else + (set! f3-0 1.5) + ) + ) + (set! (-> v1-1 0 decay-rate) (* 0.1 f3-0)) + (when (< (-> v1-1 0 danger-level) f2-0) + (set! (-> v1-1 0 danger-level) f2-0) + (set! (-> v1-1 0 sphere r) f1-0) + (set! (-> v1-1 0 notify-radius) f0-0) + ) + ) + (let ((f0-1 (-> v1-1 0 sphere r))) + (set! (-> v1-1 0 sphere quad) (-> s5-0 control trans quad)) + (set! (-> v1-1 0 sphere r) f0-1) + ) + (set! (-> v1-1 0 velocity quad) (-> s5-0 control transv quad)) + (let ((f0-3 (- (-> v1-1 0 danger-level) (* (-> v1-1 0 decay-rate) (seconds-per-frame))))) + (set! (-> v1-1 0 danger-level) (fmax 0.0 f0-3)) + ) + ) + (let ((s3-0 (-> s5-0 focus-status)) + (f30-0 0.0) + (s4-0 (new 'stack-no-clear 'inline-array 'traffic-suppression-box 2)) + ) + (set! (-> s4-0 0 bbox max quad) (-> s5-0 control transv quad)) + (vector-z-quaternion! (the-as vector (-> s4-0 1)) (get-quat s5-0 3)) + (set! (-> s4-0 1 data 16) (the-as uint 3)) + (cond + ((logtest? (focus-status shooting) s3-0) + (vector-float*! (the-as vector (-> s4-0 0)) (the-as vector (-> s4-0 1)) 409600.0) + (set! f30-0 4096.0) + (set! (-> s4-0 1 data 16) (the-as uint 0)) + 0 + ) + ((and (logtest? (focus-status gun) s3-0) + (not (and (logtest? (focus-status pilot) s3-0) (let* ((v1-19 (-> s4-0 0 bbox max)) + (f0-6 40960.0) + (f0-8 (* f0-6 f0-6)) + ) + (.lvf vf1 (&-> v1-19 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-20 vf1) + (< f0-8 v1-20) + ) + ) + ) + ) + (vector-float*! (the-as vector (-> s4-0 0)) (the-as vector (-> s4-0 1)) 163840.0) + (set! f30-0 8192.0) + (set! (-> s4-0 1 data 16) (the-as uint 1)) + ) + ((logtest? (focus-status dangerous flut board pilot) s3-0) + (vector-float*! (the-as vector (-> s4-0 0)) (-> s4-0 0 bbox max) 2.0) + (let* ((v1-31 (-> s4-0 0)) + (f0-11 20480.0) + (f0-13 (* f0-11 f0-11)) + ) + (.lvf vf1 (&-> v1-31 bbox min 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-32 vf1) + (if (< f0-13 v1-32) + (set! f30-0 20480.0) + ) + ) + (set! (-> s4-0 1 data 16) (the-as uint (cond + ((logtest? (focus-status pilot) s3-0) + 3 + ) + ((logtest? (focus-status flut board) s3-0) + 2 + ) + ((logtest? s3-0 (focus-status dangerous)) + 4 + ) + (else + 5 + ) + ) + ) + ) + ) + ) + (when (< 0.0 f30-0) + (let ((s3-1 (new 'stack-no-clear 'array 'collide-shape 40)) + (s2-1 (new 'stack 'traffic-danger-info)) + ) + (set! (-> s2-1 sphere quad) (-> s5-0 control trans quad)) + (set! (-> s2-1 danger-type) (-> s4-0 1 data 16)) + (set! (-> s2-1 sphere r) f30-0) + (set! (-> s2-1 velocity quad) (-> s4-0 0 bbox min quad)) + (let ((gp-1 (fill-actor-list-for-sphere + (-> this object-hash) + (-> s2-1 sphere) + (-> s2-1 velocity) + (-> s2-1 sphere r) + s3-1 + 40 + -1 + ) + ) + ) + (dotimes (s5-1 gp-1) + (let* ((s4-1 (-> s3-1 s5-1)) + (a0-52 (if (type? s4-1 citizen) + s4-1 + ) + ) + ) + (if a0-52 + (send-event (the-as process-tree a0-52) 'clear-path s2-1) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 53 of type traffic-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod update-danger ((this traffic-engine)) + (update-danger-from-target this) + (dotimes (s5-0 (-> this danger-sphere-count)) + (let ((s4-0 (-> this danger-sphere-array s5-0))) + (when (< 0.0 (-> s4-0 danger-level)) + (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 40)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 quad) (-> s4-0 sphere quad)) + (set! (-> a1-0 w) (-> s4-0 notify-radius)) + (let ((s2-0 (fill-actor-list-for-box (-> this object-hash) a1-0 s3-0 40))) + (dotimes (s1-0 s2-0) + (let* ((s0-0 (-> s3-0 s1-0)) + (a0-6 (if (type? s0-0 citizen) + s0-0 + ) + ) + ) + (when a0-6 + (if (= (-> s4-0 danger-type) 8) + (send-event (the-as process-tree a0-6) 'clear-path s4-0) + (send-event + (the-as process-tree a0-6) + (if (< 0.5 (-> s4-0 danger-level)) + 'panic + 'avoid + ) + s4-0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> this danger-sphere-count) 1) + 0 + (none) + ) + +;; definition for method 22 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod add-danger ((this traffic-engine) (arg0 traffic-danger-info)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((a1-1 (new 'stack-no-clear 'traffic-danger-info))) + (let ((a0-1 (-> a1-1 sphere))) + (let ((v1-0 (-> arg0 sphere))) + (let ((a2-0 (- (-> arg0 notify-radius)))) + (.mov vf6 a2-0) + ) + (.lvf vf4 (&-> v1-0 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-1 quad) vf5) + ) + (let ((a0-2 (-> a1-1 velocity))) + (let ((v1-1 (-> arg0 sphere))) + (let ((a2-1 (-> arg0 notify-radius))) + (.mov vf6 a2-1) + ) + (.lvf vf4 (&-> v1-1 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-2 quad) vf5) + ) + (set! (-> a1-1 handle) (new 'static 'handle :process #x5dc :u64 #x5dc)) + (new-suppression-box this (the-as traffic-suppression-params a1-1)) + ) + (let ((v1-5 (-> this danger-sphere-count))) + (when (< v1-5 4) + (let ((a0-5 (-> this danger-sphere-array v1-5))) + (mem-copy! (the-as pointer a0-5) (the-as pointer arg0) 54) + ) + (+! (-> this danger-sphere-count) 1) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 43 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod kill-traffic-sphere ((this traffic-engine) (arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 64))) + (countdown (s5-0 (fill-actor-list-for-box *actor-hash* arg0 gp-0 64)) + (let* ((s4-0 (-> gp-0 s5-0)) + (v1-3 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (if v1-3 + (send-event (-> v1-3 process) 'traffic-off-force) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 52 of type traffic-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 52 traffic-engine) has a return type of none, but the expression builder found a return statement. +(defmethod update-traffic-amount ((this traffic-engine)) + (local-vars (sv-48 int) (sv-64 nav-segment)) + (if (not (-> this allow-spawning?)) + (return 0) + ) + (set! (-> this object-hash object-count) 0) + (clear-bucket-array (-> this object-hash)) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((a2-0 *target*)) + (when a2-0 + (cond + ((focus-test? a2-0 pilot) + (when (nonzero? (-> a2-0 pilot)) + (let ((a2-1 (handle->process (-> a2-0 pilot vehicle)))) + (when a2-1 + (set! (-> s5-0 quad) (-> (the-as process-focusable a2-1) root root-prim prim-core world-sphere quad)) + (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) a2-1)) + ) + ) + ) + ) + (else + (set! (-> s5-0 quad) (-> a2-0 control trans quad)) + (set! (-> s5-0 w) 20480.0) + (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) a2-0)) + ) + ) + ) + ) + (countdown (s4-0 (-> this tracker0 active-object-count)) + (let ((s3-0 (handle->process (-> this tracker0 active-object-list s4-0)))) + (cond + (s3-0 + (cond + ((focus-test? (the-as process-focusable s3-0) inactive) + (deactivate-object (-> this tracker0) (the-as int s4-0) #f) + ) + ((begin + (let ((v1-32 (-> (the-as process-focusable s3-0) root))) + (set! (-> s5-0 quad) (-> v1-32 trans quad)) + (set! (-> s5-0 w) (-> v1-32 root-prim prim-core world-sphere w)) + ) + (sphere-in-loaded-city-infos? this s5-0 0) + ) + (set! (-> (the-as vehicle s3-0) traffic-hash-id) + (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) s3-0)) + ) + ) + (else + (deactivate-object (-> this tracker0) (the-as int s4-0) #f) + ) + ) + ) + (else + (remove-active-process (-> this tracker0) (the-as int s4-0)) + ) + ) + ) + ) + (countdown (s4-1 (-> this tracker1 active-object-count)) + (let ((s3-1 (handle->process (-> this tracker1 active-object-list s4-1)))) + (cond + (s3-1 + (cond + ((focus-test? (the-as process-focusable s3-1) inactive) + (deactivate-object (-> this tracker1) (the-as int s4-1) #f) + ) + (else + (let ((v1-53 (-> (the-as process-focusable s3-1) root))) + (set! (-> s5-0 quad) (-> v1-53 trans quad)) + (set! (-> s5-0 w) (-> v1-53 root-prim prim-core world-sphere w)) + ) + (when (logtest? (-> (the-as citizen s3-1) flags) (citizen-flag in-formation)) + ) + (if (sphere-in-loaded-city-infos? this s5-0 1) + (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) s3-1)) + (deactivate-object (-> this tracker1) (the-as int s4-1) #f) + ) + ) + ) + ) + (else + (remove-active-process (-> this tracker1) (the-as int s4-1)) + ) + ) + ) + ) + ) + (dotimes (s5-1 2) + (let ((s4-2 (-> this level-data-array s5-1))) + (when (nonzero? (-> s4-2 city-info)) + (dotimes (s3-2 (the-as int (-> s4-2 newly-active-cell-count))) + (let ((a1-19 (-> s4-2 newly-active-cell-list s3-2))) + (handle-new-vis-cell this a1-19) + ) + ) + (dotimes (s3-3 2) + (when (> (-> this tracker-array s3-3 inactive-object-count) 0) + (let ((s2-0 (the-as nav-segment #f))) + (let ((f30-0 10000000000000000000000000000000000000.0)) + (dotimes (s1-0 (the-as int (-> s4-2 active-cell-count))) + (let ((s0-0 (-> s4-2 active-cell-list s1-0))) + (when (and (logtest? (-> s0-0 flags) (ash 1 s3-3)) (not (logtest? (-> s0-0 flags) (vis-cell-flag suppress)))) + (set! sv-48 0) + (while (< sv-48 (-> s0-0 incoming-segment-count)) + (set! sv-64 (-> s0-0 segment-array sv-48)) + (when (= (-> sv-64 tracker-id) s3-3) + (when (and (not (logtest? (-> s4-2 city-info cell-array (-> sv-64 from-cell-id) flags) (ash 1 s3-3))) + (< (-> sv-64 branch density) (the-as uint 128)) + ) + (let ((f0-3 (rand-vu))) + (when (< f0-3 f30-0) + (set! f30-0 f0-3) + (set! s2-0 sv-64) + ) + ) + ) + ) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + ) + (when s2-0 + (let ((a0-46 (-> s2-0 branch))) + (when (not (or (>= (-> a0-46 user-count) (-> a0-46 max-user-count)) (can-dest-be-used? this (-> s2-0 branch)))) + (cond + ((= s3-3 1) + (if (nonzero? (-> s2-0 nav-mesh-id)) + (activate-one-vehicle this s2-0 0.0) + ) + ) + (else + (activate-one-citizen this s2-0 0.0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod update-traffic ((this traffic-engine)) + (init-sync-masks this) + (update-suppressor this) + (let ((s5-0 (new 'stack-no-clear 'bounding-box))) + (set-vector! + (-> s5-0 min) + 10000000000000000000000000000000000000.0 + 10000000000000000000000000000000000000.0 + 10000000000000000000000000000000000000.0 + 1.0 + ) + (set-vector! + (-> s5-0 max) + -10000000000000000000000000000000000000.0 + -10000000000000000000000000000000000000.0 + -10000000000000000000000000000000000000.0 + 1.0 + ) + (dotimes (s4-0 2) + (let ((s3-0 (-> this level-data-array s4-0))) + (when (nonzero? (-> s3-0 city-info)) + (per-frame-cell-update s3-0) + (add-box! s5-0 (-> s3-0 active-cell-box)) + 0 + ) + ) + ) + (update-grid-for-objects-in-box (-> this object-hash) 253 (-> s5-0 min) (-> s5-0 max)) + ) + (when *cty-faction-manager* + (let ((a1-2 0)) + (dotimes (v1-22 2) + (let ((a0-17 (-> this level-data-array v1-22))) + (when (nonzero? (-> a0-17 city-info)) + (dotimes (a2-3 (the-as int (-> a0-17 active-cell-count))) + (set! a1-2 (logior a1-2 (-> a0-17 active-cell-list a2-3 nav-territories))) + ) + ) + ) + ) + (cty-faction-manager-method-20 *cty-faction-manager* (the-as uint a1-2)) + ) + (cty-faction-manager-method-13 *cty-faction-manager*) + ) + (if *cty-attack-controller* + (mission-squad-control-method-16 *cty-attack-controller*) + ) + (update-traffic-amount this) + (dotimes (s5-1 4) + (let ((a0-23 (-> this squad-control-array s5-1))) + (if a0-23 + (update a0-23) + ) + ) + ) + (update-danger this) + 0 + (none) + ) + +;; definition for method 21 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod callback-on-nav-segments-in-sphere ((this traffic-engine) + (arg0 vector) + (arg1 int) + (arg2 traffic-find-segment-struct) + (arg3 (function traffic-find-segment-struct nav-segment none)) + ) + (dotimes (s1-0 2) + (let ((v1-3 (-> this level-data-array s1-0))) + (if (nonzero? (-> v1-3 city-info)) + (callback-on-nav-segments-in-sphere (-> v1-3 city-info) arg0 arg1 arg2 arg3) + ) + ) + ) + 0 + (none) + ) + +;; definition of type traffic-find-segment-struct +(deftype traffic-find-segment-struct (structure) + ((best-seg nav-segment) + (best-rating float) + (dir vector :inline) + ) + ) + +;; definition for method 3 of type traffic-find-segment-struct +(defmethod inspect ((this traffic-find-segment-struct)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traffic-find-segment-struct) + (format #t "~1Tbest-seg: #~%" (-> this best-seg)) + (format #t "~1Tbest-rating: ~f~%" (-> this best-rating)) + (format #t "~1Tdir: #~%" (-> this dir)) + (label cfg-4) + this + ) + +;; definition for method 20 of type traffic-engine +;; INFO: Used lq/sq +(defmethod find-best-segment ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) + (let ((gp-0 (new 'stack-no-clear 'traffic-find-segment-struct))) + (set! (-> gp-0 dir quad) (-> arg1 quad)) + (set! (-> gp-0 best-rating) -10000000000000000000000000000000000000.0) + (set! (-> gp-0 best-seg) #f) + (callback-on-nav-segments-in-sphere + this + arg0 + arg2 + gp-0 + (lambda ((arg0 traffic-find-segment-struct) (arg1 nav-segment)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 (-> arg1 vertex 1) (the-as vector (-> arg1 vertex))) + (let ((a2-1 v1-0) + (a3-1 v1-0) + (f0-0 (-> arg1 length)) + ) + (vector-float*! a2-1 a3-1 (/ 1.0 f0-0)) + ) + (let ((f0-4 (vector-dot v1-0 (-> arg0 dir)))) + (when (< (-> arg0 best-rating) f0-4) + (set! (-> arg0 best-rating) f0-4) + (set! (-> arg0 best-seg) arg1) + ) + ) + ) + (none) + ) + ) + (-> gp-0 best-seg) + ) + ) + +;; definition for method 23 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod target-count ((this traffic-engine) (arg0 float)) + (dotimes (v1-0 29) + (let ((a2-2 (-> this object-type-info-array v1-0))) + (set! (-> a2-2 target-count) (the int (* arg0 (the float (max 0 (+ (-> a2-2 want-count) -1)))))) + ) + ) + 0 + (none) + ) + +;; definition for method 26 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod restore-default-settings ((this traffic-engine)) + (let ((t9-0 (-> *traffic-info* restore-speech-callback))) + (if t9-0 + (t9-0) + ) + ) + (target-count this 1.0) + (set! (-> this inv-density-factor) 5.0) + (let ((v1-6 32)) + (dotimes (a0-2 29) + (let ((a1-3 (-> this object-type-info-array a0-2))) + (set! (-> a1-3 flags) (traffic-type-flag ttf1 ttf2)) + (set! (-> a1-3 reserve-count) (the-as uint (max 1000 (min #xfde8 (* 1000 (-> a1-3 want-count)))))) + (set! (-> a1-3 killed-count) (the-as uint 0)) + (set! (-> a1-3 parking-spot-prob) + (the-as uint (if (and (zero? (-> a1-3 tracker-index)) + (not (logtest? (-> a1-3 flags) (traffic-type-flag ttf0))) + (!= a0-2 27) + (!= a0-2 26) + ) + v1-6 + 0 + ) + ) + ) + (let ((a2-9 a0-2)) + (if (or (= a2-9 17) (or (= a2-9 18) (= a2-9 19) (= a2-9 28))) + (set! (-> a1-3 parking-spot-prob) (the-as uint 128)) + ) + ) + ) + ) + ) + (let ((v1-9 (-> this object-type-info-array 6))) + (logior! (-> v1-9 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-10 (-> this object-type-info-array 7))) + (logior! (-> v1-10 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-11 (-> this object-type-info-array 24))) + (logior! (-> v1-11 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-12 (-> this object-type-info-array 25))) + (logior! (-> v1-12 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-13 (-> this object-type-info-array 26))) + (logior! (-> v1-13 flags) (traffic-type-flag ttf0)) + ) + (let ((v1-14 (-> this object-type-info-array 5))) + (set! (-> v1-14 target-count) 0) + (logclear! (-> v1-14 flags) (traffic-type-flag ttf1 ttf2)) + ) + (let ((v1-15 (-> this object-type-info-array 3))) + (set! (-> v1-15 target-count) 0) + (logclear! (-> v1-15 flags) (traffic-type-flag ttf2)) + ) + (let ((v1-16 (-> this object-type-info-array 4))) + (set! (-> v1-16 target-count) 0) + (logclear! (-> v1-16 flags) (traffic-type-flag ttf2)) + ) + (let ((v1-17 (-> this object-type-info-array 23))) + (set! (-> v1-17 target-count) 0) + (logclear! (-> v1-17 flags) (traffic-type-flag ttf1 ttf2)) + ) + (let ((v1-18 (-> this object-type-info-array 28))) + (set! (-> v1-18 target-count) 0) + (logclear! (-> v1-18 flags) (traffic-type-flag ttf2)) + (logior! (-> v1-18 flags) (traffic-type-flag ttf3)) + ) + (dotimes (s5-0 4) + (let ((a0-25 (-> this squad-control-array s5-0))) + (if a0-25 + (init-alert a0-25) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 24 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod deactivate-all ((this traffic-engine)) + (deactivate-all (-> this tracker0) #t) + (deactivate-all (-> this tracker1) #t) + 0 + (none) + ) + +;; definition for method 25 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod deactivate-by-type ((this traffic-engine) (arg0 traffic-type)) + (let ((a2-0 (-> this object-type-info-array arg0))) + (deactivate-all-of-type (-> this tracker-array (-> a2-0 tracker-index)) arg0 #t) + ) + 0 + (none) + ) + +;; definition for method 19 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod deactivate-all-from-level ((this traffic-engine) (arg0 symbol)) + (local-vars (v1-6 nav-branch)) + (countdown (s4-0 (-> this tracker0 active-object-count)) + (let ((v1-3 (handle->process (-> this tracker0 active-object-list s4-0)))) + (when v1-3 + (cond + ((focus-test? (the-as process-focusable v1-3) inactive) + (deactivate-object (-> this tracker0) (the-as int s4-0) #f) + ) + ((begin (set! v1-6 (-> (the-as hvehicle v1-3) controller branch)) (and v1-6 (nonzero? v1-6))) + (let ((v1-7 (-> v1-6 dest-node))) + (cond + (v1-7 + (if (= arg0 (-> v1-7 level)) + (deactivate-object (-> this tracker0) (the-as int s4-0) #t) + ) + ) + (else + 0 + ) + ) + ) + ) + (else + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 41 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod set-object-auto-activate ((this traffic-engine) (arg0 int) (arg1 symbol)) + (let ((v1-2 (-> this object-type-info-array arg0))) + (if arg1 + (logior! (-> v1-2 flags) (traffic-type-flag ttf2)) + (logclear! (-> v1-2 flags) (traffic-type-flag ttf2)) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod set-object-target-level ((this traffic-engine) (arg0 int) (arg1 float)) + (let ((v1-2 (-> this object-type-info-array arg0))) + (set! (-> v1-2 target-count) (the int (* arg1 (the float (max 0 (+ (-> v1-2 want-count) -1)))))) + ) + 0 + (none) + ) + +;; definition for method 28 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod set-object-target-count ((this traffic-engine) (arg0 int) (arg1 int)) + (set! (-> this object-type-info-array arg0 target-count) arg1) + 0 + (none) + ) + +;; definition for method 29 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod set-object-reserve-count ((this traffic-engine) (arg0 int) (arg1 uint)) + (set! (-> this object-type-info-array arg0 reserve-count) arg1) + 0 + (none) + ) + +;; definition for method 30 of type traffic-engine +(defmethod get-object-reserve-count ((this traffic-engine) (arg0 int)) + (-> this object-type-info-array arg0 reserve-count) + ) + +;; definition for method 31 of type traffic-engine +(defmethod get-object-remaining-count ((this traffic-engine) (arg0 int)) + (let ((a0-1 (-> this object-type-info-array arg0))) + (+ (-> a0-1 active-count) (-> a0-1 reserve-count)) + ) + ) + +;; definition for method 34 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod set-parking-spot-prob ((this traffic-engine) (arg0 int) (arg1 float)) + (let ((v1-2 (-> this object-type-info-array arg0))) + (set! (-> v1-2 parking-spot-prob) (the-as uint (min 255 (the int (* 256.0 arg1))))) + ) + 0 + (none) + ) + +;; definition for method 35 of type traffic-engine +;; WARN: Return type mismatch int vs traffic-type. +(defmethod get-random-parking-spot-type ((this traffic-engine)) + (let ((s4-0 0) + (s5-0 0) + ) + (let ((s3-0 17) + (s2-0 28) + ) + (while (>= (the-as uint s2-0) (the-as uint s3-0)) + (let ((s1-0 (-> this object-type-info-array s3-0))) + (if (and (logtest? (-> s1-0 flags) (traffic-type-flag ttf3)) + (= (status-of-level-and-borrows *level* (-> s1-0 level) 'ignore-borrow) 'active) + ) + (+! s4-0 (-> s1-0 parking-spot-prob)) + ) + ) + (+! s3-0 1) + ) + ) + (let ((s4-1 (mod (the-as int (rand-uint31-gen *random-generator*)) (+ s4-0 1))) + (s3-1 17) + (s2-1 28) + ) + (while (>= (the-as uint s2-1) (the-as uint s3-1)) + (let ((s1-1 (-> this object-type-info-array s3-1))) + (when (and (logtest? (-> s1-1 flags) (traffic-type-flag ttf3)) + (= (status-of-level-and-borrows *level* (-> s1-1 level) #f) 'active) + ) + (+! s5-0 (-> s1-1 parking-spot-prob)) + (if (< s4-1 s5-0) + (return (the-as traffic-type s3-1)) + ) + ) + ) + (+! s3-1 1) + ) + ) + ) + (the-as traffic-type 29) + ) + +;; definition for method 32 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod activate-object ((this traffic-engine) (arg0 traffic-object-spawn-params)) + (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) + (activate-from-params (-> this tracker-array (-> a2-0 tracker-index)) arg0) + ) + 0 + (none) + ) + +;; definition for method 33 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod activate-by-handle ((this traffic-engine) (arg0 traffic-object-spawn-params)) + (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) + (activate-by-handle (-> this tracker-array (-> a2-0 tracker-index)) arg0) + ) + 0 + (none) + ) + +;; definition for method 36 of type traffic-engine +(defmethod new-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) + (add-new-supression-box (-> this suppressor) arg0) + (none) + ) + +;; definition for method 37 of type traffic-engine +(defmethod remove-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) + (remove-box-by-id (-> this suppressor) (the-as int arg0)) + (none) + ) + +;; definition for method 38 of type traffic-engine +(defmethod update-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) + (update-box-from-params (-> this suppressor) arg0) + (none) + ) + +;; definition for method 56 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod update-suppressor ((this traffic-engine)) + (let ((v1-3 (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)))) + (dotimes (a1-3 16) + (let ((a2-2 (-> this suppressor array a1-3))) + (when (logtest? (-> a2-2 flags) (traffic-suppression-box-flag in-use)) + (let ((a3-3 (-> a2-2 duration))) + (cond + ((< a3-3 (the-as uint v1-3)) + (logclear! (-> a2-2 flags) (traffic-suppression-box-flag in-use)) + (logior! (-> this suppressor flags) (traffic-suppressor-flag needs-update)) + ) + (else + (set! (-> a2-2 duration) (- a3-3 (the-as uint v1-3))) + ) + ) + ) + ) + ) + ) + ) + (when (logtest? (-> this suppressor flags) (traffic-suppressor-flag needs-update)) + (logclear! (-> this suppressor flags) (traffic-suppressor-flag needs-update)) + (recompute-suppressions this) + ) + 0 + (none) + ) + +;; definition for method 57 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod recompute-suppressions ((this traffic-engine)) + (dotimes (s5-0 2) + (let ((v1-3 (-> this level-data-array s5-0))) + (if (nonzero? (-> v1-3 city-info)) + (update-suppressions-from-traffic-engine (-> v1-3 city-info) this) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 46 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod add-squad-ctrl ((this traffic-engine) (arg0 squad-control)) + (let ((v1-0 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (b! (-> this squad-control-array v1-0) cfg-3 :delay (empty-form)) + (set! (-> this squad-control-array v1-0) arg0) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + (+! v1-0 1) + (label cfg-4) + (b! (< v1-0 4) cfg-1) + ) + (label cfg-6) + 0 + (none) + ) + +;; definition for method 42 of type traffic-engine +;; WARN: Return type mismatch int vs none. +(defmethod check-proc-in-tracker ((this traffic-engine) (arg0 process) (arg1 int)) + (let ((v1-3 (-> this tracker-array arg1)) + (a0-3 (process->handle arg0)) + ) + (dotimes (a3-4 (the-as int (-> v1-3 active-object-count))) + (b! (= (-> v1-3 active-object-list a3-4) a0-3) cfg-10 :delay (nop!)) + ) + ) + (format *stdebug* "proc pid ~d (~a) not found in tracker ~d~%" (-> arg0 pid) arg0 arg1) + (label cfg-10) + 0 + 0 + (none) + ) + +;; definition for method 0 of type traffic-engine +(defmethod new traffic-engine ((allocation symbol) (type-to-make type)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 object-hash) ((method-of-type spatial-hash new) allocation spatial-hash #xc1c0 253)) + s5-0 + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/traffic-manager_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/traffic-manager_REF.gc new file mode 100644 index 0000000000..8036575c58 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/traffic-manager_REF.gc @@ -0,0 +1,1327 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *traffic-engine*, type traffic-engine +(define *traffic-engine* (the-as traffic-engine #f)) + +;; definition for symbol *traffic-fast-spawn*, type symbol +(define *traffic-fast-spawn* #f) + +;; definition of type traffic-manager +(deftype traffic-manager (process) + ((traffic-engine traffic-engine) + (fast-spawn symbol) + (dark-guard-ratio int32) + (spawn-params traffic-object-spawn-params :inline) + ) + (:state-methods + idle + active + ) + (:methods + (traffic-manager-method-16 (_type_) none) + (spawn-all (_type_) none) + (traffic-manager-method-18 (_type_) none) + (kill-all (_type_) none) + (traffic-manager-method-20 (_type_) none) + (traffic-manager-method-21 (_type_) none) + (traffic-manager-method-22 (_type_) none) + ) + ) + +;; definition for method 3 of type traffic-manager +(defmethod inspect ((this traffic-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Ttraffic-engine: ~A~%" (-> this traffic-engine)) + (format #t "~2Tfast-spawn: ~A~%" (-> this fast-spawn)) + (format #t "~2Tdark-guard-ratio: ~D~%" (-> this dark-guard-ratio)) + (format #t "~2Tspawn-params: #~%" (-> this spawn-params)) + (label cfg-4) + this + ) + +;; definition for function draw-city-info +;; WARN: Return type mismatch int vs none. +(defun draw-city-info ((arg0 city-level-info) (arg1 vis-grid-pos)) + (let ((v1-0 (-> arg0 grid-info box))) + (add-debug-box #t (bucket-id debug) (-> v1-0 min) (-> v1-0 max) *color-yellow*) + ) + (debug-draw-grid (-> arg0 grid-info) *color-gray*) + (debug-draw-cell (-> arg0 grid-info) arg1 *color-red*) + (let* ((v1-8 (+ (-> arg1 x) + (* (-> arg1 z) (-> arg0 grid-info dimension-array 0)) + (* (* (-> arg1 y) (-> arg0 grid-info dimension-array 0)) (-> arg0 grid-info dimension-array 2)) + ) + ) + (v1-10 (-> arg0 cell-array v1-8)) + ) + (add-debug-sphere #t (bucket-id debug) (-> v1-10 sphere) (-> v1-10 sphere r) *color-green*) + ) + 0 + (none) + ) + +;; definition for method 16 of type traffic-manager +;; WARN: Return type mismatch int vs none. +(defmethod traffic-manager-method-16 ((this traffic-manager)) + (traffic-manager-method-22 this) + (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (set-setting! 'gem-pool-index #f 0.0 1) + ) + (update-traffic (-> this traffic-engine)) + (cond + ((-> *setting-control* user-current traffic-spawn) + (traffic-manager-method-18 this) + (spawn-all this) + ) + (else + (kill-all this) + ) + ) + (if *debug-segment* + (stub (-> this traffic-engine)) + ) + (if *display-traffic-height-map* + (debug-draw *traffic-height-map* (target-pos 0)) + ) + 0 + (none) + ) + +;; definition for method 18 of type traffic-manager +;; WARN: Return type mismatch int vs none. +(defmethod traffic-manager-method-18 ((this traffic-manager)) + (let ((s5-0 0)) + (while (< (the-as uint s5-0) (the-as uint 29)) + (let ((v1-2 (-> this traffic-engine object-type-info-array s5-0))) + (when (logtest? (-> v1-2 flags) (traffic-type-flag ttf1)) + (let ((a0-5 (+ (-> v1-2 active-count) (-> v1-2 inactive-count)))) + (when (< (-> v1-2 want-count) a0-5) + (let ((a0-10 (handle->process (get-from-inactive-by-type + (-> this traffic-engine tracker-array (-> v1-2 tracker-index)) + (the-as traffic-type s5-0) + ) + ) + ) + ) + (if a0-10 + (deactivate a0-10) + ) + ) + ) + ) + ) + ) + (+! s5-0 1) + ) + ) + 0 + (none) + ) + +;; definition for method 19 of type traffic-manager +;; WARN: Return type mismatch int vs none. +(defmethod kill-all ((this traffic-manager)) + (deactivate-all (-> this traffic-engine)) + (let ((s5-0 0)) + (while (< (the-as uint s5-0) (the-as uint 29)) + (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) + (countdown (s3-0 (-> s4-0 inactive-count)) + (let ((a0-7 (handle->process (get-from-inactive-by-type + (-> this traffic-engine tracker-array (-> s4-0 tracker-index)) + (the-as traffic-type s5-0) + ) + ) + ) + ) + (if a0-7 + (deactivate a0-7) + ) + ) + ) + ) + (+! s5-0 1) + ) + ) + 0 + (none) + ) + +;; definition for method 17 of type traffic-manager +;; WARN: Return type mismatch int vs none. +(defmethod spawn-all ((this traffic-manager)) + (dotimes (s5-0 29) + (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) + (logclear! (-> s4-0 flags) (traffic-type-flag ttf3)) + (if (= (status-of-level-and-borrows *level* (-> s4-0 level) #f) 'active) + (logior! (-> s4-0 flags) (traffic-type-flag ttf3)) + ) + ) + ) + (let ((s5-1 1) + (s4-1 0) + (s3-1 #x1fffffff) + ) + (if (-> this fast-spawn) + (set! s5-1 120) + ) + (b! #t cfg-38 :delay (nop!)) + (label cfg-8) + (let* ((s2-0 (-> this spawn-params)) + (s1-0 (the-as int (-> s2-0 object-type))) + ) + (when (logtest? s3-1 (ash 1 s1-0)) + (let ((s0-0 (-> this traffic-engine object-type-info-array (the-as traffic-type s1-0)))) + (let ((v1-21 (+ (-> s0-0 active-count) (-> s0-0 inactive-count)))) + (b! + (not (and (logtest? (-> s0-0 flags) (traffic-type-flag ttf1)) + (logtest? (-> s0-0 flags) (traffic-type-flag ttf3)) + (not (logtest? (-> s0-0 flags) (traffic-type-flag ttf4))) + (< v1-21 (-> s0-0 want-count)) + ) + ) + cfg-31 + :delay (nop!) + ) + (logclear! (-> s2-0 flags) (traffic-spawn-flags tsf3)) + (if (and (= (-> s2-0 object-type) (traffic-type guard-a)) + (> (-> this dark-guard-ratio) 0) + (zero? (mod v1-21 (-> this dark-guard-ratio))) + ) + (logior! (-> s2-0 flags) (traffic-spawn-flags tsf3)) + ) + ) + (let ((a2-1 (traffic-object-spawn this s2-0))) + (b! (not a2-1) cfg-29 :delay (nop!)) + (add-object (-> this traffic-engine) (the-as traffic-type s1-0) a2-1) + ) + (+! (-> s0-0 reserve-count) -1) + ) + (+! (-> s2-0 id) 1) + (+! s4-1 1) + (b! #t cfg-30 :delay (nop!)) + (label cfg-29) + (format #t "traffic-manager: unable to spawn~%") + (b! #t cfg-43 :delay (nop!)) + (label cfg-30) + (b! #t cfg-35 :delay (nop!)) + (label cfg-31) + (set! s3-1 (logclear s3-1 (ash 1 s1-0))) + ) + (label cfg-35) + (let ((v1-37 (+ s1-0 1))) + (if (>= (the-as uint v1-37) (the-as uint 29)) + (set! v1-37 0) + ) + (set! (-> s2-0 object-type) (the-as traffic-type v1-37)) + ) + ) + (label cfg-38) + (b! (and (< s4-1 s5-1) (nonzero? s3-1)) cfg-8 :delay (nop!)) + ) + (label cfg-43) + (set! (-> this fast-spawn) #f) + 0 + 0 + (none) + ) + +;; definition for function formation-spawn +;; WARN: Return type mismatch process vs formation-object. +(defun formation-spawn ((arg0 process) (arg1 type) (arg2 formation-info)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* arg1 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg0 "formation" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 formation-init-by-other arg2) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as formation-object gp-0) + ) + ) + +;; definition for function type-from-traffic-object-type +(defun type-from-traffic-object-type ((arg0 traffic-type)) + (case arg0 + (((traffic-type civilian-male)) + citizen-norm + ) + (((traffic-type civilian-female)) + citizen-chick + ) + (((traffic-type civilian-fat)) + citizen-fat + ) + (((traffic-type civilian-pilot)) + citizen-norm + ) + (((traffic-type metalhead-predator)) + metalhead-predator + ) + (((traffic-type metalhead-grunt)) + metalhead-grunt + ) + (((traffic-type metalhead-flitter)) + metalhead-flitter + ) + (((traffic-type wlander-male)) + wlander-male + ) + (((traffic-type wlander-female)) + wlander-female + ) + (((traffic-type guard-a)) + crimson-guard + ) + (((traffic-type guard-pilot)) + crimson-guard + ) + (((traffic-type roboguard)) + roboguard-city + ) + (((traffic-type spydroid)) + spydroid + ) + (((traffic-type flying-turret)) + flying-turret + ) + (else + (the-as type #f) + ) + ) + ) + +;; definition for function citizen-spawn +;; WARN: Return type mismatch process vs process-drawable. +(defun citizen-spawn ((arg0 process) (arg1 traffic-type) (arg2 traffic-object-spawn-params)) + (let ((gp-0 (the-as process #f))) + (let* ((a1-1 (type-from-traffic-object-type arg1)) + (s3-0 (get-process *default-dead-pool* a1-1 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-2 (method-of-type process activate))) + (t9-2 s3-0 arg0 "citizen" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 citizen-init-by-other arg2) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as process-drawable gp-0) + ) + ) + +;; definition for function traffic-object-spawn +(defun traffic-object-spawn ((arg0 process) (arg1 traffic-object-spawn-params)) + (let ((v0-0 (the-as process-drawable #f))) + (case (-> arg1 object-type) + (((traffic-type civilian-bike-a)) + (set! v0-0 (vehicle-spawn (vehicle-type h-bike-a) arg1)) + ) + (((traffic-type civilian-bike-b)) + (set! v0-0 (vehicle-spawn (vehicle-type h-bike-b) arg1)) + ) + (((traffic-type civilian-bike-c)) + (set! v0-0 (vehicle-spawn (vehicle-type h-bike-c) arg1)) + ) + (((traffic-type bike-d)) + (set! v0-0 (vehicle-spawn (vehicle-type h-bike-d) arg1)) + ) + (((traffic-type civilian-car-a)) + (set! v0-0 (vehicle-spawn (vehicle-type h-car-a) arg1)) + ) + (((traffic-type civilian-car-b)) + (set! v0-0 (vehicle-spawn (vehicle-type h-car-b) arg1)) + ) + (((traffic-type civilian-car-c)) + (set! v0-0 (vehicle-spawn (vehicle-type h-car-c) arg1)) + ) + (((traffic-type civilian-male) + (traffic-type civilian-female) + (traffic-type civilian-fat) + (traffic-type civilian-pilot) + (traffic-type metalhead-predator) + (traffic-type metalhead-grunt) + (traffic-type metalhead-flitter) + (traffic-type wlander-male) + (traffic-type wlander-female) + (traffic-type guard-a) + (traffic-type guard-pilot) + (traffic-type roboguard) + (traffic-type spydroid) + (traffic-type flying-turret) + ) + (set! v0-0 (citizen-spawn arg0 (-> arg1 object-type) arg1)) + ) + (((traffic-type formation)) + (set! v0-0 (formation-spawn arg0 formation-object (the-as formation-info arg1))) + ) + ) + v0-0 + ) + ) + +;; definition for method 20 of type traffic-manager +;; WARN: Return type mismatch int vs none. +(defmethod traffic-manager-method-20 ((this traffic-manager)) + (set! (-> this traffic-engine) *traffic-engine*) + (reset-and-init-from-manager (-> this traffic-engine) this) + (let ((t9-1 (-> *traffic-info* restore-speech-callback))) + (if t9-1 + (t9-1) + ) + ) + 0 + (none) + ) + +;; definition for method 7 of type traffic-manager +;; WARN: Return type mismatch process vs traffic-manager. +(defmethod relocate ((this traffic-manager) (offset int)) + (set! *traffic-manager* this) + (if *traffic-manager* + (set! *traffic-manager* (&+ *traffic-manager* offset)) + ) + (the-as traffic-manager ((method-of-type process relocate) this offset)) + ) + +;; definition for method 10 of type traffic-manager +(defmethod deactivate ((this traffic-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (and *vehicle-manager* (!= (-> this level) (-> *vehicle-manager* level))) + (change-parent *vehicle-manager* *entity-pool*) + ) + (squad-stop-alarm-sound (-> this traffic-engine)) + (set! *traffic-manager* #f) + (remove-setting *setting-control* this 'task-mask) + (apply-settings *setting-control*) + (speech-table-reset! *speech-control*) + ((method-of-type process deactivate) this) + (none) + ) + +;; definition for method 21 of type traffic-manager +;; WARN: Return type mismatch int vs none. +(defmethod traffic-manager-method-21 ((this traffic-manager)) + (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (set-setting! 'gem-pool-index #f 0.0 1) + ) + (let ((s5-1 (new 'stack-no-clear 'array 'int8 29))) + (set! (-> s5-1 17) 2) + (set! (-> s5-1 18) 2) + (set! (-> s5-1 19) 2) + (set! (-> s5-1 20) 2) + (set! (-> s5-1 21) 2) + (set! (-> s5-1 22) 2) + (set! (-> s5-1 24) 0) + (set! (-> s5-1 25) 0) + (set! (-> s5-1 26) 0) + (set! (-> s5-1 0) 20) + (set! (-> s5-1 1) 20) + (set! (-> s5-1 2) 1) + (set! (-> s5-1 3) 1) + (set! (-> s5-1 4) 1) + (set! (-> s5-1 6) 14) + (set! (-> s5-1 7) 0) + (set! (-> s5-1 8) 5) + (set! (-> s5-1 9) 9) + (set! (-> s5-1 10) 3) + (set! (-> s5-1 11) 14) + (set! (-> s5-1 12) 14) + (set! (-> s5-1 13) 3) + (set! (-> s5-1 14) 10) + (set! (-> s5-1 15) 15) + (set! (-> s5-1 16) 10) + (set! (-> s5-1 27) 0) + (set! (-> s5-1 28) 0) + (set! (-> this fast-spawn) *traffic-fast-spawn*) + (traffic-manager-method-20 this) + (let ((v1-29 (-> this traffic-engine))) + (dotimes (a0-4 29) + (set! (-> v1-29 object-type-info-array a0-4 want-count) (-> s5-1 a0-4)) + ) + ) + ) + (let ((s5-2 (-> this spawn-params))) + (set! (-> s5-2 object-type) (traffic-type guard-a)) + (set! (-> s5-2 behavior) (the-as uint 1)) + (set! (-> s5-2 id) (the-as uint 0)) + (set! (-> s5-2 nav-mesh) #f) + (set! (-> s5-2 nav-branch) #f) + (set! (-> s5-2 proc) #f) + (set! (-> s5-2 handle) (the-as handle #f)) + (set! (-> s5-2 user-data) (the-as uint 0)) + (set! (-> s5-2 flags) (traffic-spawn-flags tsf1)) + (set! (-> s5-2 guard-type) (the-as uint 11)) + (set! (-> s5-2 entity) #f) + (vector-reset! (-> s5-2 velocity)) + (vector-reset! (-> s5-2 position)) + (forward-up-nopitch->quaternion + (-> s5-2 rotation) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (set! (-> s5-2 id) (the-as uint 1)) + ) + (set! (-> this dark-guard-ratio) 0) + (restore-default-settings (-> this traffic-engine)) + (set! *traffic-manager* this) + 0 + (none) + ) + +;; definition for symbol *traffic-vehicle-level-borrow-list*, type object +(define *traffic-vehicle-level-borrow-list* (the-as object '(#f))) + +;; definition for symbol *traffic-vehicle-level-sound-list*, type object +(define *traffic-vehicle-level-sound-list* (the-as object '(#f))) + +;; definition for function traffic-manager-event-handler +(defbehavior traffic-manager-event-handler traffic-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((gp-0 (the-as object #t))) + (case arg2 + (('child-killed) + (child-killed (-> self traffic-engine) arg0) + ) + (('increase-alert-level) + (break!) + 0 + ) + (('decrease-alert-level) + (break!) + 0 + ) + (('set-alert-level) + (break!) + 0 + ) + (('set-max-alert-level) + (break!) + 0 + ) + (('get-alert-level) + (break!) + 0 + ) + (('set-alert-duration) + (break!) + 0 + ) + (('disable-spawning) + (set! (-> self traffic-engine allow-spawning?) #f) + (format 0 "Disable spawn ~%") + ) + (('enable-spawning) + (set! (-> self traffic-engine allow-spawning?) #t) + (format 0 "Enable spawn ~%") + ) + (('deactivate-all) + (deactivate-all (-> self traffic-engine)) + ) + (('set-target-level) + (let ((f0-0 (the-as float (-> arg3 param 0)))) + (target-count (-> self traffic-engine) f0-0) + ) + ) + (('set-guard-target-level) + (break!) + 0 + ) + (('restore-default-settings) + (restore-default-settings (-> self traffic-engine)) + ) + (('add-danger-sphere) + (let ((a1-7 (-> arg3 param 0))) + (add-danger (-> self traffic-engine) (the-as traffic-danger-info a1-7)) + ) + ) + (('spawn-object) + (let ((s5-0 (the-as object (-> arg3 param 0)))) + (set! (-> (the-as traffic-object-spawn-params s5-0) proc) + (traffic-object-spawn self (the-as traffic-object-spawn-params s5-0)) + ) + ) + ) + (('activate-object) + (let ((a1-9 (-> arg3 param 0))) + (activate-object (-> self traffic-engine) (the-as traffic-object-spawn-params a1-9)) + ) + ) + (('activate-specific-object) + (let ((a1-10 (-> arg3 param 0))) + (activate-by-handle (-> self traffic-engine) (the-as traffic-object-spawn-params a1-10)) + ) + ) + (('get-object-remaining-count) + (let ((a1-11 (-> arg3 param 0))) + (set! gp-0 (get-object-remaining-count (-> self traffic-engine) (the-as int a1-11))) + ) + ) + (('set-object-reserve-count) + (let ((a1-12 (-> arg3 param 0)) + (a2-1 (-> arg3 param 1)) + ) + (set-object-reserve-count (-> self traffic-engine) (the-as int a1-12) a2-1) + ) + ) + (('get-object-reserve-count) + (let ((a1-13 (-> arg3 param 0))) + (set! gp-0 (get-object-reserve-count (-> self traffic-engine) (the-as int a1-13))) + ) + ) + (('set-object-target-level) + (let ((a1-14 (-> arg3 param 0)) + (f0-1 (the-as float (-> arg3 param 1))) + ) + (set-object-target-level (-> self traffic-engine) (the-as int a1-14) f0-1) + ) + ) + (('set-object-target-count) + (let ((a1-15 (-> arg3 param 0)) + (a2-3 (-> arg3 param 1)) + ) + (set-object-target-count (-> self traffic-engine) (the-as int a1-15) (the-as int a2-3)) + ) + ) + (('set-guard-target-count-range) + (break!) + 0 + ) + (('deactivate-by-type) + (let ((a1-16 (-> arg3 param 0))) + (deactivate-by-type (-> self traffic-engine) (the-as traffic-type a1-16)) + ) + ) + (('new-suppression-box) + (let ((a1-17 (-> arg3 param 0))) + (new-suppression-box (-> self traffic-engine) (the-as traffic-suppression-params a1-17)) + ) + ) + (('update-suppression-box) + (let ((a1-18 (-> arg3 param 0))) + (update-suppression-box (-> self traffic-engine) (the-as traffic-suppression-params a1-18)) + ) + ) + (('kill-traffic-sphere) + (let ((a1-19 (-> arg3 param 0))) + (kill-traffic-sphere (-> self traffic-engine) (the-as vector a1-19)) + ) + ) + (('set-guard-multi-focus) + (break!) + 0 + ) + (('player-enter-vehicle) + (let ((s5-1 (-> arg3 param 0))) + (when *city-borrow-manager* + (set! (car (ref& *traffic-vehicle-level-borrow-list* 0)) + (-> self traffic-engine object-type-info-array s5-1 level) + ) + (set! (car (ref& *traffic-vehicle-level-sound-list* 0)) + (level->sound-bank-name (-> self traffic-engine object-type-info-array s5-1 level)) + ) + (remove-setting! 'borrow-hold) + (set-setting! 'borrow-hold-perm *traffic-vehicle-level-borrow-list* 0.0 0) + (set-setting! 'city-sound *traffic-vehicle-level-sound-list* 0.0 1) + ) + ) + ) + (('player-exit-vehicle) + (let ((v1-31 (-> arg3 param 0))) + (when *city-borrow-manager* + (set! (car (ref& *traffic-vehicle-level-borrow-list* 0)) + (-> self traffic-engine object-type-info-array v1-31 level) + ) + (remove-setting! 'borrow-hold-perm) + (set-setting! 'borrow-hold *traffic-vehicle-level-borrow-list* 0.0 0) + (remove-setting! 'city-sound) + ) + ) + ) + (('set-disable-pursuit-control) + (break!) + 0 + ) + (('set-object-auto-activate) + (let ((a1-29 (-> arg3 param 0)) + (a2-10 (-> arg3 param 1)) + ) + (set-object-auto-activate (-> self traffic-engine) (the-as int a1-29) (the-as symbol a2-10)) + ) + ) + (('set-guard-force-visible) + (break!) + 0 + ) + (('end-pursuit-by-type) + (break!) + 0 + ) + (('level-loaded) + (let ((a1-30 (-> arg3 param 0))) + (level-link (-> self traffic-engine) (the-as level a1-30)) + ) + ) + (('level-killed) + (let ((s5-4 (the-as object (-> arg3 param 0)))) + (level-unlink (-> self traffic-engine) (the-as level s5-4)) + (format #t "traffic-manager : level killed ~S~%" (-> (the-as level s5-4) nickname)) + ) + ) + (('add-object) + (let ((a1-33 (-> arg3 param 0)) + (a2-12 (-> arg3 param 1)) + ) + (add-object (-> self traffic-engine) (the-as traffic-type a1-33) (the-as process a2-12)) + ) + ) + (('get-num-normal-available) + (let* ((v1-44 (the-as msg-get-num-inactive (-> arg3 param 0))) + (a1-35 (-> self traffic-engine object-type-info-array (-> v1-44 obj-type))) + ) + (set! (-> v1-44 num-inactive-out) (- (-> a1-35 target-count) (-> a1-35 active-count))) + ) + ) + (('get-num-inactive) + (let* ((v1-45 (the-as msg-get-num-inactive (-> arg3 param 0))) + (a1-37 (-> v1-45 obj-type)) + ) + (set! (-> v1-45 num-inactive-out) (-> self traffic-engine object-type-info-array a1-37 inactive-count)) + ) + ) + (('get-inactive-object-list) + (let ((v1-46 (the-as msg-get-inactive-objects (-> arg3 param 0)))) + (set! (-> v1-46 object-type-info-array) (-> self traffic-engine object-type-info-array)) + ) + ) + (('borrow-query-remaining) + (let ((a0-129 (-> arg3 param 0)) + (v1-47 0) + ) + (dotimes (a1-39 29) + (let ((a2-15 (-> self traffic-engine object-type-info-array a1-39))) + (if (= (-> a2-15 level) a0-129) + (+! v1-47 (-> a2-15 active-count)) + ) + ) + ) + (set! gp-0 v1-47) + ) + (goto cfg-131) + ) + (('borrow-notify-shutdown-end) + (let ((v1-49 (-> arg3 param 0))) + (dotimes (a0-133 29) + (let ((a1-42 (-> self traffic-engine object-type-info-array a0-133))) + (if (= (-> a1-42 level) v1-49) + (logclear! (-> a1-42 flags) (traffic-type-flag ttf4)) + ) + ) + ) + ) + ) + (('borrow-notify-shutdown-begin) + (let ((v1-51 (-> arg3 param 0))) + (dotimes (a0-136 29) + (let ((a1-45 (-> self traffic-engine object-type-info-array a0-136))) + (if (= (-> a1-45 level) v1-51) + (logior! (-> a1-45 flags) (traffic-type-flag ttf4)) + ) + ) + ) + ) + ) + (('kill-all) + (format #t "traffic-manager::kill-all~%") + (deactivate-all (-> self traffic-engine)) + (kill-all self) + ) + (('spawn-all) + (format #t "traffic-manager::spawn-all~%") + (set! (-> self fast-spawn) #t) + (spawn-all self) + ) + (('set-density-factor) + (let ((f0-2 (the-as float (-> arg3 param 0)))) + (set! (-> self traffic-engine inv-density-factor) (/ 5.0 f0-2)) + ) + ) + (('rider-off) + (let ((s5-5 (-> self child))) + (while s5-5 + (send-event (ppointer->process s5-5) 'rider-off) + (set! s5-5 (-> s5-5 0 brother)) + ) + ) + ) + (('rider-on) + (let ((s5-6 (-> self child))) + (while s5-6 + (send-event (ppointer->process s5-6) 'rider-on) + (set! s5-6 (-> s5-6 0 brother)) + ) + ) + ) + (else + (set! gp-0 #f) + ) + ) + (label cfg-131) + gp-0 + ) + ) + +;; definition for function traffic-manager-init-by-other +(defbehavior traffic-manager-init-by-other traffic-manager () + (stack-size-set! (-> self main-thread) 128) + (ctywide-entity-hack) + (traffic-manager-method-21 self) + (add-setting! 'task-mask 'clear 0.0 (task-mask ctywide)) + (set! (-> self event-hook) traffic-manager-event-handler) + (vehicle-manager-start self) + (go-virtual idle) + ) + +;; definition for function traffic-start +;; WARN: Return type mismatch int vs none. +(defun traffic-start () + (kill-by-type traffic-manager *active-pool*) + (process-spawn traffic-manager :name "traffic-manager" :to *entity-pool*) + 0 + (none) + ) + +;; definition for function traffic-kill +;; WARN: Return type mismatch symbol vs none. +(defun traffic-kill () + (kill-by-type traffic-manager *active-pool*) + (none) + ) + +;; definition for function ctywide-entity-hack +;; WARN: Return type mismatch int vs none. +(defun ctywide-entity-hack () + (with-pp + (set! (-> pp level) (-> *traffic-info* ctywide-level)) + 0 + (none) + ) + ) + +;; definition for function traffic-entity-hack +;; WARN: Return type mismatch int vs none. +(defun traffic-entity-hack ((arg0 traffic-type)) + (with-pp + (set! (-> pp level) (level-get *level* (-> *traffic-engine* object-type-info-array arg0 level))) + (if (not (-> pp level)) + (format 0 "traffic-entity-hack ~s~%" (cond + ((= arg0 (traffic-type guard-a)) + "guard-a" + ) + ((= arg0 (traffic-type civilian-fat)) + "civilian-fat" + ) + ((= arg0 (traffic-type civilian-car-a)) + "civilian-car-a" + ) + ((= arg0 (traffic-type bike-d)) + "bike-d" + ) + ((= arg0 (traffic-type civilian-bike-b)) + "civilian-bike-b" + ) + ((= arg0 (traffic-type metalhead-flitter)) + "metalhead-flitter" + ) + ((= arg0 (traffic-type vehicle-task)) + "vehicle-task" + ) + ((= arg0 (traffic-type metalhead-predator)) + "metalhead-predator" + ) + ((= arg0 (traffic-type guard-b)) + "guard-b" + ) + ((= arg0 (traffic-type wlander-female)) + "wlander-female" + ) + ((= arg0 (traffic-type civilian-bike-a)) + "civilian-bike-a" + ) + ((= arg0 (traffic-type wlander-male)) + "wlander-male" + ) + ((= arg0 (traffic-type guard-transport)) + "guard-transport" + ) + ((= arg0 (traffic-type guard-car)) + "guard-car" + ) + ((= arg0 (traffic-type roboguard)) + "roboguard" + ) + ((= arg0 (traffic-type metalhead-grunt)) + "metalhead-grunt" + ) + ((= arg0 (traffic-type guard-pilot)) + "guard-pilot" + ) + ((= arg0 (traffic-type civilian-pilot)) + "civilian-pilot" + ) + ((= arg0 (traffic-type spydroid)) + "spydroid" + ) + ((= arg0 (traffic-type kg-pickup)) + "kg-pickup" + ) + ((= arg0 (traffic-type flying-turret)) + "flying-turret" + ) + ((= arg0 (traffic-type civilian-female)) + "civilian-female" + ) + ((= arg0 (traffic-type civilian-car-c)) + "civilian-car-c" + ) + ((= arg0 (traffic-type citizen-task)) + "citizen-task" + ) + ((= arg0 (traffic-type guard-bike)) + "guard-bike" + ) + ((= arg0 (traffic-type civilian-car-b)) + "civilian-car-b" + ) + ((= arg0 (traffic-type civilian-bike-c)) + "civilian-bike-c" + ) + ((= arg0 (traffic-type formation)) + "formation" + ) + ((= arg0 (traffic-type civilian-male)) + "civilian-male" + ) + (else + "*unknown*" + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (traffic-manager) + :virtual #t + :event traffic-manager-event-handler + :enter (behavior () + (spawn-all self) + ) + :code (behavior () + (suspend) + (suspend) + (go-virtual active) + ) + ) + +;; failed to figure out what this is: +(defstate active (traffic-manager) + :virtual #t + :event traffic-manager-event-handler + :code sleep-code + :post (behavior () + (traffic-manager-method-16 self) + ) + ) + +;; definition for function riders-on +;; WARN: Return type mismatch object vs none. +(defun riders-on () + (send-event *traffic-manager* 'rider-on) + (none) + ) + +;; definition for function riders-off +;; WARN: Return type mismatch object vs none. +(defun riders-off () + (send-event *traffic-manager* 'rider-off) + (none) + ) + +;; definition of type want-count-binding +(deftype want-count-binding (structure) + ((obj-type traffic-type) + (count uint8) + ) + ) + +;; definition for method 3 of type want-count-binding +(defmethod inspect ((this want-count-binding)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'want-count-binding) + (format #t "~1Tobj-type: ~D~%" (-> this obj-type)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (label cfg-4) + this + ) + +;; definition of type want-count-group +(deftype want-count-group (structure) + ((bindings (array want-count-binding)) + ) + ) + +;; definition for method 3 of type want-count-group +(defmethod inspect ((this want-count-group)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'want-count-group) + (format #t "~1Tbindings: ~A~%" (-> this bindings)) + (label cfg-4) + this + ) + +;; definition of type want-count-level-group +(deftype want-count-level-group (structure) + ((want-groups (array want-count-group)) + (level uint8) + ) + ) + +;; definition for method 3 of type want-count-level-group +(defmethod inspect ((this want-count-level-group)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'want-count-level-group) + (format #t "~1Twant-groups: ~A~%" (-> this want-groups)) + (format #t "~1Tlevel: ~D~%" (-> this level)) + (label cfg-4) + this + ) + +;; definition for symbol *want-count-levels*, type (array want-count-level-group) +(define *want-count-levels* + (new 'static 'boxed-array :type want-count-level-group + (new 'static 'want-count-level-group + :want-groups (new 'static 'boxed-array :type want-count-group + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type roboguard)) + (new 'static 'want-count-binding :obj-type (traffic-type spydroid)) + (new 'static 'want-count-binding :obj-type (traffic-type flying-turret)) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-grunt)) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-flitter)) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-predator)) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type guard-a)) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-female)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-fat)) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-a)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-b)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-c)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-a)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-b)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-c)) + ) + ) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + ) + ) + (new 'static 'want-count-level-group + :want-groups (new 'static 'boxed-array :type want-count-group + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type roboguard)) + (new 'static 'want-count-binding :obj-type (traffic-type spydroid) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type flying-turret) :count #x1) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-grunt) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-flitter) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-predator)) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type guard-a) :count #x2) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-female) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-fat) :count #x1) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-a)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-b) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-c) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-a)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-b) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-c) :count #x1) + ) + ) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + ) + :level #x1 + ) + (new 'static 'want-count-level-group + :want-groups (new 'static 'boxed-array :type want-count-group + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type roboguard) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type spydroid) :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type flying-turret) :count #x1) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-grunt) :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-flitter) :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-predator)) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type guard-a) :count #x4) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-female) :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-fat) :count #x1) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-a) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-b) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-c) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-a) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-b) :count #x1) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-c) :count #x1) + ) + ) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + ) + :level #x2 + ) + (new 'static 'want-count-level-group + :want-groups (new 'static 'boxed-array :type want-count-group + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type roboguard) :count #x3) + (new 'static 'want-count-binding :obj-type (traffic-type spydroid) :count #x3) + (new 'static 'want-count-binding :obj-type (traffic-type flying-turret) :count #x3) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-grunt) :count #x3) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-flitter) :count #x3) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-predator) :count #x1) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type guard-a) :count #x7) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :count #xa) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-female) :count #xa) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-fat) :count #x3) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-a) :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-b) :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-c) :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-a) :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-b) :count #x2) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-c) :count #x2) + ) + ) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + ) + :level #x3 + ) + (new 'static 'want-count-level-group + :want-groups (new 'static 'boxed-array :type want-count-group + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type roboguard) :count #x5) + (new 'static 'want-count-binding :obj-type (traffic-type spydroid) :count #x4) + (new 'static 'want-count-binding :obj-type (traffic-type flying-turret) :count #x5) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-grunt) :count #x5) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-flitter) :count #x5) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-predator) :count #x2) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type guard-a) :count #xb) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-female)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-fat)) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-a)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-b)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-c)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-a)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-b)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-c)) + ) + ) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + ) + :level #x4 + ) + (new 'static 'want-count-level-group + :want-groups (new 'static 'boxed-array :type want-count-group + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type roboguard) :count #x6) + (new 'static 'want-count-binding :obj-type (traffic-type spydroid) :count #x9) + (new 'static 'want-count-binding :obj-type (traffic-type flying-turret) :count #x6) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-grunt) :count #x6) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-flitter) :count #x8) + (new 'static 'want-count-binding :obj-type (traffic-type metalhead-predator) :count #x3) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type guard-a) :count #xd) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-female)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-fat)) + ) + ) + (new 'static 'want-count-group + :bindings (new 'static 'boxed-array :type want-count-binding + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-a)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-b)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-bike-c)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-a)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-b)) + (new 'static 'want-count-binding :obj-type (traffic-type civilian-car-c)) + ) + ) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + (new 'static 'want-count-group :bindings (new 'static 'boxed-array :type want-count-binding)) + ) + :level #x7 + ) + ) + ) + +;; definition for method 22 of type traffic-manager +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 22 traffic-manager) has a return type of none, but the expression builder found a return statement. +(defmethod traffic-manager-method-22 ((this traffic-manager)) + (if (not *cty-faction-manager*) + (return 0) + ) + (dotimes (v1-3 7) + (let ((a1-1 (-> *cty-faction-manager* faction-spawn v1-3 current-level)) + (a0-3 -1) + ) + (dotimes (a2-0 (-> *want-count-levels* length)) + (when (= (-> *want-count-levels* a2-0 level) a1-1) + (set! a0-3 a2-0) + 0 + (goto cfg-11) + ) + ) + (label cfg-11) + (when (>= a0-3 0) + (let ((a0-9 (-> *want-count-levels* a0-3 want-groups v1-3))) + (dotimes (a1-7 (-> a0-9 bindings length)) + (set! (-> *traffic-engine* object-type-info-array (-> a0-9 bindings a1-7 obj-type) want-count) + (the-as int (-> a0-9 bindings a1-7 count)) + ) + ) + ) + ) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc new file mode 100644 index 0000000000..e632082125 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc @@ -0,0 +1,2009 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-h-bike-a bikea bikea-lod0-jg bikea-idle-ja + ((bikea-lod0-mg (meters 20)) (bikea-lod1-mg (meters 40)) (bikea-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.4) + :shadow bikea-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-h-bike-b bikeb bikeb-lod0-jg bikeb-idle-ja + ((bikeb-lod0-mg (meters 20)) (bikeb-lod1-mg (meters 40)) (bikeb-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.4) + :shadow bikeb-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-h-bike-c bikec bikec-lod0-jg bikec-idle-ja + ((bikec-lod0-mg (meters 20)) (bikec-lod1-mg (meters 40)) (bikec-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.8) + :shadow bikec-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-h-bike-d newbike newbike-lod0-jg newbike-idle-ja + ((newbike-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.4) + :shadow newbike-shadow-mg + :origin-joint-index 3 + ) + +;; definition for symbol *h-bike-explosion-info*, type vehicle-explosion-info +(define *h-bike-explosion-info* + (new 'static 'vehicle-explosion-info + :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) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level 'ctywide + :skel #f + :skel-name "skel-vehicle-explosion" + :anim 2 + ) + ) + +;; definition for symbol *h-bike-a-constants*, type rigid-body-vehicle-constants +(define *h-bike-a-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-bike-a-constants* + :flags #x70 + :object-type (traffic-type civilian-bike-a) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -819.2 :z 10240.0 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -10240.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x10 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x4 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 4096.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; definition for symbol *h-bike-b-constants*, type rigid-body-vehicle-constants +(define *h-bike-b-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-bike-b-constants* + :flags #x70 + :object-type (traffic-type civilian-bike-b) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :z 11059.2 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -8192.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 4096.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 757.76 :z 1175.552 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; definition for symbol *h-bike-c-constants*, type rigid-body-vehicle-constants +(define *h-bike-c-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-bike-c-constants* + :flags #x70 + :object-type (traffic-type civilian-bike-c) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 3640.889 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -614.4 :z 13721.6 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 614.4 :z -7168.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 8192.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 8192.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 802.816 :z 1318.912 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; definition for symbol *h-bike-d-constants*, type rigid-body-vehicle-constants +(define *h-bike-d-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-bike-d-constants* + :flags #x70 + :object-type (traffic-type bike-d) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :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 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 4) + :turning-accel (meters 25) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -819.2 :z 10240.0 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -10240.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x10 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x4 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 4096.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *h-bike-a-constants* explosion) *h-bike-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *h-bike-b-constants* explosion) *h-bike-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *h-bike-c-constants* explosion) *h-bike-explosion-info*) + +;; definition of type h-bike-base +(deftype h-bike-base (hvehicle) + () + ) + +;; definition for method 3 of type h-bike-base +(defmethod inspect ((this h-bike-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hvehicle inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 38 of type h-bike-base +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-38 ((this h-bike-base)) + (call-parent-method this) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (if (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf0)) + (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf0))) + (< 0.0 (-> this jump-time)) + ) + (sound-play "bike-hop") + ) + (if (zero? (-> this roll-sound-id)) + (set! (-> this roll-sound-id) (new-sound-id)) + ) + (let* ((f0-5 + (* 4.0 + (-> this force-scale) + (-> this sputter-sound-envelope) + (-> this info handling inv-max-engine-thrust) + (+ (-> this roll-thrust 0) (-> this roll-thrust 1)) + ) + ) + (f1-7 (* 0.32 f0-5)) + (f0-6 0.5) + ) + (sound-play-by-name + (static-sound-name "bike-thrust") + (-> this roll-sound-id) + (the int (* 1024.0 f1-7)) + (the int (* 1524.0 f0-6)) + 0 + (sound-group) + #t + ) + ) + ) + 0 + (none) + ) + +;; definition for method 78 of type h-bike-base +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-78 ((this h-bike-base)) + (call-parent-method this) + (when (and (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + ) + (let ((s5-0 (new 'stack-no-clear 'bike-stack-var0))) + (let* ((v1-6 (-> s5-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-7 (-> a3-0 rvec quad)) + (a1-1 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-6 rvec quad) a0-7) + (set! (-> v1-6 uvec quad) a1-1) + (set! (-> v1-6 fvec quad) a2-0) + (set! (-> v1-6 trans quad) a3-1) + ) + (set-vector! (-> s5-0 vec4) 0.0 -1.0 0.0 1.0) + (vector-rotate*! (-> s5-0 vec4) (-> s5-0 vec4) (-> s5-0 mat)) + (let ((s4-0 (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y -1228.8 :z 2457.6 :w 1.0) + (new 'static 'vector :x -2048.0 :y -1228.8 :z 2457.6 :w 1.0) + ) + ) + (s3-0 (new 'static 'inline-array vector 2 + (new 'static 'vector :x -0.707 :y 0.707 :w 1.0) + (new 'static 'vector :x 0.707 :y 0.707 :w 1.0) + ) + ) + ) + (dotimes (s2-0 2) + (when (< 0.0 (-> this roll-thrust s2-0)) + (vector-rotate*! (-> s5-0 vec4) (-> s3-0 s2-0) (-> s5-0 mat)) + (vector-matrix*! (-> s5-0 vec3) (-> s4-0 s2-0) (-> s5-0 mat)) + (set! (-> s5-0 vec5 quad) (-> this rbody matrix uvec quad)) + (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (set! (-> s5-0 vec2 y) 1638.4) + (set! (-> s5-0 vec2 z) 12288.0) + (let ((f0-9 (* (-> this roll-thrust s2-0) (-> this force-scale) (-> this info info inv-mass))) + (f1-3 (-> this info extra gravity)) + ) + (set! (-> s5-0 vec2 x) (* f0-9 (/ 1.0 f1-3))) + ) + (set! (-> s5-0 vec2 w) (-> this fog-fade)) + (forward-up->quaternion (the-as quaternion (-> s5-0 vec0)) (-> s5-0 vec4) (-> s5-0 vec5)) + (vehicle-draw-thruster (-> this info particle-common) (the-as vehicle-draw-thruster-params (-> s5-0 vec0))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type h-bike-a +(deftype h-bike-a (h-bike-base) + ((fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (rudder joint-mod-rotate-local :inline) + (brake-l joint-mod-rotate-local :inline) + (brake-r joint-mod-rotate-local :inline) + ) + ) + +;; definition for method 3 of type h-bike-a +(defmethod inspect ((this h-bike-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-bike-base inspect))) + (t9-0 this) + ) + (format #t "~2Tfin-fl: #~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: #~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: #~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: #~%" (-> this fin-rr)) + (format #t "~2Trudder: #~%" (-> this rudder)) + (format #t "~2Tbrake-l: #~%" (-> this brake-l)) + (format #t "~2Tbrake-r: #~%" (-> this brake-r)) + (label cfg-4) + this + ) + +;; definition for method 34 of type h-bike-a +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this h-bike-a)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 11264.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 -819.2 4505.6 3686.4) + (set! (-> v1-11 nav-radius) 6144.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-13 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 -3686.4 4096.0) + (set! (-> v1-13 nav-radius) 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 160)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 204.8 3276.8 1228.8 3276.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 -819.2 9011.2 1638.4) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 1228.8 -8601.6 2048.0) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 79 of type h-bike-a +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this h-bike-a)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f28-0 (* -5461.3335 (-> this controls lean-z))) + (f26-0 (* -13653.333 (-> this controls brake))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f28-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f28-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f28-0) f30-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f28-0) f30-0)) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f26-0) + ) + 0 + (none) + ) + +;; definition for method 35 of type h-bike-a +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-bike-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-bike-a-constants*) + (init (-> this fin-fl) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 10) (joint-mod-base-flags attached)) + 0 + (none) + ) + +;; definition of type h-bike-b +(deftype h-bike-b (h-bike-base) + ((fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (rudder joint-mod-rotate-local :inline) + (rudder-f joint-mod-rotate-local :inline) + (brake-l joint-mod-rotate-local :inline) + (brake-r joint-mod-rotate-local :inline) + (flap-l joint-mod-rotate-local :inline) + (flap-r joint-mod-rotate-local :inline) + ) + ) + +;; definition for method 3 of type h-bike-b +(defmethod inspect ((this h-bike-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-bike-base inspect))) + (t9-0 this) + ) + (format #t "~2Tfin-rl: #~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: #~%" (-> this fin-rr)) + (format #t "~2Trudder: #~%" (-> this rudder)) + (format #t "~2Trudder-f: #~%" (-> this rudder-f)) + (format #t "~2Tbrake-l: #~%" (-> this brake-l)) + (format #t "~2Tbrake-r: #~%" (-> this brake-r)) + (format #t "~2Tflap-l: #~%" (-> this flap-l)) + (format #t "~2Tflap-r: #~%" (-> this flap-r)) + (label cfg-4) + this + ) + +;; definition for method 34 of type h-bike-b +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this h-bike-b)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 11264.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 -409.6 4505.6 4300.8) + (set! (-> v1-11 nav-radius) 6144.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-13 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 -3686.4 4096.0) + (set! (-> v1-13 nav-radius) 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 160)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 204.8 3276.8 1228.8 3276.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 -819.2 9011.2 1638.4) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 1228.8 -8601.6 2048.0) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 79 of type h-bike-b +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this h-bike-b)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 13653.333 (-> this controls brake))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0)) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this flap-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this flap-r rotation) s5-0 (- f28-0)) + ) + 0 + (none) + ) + +;; definition for method 35 of type h-bike-b +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-bike-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-bike-b-constants*) + (init (-> this fin-rl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this rudder-f) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this flap-l) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this flap-r) this (the-as uint 11) (joint-mod-base-flags attached)) + 0 + (none) + ) + +;; definition of type h-bike-c +(deftype h-bike-c (h-bike-base) + ((fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (fin2-fl joint-mod-rotate-local :inline) + (fin2-fr joint-mod-rotate-local :inline) + (rudder joint-mod-rotate-local :inline) + (brake-l joint-mod-rotate-local :inline) + (brake-r joint-mod-rotate-local :inline) + (spoiler-l joint-mod-rotate-local :inline) + (spoiler-r joint-mod-rotate-local :inline) + ) + ) + +;; definition for method 3 of type h-bike-c +(defmethod inspect ((this h-bike-c)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-bike-base inspect))) + (t9-0 this) + ) + (format #t "~2Tfin-fl: #~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: #~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: #~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: #~%" (-> this fin-rr)) + (format #t "~2Tfin2-fl: #~%" (-> this fin2-fl)) + (format #t "~2Tfin2-fr: #~%" (-> this fin2-fr)) + (format #t "~2Trudder: #~%" (-> this rudder)) + (format #t "~2Tbrake-l: #~%" (-> this brake-l)) + (format #t "~2Tbrake-r: #~%" (-> this brake-r)) + (format #t "~2Tspoiler-l: #~%" (-> this spoiler-l)) + (format #t "~2Tspoiler-r: #~%" (-> this spoiler-r)) + (label cfg-4) + this + ) + +;; definition for method 34 of type h-bike-c +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this h-bike-c)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 13312.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 4505.6 4300.8) + (set! (-> v1-11 nav-radius) 7577.6) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-13 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 -3686.4 4096.0) + (set! (-> v1-13 nav-radius) 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 160)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 204.8 3276.8 1228.8 3276.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 9011.2 3686.4) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 1228.8 -8601.6 2048.0) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 79 of type h-bike-c +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this h-bike-c)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 13653.333 (-> this controls brake))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this spoiler-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this spoiler-r rotation) s5-0 (- f28-0)) + ) + 0 + (none) + ) + +;; definition for method 35 of type h-bike-c +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-bike-c)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-bike-c-constants*) + (init (-> this fin-fl) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this fin2-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin2-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 11) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 12) (joint-mod-base-flags attached)) + (init (-> this spoiler-l) this (the-as uint 13) (joint-mod-base-flags attached)) + (init (-> this spoiler-r) this (the-as uint 14) (joint-mod-base-flags attached)) + 0 + (none) + ) + +;; definition of type h-bike-d +(deftype h-bike-d (h-bike-a) + () + ) + +;; definition for method 3 of type h-bike-d +(defmethod inspect ((this h-bike-d)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-bike-a inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 35 of type h-bike-d +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-bike-d)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-d" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-bike-d-constants*) + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (init (-> this fin-fl) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 10) (joint-mod-base-flags attached)) + 0 + (none) + ) + +;; definition for method 109 of type h-bike-d +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-method-109 ((this h-bike-d)) + (cleanup-for-death this) + (go empty-state) + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/car_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/car_REF.gc new file mode 100644 index 0000000000..3c6db364d5 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/car_REF.gc @@ -0,0 +1,2076 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-h-car-a cara cara-lod0-jg cara-idle-ja + ((cara-lod0-mg (meters 20)) (cara-lod1-mg (meters 40)) (cara-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.2) + :shadow cara-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-h-car-b carb carb-lod0-jg carb-idle-ja + ((carb-lod0-mg (meters 20)) (carb-lod1-mg (meters 40)) (carb-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow carb-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-h-car-c carc carc-lod0-jg carc-idle-ja + ((carc-lod0-mg (meters 20)) (carc-lod1-mg (meters 40)) (carc-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.3) + :shadow carc-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-h-hellcat hellcat hellcat-lod0-jg hellcat-idle-ja + ((hellcat-lod0-mg (meters 20)) (hellcat-lod1-mg (meters 40)) (hellcat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :shadow hellcat-shadow-mg + :origin-joint-index 3 + ) + +;; definition for symbol *h-car-explosion-info*, type vehicle-explosion-info +(define *h-car-explosion-info* + (new 'static 'vehicle-explosion-info + :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) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level 'ctywide + :skel #f + :skel-name "skel-vehicle-explosion" + :anim 2 + ) + ) + +;; definition for symbol *h-car-a-constants*, type rigid-body-vehicle-constants +(define *h-car-a-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 3) (meters 6)) + ) + :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 '*h-car-a-constants* + :flags #x68 + :object-type (traffic-type civilian-car-a) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 39) + :inv-max-engine-thrust 0.000006260016 + :engine-response-rate 20.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.4 + :air-drag-factor 1.0 + :steering-thruster-factor 3.0 + :steering-thruster-max-gain 3.5 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.6 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 3) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.09 + :engine-pitch-mod-amp 0.01 + :engine-sound-select 5 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-5") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :z -14336.0 :w 1.0) + (new 'static 'vector :x -3072.0 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6963.2 :y -1024.0 :z -7372.8 :w 1.0) + (new 'static 'vector :x -6963.2 :y -1024.0 :z -7372.8 :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 3072.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -3072.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 4915.2 :z 15564.8 :w 1.0) + (new 'static 'vector :x -4915.2 :z 15564.8 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 24.0 + :inv-hit-points 0.041666668 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 3 + :color (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 3 + :rider-stance #x1 + :grab-rail-count 6 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 6 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4505.6 :y -2662.4 :z 15360.0 :w 1.0) + (new 'static 'vector :x -4505.6 :y -2662.4 :z 15360.0 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 7372.8 :y -819.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x 7372.8 :y -819.2 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -7372.8 :y -819.2 :z 4096.0 :w 1.0) + (new 'static 'vector :x -7372.8 :y -819.2 :z -4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3686.4 :y -409.6 :z -14950.4 :w 1.0) + (new 'static 'vector :x 3686.4 :y -409.6 :z -14950.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3837.952 :y -409.6 :z -14950.4 :w 1.0) + (new 'static 'vector :x 6041.6 :y -614.4 :z -9011.2 :w 1.0) + ) + :normal (new 'static 'vector :x 0.707 :z -0.707 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -6041.6 :y -614.4 :z -9011.2 :w 1.0) + (new 'static 'vector :x -3837.952 :y -409.6 :z -14950.4 :w 1.0) + ) + :normal (new 'static 'vector :x -0.707 :z -0.707 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 4079.616 :y 819.2 :z -311.296 :w (the-as float #x30000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -4079.616 :y 819.2 :z -311.296 :w (the-as float #x30000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 3751.936 :z -10563.584 :w (the-as float #x40000)) + ) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 614.4 :y 614.4 :z 1433.6 :w 1.0) + (new 'static 'vector :x 614.4 :y 614.4 :z -1433.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +;; definition for symbol *h-car-b-constants*, type rigid-body-vehicle-constants +(define *h-car-b-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 6.0 + :inv-mass 0.16666667 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-car-b-constants* + :flags #x68 + :object-type (traffic-type civilian-car-b) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 40) + :inv-max-engine-thrust 0.0000061035157 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.4 + :air-drag-factor 1.0 + :steering-thruster-factor 3.5 + :steering-thruster-max-gain 3.8 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.55 + :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.69 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 3) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select 6 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-6") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4096.0 :y 1638.4 :z -13107.2 :w 1.0) + (new 'static 'vector :x -4096.0 :y 1638.4 :z -13107.2 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6553.6 :y 3072.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -6553.6 :y 3072.0 :z -10240.0 :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 4096.0 :y 1638.4 :z -10240.0 :w 1.0) + (new 'static 'vector :x -4096.0 :y 1638.4 :z -10240.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 4096.0 :y 2457.6 :z 15155.2 :w 1.0) + (new 'static 'vector :x -4096.0 :y 2457.6 :z 15155.2 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3891.2 :y 4096.0 :z -12697.6 :w 1.0) + (new 'static 'vector :x -3891.2 :y 4096.0 :z -12697.6 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 24.0 + :inv-hit-points 0.041666668 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 9011.2 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -9011.2 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 4 + :color (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.7 :z 0.7 :w 1.0) + (new 'static 'vector :x 0.6 :y 1.0 :z 0.8 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 3 + :rider-stance #x1 + :grab-rail-count 5 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 5 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6963.2 :y -2048.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x 6963.2 :y -2048.0 :z 1638.4 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -6963.2 :y -2048.0 :z 1638.4 :w 1.0) + (new 'static 'vector :x -6963.2 :y -2048.0 :z -3276.8 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4096.0 :y -1638.4 :z 16384.0 :w 1.0) + (new 'static 'vector :x 3891.2 :y -1638.4 :z 16384.0 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3891.2 :y -1638.4 :z 16384.0 :w 1.0) + (new 'static 'vector :x -4096.0 :y -1638.4 :z 16384.0 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -819.2 :y 1024.0 :z -12697.6 :w 1.0) + (new 'static 'vector :x 819.2 :y 1024.0 :z -12697.6 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 4218.88 :y 999.424 :z -172.032 :w (the-as float #x30000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -3891.2 :y 999.424 :z -172.032 :w (the-as float #x30000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 3751.936 :z -8192.0 :w (the-as float #x40000)) + ) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 122.88 :y -1433.6 :z 614.4 :w 1.0) + (new 'static 'vector :x 122.88 :y 1433.6 :z 614.4 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +;; definition for symbol *h-car-c-constants*, type rigid-body-vehicle-constants +(define *h-car-c-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 9.0 + :inv-mass 0.11111111 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z -4096.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*h-car-c-constants* + :flags #x68 + :object-type (traffic-type civilian-car-c) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 35) + :inv-max-engine-thrust 0.0000069754465 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.4 + :air-drag-factor 1.0 + :steering-thruster-factor 3.0 + :steering-thruster-max-gain 3.0 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.75 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters -2) + :turning-accel (meters 15) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select 7 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-7") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3891.2 :z -15155.2 :w 1.0) + (new 'static 'vector :x -3891.2 :z -15155.2 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 3481.6 :z -20480.0 :w 1.0) + (new 'static 'vector :x -2457.6 :y 3481.6 :z -20480.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 + (new 'static 'vector :x -0.4 :z -0.92 :w 1.0) + (new 'static 'vector :x 0.4 :z -0.92 :w 1.0) + ) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4096.0 :y 2048.0 :z -14336.0 :w 1.0) + (new 'static 'vector :x -4096.0 :y 2048.0 :z -14336.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y 409.6 :z 8601.6 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2867.2 :y 2048.0 :z -18022.4 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z -18022.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 24.0 + :inv-hit-points 0.041666668 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 4915.2 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -13107.2 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z -4096.0 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z -4096.0 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -12288.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -4096.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -9830.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -12288.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 4 + :color (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 0.6 :y 1.2 :z 1.2 :w 1.0) + (new 'static 'vector :x 0.7 :y 1.25 :z 0.8 :w 1.0) + (new 'static 'vector :x 1.0 :y 0.6 :z 1.5 :w 1.0) + ) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 4 + :rider-stance #x1 + :grab-rail-count 9 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 9 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 5324.8 :y -819.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x 5324.8 :y -819.2 :z 2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -5324.8 :y -819.2 :z 2048.0 :w 1.0) + (new 'static 'vector :x -5324.8 :y -819.2 :z -4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y -204.8 :z 9830.4 :w 1.0) + (new 'static 'vector :y -204.8 :z 10547.2 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y -204.8 :z 10547.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y -204.8 :z 9830.4 :w 1.0) + ) + :normal (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -204.8 :y 3276.8 :z -20889.6 :w 1.0) + (new 'static 'vector :x 204.8 :y 3276.8 :z -20889.6 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :y 3481.6 :z -19660.8 :w 1.0) + (new 'static 'vector :x 3891.2 :y 3481.6 :z -16793.6 :w 1.0) + ) + :normal (new 'static 'vector :x 0.707 :z -0.707 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3891.2 :y 3481.6 :z -16793.6 :w 1.0) + (new 'static 'vector :x -3072.0 :y 3481.6 :z -19660.8 :w 1.0) + ) + :normal (new 'static 'vector :x -0.707 :z -0.707 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4915.2 :z -14745.6 :w 1.0) + (new 'static 'vector :x 4915.2 :z -12697.6 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -4915.2 :z -12697.6 :w 1.0) + (new 'static 'vector :x -4915.2 :z -14745.6 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 761.856 :z 1368.064 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2867.2 :y 1638.4 :z -2867.2 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2867.2 :y 1638.4 :z -2867.2 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 4239.36 :z -14192.64 :w (the-as float #x40000)) + ) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 696.32 :y -1433.6 :z 614.4 :w 1.0) + (new 'static 'vector :x 696.32 :y 1433.6 :z 614.4 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +;; definition for symbol *h-hellcat-constants*, type rigid-body-vehicle-constants +(define *h-hellcat-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 20.0 + :inv-mass 0.05 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :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 '*h-hellcat-constants* + :flags #x4c + :object-type (traffic-type guard-car) + :guard-type #x5 + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 30) + :inv-max-engine-thrust 0.000008138021 + :engine-response-rate 8.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.3 + :air-drag-factor 1.0 + :steering-thruster-factor 3.0 + :steering-thruster-max-gain 2.0 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-speed-factor 61440.0 + :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 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters -2) + :turning-accel (meters 12) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select 8 + :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") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-8") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 3 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :y 4096.0 :z -17612.8 :w 1.0) + (new 'static 'vector :x -6144.0 :y 4096.0 :z -17612.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :y 5529.6 :z -17612.8 :w 1.0) + (new 'static 'vector :x -6144.0 :y 5529.6 :z -17612.8 :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 2048.0 :y 4096.0 :z -16384.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 4096.0 :z -16384.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 5734.4 :y 1843.2 :z 15769.6 :w 1.0) + (new 'static 'vector :x -5734.4 :y 1843.2 :z 15769.6 :w 1.0) + (new 'static 'vector :y 6963.2 :z 6922.24 :w 1.0) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 10362.88 :y 4710.4 :z -16998.4 :w 1.0) + (new 'static 'vector :x -10362.88 :y 4710.4 :z -16998.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.25 + :hit-points 30.0 + :inv-hit-points 0.033333335 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z 8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z 6144.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :y 2048.0 :z -7782.4 :w 1.0) + :brake-local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 3 + :rider-stance #x1 + :grab-rail-count 6 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 6 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 409.6 :z 24576.0 :w 1.0) + (new 'static 'vector :x 3276.8 :y 409.6 :z 25395.2 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3276.8 :y 409.6 :z 25395.2 :w 1.0) + (new 'static 'vector :x -3686.4 :y 409.6 :z 24576.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 8601.6 :z -409.6 :w 1.0) + (new 'static 'vector :x 8601.6 :y -409.6 :z 2867.2 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -8601.6 :y -409.6 :z 2867.2 :w 1.0) + (new 'static 'vector :x -8601.6 :z -409.6 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y -409.6 :z -15974.4 :w 1.0) + (new 'static 'vector :x 10240.0 :y -409.6 :z -13926.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -10240.0 :y -409.6 :z -13926.4 :w 1.0) + (new 'static 'vector :y -409.6 :z -15974.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 5120.0 :y 819.2 :z 2457.6 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -5120.0 :y 819.2 :z 2457.6 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 3686.4 :z -8192.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *h-car-a-constants* explosion) *h-car-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *h-car-b-constants* explosion) *h-car-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *h-car-c-constants* explosion) *h-car-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *h-hellcat-constants* explosion) *h-car-explosion-info*) + +;; definition of type h-car-base +(deftype h-car-base (hvehicle) + ((rider-hand-joint-array int8 2) + ) + ) + +;; definition for method 3 of type h-car-base +(defmethod inspect ((this h-car-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hvehicle inspect))) + (t9-0 this) + ) + (format #t "~2Trider-hand-joint-array[2] @ #x~X~%" (-> this rider-hand-joint-array)) + (label cfg-4) + this + ) + +;; definition for method 113 of type h-car-base +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-113 ((this h-car-base) (arg0 vector) (arg1 int) (arg2 int)) + (vector-matrix*! + arg0 + (-> this info rider rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint-array arg1) bone transform) + ) + 0 + (none) + ) + +;; definition of type h-car-a +(deftype h-car-a (h-car-base) + ((steering-wheel-l joint-mod-rotate-local :inline) + (steering-wheel-r joint-mod-rotate-local :inline) + (fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (rudder-l joint-mod-rotate-local :inline) + (rudder-r joint-mod-rotate-local :inline) + (rudder joint-mod-rotate-local :inline) + ) + ) + +;; definition for method 3 of type h-car-a +(defmethod inspect ((this h-car-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-car-base inspect))) + (t9-0 this) + ) + (format #t "~2Tsteering-wheel-l: #~%" (-> this steering-wheel-l)) + (format #t "~2Tsteering-wheel-r: #~%" (-> this steering-wheel-r)) + (format #t "~2Tfin-fl: #~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: #~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: #~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: #~%" (-> this fin-rr)) + (format #t "~2Trudder-l: #~%" (-> this rudder-l)) + (format #t "~2Trudder-r: #~%" (-> this rudder-r)) + (format #t "~2Trudder: #~%" (-> this rudder)) + (label cfg-4) + this + ) + +;; definition for method 34 of type h-car-a +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this h-car-a)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 3686.4 0.0 12288.0 4096.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -3686.4 0.0 12288.0 4096.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 819.2 5734.4 4915.2) + (set! (-> v1-15 nav-radius) 14336.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 144)))) + (set! (-> v1-17 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 2048.0 -4096.0 5734.4) + (set! (-> v1-17 nav-radius) 14336.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 4915.2 0.0 -11468.8 4096.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) -4915.2 0.0 -11468.8 4096.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 79 of type h-car-a +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this h-car-a)) + (let ((f30-0 (* 3640.889 (-> this controls steering))) + (f28-0 (* 9102.223 (-> this controls steering))) + (f26-0 (* -3640.889 (-> this controls lean-z))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this steering-wheel-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this steering-wheel-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + ) + 0 + (none) + ) + +;; definition for method 35 of type h-car-a +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-car-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-car-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-car-a-constants*) + (set! (-> this rider-hand-joint-array 0) 11) + (set! (-> this rider-hand-joint-array 1) 12) + (init (-> this steering-wheel-l) this (the-as uint 11) (joint-mod-base-flags attached)) + (init (-> this steering-wheel-r) this (the-as uint 12) (joint-mod-base-flags attached)) + (init (-> this fin-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this rudder-l) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this rudder-r) this (the-as uint 9) (joint-mod-base-flags attached)) + 0 + (none) + ) + +;; definition of type h-car-b +(deftype h-car-b (h-car-base) + ((steering-wheel-l joint-mod-rotate-local :inline) + (steering-wheel-r joint-mod-rotate-local :inline) + (fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + ) + ) + +;; definition for method 3 of type h-car-b +(defmethod inspect ((this h-car-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-car-base inspect))) + (t9-0 this) + ) + (format #t "~2Tsteering-wheel-l: #~%" (-> this steering-wheel-l)) + (format #t "~2Tsteering-wheel-r: #~%" (-> this steering-wheel-r)) + (format #t "~2Tfin-fl: #~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: #~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: #~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: #~%" (-> this fin-rr)) + (label cfg-4) + this + ) + +;; definition for method 34 of type h-car-b +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this h-car-b)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 3686.4 409.6 13107.2 3686.4) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -3686.4 409.6 13107.2 3686.4) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 819.2 6553.6 4096.0) + (set! (-> v1-15 nav-radius) 14336.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 128)))) + (set! (-> v1-17 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 2457.6 -2457.6 5734.4) + (set! (-> v1-17 nav-radius) 14336.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 4505.6 409.6 -11059.2 3686.4) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) -4505.6 409.6 -11059.2 3686.4) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 79 of type h-car-b +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this h-car-b)) + (let ((f30-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 9102.223 (-> this controls steering))) + (gp-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this steering-wheel-l rotation) gp-0 f28-0) + (quaternion-vector-angle! (-> this steering-wheel-r rotation) gp-0 f28-0) + (quaternion-vector-angle! (-> this fin-fl rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-fr rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) + ) + 0 + (none) + ) + +;; definition for method 35 of type h-car-b +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-car-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-car-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-car-b-constants*) + (set! (-> this rider-hand-joint-array 0) 8) + (set! (-> this rider-hand-joint-array 1) 9) + (init (-> this steering-wheel-l) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this steering-wheel-r) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this fin-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 7) (joint-mod-base-flags attached)) + 0 + (none) + ) + +;; definition of type h-car-c +(deftype h-car-c (h-car-base) + ((steering-wheel joint-mod-rotate-local :inline) + (fin-fl joint-mod-rotate-local :inline) + (fin-fr joint-mod-rotate-local :inline) + (fin-rl joint-mod-rotate-local :inline) + (fin-rr joint-mod-rotate-local :inline) + (fin2-rl joint-mod-rotate-local :inline) + (fin2-rr joint-mod-rotate-local :inline) + ) + ) + +;; definition for method 3 of type h-car-c +(defmethod inspect ((this h-car-c)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-car-base inspect))) + (t9-0 this) + ) + (format #t "~2Tsteering-wheel: #~%" (-> this steering-wheel)) + (format #t "~2Tfin-fl: #~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: #~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: #~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: #~%" (-> this fin-rr)) + (format #t "~2Tfin2-rl: #~%" (-> this fin2-rl)) + (format #t "~2Tfin2-rr: #~%" (-> this fin2-rr)) + (label cfg-4) + this + ) + +;; definition for method 34 of type h-car-c +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this h-car-c)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 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 21299.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 3686.4 -819.2 6963.2 3276.8) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -3686.4 -819.2 6963.2 3276.8) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 128)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 2457.6 0.0 6144.0) + (set! (-> v1-15 nav-radius) 12288.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-17 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 2048.0 -10240.0 4915.2) + (set! (-> v1-17 nav-radius) 10240.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 2048.0 -16384.0 4096.0) + ) + (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 21299.2) + ) + (set! (-> s5-0 nav-radius) 16384.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! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 79 of type h-car-c +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this h-car-c)) + (let ((f30-0 (* -5461.3335 (-> this controls steering))) + (f28-0 (* -5461.3335 (-> this controls lean-z))) + (f0-3 (* 9102.223 (-> this controls steering))) + (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) + ) + (quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) + (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) + ) + 0 + (none) + ) + +;; definition for method 35 of type h-car-c +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-car-c)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-car-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-car-c-constants*) + (set! (-> this rider-hand-joint-array 0) 10) + (init (-> this steering-wheel) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this fin-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this fin2-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin2-rr) this (the-as uint 7) (joint-mod-base-flags attached)) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/test-bike_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/test-bike_REF.gc new file mode 100644 index 0000000000..1ae9a6f219 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/test-bike_REF.gc @@ -0,0 +1,758 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type test-bike +(deftype test-bike (h-bike-c) + () + ) + +;; definition for method 3 of type test-bike +(defmethod inspect ((this test-bike)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-bike-c inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *test-bike-constants*, type rigid-body-vehicle-constants +(define *test-bike-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :friction-factor 0.516 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 1.5) (meters 2) (meters 5)) + ) + :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 '*test-bike-constants* + :flags #x11 + :object-type (traffic-type civilian-bike-c) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 32.0 + :engine-intake-factor 1.0 + :brake-factor 2.0 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 100) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :ground-probe-offset (meters 0.5) + :cos-ground-effect-angle 0.00000000000000006123032 + :spring-lift-factor 0.35 + :air-drag-factor 1.2 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 6.0 + :steering-thruster-max-gain 2.0 + :steering-thruster-half-gain-speed (meters 80) + :tire-steering-angle 1274.3112 + :tire-steering-speed-factor 61440.0 + :tire-static-friction 0.5 + :tire-static-friction-speed (meters 1) + :tire-dynamic-friction 0.25 + :tire-dynamic-friction-speed (meters 3) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 8.0 + :drag-force-factor 1.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :roll-angle 7281.778 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 0.125) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 2.5) + :string-max-height (meters 2.5) + :string-min-length (meters 5) + :string-max-length (meters 5.5) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 2 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -614.4 :z 13721.6 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 614.4 :z -7168.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.25) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.75) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 0.25) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 8192.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 8192.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 802.816 :z 1318.912 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; definition for method 35 of type test-bike +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this test-bike)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *test-bike-constants*) + (init (-> this fin-fl) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this fin2-fl) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this fin2-fr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 11) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 12) (joint-mod-base-flags attached)) + (init (-> this spoiler-l) this (the-as uint 13) (joint-mod-base-flags attached)) + (init (-> this spoiler-r) this (the-as uint 14) (joint-mod-base-flags attached)) + 0 + (none) + ) + +;; definition of type evan-test-bike +(deftype evan-test-bike (h-bike-a) + () + ) + +;; definition for method 3 of type evan-test-bike +(defmethod inspect ((this evan-test-bike)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type h-bike-a inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *evan-test-bike-constants*, type rigid-body-vehicle-constants +(define *evan-test-bike-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6)) + ) + :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 '*evan-test-bike-constants* + :flags #x70 + :object-type (traffic-type civilian-bike-a) + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 30.0 + :engine-intake-factor 1.0 + :brake-factor 2.0 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 40) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 5) + :cos-ground-effect-angle 0.42261827 + :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-steering-speed-factor 61440.0 + :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.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 8192.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 1 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "bike-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :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 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -819.2 :z 10240.0 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -10240.0 :w 1.0) (new 'static 'vector)) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 15.0 + :inv-hit-points 0.06666667 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 2 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x10 #x8 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x4 #x0) + :damage-seg-count 2 + ) + (new 'static 'vehicle-section-info) + (new 'static 'vehicle-section-info) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z 7372.8003 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 819.2 :z -2457.6 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 0.6 :y 0.6 :z 1.5 :w 1.0)) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :grab-rail-count 2 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x 2048.0 :z 4096.0 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2048.0 :z 4096.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (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) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; definition for method 35 of type evan-test-bike +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this evan-test-bike)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-bike-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *evan-test-bike-constants*) + (init (-> this fin-fl) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this fin-fr) this (the-as uint 7) (joint-mod-base-flags attached)) + (init (-> this fin-rl) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this fin-rr) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this rudder) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this brake-l) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this brake-r) this (the-as uint 10) (joint-mod-base-flags attached)) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-control_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-control_REF.gc index 0591f35583..4fcc1673fc 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-control_REF.gc @@ -22,7 +22,7 @@ ) (:methods (vehicle-controller-method-9 (_type_) none) - (vehicle-controller-method-10 (_type_ traffic-tracker) none) + (vehicle-controller-method-10 (_type_ nav-branch) none) (vehicle-controller-method-11 (_type_) none) (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none) (vehicle-controller-method-13 (_type_ nav-branch vector) none) @@ -219,7 +219,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod vehicle-controller-method-13 ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) - (vehicle-controller-method-10 this (the-as traffic-tracker arg0)) + (vehicle-controller-method-10 this arg0) (set! (-> this path-prev-point quad) (-> arg1 quad)) (set! (-> this branch) arg0) (let ((v1-3 arg0)) @@ -384,10 +384,10 @@ ;; definition for method 10 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-10 ((this vehicle-controller) (arg0 traffic-tracker)) +(defmethod vehicle-controller-method-10 ((this vehicle-controller) (arg0 nav-branch)) (when (not (logtest? (-> this flags) (vehicle-controller-flag attached))) (logior! (-> this flags) (vehicle-controller-flag attached)) - (+! (-> arg0 active-object-count) 1) + (+! (-> arg0 user-count) 1) ) 0 (none) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc index 560b1e4db7..b9e501fc0c 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc @@ -663,7 +663,7 @@ (look-select uint8) (color-option-count int8) (color-option-select int8) - (color vector) + (color (inline-array vector)) (gun-yaw-min float) (gun-yaw-max float) (gun-pitch-min float) @@ -841,7 +841,7 @@ ;; definition of type rigid-body-vehicle-constants (deftype rigid-body-vehicle-constants (rigid-body-object-constants) ((flags uint32) - (object-type uint8) + (object-type traffic-type) (guard-type uint8) (vehicle-type vehicle-type-u8) (engine vehicle-engine-info :inline) @@ -939,7 +939,8 @@ ;; definition of type vehicle (deftype vehicle (rigid-body-object) - ((info rigid-body-vehicle-constants :override) + ((self vehicle :override) + (info rigid-body-vehicle-constants :override) (v-flags vehicle-flag :overlay-at flags) (unknown-flags vehicle-flag :offset 296) (squad squad-control) @@ -1017,7 +1018,7 @@ (vehicle-method-70 (_type_) uint) (get-best-seat (_type_ vector vehicle-seat-flag int) int) (remove-riders (_type_ handle) none) - (vehicle-method-73 (_type_) none) + (vehicle-method-73 (_type_) float) (vehicle-method-74 (_type_ int time-frame) none) (vehicle-method-75 (_type_) none) (vehicle-method-76 (_type_) none) @@ -1075,7 +1076,7 @@ (vehicle-method-128 (_type_) symbol) (vehicle-method-129 (_type_) none) (vehicle-method-130 (_type_) none) - (vehicle-method-131 (_type_) none) + (vehicle-method-131 (_type_ traffic-object-spawn-params) none) (vehicle-method-132 (_type_ traffic-object-spawn-params) none) (vehicle-method-133 (_type_ traffic-object-spawn-params) none) (vehicle-method-134 (_type_) none) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-rider_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-rider_REF.gc new file mode 100644 index 0000000000..2a552bddd0 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-rider_REF.gc @@ -0,0 +1,416 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vehicle-rider +(deftype vehicle-rider (process-focusable) + ((parent (pointer vehicle) :override) + (squad squad-control) + (flags vehicle-rider-flag) + (riding-anim int32) + (anim-t float) + (anim-speed float) + (seat-index int8) + ) + (:state-methods + inactive + active + taunt + got-passed + ) + (:methods + (initialize-collision (_type_) none) + (setup-lods (_type_) none) + (setup (_type_) none) + (vehicle-rider-post (_type_) none) + (go-inactive (_type_) none) + ) + ) + +;; definition for method 3 of type vehicle-rider +(defmethod inspect ((this vehicle-rider)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tsquad: ~A~%" (-> this squad)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Triding-anim: ~D~%" (-> this riding-anim)) + (format #t "~2Tanim-t: ~f~%" (-> this anim-t)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~2Tseat-index: ~D~%" (-> this seat-index)) + (label cfg-4) + this + ) + +;; definition for method 21 of type vehicle-rider +(defmethod get-trans ((this vehicle-rider) (arg0 int)) + "Get the `trans` for this process." + (-> this root trans) + ) + +;; definition for method 34 of type vehicle-rider +;; WARN: Return type mismatch int vs none. +(defmethod setup ((this vehicle-rider)) + (let* ((s4-0 (ppointer->process (-> this parent))) + (s5-0 (if (type? s4-0 vehicle) + s4-0 + ) + ) + ) + (logclear! (-> this flags) (vehicle-rider-flag vr2)) + (if (and s5-0 (nonzero? (vehicle-method-70 s5-0))) + (logior! (-> this flags) (vehicle-rider-flag vr2)) + ) + (put-rider-in-seat s5-0 (-> this seat-index) this) + ) + (set! (-> this anim-speed) (rand-vu-float-range 0.8 1.2)) + 0 + (none) + ) + +;; definition for method 36 of type vehicle-rider +;; WARN: Return type mismatch int vs none. +(defmethod go-inactive ((this vehicle-rider)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (put-rider-in-seat (ppointer->process (-> this parent)) (-> this seat-index) (the-as process #f)) + (go (method-of-object this inactive)) + 0 + (none) + ) + +;; definition for method 32 of type vehicle-rider +;; WARN: Return type mismatch int vs none. +(defmethod initialize-collision ((this vehicle-rider)) + (stack-size-set! (-> this main-thread) 16) + (ctywide-entity-hack) + (when (not (-> this level)) + (format 0 "vehicle-rider::initialize-collision: ERROR, no lwide level found~%") + (stack-size-set! (-> this main-thread) 256) + (go process-drawable-art-error "no lwide level found") + ) + (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) + 0 + (none) + ) + +;; definition for method 33 of type vehicle-rider +;; WARN: Return type mismatch int vs none. +(defmethod setup-lods ((this vehicle-rider)) + (logior! (-> this flags) (vehicle-rider-flag vr0)) + (set! (-> this draw lod-set lod 0 dist) 40960.0) + (set! (-> this draw lod-set lod 1 dist) 122880.0) + (set! (-> this draw lod-set lod 2 dist) 245760.0) + (set! (-> this draw lod-set lod 3 dist) 614400.0) + (set! (-> this seat-index) 0) + (set! (-> this anim-t) (* 65536.0 (rand-vu))) + (setup this) + 0 + (none) + ) + +;; definition for method 35 of type vehicle-rider +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-rider-post ((this vehicle-rider)) + (let ((a0-1 (ppointer->process (-> this parent)))) + (when a0-1 + (+! (-> this anim-t) (* 41870.223 (-> this anim-speed) (seconds-per-frame))) + (if (< 65536.0 (-> this anim-t)) + (+! (-> this anim-t) -65536.0) + ) + (let* ((f0-5 (vehicle-method-73 a0-1)) + (f0-9 (+ (* 5.0 (- 1.0 f0-5)) (sin (-> this anim-t)))) + (gp-1 (-> this skel root-channel 0)) + ) + (set! (-> gp-1 num-func) num-func-identity) + (set! (-> gp-1 frame-num) (ja-aframe f0-9 0)) + ) + ) + ) + (ja-post) + 0 + (none) + ) + +;; definition for function vehicle-rider-event-handler +;; INFO: Used lq/sq +(defbehavior vehicle-rider-event-handler vehicle-rider ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('traffic-on) + (logior! (-> self flags) (vehicle-rider-flag vr1)) + (when (logtest? (-> self flags) (vehicle-rider-flag vr0)) + (setup self) + (go-virtual active) + ) + ) + (('traffic-off) + (logclear! (-> self flags) (vehicle-rider-flag vr1)) + (go-inactive self) + ) + (('knocked-off) + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (let ((v1-14 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) + (set! (-> gp-0 object-type) (traffic-type civilian-male)) + (set! (-> gp-0 behavior) (the-as uint 11)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 nav-mesh) v1-14) + ) + (set! (-> gp-0 nav-branch) #f) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 handle) (process->handle (-> self parent 0))) + (set! (-> gp-0 user-data) (-> self draw seg-mask)) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (set! (-> gp-0 guard-type) (the-as uint 11)) + (set! (-> gp-0 entity) #f) + (vector-reset! (-> gp-0 velocity)) + (when (logtest? (-> self flags) (vehicle-rider-flag vr3)) + (squad-control-method-18 (-> self squad) 2 *target*) + (set! (-> gp-0 object-type) (traffic-type guard-a)) + ) + (set! (-> gp-0 position quad) (-> self root trans quad)) + (quaternion-copy! (-> gp-0 rotation) (-> self root quat)) + (send-event *traffic-manager* 'activate-object gp-0) + ) + (logclear! (-> self flags) (vehicle-rider-flag vr1)) + (go-inactive self) + ) + (('race-pass 'taunt) + (go-virtual taunt) + ) + (('race-got-passed) + (go-virtual got-passed) + ) + (('hide) + (set! v0-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('unhide) + (set! v0-0 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('rider-on) + (logior! (-> self flags) (vehicle-rider-flag vr0)) + (if (logtest? (-> self flags) (vehicle-rider-flag vr1)) + (go-virtual active) + ) + ) + (('rider-off) + (logclear! (-> self flags) (vehicle-rider-flag vr0)) + (go-inactive self) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (vehicle-rider) + :virtual #t + :event vehicle-rider-event-handler + :enter (behavior () + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data (-> self riding-anim))) + ) + :code sleep-code + :post (behavior () + (vehicle-rider-post self) + ) + ) + +;; failed to figure out what this is: +(defstate taunt (vehicle-rider) + :virtual #t + :event vehicle-rider-event-handler + :code sleep-code + :post (behavior () + (go-virtual active) + (vehicle-rider-post self) + ) + ) + +;; failed to figure out what this is: +(defstate got-passed (vehicle-rider) + :virtual #t + :event vehicle-rider-event-handler + :code sleep-code + :post (behavior () + (go-virtual active) + (vehicle-rider-post self) + ) + ) + +;; failed to figure out what this is: +(defstate inactive (vehicle-rider) + :virtual #t + :event vehicle-rider-event-handler + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :code sleep-code + ) + +;; definition for method 11 of type vehicle-rider +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this vehicle-rider) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; definition for function vehicle-rider-init-by-other +;; INFO: Used lq/sq +(defbehavior vehicle-rider-init-by-other vehicle-rider ((arg0 traffic-object-spawn-params)) + (set! (-> self squad) *ff-squad-control*) + (initialize-collision self) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 rotation)) + (logior! (-> self focus-status) (focus-status pilot-riding)) + (setup-lods self) + (cond + ((= (-> arg0 behavior) 1) + (go-inactive self) + ) + (else + (logior! (-> self flags) (vehicle-rider-flag vr1)) + (go-virtual active) + ) + ) + ) + +;; definition for function vehicle-rider-spawn +(defun vehicle-rider-spawn ((arg0 vehicle) (arg1 type) (arg2 traffic-object-spawn-params)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* arg1 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg0 "rider" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 vehicle-rider-init-by-other arg2) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +;; definition of type citizen-norm-rider +(deftype citizen-norm-rider (vehicle-rider) + () + ) + +;; definition for method 3 of type citizen-norm-rider +(defmethod inspect ((this citizen-norm-rider)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle-rider inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-citizen-norm-rider citizen-norm-rider citizen-norm-rider-lod0-jg citizen-norm-rider-idle-ja + ((citizen-norm-rider-lod0-mg (meters 20)) (citizen-norm-rider-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) + +;; definition for method 34 of type citizen-norm-rider +;; WARN: Return type mismatch int vs none. +(defmethod setup ((this citizen-norm-rider)) + (call-parent-method this) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 32 0) + (cond + ((logtest? (-> this flags) (vehicle-rider-flag vr2)) + (set! (-> this riding-anim) 5) + (setup-masks (-> this draw) #x40000 0) + ) + (else + (set! (-> this riding-anim) 4) + (setup-masks (-> this draw) #x20000 0) + ) + ) + (let ((v1-12 (rand-vu-int-count 2))) + (cond + ((zero? v1-12) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-12 1) + (setup-masks (-> this draw) 4096 0) + ) + ) + ) + (let ((v1-18 (rand-vu-int-count 3))) + (cond + ((zero? v1-18) + (setup-masks (-> this draw) 8 0) + ) + ((= v1-18 1) + (setup-masks (-> this draw) 512 0) + ) + ((= v1-18 2) + (setup-masks (-> this draw) #x4000 0) + ) + ) + ) + (let ((v1-26 (rand-vu-int-count 4))) + (cond + ((zero? v1-26) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-26 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-26 2) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + (let ((v1-34 (rand-vu-int-count 3))) + (cond + ((zero? v1-34) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-34 1) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-34 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + (setup-masks (-> this draw) 16 0) + (if (zero? (rand-vu-int-count 3)) + (setup-masks (-> this draw) 128 0) + ) + 0 + (none) + ) + +;; definition for method 33 of type citizen-norm-rider +;; WARN: Return type mismatch int vs none. +(defmethod setup-lods ((this citizen-norm-rider)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm-rider" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this flags) (vehicle-rider-flag vr0)) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 286720.0) + (setup this) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc index 35a42ee4de..b8fb2cbac3 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc @@ -603,10 +603,8 @@ ) ;; definition for method 73 of type vehicle -;; WARN: Return type mismatch float vs none. (defmethod vehicle-method-73 ((this vehicle)) (-> this controls steering) - (none) ) ;; definition for method 111 of type vehicle @@ -767,9 +765,7 @@ (set-time! (-> this state-time)) (let ((v1-19 (-> this info setup))) (let ((a1-0 (-> v1-19 color-option-select))) - (set! (-> this draw color-mult quad) - (-> (the-as (pointer uint128) (+ (the-as uint (-> v1-19 color)) (* a1-0 16)))) - ) + (set! (-> this draw color-mult quad) (-> v1-19 color a1-0 quad)) ) (+! (-> v1-19 color-option-select) 1) (when (>= (-> v1-19 color-option-select) (-> v1-19 color-option-count)) @@ -1257,7 +1253,7 @@ (let ((v1-0 (-> arg0 behavior))) (cond ((= v1-0 1) - (vehicle-method-131 this) + (vehicle-method-131 this arg0) (vehicle-method-109 this) ) ((zero? v1-0) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc index 8f58538ea0..36f96a6ae0 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc @@ -579,7 +579,7 @@ ) ;; definition for method 30 of type vehicle -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod rigid-body-object-method-30 ((this vehicle)) (cond ((logtest? (vehicle-flag sounds) (-> this v-flags)) @@ -613,7 +613,6 @@ (set! (-> this unknown-flags) (-> this v-flags)) (ja-post) 0 - (none) ) ;; definition for method 54 of type vehicle @@ -1392,7 +1391,7 @@ ;; definition for method 131 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-131 ((this vehicle)) +(defmethod vehicle-method-131 ((this vehicle) (arg0 traffic-object-spawn-params)) 0 (none) ) diff --git a/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc index 1f4fa36e52..888ecbb95a 100644 --- a/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc @@ -112,7 +112,7 @@ (vector+! (-> this root trans) (-> this root trans) (new 'static 'vector :w 1.0)) (quaternion-rotate-y! (-> this root quat) (-> this root quat) 32768.0) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 object-type) (traffic-type guard-a)) (set! (-> s4-0 behavior) (the-as uint 0)) (set! (-> s4-0 id) (the-as uint 0)) (set! (-> s4-0 nav-mesh) #f) @@ -506,7 +506,7 @@ ) :name '*h-sled-constants* :flags #x4009 - :object-type #x14 + :object-type (traffic-type civilian-car-a) :guard-type #xb :vehicle-type (vehicle-type-u8 vt27) :transmission (new 'static 'vehicle-transmission-info :gear-count 1) @@ -771,7 +771,7 @@ :shadow-bot-clip -40960.0 :shadow-locus-dist 409600.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 diff --git a/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc index ff676f5b8d..ce798a1d3c 100644 --- a/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc @@ -381,9 +381,9 @@ ) ;; definition for method 65 of type bot -(defmethod penetrate->next-state ((this bot)) +(defmethod penetrate->next-state ((this bot) (arg0 process) (arg1 event-message-block) (arg2 float)) (let* ((t9-0 (method-of-type nav-enemy penetrate->next-state)) - (v0-0 (t9-0 this)) + (v0-0 (t9-0 this arg0 arg1 arg2)) ) (if (logtest? (-> this bot-flags) (bot-flag bf03)) (set! v0-0 #f) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc new file mode 100644 index 0000000000..4bde6a4db9 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc @@ -0,0 +1,1648 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 4699 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 4700 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4701 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 64.0) + (:b 0.0) + (:a 32.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4702 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 32.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4703 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 12.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4704 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 64.0) + (:b 0.0) + (:a 12.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4705 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 12.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4706 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.1)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 64.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4707 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.1)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 64.0) + (:b 0.0) + (:a 64.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4708 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.1)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0 4.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-spydroid spydroid spydroid-lod0-jg spydroid-idle-ja + ((spydroid-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow spydroid-shadow-mg + ) + +;; definition for symbol *spydroid-debris-params*, type debris-static-params +(define *spydroid-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 21 :group "skel-kg-debris-c") + ) + ) + ) + +;; definition of type sensor-light-info +(deftype sensor-light-info (structure) + ((joint int16) + (part-index int16) + (offset vector :inline) + ) + ) + +;; definition for method 3 of type sensor-light-info +(defmethod inspect ((this sensor-light-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sensor-light-info) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Tpart-index: ~D~%" (-> this part-index)) + (format #t "~1Toffset: #~%" (-> this offset)) + (label cfg-4) + this + ) + +;; definition of type spydroid +(deftype spydroid (kg-squad-member) + ((old-y-deg float) + (diff-angle float) + (desire-turn symbol) + (hit-target symbol) + (floor float) + (explode-part sparticle-launch-control) + (alert-level uint8) + (next-check-player-time time-frame) + (part-ids int16 9) + (sensor-lights sensor-light-info 3 :inline) + (last-sensor-time time-frame) + (exiting-wait? symbol) + ) + (:state-methods + attack + search + hunting + scan + undefined0 + spydroid-notice + flip + wait-for-vulnerable + exit-transport + ) + (:methods + (spydroid-method-231 (_type_ uint) object) + (spydroid-method-232 (_type_) int) + (spydroid-method-233 (_type_) int) + (spydroid-method-234 (_type_ vector) float) + (spydroid-method-235 (_type_) symbol) + (spydroid-method-236 (_type_) object) + (spydroid-method-237 (_type_ traffic-danger-info) symbol) + ) + (:states + wait-for-vulnerable-close + ) + ) + +;; definition for method 3 of type spydroid +(defmethod inspect ((this spydroid)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type kg-squad-member inspect))) + (t9-0 this) + ) + (format #t "~2Told-y-deg: ~f~%" (-> this old-y-deg)) + (format #t "~2Tdiff-angle: ~f~%" (-> this diff-angle)) + (format #t "~2Tdesire-turn: ~A~%" (-> this desire-turn)) + (format #t "~2Thit-target: ~A~%" (-> this hit-target)) + (format #t "~2Tfloor: ~f~%" (-> this floor)) + (format #t "~2Texplode-part: ~A~%" (-> this explode-part)) + (format #t "~2Talert-level: ~D~%" (-> this alert-level)) + (format #t "~2Tnext-check-player-time: ~D~%" (-> this next-check-player-time)) + (format #t "~2Tpart-ids[9] @ #x~X~%" (-> this part-ids)) + (format #t "~2Tsensor-lights[3] @ #x~X~%" (-> this sensor-lights)) + (format #t "~2Tlast-sensor-time: ~D~%" (-> this last-sensor-time)) + (format #t "~2Texiting-wait?: ~A~%" (-> this exiting-wait?)) + (label cfg-4) + this + ) + +;; definition for symbol *spydroid-nav-enemy-info*, type nav-enemy-info +(define *spydroid-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 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 5 + :hit-anim -1 + :knocked-anim 9 + :knocked-land-anim 10 + :die-anim -1 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 4 + :look-at-joint 4 + :bullseye-joint 4 + :sound-hit (static-sound-name "spydroid-hit") + :sound-die (static-sound-name "spydroid-die") + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim -1 + :run-anim 5 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *spydroid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 59 of type spydroid +;; WARN: Return type mismatch int vs none. +(defmethod enemy-common-post ((this spydroid)) + (spydroid-method-236 this) + ((method-of-type kg-squad-member enemy-common-post) this) + 0 + (none) + ) + +;; definition for method 82 of type spydroid +(defmethod event-handler ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('jump) + (set! (-> this floor) (-> (the-as enemy-jump-info (-> arg3 param 1)) anim-speed)) + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type kg-squad-member event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (spydroid) + :virtual #t + :enter (behavior () + (sound-play "droid-explode") + (cond + ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) quad) + ) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 221)) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) quad) + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 221)) + ) + ) + (if (not (-> *setting-control* user-current gun-special-mode)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + ) + (cleanup-for-death self) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die-falling (spydroid) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type kg-squad-member die-falling) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (not (time-elapsed? (-> self state-time) (seconds 2))) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 219)) + ) + ) + ) + ) + :code (behavior () + (if (not (-> *setting-control* user-current gun-special-mode)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 233 of type spydroid +;; INFO: Used lq/sq +(defmethod spydroid-method-233 ((this spydroid)) + (when (handle->process (-> this focus handle)) + (let ((s4-0 (handle->process (-> this focus handle))) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> (the-as process-focusable s4-0) root root-prim prim-core world-sphere quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> this root trans)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (when (< (- (vector-normalize-ret-len! s5-1 1.0) (-> s3-0 w)) 10240.0) + (if (not (and s4-0 + (not (logtest? (-> (the-as process-focusable s4-0) focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + (return 3) + ) + (let ((gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (let ((f0-6 (vector-dot s5-1 gp-1))) + (cond + ((< 0.85 f0-6) + (return 2) + ) + ((< f0-6 0.0) + (return 1) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +;; failed to figure out what this is: +(defstate wait-for-vulnerable-close (spydroid) + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + ) + :trans (behavior () + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when gp-0 + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (get-trans gp-0 0)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (let ((f0-2 (vector-normalize-ret-len! s5-1 1.0))) + (when (< 20480.0 f0-2) + (cond + ((and self (not (logtest? (-> self focus-status) (focus-status disable dead ignore grabbed)))) + (set! (-> self exiting-wait?) #t) + (go-virtual hostile) + ) + (else + (go-virtual wait-for-vulnerable) + ) + ) + ) + ) + (vector-float*! s5-1 s5-1 49152.0) + (let ((s4-2 (vector+! (new 'stack-no-clear 'vector) (get-trans gp-0 0) s5-1))) + (nav-mesh-method-10 (-> self nav state mesh) s4-2 s4-2 (the-as nav-poly #f)) + (let ((v1-26 (-> self nav state))) + (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-26 target-pos quad) (-> s4-2 quad)) + ) + ) + ) + 0 + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (not (and v1-2 (= v1-2 spydroid-run-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! spydroid-run-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate wait-for-vulnerable (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((gp-0 (the-as process-focusable (handle->process (-> self focus handle))))) + (when gp-0 + (if (and (= (-> gp-0 type) target) + (< (vector-vector-xz-distance (-> self root trans) (get-trans gp-0 0)) 12288.0) + ) + (go wait-for-vulnerable-close) + ) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) + (and self (not (logtest? (-> self focus-status) (focus-status disable dead ignore grabbed)))) + (or (< 20480.0 (vector-vector-xz-distance (-> self root trans) (get-trans gp-0 0))) + (time-elapsed? (-> self state-time) (seconds 1.5)) + ) + ) + (set! (-> self exiting-wait?) #t) + (go-virtual hostile) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! spydroid-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (transform-post) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (spydroid-method-231 self (the-as uint 3)) + (nav-enemy-method-181 self) + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set! (-> self exiting-wait?) #f) + (if (-> self nav) + (nav-enemy-method-176 self) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (not (and v1-2 (= v1-2 spydroid-run-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja :group! spydroid-run-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (* (rnd-float-range self 0.9 1.1) (-> self travel-anim-scale-speed)))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-chase-post) + ) + ) + +;; definition for method 234 of type spydroid +(defmethod spydroid-method-234 ((this spydroid) (arg0 vector)) + (let ((gp-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + 0.0 + 0.0 + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (set! (-> gp-0 y) 0.0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-normalize! gp-0 1.0) + (vector-normalize! s4-0 1.0) + (let* ((f0-7 (vector-dot s5-1 s4-0)) + (f0-8 (acos f0-7)) + ) + (if (< (vector-dot s5-1 gp-0) 0.0) + (set! f0-8 (* -1.0 f0-8)) + ) + f0-8 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate flip (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (nav-enemy-method-182 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f28-0 0.0) + (f0-0 0.0) + (f30-0 1.0) + ) + (let ((a0-2 (the-as process-focusable (handle->process (-> self focus handle))))) + (when a0-2 + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> (get-trans a0-2 3) quad)) + (set! f0-0 (spydroid-method-234 self gp-0)) + ) + (set! f28-0 (* 0.00024414062 f0-0)) + ) + ) + (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (set! f30-0 -1.0) + ) + (cond + ((>= f0-0 0.0) + (ja-no-eval :group! spydroid-turn-180-ja :num! (seek! f28-0) :frame-num 0.0) + (until (>= (ja-frame-num 0) f28-0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 65536.0 (seconds-per-frame) f30-0)) + (ja :num! (seek! f28-0)) + (suspend) + ) + ) + (else + (ja-no-eval :group! spydroid-turn-180-ja :num! (seek! 0.0) :frame-num (fabs f28-0)) + (until (= (ja-frame-num 0) 0.0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* -65536.0 (seconds-per-frame) f30-0)) + (ja :num! (seek! 0.0)) + (suspend) + ) + ) + ) + ) + (case (spydroid-method-233 self) + ((2) + (go-virtual attack) + ) + (else + (go-virtual hostile) + ) + ) + ) + :post enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate attack (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (logior! (-> self focus-status) (focus-status dangerous)) + (nav-enemy-method-182 self) + (let* ((v1-7 *game-info*) + (v0-2 (+ (-> v1-7 attack-id) 1)) + ) + (set! (-> v1-7 attack-id) v0-2) + (set! (-> self attack-id) v0-2) + ) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :code (behavior () + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let ((a0-2 (the-as process-focusable (handle->process (-> self focus handle))))) + (when a0-2 + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> (get-trans a0-2 3) quad)) + (vector-! gp-0 s5-0 (-> self root trans)) + ) + ) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! spydroid-attack-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s5-2 (vector-float*! (new 'stack-no-clear 'vector) gp-0 (* 49152.0 (seconds-per-frame))))) + (let* ((s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (closest-point-on-mesh (-> self nav) s4-0 (-> self root trans) (the-as nav-poly #f))) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> s5-2 quad)) + (when s1-0 + (set! (-> s3-0 y) 0.0) + (clamp-vector-to-mesh-no-gaps (-> self nav) s4-0 s1-0 s3-0 s2-0) + (if (-> s2-0 found-boundary) + (set! (-> s5-2 quad) (-> s3-0 quad)) + ) + ) + ) + (vector+! (-> self root trans) (-> self root trans) s5-2) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! spydroid-attack-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual hostile) + ) + :post enemy-simple-post + ) + +;; definition for method 231 of type spydroid +(defmethod spydroid-method-231 ((this spydroid) (arg0 uint)) + (when (!= (-> this alert-level) arg0) + (remove-from-process *part-engine* this) + (add-connection + *part-engine* + this + 8 + this + 4699 + (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 573440.0) + ) + (add-connection + *part-engine* + this + 10 + this + 4699 + (new 'static 'vector :x -245.76 :y -122.88 :z 901.12 :w 573440.0) + ) + (let ((v1-8 arg0)) + (cond + ((zero? v1-8) + (add-connection + *part-engine* + this + 4 + this + 4700 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 573440.0) + ) + (add-connection *part-engine* this 6 this 4703 (new 'static 'vector :z 614.4 :w 573440.0)) + (add-connection *part-engine* this 6 this 4706 (new 'static 'vector :z 614.4 :w 573440.0)) + ) + ((= v1-8 1) + (add-connection + *part-engine* + this + 4 + this + 4701 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 573440.0) + ) + (add-connection *part-engine* this 6 this 4704 (new 'static 'vector :z 614.4 :w 573440.0)) + (add-connection *part-engine* this 6 this 4707 (new 'static 'vector :z 614.4 :w 573440.0)) + ) + ((= v1-8 3) + (add-connection + *part-engine* + this + 4 + this + 4702 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 573440.0) + ) + (add-connection *part-engine* this 6 this 4705 (new 'static 'vector :z 614.4 :w 573440.0)) + (add-connection *part-engine* this 6 this 4708 (new 'static 'vector :z 614.4 :w 573440.0)) + ) + ) + ) + ) + (set! (-> this alert-level) arg0) + (let ((v1-28 (-> this alert-level))) + (cond + ((zero? v1-28) + (enemy-method-70 this (get-target-focus (-> this squad)) (the-as enemy-aware #f)) + ) + ((= v1-28 3) + (if (and (zero? (get-alert-level1 (-> this squad))) (= (-> this faction-mode) 0)) + (increment-alert-level (-> this squad) 1) + ) + ) + ) + ) + ) + +;; definition for method 177 of type spydroid +(defmethod nav-enemy-method-177 ((this spydroid)) + (set! (-> this travel-anim-scale-speed) 1.75) + (call-parent-method this) + (none) + ) + +;; definition for method 176 of type spydroid +(defmethod nav-enemy-method-176 ((this spydroid)) + (set! (-> this travel-anim-scale-speed) 0.5) + (call-parent-method this) + (none) + ) + +;; definition for method 232 of type spydroid +;; INFO: Used lq/sq +(defmethod spydroid-method-232 ((this spydroid)) + (if (< (current-time) (-> this next-check-player-time)) + (return 0) + ) + (set! (-> this next-check-player-time) + (the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 51) 25 (current-time))) + ) + (when (handle->process (-> this focus handle)) + (let ((a0-10 (the-as process-focusable (handle->process (-> this focus handle)))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> (get-trans a0-10 3) quad)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> this root trans)))) + 0.0 + 0.0 + (let ((f30-0 1.0) + (f0-2 (-> s4-1 y)) + ) + (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) + (set! f30-0 (* 0.1 f30-0)) + ) + (when (< f0-2 40960.0) + (set! (-> s4-1 y) 0.0) + (let ((f28-0 (vector-normalize-ret-len! s4-1 1.0))) + (when (< f28-0 (* 102400.0 f30-0)) + (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (let ((f30-1 (vector-dot s4-1 s3-0))) + (when (or (< 0.707 f30-1) (and (< -0.7 f30-1) (< f28-0 18432.0)) (< f28-0 16384.0)) + (let ((a1-6 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-6 start-pos quad) (-> this root trans quad)) + (+! (-> a1-6 start-pos y) 4096.0) + (vector-! (-> a1-6 move-dist) s5-0 (-> a1-6 start-pos)) + (let ((v1-45 a1-6)) + (set! (-> v1-45 radius) 40.96) + (set! (-> v1-45 collide-with) (collide-spec backgnd obstacle)) + (set! (-> v1-45 ignore-process0) #f) + (set! (-> v1-45 ignore-process1) #f) + (set! (-> v1-45 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-45 action-mask) (collide-action solid)) + ) + (return (cond + ((!= (fill-and-probe-using-line-sphere *collide-cache* a1-6) -100000000.0) + 0 + ) + ((< 0.707 f30-1) + 2 + ) + (else + 1 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +;; failed to figure out what this is: +(defstate search (spydroid) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('panic) + (let ((gp-0 (the-as traffic-danger-info (-> block param 0)))) + (when (spydroid-method-237 self gp-0) + (set! (-> self move-dest quad) (-> gp-0 sphere quad)) + (let ((a0-4 (-> self nav state)) + (v1-5 (-> self move-dest)) + ) + (logclear! (-> a0-4 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-4 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-4 target-pos quad) (-> v1-5 quad)) + ) + 0 + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (set-time! (-> self state-time)) + (spydroid-method-231 self (the-as uint 1)) + (set-look-at-mode! self 2) + ) + :trans (behavior () + (if (or (time-elapsed? (-> self state-time) (seconds 15)) + (let ((f0-0 (vector-vector-xz-distance-squared (-> self root trans) (-> self move-dest))) + (f1-0 20480.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (go-virtual scan) + ) + (if (= (spydroid-method-232 self) 2) + (go-virtual spydroid-notice) + ) + (when (> (get-alert-level1 (-> self squad)) 0) + (spydroid-method-231 self (the-as uint 3)) + (enemy-method-70 self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) + (go-virtual hostile) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate scan (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-182 self) + (spydroid-method-231 self (the-as uint 1)) + (stop-look-at! self) + ) + :trans (behavior () + (if (= (spydroid-method-232 self) 2) + (go-virtual spydroid-notice) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! spydroid-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (>= (-> self alert-level) (the-as uint 3)) + (go-virtual hostile) + ) + (let ((a1-4 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (vector-float*! a1-4 a1-4 -1.0) + (citizen-method-208 self a1-4) + ) + (go-virtual active) + ) + :post enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate spydroid-notice (spydroid) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-play "spydroid-jabber") + (set-time! (-> self state-time)) + (nav-enemy-method-182 self) + (set-look-at-mode! self 1) + (spydroid-method-231 self (the-as uint 2)) + (remove-from-process *part-engine* self) + (add-connection + *part-engine* + self + 8 + self + 4699 + (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 573440.0) + ) + (add-connection + *part-engine* + self + 10 + self + 4699 + (new 'static 'vector :x -245.76 :y -122.88 :z 901.12 :w 573440.0) + ) + (set-time! (-> self last-sensor-time)) + ) + :trans (behavior () + (if (< (+ (current-time) (seconds -0.15)) (-> self last-sensor-time)) + (spydroid-method-235 self) + ) + (if (>= (+ (current-time) (seconds -0.2)) (-> self last-sensor-time)) + (set-time! (-> self last-sensor-time)) + ) + (if (>= (-> self alert-level) (the-as uint 3)) + (go-virtual hostile) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (handle->process (-> self focus handle)) + (let* ((a0-9 (the-as process-focusable (handle->process (-> self focus handle)))) + (f0-0 (vector-vector-xz-distance-squared (get-trans a0-9 3) (-> self root trans))) + (f1-0 143360.0) + ) + (when (< (* f1-0 f1-0) f0-0) + (spydroid-method-231 self (the-as uint 3)) + (go-virtual hostile) + ) + ) + ) + (set-time! (-> self state-time)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! spydroid-idle-ja + :num! (seek! max (kg-squad-control-method-54 (-> self squad))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (kg-squad-control-method-54 (-> self squad)))) + ) + (spydroid-method-231 self (the-as uint 3)) + (go-virtual hostile) + ) + :post enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate wait (spydroid) + :virtual #t + :enter (behavior () + (go-virtual scan) + ) + ) + +;; definition for method 120 of type spydroid +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this spydroid)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot civilian enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 2048.0 0.0 6144.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.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 enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot civilian enemy hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (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 event-priority) (the-as uint 8)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 67 of type spydroid +(defmethod coin-flip? ((this spydroid)) + #f + ) + +;; definition for method 10 of type spydroid +(defmethod deactivate ((this spydroid)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this explode-part)) + (kill-particles (-> this explode-part)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type spydroid +;; WARN: Return type mismatch kg-squad-member vs spydroid. +(defmethod relocate ((this spydroid) (offset int)) + (when (nonzero? (-> this explode-part)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) offset) + ) + ) + (the-as spydroid ((method-of-type kg-squad-member relocate) this offset)) + ) + +;; definition for method 194 of type spydroid +;; WARN: Return type mismatch float vs none. +(defmethod citizen-method-194 ((this spydroid)) + (call-parent-method this) + (add-connection + *part-engine* + this + 4 + this + 4700 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 573440.0) + ) + (add-connection *part-engine* this 6 this 4703 (new 'static 'vector :z 614.4 :w 573440.0)) + (add-connection *part-engine* this 6 this 4706 (new 'static 'vector :z 614.4 :w 573440.0)) + (set! (-> this exiting-wait?) #f) + (let* ((v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-8 (the-as number (logior #x3f800000 v1-7))) + (f0-2 (+ -1.0 (the-as float v1-8))) + ) + (cond + ((< f0-2 0.1) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + ((< f0-2 0.18) + (set! (-> this fact pickup-type) (pickup-type health)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + (else + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 5.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + ) + ) + ) + (set! (-> this enemy-flags) + (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag auto-death-phase-out))) + ) + (set! (-> this choose-new-enemy-delay-time) (seconds 0.1)) + (let ((v1-33 (-> this nav))) + (set! (-> v1-33 speed-scale) 1.0) + ) + 0 + (spydroid-method-231 this (the-as uint 0)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (set! (-> this next-check-player-time) 0) + (set! (-> this travel-anim-scale-speed) 0.5) + (none) + ) + +;; definition for method 235 of type spydroid +;; INFO: Used lq/sq +(defmethod spydroid-method-235 ((this spydroid)) + (cond + ((not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'wait-for-vulnerable) (= v1-3 'scan)) + ) + ) + ) + (set! (-> this sensor-lights 1 offset z) 0.15) + (set! (-> this sensor-lights 2 offset z) 0.15) + ) + (else + (set! (-> this sensor-lights 1 offset z) 0.0) + (set! (-> this sensor-lights 2 offset z) 0.0) + ) + ) + (dotimes (s5-0 3) + (let ((s3-0 (-> this sensor-lights s5-0)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> this node-list data (-> s3-0 joint)))) + (let* ((v1-13 s4-0) + (t0-0 (-> a1-1 bone transform)) + (a0-5 (-> t0-0 rvec quad)) + (a2-0 (-> t0-0 uvec quad)) + (a3-0 (-> t0-0 fvec quad)) + (t0-1 (-> t0-0 trans quad)) + ) + (set! (-> v1-13 rvec quad) a0-5) + (set! (-> v1-13 uvec quad) a2-0) + (set! (-> v1-13 fvec quad) a3-0) + (set! (-> v1-13 trans quad) t0-1) + ) + (vector<-cspace! (-> s4-0 trans) a1-1) + ) + (set! (-> s2-0 quad) (-> s3-0 offset quad)) + (set! (-> s2-0 w) 1.0) + (vector-matrix*! (-> s4-0 trans) s2-0 s4-0) + ) + (launch-particles (-> *part-id-table* (-> s3-0 part-index)) s4-0 :origin-is-matrix #t) + ) + ) + #f + ) + +;; definition for method 121 of type spydroid +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this spydroid)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *spydroid-nav-enemy-info*) + (call-parent-method this) + (let ((v1-5 (-> this neck))) + (set! (-> v1-5 up) (the-as uint 1)) + (set! (-> v1-5 nose) (the-as uint 2)) + (set! (-> v1-5 ear) (the-as uint 0)) + (set-vector! (-> v1-5 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-5 ignore-angle) 15473.777) + ) + (let ((v1-7 (-> this nav))) + (set! (-> v1-7 speed-scale) 1.0) + ) + 0 + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set! (-> this part-ids 0) 4700) + (set! (-> this part-ids 1) 4703) + (set! (-> this part-ids 2) 4706) + (set! (-> this part-ids 3) 4701) + (set! (-> this part-ids 4) 4704) + (set! (-> this part-ids 5) 4707) + (set! (-> this part-ids 6) 4702) + (set! (-> this part-ids 7) 4705) + (set! (-> this part-ids 8) 4708) + (set! (-> this sensor-lights 0 part-index) (-> this part-ids 6)) + (set! (-> this sensor-lights 0 joint) 4) + (set-vector! (-> this sensor-lights 0 offset) 0.2 -0.03 0.82 1.0) + (set! (-> this sensor-lights 1 part-index) (-> this part-ids 7)) + (set! (-> this sensor-lights 1 joint) 6) + (set! (-> this sensor-lights 1 offset quad) (the-as uint128 0)) + (set! (-> this sensor-lights 2 part-index) (-> this part-ids 8)) + (set! (-> this sensor-lights 2 joint) 6) + (set! (-> this sensor-lights 2 offset quad) (the-as uint128 0)) + (set! (-> this anim-shuffle) 3) + (set! (-> this anim-walk) 4) + (set! (-> this speed-walk) 16384.0) + (set! (-> this dist-walk-anim) 8192.0) + (set! (-> this dist-run-anim) 16384.0) + (set! (-> this anim-run) 5) + (set! (-> this speed-run) 32768.0) + (logclear! (-> this focus-status) (focus-status dangerous)) + (set! (-> this water-anim) 5) + 0 + (none) + ) + +;; definition for method 196 of type spydroid +(defmethod go-inactive ((this spydroid)) + (let ((v1-1 (-> this root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate hunting (spydroid) + :virtual #t + :parent (spydroid active) + :event enemy-event-handler + :enter (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 enter))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + (spydroid-method-231 self (the-as uint 3)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (handle->process (-> self focus handle)) + (go-virtual hostile) + ) + (let ((f0-0 2867.2) + (v1-9 (-> self root transv)) + ) + (if (< f0-0 (sqrtf (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z))))) + (set-time! (-> self cp-next-time)) + ) + ) + (when (< (+ (-> self cp-next-time) (seconds 2)) (current-time)) + (let ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> self controller path-prev-point) (-> self dest-point)))) + (set-time! (-> self cp-next-time)) + (citizen-method-208 self a1-2) + ) + ) + ) + ) + +;; definition for method 237 of type spydroid +(defmethod spydroid-method-237 ((this spydroid) (arg0 traffic-danger-info)) + (when (zero? (-> this faction-mode)) + (let ((f30-0 (+ 204800.0 (-> arg0 notify-radius)))) + (and (< 0.98 (-> arg0 danger-level)) + (and (or (= (-> arg0 danger-type) 0) (= (-> arg0 danger-type) 3) (= (-> arg0 danger-type) 5)) + (< (fabs (- (-> arg0 sphere y) (-> this root trans y))) 61440.0) + (< (vector-vector-xz-distance-squared (-> this root trans) (-> arg0 sphere)) (* f30-0 f30-0)) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (spydroid) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('panic) + (let ((gp-0 (the-as traffic-danger-info (-> block param 0)))) + (when (spydroid-method-237 self gp-0) + (set! (-> self move-dest quad) (-> gp-0 sphere quad)) + (go-virtual search) + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (spydroid-method-231 self (the-as uint 0)) + (set-time! (-> self state-time)) + (logior! (-> self flags) (citizen-flag neck-no-auto-look-at)) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (when (or (!= (-> self faction-mode) 0) (logtest? (-> self flags) (citizen-flag in-mission))) + (spydroid-method-236 self) + (go-virtual hostile) + ) + (case (spydroid-method-232 self) + ((2) + (go-virtual spydroid-notice) + ) + ) + (when (> (get-alert-level1 (-> self squad)) 0) + (spydroid-method-231 self (the-as uint 3)) + (enemy-method-70 self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) + (go-virtual hostile) + ) + ) + ) + +;; definition for method 236 of type spydroid +;; WARN: disable def twice: 120. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod spydroid-method-236 ((this spydroid)) + (local-vars (v0-6 object)) + (when (not (handle->process (-> this current-enemy))) + (set! (-> this focus handle) (the-as handle #f)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + (let ((a0-6 (get-current-enemy this))) + (if a0-6 + (set! (-> this current-enemy) (process->handle a0-6)) + (set! (-> this current-enemy) (the-as handle #f)) + ) + ) + (when (logtest? (-> this attacker-info flags) (city-attacker-info-flag cai2)) + (set! (-> this attacker-info next-update-target-time) (+ (current-time) (seconds 3))) + (logclear! (-> this attacker-info flags) (city-attacker-info-flag cai2)) + ) + (let* ((s5-0 (handle->process (-> this current-enemy))) + (a0-18 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and a0-18 + (not (logtest? (-> (the-as process-focusable a0-18) focus-status) (focus-status disable dead inactive))) + ) + (let* ((s5-1 this) + (s4-0 (method-of-object s5-1 enemy-method-70)) + (s3-0 (handle->process (-> this current-enemy))) + ) + (s4-0 + s5-1 + (the-as process-focusable (if (type? s3-0 process-focusable) + s3-0 + ) + ) + (the-as enemy-aware #f) + ) + ) + (update-focus this) + (let ((f0-0 (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (f1-0 266240.0) + ) + (cond + ((< f0-0 (* f1-0 f1-0)) + (when (not (logtest? (-> this squad alert-state flags) (squad-alert-flag war))) + (set! v0-6 (logior (-> this flags) (citizen-flag persistent))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + (else + (set! v0-6 (logclear (-> this flags) (citizen-flag persistent))) + (set! (-> this flags) (the-as citizen-flag v0-6)) + v0-6 + ) + ) + ) + ) + (else + (set! (-> this focus handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent)) + (when (and (-> this next-state) (= (-> this next-state name) 'hostile)) + (if (nonzero? (-> this faction-mode)) + (go (method-of-object this hunting)) + (go (method-of-object this active)) + ) + ) + ) + ) + ) + ) + +;; definition for method 195 of type spydroid +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-195 ((this spydroid)) + (call-parent-method this) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 sphere-mask) (the-as uint #x1000f8)) + ) + 0 + (none) + ) + +;; definition for method 215 of type spydroid +(defmethod citizen-method-215 ((this spydroid)) + (when (nonzero? *cty-attack-controller*) + (set! (-> this mission-squad) *cty-attack-controller*) + (when (not (-> this attacker-info)) + (set! (-> this attacker-info) (allocate-attacker (-> this mission-squad))) + (init! (-> this attacker-info) this 11) + ) + ) + (none) + ) + +;; definition for method 212 of type spydroid +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod go-from-behavior ((this spydroid) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((6) + (set! (-> this root trans quad) (-> arg0 position quad)) + (go (method-of-object this exit-transport)) + ) + (else + (call-parent-method this arg0) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate exit-transport (spydroid) + :virtual #t + :enter (behavior () + (nav-enemy-method-182 self) + (logclear! (-> self root status) (collide-status on-surface touch-surface impact-surface)) + ) + :trans (behavior () + (if (logtest? (-> self root status) (collide-status on-surface touch-surface impact-surface)) + (go-virtual hostile) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! spydroid-knocked0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + :post (behavior () + (enemy-falling-post) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc b/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc new file mode 100644 index 0000000000..3859b58df6 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc @@ -0,0 +1,452 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *target-controller-pad*, type cpad-info +(define *target-controller-pad* (new 'static 'cpad-info)) + +;; definition for function setup-control-pad +;; WARN: Return type mismatch int vs none. +(defun setup-control-pad ((arg0 cpad-info)) + (cpad-invalid! arg0) + (set! (-> arg0 button0) (the-as uint 0)) + (set! (-> arg0 valid) (the-as uint 0)) + 0 + (none) + ) + +;; definition for function set-pad-world-dir +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun set-pad-world-dir ((arg0 cpad-info) (arg1 vector) (arg2 float)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 quad)) + (let ((s3-0 (matrix-transpose! (new 'stack-no-clear 'matrix) (-> *target* control cam-R-w)))) + (let ((s2-0 (matrix-from-two-vectors! + (new 'stack-no-clear 'matrix) + (-> *target* control cam-R-w uvec) + (-> *target* control local-normal) + ) + ) + ) + (matrix-transpose! s2-0 s2-0) + (vector-matrix*! s5-0 s5-0 s2-0) + ) + (vector-matrix*! s5-0 s5-0 s3-0) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 arg2) + (vector-rotate-around-y! s5-0 s5-0 32768.0) + (set! (-> arg0 stick0-dir) (atan (- (-> s5-0 x)) (- (-> s5-0 z)))) + (set! (-> arg0 stick0-speed) arg2) + (+! (-> s5-0 x) 1.0) + (+! (-> s5-0 z) 1.0) + (set! (-> s5-0 x) (* 0.5 (-> s5-0 x))) + (set! (-> s5-0 z) (* 0.5 (-> s5-0 z))) + (set! (-> arg0 leftx) (the-as uint (the int (* 255.0 (-> s5-0 x))))) + (if (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) + (set! (-> arg0 leftx) (the-as uint (* (the-as uint -1) (-> arg0 leftx)))) + ) + (set! (-> arg0 lefty) (the-as uint (the int (* 255.0 (-> s5-0 z))))) + ) + (none) + ) + +;; definition for function override-player-controls +(defun override-player-controls ((arg0 cpad-info)) + (let ((v1-1 (-> *setting-control* user-current player-control-override))) + (logclear! (-> arg0 button0) (-> *setting-control* user-current player-control-mask)) + (logior! (-> arg0 button0) (logand (-> v1-1 button0) (-> *setting-control* user-current player-control-mask))) + (when (logtest? #x4000000 (-> *setting-control* user-current player-control-mask)) + (set! (-> arg0 leftx) (-> v1-1 leftx)) + (set! (-> arg0 lefty) (-> v1-1 lefty)) + (set! (-> arg0 stick0-dir) (-> v1-1 stick0-dir)) + (set! (-> arg0 stick0-speed) (-> v1-1 stick0-speed)) + ) + (when (logtest? #x8000000 (-> *setting-control* user-current player-control-mask)) + (set! (-> arg0 rightx) (-> v1-1 rightx)) + (set! (-> arg0 righty) (-> v1-1 righty)) + ) + ) + 0 + ) + +;; definition of type player-controller-init-params +(deftype player-controller-init-params (structure) + ((mode symbol) + (flags player-controller-flag) + (targ-pos vector :inline) + (notify-proc handle) + ) + ) + +;; definition for method 3 of type player-controller-init-params +(defmethod inspect ((this player-controller-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'player-controller-init-params) + (format #t "~1Tmode: ~A~%" (-> this mode)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Ttarg-pos: #~%" (-> this targ-pos)) + (format #t "~1Tnotify-proc: ~D~%" (-> this notify-proc)) + (label cfg-4) + this + ) + +;; definition of type player-controller +(deftype player-controller (process-focusable) + ((params player-controller-init-params :inline) + (targ-pos vector :inline) + ) + (:state-methods + idle + active + clip-to-nav-mesh + lock + ) + (:methods + (set-nav-params (_type_) none) + (set-nav-mesh (_type_) none) + (set-params (_type_ player-controller-init-params) object) + (event-handler (_type_ process int symbol event-message-block) object) + ) + ) + +;; definition for method 3 of type player-controller +(defmethod inspect ((this player-controller)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tparams: #~%" (-> this params)) + (format #t "~2Ttarg-pos: #~%" (-> this targ-pos)) + (label cfg-4) + this + ) + +;; definition for method 32 of type player-controller +;; WARN: Return type mismatch nav-callback-info vs none. +(defmethod set-nav-params ((this player-controller)) + (when (or (not (-> this nav)) (zero? (-> this nav))) + (let ((a0-4 (find-nearest-nav-mesh (target-pos 0) (the-as float #x7f800000)))) + (if a0-4 + (add-process-drawable-to-nav-mesh a0-4 this #t) + ) + ) + ) + (when (-> this nav) + (set! (-> this nav flags) (nav-control-flag display-marks)) + (let ((v1-9 (-> this nav))) + (set! (-> v1-9 sphere-mask) (the-as uint 0)) + ) + 0 + (let ((v1-11 (-> this nav))) + (set! (-> v1-11 target-speed) 4096.0) + ) + 0 + (let ((v1-13 (-> this nav))) + (set! (-> v1-13 acceleration) 409600.0) + ) + 0 + (let ((v1-15 (-> this nav))) + (set! (-> v1-15 turning-acceleration) 40960000.0) + ) + 0 + (let ((v1-17 (-> this nav))) + (set! (-> v1-17 speed-scale) 1.0) + ) + 0 + (let ((v1-19 (-> this nav))) + (set! (-> v1-19 max-rotation-rate) 18204444.0) + ) + 0 + (set! (-> this nav callback-info) *default-nav-callback-info*) + ) + (none) + ) + +;; definition for function player-controller-init-by-other +;; INFO: Used lq/sq +(defbehavior player-controller-init-by-other player-controller ((arg0 player-controller-init-params)) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((v1-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set-vector! (-> v1-3 local-sphere) 0.0 0.0 0.0 0.01) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-3) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-6 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-6 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-6 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (set-params self arg0) + (go-virtual idle) + ) + +;; definition for method 34 of type player-controller +;; INFO: Used lq/sq +(defmethod set-params ((this player-controller) (arg0 player-controller-init-params)) + (mem-copy! (the-as pointer (-> this params)) (the-as pointer arg0) 40) + (set! (-> this targ-pos quad) (-> arg0 targ-pos quad)) + (case (-> arg0 mode) + (('active) + (if (not (and (-> this next-state) (= (-> this next-state name) 'active))) + (go (method-of-object this active)) + ) + ) + (('clip-to-nav-mesh) + (if (not (and (-> this next-state) (= (-> this next-state name) 'clip-to-nav-mesh))) + (go (method-of-object this clip-to-nav-mesh)) + ) + ) + (('lock) + (if (not (and (-> this next-state) (= (-> this next-state name) 'lock))) + (go (method-of-object this lock)) + ) + ) + (('idle) + (if (not (and (-> this next-state) (= (-> this next-state name) 'idle))) + (go (method-of-object this idle)) + ) + ) + ) + ) + +;; definition for method 33 of type player-controller +(defmethod set-nav-mesh ((this player-controller)) + (let ((a0-3 (find-nearest-nav-mesh (target-pos 0) (the-as float #x7f800000)))) + (if (and a0-3 (!= nav-mesh (-> this nav state mesh))) + (change-to a0-3 this) + ) + ) + (none) + ) + +;; definition for function player-controller-event-handler +(defbehavior player-controller-event-handler player-controller ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (event-handler self arg0 arg1 arg2 arg3) + ) + +;; definition for method 35 of type player-controller +;; INFO: Used lq/sq +(defmethod event-handler ((this player-controller) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('set-params) + (set-params this (the-as player-controller-init-params (-> arg3 param 0))) + ) + (('set-target) + (let ((v0-0 (the-as object (-> this targ-pos)))) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + ) + (('change-mode) + (set! (-> this params mode) (the-as symbol (-> arg3 param 0))) + (set-params this (-> this params)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (player-controller) + :virtual #t + :event player-controller-event-handler + :enter (behavior () + (remove-setting! 'player-control-override) + (remove-setting! 'player-control-mask) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate clip-to-nav-mesh (player-controller) + :virtual #t + :event player-controller-event-handler + :enter (behavior () + (set-nav-params self) + ) + :trans (behavior () + (if (not *target*) + (go empty-state) + ) + (set-nav-mesh self) + (when (and (-> self nav) (nonzero? (-> self nav))) + (when (and (logtest? (-> self params flags) (player-controller-flag pc1)) (-> self nav state mesh)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (if (nav-mesh-method-10 (-> self nav state mesh) gp-0 (target-pos 0) (the-as nav-poly #f)) + (set! (-> gp-0 y) (-> (target-pos 0) y)) + ) + (move-to-point! (-> *target* control) gp-0) + ) + ) + ) + (set! (-> self root trans quad) (-> (target-pos 0) quad)) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate lock (player-controller) + :virtual #t + :event player-controller-event-handler + :enter (behavior () + (when (logtest? (-> self params flags) (player-controller-flag lock-features)) + (set-setting! 'duck #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'darkjak #f 0.0 0) + (set-setting! 'jump #f 0.0 0) + ) + (when (logtest? (-> self params flags) (player-controller-flag letterbox)) + (set-setting! 'letterbox 'abs 1.0 0) + (set-setting! 'letterbox-speed 'abs 2.0 0) + ) + (set-setting! 'player-control-override #f 0.0 *target-controller-pad*) + (let ((t1-7 #x400fff4)) + (if (not (logtest? (-> self params flags) (player-controller-flag pc0))) + (set! t1-7 (logior #x8000000 t1-7)) + ) + (set-setting! 'player-control-mask #f 0.0 t1-7) + ) + (setup-control-pad *target-controller-pad*) + ) + :exit (behavior () + (when (logtest? (-> self params flags) (player-controller-flag lock-features)) + (remove-setting! 'duck) + (remove-setting! 'board) + (remove-setting! 'darkjak) + (remove-setting! 'jump) + ) + (remove-setting! 'player-control-override) + (remove-setting! 'player-control-mask) + (when (logtest? (-> self params flags) (player-controller-flag letterbox)) + (remove-setting! 'letterbox) + (set-setting! 'letterbox-speed 'abs 4.0 0) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate active (player-controller) + :virtual #t + :event player-controller-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (when (logtest? (-> self params flags) (player-controller-flag lock-features)) + (set-setting! 'duck #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'darkjak #f 0.0 0) + (set-setting! 'jump #f 0.0 0) + ) + (when (logtest? (-> self params flags) (player-controller-flag letterbox)) + (set-setting! 'letterbox 'abs 1.0 0) + (set-setting! 'letterbox-speed 'abs 2.0 0) + ) + (set-nav-params self) + (set-setting! 'player-control-override #f 0.0 *target-controller-pad*) + (let ((t1-7 #x400fff4)) + (if (not (logtest? (-> self params flags) (player-controller-flag pc0))) + (set! t1-7 (logior #x8000000 t1-7)) + ) + (set-setting! 'player-control-mask #f 0.0 t1-7) + ) + ) + :exit (behavior () + (when (logtest? (-> self params flags) (player-controller-flag lock-features)) + (remove-setting! 'duck) + (remove-setting! 'board) + (remove-setting! 'darkjak) + (remove-setting! 'jump) + ) + (remove-setting! 'player-control-override) + (remove-setting! 'player-control-mask) + (when (logtest? (-> self params flags) (player-controller-flag letterbox)) + (remove-setting! 'letterbox) + (set-setting! 'letterbox-speed 'abs 4.0 0) + ) + ) + :trans (behavior () + (if (not *target*) + (go empty-state) + ) + (if (or (not (-> self nav)) (zero? (-> self nav))) + (go-virtual idle) + ) + (set-nav-mesh self) + (when (and (logtest? (-> self params flags) (player-controller-flag pc1)) (-> self nav state mesh)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (if (nav-mesh-method-10 (-> self nav state mesh) gp-0 (target-pos 0) (the-as nav-poly #f)) + (set! (-> gp-0 y) (-> (target-pos 0) y)) + ) + (move-to-point! (-> *target* control) gp-0) + ) + ) + (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (set-virtual-cur-pos! (-> self nav state) (target-pos 0)) + (let ((a0-9 (-> self nav state)) + (v1-33 (-> self targ-pos)) + ) + (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-9 target-pos quad) (-> v1-33 quad)) + ) + 0 + (let ((gp-3 *target-controller-pad*)) + (let ((a1-7 (-> self nav state))) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> a1-7 velocity quad)) + ) + (let ((a0-12 (-> self nav state)) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-2 quad) (-> a0-12 heading quad)) + (let ((f30-0 (vector-vector-xz-distance (-> self root trans) (-> self targ-pos)))) + (let ((f28-0 1.0)) + (setup-control-pad gp-3) + (if (< f30-0 24576.0) + (set! f28-0 (lerp-scale 0.3 1.0 f30-0 4096.0 24576.0)) + ) + (set-pad-world-dir gp-3 s5-2 f28-0) + ) + (when (and (logtest? (-> self params flags) (player-controller-flag pc4)) + (or (and (>= 1024.0 (vector-length (get-transv *target*))) (< f30-0 12288.0)) + (and (< f30-0 14336.0) (focus-test? *target* board)) + ) + ) + (send-event (handle->process (-> self params notify-proc)) 'reached-destination) + (go-virtual idle) + ) + ) + ) + ) + ) + :code sleep-code + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control-h_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control-h_REF.gc index 1f94e1e64d..92d27f2dd7 100644 --- a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control-h_REF.gc @@ -13,6 +13,7 @@ (rand-burst-delay uint16) (rand-shot-delay uint16) ) + :allow-misaligned ) ;; definition for method 3 of type squad-unit-settings @@ -190,7 +191,7 @@ (set-sync-mask (_type_) none) (probe-backgnd-collision (_type_ vector vector) symbol) (squad-control-method-16 (_type_ vector process-focusable squad-target-status) none) - (squad-control-method-17 (_type_ vector int squad-target-status) none) + (squad-control-method-17 (_type_ vector int squad-target-status) squad-target-status) (squad-control-method-18 (_type_ int process) int) (set-alert-level0 (_type_ int) int) (start-alert (_type_ int) none) @@ -232,7 +233,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc index 6a5f15ac0b..332bbec8bd 100644 --- a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc @@ -85,10 +85,8 @@ ;; definition for method 17 of type squad-control ;; INFO: this function exists in multiple non-identical object files -;; WARN: Return type mismatch squad-target-status vs none. (defmethod squad-control-method-17 ((this squad-control) (arg0 vector) (arg1 int) (arg2 squad-target-status)) - (empty) - (none) + arg2 ) ;; definition for method 18 of type squad-control @@ -225,7 +223,6 @@ ;; definition for method 17 of type squad-control ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -;; WARN: Return type mismatch squad-target-status vs none. (defmethod squad-control-method-17 ((this squad-control) (arg0 vector) (arg1 int) (arg2 squad-target-status)) (logclear! (-> arg2 flags) (squad-target-flag visible-now updated)) (cond @@ -258,7 +255,7 @@ (logclear! (-> arg2 flags) (squad-target-flag updated)) ) ) - (none) + arg2 ) ;; definition for method 24 of type squad-control @@ -550,7 +547,3 @@ ) arg1 ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc b/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc index 3658a4749d..a2bf9122e2 100644 --- a/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc @@ -1061,7 +1061,7 @@ (set! (-> s4-0 vec0 quad) (-> gp-0 info start-sphere quad)) (set! (-> s4-0 vec1 quad) (-> gp-0 info start-dir quad)) (set-vector! (-> s4-0 vec2) (-> s4-0 vec1 z) 0.0 (- (-> s4-0 vec1 x)) 1.0) - (set! (-> s4-0 params object-type) (the-as uint 23)) + (set! (-> s4-0 params object-type) (traffic-type vehicle-task)) (set! (-> s4-0 params behavior) (the-as uint 10)) (set! (-> s4-0 params id) (the-as uint 0)) (set! (-> s4-0 params nav-mesh) #f) diff --git a/test/decompiler/reference/jak3/levels/desert/chase/desert-chase-path-h_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase-path-h_REF.gc new file mode 100644 index 0000000000..9f1f91d32c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase-path-h_REF.gc @@ -0,0 +1,57 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type deschase-node +(deftype deschase-node (structure) + ((position vector :inline) + (pos-x float :overlay-at (-> position data 0)) + (pos-y float :overlay-at (-> position data 1)) + (pos-z float :overlay-at (-> position data 2)) + (speed float) + (next-node int32) + ) + ) + +;; definition for method 3 of type deschase-node +(defmethod inspect ((this deschase-node)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'deschase-node) + (format #t "~1Tposition: ~`vector`P~%" (-> this position)) + (format #t "~1Tpos-x: ~f~%" (-> this position x)) + (format #t "~1Tpos-y: ~f~%" (-> this position y)) + (format #t "~1Tpos-z: ~f~%" (-> this position z)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Tnext-node: ~D~%" (-> this next-node)) + (label cfg-4) + this + ) + +;; definition of type deschase-path +(deftype deschase-path (structure) + ((node-count uint16) + (node (inline-array deschase-node)) + ) + ) + +;; definition for method 3 of type deschase-path +(defmethod inspect ((this deschase-path)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'deschase-path) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tnode: #x~X~%" (-> this node)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/chase/desert-chase-path_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase-path_REF.gc new file mode 100644 index 0000000000..265aec2866 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase-path_REF.gc @@ -0,0 +1,405 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *desert-chase-marauder-path*, type deschase-path +(define *desert-chase-marauder-path* (new 'static 'deschase-path + :node-count #x50 + :node (new 'static 'inline-array deschase-node 80 + (new 'static 'deschase-node + :position (new 'static 'vector :x 6171114.5 :y 103217.97 :z 12076113.0) + :next-node 1 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6141173.0 :y 103217.97 :z 12241058.0) + :next-node 2 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6059498.5 :y 103218.38 :z 12343621.0) + :next-node 3 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5903399.5 :y 102786.664 :z 12505987.0) + :next-node 4 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5838478.0 :y 102786.664 :z 12646603.0) + :next-node 5 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5839911.5 :y 102786.664 :z 12840671.0) + :next-node 6 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6069165.5 :y 103464.14 :z 13123214.0) + :next-node 7 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6374071.0 :y 86857.73 :z 13419518.0) + :speed 16384.0 + :next-node 8 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6720224.5 :y 75224.266 :z 13569636.0) + :speed 16384.0 + :next-node 9 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6943006.0 :y 75921.41 :z 13605888.0) + :speed 16384.0 + :next-node 10 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7613275.5 :y 88437.555 :z 13514831.0) + :speed 16384.0 + :next-node 46 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7988264.0 :y 123324.01 :z 12824860.0) + :speed 16384.0 + :next-node 49 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7684750.0 :y 118384.23 :z 13634518.0) + :speed 16384.0 + :next-node 11 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7455169.5 :y 256129.44 :z 14134966.0) + :speed 16384.0 + :next-node 12 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7416257.5 :y 313731.47 :z 14450318.0) + :speed 16384.0 + :next-node 13 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7498300.0 :y 354459.66 :z 14788360.0) + :speed 16384.0 + :next-node 14 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7917075.5 :y 386711.56 :z 15349595.0) + :speed 16384.0 + :next-node 15 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8342322.5 :y 353510.6 :z 15460104.0) + :speed 16384.0 + :next-node 16 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8977202.0 :y 195093.7 :z 15438396.0) + :speed 16384.0 + :next-node 17 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9379347.0 :y 135773.8 :z 15164537.0) + :speed 16384.0 + :next-node 18 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10063993.0 :y 113954.41 :z 13986404.0) + :speed 16384.0 + :next-node 19 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 11021801.0 :y 122775.96 :z 13413906.0) + :speed 16384.0 + :next-node 20 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 11887451.0 :y 145189.69 :z 12549733.0) + :speed 16384.0 + :next-node 21 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12038346.0 :y 113069.26 :z 12379257.0) + :speed 16384.0 + :next-node 22 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12423616.0 :y 84316.98 :z 11828837.0) + :speed 16384.0 + :next-node 23 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12771489.0 :y 94443.11 :z 11096636.0) + :speed 16384.0 + :next-node 24 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12922099.0 :y 103745.945 :z 10752408.0) + :speed 16384.0 + :next-node 25 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 13012048.0 :y 141570.05 :z 10469743.0) + :speed 16384.0 + :next-node 26 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12894616.0 :y 205741.67 :z 10160208.0) + :speed 16384.0 + :next-node 27 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 12469902.0 :y 234573.0 :z 9697606.0) + :speed 16384.0 + :next-node 28 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 11993947.0 :y 215212.44 :z 9265642.0) + :speed 16384.0 + :next-node 29 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10752613.0 :y 241458.38 :z 8241232.5) + :speed 16384.0 + :next-node 30 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10284317.0 :y 143553.33 :z 8058715.5) + :speed 16384.0 + :next-node 31 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9675201.0 :y 96550.914 :z 7868661.0) + :speed 16384.0 + :next-node 32 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9172049.0 :y 76422.35 :z 7427072.0) + :speed 16384.0 + :next-node 33 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8758926.0 :y 76116.375 :z 7317011.5) + :speed 16384.0 + :next-node 34 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8286903.0 :y 103902.414 :z 7306034.5) + :speed 16384.0 + :next-node 35 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8020868.5 :y 113698.81 :z 7419042.5) + :speed 16384.0 + :next-node 36 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7885331.5 :y 99130.164 :z 7650753.5) + :speed 16384.0 + :next-node 37 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7909866.5 :y 90708.79 :z 7933623.0) + :speed 16384.0 + :next-node 38 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8152350.0 :y 105081.65 :z 8582020.0) + :speed 16384.0 + :next-node 39 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8096480.5 :y 100046.44 :z 8786164.0) + :speed 16384.0 + :next-node 40 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7948778.5 :y 77104.74 :z 9512836.0) + :speed 16384.0 + :next-node 41 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8007351.0 :y 108013.16 :z 11117115.0) + :speed 16384.0 + :next-node 42 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8041552.5 :y 119379.97 :z 11799223.0) + :speed 16384.0 + :next-node 43 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 8063835.5 :y 136027.75 :z 12527368.0) + :speed 16384.0 + :next-node 44 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7909497.5 :y 107760.02 :z 13230446.0) + :speed 16384.0 + :next-node 45 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6165913.0 :y 103217.97 :z 12276119.0) + :next-node 2 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6322503.0 :y 103217.97 :z 12247120.0) + :next-node 47 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7984496.0 :y 93854.516 :z 12095731.0) + :speed 16384.0 + :next-node 50 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7725546.5 :y 86930.64 :z 11389131.0) + :speed 16384.0 + :next-node 51 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7518903.0 :y 116947.766 :z 11047893.0) + :speed 16384.0 + :next-node 52 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7138466.5 :y 80252.516 :z 10817412.0) + :speed 16384.0 + :next-node 53 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6200237.5 :y 66664.445 :z 10777680.0) + :speed 16384.0 + :next-node 54 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5747260.0 :y 117487.62 :z 10399497.0) + :speed 16384.0 + :next-node 55 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5785680.5 :y 163153.1 :z 9988258.0) + :speed 16384.0 + :next-node 56 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5827542.0 :y 261514.86 :z 9435216.0) + :speed 16384.0 + :next-node 57 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5842902.0 :y 232043.31 :z 8828804.0) + :speed 16384.0 + :next-node 58 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5784656.5 :y 136654.03 :z 8382217.5) + :speed 16384.0 + :next-node 59 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5735669.0 :y 67932.98 :z 7747624.0) + :speed 16384.0 + :next-node 60 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5490727.5 :y 121842.484 :z 6632487.5) + :speed 16384.0 + :next-node 61 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 4772208.0 :y 156765.39 :z 5116804.5) + :speed 16384.0 + :next-node 62 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 4786585.0 :y 129592.12 :z 4529806.0) + :speed 16384.0 + :next-node 63 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 4915854.0 :y 197361.66 :z 4256848.5) + :speed 16384.0 + :next-node 64 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 4963655.0 :y 322608.75 :z 3686715.0) + :speed 16384.0 + :next-node 65 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5249351.0 :y 222091.27 :z 3068501.5) + :speed 16384.0 + :next-node 66 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5421096.0 :y 256218.72 :z 2950384.8) + :speed 16384.0 + :next-node 67 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 5889760.5 :y 222968.62 :z 2912116.0) + :speed 16384.0 + :next-node 68 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6202695.0 :y 216614.1 :z 2909986.5) + :speed 16384.0 + :next-node 69 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 6728703.0 :y 99570.89 :z 2910437.0) + :speed 16384.0 + :next-node 70 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 7674018.5 :y 135836.88 :z 2834030.2) + :speed 16384.0 + :next-node 71 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9490594.0 :y 109878.88 :z 2894662.8) + :speed 16384.0 + :next-node 72 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 9915309.0 :y 117802.6 :z 3004206.8) + :speed 16384.0 + :next-node 73 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10371153.0 :y 194768.08 :z 3505172.0) + :speed 16384.0 + :next-node 74 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10298244.0 :y 251813.89 :z 4208885.0) + :speed 16384.0 + :next-node 75 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10299923.0 :y 206769.36 :z 5070847.0) + :speed 16384.0 + :next-node 76 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10347109.0 :y 46356.89 :z 6077808.0) + :speed 16384.0 + :next-node 77 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10499480.0 :y 88315.49 :z 6486834.5) + :speed 16384.0 + :next-node 78 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 10827815.0 :y 136688.03 :z 7431986.5) + :speed 16384.0 + :next-node 79 + ) + (new 'static 'deschase-node + :position (new 'static 'vector :x 11062516.0 :y 238765.27 :z 7961599.0) + :speed 16384.0 + :next-node 30 + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc new file mode 100644 index 0000000000..dfb06392e7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc @@ -0,0 +1,2137 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type deschase-point +(deftype deschase-point (structure) + ((pos vector :inline) + (quat quaternion :inline) + (i-node int8 :overlay-at (-> pos data 3)) + ) + ) + +;; definition for method 3 of type deschase-point +(defmethod inspect ((this deschase-point)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'deschase-point) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Ti-node: ~D~%" (-> this i-node)) + (label cfg-4) + this + ) + +;; definition for symbol *stronghold-inside-point*, type vector +(define *stronghold-inside-point* (new 'static 'vector :x 6253938.5 :y 99123.2 :z 12145754.0 :w 1.0)) + +;; definition for symbol *stronghold-vehicle-stop-point*, type vector +(define *stronghold-vehicle-stop-point* (new 'static 'vector :x 6413203.5 :y 103606.27 :z 12111851.0 :w 1.0)) + +;; definition for symbol *stronghold-player-goto-point*, type vector +(define *stronghold-player-goto-point* (new 'static 'vector :x 6321789.5 :y 99123.2 :z 12098191.0 :w 1.0)) + +;; definition for symbol *stronghold-marauder-start*, type (array deschase-point) +(define *stronghold-marauder-start* (new 'static 'boxed-array :type deschase-point + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6207577.5 :y 159539.2 :z 11966325.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0002 :y -0.1364 :w -0.9906) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6395575.0 :y 159329.08 :z 12035728.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3977 :w 0.9174) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6444253.0 :y 159329.08 :z 12226157.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7455 :w -0.6664) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6297671.5 :y 158481.2 :z 12361336.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9791 :w 0.2032) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6063449.5 :y 159329.08 :z 12111502.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.5197 :w 0.8543) + ) + ) + ) + +;; definition for symbol *deschase-catapult-spawn-point*, type (array deschase-point) +(define *deschase-catapult-spawn-point* + (new 'static 'boxed-array :type deschase-point + (new 'static 'deschase-point + :pos (new 'static 'vector :x 5243015.0 :y 196608.0 :z 11060786.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.3797 :w 0.925) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 5784936.5 :y 84433.305 :z 10807021.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.1997 :w 0.9798) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6550656.5 :y 69453.82 :z 10759278.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.0015 :w 0.9999) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 7493730.0 :y 122130.84 :z 10950285.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3666 :w 0.9303) + ) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-catapult-embers-fire + :id 454 + :flags (sp0 sp1 sp4) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1806 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1806 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:x (meters -0.25) (meters 0.25)) + (:y (meters -0.25)) + (:z (meters -0.25) (meters 0.25)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 40.0) + (:b -64.0 4.0 32.0) + (:a 128.0 128.0) + (:scalevel-x (meters -0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters 0.0016666667) (meters 0.0016666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition of type v-catapult-shot-embers +(deftype v-catapult-shot-embers (metalhead-grenade-shot) + ((ptracker-proc handle) + ) + ) + +;; definition for method 3 of type v-catapult-shot-embers +(defmethod inspect ((this v-catapult-shot-embers)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type metalhead-grenade-shot inspect))) + (t9-0 this) + ) + (format #t "~2Tptracker-proc: ~D~%" (-> this ptracker-proc)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate impact (v-catapult-shot-embers) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'touched) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (send-event (handle->process (-> self ptracker-proc)) 'draw #f) + (projectile-event-handler proc argc message block) + ) + (else + (projectile-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (suspend) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> self root) a1-0) + ) + (suspend) + ) + ) + (let ((v1-10 (-> self root root-prim))) + (set! (-> v1-10 prim-core collide-as) (collide-spec)) + (set! (-> v1-10 prim-core collide-with) (collide-spec)) + ) + 0 + (while (-> self child) + (suspend) + ) + (deactivate self) + ) + ) + +;; definition for method 25 of type v-catapult-shot-embers +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this v-catapult-shot-embers)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) + ) + 0 + (none) + ) + +;; definition for method 26 of type v-catapult-shot-embers +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this v-catapult-shot-embers)) + (set! (-> this ptracker-proc) + (process->handle + (-> (cond + ((logtest? (-> *part-group-id-table* 454 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn + part-tracker-subsampler + :to this + :group (-> *part-group-id-table* 454) + :duration (seconds 3) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 454) :duration (seconds 3)) + ) + ) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 40 of type v-catapult-shot-embers +(defmethod projectile-method-40 ((this v-catapult-shot-embers)) + 512 + ) + +;; definition for method 31 of type v-catapult-shot-embers +;; WARN: Return type mismatch symbol vs none. +(defmethod init-proj-settings! ((this v-catapult-shot-embers)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this blast-radius) 4096.0) + (set! (-> this max-speed) 135168.0) + (set! (-> this update-velocity) projectile-update-velocity-add-gravity) + (set! (-> this move) gren-canister-move) + (set! (-> this root dynam gravity y) 102400.0) + (set! (-> this root dynam gravity-length) 102400.0) + (set! (-> this root dynam gravity-max) 102400.0) + (let ((f0-5 1092.2667)) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-5) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 454) this)) + (set! (-> this ptracker-proc) (the-as handle #f)) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-catapult-target-glow + :id 455 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1807 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 1807 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 40.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-catapult-target-scorched-earth + :id 456 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1808 :flags (is-3d sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 1808 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:y (meters 0.1)) + (:z (meters 8)) + (:scale-x (meters 1) (meters 2)) + (:scale-y (meters 5) (meters 5)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 0.85333335 0.85333335) + (:timer (seconds 3)) + (:flags (left-multiply-quat)) + (:next-time (seconds 0.25)) + (:next-launcher 1809) + (:rotate-y (degrees 0) (degrees 36000)) + ) + ) + +;; failed to figure out what this is: +(defpart 1809 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.75)) (:next-launcher 1810)) + ) + +;; failed to figure out what this is: +(defpart 1810 + :init-specs ((:fade-a -0.21333334)) + ) + +;; definition of type catapult-target +(deftype catapult-target (process-drawable) + ((alpha float) + ) + (:state-methods + idle + ) + (:methods + (catapult-target-method-21 (_type_) none) + ) + ) + +;; definition for method 3 of type catapult-target +(defmethod inspect ((this catapult-target)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Talpha: ~f~%" (-> this alpha)) + (label cfg-4) + this + ) + +;; definition for function catapult-target-handler +;; INFO: Used lq/sq +(defbehavior catapult-target-handler catapult-target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-1 object)) + (case arg2 + (('update) + (let ((f0-1 (- (-> (the-as vector (-> arg3 param 0)) y) (-> self root trans y)))) + (set! (-> self alpha) (lerp-scale 128.0 0.0 f0-1 0.0 614400.0)) + ) + 0 + ) + (('on) + (set! v0-1 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-1)) + v0-1 + ) + (('off) + (set! v0-1 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-1)) + v0-1 + ) + (('die) + (activate! *camera-smush-control* 2048.0 30 150 1.0 0.8 (-> *display* camera-clock)) + (cond + ((logtest? (-> *part-group-id-table* 456 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 456)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 456)) + ) + ) + (let ((gp-2 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat))) + (s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (quaternion-rotate-y! gp-2 gp-2 (* 182.04445 (the float (rand-vu-int-count 90)))) + (dotimes (s3-1 4) + (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (quaternion-rotate-y! gp-2 gp-2 16384.0) + (quaternion-rotate-local-x! s5-0 gp-2 -12743.111) + (vector-z-quaternion! s4-0 gp-2) + (vector-normalize! s4-0 40960.0) + (vector+! s4-0 s4-0 (-> self root trans)) + (set! (-> s2-1 ent) (-> self entity)) + (set! (-> s2-1 charge) 1.0) + (set! (-> s2-1 options) (projectile-options)) + (logclear! (-> s2-1 options) (projectile-options po14 po15 po16)) + (set! (-> s2-1 pos quad) + (-> (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) quad) + ) + (set! (-> s2-1 notify-handle) (the-as handle #f)) + (set! (-> s2-1 owner-handle) (the-as handle #f)) + (set! (-> s2-1 target-handle) (the-as handle #f)) + (set! (-> s2-1 target-pos quad) (the-as uint128 0)) + (set! (-> s2-1 ignore-handle) (process->handle self)) + (let* ((v1-55 *game-info*) + (a0-42 (+ (-> v1-55 attack-id) 1)) + ) + (set! (-> v1-55 attack-id) a0-42) + (set! (-> s2-1 attack-id) a0-42) + ) + (set! (-> s2-1 timeout) (seconds 5)) + (set! (-> s2-1 damage) 1.0) + (logior! (-> s2-1 options) (projectile-options po14)) + (vector-normalize-copy! (-> s2-1 vel) (vector-z-quaternion! s4-0 s5-0) 81920.0) + (spawn-projectile v-catapult-shot-embers s2-1 (-> self parent 0) *default-dead-pool*) + ) + ) + ) + (go empty-state) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (catapult-target) + :virtual #t + :event catapult-target-handler + :trans (behavior () + (catapult-target-method-21 self) + ) + :code sleep-code + ) + +;; definition for method 21 of type catapult-target +;; WARN: Return type mismatch object vs none. +(defmethod catapult-target-method-21 ((this catapult-target)) + (set! (-> *part-id-table* 1807 init-specs 2 initial-valuef) + (lerp-scale 20480.0 32768.0 (- (-> (math-camera-pos) y) (-> this root trans y)) 12288.0 49152.0) + ) + (set! (-> *part-id-table* 1807 init-specs 8 initial-valuef) (-> this alpha)) + (spawn (-> this part) (-> this root trans)) + (none) + ) + +;; definition for function catapult-target-init-by-other +;; INFO: Used lq/sq +(defbehavior catapult-target-init-by-other catapult-target ((arg0 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 455) self)) + (go-virtual idle) + ) + +;; definition of type deschase-vehicle +(deftype deschase-vehicle (structure) + ((handle handle) + (wait-timer time-frame) + (shot-fired? symbol) + ) + :allow-misaligned + ) + +;; definition for method 3 of type deschase-vehicle +(defmethod inspect ((this deschase-vehicle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'deschase-vehicle) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Twait-timer: ~D~%" (-> this wait-timer)) + (format #t "~1Tshot-fired?: ~A~%" (-> this shot-fired?)) + (label cfg-4) + this + ) + +;; definition of type desert-chase-ambush-manager +(deftype desert-chase-ambush-manager (task-manager) + ((marauder-nav-mesh nav-mesh) + (marauder handle 5) + (m-free-list (array uint8)) + (marauder-count uint8) + (total-spawned uint8) + (check-timer time-frame) + (marauder-entity entity-actor) + (h-player-controller handle) + (player-moved? symbol) + (vehicle-nav-mesh nav-mesh) + (vehicle deschase-vehicle 4 :inline) + (vehicle-count uint8) + (v-free-list (array uint8)) + (total-veh-spawned uint8) + (target-point vector 4 :inline) + (last-shot-time time-frame) + ) + (:methods + (spawn-marauder (_type_ deschase-point) none) + (spawn-v-catapult (_type_ int) handle) + (fire-catapult-shot (_type_ vector vector) none) + (desert-chase-ambush-manager-method-35 (_type_ int) none) + ) + ) + +;; definition for method 3 of type desert-chase-ambush-manager +(defmethod inspect ((this desert-chase-ambush-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tmarauder-nav-mesh: ~A~%" (-> this marauder-nav-mesh)) + (format #t "~2Tmarauder[5] @ #x~X~%" (-> this marauder)) + (format #t "~2Tm-free-list: ~A~%" (-> this m-free-list)) + (format #t "~2Tmarauder-count: ~D~%" (-> this marauder-count)) + (format #t "~2Ttotal-spawned: ~D~%" (-> this total-spawned)) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (format #t "~2Tmarauder-entity: ~A~%" (-> this marauder-entity)) + (format #t "~2Th-player-controller: ~D~%" (-> this h-player-controller)) + (format #t "~2Tplayer-moved?: ~A~%" (-> this player-moved?)) + (format #t "~2Tvehicle-nav-mesh: ~A~%" (-> this vehicle-nav-mesh)) + (format #t "~2Tvehicle[4] @ #x~X~%" (-> this vehicle)) + (format #t "~2Tvehicle-count: ~D~%" (-> this vehicle-count)) + (format #t "~2Tv-free-list: ~A~%" (-> this v-free-list)) + (format #t "~2Ttotal-veh-spawned: ~D~%" (-> this total-veh-spawned)) + (format #t "~2Ttarget-point[4] @ #x~X~%" (-> this target-point)) + (format #t "~2Tlast-shot-time: ~D~%" (-> this last-shot-time)) + (label cfg-4) + this + ) + +;; definition for function desert-chase-ambush-intro-sequence +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +;; WARN: Return type mismatch int vs none. +(defbehavior desert-chase-ambush-intro-sequence desert-chase-ambush-manager () + (local-vars + (a0-4 process) + (a1-0 event-message-block) + (t9-2 (function process-tree event-message-block object)) + ) + (was-squad-manager-start self) + (let ((v1-0 *was-squad-control*)) + (set! (-> v1-0 target-count) 3) + (set! (-> v1-0 reserve-count) 40) + ) + (label cfg-1) + (let ((gp-0 (entity-by-name "des-draw-bridge-1"))) + (when (not gp-0) + (suspend) + (goto cfg-1) + ) + (set! (-> *was-squad-control* target-count) 0) + (until (t9-2 a0-4 a1-0) + (suspend) + (set! 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) 'down?) + (set! t9-2 send-event-function) + (let ((v1-6 gp-0)) + (set! a0-4 (if v1-6 + (-> v1-6 extra process) + ) + ) + ) + ) + ) + (was-squad-manager-kill) + (set-setting! 'extra-bank '((desert1 strong1) (desert2 desert5)) 0.0 0) + (while (< 184320.0 (vector-vector-distance *stronghold-inside-point* (target-pos 0))) + (suspend) + ) + (set-setting! 'music 'chasmara 0.0 0) + (dotimes (gp-2 4) + (spawn-v-catapult self gp-2) + ) + (suspend) + (dotimes (gp-3 4) + (let* ((s4-0 (handle->process (-> self vehicle gp-3 handle))) + (s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s5-1 + (send-event s5-1 'ai-ignore-nav-mesh) + (send-event s5-1 'ai-set-mode 0) + (send-event s5-1 'ai-set-target-speed 0) + ) + ) + ) + (when (and *target* (focus-test? *target* pilot-riding) (handle->process (-> *target* pilot vehicle))) + (-> self player-vehicle) + (set-setting! 'letterbox 'abs 1.0 0) + (set-setting! 'letterbox-speed 'abs 2.0 0) + (set-setting! 'entity-name "camera-394" 0.0 0) + (sound-play "camera-pan-1" :position #f) + (let ((gp-5 (-> *target* pilot vehicle))) + (send-event (handle->process gp-5) 'ignore-damage #t) + (send-event (handle->process gp-5) 'ignore-impulse #t) + (send-event (handle->process gp-5) 'set-control-hook-ai) + (send-event (handle->process gp-5) 'ai-ignore-nav-mesh #t) + (send-event (handle->process gp-5) 'ai-set-target-speed 122880.0) + (send-event (handle->process gp-5) 'ai-set-target-position *stronghold-vehicle-stop-point*) + ) + (while (let ((f0-1 81920.0)) + (< (* f0-1 f0-1) (vector-vector-distance-squared (target-pos 0) *stronghold-vehicle-stop-point*)) + ) + (suspend) + ) + (process-spawn + simple-nav-sphere + 40960.0 + *stronghold-vehicle-stop-point* + (-> self marauder-nav-mesh) + -1 + :name "simple-nav-sphere" + :to self + ) + (set-setting! 'stop-vehicle? #t 0.0 0) + (send-event *target* 'change-mode 'normal) + (set-setting! 'pilot #f 0.0 0) + ) + (send-event *vehicle-manager* 'no-extra-bank) + (set-setting! 'extra-bank '((wasall1 strong2) (desert1 strong1) (desert2 desert5)) 0.0 0) + (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) + (set! (-> *display* force-sync) (the-as uint 240)) + (sound-play "camera-pan-2" :position #f) + (set-setting! 'entity-name "camera-399" 0.0 0) + (let ((v1-137 (-> self vehicle 3 handle process))) + (set-setting! 'sound-ear v1-137 0.0 (-> v1-137 0 pid)) + ) + (let ((gp-9 (current-time))) + (until (time-elapsed? gp-9 (seconds 1.5)) + (suspend) + ) + ) + (desert-chase-ambush-manager-method-35 self 3) + (let ((gp-10 (current-time))) + (until (time-elapsed? gp-10 (seconds 1)) + (suspend) + ) + ) + (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) + (set! (-> *display* force-sync) (the-as uint 240)) + (sound-play "camera-pan-3" :position #f) + (let ((v1-157 (-> self vehicle 2 handle process))) + (set-setting! 'sound-ear v1-157 0.0 (-> v1-157 0 pid)) + ) + (set-setting! 'entity-name "camera-400" 0.0 0) + (let ((gp-12 (current-time))) + (until (time-elapsed? gp-12 (seconds 1.5)) + (suspend) + ) + ) + (desert-chase-ambush-manager-method-35 self 2) + (let ((gp-13 (current-time))) + (until (time-elapsed? gp-13 (seconds 1)) + (suspend) + ) + ) + (desert-chase-ambush-manager-method-35 self 1) + (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) + (set! (-> *display* force-sync) (the-as uint 240)) + (sound-play "camera-pan-4" :position #f) + (let ((v1-181 (-> self vehicle 0 handle process))) + (set-setting! 'sound-ear v1-181 0.0 (-> v1-181 0 pid)) + ) + (set-setting! 'entity-name "camera-402" 0.0 0) + (let ((gp-15 (current-time))) + (until (time-elapsed? gp-15 (seconds 1.5)) + (suspend) + ) + ) + (desert-chase-ambush-manager-method-35 self 0) + (let ((gp-16 (current-time))) + (until (time-elapsed? gp-16 (seconds 1)) + (suspend) + ) + ) + (remove-setting! 'sound-ear) + (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) + (set! (-> *display* force-sync) (the-as uint 240)) + (sound-play "camera-pan-5" :position #f) + (set-setting! 'entity-name "camera-394" 0.0 0) + (remove-setting! 'letterbox) + (set-blackout-frames 0) + (until (process-release? *target*) + (suspend) + ) + (when *target* + (logior! (-> *target* focus-status) (focus-status teleporting)) + (process-drawable-show-all-cloth *target* #f) + (logior! (-> *target* draw status) (draw-control-status no-draw)) + (let ((gp-18 (get-continue-by-name *game-info* "desertf-stronghold-start"))) + (move-to-point! (-> *target* control) (-> gp-18 trans)) + (let ((t9-64 quaternion-copy!) + (a0-97 (-> *target* control quat-for-control)) + (a1-57 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> a1-57 x) (* 0.00003051851 (the float (-> gp-18 quat x)))) + (set! (-> a1-57 y) (* 0.00003051851 (the float (-> gp-18 quat y)))) + (set! (-> a1-57 z) (* 0.00003051851 (the float (-> gp-18 quat z)))) + (set! (-> a1-57 w) (* 0.00003051851 (the float (-> gp-18 quat w)))) + (t9-64 a0-97 a1-57) + ) + ) + (rot->dir-targ! (-> *target* control)) + ) + (suspend) + (when *target* + (process-drawable-show-all-cloth *target* #t) + (logclear! (-> *target* draw status) (draw-control-status no-draw)) + ) + (suspend) + (if *target* + (logclear! (-> *target* focus-status) (focus-status teleporting)) + ) + (let ((gp-19 (current-time))) + (until (time-elapsed? gp-19 (seconds 2.5)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (dotimes (gp-20 4) + (let ((s5-7 (-> self vehicle gp-20)) + (v1-253 (-> self vehicle gp-20 handle)) + ) + (when (!= v1-253 #f) + (let ((a0-110 (handle->process v1-253))) + (when a0-110 + (send-event a0-110 'go-die) + (set! (-> s5-7 handle) (the-as handle #f)) + (+! (-> self vehicle-count) -1) + (let ((s5-8 (-> self v-free-list))) + (set! (-> s5-8 (length s5-8)) (the-as uint gp-20)) + (+! (-> s5-8 length) 1) + ) + ) + ) + ) + ) + ) + (task-node-close! (game-task-node desert-chase-marauders-get-to-stronghold) 'event) + (none) + ) + +;; failed to figure out what this is: +(defstate active (desert-chase-ambush-manager) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reached-destination) + (set! (-> self player-moved?) #t) + (send-event proc 'change-mode 'lock) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + ) + +;; definition for method 34 of type desert-chase-ambush-manager +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod fire-catapult-shot ((this desert-chase-ambush-manager) (arg0 vector) (arg1 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-5 (ppointer->handle (process-spawn catapult-target arg1 :name "catapult-target" :to this)))) + (set! (-> gp-0 ent) (-> this entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> arg0 quad)) + (set! (-> gp-0 notify-handle) (process->handle this)) + (set! (-> gp-0 owner-handle) (process->handle this)) + (set! (-> gp-0 target-handle) (ppointer->handle (.asm.sllv.r0 (the-as handle v1-5)))) + ) + (set! (-> gp-0 target-pos quad) (-> arg1 quad)) + (set! (-> gp-0 ignore-handle) (process->handle this)) + (let* ((v1-13 *game-info*) + (a0-27 (+ (-> v1-13 attack-id) 1)) + ) + (set! (-> v1-13 attack-id) a0-27) + (set! (-> gp-0 attack-id) a0-27) + ) + (set! (-> gp-0 timeout) (seconds 10)) + (set! (-> gp-0 damage) 4.0) + (logior! (-> gp-0 options) (projectile-options po14)) + (spawn-projectile v-catapult-shot gp-0 this *default-dead-pool*) + ) + 0 + (none) + ) + +;; definition for method 26 of type desert-chase-ambush-manager +(defmethod task-manager-method-26 ((this desert-chase-ambush-manager)) + (dotimes (s5-0 5) + (let ((v1-2 (-> this marauder s5-0))) + (when (!= v1-2 #f) + (let ((s4-0 (handle->process v1-2))) + (cond + ((if (type? s4-0 process-focusable) + s4-0 + ) + ) + (else + (set! (-> this marauder s5-0) (the-as handle #f)) + (+! (-> this marauder-count) -1) + (let ((s4-1 (-> this m-free-list))) + (set! (-> s4-1 (length s4-1)) (the-as uint s5-0)) + (+! (-> s4-1 length) 1) + ) + ) + ) + ) + ) + ) + ) + ((method-of-type task-manager task-manager-method-26) this) + (none) + ) + +;; definition for method 35 of type desert-chase-ambush-manager +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod desert-chase-ambush-manager-method-35 ((this desert-chase-ambush-manager) (arg0 int)) + (let* ((gp-0 (-> this vehicle arg0)) + (v1-2 (-> gp-0 handle)) + ) + (when (!= v1-2 #f) + (let* ((s2-0 (handle->process v1-2)) + (s4-0 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when s4-0 + (let ((s3-1 (-> this target-point arg0))) + (set! (-> s3-1 quad) (-> *stronghold-inside-point* quad)) + (+! (-> s3-1 x) (rand-vu-float-range -122880.0 122880.0)) + (+! (-> s3-1 z) (rand-vu-float-range -122880.0 122880.0)) + (send-event s4-0 'launch s3-1 this) + ) + (set! (-> gp-0 shot-fired?) #t) + (set-time! (-> gp-0 wait-timer)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 32 of type desert-chase-ambush-manager +;; INFO: Used lq/sq +;; WARN: Return type mismatch connection-minimap vs none. +(defmethod spawn-marauder ((this desert-chase-ambush-manager) (arg0 deschase-point)) + (let ((s5-0 (-> this m-free-list))) + (when (nonzero? (length s5-0)) + (let ((s4-0 (-> s5-0 (+ (length s5-0) -1))) + (s3-0 43) + (f30-0 10.0) + ) + (when (and *target* (and (>= 5.0 (-> *target* fact health)) (rand-vu-percent? 0.6))) + (set! s3-0 20) + (set! f30-0 2.0) + ) + (let ((s1-0 (new 'stack-no-clear 'marauder-init-by-other-params))) + (set! (-> s1-0 trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> s1-0 quat) (-> arg0 quat)) + (set! (-> s1-0 entity) (-> this marauder-entity)) + (set! (-> s1-0 directed?) #f) + (set! (-> s1-0 no-initial-move-to-ground?) #t) + (set! (-> s1-0 multi-focus) #f) + (set! (-> s1-0 skip-jump) #f) + (let ((s2-2 (ppointer->process (process-spawn marauder this s1-0 :name "marauder" :to this)))) + (when s2-2 + (change-to (-> this marauder-nav-mesh) (the-as process-drawable s2-2)) + (let ((v1-26 (-> (the-as marauder s2-2) nav state))) + (set! (-> v1-26 current-poly) (the-as nav-poly #f)) + ) + 0 + (reset-to-collide-spec + (-> (the-as marauder s2-2) focus) + (collide-spec jak bot hit-by-others-list player-list jak-vehicle) + ) + (set! (-> (the-as marauder s2-2) fact pickup-type) (the-as pickup-type s3-0)) + (set! (-> (the-as marauder s2-2) fact pickup-amount) f30-0) + (set! (-> (the-as marauder s2-2) gun?) #f) + (set! (-> this marauder s4-0) (process->handle (the-as marauder s2-2))) + (+! (-> this marauder-count) 1) + (+! (-> s5-0 length) -1) + (+! (-> this total-spawned) 1) + (add-icon! *minimap* (the-as marauder s2-2) (the-as uint 117) (the-as int #f) (the-as vector #t) 0) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 33 of type desert-chase-ambush-manager +;; INFO: Used lq/sq +(defmethod spawn-v-catapult ((this desert-chase-ambush-manager) (arg0 int)) + (let ((gp-0 (-> this v-free-list))) + (when (nonzero? (length gp-0)) + (let ((s4-0 (-> this vehicle (-> gp-0 (+ (length gp-0) -1)))) + (s3-1 (-> *deschase-catapult-spawn-point* arg0)) + (s2-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0)) + ) + (vector-z-quaternion! (-> s2-0 vec) (-> s3-1 quat)) + (vector-float*! (-> s2-0 vec) (-> s2-0 vec) 0.0) + (set! (-> s2-0 params object-type) (traffic-type guard-a)) + (set! (-> s2-0 params behavior) (the-as uint 3)) + (set! (-> s2-0 params id) (the-as uint 0)) + (set! (-> s2-0 params nav-mesh) #f) + (set! (-> s2-0 params nav-branch) #f) + (set! (-> s2-0 params proc) #f) + (set! (-> s2-0 params handle) (the-as handle #f)) + (set! (-> s2-0 params user-data) (the-as uint 0)) + (set! (-> s2-0 params flags) (traffic-spawn-flags tsf6)) + (set! (-> s2-0 params guard-type) (the-as uint 11)) + (set! (-> s2-0 params entity) #f) + (set! (-> s2-0 params velocity quad) (-> s2-0 vec quad)) + (set! (-> s2-0 params position quad) (-> s3-1 pos quad)) + (quaternion-copy! (-> s2-0 params rotation) (-> s3-1 quat)) + (let ((a0-12 (vehicle-spawn (vehicle-type v-catapult) (-> s2-0 params)))) + (when a0-12 + (set! (-> s4-0 handle) (process->handle a0-12)) + (set! (-> s4-0 wait-timer) (the-as time-frame (+ (- 900 (the int (* 1500.0 (rand-vu)))) (current-time)))) + (+! (-> this vehicle-count) 1) + (+! (-> this total-veh-spawned) 1) + (+! (-> gp-0 length) -1) + (return (-> s4-0 handle)) + ) + ) + ) + ) + ) + (the-as handle #f) + ) + +;; definition for method 25 of type desert-chase-ambush-manager +(defmethod task-manager-method-25 ((this desert-chase-ambush-manager)) + (send-event (handle->process (-> this player-vehicle)) 'ignore-damage #f) + (send-event (handle->process (-> this player-vehicle)) 'ignore-impulse #f) + (let ((t9-2 (method-of-type task-manager task-manager-method-25))) + (t9-2 this) + ) + (set! (-> *marauder-nav-enemy-info* attack-damage) 2) + (let ((a0-14 (handle->process (-> this h-player-controller)))) + (if a0-14 + (deactivate a0-14) + ) + ) + (none) + ) + +;; definition for method 20 of type desert-chase-ambush-manager +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this desert-chase-ambush-manager)) + (let ((t9-0 (method-of-type task-manager init!))) + (t9-0 this) + ) + (set! (-> this h-player-controller) (the-as handle #f)) + (none) + ) + +;; definition for method 21 of type desert-chase-ambush-manager +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this desert-chase-ambush-manager)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'extra-bank '((desert2 desert5) (desert3 desert6)) 0.0 0) + (set! (-> this marauder-nav-mesh) (get-nav-mesh (the-as actor-id #xf064))) + (set! (-> this m-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 5)) + (dotimes (v1-4 5) + (set! (-> this marauder v1-4) (the-as handle #f)) + (set! (-> this m-free-list v1-4) (the-as uint v1-4)) + ) + (set! (-> this m-free-list length) 5) + (set! (-> this marauder-entity) (the-as entity-actor (entity-by-name "marauder-3"))) + (set! (-> *marauder-nav-enemy-info* attack-damage) 1) + (set! (-> this marauder-nav-mesh) (get-nav-mesh (the-as actor-id #xf064))) + (set! (-> this v-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 4)) + (dotimes (v1-10 4) + (set! (-> this vehicle v1-10 handle) (the-as handle #f)) + (set! (-> this vehicle v1-10 shot-fired?) #f) + (set! (-> this v-free-list v1-10) (the-as uint v1-10)) + ) + (set! (-> this v-free-list length) 4) + (set! (-> this player-moved?) #f) + (none) + ) + +;; definition of type deschase-artifact +(deftype deschase-artifact (process-drawable) + ((arrow handle) + (pos vector :inline) + (angs vector :inline) + ) + (:state-methods + idle + ) + (:methods + (check-pickup (_type_) none) + (rotate (_type_) none) + ) + ) + +;; definition for method 3 of type deschase-artifact +(defmethod inspect ((this deschase-artifact)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tarrow: ~D~%" (-> this arrow)) + (format #t "~2Tpos: #~%" (-> this pos)) + (format #t "~2Tangs: #~%" (-> this angs)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-deschase-artifact pre-artifact-a pre-artifact-a-lod0-jg pre-artifact-a-idle-ja + ((pre-artifact-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition for function deschase-artifact-init-by-other +;; INFO: Used lq/sq +(defbehavior deschase-artifact-init-by-other deschase-artifact ((arg0 vector)) + (set! (-> self level) (level-get *level* 'deschase)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self pos quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-deschase-artifact" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (-> self draw shadow) + (set! (-> self draw shadow-ctrl) (new + 'process + 'shadow-control + -40960.0 + 40960.0 + 614400.0 + (the-as vector #f) + (shadow-flags shdf00 shdf04) + 245760.0 + ) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-1 pos quad) (-> arg0 quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags taf3)) + (set! (-> s5-1 map-icon) (the-as uint 13)) + (set! (-> self arrow) (process->handle (task-arrow-spawn s5-1 self))) + ) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defstate idle (deschase-artifact) + :virtual #t + :trans (behavior () + (check-pickup self) + ) + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + :post (behavior () + (rotate self) + ) + ) + +;; definition for method 21 of type deschase-artifact +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod check-pickup ((this deschase-artifact)) + (let ((v1-0 *target*) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (when v1-0 + (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (set! (-> s5-0 w) 4096.0) + (when (focus-test? v1-0 pilot) + (let ((a1-4 (the-as process-focusable (handle->process (-> v1-0 pilot vehicle))))) + (set! (-> s5-0 quad) (-> a1-4 root root-prim prim-core world-sphere quad)) + ) + ) + (let ((f0-1 (vector-vector-distance-squared (-> this root trans) s5-0)) + (f1-1 (+ 12288.0 (-> s5-0 w))) + ) + (when (>= (* f1-1 f1-1) f0-1) + (sound-play "artifact-pickup") + (deactivate this) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 22 of type deschase-artifact +;; WARN: Return type mismatch int vs none. +(defmethod rotate ((this deschase-artifact)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (set! (-> gp-0 fvec x) (seconds-per-frame)) + (+! (-> this angs x) (* 32768.0 (-> gp-0 fvec x))) + (+! (-> this angs y) (* 23665.777 (-> gp-0 fvec x))) + (+! (-> this angs z) (* 20024.889 (-> gp-0 fvec x))) + (+! (-> this angs w) (* 22755.555 (-> gp-0 fvec x))) + (dotimes (v1-5 4) + (if (< 32768.0 (-> this angs data v1-5)) + (+! (-> this angs data v1-5) -65536.0) + ) + (if (< (-> this angs data v1-5) -32768.0) + (+! (-> this angs data v1-5) 65536.0) + ) + ) + (vector-reset! (-> gp-0 rvec)) + (set! (-> gp-0 rvec y) (+ 4915.2 (* 2048.0 (sin (-> this angs x))))) + (set! (-> gp-0 rvec x) (* 1024.0 (sin (-> this angs y)))) + (set! (-> gp-0 rvec z) (* 1024.0 (cos (-> this angs y)))) + (vector+! (-> this root trans) (-> this pos) (-> gp-0 rvec)) + (vector-reset! (-> gp-0 uvec)) + (set! (-> gp-0 uvec z) (* 5461.3335 (sin (-> this angs z)))) + (set! (-> gp-0 uvec y) (-> this angs w)) + (quaternion-zxy! (-> this root quat) (-> gp-0 uvec)) + ) + (ja-post) + 0 + (none) + ) + +;; definition for method 11 of type deschase-artifact +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this deschase-artifact) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; definition for function deschase-artifact-spawn +;; WARN: Return type mismatch process vs deschase-artifact. +(defun deschase-artifact-spawn ((arg0 process) (arg1 vector)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn deschase-artifact arg1 :name "deschase-artifact" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as deschase-artifact gp-0) + ) + ) + +;; definition of type hud-desert-chase-marauders +(deftype hud-desert-chase-marauders (hud) + () + ) + +;; definition for method 3 of type hud-desert-chase-marauders +(defmethod inspect ((this hud-desert-chase-marauders)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type hud-desert-chase-marauders +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-desert-chase-marauders)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 482.0 (* 130.0 (-> this offset)))) + 25 + ) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -20 45) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-desert-chase-marauders +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-desert-chase-marauders)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + (set! (-> this values 1 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-desert-chase-marauders +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-desert-chase-marauders)) + (set! (-> this level) (level-get *level* 'deschase)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xc70))) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.8) + (set! (-> this strings 0 flags) (font-flags shadow kerning middle large)) + (set! (-> this strings 0 color) (font-color white)) + 0 + (none) + ) + +;; definition for symbol *stronghold-vehicle-start*, type (array deschase-point) +(define *stronghold-vehicle-start* (new 'static 'boxed-array :type deschase-point + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6089183.0 :y 99123.2 :z 11991433.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.4923 :z 0.0004 :w -0.8703) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 6419560.5 :y 99123.2 :z 12347280.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0004 :y -0.9183 :w 0.3957) + ) + ) + ) + +;; definition for symbol *desert-chase-vehicle-start*, type (array deschase-point) +(define *desert-chase-vehicle-start* (new 'static 'boxed-array :type deschase-point + (new 'static 'deschase-point + :pos (new 'static 'vector :x 8088014.5 :y 167103.69 :z 12576974.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.3283 :y 0.9339 :z -0.0804 :w 0.1161) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 8003995.5 :y 131172.36 :z 12836982.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.1975 :y 0.9546 :z 0.0761 :w 0.209) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 7909497.5 :y 107760.02 :z 13230446.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.178 :y 0.9448 :z -0.0933 :w 0.2583) + ) + (new 'static 'deschase-point + :pos (new 'static 'vector :x 7661562.5 :y 84980.125 :z 13392549.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.1404 :y 0.936 :z -0.0788 :w 0.3128) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *desert-chase-vehicle-start* 0 i-node) 45) + +;; failed to figure out what this is: +(set! (-> *desert-chase-vehicle-start* 1 i-node) 45) + +;; failed to figure out what this is: +(set! (-> *desert-chase-vehicle-start* 2 i-node) 45) + +;; failed to figure out what this is: +(set! (-> *desert-chase-vehicle-start* 3 i-node) 46) + +;; definition of type deschase-vehicle-control +(deftype deschase-vehicle-control (structure) + ((vehicle handle) + (target handle) + (path deschase-path) + (speed float) + (i-node int32) + (max-dist float) + (speed-factor float) + ) + :allow-misaligned + (:methods + (deschase-vehicle-control-method-9 (_type_) none) + (deschase-vehicle-control-method-10 (_type_) none) + (deschase-vehicle-control-method-11 (_type_) none) + (deschase-vehicle-control-method-12 (_type_) none) + ) + ) + +;; definition for method 3 of type deschase-vehicle-control +(defmethod inspect ((this deschase-vehicle-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'deschase-vehicle-control) + (format #t "~1Tvehicle: ~D~%" (-> this vehicle)) + (format #t "~1Ttarget: ~D~%" (-> this target)) + (format #t "~1Tpath: #~%" (-> this path)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Ti-node: ~D~%" (-> this i-node)) + (format #t "~1Tmax-dist: ~f~%" (-> this max-dist)) + (format #t "~1Tspeed-factor: ~f~%" (-> this speed-factor)) + (label cfg-4) + this + ) + +;; definition for method 9 of type deschase-vehicle-control +;; WARN: Return type mismatch int vs none. +(defmethod deschase-vehicle-control-method-9 ((this deschase-vehicle-control)) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this target) (the-as handle #f)) + (set! (-> this speed-factor) 1.0) + 0 + (none) + ) + +;; definition for method 11 of type deschase-vehicle-control +;; WARN: Return type mismatch int vs none. +(defmethod deschase-vehicle-control-method-11 ((this deschase-vehicle-control)) + (let ((gp-0 (handle->process (-> this vehicle)))) + (when gp-0 + (let* ((s5-0 (-> this path node (-> this i-node))) + (f0-0 (-> s5-0 speed)) + ) + (if (>= 16384.0 f0-0) + (set! f0-0 327680.0) + ) + (let ((f30-0 (fmin f0-0 (* (-> this speed-factor) (-> this speed))))) + (send-event gp-0 'ai-set-target-process (handle->process (-> this target))) + (send-event gp-0 'ai-set-target-position (-> s5-0 position)) + (send-event gp-0 'ai-set-target-speed f30-0) + ) + ) + (send-event gp-0 'ai-ignore-nav-mesh) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type deschase-vehicle-control +;; WARN: Return type mismatch int vs none. +(defmethod deschase-vehicle-control-method-10 ((this deschase-vehicle-control)) + (let* ((s5-0 (handle->process (-> this vehicle))) + (v1-3 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when v1-3 + (let* ((s5-1 (-> this path node (-> this i-node))) + (f0-0 (vector-vector-distance-squared (-> v1-3 root trans) (-> s5-1 position))) + (f1-0 40960.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let ((v1-7 (-> s5-1 next-node))) + (if (!= v1-7 -1) + (set! (-> this i-node) v1-7) + ) + ) + ) + ) + (deschase-vehicle-control-method-11 this) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type deschase-vehicle-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod deschase-vehicle-control-method-12 ((this deschase-vehicle-control)) + (let* ((s5-0 (handle->process (-> this vehicle))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when (and (the-as process-focusable gp-0) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead))) + ) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (set! (-> s4-0 uvec quad) (-> (the-as process-focusable gp-0) root trans quad)) + (vector-float*! (-> s4-0 rvec) (-> (the-as process-focusable gp-0) root transv) 0.1) + (set! (-> s4-0 fvec x) 24576.0) + (let ((s5-1 (the-as (array collide-shape) ((method-of-type array new) + (the-as symbol (new 'stack-no-clear 'array 'collide-shape 128)) + array + collide-shape + 128 + ) + ) + ) + ) + (set! (-> s5-1 length) (fill-actor-list-for-sphere + *actor-hash* + (-> s4-0 uvec) + (-> s4-0 rvec) + (-> s4-0 fvec x) + (-> s5-1 data) + (-> s5-1 allocated-length) + -1 + ) + ) + (dotimes (s4-1 (-> s5-1 length)) + (let* ((s3-0 (-> s5-1 s4-1 process)) + (a0-15 (if (type? s3-0 v-marauder) + s3-0 + ) + ) + ) + (if (and a0-15 (!= a0-15 gp-0)) + (send-event + a0-15 + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 30.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 0.0)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type desert-chase-chase-manager +(deftype desert-chase-chase-manager (task-manager) + ((h-player-controller handle) + (check-timer time-frame) + (speech-time time-frame) + (last-speech int8) + (death-count int16) + (max-dist float) + (suck-factor float) + (player-moved? symbol) + (control-array deschase-vehicle-control 4 :inline) + (minimap connection-minimap :offset 472) + (artifact handle) + ) + (:methods + (spawn-chase-vehicle (_type_ deschase-vehicle deschase-point) none) + (update-chase-status (_type_) none) + ) + ) + +;; definition for method 3 of type desert-chase-chase-manager +(defmethod inspect ((this desert-chase-chase-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Th-player-controller: ~D~%" (-> this h-player-controller)) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (format #t "~2Tspeech-time: ~D~%" (-> this speech-time)) + (format #t "~2Tlast-speech: ~D~%" (-> this last-speech)) + (format #t "~2Tdeath-count: ~D~%" (-> this death-count)) + (format #t "~2Tmax-dist: ~f~%" (-> this max-dist)) + (format #t "~2Tsuck-factor: ~f~%" (-> this suck-factor)) + (format #t "~2Tplayer-moved?: ~A~%" (-> this player-moved?)) + (format #t "~2Tcontrol-array[4] @ #x~X~%" (-> this control-array)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tartifact: ~D~%" (-> this artifact)) + (label cfg-4) + this + ) + +;; definition for method 25 of type desert-chase-chase-manager +(defmethod task-manager-method-25 ((this desert-chase-chase-manager)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (let ((a0-3 (handle->process (-> this h-player-controller)))) + (if a0-3 + (deactivate a0-3) + ) + ) + (none) + ) + +;; definition for method 20 of type desert-chase-chase-manager +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this desert-chase-chase-manager)) + (let ((t9-0 (method-of-type task-manager init!))) + (t9-0 this) + ) + (set! (-> this h-player-controller) (the-as handle #f)) + (set! (-> this artifact) (the-as handle #f)) + (dotimes (s5-0 4) + (deschase-vehicle-control-method-9 (-> this control-array s5-0)) + ) + (none) + ) + +;; definition for method 21 of type desert-chase-chase-manager +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this desert-chase-chase-manager)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (let ((t1-0 8)) + (set-setting! 'vehicles 'set (shr t1-0 32) t1-0) + ) + (set-setting! 'exclusive-task #f 0.0 (-> this node-info task)) + (set-setting! 'pilot-exit #f 0.0 0) + (let ((a2-3 (-> *game-info* sub-task-list (-> this info final-node) death-count))) + (set! (-> this death-count) (the-as int a2-3)) + (set! (-> this suck-factor) (cond + ((< a2-3 (the-as uint 5)) + 0.0 + ) + ((< a2-3 (the-as uint 10)) + 0.25 + ) + (else + (fmin 1.0 (* 0.05 (the float a2-3))) + ) + ) + ) + (format #t "desert-chase-marauders::initialize death-count ~d, suck-factor ~f~%" a2-3 (-> this suck-factor)) + ) + (set! (-> this player-moved?) #f) + (none) + ) + +;; definition for method 26 of type desert-chase-chase-manager +(defmethod task-manager-method-26 ((this desert-chase-chase-manager)) + (when (!= (-> this player-vehicle) #f) + (let* ((s5-0 (handle->process (-> this player-vehicle))) + (a0-5 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (if (or (not a0-5) (focus-test? a0-5 dead)) + (send-event this 'fail) + ) + ) + ) + (let ((s5-1 0)) + (dotimes (s4-0 4) + (let ((s3-0 (-> this control-array s4-0))) + (let* ((s2-0 (handle->process (-> s3-0 vehicle))) + (a0-14 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (if (and a0-14 (not (logtest? (-> (the-as process-focusable a0-14) focus-status) (focus-status dead)))) + (+! s5-1 1) + ) + ) + (deschase-vehicle-control-method-10 s3-0) + ) + ) + (set! (-> *game-info* counter) (the float s5-1)) + ) + (hud-timer-handler this) + ((method-of-type task-manager task-manager-method-26) this) + (none) + ) + +;; definition for method 32 of type desert-chase-chase-manager +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spawn-chase-vehicle ((this desert-chase-chase-manager) (arg0 deschase-vehicle) (arg1 deschase-point)) + (let ((s5-0 (new 'stack-no-clear 'traffic-object-spawn-params))) + (set! (-> s5-0 object-type) (traffic-type guard-a)) + (set! (-> s5-0 behavior) (the-as uint 3)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 nav-mesh) #f) + (set! (-> s5-0 nav-branch) #f) + (set! (-> s5-0 proc) #f) + (set! (-> s5-0 handle) (the-as handle #f)) + (set! (-> s5-0 user-data) (the-as uint 0)) + (set! (-> s5-0 flags) (traffic-spawn-flags)) + (set! (-> s5-0 guard-type) (the-as uint 11)) + (set! (-> s5-0 entity) #f) + (vector-reset! (-> s5-0 velocity)) + (set! (-> s5-0 position quad) (-> arg1 pos quad)) + (quaternion-copy! (-> s5-0 rotation) (-> arg1 quat)) + (let ((s5-1 (vehicle-spawn (vehicle-type v-marauder-b) (the-as traffic-object-spawn-params (&-> s5-0 object-type)))) + ) + (if (not s5-1) + (format #t "vehicle-spawn failed~%") + ) + (when s5-1 + (format #t "vehicle-spawn pid ~d~%" (-> s5-1 pid)) + (set! (-> arg0 handle) (process->handle s5-1)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 33 of type desert-chase-chase-manager +;; WARN: Return type mismatch int vs none. +;; WARN: new jak 2 until loop case, check carefully +(defmethod update-chase-status ((this desert-chase-chase-manager)) + (let ((s4-0 -1) + (s5-0 -1) + ) + (let ((s3-0 #f) + (s2-0 3) + ) + (until #f + (let* ((s1-0 (handle->process (-> this control-array s2-0 vehicle))) + (a0-5 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (cond + ((or (not a0-5) (focus-test? (the-as process-focusable a0-5) dead)) + (if s3-0 + (set! s4-0 s2-0) + ) + ) + (else + (when (not s3-0) + (set! s3-0 #t) + (set! s5-0 s2-0) + ) + ) + ) + ) + (+! s2-0 -1) + (if (< s2-0 0) + (goto cfg-21) + ) + ) + ) + #f + (label cfg-21) + (when (!= s4-0 -1) + (let ((v1-21 (-> this control-array s4-0 vehicle))) + (let ((a0-8 (+ s4-0 1))) + (while (>= s5-0 a0-8) + (set! (-> this control-array (+ a0-8 -1) vehicle) (-> this control-array a0-8 vehicle)) + (+! a0-8 1) + ) + ) + (set! (-> this control-array s5-0 vehicle) v1-21) + ) + ) + ) + 0 + (none) + ) + +;; definition for function desert-chase-chase-intro-sequence +;; INFO: Used lq/sq +;; WARN: new jak 2 until loop case, check carefully +(defbehavior desert-chase-chase-intro-sequence desert-chase-chase-manager () + (set-setting! 'extra-bank '((wasall1 wastoad) (desert2 desert5)) 0.0 0) + (set! (-> self player-moved?) #f) + (when *target* + (set-setting! 'entity-name "camera-394" 0.0 0) + (let ((gp-0 (new 'stack-no-clear 'player-controller-init-params))) + (set! (-> gp-0 mode) 'active) + (set! (-> gp-0 flags) (player-controller-flag pc1 lock-features letterbox pc4)) + (set! (-> gp-0 targ-pos quad) (-> *stronghold-player-goto-point* quad)) + (set! (-> gp-0 notify-proc) (process->handle self)) + (set! (-> self h-player-controller) + (ppointer->handle (process-spawn player-controller gp-0 :name "player-controller" :to *target*)) + ) + ) + ) + (set-setting! 'sound-ear-scale 'abs 0.25 0) + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer self)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'raise) + (let ((s5-1 send-event-function) + (v1-21 (entity-by-name "des-jump-bridge-2")) + ) + (s5-1 + (if v1-21 + (-> v1-21 extra process) + ) + gp-1 + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-2 from) (process->ppointer self)) + (set! (-> gp-2 num-params) 0) + (set! (-> gp-2 message) 'raise) + (let ((s5-2 send-event-function) + (v1-26 (entity-by-name "des-jump-bridge-1")) + ) + (s5-2 + (if v1-26 + (-> v1-26 extra process) + ) + gp-2 + ) + ) + ) + (set-time! (-> self check-timer)) + (until #f + (if (or (-> self player-moved?) + (or (< (vector-vector-distance (target-pos 0) *stronghold-player-goto-point*) 40960.0) + (time-elapsed? (-> self check-timer) (seconds 5)) + ) + ) + (goto cfg-32) + ) + (suspend) + ) + #f + (label cfg-32) + (let ((gp-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-4 from) (process->ppointer self)) + (set! (-> gp-4 num-params) 0) + (set! (-> gp-4 message) 'open) + (let ((s5-3 send-event-function) + (v1-44 (entity-by-name "des-garage-door-2")) + ) + (s5-3 + (if v1-44 + (-> v1-44 extra process) + ) + gp-4 + ) + ) + ) + (dotimes (v1-47 4) + (let ((a0-29 (-> self control-array v1-47))) + (set! (-> a0-29 speed) 327680.0) + ) + ) + (let ((gp-5 (-> self control-array))) + (when (not (handle->process (-> gp-5 0 vehicle))) + (spawn-chase-vehicle self (the-as deschase-vehicle gp-5) (-> *stronghold-vehicle-start* 0)) + (set! (-> gp-5 0 path) *desert-chase-marauder-path*) + (set! (-> gp-5 0 i-node) 0) + 0 + ) + ) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 1)) + (suspend) + ) + ) + (let ((gp-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-7 from) (process->ppointer self)) + (set! (-> gp-7 num-params) 0) + (set! (-> gp-7 message) 'open) + (let ((s5-4 send-event-function) + (v1-66 (entity-by-name "des-garage-door-1")) + ) + (s5-4 + (if v1-66 + (-> v1-66 extra process) + ) + gp-7 + ) + ) + ) + (let ((gp-8 (-> self control-array 1))) + (when (not (handle->process (-> gp-8 vehicle))) + (spawn-chase-vehicle self (the-as deschase-vehicle gp-8) (-> *stronghold-vehicle-start* 1)) + (set! (-> gp-8 path) *desert-chase-marauder-path*) + (set! (-> gp-8 i-node) 48) + ) + ) + (let ((gp-9 (current-time))) + (until (time-elapsed? gp-9 (seconds 1)) + (suspend) + ) + ) + (let ((gp-10 (-> self control-array 2))) + (when (not (handle->process (-> gp-10 vehicle))) + (spawn-chase-vehicle self (the-as deschase-vehicle gp-10) (-> *stronghold-vehicle-start* 0)) + (set! (-> gp-10 path) *desert-chase-marauder-path*) + (set! (-> gp-10 i-node) 0) + 0 + ) + ) + (let ((gp-11 (current-time))) + (until (time-elapsed? gp-11 (seconds 1)) + (suspend) + ) + ) + (let ((gp-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-12 from) (process->ppointer self)) + (set! (-> gp-12 num-params) 0) + (set! (-> gp-12 message) 'close) + (let ((s5-5 send-event-function) + (v1-99 (entity-by-name "des-garage-door-2")) + ) + (s5-5 + (if v1-99 + (-> v1-99 extra process) + ) + gp-12 + ) + ) + ) + (let ((gp-13 (-> self control-array 3))) + (when (not (handle->process (-> gp-13 vehicle))) + (spawn-chase-vehicle self (the-as deschase-vehicle gp-13) (-> *stronghold-vehicle-start* 1)) + (set! (-> gp-13 path) *desert-chase-marauder-path*) + (set! (-> gp-13 i-node) 48) + ) + ) + (let ((gp-14 (current-time))) + (until (time-elapsed? gp-14 (seconds 1)) + (suspend) + ) + ) + (let ((gp-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-15 from) (process->ppointer self)) + (set! (-> gp-15 num-params) 0) + (set! (-> gp-15 message) 'close) + (let ((s5-6 send-event-function) + (v1-118 (entity-by-name "des-garage-door-1")) + ) + (s5-6 + (if v1-118 + (-> v1-118 extra process) + ) + gp-15 + ) + ) + ) + (let ((gp-16 (current-time))) + (until (time-elapsed? gp-16 (seconds 1)) + (suspend) + ) + ) + (let ((gp-17 (current-time))) + (until (time-elapsed? gp-17 (seconds 4)) + (suspend) + ) + ) + (send-event (handle->process (-> self h-player-controller)) 'change-mode 'idle) + (dotimes (gp-18 4) + (let ((s5-7 (-> self control-array gp-18))) + (send-event (handle->process (-> s5-7 vehicle)) 'go-die) + (set! (-> s5-7 vehicle) (the-as handle #f)) + ) + ) + (remove-setting! 'pilot) + (remove-setting! 'entity-name) + (remove-setting! 'sound-ear-scale) + (send-event *vehicle-manager* 'no-extra-bank) + (remove-setting! 'extra-bank) + (none) + ) + +;; failed to figure out what this is: +(defstate active (desert-chase-chase-manager) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reached-destination) + (set! (-> self player-moved?) #t) + (send-event proc 'change-mode 'lock) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (set-setting! 'allow-progress #f 0.0 0) + (until #f + (let ((a1-1 *target*)) + (if (and a1-1 (not (logtest? (focus-status teleporting) (-> a1-1 focus-status)))) + (goto cfg-8) + ) + ) + (suspend) + ) + #f + (label cfg-8) + (set-setting! 'music 'desres1 0.0 0) + (suspend) + (when (not (task-node-closed? (game-task-node desert-chase-marauders-chase))) + (desert-chase-chase-intro-sequence) + (task-node-close! (game-task-node desert-chase-marauders-chase) 'event) + ) + (set! (-> self player-vehicle) (-> *vehicle-info* handle-by-vehicle-type 15)) + (dotimes (gp-0 3) + (send-event (handle->process (-> self player-vehicle)) 'turbo-pickup) + ) + (remove-setting! 'allow-progress) + (talker-spawn-func (-> *talker-speech* 174) *entity-pool* (target-pos 0) (the-as region #f)) + (dotimes (gp-2 4) + (let ((s5-1 (-> self control-array gp-2))) + (let ((s4-1 (-> *desert-chase-vehicle-start* gp-2))) + (spawn-chase-vehicle self (the-as deschase-vehicle s5-1) s4-1) + (set! (-> s5-1 path) *desert-chase-marauder-path*) + (set! (-> s5-1 i-node) (-> s4-1 i-node)) + ) + (set! (-> s5-1 speed) 0.0) + (set! (-> s5-1 max-dist) 1638400.0) + ) + ) + (set! (-> self hud-counter) + (ppointer->handle + (process-spawn hud-desert-chase-marauders :init hud-init-by-other :name "hud-desert-chase-marauders" :to self) + ) + ) + (suspend) + (set-time! (-> self state-time)) + (until #f + (if (or (and *target* (focus-test? *target* pilot-riding)) + (or (< 204800.0 (vector-vector-distance (target-pos 0) *stronghold-player-goto-point*)) + (time-elapsed? (-> self state-time) (seconds 10)) + ) + ) + (goto cfg-43) + ) + (suspend) + ) + #f + (label cfg-43) + (let ((v1-58 (new 'static 'vector :x 204800.0 :y 192512.0 :z 180224.0 :w 122880.0))) + (dotimes (a0-27 4) + (let ((a1-16 (-> self control-array a0-27))) + (set! (-> a1-16 speed) (+ (-> v1-58 data a0-27) (* -24576.0 (-> self suck-factor)))) + (if *target* + (set! (-> a1-16 target) (process->handle *target*)) + ) + ) + ) + ) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 1)) + (suspend) + ) + ) + (was-squad-manager-start self) + (let ((v1-66 *was-squad-control*)) + (set! (-> v1-66 target-count) 2) + (set! (-> v1-66 reserve-count) 400) + (set! (-> v1-66 target-speed) 143360.0) + ) + (let ((gp-6 3)) + (until #f + (let ((v1-68 gp-6)) + (set! (-> self time-limit) (the-as time-frame (cond + ((zero? v1-68) + 0 + ) + ((= v1-68 1) + #x4650 + ) + ((= v1-68 2) + #x4650 + ) + ((= v1-68 3) + (+ (if (zero? (-> self death-count)) + 900 + 0 + ) + #x34bc + ) + ) + (else + 0 + ) + ) + ) + ) + ) + (set! (-> self max-dist) 2457600.0) + (if (= gp-6 3) + (set! (-> self max-dist) 3072000.0) + ) + (if (nonzero? gp-6) + (set-time! (-> self start-time)) + ) + (set! (-> self minimap) #f) + (until #f + (update-chase-status self) + (dotimes (s5-2 4) + (deschase-vehicle-control-method-12 (-> self control-array s5-2)) + ) + (dotimes (s5-3 gp-6) + (let* ((s4-2 (-> self control-array s5-3)) + (s2-0 (-> self control-array (+ s5-3 1))) + (s1-0 (handle->process (-> s4-2 vehicle))) + (s3-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + (s2-1 (handle->process (-> s2-0 vehicle))) + (v1-101 (if (type? s2-1 process-focusable) + s2-1 + ) + ) + ) + (when (and s3-0 v1-101) + (let ((f0-8 (vector-vector-distance + (-> (the-as process-focusable s3-0) root trans) + (-> (the-as process-focusable v1-101) root trans) + ) + ) + ) + (set! (-> s4-2 speed-factor) 1.0) + (if (< (-> s4-2 max-dist) f0-8) + (set! (-> s4-2 speed-factor) 0.0) + ) + ) + ) + ) + ) + (let ((v1-109 (-> self control-array gp-6))) + (set! (-> v1-109 speed-factor) 1.0) + (let* ((s4-3 (handle->process (-> v1-109 vehicle))) + (s5-4 (if (type? s4-3 process-focusable) + s4-3 + ) + ) + ) + (when (the-as process-focusable s5-4) + (if (not (-> self minimap)) + (set! (-> self minimap) + (add-icon! *minimap* (the-as process-focusable s5-4) (the-as uint 12) (the-as int #f) (the-as vector #t) 0) + ) + ) + (let ((f30-1 (vector-vector-distance (target-pos 0) (-> (the-as process-focusable s5-4) root trans)))) + (if (< (-> self max-dist) f30-1) + (send-event self 'fail) + ) + (when (and (< f30-1 532480.0) (time-elapsed? (-> self speech-time) (seconds 5))) + (set-time! (-> self speech-time)) + (let ((v1-131 (rand-vu-int-count 4))) + (when (!= v1-131 (-> self last-speech)) + (set! (-> self last-speech) v1-131) + (cond + ((zero? v1-131) + (talker-spawn-func (-> *talker-speech* 177) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-131 1) + (talker-spawn-func (-> *talker-speech* 178) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-131 2) + (talker-spawn-func (-> *talker-speech* 180) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-131 3) + (talker-spawn-func (-> *talker-speech* 181) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + ) + ) + 0 + ) + (when (or (not s5-4) (focus-test? (the-as process-focusable s5-4) dead)) + (if (and s5-4 (zero? gp-6)) + (set! (-> self artifact) + (process->handle (deschase-artifact-spawn self (-> (the-as process-focusable s5-4) root trans))) + ) + ) + (goto cfg-146) + ) + ) + ) + (suspend) + ) + #f + (label cfg-146) + (set! (-> self start-time) 0) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (if (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + ) + (let ((s5-5 (current-time))) + (until (time-elapsed? s5-5 (seconds 1)) + (suspend) + ) + ) + (+! gp-6 -1) + (if (= gp-6 -1) + (goto cfg-176) + ) + (if (zero? gp-6) + (send-event (handle->process (-> self control-array 0 vehicle)) 'no-pickup) + ) + (let ((v1-176 gp-6)) + (cond + ((zero? v1-176) + (talker-spawn-func (-> *talker-speech* 179) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-176 1) + (talker-spawn-func (-> *talker-speech* 175) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-176 2) + (talker-spawn-func (-> *talker-speech* 176) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + ) + #f + (label cfg-176) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> *was-squad-control* target-count) 0) + 0 + (until #f + (if (not (handle->process (-> self artifact))) + (goto cfg-193) + ) + (suspend) + ) + #f + (label cfg-193) + (send-event self 'complete) + ) + ) + +;; failed to figure out what this is: +(defstate complete (desert-chase-chase-manager) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 4)) + (suspend) + ) + ) + (let ((t9-1 (-> (find-parent-state) code))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc new file mode 100644 index 0000000000..86862e3ec7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc @@ -0,0 +1,1403 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-kamikaze-interceptor-fire + :id 453 + :flags (sp0 sp1 sp4) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1802 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7)) + (sp-item 1803 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7)) + (sp-item 1804 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1804 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 2.0 1.0) + (:x (meters -2) (meters 4)) + (:y (meters 0.5)) + (:z (meters -1) (meters 3)) + (:scale-x (meters 5) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 20.0 20.0) + (:scalevel-x (meters -0.04)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.9) + (:fade-a -0.15) + (:accel-y (meters 0.0016666667) (meters 0.0016666667)) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1802 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.2) + (:y (meters 0)) + (:scale-x (meters 25) (meters 6)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 32.0) + (:b 0.0) + (:a 8.0 8.0) + (:omega (degrees 2250011.2)) + (:timer (seconds 0.335) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1803 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.5) + (:x (meters -2) (meters 4)) + (:y (meters 1.5)) + (:z (meters -1) (meters 3)) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 160) (degrees 40)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 10.0) + (:a 1.0) + (:scalevel-x (meters 0.015) (meters 0.008333334)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.6 0.6) + (:accel-y (meters 0.00066666666) (meters 0.00066666666)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:next-time (seconds 0.167)) + (:next-launcher 1805) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1805 + :init-specs ((:fade-r -0.42666668) + (:fade-g 0.093333334) + (:fade-b 0.39333335) + (:fade-a -0.10909091) + (:accel-y (meters 0.00033333333)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-airlock-debris wascity-airlock-debris wascity-airlock-debris-lod0-jg wascity-airlock-debris-idle-ja + ((wascity-airlock-debris-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +;; definition for symbol *wascity-airlock-exploder-params*, type joint-exploder-static-params +(define *wascity-airlock-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) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 28 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 30 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition of type wascity-airlock-debris +(deftype wascity-airlock-debris (process-drawable) + () + (:state-methods + idle + explode + ) + (:methods + (spawn-exploder (_type_) none) + ) + ) + +;; definition for method 3 of type wascity-airlock-debris +(defmethod inspect ((this wascity-airlock-debris)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (wascity-airlock-debris) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('explode) + (go-virtual explode) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate explode (wascity-airlock-debris) + :virtual #t + :code (behavior () + (let ((gp-0 (the-as entity-actor (entity-by-name "wascity-airlock-5"))) + (s5-0 (the-as entity-actor (entity-by-name "wascity-airlock-4"))) + ) + (when (and gp-0 s5-0) + (toggle-status gp-0 (entity-perm-status dead) #t) + (toggle-status s5-0 (entity-perm-status dead) #t) + (kill-by-type wascity-airlock *active-pool*) + (set! (-> self root trans quad) (-> gp-0 extra trans quad)) + (spawn-exploder self) + ) + ) + (suspend) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 12 of type wascity-airlock-debris +(defmethod run-logic? ((this wascity-airlock-debris)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 22 of type wascity-airlock-debris +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spawn-exploder ((this wascity-airlock-debris)) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let ((v1-2 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) 327680.0))) + (vector+! v1-2 v1-2 (-> this root trans)) + (set! (-> gp-0 fountain-rand-transv-lo quad) (-> v1-2 quad)) + ) + (set! (-> gp-0 fountain-rand-transv-hi x) 81920.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 327680.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 4096.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 16384.0) + (set! (-> gp-0 hit-xz-reaction) 0.75) + (set! (-> gp-0 hit-y-reaction) 0.35) + (set! (-> gp-0 max-probes) (the-as uint (length (-> *wascity-airlock-exploder-params* joints)))) + (set! (-> gp-0 duration) (seconds 4)) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-wascity-airlock-debris" (the-as (pointer level) #f)) + 2 + gp-0 + *wascity-airlock-exploder-params* + :name "joint-exploder" + :to this + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type wascity-airlock-debris +(defmethod init-from-entity! ((this wascity-airlock-debris) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (go (method-of-object this idle)) + ) + +;; definition of type beam-generator +(deftype beam-generator (process-drawable) + ((arrow handle) + (pos vector :inline) + (angs vector :inline) + ) + (:state-methods + idle + die + ) + (:methods + (check-pickup (_type_) none) + (rotate (_type_) none) + ) + ) + +;; definition for method 3 of type beam-generator +(defmethod inspect ((this beam-generator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tarrow: ~D~%" (-> this arrow)) + (format #t "~2Tpos: #~%" (-> this pos)) + (format #t "~2Tangs: #~%" (-> this angs)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-beam-generator beam-generator beam-generator-lod0-jg beam-generator-idle-ja + ((beam-generator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow beam-generator-shadow-mg + ) + +;; definition for function beam-generator-init-by-other +;; INFO: Used lq/sq +(defbehavior beam-generator-init-by-other beam-generator ((arg0 vector) (arg1 entity-actor)) + (process-entity-set! self arg1) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self pos quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-beam-generator" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (-> self draw shadow) + (set! (-> self draw shadow-ctrl) (new + 'process + 'shadow-control + -40960.0 + 40960.0 + 614400.0 + (the-as vector #f) + (shadow-flags shdf00 shdf04) + 245760.0 + ) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-1 pos quad) (-> arg0 quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags taf3)) + (set! (-> s5-1 map-icon) (the-as uint 13)) + (set! (-> self arrow) (process->handle (task-arrow-spawn s5-1 self))) + ) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defstate idle (beam-generator) + :virtual #t + :trans (behavior () + (check-pickup self) + ) + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + :post (behavior () + (rotate self) + ) + ) + +;; failed to figure out what this is: +(defstate die (beam-generator) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + ) + ) + +;; definition for method 22 of type beam-generator +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod check-pickup ((this beam-generator)) + (let ((v1-0 *target*) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (when v1-0 + (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (set! (-> s5-0 w) 4096.0) + (when (focus-test? v1-0 pilot) + (let ((a1-4 (the-as process-focusable (handle->process (-> v1-0 pilot vehicle))))) + (set! (-> s5-0 quad) (-> a1-4 root root-prim prim-core world-sphere quad)) + ) + ) + (let ((f0-1 (vector-vector-distance-squared (-> this root trans) s5-0)) + (f1-1 (+ 12288.0 (-> s5-0 w))) + ) + (when (>= (* f1-1 f1-1) f0-1) + (talker-spawn-func (-> *talker-speech* 128) *entity-pool* (target-pos 0) (the-as region #f)) + (send-event (handle->process (-> this arrow)) 'die) + (go (method-of-object this die)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 23 of type beam-generator +;; WARN: Return type mismatch int vs none. +(defmethod rotate ((this beam-generator)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (set! (-> gp-0 fvec x) (seconds-per-frame)) + (+! (-> this angs x) (* 32768.0 (-> gp-0 fvec x))) + (+! (-> this angs y) (* 23665.777 (-> gp-0 fvec x))) + (+! (-> this angs z) (* 20024.889 (-> gp-0 fvec x))) + (+! (-> this angs w) (* 22755.555 (-> gp-0 fvec x))) + (dotimes (v1-5 4) + (if (< 32768.0 (-> this angs data v1-5)) + (+! (-> this angs data v1-5) -65536.0) + ) + (if (< (-> this angs data v1-5) -32768.0) + (+! (-> this angs data v1-5) 65536.0) + ) + ) + (vector-reset! (-> gp-0 rvec)) + (set! (-> gp-0 rvec y) (+ 4915.2 (* 2048.0 (sin (-> this angs x))))) + (set! (-> gp-0 rvec x) (* 1024.0 (sin (-> this angs y)))) + (set! (-> gp-0 rvec z) (* 1024.0 (cos (-> this angs y)))) + (vector+! (-> this root trans) (-> this pos) (-> gp-0 rvec)) + (vector-reset! (-> gp-0 uvec)) + (set! (-> gp-0 uvec z) (* 5461.3335 (sin (-> this angs z)))) + (set! (-> gp-0 uvec y) (-> this angs w)) + (quaternion-zxy! (-> this root quat) (-> gp-0 uvec)) + ) + (ja-post) + 0 + (none) + ) + +;; definition for method 11 of type beam-generator +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this beam-generator) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; definition of type hud-wasdoors-health +(deftype hud-wasdoors-health (hud) + () + ) + +;; definition for method 3 of type hud-wasdoors-health +(defmethod inspect ((this hud-wasdoors-health)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type hud-wasdoors-health +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-wasdoors-health)) + (set-hud-piece-position! + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) + ) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 15 10) + (let ((f30-1 + (the float + (+ (the int (* 127.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 2)))))) 127) + ) + ) + ) + (set! (-> this sprites 1 color x) (the int (lerp-scale 64.0 128.0 f30-1 0.0 255.0))) + (set! (-> this sprites 1 color y) (the int (lerp-scale 64.0 128.0 f30-1 0.0 255.0))) + (set! (-> this sprites 1 color z) (the int (lerp-scale 64.0 128.0 f30-1 0.0 255.0))) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-wasdoors-health +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-wasdoors-health)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* health-bar)))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-wasdoors-health +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-wasdoors-health)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-transparent-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xace))) + ) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #xace))) + ) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xace))) + ) + (set! (-> this sprites 3 scale-x) 0.65) + (set! (-> this sprites 3 scale-y) 0.95) + (set! (-> this sprites 3 pos z) #xffffff) + 0 + (none) + ) + +;; definition of type hud-desert-catapult-count +(deftype hud-desert-catapult-count (hud) + () + ) + +;; definition for method 3 of type hud-desert-catapult-count +(defmethod inspect ((this hud-desert-catapult-count)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type hud-desert-catapult-count +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-desert-catapult-count)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 482.0 (* 130.0 (-> this offset)))) + 25 + ) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -20 60) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-desert-catapult-count +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-desert-catapult-count)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-desert-catapult-count +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-desert-catapult-count)) + (set! (-> this level) (level-get *level* 'desjump)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xace))) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.8) + (set! (-> this strings 0 flags) (font-flags shadow kerning middle large)) + (set! (-> this strings 0 color) (font-color white)) + 0 + (none) + ) + +;; definition of type desjump-point +(deftype desjump-point (structure) + ((pos vector :inline) + (quat quaternion :inline) + ) + ) + +;; definition for method 3 of type desjump-point +(defmethod inspect ((this desjump-point)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'desjump-point) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (label cfg-4) + this + ) + +;; definition for symbol *desjump-wasdoors-pos*, type vector +(define *desjump-wasdoors-pos* (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0)) + +;; definition for symbol *desjump-vehicle-path*, type (array (array desjump-point)) +(define *desjump-vehicle-path* (the-as (array (array desjump-point)) + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9631658.0 :y 117858.305 :z 2423129.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9983 :w 0.0566) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9501355.0 :y 119288.22 :z 1724418.5 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 8930882.0 :y 149373.75 :z 2460976.8 :w 1.0) + :quat (new 'static 'quaternion :y 0.9699 :w 0.2434) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9102560.0 :y 123364.97 :z 1795913.4 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 10259027.0 :y 116531.61 :z 2201311.2 :w 1.0) + :quat (new 'static 'quaternion :y -0.9269 :w 0.3752) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9727058.0 :y 119932.516 :z 1606351.2 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 10602098.0 :y 112007.58 :z 1830187.4 :w 1.0) + :quat (new 'static 'quaternion :y -0.915 :w 0.4034) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9916447.0 :y 120501.45 :z 1482014.2 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 10375236.0 :y 110511.31 :z 2096389.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.9286 :w 0.3709) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9508849.0 :y 123161.4 :z 1245483.9 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9639729.0 :y 122473.68 :z 1372115.8 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9996342.0 :y 119910.81 :z 2389373.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.9658 :w 0.2589) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9453793.0 :y 123170.41 :z 1286821.1 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9500160.0 :y 122431.08 :z 1457920.4 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9268282.0 :y 124794.06 :z 2578690.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.9999 :w 0.0133) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9270956.0 :y 138510.34 :z 1285244.9 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9313876.0 :y 128615.22 :z 1467933.1 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + (new 'static 'boxed-array :type desjump-point + (new 'static 'desjump-point + :pos (new 'static 'vector :x 8764265.0 :y 182223.25 :z 2371544.8 :w 1.0) + :quat (new 'static 'quaternion :y 0.9733 :w 0.2294) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9174787.0 :y 162145.08 :z 1362950.5 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9219156.0 :y 148370.64 :z 1482753.2 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + (new 'static 'desjump-point + :pos (new 'static 'vector :x 9276363.0 :y 127580.98 :z 962223.7 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + ) + ) + ) + ) + ) + +;; definition of type desjump-vehicle +(deftype desjump-vehicle (structure) + ((handle handle) + (path-type uint8) + (path-pos uint8) + (ready? symbol) + (kamikaze? symbol) + (wait-timer time-frame) + ) + :pack-me + ) + +;; definition for method 3 of type desjump-vehicle +(defmethod inspect ((this desjump-vehicle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'desjump-vehicle) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tpath-type: ~D~%" (-> this path-type)) + (format #t "~1Tpath-pos: ~D~%" (-> this path-pos)) + (format #t "~1Tready?: ~A~%" (-> this ready?)) + (format #t "~1Tkamikaze?: ~A~%" (-> this kamikaze?)) + (format #t "~1Twait-timer: ~D~%" (-> this wait-timer)) + (label cfg-4) + this + ) + +;; definition of type desert-jump-manager +(deftype desert-jump-manager (task-manager) + ((nav-mesh nav-mesh) + (vehicle desjump-vehicle 2 :inline) + (vehicle-count uint8) + (v-free-list (array uint8)) + (total-veh-spawned uint8) + (check-timer time-frame) + (hud-wasdoors-health handle :overlay-at (-> hud 2)) + (generator handle) + (interceptor desjump-vehicle 4 :inline) + (interceptor-count uint8) + (i-free-list (array uint8)) + (interceptor-timer time-frame) + (plane vector :inline) + (last-catapult-pos vector :inline) + (player-can-win? symbol) + ) + (:methods + (spawn-vehicle (_type_ uint vehicle-type) handle) + (spawn-beam-generator (_type_ vector) none) + (damage-airlock (_type_ int) none) + ) + ) + +;; definition for method 3 of type desert-jump-manager +(defmethod inspect ((this desert-jump-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~2Tvehicle[2] @ #x~X~%" (-> this vehicle)) + (format #t "~2Tvehicle-count: ~D~%" (-> this vehicle-count)) + (format #t "~2Tv-free-list: ~A~%" (-> this v-free-list)) + (format #t "~2Ttotal-veh-spawned: ~D~%" (-> this total-veh-spawned)) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (format #t "~2Thud-wasdoors-health: ~D~%" (-> this hud-wasdoors-health)) + (format #t "~2Tgenerator: ~D~%" (-> this generator)) + (format #t "~2Tinterceptor[4] @ #x~X~%" (-> this interceptor)) + (format #t "~2Tinterceptor-count: ~D~%" (-> this interceptor-count)) + (format #t "~2Ti-free-list: ~A~%" (-> this i-free-list)) + (format #t "~2Tinterceptor-timer: ~D~%" (-> this interceptor-timer)) + (format #t "~2Tplane: #~%" (-> this plane)) + (format #t "~2Tlast-catapult-pos: #~%" (-> this last-catapult-pos)) + (format #t "~2Tplayer-can-win?: ~A~%" (-> this player-can-win?)) + (label cfg-4) + this + ) + +;; definition for method 30 of type desert-jump-manager +(defmethod taskman-event-handler ((this desert-jump-manager) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (with-pp + (case arg2 + (('notify) + (when (= (-> arg3 param 0) 'attack) + (let ((v1-2 (if (type? arg0 projectile) + (the-as projectile arg0) + ) + ) + ) + (if (and v1-2 (let ((f0-0 (vector-vector-distance-squared (-> v1-2 root trans) *desjump-wasdoors-pos*)) + (f1-0 20480.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (damage-airlock this 1) + ) + ) + ) + ) + (('explode-doors) + (want-display-level *load-state* 'wasdoors 'display) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 5) + 'entity-name + (the-as symbol "camera-398") + 0.0 + 0 + ) + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer pp)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'explode) + (let ((s5-1 send-event-function) + (v1-14 (entity-by-name "wascity-airlock-debris-1")) + ) + (s5-1 + (if v1-14 + (-> v1-14 extra process) + ) + gp-1 + ) + ) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +;; definition for method 34 of type desert-jump-manager +;; WARN: Return type mismatch int vs none. +(defmethod damage-airlock ((this desert-jump-manager) (arg0 int)) + (when #t + (when (not (task-node-closed? (game-task-node desert-jump-mission-protect-doors))) + (cond + ((= arg0 1) + (+! (-> *game-info* health-bar) -0.15) + ) + ((zero? arg0) + (+! (-> *game-info* health-bar) -0.07) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (desert-jump-manager) + :virtual #t + :code (behavior () + (local-vars (v1-33 object) (f30-1 float)) + (set-setting! 'fog-special-interp-rate #f 0.025 0) + (set-setting! 'fog-special-interp-targ #f 0.4 0) + (cond + ((task-node-closed? (game-task-node desert-jump-mission-protect-doors)) + (spawn-beam-generator self (-> *desjump-vehicle-path* 0 (+ (length (-> *desjump-vehicle-path* 0)) -1) pos)) + ) + (else + (if (and *target* (nonzero? (-> *target* pilot))) + (send-event (handle->process (-> *target* pilot vehicle)) 'scale-max-hit-points 2.7) + ) + (let ((gp-1 (the-as entity-actor (entity-by-name "wascity-airlock-5")))) + (when gp-1 + (vector-z-quaternion! (-> self plane) (-> gp-1 quat)) + (set! (-> self plane w) (- (vector-dot (-> self plane) (-> gp-1 extra trans)))) + ) + ) + (until v1-33 + (suspend) + (set! v1-33 (and *target* (< 81920.0 (vector4-dot (-> self plane) (target-pos 0))))) + ) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-load '((ignore all) (allow desjump)) 0.0 0) + (let ((a1-7 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-7 9) #f) + (set! (-> a1-7 8) #f) + (set! (-> a1-7 7) #f) + (set! (-> a1-7 6) #f) + (set! (-> a1-7 5) #f) + (set! (-> a1-7 4) #f) + (set! (-> a1-7 3) 'desertb) + (set! (-> a1-7 2) 'desert-game) + (set! (-> a1-7 1) 'wasdoors) + (set! (-> a1-7 0) 'wasall) + (want-levels *load-state* a1-7) + ) + (set-setting! 'extra-bank '((desert2 desjump1)) 0.0 0) + (until (and (>= (-> self total-veh-spawned) (the-as uint 13)) + (zero? (-> self vehicle-count)) + (-> self player-can-win?) + ) + (when (>= (+ (current-time) (seconds -1)) (-> self interceptor-timer)) + (when (< (-> self interceptor-count) (the-as uint 4)) + (let ((gp-3 15)) + (dotimes (v1-56 4) + (let ((a0-25 (-> self interceptor v1-56))) + (if (!= (-> a0-25 handle) #f) + (set! gp-3 (logior gp-3 (ash 1 (the-as int (-> a0-25 path-type))))) + ) + ) + ) + (spawn-vehicle + self + (the-as uint (rand-vu-int-count-excluding (length *desjump-vehicle-path*) gp-3)) + (vehicle-type v-marauder) + ) + ) + (set-time! (-> self interceptor-timer)) + ) + ) + (when (>= (+ (current-time) (seconds -7)) (-> self check-timer)) + (when (and (< (-> self vehicle-count) (the-as uint 2)) (< (-> self total-veh-spawned) (the-as uint 13))) + (let ((gp-4 4080)) + (dotimes (v1-72 2) + (let ((a0-36 (-> self vehicle v1-72))) + (if (!= (-> a0-36 handle) #f) + (set! gp-4 (logior gp-4 (ash 1 (the-as int (-> a0-36 path-type))))) + ) + ) + ) + (if (= (-> self total-veh-spawned) 12) + (set! gp-4 (logior gp-4 2)) + ) + (spawn-vehicle + self + (the-as uint (rand-vu-int-count-excluding (length *desjump-vehicle-path*) gp-4)) + (vehicle-type v-catapult) + ) + ) + ) + (set-time! (-> self check-timer)) + ) + (suspend) + ) + ) + ) + (send-event (handle->process (-> self hud-wasdoors-health)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (when (not (task-node-closed? (game-task-node desert-jump-mission-protect-doors))) + (remove-setting! 'exclusive-load) + (spawn-beam-generator self (-> self last-catapult-pos)) + (task-node-close! (game-task-node desert-jump-mission-protect-doors) 'event) + ) + (set-setting! 'fog-special-interp-rate #f 0.05 0) + (set-setting! 'fog-special-interp-targ #f 0.1 0) + (while (or (handle->process (-> self generator)) (nonzero? (-> self interceptor-count))) + (dotimes (gp-5 4) + (let ((s5-3 (-> self interceptor gp-5))) + (when (!= (-> s5-3 handle) #f) + (let* ((s4-2 (handle->process (-> s5-3 handle))) + (a0-63 (if (type? s4-2 process-focusable) + s4-2 + ) + ) + ) + (when a0-63 + (cond + ((-> s5-3 kamikaze?) + (send-event + a0-63 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker-velocity (new 'static 'vector :w 1.0)) + ) + ) + ) + (set! (-> self interceptor gp-5 handle) (the-as handle #f)) + (+! (-> self interceptor-count) -1) + (let ((s5-4 (-> self i-free-list))) + (set! (-> s5-4 (length s5-4)) (the-as uint gp-5)) + (+! (-> s5-4 length) 1) + ) + ) + ((not (logtest? (-> (the-as process-focusable a0-63) draw status) (draw-control-status on-screen))) + (send-event a0-63 'go-die) + ) + ) + ) + ) + ) + ) + ) + (suspend) + ) + (when (handle->process (-> *game-info* dust-storm)) + 1.0 + (let ((gp-6 (-> *game-info* dust-storm))) + (until (>= 0.1 f30-1) + (let ((a1-34 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-34 from) (process->ppointer self)) + (set! (-> a1-34 num-params) 0) + (set! (-> a1-34 message) 'get-intensity) + (let ((t9-31 send-event-function) + (a0-75 (handle->process gp-6)) + ) + (set! f30-1 (the-as float (t9-31 a0-75 a1-34))) + ) + ) + (suspend) + ) + ) + ) + (let ((gp-7 (current-time))) + (until (time-elapsed? gp-7 (seconds 2)) + (suspend) + ) + ) + (send-event self 'complete) + ) + :post (behavior () + (set! (-> *game-info* counter) + (the float (- 13 (the-as int (- (-> self total-veh-spawned) (-> self vehicle-count))))) + ) + 0 + ) + ) + +;; definition for method 26 of type desert-jump-manager +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod task-manager-method-26 ((this desert-jump-manager)) + (with-pp + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (>= 0.0 (-> *game-info* health-bar)) + (want-display-level *load-state* 'wasdoors 'display) + (set-setting! 'entity-name "camera-398" 0.0 0) + (let ((s5-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-0 from) (process->ppointer pp)) + (set! (-> s5-0 num-params) 0) + (set! (-> s5-0 message) 'explode) + (let ((s4-0 send-event-function) + (v1-9 (entity-by-name "wascity-airlock-debris-1")) + ) + (s4-0 + (if v1-9 + (-> v1-9 extra process) + ) + s5-0 + ) + ) + ) + (send-event this 'fail) + ) + (dotimes (s5-1 2) + (let* ((s4-1 (-> this vehicle s5-1)) + (v1-17 (-> s4-1 handle)) + ) + (when (!= v1-17 #f) + (let* ((s2-0 (handle->process v1-17)) + (s3-0 (if (type? s2-0 process-focusable) + (the-as process-focusable s2-0) + ) + ) + ) + (cond + ((and s3-0 (not (logtest? (-> s3-0 focus-status) (focus-status dead)))) + (set! (-> this last-catapult-pos quad) (-> s3-0 root trans quad)) + (let ((s1-0 (-> *desjump-vehicle-path* (-> s4-1 path-type) (-> s4-1 path-pos))) + (s2-1 (= (+ (length (-> *desjump-vehicle-path* (-> s4-1 path-type))) -1) (-> s4-1 path-pos))) + ) + (let ((f30-0 (vector-vector-distance-squared (-> s1-0 pos) (-> s3-0 root trans)))) + (when (and (not s2-1) (let ((f0-1 81920.0)) + (< f30-0 (* f0-1 f0-1)) + ) + ) + (+! (-> s4-1 path-pos) 1) + (send-event + s3-0 + 'ai-set-target-position + (-> *desjump-vehicle-path* (-> s4-1 path-type) (-> s4-1 path-pos) pos) + ) + (send-event s3-0 'ai-set-target-speed 163840.0) + (if *target* + (send-event s3-0 'ai-set-target-process *target*) + ) + ) + (when (and s2-1 + (let ((f0-4 122880.0)) + (< f30-0 (* f0-4 f0-4)) + ) + (not (-> s4-1 ready?)) + ) + (send-event s3-0 'ai-set-mode 0) + (send-event s3-0 'ai-set-target-speed 0) + (set-time! (-> s4-1 wait-timer)) + (set! (-> s4-1 ready?) #t) + (when (= (-> this total-veh-spawned) 13) + (send-event s3-0 'ignore-damage #f) + (send-event s3-0 'ignore-impulse #f) + ) + ) + ) + (when (and s2-1 + (-> s4-1 ready?) + (time-elapsed? (-> s4-1 wait-timer) (seconds 10)) + (not (focus-test? s3-0 inactive)) + (let ((a0-49 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 root quat))) + (a1-17 (vector-! (new 'stack-no-clear 'vector) *desjump-wasdoors-pos* (-> s3-0 root trans))) + ) + (< (vector-vector-angle-safe a0-49 a1-17) 5461.3335) + ) + ) + (send-event s3-0 'launch *desjump-wasdoors-pos* this) + (set-time! (-> s4-1 wait-timer)) + (if (>= 0.15 (-> *game-info* health-bar)) + (set! (-> this player-can-win?) #f) + ) + ) + ) + ) + (else + (set! (-> this vehicle s5-1 handle) (the-as handle #f)) + (+! (-> this vehicle-count) -1) + (let ((s4-2 (-> this v-free-list))) + (set! (-> s4-2 (length s4-2)) (the-as uint s5-1)) + (+! (-> s4-2 length) 1) + ) + ) + ) + ) + ) + ) + ) + (dotimes (s5-2 4) + (let* ((s3-1 (-> this interceptor s5-2)) + (v1-119 (-> s3-1 handle)) + ) + (when (!= v1-119 #f) + (let* ((s2-2 (handle->process v1-119)) + (s4-3 (if (type? s2-2 process-focusable) + s2-2 + ) + ) + ) + (cond + ((and (the-as process-focusable s4-3) + (not (logtest? (-> (the-as process-focusable s4-3) focus-status) (focus-status dead))) + ) + (let* ((s1-1 (-> *desjump-vehicle-path* (-> s3-1 path-type) (-> s3-1 path-pos))) + (s2-3 (= (+ (length (-> *desjump-vehicle-path* (-> s3-1 path-type))) -1) (-> s3-1 path-pos))) + (f0-9 (vector-vector-distance-squared (-> s1-1 pos) (-> (the-as process-focusable s4-3) root trans))) + ) + (cond + ((-> s3-1 kamikaze?) + (when (and (not s2-3) (let ((f1-3 81920.0)) + (< f0-9 (* f1-3 f1-3)) + ) + ) + (+! (-> s3-1 path-pos) 1) + (send-event + s4-3 + 'ai-set-target-position + (-> *desjump-vehicle-path* (-> s3-1 path-type) (-> s3-1 path-pos) pos) + ) + (send-event s4-3 'ai-set-target-speed 163840.0) + ) + (when (and s2-3 (not (-> s3-1 ready?))) + (send-event s4-3 'ai-ignore-nav-mesh #t) + (send-event + s4-3 + 'ai-set-target-position + (-> *desjump-vehicle-path* (-> s3-1 path-type) (-> s3-1 path-pos) pos) + ) + (send-event s4-3 'ai-set-target-speed 245760.0) + (set! (-> s3-1 ready?) #t) + ) + (when (and s2-3 + (-> s3-1 ready?) + (< (vector4-dot (-> this plane) (-> (the-as process-focusable s4-3) root trans)) 61440.0) + ) + (send-event + s4-3 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker-velocity (new 'static 'vector :w 1.0)) + ) + ) + ) + (damage-airlock this 0) + (set! (-> this interceptor s5-2 handle) (the-as handle #f)) + (+! (-> this interceptor-count) -1) + (let ((s4-4 (-> this i-free-list))) + (set! (-> s4-4 (length s4-4)) (the-as uint s5-2)) + (+! (-> s4-4 length) 1) + ) + ) + ) + (else + (when (and (time-elapsed? (-> s3-1 wait-timer) (seconds 3)) *target*) + (send-event s4-3 'ai-set-target-process *target*) + (send-event s4-3 'ai-set-target-speed 163840.0) + (send-event s4-3 'ai-set-target-position (target-pos 0)) + (set-time! (-> s3-1 wait-timer)) + ) + ) + ) + ) + ) + (else + (set! (-> this interceptor s5-2 handle) (the-as handle #f)) + (+! (-> this interceptor-count) -1) + (let ((s4-5 (-> this i-free-list))) + (set! (-> s4-5 (length s4-5)) (the-as uint s5-2)) + (+! (-> s4-5 length) 1) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 33 of type desert-jump-manager +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spawn-beam-generator ((this desert-jump-manager) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg0 quad)) + (+! (-> s5-0 y) 8192.0) + (set! (-> this generator) + (ppointer->handle (process-spawn beam-generator s5-0 (-> this entity) :name "beam-generator" :to this)) + ) + ) + 0 + (none) + ) + +;; definition for function part-tracker-check-parent +(defun part-tracker-check-parent ((arg0 part-tracker)) + (let ((v1-1 (-> arg0 parent 0))) + (when (and v1-1 (-> v1-1 next-state) (= (-> v1-1 next-state name) 'explode-into-nothing)) + (set! (-> arg0 linger-duration) (seconds 6)) + (send-event arg0 'draw #f) + ) + ) + ) + +;; definition for method 32 of type desert-jump-manager +;; INFO: Used lq/sq +(defmethod spawn-vehicle ((this desert-jump-manager) (arg0 uint) (arg1 vehicle-type)) + (let ((gp-0 (if (= arg1 (vehicle-type v-catapult)) + (-> this v-free-list) + (-> this i-free-list) + ) + ) + ) + (when (nonzero? (length gp-0)) + (let* ((v1-8 (-> gp-0 (+ (length gp-0) -1))) + (s5-0 (if (= arg1 (vehicle-type v-catapult)) + (-> this vehicle v1-8) + (-> this interceptor v1-8) + ) + ) + (s2-0 (-> *desjump-vehicle-path* arg0 0)) + (s0-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0)) + ) + (vector-z-quaternion! (-> s0-0 vec) (-> s2-0 quat)) + (vector-float*! (-> s0-0 vec) (-> s0-0 vec) 204800.0) + (set! (-> s0-0 params object-type) (traffic-type guard-a)) + (set! (-> s0-0 params behavior) (the-as uint 3)) + (set! (-> s0-0 params id) (the-as uint 0)) + (set! (-> s0-0 params nav-mesh) (-> this nav-mesh)) + (set! (-> s0-0 params nav-branch) #f) + (set! (-> s0-0 params proc) #f) + (set! (-> s0-0 params handle) (the-as handle #f)) + (set! (-> s0-0 params user-data) (the-as uint 0)) + (set! (-> s0-0 params flags) (traffic-spawn-flags)) + (set! (-> s0-0 params guard-type) (the-as uint 11)) + (set! (-> s0-0 params entity) #f) + (set! (-> s0-0 params velocity quad) (-> s0-0 vec quad)) + (set! (-> s0-0 params position quad) (-> s2-0 pos quad)) + (quaternion-copy! (-> s0-0 params rotation) (-> s2-0 quat)) + (let ((s2-1 (vehicle-spawn arg1 (-> s0-0 params)))) + (when s2-1 + (set! (-> s5-0 path-type) arg0) + (set! (-> s5-0 path-pos) (the-as uint 0)) + (set! (-> s5-0 handle) (process->handle s2-1)) + (set! (-> s5-0 ready?) #f) + (cond + ((= arg1 (vehicle-type v-catapult)) + (+! (-> this vehicle-count) 1) + (+! (-> this total-veh-spawned) 1) + ) + (else + (+! (-> this interceptor-count) 1) + (set! (-> s5-0 kamikaze?) (rand-vu-percent? 0.3)) + (cond + ((-> s5-0 kamikaze?) + (set! (-> (the-as wvehicle s2-1) minimap) + (add-icon! *minimap* s2-1 (the-as uint 128) (the-as int #f) (the-as vector #t) 0) + ) + (if (logtest? (-> *part-group-id-table* 453 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to s2-1 + :group (-> *part-group-id-table* 453) + :duration -1 + :callback (the-as (function part-tracker vector) part-tracker-check-parent) + :target s2-1 + :mat-joint 3 + ) + (part-tracker-spawn + part-tracker + :to s2-1 + :group (-> *part-group-id-table* 453) + :duration -1 + :callback (the-as (function part-tracker vector) part-tracker-check-parent) + :target s2-1 + :mat-joint 3 + ) + ) + ) + (else + ) + ) + ) + ) + (when (not (-> s5-0 kamikaze?)) + (send-event s2-1 'ai-set-attack-delay-factor 4.0) + (send-event s2-1 'ai-set-inaccuracy-factor 2.0) + ) + (when (and (= (-> this total-veh-spawned) 13) (= arg1 (vehicle-type v-catapult))) + (send-event s2-1 'no-pickup) + (send-event s2-1 'ignore-damage #t) + (send-event s2-1 'ignore-impulse #t) + ) + (+! (-> gp-0 length) -1) + (return (-> s5-0 handle)) + ) + ) + ) + ) + ) + (the-as handle #f) + ) + +;; definition for method 21 of type desert-jump-manager +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this desert-jump-manager)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'music 'oasisfi 0.0 0) + (set! (-> *game-info* health-bar) 1.0) + (set! (-> *game-info* health-bar-owner) (process->handle this)) + (set! (-> this hud-wasdoors-health) + (ppointer->handle + (process-spawn hud-wasdoors-health :init hud-init-by-other :name "hud-wasdoors-health" :to this) + ) + ) + (set! (-> this hud-counter) + (ppointer->handle + (process-spawn hud-desert-catapult-count :init hud-init-by-other :name "hud-desert-catapult-count" :to this) + ) + ) + (set! (-> this nav-mesh) (get-nav-mesh (the-as actor-id #xa7d6))) + (set! (-> this v-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 2)) + (dotimes (v1-19 2) + (set! (-> this vehicle v1-19 handle) (the-as handle #f)) + (set! (-> this vehicle v1-19 ready?) #f) + (set! (-> this v-free-list v1-19) (the-as uint v1-19)) + ) + (set! (-> this v-free-list length) 2) + (set! (-> this i-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 4)) + (dotimes (v1-24 4) + (set! (-> this interceptor v1-24 handle) (the-as handle #f)) + (set! (-> this interceptor v1-24 ready?) #f) + (set! (-> this i-free-list v1-24) (the-as uint v1-24)) + ) + (set! (-> this i-free-list length) 4) + (set! (-> this generator) (the-as handle #f)) + (set! (-> this player-can-win?) #t) + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/desert/chase/marauder_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/marauder_REF.gc index 5e160b43dc..20617c4267 100644 --- a/test/decompiler/reference/jak3/levels/desert/chase/marauder_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/chase/marauder_REF.gc @@ -1588,8 +1588,8 @@ ) ;; definition for method 65 of type marauder -(defmethod penetrate->next-state ((this marauder)) - ((method-of-type nav-enemy penetrate->next-state) this) +(defmethod penetrate->next-state ((this marauder) (arg0 process) (arg1 event-message-block) (arg2 float)) + ((method-of-type nav-enemy penetrate->next-state) this arg0 arg1 arg2) ) ;; definition for method 62 of type marauder @@ -1936,16 +1936,15 @@ ) ;; definition for method 119 of type marauder -;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-defaults! ((this marauder) (arg0 enemy-info)) - (set! (-> (the-as nav-enemy-info arg0) nav-mesh) *default-nav-mesh*) +;; WARN: Return type mismatch int vs object. +(defmethod init-enemy-defaults! ((this marauder) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) 0 - (none) ) ;; definition for method 120 of type marauder @@ -2241,7 +2240,3 @@ (set! (-> this save) #f) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/chase/wcar-catapult_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/wcar-catapult_REF.gc new file mode 100644 index 0000000000..8a5d811107 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/chase/wcar-catapult_REF.gc @@ -0,0 +1,2418 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult catapult 38 41 + ((39 (meters 999999))) + :bounds (static-spherem 0 0 0 24) + :shadow 40 + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-wheel catapult catapult-wheel-lod0-jg catapult-wheel-idle-ja + ((catapult-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.5) + :longest-edge (meters 1.07) + :shadow catapult-wheel-shadow-mg + ) + +;; definition for symbol *v-catapult-turret-control-info*, type turret-control-info +(define *v-catapult-turret-control-info* (new 'static 'turret-control-info + :joint-index 59 + :barrel-count 1 + :shot-speed 819200.0 + :attack-range 819200.0 + :damage 2.0 + :vehicle-damage-factor 1.0 + :vehicle-impulse-factor 1.0 + :rot-min (new 'static 'array float 2 -1820.4445 -16384.0) + :rot-max (new 'static 'array float 2 16384.0 16384.0) + :local-pos (new 'static 'vector :z 4096.0 :w 1.0) + :local-dir (new 'static 'vector :z 1.0 :w 1.0) + :barrel-array (new 'static 'inline-array turret-barrel-info 4 + (new 'static 'turret-barrel-info + :local-pos (new 'static 'vector :w 1.0) + :local-dir (new 'static 'vector :z 1.0 :w 1.0) + ) + (new 'static 'turret-barrel-info) + (new 'static 'turret-barrel-info) + (new 'static 'turret-barrel-info) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *v-catapult-turret-control-info* shot-type) v-marauder-shot) + +;; definition for symbol *v-catapult-turret-guard-settings*, type squad-unit-settings +(define *v-catapult-turret-guard-settings* (new 'static 'squad-unit-settings + :shot-count 2 + :rand-shot-count 2 + :inaccuracy 0.5 + :acquire-delay (seconds 0.2) + :shot-delay (seconds 0.1) + :burst-delay (seconds 0.5) + :rand-burst-delay (seconds 1) + :rand-shot-delay (seconds 0.2) + ) + ) + +;; failed to figure out what this is: +(set! (-> *v-catapult-constants* debris) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-ring") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-nut") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-rod") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-v-marauder-debris-panel") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-v-marauder-debris-panel") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "inter-pieces") + :art-level 'wasall + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-longspike catapult catapult-debris-longspike-lod0-jg -1 + ((catapult-debris-longspike-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; definition for symbol *v-catapult-debris-longspike-params*, type debris-static-params +(define *v-catapult-debris-longspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 29 :group "skel-v-catapult-debris-longspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-bar catapult catapult-debris-bar-lod0-jg -1 + ((catapult-debris-bar-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +;; definition for symbol *v-catapult-debris-bar-params*, type debris-static-params +(define *v-catapult-debris-bar-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 18 :group "skel-v-catapult-debris-bar") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-panel catapult catapult-debris-panel-lod0-jg -1 + ((catapult-debris-panel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; definition for symbol *v-catapult-debris-lpanel-params*, type debris-static-params +(define *v-catapult-debris-lpanel-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-v-catapult-debris-panel") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rpanel-params*, type debris-static-params +(define *v-catapult-debris-rpanel-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-v-catapult-debris-panel") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-bumper catapult catapult-debris-bumper-lod0-jg -1 + ((catapult-debris-bumper-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) + +;; definition for symbol *v-catapult-debris-lbumperspikes-params*, type debris-static-params +(define *v-catapult-debris-lbumperspikes-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 17 :group "skel-v-catapult-debris-bumper") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rbumperspikes-params*, type debris-static-params +(define *v-catapult-debris-rbumperspikes-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 16 :group "skel-v-catapult-debris-bumper") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-smlspike catapult catapult-debris-smlspike-lod0-jg -1 + ((catapult-debris-smlspike-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; definition for symbol *v-catapult-debris-lfspike-params*, type debris-static-params +(define *v-catapult-debris-lfspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rfspike-params*, type debris-static-params +(define *v-catapult-debris-rfspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-ltopspike-params*, type debris-static-params +(define *v-catapult-debris-ltopspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 15 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rtopspike-params*, type debris-static-params +(define *v-catapult-debris-rtopspike-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-lsidespikea-params*, type debris-static-params +(define *v-catapult-debris-lsidespikea-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 24 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-lsidespikeb-params*, type debris-static-params +(define *v-catapult-debris-lsidespikeb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 25 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-lsidespikec-params*, type debris-static-params +(define *v-catapult-debris-lsidespikec-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 26 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-lsidespiked-params*, type debris-static-params +(define *v-catapult-debris-lsidespiked-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 27 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-lsidespikee-params*, type debris-static-params +(define *v-catapult-debris-lsidespikee-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 28 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rsidespikea-params*, type debris-static-params +(define *v-catapult-debris-rsidespikea-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 19 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rsidespikeb-params*, type debris-static-params +(define *v-catapult-debris-rsidespikeb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 20 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rsidespikec-params*, type debris-static-params +(define *v-catapult-debris-rsidespikec-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 21 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rsidespiked-params*, type debris-static-params +(define *v-catapult-debris-rsidespiked-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 22 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rsidespikee-params*, type debris-static-params +(define *v-catapult-debris-rsidespikee-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 23 :group "skel-v-catapult-debris-smlspike") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-frontpanel-a catapult catapult-debris-frontpanel-a-lod0-jg -1 + ((catapult-debris-frontpanel-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lfpanela-params*, type debris-static-params +(define *v-catapult-debris-lfpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 33 :group "skel-v-catapult-debris-frontpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rfpanela-params*, type debris-static-params +(define *v-catapult-debris-rfpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 45 :group "skel-v-catapult-debris-frontpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-frontpanel-b catapult catapult-debris-frontpanel-b-lod0-jg -1 + ((catapult-debris-frontpanel-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lfpanelb-params*, type debris-static-params +(define *v-catapult-debris-lfpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 34 :group "skel-v-catapult-debris-frontpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rfpanelb-params*, type debris-static-params +(define *v-catapult-debris-rfpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 46 :group "skel-v-catapult-debris-frontpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-frontpanel-c catapult catapult-debris-frontpanel-c-lod0-jg -1 + ((catapult-debris-frontpanel-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lfpanelc-params*, type debris-static-params +(define *v-catapult-debris-lfpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 35 :group "skel-v-catapult-debris-frontpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rfpanelc-params*, type debris-static-params +(define *v-catapult-debris-rfpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 47 :group "skel-v-catapult-debris-frontpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-frontpanel-d catapult catapult-debris-frontpanel-d-lod0-jg -1 + ((catapult-debris-frontpanel-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lfpaneld-params*, type debris-static-params +(define *v-catapult-debris-lfpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 36 :group "skel-v-catapult-debris-frontpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rfpaneld-params*, type debris-static-params +(define *v-catapult-debris-rfpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 48 :group "skel-v-catapult-debris-frontpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-midpanel-a catapult catapult-debris-midpanel-a-lod0-jg -1 + ((catapult-debris-midpanel-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lmpanela-params*, type debris-static-params +(define *v-catapult-debris-lmpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 37 :group "skel-v-catapult-debris-midpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rmpanela-params*, type debris-static-params +(define *v-catapult-debris-rmpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 49 :group "skel-v-catapult-debris-midpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-midpanel-b catapult catapult-debris-midpanel-b-lod0-jg -1 + ((catapult-debris-midpanel-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lmpanelb-params*, type debris-static-params +(define *v-catapult-debris-lmpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 38 :group "skel-v-catapult-debris-midpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rmpanelb-params*, type debris-static-params +(define *v-catapult-debris-rmpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 50 :group "skel-v-catapult-debris-midpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-midpanel-c catapult catapult-debris-midpanel-c-lod0-jg -1 + ((catapult-debris-midpanel-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lmpanelc-params*, type debris-static-params +(define *v-catapult-debris-lmpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 39 :group "skel-v-catapult-debris-midpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rmpanelc-params*, type debris-static-params +(define *v-catapult-debris-rmpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 51 :group "skel-v-catapult-debris-midpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-midpanel-d catapult catapult-debris-midpanel-d-lod0-jg -1 + ((catapult-debris-midpanel-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lmpaneld-params*, type debris-static-params +(define *v-catapult-debris-lmpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 40 :group "skel-v-catapult-debris-midpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rmpaneld-params*, type debris-static-params +(define *v-catapult-debris-rmpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 52 :group "skel-v-catapult-debris-midpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-rearpanel-a catapult catapult-debris-rearpanel-a-lod0-jg -1 + ((catapult-debris-rearpanel-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lrpanela-params*, type debris-static-params +(define *v-catapult-debris-lrpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 41 :group "skel-v-catapult-debris-rearpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rrpanela-params*, type debris-static-params +(define *v-catapult-debris-rrpanela-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 53 :group "skel-v-catapult-debris-rearpanel-a") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-rearpanel-b catapult catapult-debris-rearpanel-b-lod0-jg -1 + ((catapult-debris-rearpanel-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lrpanelb-params*, type debris-static-params +(define *v-catapult-debris-lrpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 42 :group "skel-v-catapult-debris-rearpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rrpanelb-params*, type debris-static-params +(define *v-catapult-debris-rrpanelb-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 54 :group "skel-v-catapult-debris-rearpanel-b") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-rearpanel-c catapult catapult-debris-rearpanel-c-lod0-jg -1 + ((catapult-debris-rearpanel-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lrpanelc-params*, type debris-static-params +(define *v-catapult-debris-lrpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 43 :group "skel-v-catapult-debris-rearpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rrpanelc-params*, type debris-static-params +(define *v-catapult-debris-rrpanelc-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 55 :group "skel-v-catapult-debris-rearpanel-c") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-catapult-debris-rearpanel-d catapult catapult-debris-rearpanel-d-lod0-jg -1 + ((catapult-debris-rearpanel-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition for symbol *v-catapult-debris-lrpaneld-params*, type debris-static-params +(define *v-catapult-debris-lrpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 44 :group "skel-v-catapult-debris-rearpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for symbol *v-catapult-debris-rrpaneld-params*, type debris-static-params +(define *v-catapult-debris-rrpaneld-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 56 :group "skel-v-catapult-debris-rearpanel-d") + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-v-catapult-shot-chargeup + :id 448 + :linger-duration (seconds 0) + :flags (sp0) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1783 :flags (sp6) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1784 :period (seconds 30) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 1783 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.015555556)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.06666667) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 3)) + (:next-launcher 1785) + ) + ) + +;; failed to figure out what this is: +(defpart 1784 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 0.0) + (:fade-a 0.14222223) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 3)) + (:next-launcher 1785) + ) + ) + +;; failed to figure out what this is: +(defpart 1785 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.85333335) (:flags (sp-cpuinfo-flag-2))) + ) + +;; failed to figure out what this is: +(defpartgroup group-v-catapult-shot-idle + :id 449 + :flags (sp0) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1786 :fade-after (meters 270) :falloff-to (meters 270) :flags (sp6)) + (sp-item 1787 :fade-after (meters 270)) + (sp-item 1788 :fade-after (meters 270)) + ) + ) + +;; failed to figure out what this is: +(defpart 1786 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 20.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 1787 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 60.0 60.0) + (:scalevel-x (meters -0.060000002)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-v-catapult-shot + :id 450 + :flags (sp0) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1789 :flags (sp6)) (sp-item 1790)) + ) + +;; failed to figure out what this is: +(defpart 1789 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 20.0 40.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 1790 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters -0.060000002)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-v-catapult-shot-trail + :id 451 + :flags (sp0 sp13) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1788)) + ) + +;; failed to figure out what this is: +(defpart 1788 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 2)) + (:scale-x (meters 3.2) (meters 0.8)) + (:scale-y (meters 2.4) (meters 0.4)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:scalevel-x (meters -0.0053333333) (meters -0.0053333333)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.6666667) + (:fade-b -3.4) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:next-time (seconds 0.25)) + (:next-launcher 1791) + (:rotate-y (degrees 0) (degrees 3600)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1791 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.48 -0.48)) + ) + +;; failed to figure out what this is: +(defpartgroup group-v-catapult-shot-explosion + :id 452 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 1793 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1794 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1795 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1796 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1797 :period (seconds 30) :length (seconds 0.035)) + (sp-item 1798 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1799 :period (seconds 30) :length (seconds 0.167)) + (sp-item 1800 :period (seconds 30) :length (seconds 0.5)) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1801 :flags (sp3) :binding 1792) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 1792 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 1793 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 30.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1794 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0 20.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1795 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 20.0 10.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.114285715) + (:fade-b -0.042857144) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1796 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1797 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-v-catapult-shot-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-v-catapult-shot-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 1797 init-specs 14 initial-valuef) + (the-as float *part-v-catapult-shot-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* color-start) *range-ftexplo-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* alpha-start) *range-ftexplo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* scale-x-start) *range-ftexplo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* scale-y-start) *range-ftexplo-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* a-scalar) *curve-ftexplo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* scale-x-scalar) + *curve-ftexplo-dust-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-dust-in-curve-settings* scale-y-scalar) + *curve-ftexplo-dust-scale-y* + ) + +;; failed to figure out what this is: +(defpart 1799 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1800 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-v-catapult-shot-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-v-catapult-shot-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 1800 init-specs 16 initial-valuef) + (the-as float *part-v-catapult-shot-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* color-start) *range-ftexplo-color*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* alpha-start) *range-ftexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* scale-x-start) *range-ftexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* scale-y-start) *range-ftexplo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* a-scalar) *curve-ftexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* scale-x-scalar) *curve-ftexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-v-catapult-shot-explosion-texture-curve-settings* scale-y-scalar) *curve-ftexplo-scale-y*) + +;; failed to figure out what this is: +(defpart 1798 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1801 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.02) (meters -0.02)) + (:rotvel-z (degrees -300) (degrees 600)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.001)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 70)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1792 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 50.0) + (:a 128.0) + (:fade-r -0.85333335) + (:fade-g -0.6666667) + (:fade-b -0.5) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-catapult-shot-sphere gun gun-red-sphere-lod0-jg gun-red-sphere-idle-ja + ((gun-red-sphere-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + :texture-level 10 + :sort 4 + ) + +;; definition of type catapult-shot-sphere +(deftype catapult-shot-sphere (process-drawable) + ((current-alpha float) + (pad uint8 12) + ) + (:state-methods + active + ) + ) + +;; definition for method 3 of type catapult-shot-sphere +(defmethod inspect ((this catapult-shot-sphere)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tcurrent-alpha: ~f~%" (-> this current-alpha)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (label cfg-4) + this + ) + +;; definition of type catapult-shot-sphere-init-params +(deftype catapult-shot-sphere-init-params (structure) + ((pos vector :inline) + ) + ) + +;; definition for method 3 of type catapult-shot-sphere-init-params +(defmethod inspect ((this catapult-shot-sphere-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'catapult-shot-sphere-init-params) + (format #t "~1Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; definition for function catapult-shot-sphere-init-by-other +;; INFO: Used lq/sq +(defbehavior catapult-shot-sphere-init-by-other catapult-shot-sphere ((arg0 catapult-shot-sphere-init-params)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-catapult-shot-sphere" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-identity! (-> self root quat)) + (go-virtual active) + ) + +;; failed to figure out what this is: +(defstate active (catapult-shot-sphere) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (math-camera-matrix)) + (v1-0 (-> a2-0 rvec quad)) + (a0-0 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-0) + (set! (-> gp-0 uvec quad) a0-0) + (set! (-> gp-0 fvec quad) a1-0) + (set! (-> gp-0 trans quad) a2-1) + ) + (-> gp-0 fvec) + (-> gp-0 rvec) + (matrix->quat gp-0 (-> self root quat)) + ) + (set! (-> self current-alpha) (* 0.008333334 (the float (- (current-time) (-> self state-time))))) + (let ((f0-3 (+ (-> self root scale x) (* 24.0 (seconds-per-frame))))) + (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self draw art-group data 77) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! (-> self draw art-group data 78) :num! (seek! max 5.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 5.0)) + ) + (deactivate self) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(when (or (zero? *v-catapult-shot-impact-blur*) (!= loading-level global)) + (set! *v-catapult-shot-impact-blur* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *v-catapult-shot-impact-blur* 3 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *v-catapult-shot-impact-blur* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *v-catapult-shot-impact-blur* pts data 0 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *v-catapult-shot-impact-blur* pts data 1 first) 0.2) + +;; failed to figure out what this is: +(set! (-> *v-catapult-shot-impact-blur* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *v-catapult-shot-impact-blur* pts data 2 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *v-catapult-shot-impact-blur* pts data 2 second) 0.0) + +;; definition of type v-catapult-shot +(deftype v-catapult-shot (metalhead-grenade-shot) + ((trail-part sparticle-launch-control) + ) + ) + +;; definition for method 3 of type v-catapult-shot +(defmethod inspect ((this v-catapult-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type metalhead-grenade-shot inspect))) + (t9-0 this) + ) + (format #t "~2Ttrail-part: ~A~%" (-> this trail-part)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate impact (v-catapult-shot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type metalhead-grenade-shot impact) enter))) + (if t9-0 + (t9-0) + ) + ) + (send-event (handle->process (-> self desired-target)) 'die) + ) + ) + +;; definition for method 25 of type v-catapult-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this v-catapult-shot)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) + ) + (if (nonzero? (-> this trail-part)) + (push-back (-> this trail-part) (-> this root trans)) + ) + 0 + (none) + ) + +;; definition for method 39 of type v-catapult-shot +;; WARN: Return type mismatch object vs none. +(defmethod projectile-method-39 ((this v-catapult-shot)) + (let ((t9-0 (method-of-type metalhead-grenade-shot projectile-method-39))) + (t9-0 this) + ) + (send-event (handle->process (-> this desired-target)) 'update (-> this root trans)) + (none) + ) + +;; definition for method 26 of type v-catapult-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this v-catapult-shot)) + (cond + ((logtest? (-> *part-group-id-table* 452 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 452)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 452)) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type v-catapult-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this v-catapult-shot) (arg0 projectile-options)) + (case arg0 + (((projectile-options po0)) + (if (task-node-closed? (game-task-node desert-chase-marauders-get-to-stronghold)) + (sound-play "firebomb") + (sound-play "proj-incoming") + ) + ) + (((projectile-options po0 po1)) + (let ((f0-0 (vector-vector-distance-squared (-> this self root trans) (-> this desired-target-pos))) + (f1-0 614400.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let ((a0-9 (static-sound-spec "incoming" :group 0 :volume 0.0))) + (set! (-> a0-9 volume) 1024) + (sound-play-by-spec a0-9 (-> this sound-id) (-> this root trans)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 7 of type v-catapult-shot +;; WARN: Return type mismatch metalhead-grenade-shot vs v-catapult-shot. +(defmethod relocate ((this v-catapult-shot) (offset int)) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) offset) + ) + (the-as v-catapult-shot ((method-of-type metalhead-grenade-shot relocate) this offset)) + ) + +;; definition for method 40 of type v-catapult-shot +(defmethod projectile-method-40 ((this v-catapult-shot)) + 512 + ) + +;; definition for method 31 of type v-catapult-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-proj-settings! ((this v-catapult-shot)) + (with-pp + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this blast-radius) 20480.0) + (set! (-> this max-speed) 135168.0) + (set! (-> this update-velocity) projectile-update-velocity-add-gravity) + (set! (-> this move) gren-canister-move) + (set! (-> this root dynam gravity y) 102400.0) + (set! (-> this root dynam gravity-length) 102400.0) + (set! (-> this root dynam gravity-max) 102400.0) + (let ((f0-5 1092.2667)) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-5) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 450) this)) + pp + (set! (-> this trail-part) + (the-as + sparticle-launch-control + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 1788) 5.0) + ) + ) + (set! (-> this sound-id) (new-sound-id)) + (none) + ) + ) + +;; definition of type v-catapult +(deftype v-catapult (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-gun-x joint-mod-rotate-local :inline) + (jmod-gun-y joint-mod-rotate-local :inline) + (turret-control turret-control :inline) + (sub-state-time uint32) + (sub-state int8) + (launch-projectile? symbol) + (targ-pos vector :inline) + (notify-handle handle) + (spawn-part? symbol) + (charge-time time-frame) + (exploding? symbol) + ) + (:methods + (fire-catapult-shot (_type_ vector vector) none) + (v-catapult-method-204 (_type_) symbol) + ) + ) + +;; definition for method 3 of type v-catapult +(defmethod inspect ((this v-catapult)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-base inspect))) + (t9-0 this) + ) + (format #t "~2Tjmod-axles[4] @ #x~X~%" (-> this jmod-axles)) + (format #t "~2Tjmod-gun-x: #~%" (-> this jmod-gun-x)) + (format #t "~2Tjmod-gun-y: #~%" (-> this jmod-gun-y)) + (format #t "~2Tturret-control: #~%" (-> this turret-control)) + (format #t "~2Tsub-state-time: ~D~%" (-> this sub-state-time)) + (format #t "~2Tsub-state: ~D~%" (-> this sub-state)) + (format #t "~2Tlaunch-projectile?: ~A~%" (-> this launch-projectile?)) + (format #t "~2Ttarg-pos: #~%" (-> this targ-pos)) + (format #t "~2Tnotify-handle: ~D~%" (-> this notify-handle)) + (format #t "~2Tspawn-part?: ~A~%" (-> this spawn-part?)) + (format #t "~2Tcharge-time: ~D~%" (-> this charge-time)) + (format #t "~2Texploding?: ~A~%" (-> this exploding?)) + (label cfg-4) + this + ) + +;; definition for method 90 of type v-catapult +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod control-hook-ai ((this v-catapult) (arg0 vehicle-controls)) + (let ((t9-0 (method-of-type wcar-base control-hook-ai))) + (t9-0 this arg0) + ) + (let ((v1-1 (-> this target-status))) + (let ((f0-0 (vector-length (-> v1-1 velocity)))) + (set! (-> this turret-control inaccuracy) (* 0.000012207031 (+ 20480.0 f0-0))) + ) + (turret-control-method-11 (-> this turret-control) this (-> v1-1 position) (-> v1-1 velocity)) + ) + (when (-> this launch-projectile?) + (let ((v1-5 (-> this sub-state))) + (cond + ((zero? v1-5) + (sound-play "proj-launch") + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 42))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 42)) frames num-frames) -1)) + ) + (set! (-> a0-11 param 1) 1.0) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 42)) num-func-seek!) + ) + (+! (-> this sub-state) 1) + ) + ((= v1-5 1) + (when (not (ja-done? 0)) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group frames num-frames) -1))) + (set! (-> a0-15 param 1) 1.0) + (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (when (ja-done? 0) + (set! (-> this sub-state-time) (the-as uint (current-time))) + (+! (-> this sub-state) 1) + ) + ) + ((= v1-5 2) + (when (>= (the-as uint (- (current-time) (the-as int (-> this sub-state-time)))) (the-as uint 900)) + (sound-play "catapult-retrct") + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 43))) + (set! (-> a0-22 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 43)) frames num-frames) -1)) + ) + (set! (-> a0-22 param 1) 1.0) + (set! (-> a0-22 frame-num) 0.0) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 43)) num-func-seek!) + ) + (+! (-> this sub-state) 1) + ) + ) + ((= v1-5 3) + (when (not (ja-done? 0)) + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 param 0) (the float (+ (-> a0-26 frame-group frames num-frames) -1))) + (set! (-> a0-26 param 1) 1.0) + (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (if (ja-done? 0) + (+! (-> this sub-state) 1) + ) + ) + ((= v1-5 4) + (+! (-> this sub-state) 1) + (set! (-> this notify-handle) (the-as handle #f)) + (set-time! (-> this charge-time)) + (logior! (-> this mask) (process-mask actor-pause)) + (let* ((s5-2 (-> this node-list data 7 bone)) + (v1-79 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-2 transform uvec) -12288.0)) + ) + (vector+! v1-79 (-> s5-2 transform trans) v1-79) + (cond + ((logtest? (-> *part-group-id-table* 448 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-79 quad)) + (part-tracker-spawn + part-tracker-subsampler + :to this + :group (-> *part-group-id-table* 448) + :duration (seconds 4) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-79 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 448) :duration (seconds 4)) + ) + ) + ) + ) + ((= v1-5 5) + (when (time-elapsed? (-> this charge-time) (seconds 3)) + (set! (-> this sub-state) 0) + (set! (-> this launch-projectile?) #f) + (set! (-> this spawn-part?) #t) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 203 of type v-catapult +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod fire-catapult-shot ((this v-catapult) (arg0 vector) (arg1 vector)) + (let ((s4-0 (new 'stack-no-clear 'traj2d-params)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (set! (-> s4-0 initial-tilt) 8192.0) + (set! (-> s4-0 gravity) 102400.0) + (vector-! s5-0 arg1 arg0) + (let* ((v1-3 s5-0) + (f0-11 + (* (- (* (sqrtf (+ (* (-> v1-3 x) (-> v1-3 x)) (* (-> v1-3 z) (-> v1-3 z)))) (tan (-> s4-0 initial-tilt))) + (-> s5-0 y) + ) + (/ 2.0 (-> s4-0 gravity)) + ) + ) + ) + (if (< 0.0 f0-11) + (sqrtf f0-11) + ) + ) + (let ((v1-8 s5-0)) + (set! (-> s4-0 x) (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z))))) + ) + (set! (-> s4-0 y) (-> s5-0 y)) + (when (traj2d-calc-initial-speed-using-tilt s4-0) + (let ((s1-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s1-0 ent) (-> this entity)) + (set! (-> s1-0 charge) 1.0) + (set! (-> s1-0 options) (projectile-options)) + (logclear! (-> s1-0 options) (projectile-options po14 po15 po16)) + (set! (-> s1-0 pos quad) (-> arg0 quad)) + (set! (-> s1-0 notify-handle) (process->handle (handle->process (-> this notify-handle)))) + (set! (-> s1-0 owner-handle) (process->handle this)) + (set! (-> s1-0 target-handle) (the-as handle #f)) + (set! (-> s1-0 target-pos quad) (-> arg1 quad)) + (set! (-> s1-0 ignore-handle) (process->handle this)) + (let* ((v1-29 *game-info*) + (a0-22 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-22) + (set! (-> s1-0 attack-id) a0-22) + ) + (set! (-> s1-0 timeout) (seconds 10)) + (set! (-> s1-0 damage) 4.0) + (logior! (-> s1-0 options) (projectile-options po14)) + (let ((s3-1 (new 'stack-no-clear 'quaternion))) + (vector-normalize! s5-0 1.0) + (quaternion-look-at! s3-1 s5-0 *up-vector*) + (quaternion-rotate-local-x! s3-1 s3-1 -8192.0) + (vector-z-quaternion! s5-0 s3-1) + ) + (vector-normalize-copy! (-> s1-0 vel) s5-0 (-> s4-0 initial-speed)) + (spawn-projectile v-catapult-shot s1-0 this *default-dead-pool*) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 34 of type v-catapult +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this v-catapult)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((a0-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 144)))) + (set! (-> a0-15 prim-core action) (collide-action solid)) + (set! (-> a0-15 transform-index) 0) + ) + (let ((a0-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> a0-17 prim-core action) (collide-action solid)) + (set! (-> a0-17 transform-index) 0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-24 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 62 of type v-catapult +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this v-catapult)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 32768.0 :z 15687.68 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -32768.0 :z 15687.68 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 28672.0 :z -24166.4 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -28672.0 :z -24166.4 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 11468.8 :z 26624.0 :w 20480.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 12288.0 :z -3276.8 :w 20480.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 8192.0 :z -26624.0 :w 16384.0)) + 16 + ) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; definition for method 79 of type v-catapult +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this v-catapult)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 3))) + (set-vector! (-> s5-0 2) 1092.2667 1092.2667 0.0 0.0) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((s3-0 (-> this wheel s4-0))) + (-> s3-0 info) + (quaternion-set! + (-> s5-0 0) + 0.0 + 0.0 + (* (-> s3-0 sin-susp-ang) (-> s3-0 x-scale)) + (+ 1.0 (-> s3-0 cos-susp-ang)) + ) + (quaternion-normalize! (-> s5-0 0)) + (quaternion-axis-angle! (-> s5-0 1) 0.0 0.0 (-> s3-0 x-scale) (-> (&-> s5-0 0 data s4-0) 8)) + ) + (let ((v1-10 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-10 rotation) (-> s5-0 0) (-> s5-0 1)) + ) + 0 + ) + ) + (quaternion-axis-angle! (-> this jmod-gun-x rotation) 1.0 0.0 0.0 (- (-> this turret-control aim-rot-x))) + (quaternion-axis-angle! (-> this jmod-gun-y rotation) 0.0 1.0 0.0 (-> this turret-control aim-rot-y)) + 0 + (none) + ) + +;; definition for method 204 of type v-catapult +;; INFO: Used lq/sq +(defmethod v-catapult-method-204 ((this v-catapult)) + (let* ((s4-0 (-> this node-list data 7 bone)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 transform uvec) -12288.0)) + ) + (vector+! s5-0 (-> s4-0 transform trans) s5-0) + (if (and (nonzero? (-> this part)) (-> this spawn-part?)) + (spawn (-> this part) s5-0) + ) + (when (and (not (-> this exploding?)) + *target* + (and (>= 28672.0 (vector-vector-distance s5-0 (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (send-event + this + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker-velocity (new 'static 'vector :w 1.0)) + ) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 452 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 452)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 452)) + ) + ) + (if (and *target* (nonzero? (-> *target* pilot))) + (send-event + (handle->process (-> *target* pilot vehicle)) + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 40.0) (vehicle-impulse-factor 20.0)) + ) + ) + ) + (let ((v0-3 #t)) + (set! (-> this exploding?) v0-3) + v0-3 + ) + ) + ) + ) + +;; definition for method 46 of type v-catapult +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod apply-damage ((this v-catapult) (arg0 float) (arg1 rigid-body-impact)) + (let ((t9-0 (method-of-type wcar-base apply-damage))) + (t9-0 this arg0 arg1) + ) + (let* ((s5-0 (-> this node-list data 3 bone transform)) + (s4-0 (-> this node-list data 3 bone transform fvec)) + (a1-4 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg1 point) (-> this root trans)) 1.0)) + (f0-1 (vector-dot (the-as vector s5-0) a1-4)) + (s5-1 (< 0.0 f0-1)) + (s4-1 (< (vector-vector-angle-safe s4-0 a1-4) 5461.3335)) + (a1-6 (new 'stack 'debris-tuning (the-as uint 1))) + ) + (set! (-> a1-6 fountain-rand-transv-lo quad) (-> this root trans quad)) + (set! (-> a1-6 hit-xz-reaction) 0.95) + (set! (-> a1-6 hit-y-reaction) 0.6) + (set! (-> a1-6 scale-rand-lo) 1.0) + (set! (-> a1-6 scale-rand-hi) 1.0) + (set! (-> a1-6 fountain-rand-transv-hi x) 40960.0) + (set! (-> a1-6 fountain-rand-transv-hi y) 81920.0) + (set! (-> a1-6 fountain-rand-transv-hi z) 8192.0) + (set! (-> a1-6 fountain-rand-transv-hi w) 20480.0) + (set! (-> a1-6 duration) (seconds 0.5)) + (cond + ((and s5-1 s4-1) + (cond + ((not (logtest? (-> this draw seg-mask) 4)) + (debris-spawn this a1-6 *v-catapult-debris-longspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 4) + ) + ((not (logtest? (-> this draw seg-mask) 2)) + (debris-spawn this a1-6 *v-catapult-debris-bar-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 2) + ) + ((not (logtest? (-> this draw seg-mask) 128)) + (debris-spawn this a1-6 *v-catapult-debris-lbumperspikes-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 128) + ) + ((not (logtest? #x10000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lfspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x10000) + ) + ((not (logtest? #x800000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-ltopspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x800000) + ) + ((not (logtest? (-> this draw seg-mask) 4096)) + (debris-spawn this a1-6 *v-catapult-debris-lfpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 4096) + ) + ((not (logtest? (-> this draw seg-mask) 8192)) + (debris-spawn this a1-6 *v-catapult-debris-lfpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 8192) + ) + ((not (logtest? (-> this draw seg-mask) #x4000)) + (debris-spawn this a1-6 *v-catapult-debris-lfpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x4000) + ) + ((not (logtest? (-> this draw seg-mask) #x8000)) + (debris-spawn this a1-6 *v-catapult-debris-lfpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x8000) + ) + ) + ) + (s4-1 + (cond + ((not (logtest? (-> this draw seg-mask) 2)) + (debris-spawn this a1-6 *v-catapult-debris-bar-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 2) + ) + ((not (logtest? #x20000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rbumperspikes-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x20000000) + ) + ((not (logtest? (shl 64 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 64 32)) + ) + ((not (logtest? (shl 4096 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rtopspike-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 4096 32)) + ) + ((not (logtest? (shl 4 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 4 32)) + ) + ((not (logtest? (shl 8 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 8 32)) + ) + ((not (logtest? (shl 16 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 16 32)) + ) + ((not (logtest? (shl 32 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rfpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 32 32)) + ) + ) + ) + (s5-1 + (cond + ((not (logtest? #x40000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespikea-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x40000) + ) + ((not (logtest? #x80000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespikeb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x80000) + ) + ((not (logtest? #x100000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespikec-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x100000) + ) + ((not (logtest? #x200000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespiked-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x200000) + ) + ((not (logtest? #x400000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-lsidespikee-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x400000) + ) + ((not (logtest? (-> this draw seg-mask) 256)) + (debris-spawn this a1-6 *v-catapult-debris-lmpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 256) + ) + ((not (logtest? (-> this draw seg-mask) 512)) + (debris-spawn this a1-6 *v-catapult-debris-lmpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 512) + ) + ((not (logtest? (-> this draw seg-mask) 1024)) + (debris-spawn this a1-6 *v-catapult-debris-lmpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 1024) + ) + ((not (logtest? (-> this draw seg-mask) 2048)) + (debris-spawn this a1-6 *v-catapult-debris-lmpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 2048) + ) + ((not (logtest? (-> this draw seg-mask) 8)) + (debris-spawn this a1-6 *v-catapult-debris-lrpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 8) + ) + ((not (logtest? (-> this draw seg-mask) 16)) + (debris-spawn this a1-6 *v-catapult-debris-lrpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 16) + ) + ((not (logtest? (-> this draw seg-mask) 32)) + (debris-spawn this a1-6 *v-catapult-debris-lrpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 32) + ) + ((not (logtest? (-> this draw seg-mask) 64)) + (debris-spawn this a1-6 *v-catapult-debris-lrpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 64) + ) + ) + ) + (else + (cond + ((not (logtest? (shl 128 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespikea-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 128 32)) + ) + ((not (logtest? (shl 256 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespikeb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 256 32)) + ) + ((not (logtest? (shl 512 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespikec-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 512 32)) + ) + ((not (logtest? (shl 1024 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespiked-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 1024 32)) + ) + ((not (logtest? (shl 2048 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rsidespikee-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 2048 32)) + ) + ((not (logtest? #x40000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rmpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x40000000) + ) + ((not (logtest? (shl #x8000 16) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rmpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl #x8000 16)) + ) + ((not (logtest? (shl 1 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rmpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 1 32)) + ) + ((not (logtest? (shl 2 32) (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rmpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 (shl 2 32)) + ) + ((not (logtest? #x2000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rrpanela-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x2000000) + ) + ((not (logtest? #x4000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rrpanelb-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x4000000) + ) + ((not (logtest? #x8000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rrpanelc-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x8000000) + ) + ((not (logtest? #x10000000 (-> this draw seg-mask))) + (debris-spawn this a1-6 *v-catapult-debris-rrpaneld-params* (the-as process-drawable #f)) + (setup-masks (-> this draw) 0 #x10000000) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 49 of type v-catapult +;; INFO: Used lq/sq +;; WARN: disable def twice: 9. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod rbody-event-handler ((this v-catapult) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('launch) + (let ((a0-2 (the-as vector (-> arg3 param 0))) + (v1-1 (the-as process (-> arg3 param 1))) + ) + (when (and a0-2 v1-1) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this targ-pos quad) (-> a0-2 quad)) + (set! (-> this notify-handle) (process->handle v1-1)) + (let ((v0-0 (the-as object #t))) + (set! (-> this launch-projectile?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + (('event-fire) + (set! (-> this spawn-part?) #f) + (fire-catapult-shot this (-> this node-list data 7 bone transform trans) (-> this targ-pos)) + (let* ((s4-0 (-> this root quat)) + (s5-1 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-0) 40960.0)) + (v1-11 (vector-normalize! (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-0) -409600.0)) + ) + (vector+! s5-1 (-> this root trans) s5-1) + (send-event this 'apply-impulse s5-1 v1-11) + ) + ) + (('event-reset) + (let* ((s4-1 (-> this root quat)) + (s5-3 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-1) -40960.0)) + (v1-13 (vector-normalize! (vector-y-quaternion! (new 'stack-no-clear 'vector) s4-1) -409600.0)) + ) + (vector+! s5-3 (-> this root trans) s5-3) + (send-event this 'apply-impulse s5-3 v1-13) + ) + ) + (else + ((method-of-type wcar-base rbody-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 35 of type v-catapult +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this v-catapult)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-catapult" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-catapult-constants*) + (set! (-> this draw lod-set lod 0 dist) 1105920.0) + (set! (-> this rider-hand-joint-array 0) 3) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-gun-x) this (the-as uint 58) (joint-mod-base-flags attached)) + (init (-> this jmod-gun-y) this (the-as uint 57) (joint-mod-base-flags attached)) + (set-info (-> this turret-control) *v-catapult-turret-control-info*) + (set! (-> this turret-control flags) (-> this turret-control flags)) + (set! (-> this turret-control ignore-handle) (process->handle this)) + (set! (-> this turret-control guard-settings) *v-catapult-turret-guard-settings*) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-catapult-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-catapult-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + (set! (-> this eng-pitch-offset) (rand-vu-float-range -0.5 0.5)) + (set! (-> this launch-projectile?) #f) + (set! (-> this notify-handle) (the-as handle #f)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 449) this)) + (set! (-> this spawn-part?) #t) + (set! (-> this exploding?) #f) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate explode (v-catapult) + :virtual #t + :enter (behavior () + (if (not (logtest? (vehicle-flag vf55) (-> self v-flags))) + (turbo-pickup-spawn (-> self root trans)) + ) + (let ((t9-1 (-> (method-of-type wcar-base explode) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (v-catapult) + :virtual #t + :enter (behavior () + (if (not (-> self minimap)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 129) (the-as int #f) (the-as vector #t) 0)) + ) + (let ((t9-1 (-> (method-of-type wcar-base hostile) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type wcar-base hostile) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (v-catapult-method-204 self) + ) + ) + +;; failed to figure out what this is: +(defstate die (v-catapult) + :virtual #t + :code (behavior () + (kill-by-type vehicle-wheel self) + (while (-> self child) + (suspend) + ) + (let ((t9-1 (-> (method-of-type wcar-base die) code))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/chase/wcar-marauder-b_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/wcar-marauder-b_REF.gc index 67929ca50c..176291683e 100644 --- a/test/decompiler/reference/jak3/levels/desert/chase/wcar-marauder-b_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/chase/wcar-marauder-b_REF.gc @@ -101,7 +101,7 @@ :shadow-bot-clip -32768.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -388,7 +388,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc index 892621ce5c..10ddf8473c 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc @@ -1871,7 +1871,7 @@ ) :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'traffic-object-spawn-params))) - (set! (-> gp-0 object-type) (the-as uint 6)) + (set! (-> gp-0 object-type) (traffic-type guard-a)) (set! (-> gp-0 behavior) (the-as uint 3)) (set! (-> gp-0 id) (the-as uint 0)) (set! (-> gp-0 nav-mesh) #f) diff --git a/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc b/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc index f5e8255fb0..3d5a3ad99d 100644 --- a/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc @@ -367,7 +367,7 @@ ) (vector-z-quaternion! (-> s4-0 vec) (-> s5-1 quat)) (vector-float*! (-> s4-0 vec) (-> s4-0 vec) 204800.0) - (set! (-> s4-0 params object-type) (the-as uint 6)) + (set! (-> s4-0 params object-type) (traffic-type guard-a)) (set! (-> s4-0 params behavior) (the-as uint 3)) (set! (-> s4-0 params id) (the-as uint 0)) (set! (-> s4-0 params nav-mesh) (-> self nav-mesh)) @@ -746,7 +746,7 @@ 204800.0 ) ) - (set! (-> sv-240 params object-type) (the-as uint 6)) + (set! (-> sv-240 params object-type) (traffic-type guard-a)) (set! (-> sv-240 params behavior) (the-as uint 3)) (set! (-> sv-240 params id) (the-as uint 0)) (set! (-> sv-240 params nav-mesh) (-> this nav-mesh)) diff --git a/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc b/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc index 912ae23abc..01c0022f35 100644 --- a/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc @@ -162,7 +162,7 @@ ) (set! (-> s3-0 vec1 quad) (-> s5-0 info start-sphere quad)) (set! (-> s3-0 vec2 quad) (-> s5-0 info start-dir quad)) - (set! (-> s3-0 params object-type) (the-as uint 23)) + (set! (-> s3-0 params object-type) (traffic-type vehicle-task)) (set! (-> s3-0 params behavior) (the-as uint 10)) (set! (-> s3-0 params id) (the-as uint 0)) (set! (-> s3-0 params nav-mesh) #f) diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue-bbush_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue-bbush_REF.gc new file mode 100644 index 0000000000..b755a933e0 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue-bbush_REF.gc @@ -0,0 +1,321 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type task-manager-desert-rescue-bbush +(deftype task-manager-desert-rescue-bbush (task-manager-desert-rescue) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (final-timeout time-frame) + ) + (:state-methods + show-finish + finish-bbush + ) + ) + +;; definition for method 3 of type task-manager-desert-rescue-bbush +(defmethod inspect ((this task-manager-desert-rescue-bbush)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager-desert-rescue inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tfinal-timeout: ~D~%" (-> this final-timeout)) + (label cfg-7) + this + ) + +;; definition for symbol *bbush-passenger-pos*, type (array desert-passenger-info) +(define *bbush-passenger-pos* (new 'loading-level 'boxed-array desert-passenger-info 8)) + +;; failed to figure out what this is: +(dotimes (gp-0 (-> *bbush-passenger-pos* allocated-length)) + (set! (-> *bbush-passenger-pos* gp-0) (new 'loading-level 'desert-passenger-info)) + ) + +;; definition for symbol *__bbush-transport-path__*, type (inline-array vector) +(define *__bbush-transport-path__* (new 'static 'inline-array vector 50 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + +;; failed to figure out what this is: +(dotimes (v1-10 (-> *desresc-transport-path-1* length)) + (set! (-> *__bbush-transport-path__* v1-10 quad) (-> *desresc-transport-path-1* v1-10 pos quad)) + ) + +;; definition for method 46 of type task-manager-desert-rescue-bbush +;; INFO: Used lq/sq +;; WARN: Return type mismatch quaternion vs none. +(defmethod init-transport-params! ((this task-manager-desert-rescue-bbush) (arg0 desert-rescue-transport-init-params)) + (set! (-> arg0 path-pts) *__bbush-transport-path__*) + (set! (-> arg0 num-pts) (-> this desresc-path allocated-length)) + (set! (-> arg0 pos quad) (-> this desresc-path 0 pos quad)) + (set! (-> arg0 desresc-path) (-> this desresc-path)) + (quaternion-identity! (-> arg0 quat)) + (none) + ) + +;; definition for method 21 of type task-manager-desert-rescue-bbush +;; INFO: Used lq/sq +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-desert-rescue-bbush)) + (local-vars (sv-16 res-tag)) + (set-setting! 'pilot-exit #f 0.0 0) + (let ((t1-1 2)) + (set-setting! 'vehicles 'set (shr t1-1 32) t1-1) + ) + (set-setting! 'airlock #f 0.0 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-7 (res-lump-data (entity-by-name "desresc-bbush-info-1") 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-7 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-7)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this passenger-pos) *bbush-passenger-pos*) + (set! (-> this desresc-path) *desresc-transport-path-1*) + (dotimes (s5-1 (-> *passenger-pos* length)) + (mem-copy! (the-as pointer (-> *bbush-passenger-pos* s5-1)) (the-as pointer (-> *passenger-pos* s5-1)) 56) + ) + (set! (-> this passenger-pos length) (-> *passenger-pos* length)) + (when (-> this actor-group) + (dotimes (s5-2 (-> this actor-group 0 length)) + (set! (-> *bbush-passenger-pos* s5-2 passenger-pos quad) + (-> this actor-group 0 data s5-2 actor extra trans quad) + ) + (set! (-> *bbush-passenger-pos* s5-2 beacon-pos quad) + (-> this actor-group 1 data s5-2 actor extra trans quad) + ) + (set! (-> *bbush-passenger-pos* s5-2 is-final?) #f) + (let ((s4-0 + (res-lump-value + (-> this actor-group 0 data s5-2 actor) + 'marauders + uint128 + :default (the-as uint128 3) + :time -1000000000.0 + ) + ) + (v1-47 (the int (* 300.0 (res-lump-float (-> this actor-group 0 data s5-2 actor) 'timeout :default 45.0)))) + ) + (set! (-> *bbush-passenger-pos* s5-2 num-marauders) (the-as int s4-0)) + (set! (-> *bbush-passenger-pos* s5-2 total-time) (the-as time-frame v1-47)) + ) + (set! (-> *bbush-passenger-pos* s5-2 sandstorm-intensity) + (* 0.5 (/ (the float (+ s5-2 1)) (the float (-> this actor-group 0 length)))) + ) + ) + (set! (-> this passenger-pos length) (-> this actor-group 0 length)) + (set! (-> this passenger-pos) *bbush-passenger-pos*) + ) + (let ((a0-41 (entity-by-name "desresc-bbush-info-1"))) + (if a0-41 + (set! (-> this final-timeout) + (the-as time-frame (the int (* 300.0 (res-lump-float a0-41 'timeout :default 60.0)))) + ) + ) + ) + ((method-of-type task-manager set-time-limit) this) + (dotimes (gp-1 3) + (speeches-reset (-> *rescue-speech-array* gp-1)) + ) + (set-setting! 'extra-bank '((desert2 desresc1)) 0.0 0) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-desert-rescue-bbush) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self entity) #f) + (dotimes (v1-4 (-> self passenger-pos length)) + (if (-> self passenger-pos v1-4 is-final?) + (set! (-> self current-passenger-index) v1-4) + ) + ) + (set-setting! 'fog-special-interp-targ #f 0.2 0) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-49 self) + (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x3e4ccccd) + (when (and *target* (focus-test? *target* pilot-riding)) + (set! (-> self jak-vehicle) (process->handle (the-as process (send-event *target* 'get-vehicle)))) + (when (handle->process (-> self jak-vehicle)) + (send-event (handle->process (-> self jak-vehicle)) 'scale-max-hit-points #x3fa66666) + (go-virtual rescue-start) + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate drop-off-passenger (task-manager-desert-rescue-bbush) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('dropped-off) + (task-manager-desert-rescue-method-45 self 2) + (+! (-> self current-passenger-index) 1) + (send-event (handle->process (-> self current-task-arrow)) 'leave) + (if (= (-> self current-passenger-index) (-> self passenger-pos length)) + (go-virtual show-finish) + (go-virtual pickup-passenger) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate show-finish (task-manager-desert-rescue-bbush) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (let ((a0-1 (entity-by-name "des-burning-bush-40"))) + (when a0-1 + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> a0-1 extra trans quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3)) + (set! (-> self current-task-arrow) (process->handle (task-arrow-spawn gp-0 self))) + ) + ) + ) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((v1-0 (entity-by-name "des-burning-bush-40"))) + (when v1-0 + (let ((s5-0 (-> v1-0 extra trans))) + (if (< (vector-vector-xz-distance (target-pos 0) s5-0) 163840.0) + (go-virtual finish-bbush) + ) + ) + ) + ) + (set! (-> *game-info* timer) (- (-> self final-timeout) (- (current-time) (-> self state-time)))) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate finish-bbush (task-manager-desert-rescue-bbush) + :virtual #t + :event task-manager-event-handler + :code (behavior () + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (send-event self 'complete) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate pickup-passenger (task-manager-desert-rescue-bbush) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self current-passenger) (the-as handle #f)) + (task-manager-desert-rescue-method-42 self) + (set-time! (-> self taxi-timer)) + (let ((v1-6 *was-squad-control*)) + (set! (-> v1-6 target-count) (-> self passenger-pos (-> self current-passenger-index) num-marauders)) + ) + ) + ) + +;; definition for method 49 of type task-manager-desert-rescue +;; WARN: Return type mismatch connection vs none. +(defmethod task-manager-desert-rescue-method-49 ((this task-manager-desert-rescue)) + (set-setting! 'music 'desresbb 0.0 0) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc new file mode 100644 index 0000000000..91f755e56e --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc @@ -0,0 +1,2801 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *desert-rescue-speech-list*, type (inline-array talker-speech-class) +(define *desert-rescue-speech-list* (new 'static 'inline-array talker-speech-class 85 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "resc101" + :channel (gui-channel citizen) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc102" + :channel (gui-channel citizen) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc103" + :channel (gui-channel citizen) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc104" + :channel (gui-channel citizen) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc105" + :channel (gui-channel citizen) + :speech #x5 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc106" + :channel (gui-channel citizen) + :speech #x6 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc107" + :channel (gui-channel citizen) + :speech #x7 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc108" + :channel (gui-channel citizen) + :speech #x8 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc109" + :channel (gui-channel citizen) + :speech #x9 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc110" + :channel (gui-channel citizen) + :speech #xa + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc111" + :channel (gui-channel citizen) + :speech #xb + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc112" + :channel (gui-channel citizen) + :speech #xc + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc113" + :channel (gui-channel citizen) + :speech #xd + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc114" + :channel (gui-channel citizen) + :speech #xe + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc115" + :channel (gui-channel citizen) + :speech #xf + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc116" + :channel (gui-channel citizen) + :speech #x10 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc117" + :channel (gui-channel citizen) + :speech #x11 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc118" + :channel (gui-channel citizen) + :speech #x12 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc119" + :channel (gui-channel citizen) + :speech #x13 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc120" + :channel (gui-channel citizen) + :speech #x14 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc121" + :channel (gui-channel citizen) + :speech #x15 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc122" + :channel (gui-channel citizen) + :speech #x16 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc123" + :channel (gui-channel citizen) + :speech #x17 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc124" + :channel (gui-channel citizen) + :speech #x18 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc125" + :channel (gui-channel citizen) + :speech #x19 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc126" + :channel (gui-channel citizen) + :speech #x1a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc127" + :channel (gui-channel citizen) + :speech #x1b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc101a" + :channel (gui-channel citizen) + :speech #x1c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc102a" + :channel (gui-channel citizen) + :speech #x1d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc103a" + :channel (gui-channel citizen) + :speech #x1e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc104a" + :channel (gui-channel citizen) + :speech #x1f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc105a" + :channel (gui-channel citizen) + :speech #x20 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc106a" + :channel (gui-channel citizen) + :speech #x21 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc107a" + :channel (gui-channel citizen) + :speech #x22 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc108a" + :channel (gui-channel citizen) + :speech #x23 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc109a" + :channel (gui-channel citizen) + :speech #x24 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc110a" + :channel (gui-channel citizen) + :speech #x25 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc111a" + :channel (gui-channel citizen) + :speech #x26 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc112a" + :channel (gui-channel citizen) + :speech #x27 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc113a" + :channel (gui-channel citizen) + :speech #x28 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc114a" + :channel (gui-channel citizen) + :speech #x29 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc115a" + :channel (gui-channel citizen) + :speech #x2a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc116a" + :channel (gui-channel citizen) + :speech #x2b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc117a" + :channel (gui-channel citizen) + :speech #x2c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc118a" + :channel (gui-channel citizen) + :speech #x2d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc119a" + :channel (gui-channel citizen) + :speech #x2e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc120a" + :channel (gui-channel citizen) + :speech #x2f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc121a" + :channel (gui-channel citizen) + :speech #x30 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc122a" + :channel (gui-channel citizen) + :speech #x31 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc123a" + :channel (gui-channel citizen) + :speech #x32 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc124a" + :channel (gui-channel citizen) + :speech #x33 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc125a" + :channel (gui-channel citizen) + :speech #x34 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc126a" + :channel (gui-channel citizen) + :speech #x35 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc127a" + :channel (gui-channel citizen) + :speech #x36 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc101b" + :channel (gui-channel citizen) + :speech #x37 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc102b" + :channel (gui-channel citizen) + :speech #x38 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc103b" + :channel (gui-channel citizen) + :speech #x39 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc104b" + :channel (gui-channel citizen) + :speech #x3a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc105b" + :channel (gui-channel citizen) + :speech #x3b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc106b" + :channel (gui-channel citizen) + :speech #x3c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc107b" + :channel (gui-channel citizen) + :speech #x3d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc108b" + :channel (gui-channel citizen) + :speech #x3e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc109b" + :channel (gui-channel citizen) + :speech #x3f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc110b" + :channel (gui-channel citizen) + :speech #x40 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc111b" + :channel (gui-channel citizen) + :speech #x41 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc112b" + :channel (gui-channel citizen) + :speech #x42 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc113b" + :channel (gui-channel citizen) + :speech #x43 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc114b" + :channel (gui-channel citizen) + :speech #x44 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc115b" + :channel (gui-channel citizen) + :speech #x45 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc116b" + :channel (gui-channel citizen) + :speech #x46 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc117b" + :channel (gui-channel citizen) + :speech #x47 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc118b" + :channel (gui-channel citizen) + :speech #x48 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc119b" + :channel (gui-channel citizen) + :speech #x49 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc120b" + :channel (gui-channel citizen) + :speech #x4a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc121b" + :channel (gui-channel citizen) + :speech #x4b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc122b" + :channel (gui-channel citizen) + :speech #x4c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc123b" + :channel (gui-channel citizen) + :speech #x4d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc124b" + :channel (gui-channel citizen) + :speech #x4e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc125b" + :channel (gui-channel citizen) + :speech #x4f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc126b" + :channel (gui-channel citizen) + :speech #x50 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "resc127b" + :channel (gui-channel citizen) + :speech #x51 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax232" + :channel (gui-channel daxter) + :speech #x52 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax198" + :channel (gui-channel daxter) + :speech #x53 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "dax128" + :channel (gui-channel daxter) + :speech #x54 + :text-duration (seconds 1) + :neg #x1 + :on-close #f + :camera #f + ) + ) + ) + +;; definition of type rescue-speech-instance +(deftype rescue-speech-instance (speech-instance) + () + ) + +;; definition for method 3 of type rescue-speech-instance +(defmethod inspect ((this rescue-speech-instance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'rescue-speech-instance) + (format #t "~1Tspeech: ~D~%" (-> this speech)) + (format #t "~1Tnum-play-times: ~D~%" (-> this num-play-times)) + (format #t "~1Tprobability: ~f~%" (-> this probability)) + (label cfg-4) + this + ) + +;; definition of type desert-rescue-transport-init-params +(deftype desert-rescue-transport-init-params (structure) + ((pos vector :inline) + (quat quaternion :inline) + (path-pts (inline-array vector)) + (num-pts int32) + (desresc-path (array desert-transport-node)) + ) + ) + +;; definition for method 3 of type desert-rescue-transport-init-params +(defmethod inspect ((this desert-rescue-transport-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'desert-rescue-transport-init-params) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tpath-pts: #x~X~%" (-> this path-pts)) + (format #t "~1Tnum-pts: ~D~%" (-> this num-pts)) + (format #t "~1Tdesresc-path: ~A~%" (-> this desresc-path)) + (label cfg-4) + this + ) + +;; definition of type desert-passenger-info +(deftype desert-passenger-info (structure) + ((passenger-pos vector :inline) + (beacon-pos vector :inline) + (transport-angle float) + (is-final? symbol) + (total-time time-frame) + (num-marauders int8) + (sandstorm-intensity float) + ) + ) + +;; definition for method 3 of type desert-passenger-info +(defmethod inspect ((this desert-passenger-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'desert-passenger-info) + (format #t "~1Tpassenger-pos: #~%" (-> this passenger-pos)) + (format #t "~1Tbeacon-pos: #~%" (-> this beacon-pos)) + (format #t "~1Ttransport-angle: ~f~%" (-> this transport-angle)) + (format #t "~1Tis-final?: ~A~%" (-> this is-final?)) + (format #t "~1Ttotal-time: ~D~%" (-> this total-time)) + (format #t "~1Tnum-marauders: ~D~%" (-> this num-marauders)) + (format #t "~1Tsandstorm-intensity: ~f~%" (-> this sandstorm-intensity)) + (label cfg-4) + this + ) + +;; definition of type task-manager-desert-rescue +(deftype task-manager-desert-rescue (task-manager) + ((current-passenger-index int8) + (current-passenger handle) + (current-task-arrow handle) + (current-transport handle) + (taxi-timer time-frame) + (num-enemies-remaining int8 :offset 288) + (current-enemy handle) + (jak-vehicle handle) + (dust-storm handle) + (passenger-pos (array desert-passenger-info)) + (desresc-path (array desert-transport-node)) + ) + (:state-methods + pickup-passenger + drop-off-passenger + finish-task + fight + race-home + rescue-start + play-dead-wlander-movie + wait-for-vehicle-return + investigate-dead-wlander + fail-delay + ) + (:methods + (task-manager-desert-rescue-method-42 (_type_) none) + (spawn-sat (_type_) none) + (task-manager-desert-rescue-method-44 (_type_) none) + (task-manager-desert-rescue-method-45 (_type_ int) none) + (init-transport-params! (_type_ desert-rescue-transport-init-params) none) + (task-manager-desert-rescue-method-47 (_type_) time-frame) + (task-manager-desert-rescue-method-48 (_type_) float) + (task-manager-desert-rescue-method-49 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-desert-rescue +(defmethod inspect ((this task-manager-desert-rescue)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tcurrent-passenger-index: ~D~%" (-> this current-passenger-index)) + (format #t "~2Tcurrent-passenger: ~D~%" (-> this current-passenger)) + (format #t "~2Tcurrent-task-arrow: ~D~%" (-> this current-task-arrow)) + (format #t "~2Tcurrent-transport: ~D~%" (-> this current-transport)) + (format #t "~2Ttaxi-timer: ~D~%" (-> this taxi-timer)) + (format #t "~2Thud-timer: ~D~%" (-> this hud-timer)) + (format #t "~2Tnum-enemies-remaining: ~D~%" (-> this num-enemies-remaining)) + (format #t "~2Tcurrent-enemy: ~D~%" (-> this current-enemy)) + (format #t "~2Tjak-vehicle: ~D~%" (-> this jak-vehicle)) + (format #t "~2Tdust-storm: ~D~%" (-> this dust-storm)) + (format #t "~2Tpassenger-pos: ~A~%" (-> this passenger-pos)) + (format #t "~2Tdesresc-path: ~A~%" (-> this desresc-path)) + (label cfg-4) + this + ) + +;; definition for symbol *rescue-speech*, type (array speech-info) +(define *rescue-speech* + (new 'static 'boxed-array :type speech-info :length 7 :allocated-length 8 + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x1 :probability 1.0) + (new 'static 'speech-instance :speech #x2 :probability 1.0) + (new 'static 'speech-instance :speech #x3 :probability 1.0) + (new 'static 'speech-instance :speech #x4 :probability 1.0) + (new 'static 'speech-instance :speech #x5 :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x6 :probability 1.0) + (new 'static 'speech-instance :speech #x7 :probability 1.0) + (new 'static 'speech-instance :speech #x8 :probability 1.0) + (new 'static 'speech-instance :speech #xe :probability 1.0) + (new 'static 'speech-instance :speech #xf :probability 1.0) + (new 'static 'speech-instance :speech #x10 :probability 1.0) + (new 'static 'speech-instance :speech #x11 :probability 1.0) + (new 'static 'speech-instance :speech #x12 :probability 1.0) + (new 'static 'speech-instance :speech #x13 :probability 1.0) + (new 'static 'speech-instance :speech #x14 :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x9 :probability 1.0) + (new 'static 'speech-instance :speech #xa :probability 1.0) + (new 'static 'speech-instance :speech #xb :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x15 :probability 1.0) + (new 'static 'speech-instance :speech #x16 :probability 1.0) + (new 'static 'speech-instance :speech #x17 :probability 1.0) + (new 'static 'speech-instance :speech #xd :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #xc :probability 1.0) + (new 'static 'speech-instance :speech #x18 :probability 1.0) + (new 'static 'speech-instance :speech #x19 :probability 1.0) + (new 'static 'speech-instance :speech #x1a :probability 1.0) + (new 'static 'speech-instance :speech #x1b :probability 1.0) + ) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x52 :probability 1.0)) + ) + (new 'static 'speech-info + :speeches (new 'static 'boxed-array :type speech-instance (new 'static 'speech-instance :speech #x53 :probability 1.0)) + ) + ) + ) + +;; definition for symbol *rescue-speech-1*, type (array speech-info) +(define *rescue-speech-1* + (new 'static 'boxed-array :type speech-info :length 5 :allocated-length 8 + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x1c :probability 1.0) + (new 'static 'speech-instance :speech #x1d :probability 1.0) + (new 'static 'speech-instance :speech #x1e :probability 1.0) + (new 'static 'speech-instance :speech #x1f :probability 1.0) + (new 'static 'speech-instance :speech #x20 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x21 :probability 1.0) + (new 'static 'speech-instance :speech #x22 :probability 1.0) + (new 'static 'speech-instance :speech #x23 :probability 1.0) + (new 'static 'speech-instance :speech #x29 :probability 1.0) + (new 'static 'speech-instance :speech #x2a :probability 1.0) + (new 'static 'speech-instance :speech #x2b :probability 1.0) + (new 'static 'speech-instance :speech #x2c :probability 1.0) + (new 'static 'speech-instance :speech #x2d :probability 1.0) + (new 'static 'speech-instance :speech #x2e :probability 1.0) + (new 'static 'speech-instance :speech #x2f :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x24 :probability 1.0) + (new 'static 'speech-instance :speech #x25 :probability 1.0) + (new 'static 'speech-instance :speech #x26 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x30 :probability 1.0) + (new 'static 'speech-instance :speech #x31 :probability 1.0) + (new 'static 'speech-instance :speech #x32 :probability 1.0) + (new 'static 'speech-instance :speech #x28 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x27 :probability 1.0) + (new 'static 'speech-instance :speech #x33 :probability 1.0) + (new 'static 'speech-instance :speech #x34 :probability 1.0) + (new 'static 'speech-instance :speech #x35 :probability 1.0) + (new 'static 'speech-instance :speech #x36 :probability 1.0) + ) + ) + ) + ) + +;; definition for symbol *rescue-speech-2*, type (array speech-info) +(define *rescue-speech-2* + (new 'static 'boxed-array :type speech-info :length 5 :allocated-length 8 + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x37 :probability 1.0) + (new 'static 'speech-instance :speech #x38 :probability 1.0) + (new 'static 'speech-instance :speech #x39 :probability 1.0) + (new 'static 'speech-instance :speech #x3a :probability 1.0) + (new 'static 'speech-instance :speech #x3b :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x3c :probability 1.0) + (new 'static 'speech-instance :speech #x3d :probability 1.0) + (new 'static 'speech-instance :speech #x3e :probability 1.0) + (new 'static 'speech-instance :speech #x44 :probability 1.0) + (new 'static 'speech-instance :speech #x45 :probability 1.0) + (new 'static 'speech-instance :speech #x46 :probability 1.0) + (new 'static 'speech-instance :speech #x47 :probability 1.0) + (new 'static 'speech-instance :speech #x48 :probability 1.0) + (new 'static 'speech-instance :speech #x49 :probability 1.0) + (new 'static 'speech-instance :speech #x4a :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x3f :probability 1.0) + (new 'static 'speech-instance :speech #x40 :probability 1.0) + (new 'static 'speech-instance :speech #x41 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x4b :probability 1.0) + (new 'static 'speech-instance :speech #x4c :probability 1.0) + (new 'static 'speech-instance :speech #x4d :probability 1.0) + (new 'static 'speech-instance :speech #x43 :probability 1.0) + ) + ) + (new 'static 'speech-info :speeches (new 'static 'boxed-array :type speech-instance + (new 'static 'speech-instance :speech #x42 :probability 1.0) + (new 'static 'speech-instance :speech #x4e :probability 1.0) + (new 'static 'speech-instance :speech #x4f :probability 1.0) + (new 'static 'speech-instance :speech #x50 :probability 1.0) + (new 'static 'speech-instance :speech #x51 :probability 1.0) + ) + ) + ) + ) + +;; definition for symbol *rescue-speech-array*, type (array (array speech-info)) +(define *rescue-speech-array* + (the-as (array (array speech-info)) (new 'static 'boxed-array :type array :length 0 :allocated-length 3)) + ) + +;; failed to figure out what this is: +(set! (-> *rescue-speech-array* 0) *rescue-speech*) + +;; failed to figure out what this is: +(set! (-> *rescue-speech-array* 1) *rescue-speech-1*) + +;; failed to figure out what this is: +(set! (-> *rescue-speech-array* 2) *rescue-speech-2*) + +;; definition for symbol *duststorm-gate-pos*, type vector +(define *duststorm-gate-pos* (new 'static 'vector :x 9175730.0 :y 130316.695 :z 1006544.06 :w 1.0)) + +;; definition for symbol *duststorm-wind-angle*, type float +(define *duststorm-wind-angle* 14563.556) + +;; definition for symbol *home-pos*, type vector +(define *home-pos* (new 'static 'vector :x 9258721.0 :y 125009.92 :z 787988.5 :w 1.0)) + +;; definition for symbol *snake-start-pos*, type vector +(define *snake-start-pos* (new 'static 'vector :x 2217369.5 :y 103464.96 :z 10151731.0 :w 1.0)) + +;; definition for symbol *snake-start-angle*, type float +(define *snake-start-angle* 1820.4445) + +;; definition for symbol *passenger-pos*, type (array desert-passenger-info) +(define *passenger-pos* (new 'static 'boxed-array :type desert-passenger-info + (new 'static 'desert-passenger-info + :passenger-pos (new 'static 'vector :x 3470704.8 :y 275742.72 :z 5098496.0 :w 1.0) + :beacon-pos (new 'static 'vector :x 5855805.5 :y 107233.28 :z 8262902.0 :w 1.0) + :is-final? #f + :total-time (seconds 100) + :num-marauders 1 + :sandstorm-intensity 0.3 + ) + (new 'static 'desert-passenger-info + :passenger-pos (new 'static 'vector :x 1681981.5 :y 102400.0 :z 7980359.5 :w 1.0) + :beacon-pos (new 'static 'vector :x 5408399.5 :y 82821.12 :z 7242465.5 :w 1.0) + :is-final? #f + :total-time (seconds 90) + :num-marauders 2 + :sandstorm-intensity 0.5 + ) + (new 'static 'desert-passenger-info + :passenger-pos (new 'static 'vector :x 2482667.5 :y 389038.1 :z 6811853.0 :w 1.0) + :beacon-pos (new 'static 'vector :x 6194995.0 :y 87859.2 :z 4850729.0 :w 1.0) + :is-final? #f + :total-time (seconds 90) + :num-marauders 3 + :sandstorm-intensity 0.7 + ) + (new 'static 'desert-passenger-info + :passenger-pos (new 'static 'vector :x 2281472.0 :y 86135.195 :z 10281697.0 :w 1.0) + :beacon-pos (new 'static 'vector :x 2383872.0 :y 61559.195 :z 10273505.0 :w 1.0) + :is-final? #t + :total-time (seconds 260) + :sandstorm-intensity 1.0 + ) + ) + ) + +;; definition of type transport-path-control +(deftype transport-path-control (path-control) + () + (:methods + (new (symbol type process-drawable (inline-array vector) int) _type_) + ) + ) + +;; definition for method 3 of type transport-path-control +(defmethod inspect ((this transport-path-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tcurve: #~%" (-> this curve)) + (format #t "~1Tnum-cverts: ~D~%" (-> this curve num-cverts)) + (format #t "~1Tcverts: #x~X~%" (-> this curve cverts)) + (label cfg-4) + this + ) + +;; definition for symbol *__transport-path__*, type (inline-array vector) +(define *__transport-path__* (new 'static 'inline-array vector 50 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + +;; failed to figure out what this is: +(dotimes (v1-20 (-> *desresc-transport-path-0* length)) + (set! (-> *__transport-path__* v1-20 quad) (-> *desresc-transport-path-0* v1-20 pos quad)) + ) + +;; definition for method 0 of type transport-path-control +(defmethod new transport-path-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 (inline-array vector)) (arg2 int)) + 0 + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 process) arg0) + (set! (-> v0-0 name) #f) + (set! (-> v0-0 curve num-cverts) arg2) + (set! (-> v0-0 curve cverts) arg1) + v0-0 + ) + ) + +;; definition for method 19 of type transport-path-control +(defmethod get-num-verts ((this transport-path-control)) + (-> this curve num-cverts) + ) + +;; failed to figure out what this is: +(if (or (zero? *transport-tread-settings*) (!= loading-level global)) + (set! *transport-tread-settings* (new 'loading-level 'light-trail-composition)) + ) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* color-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* color-repeat-dist) 73728.0) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* alpha-2-mode) (the-as uint 6)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* base-alpha) 0.2) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* alpha-repeat-dist) 12288.0) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* width-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* base-width) 12288.0) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* uv-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* uv-repeat-dist) 20480.0) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* lie-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* max-age) (seconds 20)) + +;; failed to figure out what this is: +(if "tread-marks" + (set! (-> *transport-tread-settings* tex-id) + (the-as uint (lookup-texture-id-by-name "tread-marks" (the-as string #f))) + ) + (set! (-> *transport-tread-settings* tex-id) (the-as uint #x100300)) + ) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* width-curve) (the-as curve2d-piecewise *curve-unity*)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* color-curve) (the-as curve-color-piecewise *trail-color-curve-white*)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* alpha-curve-2) #f) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* zbuffer?) #f) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* lie-vector quad) (-> *up-vector* quad)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* use-tape-mode?) #f) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* blend-mode) (the-as uint 2)) + +;; failed to figure out what this is: +(set! (-> *transport-tread-settings* frame-stagger) (the-as uint 5)) + +;; definition of type desert-rescue-transport +(deftype desert-rescue-transport (process-focusable) + ((pitch float) + (target-pitch float) + (down-force float) + (ground-offset float) + (offset-dist float) + (angular-speed float) + (path-t float) + (current-node-index int16) + (current-stop-node-index int16) + (move-speed float) + (target-move-speed float) + (has-passenger? symbol) + (seek-speed float) + (is-braking? symbol) + (teleport-when-ready? symbol) + (die-when-ready? symbol) + (is-last-passenger? symbol) + (tread1 handle) + (tread2 handle) + (tread-frequency uint8) + (tread-last-spawn-index uint8) + (desresc-path (array desert-transport-node)) + (can-board? symbol) + ) + (:state-methods + undefined0 + die + undefined1 + following-path + waiting-for-passenger + preparing-for-launch + ) + (:methods + (desert-rescue-transport-method-34 (_type_) float) + (probe-ground (_type_ vector) float) + (get-node-stop-idx (_type_) int) + (desert-rescue-transport-method-37 (_type_ int int) quaternion) + (desert-rescue-transport-method-38 (_type_) quaternion) + (desert-rescue-transport-method-39 (_type_) quaternion) + (desert-rescue-transport-method-40 (_type_) none) + (desert-rescue-transport-method-41 (_type_) none) + (probe-ground2 (_type_ vector vector) float) + (desert-rescue-transport-method-43 (_type_) none) + (desert-rescue-transport-method-44 (_type_) symbol) + (desert-rescue-transport-method-45 (_type_) symbol) + ) + (:states + hidden-idle + idle-hidden + ) + ) + +;; definition for method 3 of type desert-rescue-transport +(defmethod inspect ((this desert-rescue-transport)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tpitch: ~f~%" (-> this pitch)) + (format #t "~2Ttarget-pitch: ~f~%" (-> this target-pitch)) + (format #t "~2Tdown-force: ~f~%" (-> this down-force)) + (format #t "~2Tground-offset: ~f~%" (-> this ground-offset)) + (format #t "~2Toffset-dist: ~f~%" (-> this offset-dist)) + (format #t "~2Tangular-speed: ~f~%" (-> this angular-speed)) + (format #t "~2Tpath-t: ~f~%" (-> this path-t)) + (format #t "~2Tcurrent-node-index: ~D~%" (-> this current-node-index)) + (format #t "~2Tcurrent-stop-node-index: ~D~%" (-> this current-stop-node-index)) + (format #t "~2Tmove-speed: ~f~%" (-> this move-speed)) + (format #t "~2Ttarget-move-speed: ~f~%" (-> this target-move-speed)) + (format #t "~2Thas-passenger?: ~A~%" (-> this has-passenger?)) + (format #t "~2Tseek-speed: ~f~%" (-> this seek-speed)) + (format #t "~2Tis-braking?: ~A~%" (-> this is-braking?)) + (format #t "~2Tteleport-when-ready?: ~A~%" (-> this teleport-when-ready?)) + (format #t "~2Tdie-when-ready?: ~A~%" (-> this die-when-ready?)) + (format #t "~2Tis-last-passenger?: ~A~%" (-> this is-last-passenger?)) + (format #t "~2Ttread1: ~D~%" (-> this tread1)) + (format #t "~2Ttread2: ~D~%" (-> this tread2)) + (format #t "~2Ttread-frequency: ~D~%" (-> this tread-frequency)) + (format #t "~2Ttread-last-spawn-index: ~D~%" (-> this tread-last-spawn-index)) + (format #t "~2Tdesresc-path: ~A~%" (-> this desresc-path)) + (format #t "~2Tcan-board?: ~A~%" (-> this can-board?)) + (label cfg-4) + this + ) + +;; definition for symbol *replace-last*, type object +(define *replace-last* (the-as object 0)) + +;; definition for symbol *frequency*, type int +(define *frequency* 10) + +;; definition for method 43 of type desert-rescue-transport +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod desert-rescue-transport-method-43 ((this desert-rescue-transport)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> this root trans quad)) + (let ((v1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + (s3-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> this tread-frequency) (the-as uint 10)) + (vector+float*! s2-0 s2-0 (-> v1-4 fvec) -27852.8) + (vector+float*! s3-0 s2-0 (-> v1-4 rvec) -14131.2) + (vector+float*! s5-0 s2-0 (-> v1-4 rvec) 14131.2) + (set! (-> *transport-tread-settings* tex-id) + (the-as uint (lookup-texture-id-by-name "tread-marks" (the-as string #f))) + ) + (set! (-> s3-0 y) (probe-ground2 this s3-0 s4-0)) + (+! (-> s3-0 y) 409.6) + (let ((v1-11 (the-as tread-trail-tracker (handle->process (-> this tread1))))) + (if (zero? (mod (-> this tread-last-spawn-index) (-> this tread-frequency))) + (tread-trail-method-22 (-> v1-11 trail) s3-0 s4-0) + (tread-trail-method-23 (-> v1-11 trail) s3-0 s4-0) + ) + ) + (set! (-> s5-0 y) (probe-ground2 this s5-0 s4-0)) + (+! (-> s5-0 y) 409.6) + (let ((v1-21 (the-as tread-trail-tracker (handle->process (-> this tread2))))) + (if (zero? (mod (-> this tread-last-spawn-index) (-> this tread-frequency))) + (tread-trail-method-22 (-> v1-21 trail) s5-0 s4-0) + (tread-trail-method-23 (-> v1-21 trail) s5-0 s4-0) + ) + ) + ) + ) + (+! (-> this tread-last-spawn-index) 1) + 0 + (none) + ) + +;; definition for method 42 of type desert-rescue-transport +;; INFO: Used lq/sq +(defmethod probe-ground2 ((this desert-rescue-transport) (arg0 vector) (arg1 vector)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> gp-0 start-pos) arg0 *up-vector* 24576.0) + (set! (-> gp-0 move-dist quad) (the-as uint128 0)) + (set! (-> gp-0 move-dist y) -81920.0) + (let ((v1-4 gp-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) + (set! (-> arg1 quad) (-> gp-0 best-other-tri normal quad)) + (-> gp-0 best-other-tri intersect y) + ) + (else + -40960000.0 + ) + ) + ) + ) + +;; definition for method 35 of type desert-rescue-transport +;; INFO: Used lq/sq +(defmethod probe-ground ((this desert-rescue-transport) (arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> gp-0 start-pos) arg0 *up-vector* 24576.0) + (set! (-> gp-0 move-dist quad) (the-as uint128 0)) + (set! (-> gp-0 move-dist y) -81920.0) + (let ((v1-4 gp-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) + (-> gp-0 best-other-tri intersect y) + -40960000.0 + ) + ) + ) + +;; definition for function desert-transport-event-handler +;; WARN: Return type mismatch symbol vs object. +(defbehavior desert-transport-event-handler desert-rescue-transport ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 symbol)) + (case arg2 + (('passenger-pickup) + (set! v0-0 #t) + (set! (-> self has-passenger?) v0-0) + v0-0 + ) + (('note-last-passenger) + (set! v0-0 #t) + (set! (-> self is-last-passenger?) v0-0) + v0-0 + ) + (('die-when-ready) + (when (-> self is-last-passenger?) + (set! v0-0 #t) + (set! (-> self die-when-ready?) v0-0) + v0-0 + ) + ) + ) + ) + +;; definition for method 12 of type desert-rescue-transport +(defmethod run-logic? ((this desert-rescue-transport)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 34 of type desert-rescue-transport +(defmethod desert-rescue-transport-method-34 ((this desert-rescue-transport)) + (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (f30-0 (-> this offset-dist)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s4-0 (-> this root trans) s3-0 0.0) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (let* ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (* 0.5 f30-0))) + (s2-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (* -0.5 f30-0))) + (f28-0 (probe-ground this s5-1)) + (f0-6 (probe-ground this s2-1)) + ) + (set! (-> s5-1 y) f28-0) + (set! (-> s2-1 y) f0-6) + (let* ((f0-8 (- (+ f28-0 (-> this ground-offset)) (+ f0-6 (-> this ground-offset)))) + (f0-10 (asin (/ f0-8 f30-0))) + ) + (set! (-> this target-pitch) (- (fmax -8192.0 (fmin 8192.0 f0-10)))) + ) + ) + ) + (let ((f0-17 (* (+ (* 15.0 (- (-> this target-pitch) (-> this pitch))) (* 2.0 (- (-> this angular-speed)))) + (seconds-per-frame) + ) + ) + ) + (+! (-> this angular-speed) f0-17) + ) + (set! (-> this pitch) (+ (-> this pitch) (* (-> this angular-speed) (seconds-per-frame)))) + ) + +;; failed to figure out what this is: +(defskelgroup skel-desert-rescue-transport desert-transport desert-transport-lod0-jg desert-transport-idle-ja + ((desert-transport-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 -2 12.5) + ) + +;; definition for function desert-rescue-transport-init-by-other +;; INFO: Used lq/sq +(defbehavior desert-rescue-transport-init-by-other desert-rescue-transport ((arg0 desert-rescue-transport-init-params)) + (stack-size-set! (-> self main-thread) 256) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self level) (level-get *level* 'desrescg)) + (let ((s5-0 (new 'process 'collide-shape-moving self (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)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 69632.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 4) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 69632.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-23 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-desert-rescue-transport" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (ja :group! (-> self draw art-group data 3) :num! (identity 1.0)) + (set! (-> self desresc-path) (-> arg0 desresc-path)) + (set! (-> self path) (new 'process 'transport-path-control self (-> arg0 path-pts) (-> arg0 num-pts))) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (set! (-> self target-pitch) 0.0) + (set! (-> self pitch) 0.0) + (set! (-> self ground-offset) -4096.0) + (set! (-> self offset-dist) 49152.0) + (set! (-> self current-node-index) -1) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set! (-> self current-node-index) 0) + (desert-rescue-transport-method-37 self 0 0) + (set! (-> self current-stop-node-index) (get-node-stop-idx self)) + (set! (-> self has-passenger?) #f) + (set! (-> self move-speed) 40960.0) + (set! (-> self seek-speed) 10240.0) + (set! (-> self target-move-speed) 12288.0) + (set! (-> self teleport-when-ready?) #f) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self die-when-ready?) #f) + (set! (-> self is-last-passenger?) #f) + (let ((gp-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> gp-1 tracked-obj) (process->handle self)) + (set! (-> gp-1 max-num-crumbs) 325) + (set! (-> gp-1 appearance) *transport-tread-settings*) + (let* ((v1-64 + (estimate-light-trail-mem-usage + (the-as uint (-> gp-1 max-num-crumbs)) + (the-as uint (= (-> gp-1 appearance lie-mode) 3)) + ) + ) + (s5-2 (get-process *default-dead-pool* tread-trail-tracker (+ v1-64 8192) 1)) + ) + (set! (-> self tread1) + (process->handle (-> (when s5-2 + (let ((t9-16 (method-of-type process activate))) + (t9-16 s5-2 self "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-2 tread-trail-tracker-init-by-other gp-1) + (-> s5-2 ppointer) + ) + 0 + ) + ) + ) + ) + (let* ((v1-73 + (estimate-light-trail-mem-usage + (the-as uint (-> gp-1 max-num-crumbs)) + (the-as uint (= (-> gp-1 appearance lie-mode) 3)) + ) + ) + (s5-3 (get-process *default-dead-pool* tread-trail-tracker (+ v1-73 8192) 1)) + ) + (set! (-> self tread2) + (process->handle (-> (when s5-3 + (let ((t9-20 (method-of-type process activate))) + (t9-20 s5-3 self "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-3 tread-trail-tracker-init-by-other gp-1) + (-> s5-3 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (set! (-> self tread-last-spawn-index) (the-as uint 0)) + (go-virtual following-path) + ) + +;; definition for method 7 of type desert-rescue-transport +(defmethod relocate ((this desert-rescue-transport) (offset int)) + (call-parent-method this offset) + ) + +;; failed to figure out what this is: +(defstate die (desert-rescue-transport) + :virtual #t + :code (behavior () + '() + ) + ) + +;; definition for symbol *transport-move-speed*, type float +(define *transport-move-speed* 0.0) + +;; definition for method 36 of type desert-rescue-transport +(defmethod get-node-stop-idx ((this desert-rescue-transport)) + (let ((v1-1 (+ (-> this current-node-index) 1)) + (a1-2 (+ (-> this desresc-path allocated-length) -1)) + ) + (while (>= a1-2 v1-1) + (if (-> this desresc-path v1-1 is-stop?) + (return v1-1) + ) + (+! v1-1 1) + ) + ) + -1 + ) + +;; definition for method 38 of type desert-rescue-transport +(defmethod desert-rescue-transport-method-38 ((this desert-rescue-transport)) + (let ((s5-0 (displacement-between-points-at-percent-normalized! + (-> this path) + (new 'stack-no-clear 'vector) + (-> this path-t) + ) + ) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (quaternion-look-at! (-> this root quat) s5-0 *up-vector*) + ) + ) + +;; definition for method 37 of type desert-rescue-transport +(defmethod desert-rescue-transport-method-37 ((this desert-rescue-transport) (arg0 int) (arg1 int)) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (the-as float arg1) 'interp) + (set! (-> this root trans y) (probe-ground this (-> this root trans))) + (set! (-> this current-node-index) arg0) + (set! (-> this path-t) (the-as float arg1)) + (desert-rescue-transport-method-38 this) + ) + +;; failed to figure out what this is: +(defstate idle-hidden (desert-rescue-transport) + :event desert-transport-event-handler + :enter (behavior () + '() + ) + :trans (behavior () + (if (logtest? (-> self draw status) (draw-control-status on-screen)) + (go-virtual following-path) + ) + ) + :code sleep-code + ) + +;; definition for method 39 of type desert-rescue-transport +;; INFO: Used lq/sq +(defmethod desert-rescue-transport-method-39 ((this desert-rescue-transport)) + (let* ((v1-4 (-> this desresc-path (-> this current-node-index) pos)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) v1-4 (-> this root trans))) + (s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + 0.0 + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (let ((f0-4 (vector-dot s3-1 s5-0))) + (cond + ((>= f0-4 0.9999) + (set! (-> s5-0 quad) (-> s3-1 quad)) + ) + (else + (vector-cross! s4-0 s5-0 s3-1) + (let ((f0-6 (fmin (acos f0-4) (* 5461.3335 (seconds-per-frame))))) + (vector-rotate-around-axis! s5-0 (the-as quaternion s5-0) f0-6 s4-0) + ) + ) + ) + ) + ) + (quaternion-look-at! (-> this root quat) s5-0 *up-vector*) + ) + ) + +;; failed to figure out what this is: +(defstate preparing-for-launch (desert-rescue-transport) + :virtual #t + :event desert-transport-event-handler + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (+! (-> self current-node-index) 1) + (set! (-> self current-stop-node-index) (get-node-stop-idx self)) + (set! (-> self target-move-speed) 20480.0) + (go-virtual following-path) + ) + :post transform-post + ) + +;; definition for method 41 of type desert-rescue-transport +;; WARN: Return type mismatch int vs none. +(defmethod desert-rescue-transport-method-41 ((this desert-rescue-transport)) + 0 + (none) + ) + +;; definition for method 44 of type desert-rescue-transport +;; INFO: Used lq/sq +(defmethod desert-rescue-transport-method-44 ((this desert-rescue-transport)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> this root trans quad)) + (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + (f30-0 43008.0) + ) + *color-green* + (vector+float*! gp-0 gp-0 (-> a1-1 fvec) -40960.0) + (< (vector-vector-distance (target-pos 0) gp-0) f30-0) + ) + ) + ) + +;; definition for method 45 of type desert-rescue-transport +;; INFO: Used lq/sq +(defmethod desert-rescue-transport-method-45 ((this desert-rescue-transport)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> this root trans quad)) + (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) + (f30-0 43008.0) + ) + *color-green* + (vector+float*! gp-0 gp-0 (-> a1-1 fvec) 49152.0) + (< (vector-vector-distance (target-pos 0) gp-0) f30-0) + ) + ) + ) + +;; failed to figure out what this is: +(defstate waiting-for-passenger (desert-rescue-transport) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('can-board?) + (-> self can-board?) + ) + (('leave) + (go-virtual preparing-for-launch) + ) + (else + (desert-transport-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self teleport-when-ready?) #f) + (set! (-> self can-board?) #f) + ) + :trans (behavior () + (desert-rescue-transport-method-41 self) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (= (-> self skel root-channel 0 frame-num) (the float (ja-num-frames 0))) + (if (desert-rescue-transport-method-44 self) + (ja :num! (seek! 0.0)) + (ja :num! (seek!)) + ) + (suspend) + ) + (set! (-> self can-board?) #t) + (sleep-code) + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate hidden-idle (desert-rescue-transport) + :event desert-transport-event-handler + :trans (behavior () + (if (and (-> self die-when-ready?) (not (logtest? (-> self draw status) (draw-control-status on-screen)))) + (go-virtual die) + ) + (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> self desresc-path (-> self current-stop-node-index) pos))) + ) + (when (or (logtest? (-> self draw status) (draw-control-status on-screen)) (< f0-0 1024000.0)) + 0.0 + (let* ((f0-1 (* 0.0000048828124 f0-0)) + (f0-3 (fmax 1.0 (+ -2.0 f0-1))) + ) + (set! (-> self move-speed) (/ 245760.0 f0-3)) + ) + (set! (-> self target-move-speed) (-> self move-speed)) + (go-virtual following-path) + ) + ) + ) + :code sleep-code + :post transform-post + ) + +;; failed to figure out what this is: +(defstate following-path (desert-rescue-transport) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('passenger-pickup) + (set! (-> self teleport-when-ready?) #t) + (desert-transport-event-handler proc argc message block) + ) + (('die) + (go-virtual die) + ) + (else + (desert-transport-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self is-braking?) #f) + (set! (-> self teleport-when-ready?) #f) + (send-event (handle->process (-> self tread1)) 'reset) + (send-event (handle->process (-> self tread2)) 'reset) + ) + :trans (behavior () + (desert-rescue-transport-method-43 self) + (if (and (-> self die-when-ready?) (not (logtest? (-> self draw status) (draw-control-status on-screen)))) + (go-virtual die) + ) + (when (and (-> self teleport-when-ready?) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + (< 286720.0 + (vector-vector-distance (-> self root trans) (-> self desresc-path (-> self current-stop-node-index) pos)) + ) + ) + (let* ((f0-3 (/ (the float (-> self current-stop-node-index)) (the float (+ (-> self path curve num-cverts) -1)))) + (f0-4 (path-control-method-26 (-> self path) f0-3 -245760.0)) + ) + (set! (-> self teleport-when-ready?) #f) + (desert-rescue-transport-method-37 + self + (the int (+ 1.0 (* f0-4 (the float (+ (-> self path curve num-cverts) -1))))) + (the-as int f0-4) + ) + ) + (go hidden-idle) + ) + (let ((f0-5 + (vector-vector-xz-distance (-> self root trans) (-> self desresc-path (-> self current-node-index) pos)) + ) + ) + (cond + ((= (-> self current-node-index) (-> self current-stop-node-index)) + (when (< f0-5 81920.0) + (when (not (-> self is-braking?)) + (set! (-> self is-braking?) #t) + (let ((f1-6 0.5) + (f2-3 (-> self move-speed)) + ) + (set! (-> self seek-speed) (/ (* f1-6 (* f2-3 f2-3)) f0-5)) + ) + ) + (set! (-> self target-move-speed) 0.0) + ) + (if (= (-> self move-speed) 0.0) + (go-virtual waiting-for-passenger) + ) + ) + (else + (if (and (< f0-5 40960.0) (< (-> self current-node-index) (+ (-> self desresc-path length) -1))) + (+! (-> self current-node-index) 1) + ) + ) + ) + ) + (let ((f0-9 (probe-ground self (-> self root trans)))) + (set! (-> self down-force) (- (-> self down-force) (* 204800.0 (seconds-per-frame)))) + (+! (-> self root trans y) (* (-> self down-force) (seconds-per-frame))) + (when (< (-> self root trans y) (+ f0-9 (-> self ground-offset))) + (set! (-> self root trans y) (+ f0-9 (-> self ground-offset))) + (set! (-> self down-force) 0.0) + ) + ) + (desert-rescue-transport-method-34 self) + (cond + ((< 4096.0 (-> self move-speed)) + (desert-rescue-transport-method-39 self) + ) + (else + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) + ) + ) + ) + (let ((gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (if (not (desert-rescue-transport-method-45 self)) + (vector+float*! (-> self root trans) (-> self root trans) gp-1 (* (-> self move-speed) (seconds-per-frame))) + ) + ) + (seek! (-> self move-speed) (-> self target-move-speed) (* (-> self seek-speed) (seconds-per-frame))) + (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) (-> self pitch)) + ) + :code (behavior () + (transform-and-sleep-code) + ) + :post transform-post + ) + +;; definition for symbol *nav-mesh-aid*, type int +(define *nav-mesh-aid* #xb5d9) + +;; definition for method 21 of type task-manager-desert-rescue +;; WARN: Return type mismatch (array desert-passenger-info) vs none. +(defmethod set-time-limit ((this task-manager-desert-rescue)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (dotimes (s5-0 3) + (speeches-reset (-> *rescue-speech-array* s5-0)) + ) + (set-setting! 'dust-storm-sound-scalar #f 0.9 0) + (set-setting! 'extra-bank '((desert2 desresc1)) 0.0 0) + (let ((t1-2 2)) + (set-setting! 'vehicles 'set (shr t1-2 32) t1-2) + ) + (set-setting! 'goggles 'abs 1.0 0) + (set-setting! 'scarf 'abs 1.0 0) + (set! (-> this desresc-path) *desresc-transport-path-0*) + (set! (-> this passenger-pos) *passenger-pos*) + (none) + ) + +;; definition for method 42 of type task-manager-desert-rescue +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-desert-rescue-method-42 ((this task-manager-desert-rescue)) + (set! (-> this current-passenger) + (ppointer->handle (spawn-wlander (-> this passenger-pos (-> this current-passenger-index)) this)) + ) + (none) + ) + +;; definition for method 43 of type task-manager-desert-rescue +;; WARN: Return type mismatch int vs none. +(defmethod spawn-sat ((this task-manager-desert-rescue)) + (set! (-> this current-enemy) + (ppointer->handle (spawn-neo-sat + (-> this passenger-pos (-> this current-passenger-index) beacon-pos) + (quaternion-identity! (new 'stack-no-clear 'quaternion)) + this + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate wait (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :code (behavior () + (while (or (not *target*) (not *spawn-actors*) (!= (status-of-level-and-borrows *level* 'desrescg #f) 'active)) + (suspend) + ) + (set-time-limit self) + (go-virtual active) + ) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self entity) #f) + (dotimes (v1-2 (-> self passenger-pos length)) + (if (-> self passenger-pos v1-2 is-final?) + (set! (-> self current-passenger-index) v1-2) + ) + ) + (cond + ((or (task-node-open? (game-task-node desert-rescue-satellite-fight)) + (task-node-closed? (game-task-node desert-rescue-satellite-fight)) + ) + (let ((f30-0 (-> self passenger-pos (+ (-> self current-passenger-index) -1) sandstorm-intensity))) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity f30-0) + (set-setting! 'fog-special-interp-targ #f f30-0 0) + ) + ) + ((and *target* (focus-test? *target* pilot-riding)) + (set-setting! 'fog-special-interp-targ #f 0.2 0) + ) + (else + (set-setting! 'fog-special-interp-targ #f 0.2 0) + ) + ) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (cond + ((task-node-open? (game-task-node desert-rescue-satellite-fight)) + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 object-type) (traffic-type guard-a)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 nav-mesh) #f) + (set! (-> gp-0 nav-branch) #f) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 handle) (the-as handle #f)) + (set! (-> gp-0 user-data) (the-as uint 0)) + (set! (-> gp-0 flags) (traffic-spawn-flags tsf5)) + (set! (-> gp-0 guard-type) (the-as uint 11)) + (set! (-> gp-0 entity) #f) + (vector-reset! (-> gp-0 velocity)) + (set! (-> gp-0 position quad) (-> *snake-start-pos* quad)) + (quaternion-identity! (-> gp-0 rotation)) + (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *snake-start-angle*) + (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-0))) + ) + (set! (-> self current-transport) (the-as handle #f)) + (set! (-> self current-passenger) (the-as handle #f)) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + (set! (-> self num-enemies-remaining) 1) + (set! (-> self current-enemy) (the-as handle #f)) + (spawn-sat self) + (go-virtual fight) + ) + ((task-node-closed? (game-task-node desert-rescue-satellite-fight)) + (let ((gp-2 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-2 object-type) (traffic-type guard-a)) + (set! (-> gp-2 behavior) (the-as uint 0)) + (set! (-> gp-2 id) (the-as uint 0)) + (set! (-> gp-2 nav-mesh) #f) + (set! (-> gp-2 nav-branch) #f) + (set! (-> gp-2 proc) #f) + (set! (-> gp-2 handle) (the-as handle #f)) + (set! (-> gp-2 user-data) (the-as uint 0)) + (set! (-> gp-2 flags) (traffic-spawn-flags tsf5)) + (set! (-> gp-2 guard-type) (the-as uint 11)) + (set! (-> gp-2 entity) #f) + (vector-reset! (-> gp-2 velocity)) + (set! (-> gp-2 position quad) (-> *snake-start-pos* quad)) + (quaternion-identity! (-> gp-2 rotation)) + (quaternion-rotate-y! (-> gp-2 rotation) (-> gp-2 rotation) *snake-start-angle*) + (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-2))) + ) + (set! (-> self current-transport) (the-as handle #f)) + (set! (-> self current-passenger) (the-as handle #f)) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + (set! (-> self num-enemies-remaining) 0) + (set! (-> self current-enemy) (the-as handle #f)) + (set! (-> self taxi-timer) (+ (current-time) (seconds -60))) + (go-virtual wait-for-vehicle-return) + ) + (else + (task-manager-desert-rescue-method-49 self) + (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x3e4ccccd) + (when (and *target* (focus-test? *target* pilot-riding)) + (set! (-> self jak-vehicle) (process->handle (the-as process (send-event *target* 'get-vehicle)))) + (if (handle->process (-> self jak-vehicle)) + (go-virtual rescue-start) + ) + ) + ) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 49 of type task-manager-desert-rescue +;; WARN: Return type mismatch connection vs none. +(defmethod task-manager-desert-rescue-method-49 ((this task-manager-desert-rescue)) + (set-setting! 'music 'desres1 0.0 0) + (none) + ) + +;; definition for method 46 of type task-manager-desert-rescue +;; INFO: Used lq/sq +;; WARN: Return type mismatch quaternion vs none. +(defmethod init-transport-params! ((this task-manager-desert-rescue) (arg0 desert-rescue-transport-init-params)) + (set! (-> arg0 path-pts) *__transport-path__*) + (set! (-> arg0 num-pts) (-> this desresc-path allocated-length)) + (set! (-> arg0 pos quad) (-> this desresc-path 0 pos quad)) + (set! (-> arg0 desresc-path) (-> this desresc-path)) + (quaternion-identity! (-> arg0 quat)) + (none) + ) + +;; failed to figure out what this is: +(defstate rescue-start (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set! (-> self current-passenger-index) 0) + (set! (-> self current-transport) (the-as handle #f)) + (set! (-> self current-passenger) (the-as handle #f)) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + (task-node-close! (game-task-node desert-rescue-post-intro) 'event) + (let ((gp-1 (new 'stack-no-clear 'desert-rescue-transport-init-params))) + (init-transport-params! self gp-1) + (let ((s5-0 (get-process *default-dead-pool* desert-rescue-transport #x4000 1))) + (set! (-> self current-transport) + (process->handle + (-> (when s5-0 + (let ((t9-6 (method-of-type desert-rescue-transport activate))) + (t9-6 (the-as desert-rescue-transport s5-0) self "desert-rescue-transport" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 desert-rescue-transport-init-by-other gp-1) + (-> s5-0 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (was-squad-manager-start self) + (let ((v1-13 *was-squad-control*)) + (set! (-> v1-13 reserve-count) 40) + ) + ) + :trans (behavior () + (go-virtual pickup-passenger) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate race-home (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-setting! 'dust-storm-sound-scalar #f 1.0 0) + (remove-setting! 'vehicles) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> *home-pos* quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 12)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3)) + (set! (-> self current-task-arrow) (process->handle (task-arrow-spawn gp-0 self))) + ) + (set-time! (-> self state-time)) + (task-node-close! (game-task-node desert-rescue-satellite-fight) 'event) + (was-squad-manager-start self) + (let ((v1-13 *was-squad-control*)) + (set! (-> v1-13 reserve-count) 40) + ) + ) + :trans (behavior () + (local-vars (gp-1 symbol)) + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-44 self) + (if (< (vector-vector-xz-distance (target-pos 0) *home-pos*) 61440.0) + (go-virtual finish-task) + ) + (if (or (not (handle->process (-> self jak-vehicle))) + (begin + (let* ((gp-2 #t) + (s5-0 (handle->process (-> self jak-vehicle))) + (v1-17 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-1 v1-17 gp-2) + ) + gp-1 + ) + ) + (send-event self 'fail) + ) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (let ((v1-25 *was-squad-control*)) + (when v1-25 + (cond + ((< (-> *game-info* timer) (seconds 30)) + (set! (-> v1-25 target-count) 0) + 0 + ) + (else + (set! (-> v1-25 target-count) 4) + ) + ) + ) + ) + (let ((f0-1 (vector-vector-xz-distance (target-pos 0) *home-pos*))) + (if (and (not (logtest? (-> *rescue-speech-array* 0 6 flags) (speech-info-flag si6))) (< f0-1 4096000.0)) + (speech-play (-> *rescue-speech-array* 0) 6 *desert-rescue-speech-list* (target-pos 0)) + ) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate investigate-dead-wlander (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-setting! 'stop-vehicle? #t 0.0 0) + ) + :exit (behavior () + (remove-setting! 'stop-vehicle?) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (cond + ((and *target* (focus-test? *target* pilot-riding) (< (vector-length (get-transv *target*)) 6144.0)) + (send-event *target* 'change-mode 'normal) + (set-time! (-> self state-time)) + (set-setting! 'pilot #f 0.0 0) + ) + ((and *target* (not (focus-test? *target* pilot-riding)) (time-elapsed? (-> self state-time) (seconds 1.7))) + (go-virtual play-dead-wlander-movie) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate play-dead-wlander-movie (task-manager-desert-rescue) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hide-wlander) + (let ((v1-2 (the-as wland-passenger (handle->process (-> self current-passenger))))) + (when v1-2 + (let ((v0-0 (the-as object (logior (-> v1-2 draw status) (draw-control-status no-draw))))) + (set! (-> v1-2 draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + ) + ) + ) + (('spawn-enemy) + (spawn-sat self) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (cond + (#t + (remove-setting! 'music) + (set! (-> self num-enemies-remaining) 1) + (set! (-> self current-enemy) (the-as handle #f)) + (process-spawn scene-player :init scene-player-init "desert-rescue-res-a" #t #f :name "scene-player") + ) + (else + (task-node-close! (game-task-node desert-rescue-dead-wlander-movie) 'event) + ) + ) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (when (task-node-closed? (game-task-node desert-rescue-dead-wlander-movie)) + (let ((v1-3 (the-as wland-passenger (handle->process (-> self current-passenger))))) + (if v1-3 + (logclear! (-> v1-3 draw status) (draw-control-status no-draw)) + ) + ) + (go-virtual fight) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate wait-for-vehicle-return (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-setting! 'music 'desres3 0.0 0) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (let ((s5-0 (-> gp-0 pos)) + (s4-0 (handle->process (-> self jak-vehicle))) + ) + (set! (-> s5-0 quad) (-> (get-trans + (the-as process-focusable (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + 0 + ) + quad + ) + ) + ) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3)) + (set! (-> self current-task-arrow) (process->handle (task-arrow-spawn gp-0 self))) + ) + (set-setting! 'dust-storm-sound-scalar #f 1.0 0) + ) + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + (send-event (handle->process (-> self jak-vehicle)) 'ignore-damage #f) + (send-event (handle->process (-> self jak-vehicle)) 'ignore-impulse #f) + (task-manager-desert-rescue-method-44 self) + (when (and *target* (focus-test? *target* pilot-riding)) + (send-event (handle->process (-> self current-task-arrow)) 'leave) + (go-virtual race-home) + ) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + ) + :code (behavior () + (until (time-elapsed? (-> self state-time) (seconds 3)) + (suspend) + ) + (talker-spawn-func (-> *desert-rescue-speech-list* 84) *entity-pool* (target-pos 0) (the-as region #f)) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate fight (task-manager-desert-rescue) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (when (and (= (-> block param 0) 'die) (= (process->handle proc) (-> self current-enemy))) + (+! (-> self num-enemies-remaining) -1) + (if (zero? (-> self num-enemies-remaining)) + (go-virtual wait-for-vehicle-return) + (spawn-sat self) + ) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-setting! 'pilot #f 0.0 0) + (when #f + (remove-setting! 'music) + (set! (-> self num-enemies-remaining) 1) + (set! (-> self current-enemy) (the-as handle #f)) + (spawn-sat self) + ) + (set-time! (-> self taxi-timer)) + (when #f + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 object-type) (traffic-type guard-a)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 nav-mesh) #f) + (set! (-> gp-0 nav-branch) #f) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 handle) (the-as handle #f)) + (set! (-> gp-0 user-data) (the-as uint 0)) + (set! (-> gp-0 flags) (traffic-spawn-flags tsf5)) + (set! (-> gp-0 guard-type) (the-as uint 11)) + (set! (-> gp-0 entity) #f) + (vector-reset! (-> gp-0 velocity)) + (set! (-> gp-0 position quad) (-> *snake-start-pos* quad)) + (quaternion-identity! (-> gp-0 rotation)) + (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *snake-start-angle*) + (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-0))) + ) + ) + (send-event (handle->process (-> self jak-vehicle)) 'ignore-damage #t) + (send-event (handle->process (-> self jak-vehicle)) 'ignore-impulse #t) + ) + :exit (behavior () + (remove-setting! 'pilot) + ) + :trans (behavior () + (local-vars (gp-0 symbol)) + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-44 self) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + (if (or (not (handle->process (-> self jak-vehicle))) + (begin + (let* ((gp-1 #t) + (s5-0 (handle->process (-> self jak-vehicle))) + (v1-21 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-0 v1-21 gp-1) + ) + gp-0 + ) + ) + (send-event self 'fail) + ) + ) + :code sleep-code + ) + +;; definition for method 48 of type task-manager-desert-rescue +(defmethod task-manager-desert-rescue-method-48 ((this task-manager-desert-rescue)) + (let ((f30-0 (the-as float 0.0))) + (when (not (task-node-closed? (game-task-node desert-rescue-rescue))) + (let ((f0-1 (the float (-> *game-info* sub-task-list (game-task-node desert-rescue-rescue) death-count)))) + (set! f30-0 (lerp-scale-clamp 0.0 1.0 f0-1 3.0 8.0)) + ) + ) + f30-0 + ) + ) + +;; definition for method 47 of type task-manager-desert-rescue +;; WARN: Return type mismatch int vs time-frame. +(defmethod task-manager-desert-rescue-method-47 ((this task-manager-desert-rescue)) + (let ((gp-0 (-> this passenger-pos (-> this current-passenger-index) total-time)) + (f0-0 (task-manager-desert-rescue-method-48 this)) + ) + (the time-frame (* (the float gp-0) (lerp 1.0 2.0 f0-0))) + ) + ) + +;; failed to figure out what this is: +(defstate pickup-passenger (task-manager-desert-rescue) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fight) + (go-virtual investigate-dead-wlander) + ) + (('picked-up) + (go-virtual drop-off-passenger) + ) + (('fail-delay) + (go-virtual fail-delay) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (send-event + (handle->process (-> self jak-vehicle)) + 'scale-max-hit-points + (lerp 1.0 2.0 (task-manager-desert-rescue-method-48 self)) + ) + (set-time! (-> self state-time)) + (set! (-> self current-passenger) (the-as handle #f)) + (task-manager-desert-rescue-method-42 self) + (set-time! (-> self taxi-timer)) + (if (= (-> self current-passenger-index) (+ (-> self passenger-pos length) -1)) + (send-event (handle->process (-> self current-transport)) 'note-last-passenger) + ) + (let ((v1-24 *was-squad-control*)) + (set! (-> v1-24 target-count) + (the int (the float (-> self passenger-pos (-> self current-passenger-index) num-marauders))) + ) + ) + ) + :trans (behavior () + (local-vars (gp-3 symbol)) + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-44 self) + (let ((gp-0 (the-as wland-passenger (handle->process (-> self current-passenger))))) + (when gp-0 + (if (and (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 root trans)) 225280.0) + (or (not (logtest? (-> *rescue-speech* 0 flags) (speech-info-flag si6))) + (and (> (-> *rescue-speech* 0 play-time) 0) (time-elapsed? (-> *rescue-speech* 0 play-time) (seconds 5))) + ) + ) + (task-manager-desert-rescue-method-45 self 0) + ) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (let* ((gp-1 (handle->process (-> self current-passenger))) + (a0-16 (if (type? gp-1 process-focusable) + (the-as process-focusable gp-1) + ) + ) + ) + (if (or (not a0-16) (focus-test? a0-16 disable dead inactive)) + (send-event self 'fail-delay) + ) + ) + ) + (if (and (not (handle->process (-> self current-transport))) (= (-> *was-squad-control* active-count) 0)) + (task-node-close! (game-task-node desert-rescue-rescue) 'event) + ) + (send-event + (handle->process (-> self current-passenger)) + 'set-nav-mesh + (get-nav-mesh (the-as actor-id *nav-mesh-aid*)) + ) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + (if (or (not (handle->process (-> self jak-vehicle))) + (begin + (let* ((gp-4 #t) + (s5-1 (handle->process (-> self jak-vehicle))) + (v1-70 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-1 process-focusable) + (the-as process-focusable s5-1) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-3 v1-70 gp-4) + ) + gp-3 + ) + ) + (send-event self 'fail) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate drop-off-passenger (task-manager-desert-rescue) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('dropped-off) + (task-manager-desert-rescue-method-45 self 2) + (+! (-> self current-passenger-index) 1) + (send-event (handle->process (-> self current-task-arrow)) 'leave) + (if (= (-> self current-passenger-index) (-> self passenger-pos length)) + (go-virtual complete) + (go-virtual pickup-passenger) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (task-manager-desert-rescue-method-45 self 1) + (send-event (handle->process (-> self current-transport)) 'passenger-pickup) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self passenger-pos (-> self current-passenger-index) beacon-pos quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (logior! (-> gp-0 flags) (task-arrow-flags taf3)) + (set! (-> self current-task-arrow) (process->handle (task-arrow-spawn gp-0 self))) + ) + ) + :trans (behavior () + (local-vars (gp-0 symbol)) + ((-> (method-of-type task-manager active) trans)) + (task-manager-desert-rescue-method-44 self) + (set! (-> *game-info* timer) + (- (task-manager-desert-rescue-method-47 self) (- (current-time) (-> self taxi-timer))) + ) + (if (< (-> *game-info* timer) 0) + (send-event self 'fail) + ) + (if (or (not (handle->process (-> self jak-vehicle))) + (begin + (let* ((gp-1 #t) + (s5-0 (handle->process (-> self jak-vehicle))) + (v1-21 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + focus-status + ) + (focus-status dead) + ) + ) + ) + ) + (cmove-#f-zero gp-0 v1-21 gp-1) + ) + gp-0 + ) + ) + (send-event self 'fail) + ) + (let ((f30-0 + (vector-vector-distance (target-pos 0) (-> self passenger-pos (-> self current-passenger-index) beacon-pos)) + ) + ) + (if (and (< (-> *game-info* timer) (seconds 30)) + (and (< 614400.0 f30-0) + (or (not (logtest? (-> *rescue-speech* 3 flags) (speech-info-flag si6))) + (and (> (-> *rescue-speech* 3 play-time) 0) (time-elapsed? (-> *rescue-speech* 3 play-time) (seconds 40))) + ) + ) + ) + (task-manager-desert-rescue-method-45 self 3) + ) + (if (and (< (-> *game-info* timer) (seconds 10)) + (and (< 614400.0 f30-0) + (and (> (-> *rescue-speech* 3 play-time) 0) (time-elapsed? (-> *rescue-speech* 3 play-time) (seconds 10))) + (or (not (logtest? (-> *rescue-speech* 4 flags) (speech-info-flag si6))) + (and (> (-> *rescue-speech* 4 play-time) 0) (time-elapsed? (-> *rescue-speech* 4 play-time) (seconds 45))) + ) + ) + ) + (task-manager-desert-rescue-method-45 self 4) + ) + (if (< f30-0 81920.0) + (send-event (handle->process (-> self current-passenger)) 'exit-vehicle (-> self current-transport)) + ) + (if (< f30-0 20480.0) + (send-event (handle->process (-> self current-task-arrow)) 'hide) + (send-event (handle->process (-> self current-task-arrow)) 'show) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 25 of type task-manager-desert-rescue +;; INFO: this function exists in multiple non-identical object files +(defmethod task-manager-method-25 ((this task-manager-desert-rescue)) + (send-event (handle->process (-> this current-passenger)) 'die-fast) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate finish-task (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (talker-spawn-func (-> *talker-speech* 170) *entity-pool* (target-pos 0) (the-as region #f)) + (deactivate (handle->process (-> self hud-timer))) + (send-event (handle->process (-> self current-task-arrow)) 'leave) + ) + :trans (behavior () + '() + ) + :code (behavior () + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.5)) + (suspend) + ) + (send-event self 'complete) + ) + ) + +;; definition for method 44 of type task-manager-desert-rescue +;; WARN: Return type mismatch connection vs none. +(defmethod task-manager-desert-rescue-method-44 ((this task-manager-desert-rescue)) + (let ((f0-0 (-> this passenger-pos (-> this current-passenger-index) sandstorm-intensity)) + (f1-1 (if (> (-> this current-passenger-index) 0) + (-> this passenger-pos (+ (-> this current-passenger-index) -1) sandstorm-intensity) + 0.2 + ) + ) + (f2-2 (/ (the float (- (current-time) (-> this taxi-timer))) + (the float (-> this passenger-pos (-> this current-passenger-index) total-time)) + ) + ) + ) + (if (-> this passenger-pos (-> this current-passenger-index) is-final?) + (set! f2-2 (* f2-2 f2-2)) + ) + (set-setting! 'fog-special-interp-targ #f (lerp f1-1 f0-0 f2-2) 0) + ) + (set-setting! 'fog-special-interp-rate #f 0.01 0) + (none) + ) + +;; definition for method 25 of type task-manager-desert-rescue +;; INFO: this function exists in multiple non-identical object files +(defmethod task-manager-method-25 ((this task-manager-desert-rescue)) + (call-parent-method this) + (none) + ) + +;; definition for method 45 of type task-manager-desert-rescue +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-desert-rescue-method-45 ((this task-manager-desert-rescue) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3) (= v1-0 4)) + (let ((s5-0 (mod (-> this current-passenger-index) 3))) + 0 + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> (target-pos 0) quad)) + (let ((a0-8 (the-as process-focusable (handle->process (-> this current-passenger))))) + (if a0-8 + (set! (-> s4-0 quad) (-> (get-trans a0-8 3) quad)) + ) + ) + (let ((s4-1 (speech-play (-> *rescue-speech-array* s5-0) arg0 *desert-rescue-speech-list* s4-0))) + (when (>= s4-1 0) + (dotimes (s3-3 3) + (if (!= s3-3 s5-0) + (mark-speech-played (-> *rescue-speech-array* s3-3 arg0) s4-1) + ) + ) + ) + ) + ) + ) + ) + (else + (speech-play (-> *rescue-speech-array* 0) arg0 *desert-rescue-speech-list* (target-pos 0)) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate fail-delay (task-manager-desert-rescue) + :virtual #t + :event task-manager-event-handler + :trans (behavior () + ((-> (method-of-type task-manager active) trans)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (send-event self 'fail) + (sleep-code) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/desresc-path_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/desresc-path_REF.gc new file mode 100644 index 0000000000..492e23169a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/rescue/desresc-path_REF.gc @@ -0,0 +1,224 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type desert-transport-node +(deftype desert-transport-node (structure) + ((pos vector :inline) + (is-stop? symbol) + ) + ) + +;; definition for method 3 of type desert-transport-node +(defmethod inspect ((this desert-transport-node)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'desert-transport-node) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tis-stop?: ~A~%" (-> this is-stop?)) + (label cfg-4) + this + ) + +;; definition for symbol *desresc-transport-path-0*, type (array desert-transport-node) +(define *desresc-transport-path-0* (new 'static 'boxed-array :type desert-transport-node + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6196182.0 :y 215947.67 :z 9253558.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5925682.0 :y 235313.56 :z 8948037.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5868665.0 :y 213170.17 :z 8671557.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5888490.5 :y 128275.664 :z 8337037.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5923757.0 :y 87350.07 :z 8139734.0 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5870017.5 :y 76057.805 :z 7894547.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5672508.0 :y 58489.652 :z 7758150.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5527551.0 :y 68619.47 :z 7466146.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5458369.5 :y 90043.59 :z 7101684.0 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5642975.5 :y 103924.94 :z 6626957.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5333318.5 :y 129668.71 :z 6372432.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5222480.5 :y 155880.66 :z 6057942.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5283060.0 :y 186220.55 :z 5749308.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5609142.5 :y 186021.89 :z 5486099.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5897951.5 :y 155497.27 :z 5348228.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6212156.0 :y 99508.23 :z 5045410.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6272776.5 :y 79628.29 :z 4719286.5 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6170582.0 :y 140795.9 :z 4548402.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 6000680.0 :y 198616.67 :z 4405820.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5820701.5 :y 235186.17 :z 4330085.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5738986.5 :y 238085.33 :z 4255906.0 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 5717236.0 :y 212852.73 :z 4058644.0 :w 1.0) + :is-stop? #f + ) + ) + ) + +;; definition for symbol *desresc-transport-path-1*, type (array desert-transport-node) +(define *desresc-transport-path-1* (new 'static 'boxed-array :type desert-transport-node + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15695336.0 :y 86728.3 :z 8010381.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15516956.0 :y 92864.516 :z 8010751.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15364666.0 :y 96409.6 :z 7933500.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15200581.0 :y 92348.414 :z 7886683.0 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 15011551.0 :y 93317.53 :z 7887707.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 14867456.0 :y 89701.99 :z 7885782.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 14638077.0 :y 82869.86 :z 7847688.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 14412182.0 :y 88968.805 :z 7880703.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 14100068.0 :y 98887.27 :z 7760566.5 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13938726.0 :y 123237.58 :z 7664106.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13803557.0 :y 139907.08 :z 7622122.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13721883.0 :y 140944.6 :z 7571456.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13555177.0 :y 140549.33 :z 7551261.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13383473.0 :y 136199.38 :z 7583005.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13129562.0 :y 127914.805 :z 7486093.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12857832.0 :y 70269.75 :z 7293992.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12686865.0 :y 65625.7 :z 7177706.5 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12513768.0 :y 66672.23 :z 7145348.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12386916.0 :y 65139.508 :z 7102667.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12306757.0 :y 32768.0 :z 6995597.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12404979.0 :y 45604.453 :z 6859611.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12506682.0 :y 54308.043 :z 6825695.5 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12699113.0 :y 52638.105 :z 6692822.0 :w 1.0) + :is-stop? #f + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 12936967.0 :y 48149.707 :z 6653418.5 :w 1.0) + :is-stop? #t + ) + (new 'static 'desert-transport-node + :pos (new 'static 'vector :x 13037525.0 :y 65425.0 :z 6507437.0 :w 1.0) + :is-stop? #f + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc new file mode 100644 index 0000000000..f4916ef355 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc @@ -0,0 +1,4453 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-neo-sat neo-satellite neo-satellite-lod0-jg neo-satellite-idle-ja + ((neo-satellite-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :shadow neo-satellite-shadow-mg + :origin-joint-index 3 + :global-effects 32 + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 22) (new 'static 'lightning-spec + :name "neo-sat-lightning-shock" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :b #x40 :a #x80) + :end-color (new 'static 'rgba :r #x80 :b #x40 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +;; definition for function spt-birth-func-brightness-sat-shockwave +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-sat-shockwave ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 51) 200)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 1679 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-sat-shockwave) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.06666667)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees 60) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function spt-birth-func-part-sat-shockwave +(defun spt-birth-func-part-sat-shockwave ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-sat-shockwave arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 1680 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 0.5)) + (:scale-y (meters 1)) + (:r 50.0 128.0) + (:g 255.0) + (:b 8.0 64.0) + (:a 128.0 128.0) + (:omega (degrees 0)) + (:vel-z (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y (meters -0.001)) + (:fade-a -0.425) + (:friction 0.997 0.003) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'spt-func-part-neo-sat-shockwave-hot) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1681 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:scale-y (meters 1.2) (meters 0.5)) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 255.0) + (:vel-x (meters 0.00033333333)) + (:fade-r -5.5) + (:fade-g -20.0) + (:fade-a -3.4) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + (:func 'sparticle-turn-to-vel) + (:next-time (seconds 0.035)) + (:next-launcher 1682) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1682 + :init-specs ((:fade-r -20.0)) + ) + +;; definition for function spt-birth-func-brightness-scorch-bits +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-scorch-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (mod (the-as int (rand-uint31-gen *random-generator*)) 51)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-5 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 40)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-5))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 1683 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-scorch-bits) + (:num 4.0) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.05) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.0033333334) (meters 0.016666668)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function spt-birth-func-part-scorch-bits +(defun spt-birth-func-part-scorch-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-scorch-bits arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 1684 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0) + (:z (meters 0) (meters 4)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 10.0) + (:g 20.0) + (:b 255.0) + (:a 255.0) + (:vel-y (meters 0.016666668) (meters 0.05)) + (:vel-z (meters -0.33333334)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:fade-a -5.1 -5.1) + (:accel-y (meters -0.0033333334)) + (:friction 0.8) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:conerot-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-sat-ground-impact + :id 418 + :duration (seconds 0.05) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1685 :flags (sp7)) (sp-item 1686 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1685 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-ground-impact) + (:num 10.0) + (:x (meters 2)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.06666667)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees -20) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-ground-impact +(defun spt-birth-func-part-ground-impact ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-sat-shockwave arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 1686 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 10.0) + (:scale-x (meters 2) (meters 1)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 110.0) + (:b 50.0) + (:a 64.0) + (:vel-z (meters 0.05) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.01)) + (:scalevel-y (meters -0.001)) + (:fade-a -0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:conerot-x (degrees 0) (degrees -45)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-sat-ground-emerge + :id 419 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1687 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-sat-ground-dust + :id 420 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1688 :flags (sp7) :period (seconds 10) :length (seconds 0.05))) + ) + +;; failed to figure out what this is: +(defpart 1687 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-ground-emerge) + (:num 0.3 0.3) + (:x (meters -2) (meters 4)) + (:y (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.00066666666) (meters -0.001)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-ground-emerge +(defun spt-birth-func-part-ground-emerge ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-sat-shockwave arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 1688 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 10.0) + (:scale-x (meters 4) (meters 2)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 110.0) + (:b 50.0) + (:a 64.0) + (:vel-z (meters 0.05) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.01)) + (:scalevel-y (meters -0.001)) + (:fade-a -0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:conerot-x (degrees 0) (degrees -45)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-sat-debris-fly + :id 421 + :duration (seconds 0.017) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1689 :flags (sp7)) (sp-item 1690 :flags (sp7)) (sp-item 1691)) + ) + +;; failed to figure out what this is: +(defpart 1689 + :init-specs ((:texture (middot level-default-sprite)) + (:num 20.0) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.06666667) (meters 0.06666667)) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 0.167) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-y (degrees -30) (degrees 60)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1690 + :init-specs ((:texture (crate-wood-01-splinter level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 5.0 5.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 10.0 100.0) + (:b 200.0) + (:a 128.0) + (:vel-z (meters 0.016666668) (meters 0.1)) + (:rotvel-z (degrees -5) (degrees 10)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x400600 #x408900 #x405000)) + (:conerot-x (degrees 0) (degrees -40)) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1691 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:scale-y (meters 2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.013333334)) + (:scalevel-y (meters 0.0033333334)) + (:fade-a -0.21333334) + (:accel-y (meters 0.001)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-sat-antenna-explode + :id 422 + :duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1692 :flags (sp7) :period (seconds 0.335) :length (seconds 0.017)) (sp-item 1693 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1692 + :init-specs ((:texture (middot level-default-sprite)) + (:num 100.0) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.045)) + (:vel-z (meters 0.06666667) (meters 0.06666667)) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 0.167) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1693 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.1 0.2) + (:scale-x (meters 2) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 40.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 255.0) + (:scalevel-y (meters 0.04)) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-sat-damage-light + :id 423 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1694 :flags (sp7)) (sp-item 1695 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1694 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:scale-x (meters 0.2) (meters 0.8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1695 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.05 0.1) + (:x (meters 0) (meters 2)) + (:y (meters -1)) + (:scale-x (meters 0.2) (meters 0.8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.001)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.001)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-sat-damage-medium + :id 424 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1696 :flags (sp7)) (sp-item 1697 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1696 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:scale-x (meters 0.2) (meters 0.8)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1697 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.1 0.2) + (:x (meters 0) (meters 2)) + (:y (meters -1)) + (:scale-x (meters 0.4) (meters 0.8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 160.0) + (:scalevel-x (meters -0.001)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.26666668 -0.26666668) + (:accel-y (meters -0.001)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-sat-damage-heavy + :id 425 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1698 :flags (sp7)) (sp-item 1699 :flags (sp7)) (sp-item 1700 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1698 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:scale-x (meters 0.6) (meters 1)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:vel-y (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1699 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.2 0.4) + (:x (meters 0) (meters 2)) + (:y (meters -1)) + (:scale-x (meters 0.6) (meters 0.8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 200.0) + (:b 255.0) + (:a 160.0) + (:scalevel-x (meters -0.001)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.26666668 -0.26666668) + (:accel-y (meters -0.001)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1700 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:x (meters 0) (meters 0.5)) + (:y (meters 0.5)) + (:scale-x (meters 0.5) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0 30.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.0033333334)) + (:scalevel-x (meters -0.0033333334) (meters -0.0033333334)) + (:scalevel-y (meters 0.0033333334) (meters 0.0033333334)) + (:fade-g -0.8) + (:fade-b -0.2) + (:fade-a -0.2 -0.6666667) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-satellite-explode + :id 426 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1701 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1702 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1703 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1704 :period (seconds 30) :length (seconds 0.167)) + (sp-item 1705 :period (seconds 30) :length (seconds 0.335)) + (sp-item 1706 :period (seconds 30) :length (seconds 0.667) :offset 300) + (sp-item 1707 :period (seconds 30) :length (seconds 0.117)) + ) + ) + +;; failed to figure out what this is: +(defpart 1707 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 10.0) + (:y (meters -3.5) (meters 2)) + (:scale-x (meters 5)) + (:rot-x 4) + (:scale-y (meters 0.2) (meters 0.4)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 0.0675)) + (:vel-y (meters 0.26666668) (meters 0.33333334)) + (:fade-a -0.51 -0.51) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.9 0.08) + (:timer (seconds 1.5) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 140)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1706 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 10.0) + (:x (meters -5) (meters 10)) + (:y (meters -5) (meters 10)) + (:z (meters -5) (meters 10)) + (:scale-x (meters 0.05) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 0.0 32.0) + (:b 255.0) + (:a 120.0 120.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0) (meters 0.01)) + (:fade-a -0.17 -0.1275) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.017)) + (:next-launcher 1708) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1708 + :init-specs ((:accel-x (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-y (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-z (meters -0.0033333334) 1 (meters 0.006666667)) + (:next-time (seconds 0.067) (seconds 0.03)) + (:next-launcher 1708) + ) + ) + +;; failed to figure out what this is: +(defpart 1701 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 0.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1702 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 30.0) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 30.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.06666667) + (:fade-g -0.025) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.99) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1704 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 30.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.6666667) (meters 0.26666668)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.13333334) + (:fade-g -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.8) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1705 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters -4) (meters 8)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.06666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-sat-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 32.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 64.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 64.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 64.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-sat-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-sat-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-sat-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-sat-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-sat-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 0.625 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-sat-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 0.625 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-neo-satellite-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-neo-satellite-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.7) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 1705 init-specs 16 initial-valuef) + (the-as float *part-neo-satellite-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* color-start) *range-sat-explo-color*) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* alpha-start) *range-sat-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* scale-x-start) *range-sat-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* scale-y-start) *range-sat-explo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* a-scalar) *curve-sat-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* scale-x-scalar) *curve-sat-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-neo-satellite-explosion-texture-curve-settings* scale-y-scalar) *curve-sat-explo-scale-y*) + +;; failed to figure out what this is: +(defpart 1703 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 40.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-neo-satellite-buildup + :id 427 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1709 :flags (is-3d sp7) :period (seconds 10) :length (seconds 2)) + (sp-item 1710 :flags (sp7) :period (seconds 10) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 1709 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.4 0.4) + (:scale-x (meters 40) (meters 40)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0)) + (:r 128.0) + (:g 64.0) + (:b 255.0) + (:a 255.0) + (:scalevel-y (meters 0.033333335)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1711) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1711 + :init-specs ((:scalevel-y (meters 0))) + ) + +;; failed to figure out what this is: +(defpart 1710 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; definition of type neo-sat-laser-info +(deftype neo-sat-laser-info (structure) + ((joint int16) + (rope-index int16) + ) + ) + +;; definition for method 3 of type neo-sat-laser-info +(defmethod inspect ((this neo-sat-laser-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'neo-sat-laser-info) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Trope-index: ~D~%" (-> this rope-index)) + (label cfg-4) + this + ) + +;; definition for symbol *neo-sat-laser-array*, type (array neo-sat-laser-info) +(define *neo-sat-laser-array* (new 'static 'boxed-array :type neo-sat-laser-info + (new 'static 'neo-sat-laser-info :joint 4) + (new 'static 'neo-sat-laser-info :joint 5 :rope-index -1) + (new 'static 'neo-sat-laser-info :joint 6 :rope-index 1) + (new 'static 'neo-sat-laser-info :joint 7 :rope-index 1) + (new 'static 'neo-sat-laser-info :joint 8 :rope-index 2) + (new 'static 'neo-sat-laser-info :joint 9 :rope-index -1) + ) + ) + +;; definition of type neo-sat-hash-index +(deftype neo-sat-hash-index (structure) + ((h0 float) + (h1 float) + ) + :pack-me + ) + +;; definition for method 3 of type neo-sat-hash-index +(defmethod inspect ((this neo-sat-hash-index)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'neo-sat-hash-index) + (format #t "~1Th0: ~f~%" (-> this h0)) + (format #t "~1Th1: ~f~%" (-> this h1)) + (label cfg-4) + this + ) + +;; definition of type rope-neo-sat-whip +(deftype rope-neo-sat-whip (rope-prim-system) + ((parent-handle handle) + ) + ) + +;; definition for method 3 of type rope-neo-sat-whip +(defmethod inspect ((this rope-neo-sat-whip)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tknots: ~A~%" (-> this knots)) + (format #t "~1Tknot-constraints: ~A~%" (-> this knot-constraints)) + (format #t "~1Taccum-force: #~%" (-> this accum-force)) + (format #t "~1Tgravity: ~f~%" (-> this gravity)) + (format #t "~1Tgravity-dir: #~%" (-> this gravity-dir)) + (format #t "~1Tdrag: ~f~%" (-> this drag)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tangular-mass-seek-rate: ~f~%" (-> this angular-mass-seek-rate)) + (format #t "~1Tstrip1: ~A~%" (-> this strip1)) + (format #t "~1Tstrip2: ~A~%" (-> this strip2)) + (format #t "~1Twidth: ~f~%" (-> this width)) + (format #t "~1Talpha: ~f~%" (-> this alpha)) + (format #t "~1Tuv-repeat-dist: ~f~%" (-> this uv-repeat-dist)) + (format #t "~1Tparent-handle: ~D~%" (-> this parent-handle)) + (label cfg-4) + this + ) + +;; definition of type neo-sat-yellow-ammo-pos +(deftype neo-sat-yellow-ammo-pos (structure) + ((angle float) + (dist float) + ) + :allow-misaligned + ) + +;; definition for method 3 of type neo-sat-yellow-ammo-pos +(defmethod inspect ((this neo-sat-yellow-ammo-pos)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'neo-sat-yellow-ammo-pos) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (label cfg-4) + this + ) + +;; definition for symbol *neo-sat-focus-pos*, type vector +(define *neo-sat-focus-pos* (new 'static 'vector)) + +;; definition of type neo-sat +(deftype neo-sat (nav-enemy) + ((nav-vector vector :inline) + (y-movement float) + (ground-offset float) + (desired-y-height float) + (xz-vel float) + (x-vel float) + (z-vel float) + (offset-angle float) + (last-thrust-vec vector :inline) + (disc-joint joint-mod-rotate-local :inline) + (laser-rotate-angle float) + (wander-generate-time time-frame) + (hit-player? symbol) + (desired-float-height float) + (bob-speed-scalar float) + (on-ground? symbol) + (current-shockwave-radius float) + (active-laser-index int8) + (current-stage int8) + (fly-speed-scalar float) + (last-shockwave-radius float) + (ropes (array rope-neo-sat-whip)) + (max-speed float) + (spin-current float) + (spin-dest float) + (spin-speed float) + (hashed-heights float 1225) + (shockwave-origin vector :inline) + (current-height-probe-index int16) + (last-spawned-ring-index int16) + (global-neo-sat-index uint8) + (yellow-ammo-pos neo-sat-yellow-ammo-pos 4 :inline) + (num-yellow-ammo int8 :offset 5784) + (start-thrust-pos vector :inline) + (was-player-inside-cone? symbol) + (was-doing-cone-check? symbol) + (damage-part1 sparticle-launch-control) + (damage-part2 sparticle-launch-control) + (damage-part3 sparticle-launch-control) + (burst-dust-part sparticle-launch-control) + (warp-handle handle) + (spine-joint-mods joint-mod-rotate-local 6 :inline) + (actual-laser-rotate-angle float) + (last-particle-rotate float) + (trunk-joint joint-mod-rotate-local :inline) + (ground-height float) + (tentacle rope-joint-system) + (anim-loop? symbol) + (play-anim? symbol) + (anim-speed float) + (should-rise? symbol) + (last-play-laser-time time-frame) + (snd-laser-burn sound-id) + (snd-whips-loop sound-id 3) + (sound-last-snap-time time-frame 3) + (sound-next-play-time time-frame 3) + (new-spin-time time-frame) + (snd-arms-chatter sound-id) + (was-spinning? symbol) + (snd-hover sound-id) + (snd-spool-explosion sound-id) + (antenna-explode-part sparticle-launch-control) + (next-lightning-time time-frame) + ) + (:state-methods + sat-idle + neo-sat-drill-attack + neo-sat-drill-prepare + neo-sat-drill-returning + neo-sat-laser-attack + neo-sat-drill-impact + neo-sat-sit-and-spin + ground-burst + ) + (:methods + (neo-sat-method-198 (_type_) none) + (neo-sat-method-199 (_type_) none) + (neo-sat-method-200 (_type_) none) + (neo-sat-method-201 (_type_) float) + (neo-sat-probe-ground (_type_ vector) float) + (neo-sat-method-203 (_type_ symbol) vector) + (neo-sat-method-204 (_type_) none) + (neo-sat-method-205 (_type_) none) + (neo-sat-method-206 (_type_ int symbol) none) + (neo-sat-method-207 (_type_) none) + (neo-sat-method-208 (_type_) none) + (neo-sat-method-209 (_type_) float) + (neo-sat-method-210 (_type_) float) + (neo-sat-method-211 (_type_) none) + (neo-sat-method-212 (_type_ vector vector) vector) + (neo-sat-method-213 (_type_ float) int) + (neo-sat-method-214 (_type_ float) int) + (neo-sat-method-215 (_type_ float) float) + (neo-sat-method-216 (_type_ float) float) + (neo-sat-method-217 (_type_ int int) int) + (neo-sat-method-218 (_type_ vector) float) + (neo-sat-method-219 (_type_) none) + (neo-sat-method-220 (_type_) int) + (neo-sat-method-221 (_type_) symbol) + (neo-sat-method-222 (_type_ object vector) float) + (neo-sat-method-223 (_type_ vector int int) symbol) + (neo-sat-method-224 (_type_) none) + (neo-sat-method-225 (_type_ int) object) + (neo-sat-method-226 (_type_ int) rope-system-flag) + (neo-sat-method-227 (_type_ int) none) + (neo-sat-method-228 (_type_) none) + (move-to-ground-height (_type_ float) none) + (neo-sat-method-230 (_type_) none) + (spawn-shield (_type_) none) + (neo-sat-method-232 (_type_ vector) symbol) + (neo-sat-method-233 (_type_) quaternion) + ) + (:states + neo-sat-drill-halting + ) + ) + +;; definition for method 3 of type neo-sat +(defmethod inspect ((this neo-sat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tnav-vector: #~%" (-> this nav-vector)) + (format #t "~2Ty-movement: ~f~%" (-> this y-movement)) + (format #t "~2Tground-offset: ~f~%" (-> this ground-offset)) + (format #t "~2Tdesired-y-height: ~f~%" (-> this desired-y-height)) + (format #t "~2Txz-vel: ~f~%" (-> this xz-vel)) + (format #t "~2Tx-vel: ~f~%" (-> this x-vel)) + (format #t "~2Tz-vel: ~f~%" (-> this z-vel)) + (format #t "~2Toffset-angle: ~f~%" (-> this offset-angle)) + (format #t "~2Tlast-thrust-vec: #~%" (-> this last-thrust-vec)) + (format #t "~2Tdisc-joint: #~%" (-> this disc-joint)) + (format #t "~2Tlaser-rotate-angle: ~f~%" (-> this laser-rotate-angle)) + (format #t "~2Twander-generate-time: ~D~%" (-> this wander-generate-time)) + (format #t "~2Thit-player?: ~A~%" (-> this hit-player?)) + (format #t "~2Tdesired-float-height: ~f~%" (-> this desired-float-height)) + (format #t "~2Tbob-speed-scalar: ~f~%" (-> this bob-speed-scalar)) + (format #t "~2Ton-ground?: ~A~%" (-> this on-ground?)) + (format #t "~2Tcurrent-shockwave-radius: ~f~%" (-> this current-shockwave-radius)) + (format #t "~2Tactive-laser-index: ~D~%" (-> this active-laser-index)) + (format #t "~2Tcurrent-stage: ~D~%" (-> this current-stage)) + (format #t "~2Tfly-speed-scalar: ~f~%" (-> this fly-speed-scalar)) + (format #t "~2Tlast-shockwave-radius: ~f~%" (-> this last-shockwave-radius)) + (format #t "~2Tropes: ~A~%" (-> this ropes)) + (format #t "~2Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~2Tspin-current: ~f~%" (-> this spin-current)) + (format #t "~2Tspin-dest: ~f~%" (-> this spin-dest)) + (format #t "~2Tspin-speed: ~f~%" (-> this spin-speed)) + (format #t "~2Thashed-heights[1225] @ #x~X~%" (-> this hashed-heights)) + (format #t "~2Tshockwave-origin: #~%" (-> this shockwave-origin)) + (format #t "~2Tcurrent-height-probe-index: ~D~%" (-> this current-height-probe-index)) + (format #t "~2Tlast-spawned-ring-index: ~D~%" (-> this last-spawned-ring-index)) + (format #t "~2Tglobal-neo-sat-index: ~D~%" (-> this global-neo-sat-index)) + (format #t "~2Tyellow-ammo-pos[4] @ #x~X~%" (-> this yellow-ammo-pos)) + (format #t "~2Tnum-yellow-ammo: ~D~%" (-> this num-yellow-ammo)) + (format #t "~2Tstart-thrust-pos: #~%" (-> this start-thrust-pos)) + (format #t "~2Twas-player-inside-cone?: ~A~%" (-> this was-player-inside-cone?)) + (format #t "~2Twas-doing-cone-check?: ~A~%" (-> this was-doing-cone-check?)) + (format #t "~2Tdamage-part1: ~A~%" (-> this damage-part1)) + (format #t "~2Tdamage-part2: ~A~%" (-> this damage-part2)) + (format #t "~2Tdamage-part3: ~A~%" (-> this damage-part3)) + (format #t "~2Tburst-dust-part: ~A~%" (-> this burst-dust-part)) + (format #t "~2Twarp-handle: ~D~%" (-> this warp-handle)) + (format #t "~2Tspine-joint-mods[6] @ #x~X~%" (-> this spine-joint-mods)) + (format #t "~2Tactual-laser-rotate-angle: ~f~%" (-> this actual-laser-rotate-angle)) + (format #t "~2Tlast-particle-rotate: ~f~%" (-> this last-particle-rotate)) + (format #t "~2Ttrunk-joint: #~%" (-> this trunk-joint)) + (format #t "~2Tground-height: ~f~%" (-> this ground-height)) + (format #t "~2Ttentacle: ~A~%" (-> this tentacle)) + (format #t "~2Tanim-loop?: ~A~%" (-> this anim-loop?)) + (format #t "~2Tplay-anim?: ~A~%" (-> this play-anim?)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~2Tshould-rise?: ~A~%" (-> this should-rise?)) + (format #t "~2Tlast-play-laser-time: ~D~%" (-> this last-play-laser-time)) + (format #t "~2Tsnd-laser-burn: ~D~%" (-> this snd-laser-burn)) + (format #t "~2Tsnd-whips-loop[3] @ #x~X~%" (-> this snd-whips-loop)) + (format #t "~2Tsound-last-snap-time[3] @ #x~X~%" (-> this sound-last-snap-time)) + (format #t "~2Tsound-next-play-time[3] @ #x~X~%" (-> this sound-next-play-time)) + (format #t "~2Tnew-spin-time: ~D~%" (-> this new-spin-time)) + (format #t "~2Tsnd-arms-chatter: ~D~%" (-> this snd-arms-chatter)) + (format #t "~2Twas-spinning?: ~A~%" (-> this was-spinning?)) + (format #t "~2Tsnd-hover: ~D~%" (-> this snd-hover)) + (format #t "~2Tsnd-spool-explosion: ~D~%" (-> this snd-spool-explosion)) + (format #t "~2Tantenna-explode-part: ~A~%" (-> this antenna-explode-part)) + (format #t "~2Tnext-lightning-time: ~D~%" (-> this next-lightning-time)) + (label cfg-4) + this + ) + +;; definition for symbol *alive-neo-sats*, type (array handle) +(define *alive-neo-sats* (new 'static 'boxed-array :type handle :length 0 :allocated-length 12)) + +;; failed to figure out what this is: +(set! (-> *alive-neo-sats* length) (-> *alive-neo-sats* allocated-length)) + +;; failed to figure out what this is: +(dotimes (v1-107 (-> *alive-neo-sats* length)) + (set! (-> *alive-neo-sats* v1-107) (the-as handle #f)) + ) + +;; definition for symbol *neo-sat-nav-enemy-info*, type nav-enemy-info +(define *neo-sat-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim 4 + :hit-anim 4 + :knocked-anim 4 + :knocked-land-anim 4 + :die-anim 4 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :notice-distance (meters 30) + :notice-distance-delta (meters 10) + :default-hit-points 90.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim -1 + :run-anim 4 + :taunt-anim -1 + :run-travel-speed (meters 20) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 2) + :walk-travel-speed (meters 20) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 1) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 1) + :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! (-> *neo-sat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition of type neo-sat-init-params +(deftype neo-sat-init-params (structure) + ((pos vector :inline) + (quat quaternion :inline) + ) + ) + +;; definition for method 3 of type neo-sat-init-params +(defmethod inspect ((this neo-sat-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'neo-sat-init-params) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (label cfg-4) + this + ) + +;; definition for symbol *neo-sat-rope-tentacle*, type rope-joint-system-info +(define *neo-sat-rope-tentacle* + (new 'static 'rope-joint-system-info :joint-info-array (new 'static 'boxed-array :type rope-joint-info + (new 'static 'rope-joint-info :joint-index 10) + (new 'static 'rope-joint-info :joint-index 11) + (new 'static 'rope-joint-info :joint-index 12) + (new 'static 'rope-joint-info :joint-index 13) + (new 'static 'rope-joint-info :joint-index 14) + (new 'static 'rope-joint-info :joint-index 15) + ) + ) + ) + +;; definition for symbol *neo-satellite-nav-mesh*, type actor-id +(define *neo-satellite-nav-mesh* (the-as actor-id #x11bae)) + +;; definition for function neo-sat-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defbehavior neo-sat-init-by-other neo-sat ((arg0 neo-sat-init-params)) + (stack-size-set! (-> self main-thread) 512) + (logclear! (-> self mask) (process-mask enemy)) + (init-enemy-collision! self) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-sat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init (-> self disc-joint) self (the-as uint 3) (joint-mod-base-flags attached)) + (init (-> self trunk-joint) self (the-as uint 10) (joint-mod-base-flags attached)) + (set! (-> self snd-laser-burn) (new-sound-id)) + (set! (-> self snd-arms-chatter) (new-sound-id)) + (set! (-> self snd-hover) (new-sound-id)) + (dotimes (gp-2 3) + (set! (-> self snd-whips-loop gp-2) (new-sound-id)) + ) + (init-enemy-defaults! self *neo-sat-nav-enemy-info*) + (logior! (-> self skel status) (joint-control-status sync-math)) + (ja-no-eval :group! neo-satellite-idle-ja :num! zero) + (ja-post) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self ropes) (new 'process 'boxed-array rope-neo-sat-whip 3)) + (dotimes (gp-3 (-> self ropes allocated-length)) + (set! (-> self ropes gp-3) (new 'process 'rope-neo-sat-whip)) + (set! (-> self ropes gp-3 parent-handle) (process->handle self)) + (init! (-> self ropes gp-3) 20) + (logior! (-> self ropes gp-3 flags) (rope-system-flag rs0 rs1)) + (set! (-> self ropes gp-3 gravity) 409600.0) + (set! (-> self ropes gp-3 drag) 0.3) + (set! (-> self ropes gp-3 strip1 tex-id) (new 'static 'texture-id :index #xf :page #x5)) + (set! (-> self ropes gp-3 strip2 tex-id) (new 'static 'texture-id :index #xf :page #x5)) + (set! (-> self ropes gp-3 uv-repeat-dist) 40960.0) + (rope-system-method-21 (-> self ropes gp-3)) + ) + (set! (-> self ropes length) (-> self ropes allocated-length)) + (set! (-> self tentacle) (new 'process 'rope-joint-system)) + (set! (-> self damage-part1) (create-launch-control (-> *part-group-id-table* 423) self)) + (set! (-> self damage-part2) (create-launch-control (-> *part-group-id-table* 424) self)) + (set! (-> self damage-part3) (create-launch-control (-> *part-group-id-table* 425) self)) + (set! (-> self burst-dust-part) (create-launch-control (-> *part-group-id-table* 419) self)) + (set! (-> self antenna-explode-part) (create-launch-control (-> *part-group-id-table* 422) self)) + (dotimes (gp-4 (-> *neo-sat-laser-array* length)) + (init + (-> self spine-joint-mods gp-4) + self + (the-as uint (-> *neo-sat-laser-array* gp-4 joint)) + (joint-mod-base-flags attached) + ) + ) + (change-to (get-nav-mesh *neo-satellite-nav-mesh*) self) + (if (not (-> self nav)) + (go process-drawable-art-error "No nav mesh~%") + ) + (let ((v1-109 (-> self nav state))) + (set! (-> v1-109 current-poly) (the-as nav-poly #f)) + ) + 0 + (neo-sat-method-198 self) + (let ((v1-113 0)) + (while (< v1-113 (-> *alive-neo-sats* length)) + (when (= (-> *alive-neo-sats* v1-113) #f) + (set! (-> *alive-neo-sats* v1-113) (process->handle self)) + (set! (-> self global-neo-sat-index) (the-as uint v1-113)) + ) + 0 + (break ((empty)) ((set! v1-113 (the-as int (+ 0 1))))) + ) + ) + (label cfg-28) + (init-enemy! self) + ) + +;; definition for method 198 of type neo-sat +;; WARN: Return type mismatch int vs none. +(defmethod neo-sat-method-198 ((this neo-sat)) + (let ((v1-0 (-> this nav))) + (logclear! (-> v1-0 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) + (let ((a1-7 v1-0)) + (set! (-> a1-7 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + (let ((a1-9 v1-0)) + (set! (-> a1-9 nav-cull-radius) 12288.0) + ) + 0 + (logclear! (-> v1-0 flags) (nav-control-flag output-sphere-hash)) + ) + (set! (-> this enemy-info callback-info) *physics-nav-callback-info*) + (let ((v1-2 this)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + 0 + (none) + ) + +;; definition for method 119 of type neo-sat +;; WARN: Return type mismatch none vs object. +(defmethod init-enemy-defaults! ((this neo-sat) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) + (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (t9-0 this arg0) + ) + (neo-sat-method-199 this) + ) + +;; definition for method 199 of type neo-sat +;; WARN: Return type mismatch symbol vs none. +(defmethod neo-sat-method-199 ((this neo-sat)) + (add-setting! 'music 'desres2 0.0 0) + (logclear! (-> this focus-status) (focus-status disable dead inactive hit)) + (clear-focused (-> this focus)) + (dotimes (v1-6 3) + (set! (-> this sound-last-snap-time v1-6) 0) + ) + (dotimes (v1-9 3) + (set! (-> this sound-next-play-time v1-9) 0) + ) + (logclear! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let ((v1-15 (-> this root root-prim))) + (set! (-> v1-15 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-15 prim-core collide-with) (-> this root backup-collide-with)) + ) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this enemy-flags) (enemy-flag trackable trackable-backup)) + (logior! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (update-transforms (-> this root)) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (let ((v1-31 (-> this nav))) + (set! (-> v1-31 sphere-mask) (the-as uint 65)) + ) + 0 + (let ((v1-33 (-> this nav))) + (set! (-> v1-33 acceleration) 409600000.0) + ) + 0 + (set! (-> this current-stage) 0) + (set! (-> this laser-rotate-angle) 0.0) + (set! (-> this actual-laser-rotate-angle) 0.0) + (set! (-> this hit-player?) #f) + (set! (-> this should-rise?) #f) + (set! (-> this play-anim?) #t) + (set! (-> this was-spinning?) #f) + (none) + ) + +;; definition for method 65 of type neo-sat +;; INFO: Used lq/sq +(defmethod penetrate->next-state ((this neo-sat) (arg0 process) (arg1 event-message-block) (arg2 float)) + (when (< 0.0 arg2) + (let* ((a1-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this incoming attack-direction) 1.0)) + (s5-0 (matrix-f-u-compose (new 'stack-no-clear 'matrix) a1-2 *up-vector*)) + ) + (set! (-> s5-0 trans quad) (-> this root trans quad)) + (if (logtest? (-> *part-group-id-table* 421 flags) (sp-group-flag sp13)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 421) :mat-joint s5-0) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 421) :mat-joint s5-0) + ) + ) + (when (>= 0.0 (-> this hit-points)) + ) + ) + 'none + ) + +;; definition for method 176 of type neo-sat +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-176 ((this neo-sat)) + 0 + (none) + ) + +;; definition for method 177 of type neo-sat +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-177 ((this neo-sat)) + 0 + (none) + ) + +;; definition for method 120 of type neo-sat +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this neo-sat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak 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 -20480.0 0.0 81920.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 9420.8) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 -12288.0 0.0 5324.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set-vector! (-> v1-17 local-sphere) 0.0 -20480.0 0.0 4096.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set-vector! (-> v1-19 local-sphere) 0.0 -32768.0 0.0 8192.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec backgnd jak hit-by-others-list player-list)) + (set! (-> v1-21 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-21 local-sphere) 0.0 9011.2 0.0 9420.8) + ) + (set! (-> s5-0 nav-radius) 6144.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! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type neo-sat +;; WARN: Return type mismatch object vs none. +(defmethod init-enemy! ((this neo-sat)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (set! (-> this draw lod-set lod 1 dist) 983040.0) + (ja-channel-push! 1 0) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity) + ) + (ja-post) + (set-setting! 'dust-storm-sound-scalar #f 0.75 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (go (method-of-object this sat-idle)) + (none) + ) + +;; definition for method 59 of type neo-sat +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod enemy-common-post ((this neo-sat)) + (call-parent-method this) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (when (-> this should-rise?) + (send-event this 'rise-up) + (set! (-> this should-rise?) #f) + ) + (when (-> this play-anim?) + (cond + ((-> this anim-loop?) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 param 0) (-> this anim-speed)) + (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (else + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) + (set! (-> a0-9 param 1) (-> this anim-speed)) + (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (seek! (-> this actual-laser-rotate-angle) (-> this laser-rotate-angle) (* 16384.0 (seconds-per-frame))) + (let ((v1-24 (-> this draw shadow-ctrl))) + (set! (-> v1-24 settings top-plane w) (- 4096.0)) + ) + 0 + (let ((v1-27 (-> this draw shadow-ctrl))) + (set! (-> v1-27 settings bot-plane w) (- (+ (- -12288.0 (-> this root trans y)) (-> this ground-height)))) + ) + 0 + (dotimes (s5-0 (-> *neo-sat-laser-array* length)) + (quaternion-identity! (the-as quaternion (+ (the-as uint (-> this spine-joint-mods 0 rotation)) (* s5-0 32)))) + (quaternion-rotate-local-x! + (the-as quaternion (+ (the-as uint (-> this spine-joint-mods 0 rotation)) (* s5-0 32))) + (the-as quaternion (+ (the-as uint (-> this spine-joint-mods 0 rotation)) (* s5-0 32))) + (- (-> this actual-laser-rotate-angle)) + ) + ) + (let ((a0-19 (handle->process (-> this focus handle)))) + (if a0-19 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-19) 0) quad)) + ) + ) + (let ((f0-18 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) + (when (< 0.0 f0-18) + (cond + ((< f0-18 0.27) + (spawn (-> this damage-part3) (-> this root trans)) + (when (< (-> this next-lightning-time) (current-time)) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 22) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + (set! (-> this next-lightning-time) (+ (current-time) (seconds 0.35))) + ) + ) + ((< f0-18 0.6) + (spawn (-> this damage-part2) (-> this root trans)) + ) + ((< f0-18 0.9) + (spawn (-> this damage-part1) (-> this root trans)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 202 of type neo-sat +;; INFO: Used lq/sq +(defmethod neo-sat-probe-ground ((this neo-sat) (arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> gp-0 start-pos) arg0 *up-vector* 81920.0) + (set! (-> gp-0 move-dist quad) (the-as uint128 0)) + (set! (-> gp-0 move-dist y) -245760.0) + (let ((v1-4 gp-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) + (-> gp-0 best-other-tri intersect y) + -40960000.0 + ) + ) + ) + +;; definition for method 229 of type neo-sat +;; WARN: Return type mismatch symbol vs none. +(defmethod move-to-ground-height ((this neo-sat) (arg0 float)) + (set! (-> this ground-height) arg0) + (let ((f0-2 (+ arg0 (-> this ground-offset)))) + (set! (-> this on-ground?) #f) + (when (< (-> this root trans y) f0-2) + (set! (-> this root trans y) f0-2) + (set! (-> this y-movement) 0.0) + (set! (-> this on-ground?) #t) + ) + ) + (none) + ) + +;; definition for symbol *h0*, type float +(define *h0* 20.0) + +;; definition for symbol *h1*, type float +(define *h1* 8.0) + +;; definition for symbol *hs*, type float +(define *hs* 4.0) + +;; definition for method 201 of type neo-sat +(defmethod neo-sat-method-201 ((this neo-sat)) + (when (and (-> this next-state) (= (-> this next-state name) 'neo-sat-drill-prepare)) + (let ((f0-1 (* 0.000010172526 (-> this spin-current)))) + (sound-play-by-name + (static-sound-name "sat-hover") + (-> this snd-hover) + 1024 + (the int (* 1524.0 (lerp 0.0 0.25 f0-1))) + 0 + (sound-group) + #t + ) + ) + ) + (let ((f30-1 (neo-sat-probe-ground this (-> this root trans)))) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (set! (-> a1-3 x) (-> this root trans x)) + (set! (-> a1-3 y) f30-1) + (set! (-> a1-3 z) (-> this root trans z)) + (set! (-> a1-3 w) 1.0) + (set-virtual-cur-pos! (-> this nav state) a1-3) + ) + (move-to-ground-height this f30-1) + (set! (-> this desired-y-height) (+ f30-1 (-> this desired-float-height))) + ) + (let ((f30-2 (- (-> this desired-y-height) (-> this root trans y))) + (f0-11 0.0) + ) + (when (< 8192.0 (fabs (-> this y-movement))) + (let ((f1-5 (* 0.00012207031 (+ -8192.0 (fabs (-> this y-movement)))))) + (fmax 0.0 (fmin 1.0 f1-5)) + ) + (set! f0-11 (lerp 0.0 *h1* 1.0)) + ) + (let ((f1-12 + (* (+ (* *h0* f30-2) (* f0-11 (- (-> this y-movement)))) *hs* (-> this bob-speed-scalar) (seconds-per-frame)) + ) + ) + (+! (-> this y-movement) (* f1-12 (seconds-per-frame))) + ) + ) + (set! (-> this root trans y) (+ (-> this root trans y) (* (-> this y-movement) (seconds-per-frame)))) + ) + +;; definition for symbol *m0*, type float +(define *m0* 30.0) + +;; definition for symbol *m1*, type float +(define *m1* 20.0) + +;; definition for symbol *ms*, type float +(define *ms* 1.5) + +;; definition for symbol *move-offset*, type float +(define *move-offset* 32768.0) + +;; definition for symbol *maxh*, type float +(define *maxh* 16384.0) + +;; definition for symbol *minh*, type float +(define *minh* 16384.0) + +;; definition for symbol *maxl*, type float +(define *maxl* 73728.0) + +;; definition for symbol *minl*, type float +(define *minl* 69632.0) + +;; definition for method 203 of type neo-sat +;; INFO: Used lq/sq +(defmethod neo-sat-method-203 ((this neo-sat) (arg0 symbol)) + (let ((a0-1 (-> this nav state)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a0-1 target-pos quad)) + (let ((f30-0 (vector-vector-xz-distance (-> this root trans) a1-1))) + (-> this xz-vel) + (let ((s5-0 (new-stack-vector0))) + (when arg0 + (let ((a1-2 (the-as process-focusable (handle->process (-> this focus handle))))) + (if a1-2 + (vector-float*! s5-0 (-> a1-2 root transv) 1.0) + ) + ) + ) + (fabs (+ -32768.0 f30-0)) + (let ((s3-1 (vector+float*! (new 'stack-no-clear 'vector) s5-0 (-> this nav-vector) f30-0))) + (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this root transv) 1.0) + (-> this nav-vector) + ) + (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) s3-1 (-> this root transv)))) + (vector-lerp! (-> this last-thrust-vec) (-> this last-thrust-vec) s4-2 (* 2.0 (seconds-per-frame))) + (set! (-> s4-2 quad) (-> this last-thrust-vec quad)) + (let* ((f1-1 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this root transv) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-2 1.0) + ) + ) + (f0-18 (* (+ (* *m0* f30-0) (* -1.0 (vector-length (-> this root transv)) f1-1 *m1*)) + (lerp 1.0 2.0 (fmax 0.0 (fmin 1.0 (* 0.0000061035157 (vector-length s5-0))))) + *ms* + (seconds-per-frame) + ) + ) + ) + (vector-normalize! s4-2 (* f0-18 (seconds-per-frame))) + ) + (vector+! (-> this root transv) (-> this root transv) s4-2) + ) + ) + ) + ) + ) + (let ((f0-20 (vector-length (-> this root transv)))) + (if (< (-> this max-speed) f0-20) + (vector-float*! (-> this root transv) (-> this root transv) (/ (-> this max-speed) f0-20)) + ) + ) + (vector-v++! (-> this root trans) (-> this root transv)) + ) + +;; definition for method 204 of type neo-sat +;; WARN: Return type mismatch connection vs none. +(defmethod neo-sat-method-204 ((this neo-sat)) + (set-setting! 'fov 'abs (degrees 75.0) 0) + (set-setting! 'string-min-height 'abs *minh* 0) + (set-setting! 'string-max-height 'abs *maxh* 0) + (set-setting! 'string-min-length 'abs *minl* 0) + (set-setting! 'string-max-length 'abs *maxl* 0) + (none) + ) + +;; definition for method 208 of type neo-sat +;; WARN: Return type mismatch connection vs none. +(defmethod neo-sat-method-208 ((this neo-sat)) + (set-setting! 'fov 'abs (degrees 75.0) 0) + (set-setting! 'string-min-height 'abs (meters 4) 0) + (set-setting! 'string-max-height 'abs (meters 8) 0) + (set-setting! 'string-min-length 'abs *minl* 0) + (set-setting! 'string-max-length 'abs *maxl* 0) + (none) + ) + +;; definition for method 205 of type neo-sat +(defmethod neo-sat-method-205 ((this neo-sat)) + (remove-setting! 'fov) + (remove-setting! 'string-min-height) + (remove-setting! 'string-max-height) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (none) + ) + +;; definition for method 233 of type neo-sat +(defmethod neo-sat-method-233 ((this neo-sat)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans)))) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let ((s5-2 (quaternion-look-at! (new 'stack-no-clear 'quaternion) s5-1 *up-vector*))) + (quaternion-rotate-y! s5-2 s5-2 -10922.667) + (quaternion-slerp! + (-> this trunk-joint rotation) + (-> this trunk-joint rotation) + s5-2 + (* 2.0 (seconds-per-frame)) + ) + ) + ) + ) + +;; definition for method 200 of type neo-sat +;; WARN: Return type mismatch quaternion vs none. +(defmethod neo-sat-method-200 ((this neo-sat)) + (neo-sat-method-201 this) + (neo-sat-method-203 this #t) + (neo-sat-method-233 this) + (none) + ) + +;; definition for method 207 of type neo-sat +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defmethod neo-sat-method-207 ((this neo-sat)) + (set-setting! 'duststorm-push-player? #f 0.0 0) + (set! (-> this last-play-laser-time) 0) + (set! (-> this current-height-probe-index) 0) + (set! (-> this shockwave-origin quad) (-> this root trans quad)) + (let ((v1-8 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> *neo-sat-laser-array* 0 joint))) + ) + ) + 0.0 + 0.0 + (let* ((s5-0 (new 'stack-no-clear 'vector)) + (f30-0 (- (-> v1-8 y) (-> this root trans y))) + (a0-8 (vector-! (new 'stack-no-clear 'vector) v1-8 (-> this root trans))) + (f28-0 (sqrtf (+ (* (-> a0-8 x) (-> a0-8 x)) (* (-> a0-8 z) (-> a0-8 z))))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans))) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-1 y) 0.0) + (vector-normalize! s4-1 1.0) + (vector-float*! s4-1 s4-1 81920.0) + (vector+! s3-0 (-> this focus-pos) s4-1) + (vector-normalize! s4-1 1.0) + (vector-float*! s4-1 s4-1 f28-0) + (set! (-> s4-1 y) f30-0) + (vector+! s5-0 (-> this root trans) s4-1) + (let ((a0-19 (vector-! (new 'stack-no-clear 'vector) s3-0 s5-0))) + 0.0 + 0.0 + (let ((f30-1 (fabs (-> a0-19 y)))) + (set! (-> a0-19 y) 0.0) + (let ((f0-13 (vector-normalize-ret-len! a0-19 1.0))) + (set! (-> this laser-rotate-angle) (- (atan f30-1 f0-13))) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 82 of type neo-sat +(defmethod event-handler ((this neo-sat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let ((a0-3 (-> arg3 param 1)) + (s1-0 (new 'stack-no-clear 'attack-info)) + ) + ((method-of-type attack-info attack-info-method-9) + (the-as attack-info a0-3) + s1-0 + (the-as process-drawable arg0) + this + ) + (if (and (not (logtest? (-> this enemy-flags) (enemy-flag vulnerable))) + (< (+ -8192.0 (-> this root trans y)) (-> s1-0 intersection y)) + ) + (send-event (handle->process (-> this warp-handle)) 'hit) + ) + ) + ) + (('notify) + (case (-> arg3 param 0) + (('attack) + (let ((v1-18 (the-as process (-> arg3 param 1)))) + (if (and v1-18 (= (-> v1-18 type) target) (> (-> this current-stage) 0)) + (set! (-> this hit-player?) #t) + ) + ) + ) + ) + ) + ) + (call-parent-method this arg0 arg1 arg2 arg3) + ) + +;; definition for method 67 of type neo-sat +(defmethod coin-flip? ((this neo-sat)) + #f + ) + +;; failed to figure out what this is: +(defstate neo-sat-drill-halting (neo-sat) + :event enemy-event-handler + :trans (behavior () + (if (-> self hit-player?) + (go-virtual hostile) + ) + (neo-sat-method-230 self) + (seek! (-> self anim-speed) 3.0 (* 0.15 (seconds-per-frame))) + (neo-sat-method-233 self) + (vector-float*! (-> self root transv) (-> self root transv) (fmax 0.0 (- 1.0 (* 2.0 (seconds-per-frame))))) + (vector-v++! (-> self root trans) (-> self root transv)) + (neo-sat-method-220 self) + (dotimes (gp-0 (-> *neo-sat-laser-array* length)) + (neo-sat-method-206 self (-> *neo-sat-laser-array* gp-0 joint) #f) + ) + (set! (-> self spin-current) 49152.0) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + (if (< (vector-length (-> self root transv)) 2048.0) + (go-virtual neo-sat-drill-returning) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate neo-sat-drill-returning (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((a0-12 (-> self nav state)) + (v1-4 (-> self shockwave-origin)) + ) + (logclear! (-> a0-12 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-12 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-12 target-pos quad) (-> v1-4 quad)) + ) + 0 + (set! (-> self last-thrust-vec quad) (the-as uint128 0)) + ) + :trans (behavior () + (if (-> self hit-player?) + (go-virtual hostile) + ) + (neo-sat-method-230 self) + (seek! (-> self anim-speed) 3.0 (* 0.15 (seconds-per-frame))) + (vector-! (-> self nav-vector) (-> self shockwave-origin) (-> self root trans)) + (set! (-> self nav-vector y) 0.0) + (vector-normalize! (-> self nav-vector) 1.0) + (neo-sat-method-203 self #f) + (neo-sat-method-233 self) + (neo-sat-method-220 self) + (neo-sat-method-201 self) + (dotimes (gp-0 (-> *neo-sat-laser-array* length)) + (neo-sat-method-206 self (-> *neo-sat-laser-array* gp-0 joint) #f) + ) + (set! (-> self spin-current) 49152.0) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self shockwave-origin)) 901.12) + (go-virtual neo-sat-drill-prepare) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate neo-sat-drill-prepare (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! neo-satellite-stab-ja :num! (seek!) :frame-num 0.0) + (set! (-> self anim-loop?) #f) + (set! (-> self anim-speed) 0.7) + (sound-stop (-> self snd-arms-chatter)) + ) + :trans (behavior () + (neo-sat-method-220 self) + (if (time-elapsed? (-> self state-time) (seconds 1.5)) + (go-virtual neo-sat-drill-attack) + ) + (if (-> self hit-player?) + (go-virtual hostile) + ) + (if #f + (neo-sat-method-230 self) + ) + (neo-sat-method-201 self) + (let* ((f0-1 (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (f30-0 (* f0-1 f0-1)) + ) + (set! (-> self bob-speed-scalar) (lerp 1.0 10.0 f30-0)) + (set! (-> self spin-current) (lerp 49152.0 98304.0 f30-0)) + ) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + (when #f + (dotimes (gp-0 (-> *neo-sat-laser-array* length)) + (neo-sat-method-206 self (-> *neo-sat-laser-array* gp-0 joint) #f) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (sound-stop (-> self snd-laser-burn)) + (neo-sat-method-208 self) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for method 224 of type neo-sat +;; WARN: Return type mismatch int vs none. +(defmethod neo-sat-method-224 ((this neo-sat)) + 0 + (none) + ) + +;; definition for method 10 of type rope-neo-sat-whip +;; WARN: Return type mismatch symbol vs vector. +(defmethod rope-system-method-10 ((this rope-neo-sat-whip)) + (call-parent-method this) + (let ((s5-0 (the-as neo-sat (handle->process (-> this parent-handle))))) + (the-as vector (when (not (and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'neo-sat-sit-and-spin))) + (dotimes (s4-0 (-> this knots length)) + (let* ((f0-0 (neo-sat-method-218 s5-0 (the-as vector (-> this knots data s4-0)))) + (f0-1 (+ 614.4 f0-0)) + ) + (set! (-> this knots data s4-0 pos y) (fmax (-> this knots data s4-0 pos y) f0-1)) + ) + ) + #f + ) + ) + ) + ) + +;; definition for method 225 of type neo-sat +;; INFO: Used lq/sq +(defmethod neo-sat-method-225 ((this neo-sat) (arg0 int)) + (let* ((gp-0 (-> *neo-sat-laser-array* arg0 joint)) + (a1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data gp-0))) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> this node-list data gp-0 bone transform fvec quad)) + (let ((gp-1 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) + (set! (-> gp-1 knots data 0 mass) (the-as float #x7f800000)) + (if (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) + (set! (-> gp-1 gravity-dir quad) (-> s3-0 quad)) + ) + (set! (-> gp-1 knots data 0 pos quad) (-> a1-3 quad)) + (set! (-> gp-1 knots data 0 prev-pos quad) (-> a1-3 quad)) + (set! (-> gp-1 knot-constraints data 0 dir quad) (-> s3-0 quad)) + (when (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) + (let ((f30-1 (- (-> a1-3 y) (neo-sat-method-218 this a1-3)))) + (dotimes (s2-0 (-> gp-1 knots length)) + (set! (-> gp-1 knots data s2-0 pos y) + (+ f30-1 (neo-sat-method-218 this (the-as vector (-> gp-1 knots data s2-0)))) + ) + (set! (-> gp-1 knots data s2-0 prev-pos y) (-> gp-1 knots data s2-0 pos y)) + ) + ) + ) + 0.0 + 0.0 + (let* ((f30-2 (/ 368640.0 (the float (+ (-> gp-1 knots length) -1)))) + (f28-0 (* 0.6666667 f30-2)) + ) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) + (let ((s2-1 (-> *neo-sat-laser-array* arg0 rope-index))) + (when (and (> (-> this sound-next-play-time s2-1) 0) (>= (- (current-time) (-> this sound-next-play-time s2-1)) 0)) + (sound-play "sat-whip-snap") + (set! (-> this sound-next-play-time s2-1) 0) + 0 + ) + (when (and (time-elapsed? (-> this sound-last-snap-time s2-1) (seconds 1.5)) + (not (time-elapsed? + (-> gp-1 knot-constraints data (+ (-> gp-1 knot-constraints length) -1) constrained-angle-time) + (seconds 0.1) + ) + ) + (zero? (-> this sound-next-play-time s2-1)) + ) + (set-time! (-> this sound-last-snap-time s2-1)) + (let* ((f0-10 (* 0.000030517578 (fabs (-> this spin-speed)))) + (f0-11 (* f0-10 f0-10)) + ) + (set! (-> this sound-next-play-time s2-1) (+ (current-time) (the int (* 300.0 (lerp 0.3 0.0 f0-11))))) + ) + ) + ) + (when (< 0.75 (/ (-> gp-1 knot-constraints data 0 length) f30-2)) + (let ((s2-3 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans)))) + 0.0 + 0.0 + 0.0 + 0.0 + (let ((f26-1 (fmax 0.0 (fmin 1.0 (* 0.000030517578 (fabs (-> this spin-speed))))))) + (set! (-> s2-3 y) 0.0) + (vector-normalize! s2-3 1.0) + (let* ((f0-23 (acos (vector-dot s2-3 s3-0))) + (f0-24 (* 0.000030517578 f0-23)) + (f22-0 (- 1.0 f0-24)) + (f1-10 (+ (lerp 0.0 0.75 (* f22-0 f22-0)) (lerp -0.25 0.25 f26-1))) + (f24-1 (fmax 0.0 (fmin 1.0 f1-10))) + (f0-29 (+ (lerp -0.5 0.5 f22-0) (lerp 0.0 0.5 f26-1))) + (f0-30 (fmin 1.0 f0-29)) + ) + (sound-play-by-name + (static-sound-name "sat-whip-loop-a") + (-> this snd-whips-loop (-> *neo-sat-laser-array* arg0 rope-index)) + (the int (* 1024.0 f24-1)) + (the int (* 1524.0 f0-30)) + 0 + (sound-group) + #t + ) + ) + ) + ) + ) + ) + (else + (sound-stop (-> this snd-whips-loop (-> *neo-sat-laser-array* arg0 rope-index))) + ) + ) + (when (not (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin))) + (set! f28-0 (* 2.0 f28-0)) + (set! f30-2 0.0) + ) + (dotimes (s5-1 (-> gp-1 knot-constraints length)) + (seek! (-> gp-1 knot-constraints data s5-1 length) f30-2 (* f28-0 (seconds-per-frame))) + ) + ) + (rope-system-method-18 gp-1) + ) + ) + ) + +;; definition for method 226 of type neo-sat +;; INFO: Used lq/sq +(defmethod neo-sat-method-226 ((this neo-sat) (arg0 int)) + (let* ((s4-0 (-> *neo-sat-laser-array* arg0 joint)) + (a1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s4-0))) + (v1-5 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-5 quad) (-> this node-list data s4-0 bone transform fvec quad)) + 368640.0 + (let ((a0-15 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) + 0.0 + (let ((f0-2 0.0)) + (dotimes (a2-3 (-> a0-15 knots length)) + (vector+float*! (the-as vector (-> a0-15 knots data a2-3)) a1-3 v1-5 (* (the float a2-3) f0-2)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> a0-15 knots data 0 prev-pos)) (* a2-3 64)))) + (-> a0-15 knots data a2-3 pos quad) + ) + ) + ) + (dotimes (a1-6 (-> a0-15 knot-constraints length)) + (set! (-> a0-15 knot-constraints data a1-6 dir quad) (-> v1-5 quad)) + (set! (-> a0-15 knot-constraints data a1-6 length) 0.0) + (set! (-> a0-15 knot-constraints data a1-6 rest-seek-rate) 5461.3335) + (set! (-> a0-15 knot-constraints data a1-6 max-angle) 2730.6667) + ) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) + (logior! (-> a0-15 flags) (rope-system-flag rs0)) + ) + (else + (vector-float*! (-> a0-15 gravity-dir) *up-vector* -1.0) + (logclear! (-> a0-15 flags) (rope-system-flag rs0)) + ) + ) + (rope-system-method-22 a0-15) + ) + ) + ) + +;; definition for method 209 of type neo-sat +(defmethod neo-sat-method-209 ((this neo-sat)) + (set-time! (-> this new-spin-time)) + (set! (-> this spin-current) (quaternion-y-angle (-> this disc-joint rotation))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let ((f30-0 (the float (sar (shl (the int (vector-y-angle s5-1)) 48) 48)))) + (set! (-> this spin-current) (the float (sar (shl (the int (-> this spin-current)) 48) 48))) + (when (= (-> this current-stage) 2) + (let* ((f30-1 -24576.0) + (f28-0 49152.0) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + (f0-14 (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-15))))) + (f0-15 (if (< f0-14 0.0) + (+ -21845.334 f0-14) + (+ 21845.334 f0-14) + ) + ) + ) + (set! (-> this spin-dest) (+ (-> this spin-current) f0-15)) + ) + (return 0.0) + ) + (let* ((v1-23 (-> this current-stage)) + (f28-4 (cond + ((zero? v1-23) + (let* ((f28-1 22755.555) + (f26-0 20935.113) + (v1-27 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-28 (the-as number (logior #x3f800000 v1-27))) + ) + (+ f28-1 (* f26-0 (+ -1.0 (the-as float v1-28)))) + ) + ) + ((= v1-23 1) + (let* ((f28-2 8192.0) + (f26-1 8192.0) + (v1-34 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-35 (the-as number (logior #x3f800000 v1-34))) + ) + (+ f28-2 (* f26-1 (+ -1.0 (the-as float v1-35)))) + ) + ) + (else + (let* ((f28-3 -3640.889) + (f26-2 7281.778) + (v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + ) + (+ f28-3 (* f26-2 (+ -1.0 (the-as float v1-41)))) + ) + ) + ) + ) + (f30-2 (deg- f30-0 (-> this spin-current))) + ) + 0.0 + -32768.0 + (let ((s5-2 #f)) + (if (< (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 12) + (set! s5-2 #t) + ) + (set! f30-2 (cond + (s5-2 + (if (< 0.0 f30-2) + (+ -65536.0 f30-2) + (+ 65536.0 f30-2) + ) + ) + (else + (empty) + f30-2 + ) + ) + ) + ) + (if (< f30-2 0.0) + (set! f28-4 (* -1.0 f28-4)) + ) + (let ((f0-40 (+ f30-2 f28-4))) + (set! (-> this spin-dest) (+ (-> this spin-current) f0-40)) + ) + ) + ) + ) + ) + +;; definition for method 228 of type neo-sat +(defmethod neo-sat-method-228 ((this neo-sat)) + (neo-sat-method-225 this (-> this active-laser-index)) + (neo-sat-method-227 this (-> this active-laser-index)) + (case (-> this current-stage) + ((1) + (neo-sat-method-225 this 3) + (neo-sat-method-227 this 3) + ) + ((2) + (neo-sat-method-225 this 2) + (neo-sat-method-227 this 2) + (neo-sat-method-225 this 4) + (neo-sat-method-227 this 4) + ) + ) + (none) + ) + +;; definition for method 210 of type neo-sat +(defmethod neo-sat-method-210 ((this neo-sat)) + (local-vars (s5-1 object)) + (let ((f0-0 143360.0)) + (if (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> this root trans) (-> this focus-pos))) + (go (method-of-object this ground-burst)) + ) + ) + (-> this spin-current) + 0.0 + (let ((f0-5 1.0) + (f1-1 (- (-> this spin-dest) (-> this spin-current))) + ) + (if (or (and (< 0.0 (-> this spin-speed)) (< f1-1 0.0)) (and (< (-> this spin-speed) 0.0) (< 0.0 f1-1))) + (* -1.0 f0-5) + ) + ) + (let* ((f0-10 + (* (+ (* 12.0 (- (-> this spin-dest) (-> this spin-current))) (* 6.0 (- (-> this spin-speed)))) + (seconds-per-frame) + ) + ) + (f0-11 (* 0.05 f0-10)) + ) + (+! (-> this spin-speed) f0-11) + ) + (let* ((v1-19 (-> this current-stage)) + (v1-20 (cond + ((zero? v1-19) + 50062.223 + ) + ((= v1-19 1) + 50062.223 + ) + ((= v1-19 2) + 36408.89 + ) + ) + ) + (f0-13 v1-20) + ) + (set! (-> this spin-speed) (fmax (fmin (-> this spin-speed) f0-13) (- f0-13))) + ) + (+! (-> this spin-current) (* (-> this spin-speed) (seconds-per-frame))) + (quaternion-rotate-y! + (-> this disc-joint rotation) + (-> this disc-joint rotation) + (* (-> this spin-speed) (seconds-per-frame)) + ) + (let ((s5-0 (handle->process (-> this focus handle)))) + (cond + ((and (if (type? s5-0 process-focusable) + s5-0 + ) + (begin + (let* ((s5-2 #t) + (s4-0 (handle->process (-> this focus handle))) + (v1-33 (the-as focus-status (logand (-> (the-as process-focusable (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + focus-status + ) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + (cmove-#f-nonzero s5-1 v1-33 s5-2) + ) + s5-1 + ) + ) + (if (or (time-elapsed? (-> this new-spin-time) (seconds 3)) + (and (< (-> this spin-speed) 910.2222) (< (fabs (- (-> this spin-current) (-> this spin-dest))) 546.13336)) + ) + (neo-sat-method-209 this) + ) + ) + (else + (set! (-> this spin-dest) (-> this spin-current)) + ) + ) + ) + (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* (-> this spin-dest)) + (set! (-> this laser-rotate-angle) (seek (-> this laser-rotate-angle) 0.0 (* 16384.0 (seconds-per-frame)))) + ) + +;; definition for method 62 of type neo-sat +;; WARN: Return type mismatch number vs float. +(defmethod get-damage-from-attack ((this neo-sat) (arg0 object) (arg1 event-message-block)) + (let ((v0-1 (the-as number (call-parent-method this arg0 arg1)))) + (if (logtest? (penetrate dark-bomb dark-smack) (-> (the-as attack-info (-> arg1 param 1)) penetrate-using)) + (set! v0-1 #x41f00000) + ) + (the-as float v0-1) + ) + ) + +;; definition for method 52 of type neo-sat +(defmethod damage-enemy! ((this neo-sat) (arg0 object) (arg1 event-message-block)) + (let ((f30-0 (call-parent-method this arg0 arg1))) + (let ((f28-0 (-> this hit-points)) + (f26-0 (* 30.0 (- 3.0 (the float (+ (-> this current-stage) 1))))) + ) + (sound-play "sat-hit") + (when (>= f26-0 f28-0) + (if (= f28-0 0.0) + (setup-masks (-> this draw) 0 4) + ) + (set! f30-0 (- f30-0 (- f26-0 f28-0))) + (set! (-> this hit-points) f26-0) + (set! (-> this should-rise?) #t) + ) + ) + f30-0 + ) + ) + +;; failed to figure out what this is: +(defstate neo-sat-sit-and-spin (neo-sat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('rise-up) + (+! (-> self current-stage) 1) + (cond + ((= (-> self current-stage) 3) + (+! (-> self current-stage) -1) + (set! (-> self was-spinning?) #t) + (go-virtual die) + ) + (else + (set! (-> self was-spinning?) #t) + (go-virtual ground-burst) + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self active-laser-index) 0) + (neo-sat-method-209 self) + (set-time! (-> self state-time)) + (set-time! (-> self new-spin-time)) + (sound-play "sat-whip-out") + (neo-sat-method-226 self 0) + (case (-> self current-stage) + ((1) + (neo-sat-method-226 self 3) + ) + ((2) + (neo-sat-method-226 self 2) + (neo-sat-method-226 self 4) + ) + ) + ) + :trans (behavior () + (neo-sat-method-210 self) + (neo-sat-method-211 self) + (neo-sat-method-228 self) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for function sparticle-height-set +;; WARN: Return type mismatch float vs none. +(defun sparticle-height-set ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((a0-3 (the-as neo-sat (handle->process (-> *alive-neo-sats* (shr (the int (-> arg1 omega)) 16))))) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) (-> arg2 x)) + (set! (-> a1-2 y) (-> arg2 y)) + (set! (-> a1-2 z) (-> arg2 z)) + (set! (-> a1-2 w) 1.0) + (when a0-3 + (set! (-> arg2 y) (neo-sat-method-218 a0-3 a1-2)) + (+! (-> arg2 y) 2048.0) + ) + ) + (none) + ) + +;; definition for function spt-func-part-neo-sat-shockwave-hot +(defun spt-func-part-neo-sat-shockwave-hot ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (sparticle-2d-spline-align-instant arg0 arg1 (the-as sprite-vec-data-2d arg2)) + (sparticle-height-set arg0 arg1 (the-as vector arg2)) + (none) + ) + +;; definition for function sparticle-shockwave-set +;; WARN: Return type mismatch float vs none. +(defun sparticle-shockwave-set ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((a0-3 (the-as neo-sat (handle->process (-> *alive-neo-sats* (shr (the int (-> arg1 omega)) 16))))) + (v1-7 #f) + ) + (if a0-3 + (set! v1-7 (neo-sat-method-223 + a0-3 + (-> arg2 launchrot) + (the-as int (-> arg1 user-float)) + (logand (the-as int (-> arg1 omega)) #xffff) + ) + ) + ) + (if (not v1-7) + (set! (-> arg2 coneradius) 0.0) + ) + ) + (none) + ) + +;; definition for method 223 of type neo-sat +(defmethod neo-sat-method-223 ((this neo-sat) (arg0 vector) (arg1 int) (arg2 int)) + (let ((v1-1 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* (* 327.68 (the float arg1)))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((f0-3 (- (-> this current-shockwave-radius) (* 73728.0 (the float arg2))))) + (if (< 163840.0 f0-3) + (return #f) + ) + (vector+float*! s4-0 (-> this shockwave-origin) v1-1 f0-3) + ) + (set! (-> s4-0 y) (neo-sat-method-218 this s4-0)) + (set! (-> arg0 x) (-> s4-0 x)) + (set! (-> arg0 y) (-> s4-0 y)) + (set! (-> arg0 z) (-> s4-0 z)) + ) + #t + ) + +;; definition for method 211 of type neo-sat +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod neo-sat-method-211 ((this neo-sat)) + (let ((s5-0 (+ (-> this current-stage) 1)) + (f30-0 73728.0) + ) + (let* ((f28-0 91.022224) + (f26-0 1092.2667) + (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-6 (the-as number (logior #x3f800000 v1-5))) + ) + (set! (-> this last-particle-rotate) + (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-6))) (-> this last-particle-rotate)) + ) + ) + (let ((f0-6 (-> this last-particle-rotate))) + (set! (-> this last-particle-rotate) (- f0-6 (* (the float (the int (/ f0-6 2366.578))) 2366.578))) + ) + (dotimes (s4-0 s5-0) + (let ((f0-9 (- (-> this current-shockwave-radius) (* f30-0 (the float s4-0))))) + (when (and (>= f0-9 16384.0) (< f0-9 163840.0)) + (new 'stack-no-clear 'vector) + (let ((f28-1 (- (-> this current-shockwave-radius) (* f30-0 (the float s4-0)))) + (s3-0 #f) + ) + (when (< (-> this last-spawned-ring-index) s4-0) + (sound-play "sat-shockwave") + (set! (-> this last-spawned-ring-index) s4-0) + (set! s3-0 #t) + ) + (dotimes (s2-1 20) + (let* ((f26-1 (+ (-> this last-particle-rotate) (* 3276.8 (the float s2-1)))) + (f24-0 -1638.4) + (f22-0 3276.8) + (v1-25 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-26 (the-as number (logior #x3f800000 v1-25))) + (f0-17 (+ f24-0 (* f22-0 (+ -1.0 (the-as float v1-26))) f26-1)) + (s0-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* f0-17)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s1-0 (-> this shockwave-origin) s0-0 f28-1) + (set! (-> s1-0 y) (neo-sat-method-218 this s1-0)) + (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (lerp 409.6 2457.6 (* 0.0000061035157 f28-1))) + (let* ((f26-2 (-> *part-id-table* 1679 init-specs 3 initial-valuef)) + (f24-1 1.0) + (v1-41 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-42 (the-as number (logior #x3f800000 v1-41))) + ) + (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (* f26-2 (+ f24-1 (+ -1.0 (the-as float v1-42))))) + ) + (let ((a2-4 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s0-0 *up-vector*))) + (set! (-> a2-4 trans quad) (-> s1-0 quad)) + (launch-particles (-> *part-id-table* 1679) a2-4 :origin-is-matrix #t) + ) + ) + ) + (when s3-0 + (dotimes (s3-2 100) + (let* ((f26-3 182.04445) + (f24-2 -1.8) + (f22-1 3.6) + (v1-57 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-58 (the-as number (logior #x3f800000 v1-57))) + (f0-34 (+ (* f26-3 (+ f24-2 (* f22-1 (+ -1.0 (the-as float v1-58))))) (* 655.36 (the float s3-2)))) + (s1-1 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* f0-34)) + (s2-2 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s2-2 (-> this shockwave-origin) s1-1 f28-1) + (set! (-> s2-2 y) (neo-sat-method-218 this s2-2)) + (let ((a2-7 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s1-1 *up-vector*))) + (set! (-> a2-7 trans quad) (-> s2-2 quad)) + (set! (-> *part-id-table* 1680 init-specs 9 initial-valuef) + (the-as float (shl (-> this global-neo-sat-index) 16)) + ) + (launch-particles (-> *part-id-table* 1680) a2-7 :origin-is-matrix #t) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> this last-shockwave-radius) (-> this current-shockwave-radius)) + (+! (-> this current-shockwave-radius) (* 102400.0 (seconds-per-frame))) + (dotimes (s4-1 (-> this num-yellow-ammo)) + (when (and (>= (-> this current-shockwave-radius) (-> this yellow-ammo-pos s4-1 dist)) + (< (-> this last-shockwave-radius) (-> this yellow-ammo-pos s4-1 dist)) + ) + (let ((s3-3 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *z-vector* (-> this yellow-ammo-pos s4-1 angle))) + ) + (vector-normalize! s3-3 (-> this yellow-ammo-pos s4-1 dist)) + (vector+! s3-3 s3-3 (-> this shockwave-origin)) + (set! (-> s3-3 y) (neo-sat-method-218 this s3-3)) + (birth-pickup-at-point s3-3 (pickup-type ammo-yellow) 10.0 #t *entity-pool* (the-as fact-info #f)) + ) + ) + ) + (let ((f28-2 (vector-vector-xz-distance (-> this root trans) (-> this focus-pos))) + (s4-2 (the-as object #f)) + ) + (let* ((s3-4 (handle->process (-> this focus handle))) + (v1-98 (if (type? s3-4 process-focusable) + (the-as process-focusable s3-4) + ) + ) + ) + (when v1-98 + (let ((v1-99 (-> v1-98 root))) + (set! s4-2 (and v1-99 (logtest? (-> (the-as collide-shape-moving v1-99) status) (collide-status on-surface)))) + ) + ) + ) + (when s4-2 + (dotimes (s4-4 s5-0) + (let ((f0-46 (- (-> this current-shockwave-radius) (* f30-0 (the float s4-4))))) + (if (and (>= f0-46 16384.0) (< f0-46 163840.0) (>= f0-46 (+ -4096.0 f28-2)) (>= (+ 4096.0 f28-2) f0-46)) + (send-event + (handle->process (-> this focus handle)) + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'generic)) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate neo-sat-drill-impact (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-stop (-> self snd-hover)) + (activate! *camera-smush-control* 1228.8 45 240 1.0 0.9 (-> *display* camera-clock)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 229 (seconds 0.5)) + (send-event (handle->process (-> self warp-handle)) 'turn-off) + (cond + ((logtest? (-> *part-group-id-table* 418 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 418)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 418)) + ) + ) + (sound-play "sat-in-ground") + (set! (-> self root transv quad) (the-as uint128 0)) + (set! (-> self current-shockwave-radius) 16384.0) + (set-time! (-> self state-time)) + (logior! (-> self enemy-flags) (enemy-flag vulnerable)) + (set! (-> self last-spawned-ring-index) -1) + (let ((f0-2 (get-remaining-player-ammo (pickup-type ammo-yellow)))) + (set! (-> self num-yellow-ammo) 0) + (if (>= 55.0 f0-2) + (+! (-> self num-yellow-ammo) 1) + ) + (if (>= 35.0 f0-2) + (+! (-> self num-yellow-ammo) 1) + ) + (if (>= 15.0 f0-2) + (+! (-> self num-yellow-ammo) 1) + ) + (if (>= 5.0 f0-2) + (+! (-> self num-yellow-ammo) 1) + ) + ) + (dotimes (gp-3 (-> self num-yellow-ammo)) + (let* ((f30-0 65536.0) + (v1-70 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-71 (the-as number (logior #x3f800000 v1-70))) + (f30-1 (* f30-0 (+ -1.0 (the-as float v1-71)))) + (f28-0 32768.0) + (f26-0 49152.0) + (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-77 (the-as number (logior #x3f800000 v1-76))) + (f0-10 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-77))))) + ) + (set! (-> self yellow-ammo-pos gp-3 angle) f30-1) + (set! (-> self yellow-ammo-pos gp-3 dist) f0-10) + ) + ) + ) + :trans (behavior () + (neo-sat-method-211 self) + (let ((v1-2 450)) + (if (= (-> self current-stage) 2) + (set! v1-2 675) + ) + (if (time-elapsed? (-> self state-time) v1-2) + (go-virtual neo-sat-sit-and-spin) + ) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate neo-sat-drill-attack (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self ground-offset) 4096.0) + (set! (-> self desired-float-height) -163840.0) + (set! (-> self bob-speed-scalar) 1.0) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root transv quad) (the-as uint128 0)) + (set! (-> self desired-float-height) 16384.0) + (set! (-> self start-thrust-pos quad) (-> self root trans quad)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (neo-sat-method-220 self) + (let ((f30-0 (neo-sat-probe-ground self (-> self root trans)))) + (let ((a2-0 (new 'stack-no-clear 'vector))) + (set! (-> a2-0 quad) (-> self root trans quad)) + (set! (-> a2-0 y) (+ (-> self start-thrust-pos y) (-> self desired-float-height))) + (cond + ((< 0.0 (-> self desired-float-height)) + (let* ((f1-4 (* 0.008333334 (the float (- (current-time) (-> self state-time))))) + (f1-6 (fmax 0.0 (fmin 1.0 f1-4))) + (f28-0 (- 1.0 (* (- 1.0 f1-6) (- 1.0 f1-6)))) + ) + (vector-lerp! (-> self root trans) (-> self start-thrust-pos) a2-0 f28-0) + (when (>= f28-0 0.95) + (set! (-> self desired-float-height) -102400.0) + (set-time! (-> self state-time)) + (set! (-> self start-thrust-pos quad) (-> self root trans quad)) + ) + ) + ) + (else + (let* ((f1-11 (* 0.008333334 (the float (- (current-time) (-> self state-time))))) + (f0-10 (fmax 0.0 (fmin 1.0 f1-11))) + ) + (vector-lerp! (-> self root trans) (-> self start-thrust-pos) a2-0 f0-10) + ) + ) + ) + ) + (move-to-ground-height self f30-0) + ) + (if (-> self on-ground?) + (go-virtual neo-sat-drill-impact) + ) + (set! (-> self spin-current) 98304.0) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate neo-sat-laser-attack (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (neo-sat-method-207 self) + (set! (-> self hit-player?) #f) + (set! (-> self wander-generate-time) 0) + (let ((v1-4 (-> self current-stage))) + (cond + ((zero? v1-4) + (set! (-> self max-speed) 32768.0) + ) + ((= v1-4 1) + (set! (-> self max-speed) 36864.0) + ) + ((= v1-4 2) + (set! (-> self max-speed) 40960.0) + ) + ) + ) + (set! (-> self fly-speed-scalar) 10.0) + (set! (-> self was-doing-cone-check?) #f) + ) + :trans (behavior () + (if (-> self hit-player?) + (go-virtual hostile) + ) + (seek! (-> self anim-speed) 3.0 (* 0.15 (seconds-per-frame))) + (when (time-elapsed? (-> self wander-generate-time) (seconds 1.5)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *x-vector* quad)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector-normalize! s5-0 65536.0) + (vector-rotate-y! s5-0 s5-0 (-> self offset-angle)) + (let* ((f30-0 -16384.0) + (f28-0 32768.0) + (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-17 (the-as number (logior #x3f800000 v1-16))) + ) + (set! (-> self offset-angle) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-17))) (-> self offset-angle))) + ) + (set! (-> self offset-angle) (the float (sar (shl (the int (-> self offset-angle)) 48) 48))) + (set-time! (-> self wander-generate-time)) + (vector+! gp-0 (-> self focus-pos) s5-0) + (let ((v1-26 (-> self nav state))) + (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-26 target-pos quad) (-> gp-0 quad)) + ) + ) + ) + 0 + ) + (neo-sat-method-203 self #f) + (neo-sat-method-233 self) + (if (-> self was-doing-cone-check?) + (neo-sat-method-230 self) + ) + (neo-sat-method-220 self) + (neo-sat-method-201 self) + (let* ((v1-41 (-> self current-stage)) + (f30-1 (cond + ((zero? v1-41) + -10012.444 + ) + ((= v1-41 1) + -10922.667 + ) + (else + -11832.889 + ) + ) + ) + ) + (seek! (-> self laser-rotate-angle) f30-1 (* 1820.4445 (seconds-per-frame))) + (if (and (>= 182.04445 (fabs (- (-> self laser-rotate-angle) f30-1))) + (let ((v1-50 (- (current-time) (-> self state-time))) + (a0-22 (-> self current-stage)) + ) + (>= v1-50 (cond + ((zero? a0-22) + 600 + ) + ((= a0-22 1) + 900 + ) + (else + 1200 + ) + ) + ) + ) + ) + (go neo-sat-drill-halting) + ) + (let ((gp-1 #t)) + (when (< (-> self laser-rotate-angle) -9102.223) + (set! gp-1 #f) + (when (not (-> self was-doing-cone-check?)) + (set! (-> self was-doing-cone-check?) #t) + (set! (-> self was-player-inside-cone?) (neo-sat-method-232 self (target-pos 0))) + ) + ) + (dotimes (s5-2 (-> *neo-sat-laser-array* length)) + (neo-sat-method-206 self (-> *neo-sat-laser-array* s5-2 joint) gp-1) + ) + ) + (let ((f0-24 (lerp 16384.0 32768.0 (/ (fabs (-> self laser-rotate-angle)) (fabs f30-1))))) + (if (< 32585.955 f0-24) + (set! f0-24 (lerp 32768.0 49152.0 (* 0.00055555557 (the float (- (current-time) (-> self state-time)))))) + ) + (set! (-> self spin-current) f0-24) + ) + ) + (quaternion-rotate-y! + (-> self disc-joint rotation) + (-> self disc-joint rotation) + (* (-> self spin-current) (seconds-per-frame)) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate die (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self next-lightning-time) 0) + (sound-play "sat-out-ground") + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (logclear! (-> self focus-status) (focus-status dangerous)) + (cond + ((logtest? (-> *part-group-id-table* 420 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 420)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 420)) + ) + ) + (set-time! (-> self state-time)) + (when (-> self was-spinning?) + (set! (-> self was-spinning?) #f) + (sound-play "sat-whip-in") + ) + ) + :exit (behavior () + (dotimes (gp-0 (-> self ropes length)) + (rope-system-method-21 (-> self ropes gp-0)) + ) + ) + :trans (behavior () + (when (< (-> self next-lightning-time) (current-time)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 22) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 22) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + (set! (-> self next-lightning-time) (+ (current-time) (seconds 0.05))) + ) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) + (spawn + (-> self burst-dust-part) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node neo-satellite-lod0-jg arm_top_ring)) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.9)) + (dotimes (gp-1 (-> self ropes length)) + (rope-system-method-21 (-> self ropes gp-1)) + ) + ) + (neo-sat-method-228 self) + ) + :code (behavior () + (set! (-> self play-anim?) #f) + (ja-channel-push! 1 (seconds 0.1)) + (let ((hand (the-as handle #f))) + (let ((f28-0 -1.0)) + (ja-no-eval :group! neo-satellite-death-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((f30-0 (ja-frame-num 0))) + (let ((f0-4 43.0) + (f26-0 48.0) + ) + (if (and (< f28-0 f0-4) (>= f30-0 f0-4)) + (sound-play "sat-fall-hit") + ) + (when (and (< f28-0 f26-0) (>= f30-0 f26-0)) + (set! (-> self next-lightning-time) (+ (seconds 1000) (current-time))) + (sound-play "sat-explode") + (set! hand + (process->handle + (-> (cond + ((logtest? (-> *part-group-id-table* 427 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 427)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 427)) + ) + ) + 0 + ) + ) + ) + ) + ) + (set! f28-0 f30-0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (send-event (ppointer->process (-> self parent)) 'notify 'die) + (send-event (handle->process hand) 'die) + ) + (cond + ((logtest? (-> *part-group-id-table* 426 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 426)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 426)) + ) + ) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 0.25)) + (suspend) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (until (time-elapsed? gp-6 (seconds 1.5)) + (suspend) + ) + ) + (go-virtual die-fast) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate ground-burst (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-play "sat-out-ground") + (send-event (handle->process (-> self warp-handle)) 'turn-on) + (cond + ((logtest? (-> *part-group-id-table* 420 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 420)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 420)) + ) + ) + (let ((v1-40 self)) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logclear (-> v1-40 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-40 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (set! (-> self desired-float-height) 163840.0) + (set! (-> self bob-speed-scalar) 10.0) + (neo-sat-method-204 self) + (set! (-> self ground-offset) 4096.0) + (set-time! (-> self state-time)) + (logclear! (-> self focus-status) (focus-status dangerous)) + (when (-> self was-spinning?) + (set! (-> self was-spinning?) #f) + (sound-play "sat-whip-in") + ) + (sound-play "sat-hover" :id (-> self snd-hover)) + ) + :exit (behavior () + (dotimes (gp-0 (-> self ropes length)) + (rope-system-method-21 (-> self ropes gp-0)) + ) + ) + :trans (behavior () + (neo-sat-method-201 self) + (when (not (time-elapsed? (-> self state-time) (seconds 1))) + (let* ((f1-2 (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (f1-5 (- 1.0 (* (- 1.0 f1-2) (- 1.0 f1-2)))) + (f0-3 (- 1.0 (* (- 1.0 f1-5) (- 1.0 f1-5)))) + ) + (set! (-> *part-id-table* 1687 init-specs 2 initial-valuef) (fmax 0.0 (lerp 10.0 0.0 f0-3))) + ) + (spawn (-> self burst-dust-part) (-> self root trans)) + ) + (seek! (-> self desired-float-height) 49152.0 (* 327680.0 (seconds-per-frame))) + (neo-sat-method-228 self) + (if (time-elapsed? (-> self state-time) (seconds 1.5)) + (go-virtual hostile) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (sound-play "sat-arms" :id (-> self snd-arms-chatter)) + (set! (-> self laser-rotate-angle) 0.0) + (sound-stop (-> self snd-laser-burn)) + (set! (-> self fly-speed-scalar) 1.0) + (set! (-> self max-speed) 204800.0) + (set! (-> self active-laser-index) -1) + (let ((v1-5 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-5 enemy-flags))) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-5 enemy-flags)))) + ) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-5 enemy-flags)))) + (set! (-> v1-5 nav callback-info) (-> v1-5 enemy-info callback-info)) + ) + 0 + (let ((v1-8 (-> self nav))) + (set! (-> v1-8 target-speed) 4096.0) + ) + 0 + (set-time! (-> self state-time)) + (set! (-> self hit-player?) #f) + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (set! (-> self wander-generate-time) 0) + (set! (-> self last-thrust-vec quad) (the-as uint128 0)) + (set! (-> self ground-offset) 40960.0) + (set! (-> self desired-float-height) 49152.0) + (set! (-> self bob-speed-scalar) 1.0) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! neo-satellite-active-ja :num! (loop!) :frame-num 0.0) + (set! (-> self anim-loop?) #t) + (set! (-> self play-anim?) #t) + (set! (-> self anim-speed) 0.6) + (neo-sat-method-204 self) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (sound-play "sat-hover" :id (-> self snd-hover)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *x-vector* quad)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector-normalize! s5-0 12288.0) + (vector-rotate-y! s5-0 s5-0 (-> self offset-angle)) + (when (time-elapsed? (-> self wander-generate-time) (seconds 2)) + (let* ((f30-0 -16384.0) + (f28-0 32768.0) + (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-11 (the-as number (logior #x3f800000 v1-10))) + ) + (set! (-> self offset-angle) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-11))) (-> self offset-angle))) + ) + (set! (-> self offset-angle) (the float (sar (shl (the int (-> self offset-angle)) 48) 48))) + (set-time! (-> self wander-generate-time)) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 4)) + (or (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 81920.0) + (time-elapsed? (-> self state-time) (seconds 7)) + ) + ) + (go-virtual neo-sat-laser-attack) + ) + (vector+! gp-0 (-> self focus-pos) s5-0) + (let ((v1-34 (-> self nav state))) + (logclear! (-> v1-34 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-34 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-34 target-pos quad) (-> gp-0 quad)) + ) + ) + ) + 0 + (neo-sat-method-200 self) + (neo-sat-method-201 self) + (neo-sat-method-233 self) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate sat-idle (neo-sat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (spawn-shield self) + ) + :trans (behavior () + (if (< (vector-vector-distance (-> self root trans) (-> self focus-pos)) 491520.0) + (go-virtual ground-burst) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! neo-satellite-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for method 161 of type neo-sat +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod nav-enemy-method-161 ((this neo-sat) (arg0 nav-control)) + (when (logtest? (enemy-flag ef37) (-> this enemy-flags)) + (let ((a2-1 (-> arg0 state))) + (set! (-> this nav-vector quad) (-> a2-1 travel quad)) + ) + (vector-normalize! (-> this nav-vector) 1.0) + ) + (none) + ) + +;; definition for function spawn-neo-sat +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer neo-sat). +(defun spawn-neo-sat ((arg0 vector) (arg1 quaternion) (arg2 process)) + (let ((s5-0 (new 'stack-no-clear 'neo-sat-init-params))) + (set! (-> s5-0 pos quad) (-> arg0 quad)) + (quaternion-copy! (-> s5-0 quat) arg1) + (process-spawn neo-sat s5-0 :name "neo-sat" :to arg2 :stack-size #x14000) + ) + ) + +;; definition for method 160 of type neo-sat +;; WARN: Return type mismatch int vs none. +(defmethod normalize-heading! ((this neo-sat) (arg0 nav-control)) + 0 + (none) + ) + +;; definition for method 12 of type neo-sat +(defmethod run-logic? ((this neo-sat)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 7 of type neo-sat +(defmethod relocate ((this neo-sat) (offset int)) + (if (nonzero? (-> this tentacle)) + (&+! (-> this tentacle) offset) + ) + (dotimes (v1-4 (-> this ropes length)) + (if (nonzero? (-> this ropes v1-4)) + (&+! (-> this ropes v1-4) offset) + ) + ) + (if (nonzero? (-> this ropes)) + (&+! (-> this ropes) offset) + ) + (if (nonzero? (-> this damage-part1)) + (&+! (-> this damage-part1) offset) + ) + (if (nonzero? (-> this damage-part2)) + (&+! (-> this damage-part2) offset) + ) + (if (nonzero? (-> this damage-part3)) + (&+! (-> this damage-part3) offset) + ) + (if (nonzero? (-> this burst-dust-part)) + (&+! (-> this burst-dust-part) offset) + ) + (if (nonzero? (-> this antenna-explode-part)) + (&+! (-> this antenna-explode-part) offset) + ) + (call-parent-method this offset) + ) + +;; failed to figure out what this is: +(defpart 1712 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 1713 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 1714 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; definition for method 227 of type neo-sat +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 227 neo-sat) has a return type of none, but the expression builder found a return statement. +(defmethod neo-sat-method-227 ((this neo-sat) (arg0 int)) + (if (or (not (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin))) + (not (time-elapsed? (-> this state-time) (seconds 1.5))) + ) + (return 0) + ) + (let ((s5-0 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) + (dotimes (s4-0 (+ (-> s5-0 knots length) -1)) + (let ((v1-18 (-> s5-0 knots data s4-0)) + (a0-8 (-> s5-0 knots data (+ s4-0 1))) + (s3-0 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> s3-0 start-pos quad) (-> v1-18 pos quad)) + (vector-! (-> s3-0 move-dist) (the-as vector a0-8) (the-as vector v1-18)) + (let ((v1-19 s3-0)) + (set! (-> v1-19 radius) 40.96) + (set! (-> v1-19 collide-with) (collide-spec jak player-list)) + (set! (-> v1-19 ignore-process0) this) + (set! (-> v1-19 ignore-process1) #f) + (set! (-> v1-19 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-19 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) + (if (>= f0-1 0.0) + (vector-float*! (-> s3-0 move-dist) (-> s3-0 move-dist) f0-1) + (set! (-> s3-0 best-other-tri collide-ptr) #f) + ) + ) + (cond + ((and (-> s3-0 best-other-tri collide-ptr) (let ((s2-0 (-> s3-0 best-other-tri collide-ptr))) + (if (type? s2-0 collide-shape-prim-sphere) + s2-0 + ) + ) + ) + (let* ((s2-1 (-> s3-0 best-other-tri collide-ptr)) + (s2-2 (-> (the-as collide-shape-prim-sphere (if (type? s2-1 collide-shape-prim-sphere) + (the-as collide-shape-prim-sphere s2-1) + ) + ) + cshape + process + ) + ) + (s1-0 (the-as object #f)) + ) + (let* ((s0-0 s2-2) + (v1-29 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when v1-29 + (let ((v1-30 (-> v1-29 root))) + (set! s1-0 (and v1-30 (logtest? (-> (the-as collide-shape-moving v1-30) status) (collide-status on-surface)))) + ) + ) + ) + (when s1-0 + (send-event + s2-2 + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'generic)) + ) + ) + (send-event this 'notify 'attack s2-2) + ) + ) + (vector-normalize! (-> s3-0 move-dist) (+ 2048.0 (vector-length (-> s3-0 move-dist)))) + ) + (else + (set! (-> *part-id-table* 1714 init-specs 2 initial-valuef) 4096.0) + ) + ) + (set! (-> *part-id-table* 1712 init-specs 4 initial-valuef) (vector-length (-> s3-0 move-dist))) + ) + ) + ) + (none) + ) + +;; definition for method 206 of type neo-sat +;; INFO: Used lq/sq +(defmethod neo-sat-method-206 ((this neo-sat) (arg0 int) (arg1 symbol)) + (let ((v1-2 (the int (* 75.0 (/ 65536.0 (-> this spin-current)))))) + (when (time-elapsed? (-> this last-play-laser-time) v1-2) + (sound-play "sat-laser") + (set-time! (-> this last-play-laser-time)) + ) + ) + (sound-play "sat-ground-burn" :id (-> this snd-laser-burn)) + (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0))) + (s4-1 (new 'stack-no-clear 'vector)) + (f30-0 491520.0) + (s2-1 (if arg1 + 1091 + 65 + ) + ) + ) + (set! (-> s4-1 quad) (-> this node-list data arg0 bone transform fvec quad)) + (vector-normalize! s4-1 1.0) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> s5-1 quad)) + (vector-float*! (-> s3-1 move-dist) s4-1 f30-0) + (let ((v1-16 s3-1)) + (set! (-> v1-16 radius) 4096.0) + (set! (-> v1-16 collide-with) (the-as collide-spec s2-1)) + (set! (-> v1-16 ignore-process0) this) + (set! (-> v1-16 ignore-process1) #f) + (set! (-> v1-16 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-16 action-mask) (collide-action solid)) + ) + (let ((f0-4 (fill-and-probe-using-line-sphere *collide-cache* s3-1))) + (if (>= f0-4 0.0) + (vector-float*! (-> s3-1 move-dist) (-> s3-1 move-dist) f0-4) + (set! (-> s3-1 best-other-tri collide-ptr) #f) + ) + ) + (cond + ((and (-> s3-1 best-other-tri collide-ptr) (let ((s2-2 (-> s3-1 best-other-tri collide-ptr))) + (if (type? s2-2 collide-shape-prim-sphere) + s2-2 + ) + ) + ) + (let* ((s2-3 (-> s3-1 best-other-tri collide-ptr)) + (s2-4 (-> (the-as collide-shape-prim-sphere (if (type? s2-3 collide-shape-prim-sphere) + (the-as collide-shape-prim-sphere s2-3) + ) + ) + cshape + process + ) + ) + ) + (send-event + s2-4 + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'shock)) + ) + ) + (send-event this 'notify 'attack s2-4) + ) + (vector-normalize! (-> s3-1 move-dist) (+ 2048.0 (vector-length (-> s3-1 move-dist)))) + ) + (else + (set! (-> *part-id-table* 1714 init-specs 2 initial-valuef) 4096.0) + ) + ) + (vector+float*! (-> s3-1 move-dist) (-> s3-1 move-dist) s4-1 4096.0) + (set! (-> *part-id-table* 1712 init-specs 4 initial-valuef) (vector-length (-> s3-1 move-dist))) + (draw-beam (-> *part-id-table* 1712) s5-1 (-> s3-1 move-dist) #f) + (let ((gp-1 (matrix-f-u-compose + (new 'stack-no-clear 'matrix) + (vector-cross! (new 'stack-no-clear 'vector) s4-1 *up-vector*) + *up-vector* + ) + ) + ) + (vector+! (-> gp-1 trans) (-> s3-1 move-dist) s5-1) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 1681) gp-1 :origin-is-matrix #t) + (launch-particles (-> *part-id-table* 1683) gp-1 :origin-is-matrix #t) + (launch-particles (-> *part-id-table* 1684) gp-1 :origin-is-matrix #t) + ) + ) + ) + (none) + ) + +;; definition for method 212 of type neo-sat +(defmethod neo-sat-method-212 ((this neo-sat) (arg0 vector) (arg1 vector)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this shockwave-origin)))) + (set! (-> arg1 x) (+ 163840.0 (-> v1-1 x))) + (set! (-> arg1 y) (+ 163840.0 (-> v1-1 z))) + ) + arg1 + ) + +;; definition for method 215 of type neo-sat +(defmethod neo-sat-method-215 ((this neo-sat) (arg0 float)) + (* 0.000108506945 arg0) + ) + +;; definition for method 216 of type neo-sat +(defmethod neo-sat-method-216 ((this neo-sat) (arg0 float)) + (* 0.000108506945 arg0) + ) + +;; definition for method 213 of type neo-sat +(defmethod neo-sat-method-213 ((this neo-sat) (arg0 float)) + 0 + (let ((a0-1 (the int (neo-sat-method-215 this arg0)))) + (max 0 (min 34 a0-1)) + ) + ) + +;; definition for method 214 of type neo-sat +(defmethod neo-sat-method-214 ((this neo-sat) (arg0 float)) + 0 + (let ((a0-1 (the int (neo-sat-method-216 this arg0)))) + (max 0 (min 34 a0-1)) + ) + ) + +;; definition for method 217 of type neo-sat +(defmethod neo-sat-method-217 ((this neo-sat) (arg0 int) (arg1 int)) + (+ arg0 (* 35 arg1)) + ) + +;; definition for function compute-xz-pos +(defun compute-xz-pos ((arg0 neo-sat) (arg1 int) (arg2 int) (arg3 vector)) + (let ((f0-1 (+ -163840.0 (* 9216.0 (the float arg1)))) + (f1-3 (+ -163840.0 (* 9216.0 (the float arg2)))) + (v1-4 (new 'stack-no-clear 'vector)) + ) + (set-vector! v1-4 f0-1 0.0 f1-3 1.0) + (vector+! arg3 (-> arg0 shockwave-origin) v1-4) + ) + arg3 + ) + +;; definition for method 218 of type neo-sat +(defmethod neo-sat-method-218 ((this neo-sat) (arg0 vector)) + (local-vars (sv-32 int) (sv-40 int) (sv-48 int) (sv-56 int)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (neo-sat-method-212 this arg0 s5-0) + (set! sv-32 (neo-sat-method-213 this (-> s5-0 x))) + (set! sv-40 (neo-sat-method-213 this (+ 9216.0 (-> s5-0 x)))) + (set! sv-48 (neo-sat-method-214 this (-> s5-0 y))) + (set! sv-56 (neo-sat-method-214 this (+ 9216.0 (-> s5-0 y)))) + (let* ((f26-0 (-> this hashed-heights (neo-sat-method-217 this sv-32 sv-48))) + (f24-0 (-> this hashed-heights (neo-sat-method-217 this sv-32 sv-56))) + (f30-0 (-> this hashed-heights (neo-sat-method-217 this sv-40 sv-48))) + (f28-0 (-> this hashed-heights (neo-sat-method-217 this sv-40 sv-56))) + (f26-1 (lerp-scale f26-0 f24-0 (neo-sat-method-216 this (-> s5-0 y)) (the float sv-48) (the float sv-56))) + (f0-16 (lerp-scale f30-0 f28-0 (neo-sat-method-216 this (-> s5-0 y)) (the float sv-48) (the float sv-56))) + ) + (lerp-scale f26-1 f0-16 (neo-sat-method-215 this (-> s5-0 x)) (the float sv-32) (the float sv-40)) + ) + ) + ) + +;; definition for method 222 of type neo-sat +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +(defmethod neo-sat-method-222 ((this neo-sat) (arg0 object) (arg1 vector)) + (local-vars (sv-16 float) (sv-32 float) (sv-48 float) (sv-64 float)) + (let* ((s4-0 (neo-sat-method-213 this (-> arg1 x))) + (s3-0 (neo-sat-method-213 this (+ 9216.0 (-> arg1 x)))) + (s2-0 (neo-sat-method-214 this (-> arg1 y))) + (s1-0 (neo-sat-method-214 this (+ 9216.0 (-> arg1 y)))) + (f26-0 (-> this hashed-heights (neo-sat-method-217 this s4-0 s2-0))) + (f24-0 (-> this hashed-heights (neo-sat-method-217 this s4-0 s1-0))) + (f30-0 (-> this hashed-heights (neo-sat-method-217 this s3-0 s2-0))) + (f28-0 (-> this hashed-heights (neo-sat-method-217 this s3-0 s1-0))) + (s0-0 lerp-scale) + ) + (set! sv-16 f26-0) + (set! sv-32 f24-0) + (let* ((a2-5 (neo-sat-method-216 this (-> arg1 y))) + (a3-0 (the float s2-0)) + (t0-0 (the float s1-0)) + (f26-1 (s0-0 sv-16 sv-32 a2-5 a3-0 t0-0)) + (s0-1 lerp-scale) + ) + (set! sv-48 f30-0) + (set! sv-64 f28-0) + (let* ((a2-6 (neo-sat-method-216 this (-> arg1 y))) + (a3-1 (the float s2-0)) + (t0-1 (the float s1-0)) + (f0-20 (s0-1 sv-48 sv-64 a2-6 a3-1 t0-1)) + ) + (lerp-scale f26-1 f0-20 (neo-sat-method-215 this (-> arg1 x)) (the float s4-0) (the float s3-0)) + ) + ) + ) + ) + +;; definition for method 10 of type neo-sat +(defmethod deactivate ((this neo-sat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set! (-> *alive-neo-sats* (-> this global-neo-sat-index)) (the-as handle #f)) + (dotimes (s5-0 3) + (sound-stop (-> this snd-whips-loop s5-0)) + ) + (sound-stop (-> this snd-laser-burn)) + (sound-stop (-> this snd-arms-chatter)) + (sound-stop (-> this snd-hover)) + (if (nonzero? (-> this damage-part1)) + (kill-particles (-> this damage-part1)) + ) + (if (nonzero? (-> this damage-part2)) + (kill-particles (-> this damage-part2)) + ) + (if (nonzero? (-> this damage-part3)) + (kill-particles (-> this damage-part3)) + ) + (if (nonzero? (-> this burst-dust-part)) + (kill-particles (-> this burst-dust-part)) + ) + (if (nonzero? (-> this antenna-explode-part)) + (kill-particles (-> this antenna-explode-part)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 221 of type neo-sat +(defmethod neo-sat-method-221 ((this neo-sat)) + (let ((s5-0 0) + (s4-0 1224) + ) + (while (>= s4-0 s5-0) + (let ((a1-0 (mod s5-0 35)) + (a2-0 (/ s5-0 35)) + ) + (+ 16384.0 (* 9216.0 (the float a1-0))) + (let ((s3-0 (compute-xz-pos this a1-0 a2-0 (new 'stack-no-clear 'vector)))) + (new 'stack-no-clear 'vector) + (set! (-> s3-0 y) (neo-sat-method-218 this s3-0)) + (add-debug-x #t (bucket-id debug) s3-0 *color-blue*) + (set! (-> s3-0 y) (-> this hashed-heights s5-0)) + ) + ) + (+! s5-0 1) + ) + ) + #f + ) + +;; definition for method 220 of type neo-sat +(defmethod neo-sat-method-220 ((this neo-sat)) + (dotimes (s5-0 8) + (if (>= (-> this current-height-probe-index) 1225) + (return 0) + ) + (let* ((a1-0 (mod (-> this current-height-probe-index) 35)) + (a2-0 (/ (-> this current-height-probe-index) 35)) + (s4-0 (compute-xz-pos this a1-0 a2-0 (new 'stack-no-clear 'vector))) + (f0-0 (neo-sat-probe-ground this s4-0)) + ) + (set! (-> this hashed-heights (-> this current-height-probe-index)) f0-0) + (set! (-> s4-0 y) f0-0) + ) + (+! (-> this current-height-probe-index) 1) + ) + (the-as int #f) + ) + +;; definition for function neo-sat-inside-cone? +(defun neo-sat-inside-cone? ((arg0 vector) (arg1 float) (arg2 vector) (arg3 vector)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg3 arg0))) + 0.0 + (vector-normalize! s5-1 1.0) + (let ((f0-2 (vector-dot arg2 s5-1))) + (< (acos f0-2) (- 16384.0 arg1)) + ) + ) + ) + +;; definition for method 232 of type neo-sat +(defmethod neo-sat-method-232 ((this neo-sat) (arg0 vector)) + (let* ((s2-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> *neo-sat-laser-array* 0 joint))) + ) + (f28-0 (vector-vector-xz-distance (-> this root trans) s2-0)) + (f30-0 (fabs (-> this laser-rotate-angle))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (let ((s3-1 (vector-float*! (new 'stack-no-clear 'vector) *up-vector* -1.0))) + (let ((f0-4 (* f28-0 (tan f30-0)))) + (set-vector! s4-0 (-> this root trans x) (+ (-> s2-0 y) f0-4) (-> this root trans z) 1.0) + ) + (neo-sat-inside-cone? s4-0 f30-0 s3-1 arg0) + ) + ) + ) + +;; definition for method 230 of type neo-sat +;; WARN: Return type mismatch symbol vs none. +(defmethod neo-sat-method-230 ((this neo-sat)) + (let ((s4-0 (-> this was-player-inside-cone?)) + (s5-1 (neo-sat-method-232 this (target-pos 0))) + ) + (let ((v1-1 s5-1)) + (when (or (and s4-0 (not v1-1)) (and v1-1 (not s4-0))) + (send-event + (handle->process (-> this focus handle)) + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'shock)) + ) + ) + (send-event this 'notify 'attack (handle->process (-> this focus handle))) + ) + ) + (set! (-> this was-player-inside-cone?) s5-1) + ) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-neo-sat-shield neo-satellite-shield neo-satellite-shield-lod0-jg neo-satellite-shield-idle-ja + ((neo-satellite-shield-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +;; definition of type neo-sat-shield +(deftype neo-sat-shield (process-drawable) + () + (:state-methods + active + turning-on + turning-off + hit + disabled + ) + (:methods + (neo-sat-shield-method-25 (_type_) none) + ) + ) + +;; definition for method 3 of type neo-sat-shield +(defmethod inspect ((this neo-sat-shield)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 25 of type neo-sat-shield +;; INFO: Used lq/sq +;; WARN: Return type mismatch quaternion vs none. +(defmethod neo-sat-shield-method-25 ((this neo-sat-shield)) + (let* ((s5-0 (ppointer->process (-> this parent))) + (a0-2 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (set! (-> this root trans quad) (-> (the-as process-focusable a0-2) root trans quad)) + ) + (quaternion-identity! (-> this root quat)) + (let ((s5-1 (-> (math-camera-matrix) fvec))) + 0.0 + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let ((f0-2 (vector-y-angle s5-1))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (+ 32768.0 f0-2)) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate hit (neo-sat-shield) + :virtual #t + :trans (behavior () + (neo-sat-shield-method-25 self) + ) + :code (behavior () + (ja-no-eval :group! neo-satellite-shield-hit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual active) + ) + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate turning-off (neo-sat-shield) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> self draw force-fade) (the-as uint 0)) + 0 + ) + :trans (behavior () + (neo-sat-shield-method-25 self) + ) + :code (behavior () + (ja-no-eval :group! neo-satellite-shield-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((f0-6 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (set! (-> self draw force-fade) (the-as uint (the int (lerp 0.0 128.0 f0-6)))) + ) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self draw force-fade) (the-as uint 128)) + (go-virtual disabled) + ) + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate turning-on (neo-sat-shield) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status force-fade warp-cross-fade)) + ) + :trans (behavior () + (neo-sat-shield-method-25 self) + ) + :code (behavior () + (ja-no-eval :group! neo-satellite-shield-start-ja :num! (seek! max 0.3) :frame-num 0.0) + (until (ja-done? 0) + (let ((f0-6 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) + (set! (-> self draw force-fade) (the-as uint (the int (lerp 128.0 0.0 f0-6)))) + ) + (suspend) + (ja :num! (seek! max 0.3)) + ) + (set! (-> self draw force-fade) (the-as uint 0)) + (go-virtual active) + ) + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate disabled (neo-sat-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('turn-on) + (go-virtual turning-on) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate active (neo-sat-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hit) + (go-virtual hit) + ) + (('turn-off) + (go-virtual turning-off) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> self draw force-fade) (the-as uint 0)) + 0 + ) + :trans (behavior () + (neo-sat-shield-method-25 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! neo-satellite-shield-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + ) + ) + +;; definition for function neo-sat-shield-init-by-other +;; INFO: Process stack size was changed from 32 to 64 +(defbehavior neo-sat-shield-init-by-other neo-sat-shield () + (stack-size-set! (-> self main-thread) 64) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-sat-shield" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go-virtual active) + ) + +;; definition for method 231 of type neo-sat +;; WARN: Return type mismatch int vs none. +(defmethod spawn-shield ((this neo-sat)) + (set! (-> this warp-handle) (the-as handle #f)) + (let ((s5-0 (get-process *default-dead-pool* neo-sat-shield #x4000 1))) + (set! (-> this warp-handle) + (process->handle + (-> (when s5-0 + (let ((t9-1 (method-of-type neo-sat-shield activate))) + (t9-1 (the-as neo-sat-shield s5-0) this "neo-sat-shield" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 neo-sat-shield-init-by-other) + (-> s5-0 ppointer) + ) + 0 + ) + ) + ) + ) + (none) + ) + +;; definition for method 21 of type neo-sat +(defmethod get-trans ((this neo-sat) (arg0 int)) + "Get the `trans` for this process." + (cond + ((= arg0 3) + (vector+float*! *neo-sat-focus-pos* (-> this root trans) *up-vector* 12288.0) + *neo-sat-focus-pos* + ) + (else + (call-parent-method this arg0) + ) + ) + ) + +;; definition for method 20 of type neo-sat +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this neo-sat)) + (let ((v0-0 0)) + (if (!= (-> this hit-points) 0.0) + (set! v0-0 (logior (logior v0-0 16) 8)) + ) + (the-as search-info-flag v0-0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system-h_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system-h_REF.gc new file mode 100644 index 0000000000..3513dc49ac --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system-h_REF.gc @@ -0,0 +1,79 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type rope-joint-system +(deftype rope-joint-system (rope-system) + ((info rope-joint-system-info) + (joint-mods joint-mod-world-array) + (proc handle) + ) + (:methods + (init (_type_ rope-joint-system-info process-drawable) symbol) + ) + ) + +;; definition for method 3 of type rope-joint-system +(defmethod inspect ((this rope-joint-system)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tknots: ~A~%" (-> this knots)) + (format #t "~1Tknot-constraints: ~A~%" (-> this knot-constraints)) + (format #t "~1Taccum-force: #~%" (-> this accum-force)) + (format #t "~1Tgravity: ~f~%" (-> this gravity)) + (format #t "~1Tgravity-dir: #~%" (-> this gravity-dir)) + (format #t "~1Tdrag: ~f~%" (-> this drag)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tangular-mass-seek-rate: ~f~%" (-> this angular-mass-seek-rate)) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Tjoint-mods: ~A~%" (-> this joint-mods)) + (format #t "~1Tproc: ~D~%" (-> this proc)) + (label cfg-4) + this + ) + +;; definition of type rope-prim-system +(deftype rope-prim-system (rope-system) + ((strip1 prim-strip) + (strip2 prim-strip) + (width float) + (alpha float) + (uv-repeat-dist float) + ) + (:methods + (add-prim-vert (_type_ prim-strip vector rgba float float) none) + ) + ) + +;; definition for method 3 of type rope-prim-system +(defmethod inspect ((this rope-prim-system)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tknots: ~A~%" (-> this knots)) + (format #t "~1Tknot-constraints: ~A~%" (-> this knot-constraints)) + (format #t "~1Taccum-force: #~%" (-> this accum-force)) + (format #t "~1Tgravity: ~f~%" (-> this gravity)) + (format #t "~1Tgravity-dir: #~%" (-> this gravity-dir)) + (format #t "~1Tdrag: ~f~%" (-> this drag)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tangular-mass-seek-rate: ~f~%" (-> this angular-mass-seek-rate)) + (format #t "~1Tstrip1: ~A~%" (-> this strip1)) + (format #t "~1Tstrip2: ~A~%" (-> this strip2)) + (format #t "~1Twidth: ~f~%" (-> this width)) + (format #t "~1Talpha: ~f~%" (-> this alpha)) + (format #t "~1Tuv-repeat-dist: ~f~%" (-> this uv-repeat-dist)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system_REF.gc new file mode 100644 index 0000000000..dad2245e1e --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system_REF.gc @@ -0,0 +1,334 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type rope-prim-system +;; WARN: Return type mismatch float vs object. +(defmethod init! ((this rope-prim-system) (arg0 int)) + (call-parent-method this arg0) + (set! (-> this strip1) + (new 'process 'prim-strip (* arg0 4) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)) + ) + (set! (-> this strip2) + (new 'process 'prim-strip (* arg0 4) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)) + ) + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (set! (-> this alpha) 1.0) + (set! (-> this uv-repeat-dist) 40960000.0) + (set! (-> this width) 1228.8) + ) + +;; definition for symbol *rope-prim-alpha-blend*, type gs-alpha +(define *rope-prim-alpha-blend* (new 'static 'gs-alpha :b #x1 :d #x1)) + +;; definition for method 19 of type rope-prim-system +;; INFO: Used lq/sq +(defmethod rope-system-method-19 ((this rope-prim-system)) + (local-vars + (sv-112 vector) + (sv-116 vector) + (sv-120 matrix) + (sv-124 float) + (sv-128 float) + (sv-132 float) + (sv-136 float) + (sv-240 vector) + (sv-244 vector) + (sv-248 vector) + (sv-252 vector) + (sv-256 object) + (sv-260 rgbaf) + ) + (let ((f30-0 0.0)) + 0.0 + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (set! (-> this strip1 alpha) *rope-prim-alpha-blend*) + (set! (-> this strip2 alpha) *rope-prim-alpha-blend*) + (set! (-> this strip1 adnops 0 cmds) (gs-reg64 hack)) + (set! (-> this strip1 data0) (new 'static 'gs-test)) + (set! (-> this strip2 adnops 0 cmds) (gs-reg64 hack)) + (set! (-> this strip2 data0) (new 'static 'gs-test)) + (logior! (-> this strip1 flags) (prim-flags fog-enable)) + (logior! (-> this strip2 flags) (prim-flags fog-enable)) + (dotimes (s5-0 (-> this knots length)) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! sv-116 (new 'stack-no-clear 'vector)) + (set! sv-120 (new 'stack-no-clear 'matrix)) + (set! sv-124 (-> this width)) + (set! sv-128 (-> this alpha)) + (set! sv-132 (the-as float 0.0)) + (set! sv-136 (the-as float 0.0)) + (set! (-> sv-112 quad) (-> this knots data s5-0 pos quad)) + (cond + ((< s5-0 (+ (-> this knots length) -1)) + (vector-! sv-116 (the-as vector (-> this knots data (+ s5-0 1))) sv-112) + (set! sv-136 (vector-vector-distance sv-112 (the-as vector (-> this knots data (+ s5-0 1))))) + ) + (else + (vector-! sv-116 sv-112 (the-as vector (-> this knots data (+ s5-0 -1)))) + ) + ) + (let ((f0-7 (/ f30-0 (-> this uv-repeat-dist)))) + (set! sv-132 (- f0-7 (* (the float (the int (/ f0-7 6.0))) 6.0))) + ) + (vector-normalize! sv-116 1.0) + (matrix-f-u-compose sv-120 sv-116 *up-vector*) + (set! sv-240 (vector+float*! (new 'stack-no-clear 'vector) sv-112 (-> sv-120 rvec) (* 0.5 sv-124))) + (set! sv-244 (vector+float*! (new 'stack-no-clear 'vector) sv-112 (-> sv-120 rvec) (* -0.5 sv-124))) + (set! sv-248 (vector+float*! (new 'stack-no-clear 'vector) sv-112 (-> sv-120 uvec) (* 0.5 sv-124))) + (set! sv-252 (vector+float*! (new 'stack-no-clear 'vector) sv-112 (-> sv-120 uvec) (* -0.5 sv-124))) + (set! sv-256 (new 'stack-no-clear 'rgbaf)) + (set! sv-260 (new 'stack-no-clear 'rgbaf)) + (set! (-> sv-260 x) 1.0) + (set! (-> sv-260 y) 1.0) + (set! (-> sv-260 z) 1.0) + (set! (-> sv-260 w) sv-128) + (set! sv-256 (rgba<-rgbaf (the-as rgba sv-256) sv-260)) + (add-prim-vert this (-> this strip1) sv-240 (the-as rgba sv-256) 0.0 sv-132) + (add-prim-vert this (-> this strip1) sv-244 (the-as rgba sv-256) 1.0 sv-132) + (add-prim-vert this (-> this strip2) sv-248 (the-as rgba sv-256) 1.0 sv-132) + (add-prim-vert this (-> this strip2) sv-252 (the-as rgba sv-256) 0.0 sv-132) + (+! f30-0 sv-136) + ) + ) + 1 + (call-parent-method this) + ) + +;; definition for method 24 of type rope-prim-system +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod add-prim-vert ((this rope-prim-system) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) + (when (< (-> arg0 num-verts) (-> arg0 allocated-num-verts)) + (let ((v1-5 (-> arg0 data (-> arg0 num-verts)))) + (set! (-> v1-5 pos quad) (-> arg1 quad)) + (set! (-> v1-5 col) arg2) + (set! (-> v1-5 stq x) arg3) + (set! (-> v1-5 stq y) arg4) + ) + (+! (-> arg0 num-verts) 1) + ) + 0 + (none) + ) + +;; definition for method 7 of type rope-prim-system +(defmethod relocate ((this rope-prim-system) (offset int)) + (if (nonzero? (-> this strip1)) + (&+! (-> this strip1) offset) + ) + (if (nonzero? (-> this strip2)) + (&+! (-> this strip2) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 21 of type rope-prim-system +(defmethod rope-system-method-21 ((this rope-prim-system)) + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (call-parent-method this) + ) + +;; definition for method 24 of type rope-joint-system +;; INFO: Used lq/sq +(defmethod init ((this rope-joint-system) (arg0 rope-joint-system-info) (arg1 process-drawable)) + (set! (-> this info) arg0) + (set! (-> this proc) (process->handle arg1)) + (let ((s4-0 (-> arg0 joint-info-array length))) + (init! this s4-0) + (set! (-> this joint-mods) (new 'process 'joint-mod-world-array s4-0)) + ) + (let ((a3-0 0) + (s4-1 0) + (s3-0 (+ (-> this joint-mods length) -1)) + ) + (while (>= s3-0 s4-1) + (init + (-> this joint-mods data s4-1) + arg1 + (the-as uint (-> this info joint-info-array s4-1 joint-index)) + (the-as joint-mod-base-flags a3-0) + ) + (set! a3-0 1) + (+! s4-1 1) + ) + ) + (dotimes (s4-2 (-> this knot-constraints length)) + (let ((s3-1 (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> arg1 node-list data (-> this info joint-info-array s4-2 joint-index)) + ) + ) + (a1-12 (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> arg1 node-list data (-> this info joint-info-array (+ s4-2 1) joint-index)) + ) + ) + ) + (set! (-> this knot-constraints data s4-2 length) (vector-vector-distance s3-1 a1-12)) + ) + ) + (dotimes (s4-3 (-> this joint-mods length)) + (let ((v1-44 + (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> arg1 node-list data (-> this info joint-info-array s4-3 joint-index)) + ) + ) + ) + (set! (-> this knots data s4-3 pos quad) (-> v1-44 quad)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> this knots data 0 prev-pos)) (* s4-3 64)))) + (-> v1-44 quad) + ) + ) + (when #t + (let ((s3-2 (-> this joint-mods data s4-3))) + (matrix->transformq + (-> s3-2 transform) + (-> arg1 node-list data (-> this info joint-info-array s4-3 joint-index) bone transform) + ) + (matrix->scale + (-> arg1 node-list data (-> this info joint-info-array s4-3 joint-index) bone transform) + (-> s3-2 transform scale) + ) + ) + ) + ) + #f + ) + +;; definition for method 7 of type rope-joint-system +(defmethod relocate ((this rope-joint-system) (offset int)) + (if (nonzero? (-> this joint-mods)) + (&+! (-> this joint-mods) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type rope-joint-system +;; INFO: Used lq/sq +(defmethod rope-system-method-10 ((this rope-joint-system)) + (call-parent-method this) + (let ((v1-1 (handle->process (-> this proc)))) + (vector<-cspace! + (the-as vector (-> this knots data)) + (-> (the-as process-drawable v1-1) node-list data (-> this info joint-info-array 0 joint-index)) + ) + ) + (let ((v0-3 (-> this knots data 0 prev-pos))) + (set! (-> v0-3 quad) (-> this knots data 0 pos quad)) + v0-3 + ) + ) + +;; definition for method 19 of type rope-joint-system +;; INFO: Used lq/sq +(defmethod rope-system-method-19 ((this rope-joint-system)) + (local-vars (sv-288 vector)) + (call-parent-method this) + (let* ((s5-0 (-> this joint-mods data)) + (s4-0 (handle->process (-> this proc))) + (s3-0 (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable s4-0) + node-list + data + (-> this info joint-info-array 0 joint-index) + bone + transform + fvec + ) + 1.0 + ) + ) + (s2-0 (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (the-as vector (-> (the-as process-drawable s4-0) + node-list + data + (-> this info joint-info-array 0 joint-index) + bone + transform + ) + ) + 1.0 + ) + ) + ) + (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable s4-0) + node-list + data + (-> this info joint-info-array 0 joint-index) + bone + transform + uvec + ) + 1.0 + ) + (matrix->quaternion (-> s5-0 0 transform quat) (matrix-fr-compose (new 'stack-no-clear 'matrix) s3-0 s2-0)) + ) + (let ((s5-2 1) + (s4-2 (+ (-> this joint-mods length) -1)) + ) + (while (>= s4-2 s5-2) + (let ((v1-18 (-> this knots data (+ s5-2 -1))) + (a0-15 (-> this knots data s5-2)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (vector-! s2-1 (the-as vector a0-15) (the-as vector v1-18)) + (vector-normalize! s2-1 1.0) + (let ((s3-1 (-> this joint-mods data s5-2))) + (let ((s1-0 matrix-u-f-compose) + (s0-0 (new 'stack-no-clear 'matrix)) + ) + (set! sv-288 s2-1) + (let* ((a2-4 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-1 transform quat))) + (a1-28 (s1-0 s0-0 sv-288 a2-4)) + ) + (matrix->quaternion (-> s3-1 transform quat) a1-28) + ) + ) + (quaternion-normalize! (-> s3-1 transform quat)) + (let* ((v1-24 (-> this joint-mods data (+ s5-2 -1))) + (s1-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> v1-24 transform quat))) + (s0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-1 transform quat))) + ) + (vector-flatten! s1-1 s1-1 s2-1) + (vector-normalize! s1-1 1.0) + (let ((s2-3 (vector-cross! (new 'stack-no-clear 'vector) s0-1 s1-1)) + (f30-0 (vector-dot s0-1 s1-1)) + (s1-2 (new 'stack-no-clear 'quaternion)) + ) + (vector-normalize! s2-3 1.0) + (let ((f0-1 (acos f30-0))) + (when #t + (quaternion-vector-angle! s1-2 s2-3 f0-1) + (quaternion*! (-> s3-1 transform quat) s1-2 (-> s3-1 transform quat)) + (quaternion-normalize! (-> s3-1 transform quat)) + ) + ) + ) + ) + ) + ) + (+! s5-2 1) + ) + ) + (let ((v1-31 0) + (a0-35 (+ (-> this joint-mods length) -1)) + ) + (while (>= a0-35 v1-31) + (set! (-> this joint-mods data v1-31 transform trans quad) (-> this knots data v1-31 pos quad)) + (+! v1-31 1) + ) + ) + #f + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/rope-system-h_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/rope-system-h_REF.gc new file mode 100644 index 0000000000..ad4c933163 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/rescue/rope-system-h_REF.gc @@ -0,0 +1,211 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type rope-knot +(deftype rope-knot (structure) + ((pos vector :inline) + (prev-pos vector :inline) + (force vector :inline) + (mass float) + ) + ) + +;; definition for method 3 of type rope-knot +(defmethod inspect ((this rope-knot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'rope-knot) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tprev-pos: #~%" (-> this prev-pos)) + (format #t "~1Tforce: #~%" (-> this force)) + (format #t "~1Tmass: ~f~%" (-> this mass)) + (label cfg-4) + this + ) + +;; definition of type rope-knot-constraint +(deftype rope-knot-constraint (structure) + ((dir vector :inline) + (length float) + (max-angle float) + (rest-seek-rate float) + (constrained-angle-time time-frame) + ) + ) + +;; definition for method 3 of type rope-knot-constraint +(defmethod inspect ((this rope-knot-constraint)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'rope-knot-constraint) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tlength: ~f~%" (-> this length)) + (format #t "~1Tmax-angle: ~f~%" (-> this max-angle)) + (format #t "~1Trest-seek-rate: ~f~%" (-> this rest-seek-rate)) + (format #t "~1Tconstrained-angle-time: ~D~%" (-> this constrained-angle-time)) + (label cfg-4) + this + ) + +;; definition of type rope-knot-constraint-array +(deftype rope-knot-constraint-array (inline-array-class) + ((data rope-knot-constraint :inline :dynamic) + ) + ) + +;; definition for method 3 of type rope-knot-constraint-array +(defmethod inspect ((this rope-knot-constraint-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> rope-knot-constraint-array heap-base) (the-as uint 48)) + +;; definition of type rope-knot-array +(deftype rope-knot-array (inline-array-class) + ((data rope-knot :inline :dynamic) + ) + ) + +;; definition for method 3 of type rope-knot-array +(defmethod inspect ((this rope-knot-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> rope-knot-array heap-base) (the-as uint 64)) + +;; definition of type rope-system +(deftype rope-system (basic) + ((knots rope-knot-array) + (knot-constraints rope-knot-constraint-array) + (accum-force vector :inline) + (gravity float) + (gravity-dir vector :inline) + (drag float) + (flags rope-system-flag) + (angular-mass-seek-rate float) + ) + (:methods + (init! (_type_ int) object) + (rope-system-method-10 (_type_) vector) + (rope-system-method-11 (_type_) vector) + (rope-system-method-12 (_type_ float) none) + (rope-system-method-13 (_type_) symbol) + (rope-system-method-14 (_type_) symbol) + (rope-system-method-15 (_type_) symbol) + (rope-system-method-16 (_type_ vector vector int) vector) + (rope-system-method-17 (_type_) symbol) + (rope-system-method-18 (_type_) object) + (rope-system-method-19 (_type_) symbol) + (rope-system-method-20 (_type_) symbol) + (rope-system-method-21 (_type_) rope-system-flag) + (rope-system-method-22 (_type_) rope-system-flag) + (rope-system-method-23 (_type_) symbol) + ) + ) + +;; definition for method 3 of type rope-system +(defmethod inspect ((this rope-system)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tknots: ~A~%" (-> this knots)) + (format #t "~1Tknot-constraints: ~A~%" (-> this knot-constraints)) + (format #t "~1Taccum-force: #~%" (-> this accum-force)) + (format #t "~1Tgravity: ~f~%" (-> this gravity)) + (format #t "~1Tgravity-dir: #~%" (-> this gravity-dir)) + (format #t "~1Tdrag: ~f~%" (-> this drag)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tangular-mass-seek-rate: ~f~%" (-> this angular-mass-seek-rate)) + (label cfg-4) + this + ) + +;; definition of type rope-joint-info +(deftype rope-joint-info (structure) + ((joint-index int16) + ) + :pack-me + ) + +;; definition for method 3 of type rope-joint-info +(defmethod inspect ((this rope-joint-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'rope-joint-info) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (label cfg-4) + this + ) + +;; definition of type rope-joint-system-info +(deftype rope-joint-system-info (structure) + ((joint-info-array (array rope-joint-info)) + ) + ) + +;; definition for method 3 of type rope-joint-system-info +(defmethod inspect ((this rope-joint-system-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'rope-joint-system-info) + (format #t "~1Tjoint-info-array: ~A~%" (-> this joint-info-array)) + (label cfg-4) + this + ) + +;; definition of type joint-mod-world-array +(deftype joint-mod-world-array (inline-array-class) + ((data joint-mod-set-world :inline :dynamic) + ) + ) + +;; definition for method 3 of type joint-mod-world-array +(defmethod inspect ((this joint-mod-world-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> joint-mod-world-array heap-base) (the-as uint 64)) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/rope-system_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/rope-system_REF.gc new file mode 100644 index 0000000000..3b71992820 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/rescue/rope-system_REF.gc @@ -0,0 +1,554 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type rope-system +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs object. +(defmethod init! ((this rope-system) (arg0 int)) + (set! (-> this accum-force quad) (the-as uint128 0)) + (logior! (-> this flags) (rope-system-flag rs6)) + (vector-float*! (-> this gravity-dir) *up-vector* -1.0) + (set! (-> this gravity) 196608.0) + (set! (-> this drag) 0.3) + (set! (-> this knots) (new 'process 'rope-knot-array arg0)) + (set! (-> this knot-constraints) (new 'process 'rope-knot-constraint-array (+ arg0 -1))) + (set! (-> this knots length) (-> this knots allocated-length)) + (set! (-> this knot-constraints length) (-> this knot-constraints allocated-length)) + (dotimes (v1-13 (-> this knots length)) + (set! (-> this knots data v1-13 pos quad) (the-as uint128 0)) + (set! (-> (the-as vector (+ (the-as uint (-> this knots data 0 prev-pos)) (* v1-13 64))) quad) + (the-as uint128 0) + ) + (set! (-> this knots data v1-13 mass) 1.0) + (set! (-> (the-as vector (+ (the-as uint (-> this knots data 0 force)) (* v1-13 64))) quad) + (the-as uint128 0) + ) + ) + (dotimes (v1-16 (-> this knot-constraints length)) + (set! (-> this knot-constraints data v1-16 max-angle) 3640.889) + (set! (-> this knot-constraints data v1-16 rest-seek-rate) (* 1820.4445 (seconds-per-frame))) + ) + #f + ) + +;; definition for method 20 of type rope-system +;; INFO: Used lq/sq +(defmethod rope-system-method-20 ((this rope-system)) + (dotimes (v1-0 (-> this knots length)) + (set! (-> (the-as vector (+ (the-as uint (-> this knots data 0 prev-pos)) (* v1-0 64))) quad) + (-> this knots data v1-0 pos quad) + ) + (set! (-> (the-as vector (+ (the-as uint (-> this knots data 0 force)) (* v1-0 64))) quad) (the-as uint128 0)) + ) + #f + ) + +;; definition for method 7 of type rope-system +;; WARN: Return type mismatch rope-knot-constraint-array vs rope-system. +(defmethod relocate ((this rope-system) (offset int)) + (if (nonzero? (-> this knots)) + (&+! (-> this knots) offset) + ) + (the-as rope-system (when (nonzero? (-> this knot-constraints)) + (let ((v0-0 (&+ (-> this knot-constraints) offset))) + (set! (-> this knot-constraints) v0-0) + v0-0 + ) + ) + ) + ) + +;; definition for method 11 of type rope-system +(defmethod rope-system-method-11 ((this rope-system)) + (if (logtest? (-> this flags) (rope-system-flag rs1)) + (vector-float*! (-> this accum-force) (-> this gravity-dir) (-> this gravity)) + ) + ) + +;; definition for method 12 of type rope-system +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod rope-system-method-12 ((this rope-system) (arg0 float)) + (let ((f0-1 (* arg0 arg0)) + (f1-1 (-> this drag)) + ) + (dotimes (v1-0 (-> this knots length)) + (let ((a2-1 (-> this knots data v1-0)) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (let ((a3-0 (new 'stack-no-clear 'vector))) + (set! (-> a3-0 quad) (-> this accum-force quad)) + (vector+! a3-0 a3-0 (-> a2-1 force)) + (vector-float*! a1-3 (-> a2-1 pos) (- 2.0 f1-1)) + (vector-! a1-3 a1-3 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) + (vector+float*! a1-3 a1-3 a3-0 f0-1) + ) + (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) + (set! (-> a2-1 pos quad) (-> a1-3 quad)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 17 of type rope-system +;; INFO: Used lq/sq +(defmethod rope-system-method-17 ((this rope-system)) + (local-vars (f28-0 float)) + (dotimes (s5-0 (+ (-> this knots length) -1)) + (let* ((s1-0 (-> this knot-constraints data s5-0)) + (s4-0 (-> this knots data s5-0)) + (s3-0 (-> this knots data (+ s5-0 1))) + (s2-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector s3-0) (the-as vector s4-0))) + ) + 0.0 + (vector-normalize-ret-len! s2-1 1.0) + (let ((f30-0 (-> this knot-constraints data s5-0 length))) + (vector-normalize! (the-as vector s1-0) 1.0) + (let ((f0-3 (vector-dot s2-1 (the-as vector s1-0)))) + (when (< f0-3 0.999) + (let ((s0-0 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f0-4 (acos f0-3))) + (set! f28-0 (cond + ((< (-> this knot-constraints data s5-0 max-angle) (fabs f0-4)) + (let ((f1-3 (-> this knot-constraints data s5-0 max-angle))) + (if (< f0-4 0.0) + (set! f1-3 (* -1.0 f1-3)) + ) + (set! f28-0 (- f0-4 f1-3)) + ) + (set-time! (-> this knot-constraints data s5-0 constrained-angle-time)) + f28-0 + ) + (else + (seek 0.0 f0-4 (* (-> this knot-constraints data s5-0 rest-seek-rate) (seconds-per-frame))) + ) + ) + ) + ) + (vector-cross! s0-0 s2-1 (the-as vector s1-0)) + (vector-normalize! s0-0 1.0) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s0-0) + ) + (vector-normalize! s2-1 1.0) + (if (< s5-0 (+ (-> this knot-constraints length) -1)) + (set! (-> this knot-constraints data (+ s5-0 1) dir quad) (-> s2-1 quad)) + ) + (vector+float*! (the-as vector s3-0) (the-as vector s4-0) s2-1 f30-0) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 15 of type rope-system +;; INFO: Used lq/sq +(defmethod rope-system-method-15 ((this rope-system)) + (local-vars + (f24-0 float) + (sv-144 symbol) + (sv-160 int) + (sv-176 (function _varargs_ object)) + (sv-192 symbol) + (sv-208 int) + (sv-224 (function _varargs_ object)) + (sv-240 vector) + (sv-256 vector) + (sv-272 symbol) + (sv-288 int) + (sv-304 (function _varargs_ object)) + (sv-320 symbol) + (sv-336 int) + (sv-352 (function _varargs_ object)) + (sv-368 vector) + (sv-384 int) + (sv-400 (function _varargs_ object)) + (sv-416 int) + (sv-432 (function _varargs_ object)) + ) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (dotimes (s5-0 (+ (-> this knots length) -1)) + (let* ((s1-0 (-> this knot-constraints data s5-0)) + (s3-0 (-> this knots data s5-0)) + (s2-0 (-> this knots data (+ s5-0 1))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector s2-0) (the-as vector s3-0))) + ) + 0.0 + (vector-normalize-ret-len! s4-1 1.0) + (let ((f30-0 (-> this knot-constraints data s5-0 length))) + (vector-normalize! (the-as vector s1-0) 1.0) + (let ((f0-3 (vector-dot s4-1 (the-as vector s1-0)))) + (when (< f0-3 0.999) + (let ((s0-0 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f0-4 (acos f0-3))) + (set! f24-0 (cond + ((< (-> this knot-constraints data s5-0 max-angle) (fabs f0-4)) + (let ((f1-3 (-> this knot-constraints data s5-0 max-angle))) + (if (< f0-4 0.0) + (set! f1-3 (* -1.0 f1-3)) + ) + (set! f24-0 (- f0-4 f1-3)) + ) + (set-time! (-> this knot-constraints data s5-0 constrained-angle-time)) + f24-0 + ) + (else + (seek 0.0 f0-4 (* (-> this knot-constraints data s5-0 rest-seek-rate) (seconds-per-frame))) + ) + ) + ) + ) + (vector-cross! s0-0 s4-1 (the-as vector s1-0)) + (vector-normalize! s0-0 1.0) + (let* ((f0-7 (-> this knots data s5-0 mass)) + (f2-3 (-> this knots data (+ s5-0 1) mass)) + (f1-5 (+ f0-7 f2-3)) + (f28-0 (/ f2-3 f1-5)) + (f26-0 (/ f0-7 f1-5)) + ) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (set! (-> s1-1 quad) (-> s3-0 pos quad)) + (set! sv-368 (new 'stack-no-clear 'vector)) + (let ((v1-35 (-> s2-0 pos quad))) + (set! (-> sv-368 quad) v1-35) + ) + (set! sv-240 (new 'stack-no-clear 'vector)) + (let ((v1-38 (-> s4-1 quad))) + (set! (-> sv-240 quad) v1-38) + ) + (set! sv-256 (new 'stack-no-clear 'vector)) + (let ((v1-40 s4-1) + (f0-8 -1.0) + ) + (.lvf vf1 (&-> v1-40 quad)) + (let ((v1-41 f0-8)) + (.mov vf2 v1-41) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-256 quad) vf1) + (add-debug-line #f (bucket-id debug) s1-1 sv-368 *color-red* #f (the-as rgba -1)) + (vector-rotate-around-axis! sv-240 (the-as quaternion sv-240) f24-0 s0-0) + (vector-rotate-around-axis! sv-256 (the-as quaternion sv-256) f24-0 s0-0) + (vector-normalize! sv-240 1.0) + (vector-normalize! sv-256 1.0) + (add-debug-line + #f + (bucket-id debug) + s1-1 + (vector+float*! (new 'stack-no-clear 'vector) s1-1 sv-240 f30-0) + *color-yellow* + #f + (the-as rgba -1) + ) + (add-debug-line + #f + (bucket-id debug) + sv-368 + (vector+float*! (new 'stack-no-clear 'vector) sv-368 sv-256 f30-0) + *color-white* + #f + (the-as rgba -1) + ) + (let ((s0-1 add-debug-text-3d)) + (set! sv-144 (the-as symbol #f)) + (set! sv-160 583) + (set! sv-176 format) + (let ((a0-37 (clear *temp-string*)) + (a1-13 "p0") + ) + (sv-176 a0-37 a1-13) + ) + (let ((a2-8 *temp-string*) + (a3-7 s1-1) + (t0-5 3) + (t1-3 #f) + ) + (s0-1 sv-144 (the-as bucket-id sv-160) a2-8 a3-7 (the-as font-color t0-5) (the-as vector2h t1-3)) + ) + ) + (let ((s0-2 add-debug-text-3d)) + (set! sv-192 (the-as symbol #f)) + (set! sv-208 583) + (set! sv-224 format) + (let ((a0-40 (clear *temp-string*)) + (a1-15 "p1") + ) + (sv-224 a0-40 a1-15) + ) + (let ((a2-9 *temp-string*) + (a3-8 sv-368) + (t0-6 3) + (t1-4 #f) + ) + (s0-2 sv-192 (the-as bucket-id sv-208) a2-9 a3-8 (the-as font-color t0-6) (the-as vector2h t1-4)) + ) + ) + (let ((v1-49 sv-368) + (a0-42 s3-0) + (f0-11 f30-0) + ) + (vector+float*! v1-49 (the-as vector a0-42) sv-240 f0-11) + ) + (vector+float*! s1-1 (the-as vector s2-0) sv-256 f30-0) + (let ((s0-3 add-debug-text-3d)) + (set! sv-272 (the-as symbol #f)) + (set! sv-288 583) + (set! sv-304 format) + (let ((a0-45 (clear *temp-string*)) + (a1-19 "p0new") + ) + (sv-304 a0-45 a1-19) + ) + (let ((a2-10 *temp-string*) + (a3-9 s1-1) + (t0-7 7) + (t1-5 #f) + ) + (s0-3 sv-272 (the-as bucket-id sv-288) a2-10 a3-9 (the-as font-color t0-7) (the-as vector2h t1-5)) + ) + ) + (let ((s0-4 add-debug-text-3d)) + (set! sv-320 (the-as symbol #f)) + (set! sv-336 583) + (set! sv-352 format) + (let ((a0-48 (clear *temp-string*)) + (a1-21 "p1new") + ) + (sv-352 a0-48 a1-21) + ) + (let ((a2-11 *temp-string*) + (a3-10 sv-368) + (t0-8 7) + (t1-6 #f) + ) + (s0-4 sv-320 (the-as bucket-id sv-336) a2-11 a3-10 (the-as font-color t0-8) (the-as vector2h t1-6)) + ) + ) + (vector-lerp! (the-as vector s3-0) (the-as vector s3-0) s1-1 f28-0) + ) + (let ((t9-25 vector-lerp!) + (a0-51 s2-0) + (a1-24 s2-0) + (a3-12 f26-0) + ) + (t9-25 (the-as vector a0-51) (the-as vector a1-24) sv-368 a3-12) + ) + ) + ) + (let ((s1-2 add-debug-text-3d) + (s0-5 #f) + ) + (set! sv-384 583) + (set! sv-400 format) + (let ((a0-53 (clear *temp-string*)) + (a1-25 "p0f") + ) + (sv-400 a0-53 a1-25) + ) + (let ((a2-14 *temp-string*) + (a3-13 s3-0) + (t0-9 6) + (t1-7 #f) + ) + (s1-2 + s0-5 + (the-as bucket-id sv-384) + a2-14 + (the-as vector a3-13) + (the-as font-color t0-9) + (the-as vector2h t1-7) + ) + ) + ) + (let ((s1-3 add-debug-text-3d) + (s0-6 #f) + ) + (set! sv-416 583) + (set! sv-432 format) + (let ((a0-56 (clear *temp-string*)) + (a1-27 "p1f") + ) + (sv-432 a0-56 a1-27) + ) + (let ((a2-15 *temp-string*) + (a3-14 s2-0) + (t0-10 6) + (t1-8 #f) + ) + (s1-3 + s0-6 + (the-as bucket-id sv-416) + a2-15 + (the-as vector a3-14) + (the-as font-color t0-10) + (the-as vector2h t1-8) + ) + ) + ) + (vector-! s4-1 (the-as vector s2-0) (the-as vector s3-0)) + (vector-normalize! s4-1 1.0) + (rope-system-method-16 this (the-as vector s3-0) (the-as vector s2-0) s5-0) + (when (< s5-0 (+ (-> this knot-constraints length) -1)) + (cond + ((logtest? (-> this flags) (rope-system-flag rs4)) + (vector-lerp! + (the-as vector (-> this knot-constraints data (+ s5-0 1))) + (the-as vector (-> this knot-constraints data (+ s5-0 1))) + s4-1 + (* (-> this angular-mass-seek-rate) (seconds-per-frame)) + ) + (vector-normalize! (the-as vector (-> this knot-constraints data (+ s5-0 1))) 1.0) + ) + (else + (let ((v1-78 (-> this knot-constraints data (+ s5-0 1)))) + (set! (-> v1-78 dir quad) (-> s4-1 quad)) + v1-78 + ) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 13 of type rope-system +(defmethod rope-system-method-13 ((this rope-system)) + (dotimes (s5-0 (+ (-> this knots length) -1)) + (let* ((s4-0 (-> this knots data s5-0)) + (s3-0 (-> this knots data (+ s5-0 1))) + (s2-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector s3-0) (the-as vector s4-0))) + ) + 0.0 + (vector-normalize-ret-len! s2-1 1.0) + (vector+float*! (the-as vector s3-0) (the-as vector s4-0) s2-1 (-> this knot-constraints data s5-0 length)) + ) + ) + #f + ) + +;; definition for method 16 of type rope-system +(defmethod rope-system-method-16 ((this rope-system) (arg0 vector) (arg1 vector) (arg2 int)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) + 0.0 + 0.0 + 0.0 + (let* ((f30-0 (-> this knot-constraints data arg2 length)) + (f2-0 (vector-normalize-ret-len! s5-1 1.0)) + (f0-3 (- f30-0 f2-0)) + (f3-1 (+ (-> this knots data arg2 mass) (-> this knots data (+ arg2 1) mass))) + (f1-2 (/ (-> this knots data arg2 mass) f3-1)) + (f3-2 (/ (-> this knots data (+ arg2 1) mass) f3-1)) + ) + (when (< 0.4 (/ (fabs f0-3) (fabs f2-0))) + (when (< f1-2 0.01) + (set! f1-2 0.01) + (set! f3-2 0.99) + ) + (when (< f3-2 0.01) + (set! f3-2 0.01) + (set! f1-2 0.99) + ) + ) + (vector+float*! arg1 arg1 s5-1 (* f0-3 f1-2)) + (vector+float*! arg0 arg0 s5-1 (* -1.0 f3-2 f0-3)) + ) + ) + ) + +;; definition for method 14 of type rope-system +(defmethod rope-system-method-14 ((this rope-system)) + (dotimes (s5-0 (+ (-> this knots length) -1)) + (let ((a1-0 (-> this knots data s5-0)) + (a2-0 (-> this knots data (+ s5-0 1))) + ) + (rope-system-method-16 this (the-as vector a1-0) (the-as vector a2-0) s5-0) + ) + ) + #f + ) + +;; definition for method 10 of type rope-system +;; WARN: Return type mismatch symbol vs vector. +(defmethod rope-system-method-10 ((this rope-system)) + (when (logtest? (-> this flags) (rope-system-flag rs0)) + (if (logtest? (-> this flags) (rope-system-flag rs3)) + (rope-system-method-15 this) + (rope-system-method-17 this) + ) + ) + (the-as vector (rope-system-method-14 this)) + ) + +;; definition for method 18 of type rope-system +(defmethod rope-system-method-18 ((this rope-system)) + (with-pp + (if (not (logtest? (-> this flags) (rope-system-flag rs6))) + (return 0) + ) + (when (not (logtest? (-> this flags) (rope-system-flag rs2))) + (rope-system-method-11 this) + (rope-system-method-12 this (* 0.0033333334 (the float (- (current-time) (-> pp clock old-frame-counter))))) + ) + (rope-system-method-10 this) + (rope-system-method-19 this) + ) + ) + +;; definition for method 19 of type rope-system +;; WARN: Return type mismatch int vs symbol. +(defmethod rope-system-method-19 ((this rope-system)) + (the-as symbol 0) + ) + +;; definition for method 22 of type rope-system +(defmethod rope-system-method-22 ((this rope-system)) + (rope-system-method-20 this) + (let ((v0-1 (logior (-> this flags) (rope-system-flag rs6)))) + (set! (-> this flags) v0-1) + v0-1 + ) + ) + +;; definition for method 21 of type rope-system +(defmethod rope-system-method-21 ((this rope-system)) + (rope-system-method-20 this) + (let ((v0-1 (logclear (-> this flags) (rope-system-flag rs6)))) + (set! (-> this flags) v0-1) + v0-1 + ) + ) + +;; definition for method 23 of type rope-system +(defmethod rope-system-method-23 ((this rope-system)) + (dotimes (s5-0 (-> this knot-constraints length)) + (let ((s4-0 (-> this knot-constraints data s5-0))) + (vector-! + (-> s4-0 dir) + (the-as vector (-> this knots data (+ s5-0 1))) + (the-as vector (-> this knots data s5-0)) + ) + (set! (-> s4-0 length) (vector-normalize-ret-len! (-> s4-0 dir) 1.0)) + ) + ) + #f + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/wland-passenger_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/wland-passenger_REF.gc new file mode 100644 index 0000000000..e69f5280d2 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/rescue/wland-passenger_REF.gc @@ -0,0 +1,1696 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type wland-passenger +(deftype wland-passenger (citizen) + ((task-arrow handle) + (start-pos vector :inline) + (seat int32) + (transport handle) + (is-dead? symbol) + (front-back-interp float :offset 1080) + (left-right-interp float) + (up-down-interp float) + (original-trans vector :inline) + (desired-pos vector :inline) + (dest-quat quaternion :inline) + (original-quat quaternion :inline) + (backup-nav-mask uint32) + (task-man handle) + (nav-sphere-handle handle) + ) + (:state-methods + boarding + returning + board-vehicle + ride + exit-vehicle + approaching-transport + entering-transport + lying-prone + ride-start + wait-for-transport-to-open + ) + (:methods + (toggle-rod-of-god (_type_) none) + (can-board-vehicle? (_type_) symbol) + (wland-passenger-method-228 (_type_ vector) symbol) + (wland-passenger-method-229 (_type_ vector) float) + (wland-passenger-method-230 (_type_ vehicle vector) vector) + (wland-passenger-method-231 (_type_) float) + ) + ) + +;; definition for method 3 of type wland-passenger +(defmethod inspect ((this wland-passenger)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type citizen inspect))) + (t9-0 this) + ) + (format #t "~2Ttask-arrow: ~D~%" (-> this task-arrow)) + (format #t "~2Tstart-pos: #~%" (-> this start-pos)) + (format #t "~2Tseat: ~D~%" (-> this seat)) + (format #t "~2Ttransport: ~D~%" (-> this transport)) + (format #t "~2Tis-dead?: ~A~%" (-> this is-dead?)) + (format #t "~2Talign: ~A~%" (-> this align)) + (format #t "~2Tfront-back-interp: ~f~%" (-> this front-back-interp)) + (format #t "~2Tleft-right-interp: ~f~%" (-> this left-right-interp)) + (format #t "~2Tup-down-interp: ~f~%" (-> this up-down-interp)) + (format #t "~2Toriginal-trans: #~%" (-> this original-trans)) + (format #t "~2Tdesired-pos: #~%" (-> this desired-pos)) + (format #t "~2Tdest-quat: #~%" (-> this dest-quat)) + (format #t "~2Toriginal-quat: #~%" (-> this original-quat)) + (format #t "~2Tbackup-nav-mask: ~D~%" (-> this backup-nav-mask)) + (format #t "~2Ttask-man: ~D~%" (-> this task-man)) + (format #t "~2Tnav-sphere-handle: ~D~%" (-> this nav-sphere-handle)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-wland-passenger wland-passenger wland-passenger-lod0-jg -1 + ((wland-passenger-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow wland-passenger-shadow-mg + :origin-joint-index 3 + ) + +;; definition of type wland-passenger-init-by-other-params +(deftype wland-passenger-init-by-other-params (traffic-object-spawn-params) + ((is-dead? symbol) + (parent handle) + ) + ) + +;; definition for method 3 of type wland-passenger-init-by-other-params +(defmethod inspect ((this wland-passenger-init-by-other-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'wland-passenger-init-by-other-params) + (format #t "~1Tobject-type: ~D~%" (-> this object-type)) + (format #t "~1Tbehavior: ~D~%" (-> this behavior)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~1Tnav-branch: #~%" (-> this nav-branch)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Trotation: #~%" (-> this rotation)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Thandle-parent: ~D~%" (-> this handle-parent)) + (format #t "~1Tguard-type: ~D~%" (-> this guard-type)) + (format #t "~1Tuser-data: ~D~%" (-> this user-data)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (format #t "~1Tis-dead?: ~A~%" (-> this is-dead?)) + (format #t "~1Tparent: ~D~%" (-> this parent)) + (label cfg-4) + this + ) + +;; definition for method 229 of type wland-passenger +(defmethod wland-passenger-method-229 ((this wland-passenger) (arg0 vector)) + (let ((gp-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + 0.0 + 0.0 + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) + 0.0 + (set! (-> s5-1 y) 0.0) + (set! (-> gp-0 y) 0.0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-normalize! gp-0 1.0) + (vector-normalize! s4-0 1.0) + (let* ((f0-7 (vector-dot s5-1 s4-0)) + (f0-8 (acos f0-7)) + ) + (if (< (vector-dot s5-1 gp-0) 0.0) + (set! f0-8 (* -1.0 f0-8)) + ) + f0-8 + ) + ) + ) + ) + +;; definition for method 226 of type wland-passenger +;; WARN: Return type mismatch object vs none. +(defmethod toggle-rod-of-god ((this wland-passenger)) + (if (< (vector-vector-distance (-> this root trans) (target-pos 0)) 122880.0) + (send-event (handle->process (-> this task-arrow)) 'hide) + (send-event (handle->process (-> this task-arrow)) 'show) + ) + (none) + ) + +;; definition for method 227 of type wland-passenger +(defmethod can-board-vehicle? ((this wland-passenger)) + (with-pp + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'get-vehicle) + (let ((v1-2 (the-as vehicle (send-event-function *target* a1-0)))) + (if v1-2 + (< (vector-length (-> v1-2 root transv)) 40960.0) + #f + ) + ) + ) + ) + ) + +;; definition for function probe-for-transport-ground +;; INFO: Used lq/sq +(defun probe-for-transport-ground ((arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> gp-0 start-pos) arg0 *up-vector* 24576.0) + (set! (-> gp-0 move-dist quad) (the-as uint128 0)) + (set! (-> gp-0 move-dist y) -81920.0) + (let ((v1-4 gp-0)) + (set! (-> v1-4 radius) 40.96) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) + (-> gp-0 best-other-tri intersect y) + -40960000.0 + ) + ) + ) + +;; definition for function compute-y-height +(defun compute-y-height ((arg0 process-focusable) (arg1 vector)) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)))) + 0.0 + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (get-trans arg0 0)))) + (vector-normalize! s4-0 1.0) + (let ((f30-0 (vector-dot s3-1 s4-0)) + (s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat))) + (s2-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat))) + (s3-2 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s3-2 (get-trans arg0 0) s1-0 -57344.0) + (vector+float*! s3-2 s3-2 s2-1 4096.0) + (vector+float*! s4-1 (get-trans arg0 0) s1-0 -34816.0) + (vector+float*! s4-1 s4-1 s2-1 22528.0) + (let ((f30-1 (cond + ((< f30-0 -57344.0) + (-> arg1 y) + ) + ((< -34816.0 f30-0) + (-> s4-1 y) + ) + (else + (+ 2048.0 (lerp-scale (-> s3-2 y) (-> s4-1 y) f30-0 -57344.0 -34816.0)) + ) + ) + ) + ) + (fmax (probe-for-transport-ground arg1) f30-1) + ) + ) + ) + ) + ) + +;; definition for function compute-transport-approach-pt +;; INFO: Used lq/sq +(defun compute-transport-approach-pt ((arg0 process-focusable) (arg1 vector)) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)))) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)) + (let ((f30-0 (compute-y-height arg0 (target-pos 0))) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> (target-pos 0) quad)) + (set! (-> s3-1 y) f30-0) + ) + (vector+float*! arg1 (get-trans arg0 0) s5-0 -57344.0) + ) + arg1 + ) + +;; definition for method 151 of type wland-passenger +(defmethod should-move-to-ground? ((this wland-passenger)) + (not (and (-> this next-state) (= (-> this next-state name) 'entering-transport))) + ) + +;; failed to figure out what this is: +(defstate entering-transport (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let* ((gp-0 (-> self nav state)) + (s5-0 (handle->process (-> self transport))) + (v1-8 (get-trans + (the-as vehicle (if (type? s5-0 process-focusable) + (the-as vehicle s5-0) + ) + ) + 0 + ) + ) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-pos quad) (-> v1-8 quad)) + ) + 0 + ) + :trans (behavior () + (let* ((gp-0 (handle->process (-> self transport))) + (a0-4 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (cond + (a0-4 + (set! (-> self root trans y) (compute-y-height (the-as process-focusable a0-4) (-> self root trans))) + (let ((t9-2 vector-vector-xz-distance) + (a0-5 (-> self root trans)) + (a2-0 (-> self nav state)) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-3 quad) (-> a2-0 target-pos quad)) + (when (< (t9-2 a0-5 a1-3) 14745.6) + (send-event (handle->process (-> self transport)) 'leave) + (send-event (handle->process (-> self transport)) 'die-when-ready) + (go-virtual die-fast) + ) + ) + ) + (else + (go-virtual die-fast) + ) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 90) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate wait-for-transport-to-open (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (set-time! (-> self state-time)) + (nav-enemy-method-178 self) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) + (send-event (handle->process (-> self transport)) 'can-board?) + ) + (go-virtual approaching-transport) + ) + ) + :code sleep-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for function update-nav-sphere +(defun update-nav-sphere ((arg0 handle) (arg1 process-focusable) (arg2 vector)) + (if (not arg1) + (return 0) + ) + (let ((s0-0 (-> arg1 root trans)) + (s2-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + (f30-0 40960.0) + ) + (let ((s1-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> arg1 root quat))) + (s3-1 (compute-transport-approach-pt arg1 (new 'stack-no-clear 'vector))) + ) + (vector+float*! s5-0 s0-0 s2-0 -29900.8) + (vector+float*! s5-0 s5-0 s1-0 20480.0) + (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) s3-1 arg2)) + (s0-2 (vector-float*! (new 'stack-no-clear 'vector) s2-0 1.0)) + ) + 0.0 + (set! (-> s1-2 y) 0.0) + (vector-normalize! s1-2 1.0) + (set! (-> s0-2 y) 0.0) + (vector-normalize! s0-2 1.0) + (let ((f28-0 (vector-dot s0-2 s1-2))) + (cond + ((< (vector-vector-xz-distance arg2 s3-1) 6144.0) + (set! f30-0 (the-as float 0.0)) + ) + ((< 0.0 f28-0) + (set! f30-0 (lerp f30-0 0.0 f28-0)) + ) + ) + ) + ) + ) + (send-event (handle->process arg0) 'move-trans s5-0) + (send-event (handle->process arg0) 'set-radius f30-0) + ) + ) + +;; failed to figure out what this is: +(defstate approaching-transport (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let* ((gp-0 (-> self nav state)) + (s5-0 compute-transport-approach-pt) + (s4-0 (handle->process (-> self transport))) + (v1-7 (s5-0 + (the-as process-focusable (if (type? s4-0 process-focusable) + s4-0 + ) + ) + (new 'stack-no-clear 'vector) + ) + ) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-pos quad) (-> v1-7 quad)) + ) + 0 + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + (let ((gp-1 (find-nearest-nav-mesh (-> self root trans) 8192.0))) + (if gp-1 + (set! (-> self nav-sphere-handle) + (ppointer->handle + (process-spawn simple-nav-sphere #x46a66666 (-> self root trans) gp-1 -1 :name "simple-nav-sphere" :to self) + ) + ) + ) + ) + ) + :exit (behavior () + (send-event (handle->process (-> self nav-sphere-handle)) 'die-fast) + ) + :trans (behavior () + (let ((gp-0 update-nav-sphere) + (s5-0 (-> self nav-sphere-handle)) + (s4-0 (handle->process (-> self transport))) + ) + (gp-0 + s5-0 + (the-as process-focusable (if (type? s4-0 process-focusable) + s4-0 + ) + ) + (-> self root trans) + ) + ) + (let ((t9-2 vector-vector-xz-distance) + (a0-5 (-> self root trans)) + (a2-1 (-> self nav state)) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-3 quad) (-> a2-1 target-pos quad)) + (when (< (t9-2 a0-5 a1-3) 2048.0) + (let ((v1-8 (-> self nav))) + (set! (-> v1-8 sphere-mask) (the-as uint 65)) + ) + 0 + (go-virtual entering-transport) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 30) + ) + :post (behavior () + (if (time-elapsed? (-> self state-time) (seconds 0.035)) + (nav-enemy-method-187 self) + (enemy-common-post self) + ) + ) + ) + +;; failed to figure out what this is: +(defstate returning (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((a0-12 (-> self nav state)) + (v1-4 (-> self start-pos)) + ) + (logclear! (-> a0-12 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-12 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-12 target-pos quad) (-> v1-4 quad)) + ) + 0 + (nav-enemy-method-176 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (cond + ((and (< (vector-vector-distance (target-pos 0) (-> self start-pos)) 81920.0) (can-board-vehicle? self)) + (go-virtual boarding) + ) + ((< (vector-vector-xz-distance (-> self root trans) (-> self start-pos)) 6144.0) + (go-virtual active) + ) + ) + ) + (toggle-rod-of-god self) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for function do-spline3 +(defun do-spline3 ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate boarding (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (nav-enemy-method-177 self) + (set! (-> self backup-nav-mask) (get-sphere-mask (-> self nav))) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (toggle-rod-of-god self) + (cond + ((or (< 122880.0 (vector-vector-distance (target-pos 0) (-> self root trans))) + (< 163840.0 (vector-vector-distance (-> self root trans) (-> self start-pos))) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) + (go-virtual returning) + ) + ) + (else + (let ((gp-1 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (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) 'get-vehicle) + (let ((s5-0 (the-as vehicle (send-event-function *target* a1-2)))) + (if (not s5-0) + (return 0) + ) + (set! (-> self vehicle) (process->handle s5-0)) + (when s5-0 + (set! (-> self seat) (get-best-seat s5-0 (-> self root trans) (vehicle-seat-flag vsf1) 1)) + (when (!= (-> self seat) -1) + (vehicle-method-66 s5-0 gp-1 (-> self seat)) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s5-0 root quat))) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector+float*! gp-2 (-> s5-0 root trans) s4-0 24576.0) + (cond + ((< (vector-vector-xz-distance (-> self root trans) gp-2) 14336.0) + (let ((v1-32 (-> self nav))) + (set! (-> v1-32 sphere-mask) (the-as uint 65)) + ) + 0 + ) + (else + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 sphere-mask) (-> self backup-nav-mask)) + ) + 0 + ) + ) + (let ((a0-21 (-> self nav state)) + (v1-37 gp-2) + ) + (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-21 target-pos quad) (-> v1-37 quad)) + ) + 0 + (if (< (vector-vector-xz-distance gp-2 (-> self root trans)) 6144.0) + (go-virtual board-vehicle) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info run-anim))) 90) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for method 67 of type wland-passenger +(defmethod coin-flip? ((this wland-passenger)) + #f + ) + +;; definition for method 230 of type wland-passenger +(defmethod wland-passenger-method-230 ((this wland-passenger) (arg0 vehicle) (arg1 vector)) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)))) + (let ((a0-3 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat)))) + (vector+float*! arg1 (-> arg0 root trans) a0-3 9830.4) + ) + (vector+float*! arg1 arg1 s5-0 -1843.2) + ) + (+! (-> arg1 y) -204.8) + arg1 + ) + +;; definition for symbol *progress*, type object +(define *progress* (the-as object #t)) + +;; failed to figure out what this is: +(defstate board-vehicle (wland-passenger) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('vehicle-crash) + #f + ) + (('end-task) + (go-die self) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((v1-0 (-> self nav))) + (set! (-> v1-0 sphere-mask) (-> self backup-nav-mask)) + ) + 0 + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-7 (-> self root root-prim))) + (set! (-> v1-7 prim-core collide-as) (collide-spec)) + (set! (-> v1-7 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logclear (-> v1-9 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-9 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-12 self)) + (set! (-> v1-12 enemy-flags) (the-as enemy-flag (logclear (-> v1-12 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (send-event (handle->process (-> self task-arrow)) 'die) + (send-event (handle->process (-> self task-man)) 'picked-up) + (change-parent self *rigid-body-queue-manager*) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot)) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (ja-no-eval :group! wland-passenger-vehicle-jump-to-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s5-0 (ja-num-frames 0)) + (f0-4 (ja-frame-num 0)) + ) + 0.0 + (let ((f30-0 (/ f0-4 (the float s5-0))) + (s5-1 (the-as vehicle (handle->process (-> self vehicle)))) + ) + (let ((s4-1 (vector+float*! + (new 'stack-no-clear 'vector) + (-> s5-1 root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s5-1 root quat)) + -1638.4 + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (vector-! s3-1 s4-1 (-> self root trans)) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (let ((s4-2 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat))) + (a2-2 (quaternion-look-at! (new 'stack-no-clear 'quaternion) s3-1 *up-vector*)) + ) + (quaternion-slerp! (-> self root quat) s4-2 a2-2 f30-0) + ) + ) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s5-1 root quat)) + (let ((a2-4 (wland-passenger-method-230 self s5-1 (new 'stack-no-clear 'vector)))) + (vector-lerp! (-> self root trans) gp-0 a2-4 f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((gp-1 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) + (ja-no-eval :group! wland-passenger-vehicle-get-in-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s5-2 (handle->process (-> self vehicle))) + (s3-2 (ja-num-frames 0)) + (f30-1 (ja-frame-num 0)) + ) + 0.0 + (let* ((s4-3 (new 'stack-no-clear 'vector)) + (t9-18 (method-of-object self wland-passenger-method-230)) + (a0-27 self) + (a1-16 (handle->process (-> self vehicle))) + (s2-0 (t9-18 a0-27 (the-as vehicle a1-16) (new 'stack-no-clear 'vector))) + ) + (vehicle-method-66 (the-as vehicle s5-2) s4-3 (-> self seat)) + (let ((f30-2 (/ f30-1 (the float s3-2)))) + (vector-lerp! (-> self root trans) s2-0 s4-3 f30-2) + (let ((s4-4 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> (the-as vehicle s5-2) root quat)))) + (let ((f0-18 (the float (-> (the-as vehicle s5-2) info rider seat-array (-> self seat) angle)))) + (quaternion-rotate-local-y! s4-4 s4-4 f0-18) + ) + (quaternion-slerp! (-> self root quat) gp-1 s4-4 f30-2) + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-channel-push! 1 (seconds 1)) + (ja :group! wland-passenger-pilot-car-up-down-ja :num! (identity 1.0)) + (let ((gp-2 (the-as vehicle (handle->process (-> self vehicle))))) + (vehicle-method-66 gp-2 (-> self root trans) (-> self seat)) + (let ((f0-24 (the float (-> gp-2 info rider seat-array (-> self seat) angle)))) + (quaternion-rotate-local-y! (-> self root quat) (-> gp-2 root quat) f0-24) + ) + ) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride-start) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate exit-vehicle (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (change-to (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)) self) + (if (not (-> self nav)) + (go-inactive self) + ) + (citizen-method-195 self) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (logior! (-> self flags) (citizen-flag persistent)) + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + (set-time! (-> self state-time)) + (let ((v1-18 (-> self root root-prim))) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-20 self)) + (set! (-> v1-20 enemy-flags) (the-as enemy-flag (logclear (-> v1-20 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-20 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-23 self)) + (set! (-> v1-23 enemy-flags) (the-as enemy-flag (logclear (-> v1-23 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (send-event (handle->process (-> self task-man)) 'dropped-off) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + :trans (behavior () + (let ((v1-1 (the-as vehicle (handle->process (-> self vehicle))))) + (if (or (not v1-1) (logtest? (-> v1-1 v-flags) (vehicle-flag dead))) + (citizen-method-206 self) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (remove-riders (the-as vehicle (handle->process (-> self vehicle))) (the-as handle self)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (ja-no-eval :group! wland-passenger-vehicle-get-out-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let* ((gp-0 (the-as vehicle (handle->process (-> self vehicle)))) + (s5-0 (quaternion-copy! (-> self root quat) (-> gp-0 root quat))) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (wland-passenger-method-230 self gp-0 (new 'stack-no-clear 'vector))) + (s2-0 (ja-num-frames 0)) + (f0-4 (ja-frame-num 0)) + ) + 0.0 + (let ((f30-0 (/ f0-4 (the float s2-0)))) + (vehicle-method-66 gp-0 s4-0 (-> self seat)) + (vector-lerp! (-> self root trans) s4-0 s3-0 f30-0) + (let ((gp-1 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> gp-0 root quat)))) + (quaternion-rotate-y! s5-0 s5-0 0.0) + (quaternion-rotate-y! gp-1 gp-1 -16384.0) + (quaternion-slerp! (-> self root quat) s5-0 gp-1 f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-2 (the-as vehicle (handle->process (-> self vehicle))))) + (wland-passenger-method-230 self gp-2 (-> self root trans)) + (+! (-> self root trans y) 409.6) + (quaternion-copy! (-> self root quat) (-> gp-2 root quat)) + ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) -16384.0) + (set! (-> self original-trans quad) (-> self root trans quad)) + (quaternion-copy! (-> self original-quat) (-> self root quat)) + (let ((s4-1 (the-as vehicle (handle->process (-> self vehicle)))) + (s5-1 (new 'stack-no-clear 'vector)) + (gp-3 (new 'stack-no-clear 'vector)) + ) + (let ((v1-63 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-1 root quat)))) + (vector+float*! s5-1 (-> s4-1 root trans) v1-63 40960.0) + (vector+float*! (-> self desired-pos) (-> s4-1 root trans) v1-63 24576.0) + ) + (wland-passenger-method-228 self (-> self desired-pos)) + (vector-! gp-3 s5-1 (-> self root trans)) + (set! (-> gp-3 y) 0.0) + (vector-normalize! gp-3 1.0) + (quaternion-look-at! (-> self dest-quat) gp-3 *up-vector*) + ) + (ja-no-eval :group! wland-passenger-vehicle-get-out-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-4 (ja-num-frames 0)) + (f0-17 (ja-frame-num 0)) + ) + 0.0 + (let ((f30-1 (/ f0-17 (the float gp-4)))) + (quaternion-slerp! (-> self root quat) (-> self original-quat) (-> self dest-quat) f30-1) + (vector-lerp! (-> self root trans) (-> self original-trans) (-> self desired-pos) f30-1) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wland-passenger-vehicle-get-out-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-121 (-> self root root-prim))) + (set! (-> v1-121 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-121 prim-core collide-with) (-> self root backup-collide-with)) + ) + (send-event (handle->process (-> self task-arrow)) 'die) + (go-virtual wait-for-transport-to-open) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; definition for method 228 of type wland-passenger +(defmethod wland-passenger-method-228 ((this wland-passenger) (arg0 vector)) + (let ((s3-0 (the-as vehicle (handle->process (-> this vehicle)))) + (s4-0 (new 'stack 'collide-query)) + ) + (vehicle-method-66 s3-0 arg0 (-> this seat)) + (vector-! arg0 arg0 (-> s3-0 root trans)) + (vector-normalize! arg0 (+ 34816.0 (vector-length arg0))) + (vector+! arg0 arg0 (-> s3-0 root trans)) + (when (enemy-above-ground? this s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> arg0 y) (-> s4-0 best-other-tri intersect y)) + (let ((v1-14 (-> this nav)) + (a1-10 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-10 vertex)) arg0 (the-as vector (-> v1-14 state mesh bounds))) + (set! (-> a1-10 vertex1 x) (-> v1-14 nearest-y-threshold)) + (set! (-> a1-10 data 20) (the-as uint 2)) + (if (nav-mesh-method-45 (-> v1-14 state mesh) a1-10) + (return #t) + ) + ) + ) + ) + #f + ) + +;; definition for method 231 of type wland-passenger +;; INFO: Used lq/sq +(defmethod wland-passenger-method-231 ((this wland-passenger)) + (let ((s5-0 (the-as vehicle (handle->process (-> this vehicle))))) + (if (not s5-0) + (return 0.0) + ) + (vehicle-method-66 s5-0 (-> this root trans) (-> this seat)) + (let ((f0-1 (the float (-> s5-0 info rider seat-array (-> this seat) angle)))) + (quaternion-rotate-local-y! (-> this root quat) (-> s5-0 root quat) f0-1) + ) + ) + (let ((v1-15 (the-as vehicle (handle->process (-> this vehicle))))) + (if (or (not v1-15) (logtest? (-> v1-15 v-flags) (vehicle-flag dead))) + (citizen-method-206 this) + ) + ) + (when (and *target* (focus-test? *target* pilot-riding)) + (let ((s4-0 (-> *target* pilot))) + (when (nonzero? s4-0) + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (set! (-> s5-1 uvec x) (* 182.04445 (* 0.5454545 (the float (current-time))))) + (set! (-> s5-1 uvec z) (sin (-> s5-1 uvec x))) + (set! (-> s5-1 uvec w) (cos (-> s5-1 uvec x))) + (set! (-> s5-1 uvec y) (seconds-per-frame)) + (set! (-> s5-1 rvec quad) (-> s4-0 local-accel quad)) + (let ((f1-6 (+ (* 0.03 (-> s5-1 uvec z)) (* -1.0 (-> s5-1 rvec x) (-> s4-0 left-right-accel-factor))))) + (+! (-> this left-right-interp) (* (- f1-6 (-> this left-right-interp)) (fmin 1.0 (* 8.0 (-> s5-1 uvec y))))) + ) + (set! (-> this left-right-interp) (fmax -1.0 (fmin 1.0 (-> this left-right-interp)))) + (let* ((f0-17 (+ (* 0.03 (-> s5-1 uvec w)) (* -1.0 (-> s5-1 rvec z) (-> s4-0 front-back-accel-factor)))) + (f1-16 (+ -0.5 f0-17)) + ) + (+! (-> this front-back-interp) (* (- f1-16 (-> this front-back-interp)) (fmin 1.0 (* 8.0 (-> s5-1 uvec y))))) + ) + (set! (-> this front-back-interp) (fmax -1.0 (fmin 1.0 (-> this front-back-interp)))) + (let ((f1-25 (+ (* 0.03 (-> s5-1 uvec w)) (* -1.0 (-> s5-1 rvec y) (-> s4-0 up-down-accel-factor))))) + (+! (-> this up-down-interp) (* (- f1-25 (-> this up-down-interp)) (fmin 1.0 (* 8.0 (-> s5-1 uvec y))))) + ) + ) + (set! (-> this up-down-interp) (fmax -1.0 (fmin 1.0 (-> this up-down-interp)))) + ) + ) + ) + (when (not (time-elapsed? (-> this state-time) (seconds 1))) + (set! (-> this up-down-interp) 0.0) + (set! (-> this left-right-interp) 0.0) + (set! (-> this front-back-interp) -1.0) + ) + ) + +;; definition for function wland-passenger-wcar-anim-loop +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior wland-passenger-wcar-anim-loop wland-passenger () + (ja-channel-push! 3 (seconds 1)) + (ja :group! wland-passenger-pilot-car-turn-back-ja) + (ja :chan 1 :group! wland-passenger-pilot-car-turn-front-ja) + (ja :chan 2 :group! wland-passenger-pilot-car-up-down-ja) + (until #f + (let ((f30-0 (* 5.0 (+ 1.0 (-> self left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-3 (* 0.5 (+ 1.0 (-> self front-back-interp))))) + (set! (-> gp-1 frame-interp 1) f0-3) + (set! (-> gp-1 frame-interp 0) f0-3) + ) + (set! (-> gp-1 num-func) num-func-identity) + (set! (-> gp-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (let ((f0-6 (* 5.0 (- 1.0 (-> self up-down-interp)))) + (gp-2 (-> self skel root-channel 2)) + ) + (let ((f1-7 (fabs (-> self up-down-interp)))) + (set! (-> gp-2 frame-interp 1) f1-7) + (set! (-> gp-2 frame-interp 0) f1-7) + ) + (set! (-> gp-2 num-func) num-func-identity) + (set! (-> gp-2 frame-num) (ja-aframe f0-6 2)) + ) + (suspend) + ) + #f + (none) + ) + +;; failed to figure out what this is: +(defstate ride (wland-passenger) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit-vehicle) + (when (< (vector-length (-> (the-as vehicle (handle->process (-> self vehicle))) root transv)) 20480.0) + (set! (-> self transport) (the-as handle (-> block param 0))) + (go-virtual exit-vehicle) + ) + ) + (('end-task) + (go-die self) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set-time! (-> self state-time)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-7 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self focus-status) (focus-status pilot-riding pilot)) + ) + :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 ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + (wland-passenger-method-231 self) + ) + :code (behavior () + (wland-passenger-wcar-anim-loop) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; failed to figure out what this is: +(defstate ride-start (wland-passenger) + :virtual #t + :parent (wland-passenger ride) + :trans (behavior () + (wland-passenger-method-231 self) + (if (time-elapsed? (-> self state-time) (seconds 1)) + (go-virtual ride) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate lying-prone (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (toggle-rod-of-god self) + (when (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 348160.0) + (send-event (handle->process (-> self task-man)) 'fight) + (send-event (handle->process (-> self task-arrow)) 'die) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja :group! wland-passenger-getup-front-ja :num! zero) + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate active (wland-passenger) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag vulnerable)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (cond + ((handle->process (-> self transport)) + (go-virtual approaching-transport) + ) + ((-> self is-dead?) + (go-virtual lying-prone) + ) + ((and (< (vector-vector-distance (target-pos 0) (-> self start-pos)) 81920.0) (can-board-vehicle? self)) + (go-virtual boarding) + ) + ((< 20480.0 (vector-vector-xz-distance (-> self root trans) (-> self start-pos))) + (go-virtual returning) + ) + ) + (toggle-rod-of-god self) + (when (or (logtest? (-> self draw status) (draw-control-status no-draw)) + (< 409600.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) + ) + (let ((gp-3 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)))) + (set! (-> gp-3 y) 0.0) + (vector-normalize! gp-3 1.0) + (quaternion-look-at! (-> self root quat) gp-3 *up-vector*) + ) + ) + ) + :code (behavior () + (until #f + (ja-channel-push! 1 (seconds 0.3)) + (let ((gp-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 9) 5))) + (dotimes (s5-0 gp-0) + (let ((s4-0 (-> self skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim wland-passenger-idle-wave-ja)) + (set! (-> s4-0 param 0) + (the float (+ (-> (the-as art-joint-anim wland-passenger-idle-wave-ja) frames num-frames) -1)) + ) + (let* ((f30-0 3.0) + (f28-0 0.0) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> s4-0 param 1) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-16))))) + ) + (set! (-> s4-0 frame-num) 0.0) + (joint-control-channel-group! s4-0 (the-as art-joint-anim wland-passenger-idle-wave-ja) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((s4-1 (-> self skel root-channel 0))) + (set! (-> s4-1 param 0) (the float (+ (-> s4-1 frame-group frames num-frames) -1))) + (let* ((f30-1 3.0) + (f28-1 0.0) + (v1-29 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-30 (the-as number (logior #x3f800000 v1-29))) + ) + (set! (-> s4-1 param 1) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-30))))) + ) + (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (ja-no-eval :group! wland-passenger-idle-wave-to-cover-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-1 (+ (logand (rand-uint31-gen *random-generator*) 3) 1))) + (dotimes (s5-1 (the-as int gp-1)) + (ja-no-eval :group! wland-passenger-idle-cover-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; definition for function wland-passenger-init-by-other +;; INFO: Used lq/sq +(defbehavior wland-passenger-init-by-other wland-passenger ((arg0 wland-passenger-init-by-other-params)) + (set! (-> self start-pos quad) (-> arg0 position quad)) + (set! (-> self transport) (the-as handle #f)) + (set! (-> self is-dead?) (-> arg0 is-dead?)) + (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-0 pos quad) (-> arg0 position quad)) + (quaternion-identity! (-> s5-0 quat)) + (set! (-> s5-0 flags) (task-arrow-flags)) + (set! (-> s5-0 map-icon) (the-as uint 13)) + (logior! (-> s5-0 flags) (task-arrow-flags taf3)) + (set! (-> self task-arrow) (process->handle (task-arrow-spawn s5-0 self))) + ) + (set! (-> self level) (level-get *level* 'desresc)) + (set! (-> self task-man) (-> arg0 parent)) + (citizen-init-by-other arg0) + ) + +;; definition for symbol *wland-passenger-nav-enemy-info*, type nav-enemy-info +(define *wland-passenger-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim -1 + :hit-anim 3 + :knocked-anim 9 + :knocked-land-anim 10 + :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 + :sound-hit (static-sound-name "wland-passenger") + :sound-die (static-sound-name "wland-passenger") + :notice-distance-delta (meters 0.1) + :default-hit-points 12.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 61440.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim 3 + :run-anim 19 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 10) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *wland-passenger-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 120 of type wland-passenger +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this wland-passenger)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak 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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 5324.8 0.0 5324.8) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-15 local-sphere) 0.0 9011.2 0.0 5324.8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type wland-passenger +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this wland-passenger)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wland-passenger" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *wland-passenger-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this anim-shuffle) 4) + (set! (-> this anim-walk) 4) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 19) + (set! (-> this speed-run) 49152.0) + (set! (-> this water-anim) -1) + (none) + ) + +;; definition for function spawn-wlander +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer wland-passenger). +(defun spawn-wlander ((arg0 desert-passenger-info) (arg1 process)) + (let ((s5-0 (new 'stack-no-clear 'wland-passenger-init-by-other-params))) + (set! (-> s5-0 position quad) (-> arg0 passenger-pos quad)) + (quaternion-identity! (-> s5-0 rotation)) + (set! (-> s5-0 velocity quad) (the-as uint128 0)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 flags) (traffic-spawn-flags tsf0)) + (set! (-> s5-0 is-dead?) (-> arg0 is-final?)) + (set! (-> s5-0 parent) (process->handle arg1)) + (process-spawn wland-passenger s5-0 :name "wland-passenger" :to arg1) + ) + ) + +;; definition for method 82 of type wland-passenger +;; WARN: disable def twice: 20. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this wland-passenger) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('impact-impulse) + (when (= arg0 (send-event *target* 'get-vehicle)) + (let ((t9-1 (method-of-type enemy event-handler))) + (t9-1 this arg0 arg1 arg2 arg3) + ) + (let ((v0-1 (the-as object (logior (-> this root penetrated-by) (penetrate vehicle))))) + (set! (-> this root penetrated-by) (the-as penetrate v0-1)) + v0-1 + ) + ) + ) + (('set-nav-mesh) + (when (and (-> this next-state) (= (-> this next-state name) 'inactive)) + (let ((a0-8 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) + (when a0-8 + (change-to a0-8 this) + (if (not (-> this nav)) + (go-inactive this) + ) + (let ((v1-20 (-> this nav state))) + (set! (-> v1-20 current-poly) (the-as nav-poly #f)) + ) + 0 + (citizen-method-195 this) + (citizen-method-194 this) + (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (go (method-of-object this active)) + ) + ) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate inactive (wland-passenger) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-nav-mesh) + (event-handler self proc argc message block) + ) + ) + ) + ) + +;; definition for method 143 of type wland-passenger +(defmethod on-dying ((this wland-passenger)) + (call-parent-method this) + (none) + ) + +;; definition for method 81 of type wland-passenger +(defmethod go-die ((this wland-passenger)) + (send-event (handle->process (-> this task-man)) 'fail-delay) + (call-parent-method this) + ) + +;; definition for method 17 of type wland-passenger +(defmethod cleanup-for-death ((this wland-passenger)) + (send-event (handle->process (-> this task-man)) 'fail-delay) + (call-parent-method this) + (none) + ) + +;; definition for method 66 of type wland-passenger +(defmethod get-penetrated-by ((this wland-passenger)) + ((method-of-type enemy get-penetrated-by) this) + ) + +;; definition for method 194 of type wland-passenger +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this wland-passenger)) + (call-parent-method this) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (none) + ) + +;; definition for method 78 of type wland-passenger +(defmethod go-hostile ((this wland-passenger)) + (go (method-of-object this active)) + ) + +;; definition for method 27 of type wland-passenger +(defmethod get-inv-mass ((this wland-passenger)) + 0.5 + ) + +;; definition for method 60 of type wland-passenger +(defmethod lerp-damage ((this wland-passenger) (arg0 float)) + (lerp-scale 0.0 (* 0.3 (-> this enemy-info default-hit-points)) arg0 20480.0 122880.0) + ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc index 113e63af84..89afaa23c2 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc @@ -175,7 +175,7 @@ ) (when (and v1-0 (!= s5-0 27) *vehicle-manager*) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 object-type) (traffic-type guard-a)) (set! (-> s4-0 behavior) (the-as uint 0)) (set! (-> s4-0 id) (the-as uint 0)) (set! (-> s4-0 nav-mesh) #f) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc index d71a19750e..2672862cb4 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc @@ -162,7 +162,7 @@ (let ((s3-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0))) (vector-z-quaternion! (-> s3-0 vec) arg1) (vector-float*! (-> s3-0 vec) (-> s3-0 vec) (-> this target-speed)) - (set! (-> s3-0 params object-type) (the-as uint 6)) + (set! (-> s3-0 params object-type) (traffic-type guard-a)) (set! (-> s3-0 params behavior) (the-as uint 3)) (set! (-> s3-0 params id) (the-as uint 0)) (set! (-> s3-0 params nav-mesh) (-> this nav-mesh)) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc index d510382c79..f4e45728c4 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc @@ -385,12 +385,11 @@ ) ;; definition for method 30 of type v-marauder -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod rigid-body-object-method-30 ((this v-marauder)) ((method-of-type wvehicle rigid-body-object-method-30) this) (new 'stack-no-clear 'vector) 0 - (none) ) ;; definition for method 203 of type v-marauder diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc index 64f4df7658..fde5cf13cb 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc @@ -22,7 +22,7 @@ ) :name '*v-turtle-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-turtle) :engine (new 'static 'vehicle-engine-info @@ -299,7 +299,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -349,7 +349,7 @@ ) :name '*v-snake-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-snake) :engine (new 'static 'vehicle-engine-info @@ -625,7 +625,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -679,7 +679,7 @@ ) :name '*v-scorpion-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-scorpion) :engine (new 'static 'vehicle-engine-info @@ -956,7 +956,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -2730.6667 @@ -1069,7 +1069,7 @@ ) :name '*v-toad-constants* :flags #x386318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-toad) :engine (new 'static 'vehicle-engine-info @@ -1335,7 +1335,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -1387,7 +1387,7 @@ ) :name '*v-fox-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-fox) :engine (new 'static 'vehicle-engine-info @@ -1663,7 +1663,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -1715,7 +1715,7 @@ ) :name '*v-rhino-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-rhino) :engine (new 'static 'vehicle-engine-info @@ -1991,7 +1991,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -21845.334 :gun-yaw-max 21845.334 :gun-pitch-min -5461.3335 @@ -2104,7 +2104,7 @@ ) :name '*v-mirage-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-mirage) :engine (new 'static 'vehicle-engine-info @@ -2380,7 +2380,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 0.75 :y 0.9 :z 1.05 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 0.75 :y 0.9 :z 1.05 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -2434,7 +2434,7 @@ ) :name '*v-x-ride-constants* :flags #x387318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-x-ride) :engine (new 'static 'vehicle-engine-info @@ -2710,7 +2710,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 0.9 :y 1.1 :z 0.9 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 0.9 :y 1.1 :z 0.9 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -2762,7 +2762,7 @@ ) :name '*v-marauder-constants* :flags #x81310 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-marauder) :engine (new 'static 'vehicle-engine-info @@ -3038,7 +3038,7 @@ :shadow-bot-clip -32768.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -3091,7 +3091,7 @@ ) :name '*v-faccar-constants* :flags #x287318 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-faccar) :engine (new 'static 'vehicle-engine-info @@ -3365,7 +3365,7 @@ :shadow-bot-clip -61440.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -3416,7 +3416,7 @@ ) :name '*v-catapult-constants* :flags #x80010 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 v-catapult) :engine (new 'static 'vehicle-engine-info @@ -3690,7 +3690,7 @@ :shadow-bot-clip -32768.0 :shadow-locus-dist 204800.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc index 35a60cac4a..031f01dd50 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc @@ -227,14 +227,13 @@ ) ;; definition for method 30 of type vehicle-wheel -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod rigid-body-object-method-30 ((this vehicle-wheel)) (ja-post) (if (logtest? (-> this rbody flags) (rigid-body-flag enable-collision)) (update-transforms (-> this root)) ) 0 - (none) ) ;; definition for method 39 of type vehicle-wheel diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc index 5009dea883..27336bda7f 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc @@ -323,7 +323,7 @@ ;; definition for method 30 of type wvehicle ;; INFO: Used lq/sq -;; WARN: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs object. (defmethod rigid-body-object-method-30 ((this wvehicle)) (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag sounds)))) (let ((f0-0 (-> this player-dist2)) @@ -349,7 +349,7 @@ (set! (-> a0-13 prev-flags) (-> a0-13 flags)) ) ) - (none) + #f ) ;; definition for method 162 of type wvehicle diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc index 538013f230..642436c2d2 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc @@ -296,7 +296,6 @@ ) ) ((method-of-type vehicle rigid-body-object-method-30) this) - (none) ) ;; definition for method 54 of type hvehicle diff --git a/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc b/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc index 54f316b6a3..36ca3f5c44 100644 --- a/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc @@ -34,7 +34,7 @@ ) :name '*h-warf-constants* :flags #x40408 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 vt27) :transmission (new 'static 'vehicle-transmission-info :gear-count 1) @@ -315,7 +315,7 @@ :shadow-bot-clip -40960.0 :shadow-locus-dist 409600.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 diff --git a/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc b/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc index 7316fb94f9..42c2b6cb88 100644 --- a/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc @@ -469,7 +469,7 @@ ;; definition for method 24 of type for-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 ((this for-jump-pad)) +(defmethod init-collision! ((this for-jump-pad)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (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)) @@ -1182,7 +1182,3 @@ (defmethod init-from-entity! ((this shoulder-plates) (arg0 entity-actor)) (process-entity-status! this (entity-perm-status dead) #t) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc b/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc index bc10154437..4a8005992b 100644 --- a/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc +++ b/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc @@ -30,7 +30,7 @@ ) :name '*h-glider-constants* :flags #x40428 - :object-type #x17 + :object-type (traffic-type vehicle-task) :guard-type #xb :vehicle-type (vehicle-type-u8 vt27) :transmission (new 'static 'vehicle-transmission-info :gear-count 1) @@ -271,7 +271,7 @@ :shadow-bot-clip -40960.0 :shadow-locus-dist 409600.0 :color-option-count 1 - :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :color (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) :gun-yaw-min -65536.0 :gun-yaw-max 65536.0 :gun-pitch-min -16384.0 @@ -1319,7 +1319,7 @@ ;; definition for method 30 of type h-glider ;; INFO: Used lq/sq -;; WARN: Return type mismatch uint128 vs none. +;; WARN: Return type mismatch uint128 vs object. (defmethod rigid-body-object-method-30 ((this h-glider)) (let ((t9-0 (method-of-type hvehicle rigid-body-object-method-30))) (t9-0 this) @@ -1332,8 +1332,8 @@ ) (let ((v0-1 (-> this root trans quad))) (set! (-> this root trans-old quad) v0-1) + v0-1 ) - (none) ) ;; definition for method 94 of type h-glider @@ -1383,7 +1383,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/intro/intro-obs_REF.gc b/test/decompiler/reference/jak3/levels/intro/intro-obs_REF.gc new file mode 100644 index 0000000000..8d5e615996 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/intro/intro-obs_REF.gc @@ -0,0 +1,62 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ctypal-ctyfarma +(deftype ctypal-ctyfarma (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type ctypal-ctyfarma +(defmethod inspect ((this ctypal-ctyfarma)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-ctyfarma ctypal-ctyfarma ctypal-ctyfarma-lod0-jg ctypal-ctyfarma-idle-ja + ((ctypal-ctyfarma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 640) + ) + +;; failed to figure out what this is: +(defstate idle (ctypal-ctyfarma) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for method 11 of type ctypal-ctyfarma +(defmethod init-from-entity! ((this ctypal-ctyfarma) (arg0 entity-actor)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctypal-ctyfarma" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/intro/intro-part_REF.gc b/test/decompiler/reference/jak3/levels/intro/intro-part_REF.gc new file mode 100644 index 0000000000..836746502f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/intro/intro-part_REF.gc @@ -0,0 +1,2605 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-drop-shooting-dust + :id 1191 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4101 :flags (sp7) :period (seconds 10) :length (seconds 0.035))) + ) + +;; failed to figure out what this is: +(defpart 4101 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 10.0) + (:scale-x (meters 5) (meters 10)) + (:scale-y :copy scale-x) + (:r 130.0) + (:g 110.0) + (:b 70.0) + (:a 64.0) + (:vel-z (meters -0.06666667) (meters -0.26666668)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 20)) + (:conerot-y (degrees -10) (degrees -32)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-drop-dust-trail + :id 1192 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4102 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4102 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 10.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters 0) (meters 0.00016666666)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-intro-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 140.0 :y 120.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 100.0 :y 80.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 100.0 :y 80.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 100.0 :y 80.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-intro-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 32.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 8.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-intro-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 3.3 :z 4.3 :w 5.3) + :one-over-x-deltas (new 'static 'vector :x 0.29999995 :y 1.0000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-intro-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 3.3 :z 4.3 :w 5.3) + :one-over-x-deltas (new 'static 'vector :x 0.29999995 :y 1.0000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-intro-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -0.5 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :z -2.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-intro-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 5.0 :z 6.0 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 16.666666 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-intro-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 5.0 :z 6.0 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 16.666666 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-drop-dust-trail-curve-settings*, type particle-curve-settings +(define *part-drop-dust-trail-curve-settings* + (new 'static 'particle-curve-settings :lifetime-offset (seconds 4) :flags (particle-curve-flags pcf0)) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4102 init-specs 15 initial-valuef) + (the-as float *part-drop-dust-trail-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* color-start) *range-intro-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* alpha-start) *range-intro-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* scale-x-start) *range-intro-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* scale-y-start) *range-intro-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* a-scalar) *curve-intro-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* scale-x-scalar) *curve-intro-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-trail-curve-settings* scale-y-scalar) *curve-intro-dust-scale-y*) + +;; failed to figure out what this is: +(defpartgroup group-drop-dust-landing + :id 1193 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4103 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4103 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters 0) (meters 0.00016666666)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for symbol *part-drop-dust-landing-curve-settings*, type particle-curve-settings +(define *part-drop-dust-landing-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4103 init-specs 15 initial-valuef) + (the-as float *part-drop-dust-landing-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* color-start) *range-intro-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* alpha-start) *range-intro-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* scale-x-start) *range-intro-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* scale-y-start) *range-intro-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* a-scalar) *curve-intro-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* scale-x-scalar) *curve-intro-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-landing-curve-settings* scale-y-scalar) *curve-intro-dust-scale-y*) + +;; failed to figure out what this is: +(defpartgroup group-drop-dust-takeoff + :id 1194 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4104 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4104 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 5.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters 0) (meters 0.00016666666)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for symbol *part-drop-dust-takeoff-curve-settings*, type particle-curve-settings +(define *part-drop-dust-takeoff-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 5) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4104 init-specs 15 initial-valuef) + (the-as float *part-drop-dust-takeoff-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* color-start) *range-intro-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* alpha-start) *range-intro-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* scale-x-start) *range-intro-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* scale-y-start) *range-intro-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* a-scalar) *curve-intro-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* scale-x-scalar) *curve-intro-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-takeoff-curve-settings* scale-y-scalar) *curve-intro-dust-scale-y*) + +;; failed to figure out what this is: +(defpartgroup group-drop-dust-cloud + :id 1195 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4105 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4105 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 20.0) + (:x (meters 0) (meters 2)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-x (meters 0) (meters 0.0033333334)) + (:accel-y (meters 0) (meters 0.00006666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-intro-dust-cloud-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 2.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -2.2222223 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-intro-dust-cloud-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 2.0 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 3.3333333 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-intro-dust-cloud-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 2.0 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 3.3333333 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-drop-dust-cloud-curve-settings*, type particle-curve-settings +(define *part-drop-dust-cloud-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 4) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4105 init-specs 15 initial-valuef) + (the-as float *part-drop-dust-cloud-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* color-start) *range-intro-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* alpha-start) *range-intro-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* scale-x-start) *range-intro-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* scale-y-start) *range-intro-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* a-scalar) *curve-intro-dust-cloud-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* scale-x-scalar) *curve-intro-dust-cloud-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-dust-cloud-curve-settings* scale-y-scalar) *curve-intro-dust-cloud-scale-y*) + +;; failed to figure out what this is: +(defpartgroup group-drop-pecker-dustoff + :id 1196 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4106 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4106 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 10.0) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-y (meters -0.006666667)) + (:friction 0.99) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees -40) (degrees 80)) + (:conerot-z (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-intro-pecker-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.1 :y 0.2 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 0.1 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-intro-pecker-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.1 :y 0.2 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 0.1 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-intro-pecker-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-intro-pecker-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-drop-pecker-dustoff-curve-settings*, type particle-curve-settings +(define *part-drop-pecker-dustoff-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.4) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4106 init-specs 14 initial-valuef) + (the-as float *part-drop-pecker-dustoff-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* color-start) *range-intro-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* alpha-start) *range-intro-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* scale-x-start) *range-intro-pecker-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* scale-y-start) *range-intro-pecker-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* a-scalar) *curve-intro-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* scale-x-scalar) *curve-intro-pecker-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-drop-pecker-dustoff-curve-settings* scale-y-scalar) *curve-intro-pecker-dust-scale-y*) + +;; failed to figure out what this is: +(defpartgroup group-drop-thrusters-powerdown + :id 1197 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4107 :flags (sp7)) (sp-item 4108 :flags (sp3 sp7)) (sp-item 4109 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4109 + :init-specs ((:texture (thrust-glob introcst-sprite)) + (:num 3.0) + (:scale-x (meters 2) (meters 2)) + (:rot-x (degrees 67.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 40.0 15.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees -60) 1 (degrees 120)) + (:fade-a -0.05) + (:timer (seconds 2.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:func 'sparticle-track-root) + (:next-time (seconds 2)) + (:next-launcher 4110) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4110 + :init-specs ((:fade-a 1.5) (:next-time (seconds 0.335)) (:next-launcher 4111)) + ) + +;; failed to figure out what this is: +(defpart 4111 + :init-specs ((:fade-a -2.55)) + ) + +;; failed to figure out what this is: +(defpart 4108 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x (degrees 67.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0 28.0) + (:b 0.0) + (:a 16.0 16.0) + (:omega (degrees 4511.25)) + (:vel-y (meters 0.1)) + (:timer (seconds 2.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:func 'sparticle-track-root) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-drop-thrusters + :id 1198 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4107 :flags (sp7)) + (sp-item 4112 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 4113 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4107 + :init-specs ((:num 1.0) + (:x (meters -2) (meters 4)) + (:y (meters -2) (meters 4)) + (:z (meters -2) (meters 4)) + (:rot-x 5) + (:r 20480.0) + (:g 10240.0) + (:b 8192.0 4096.0) + (:timer (seconds 0.5)) + (:flags (distort launch-along-z)) + ) + ) + +;; failed to figure out what this is: +(defpart 4112 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 4.0) + (:scale-x (meters 2) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 40.0 10.0) + (:vel-y (meters 0.1)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4113 + :init-specs ((:texture (glow level-default-sprite)) + (:num 3.0) + (:scale-x (meters 6) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0 28.0) + (:b 0.0) + (:a 8.0 8.0) + (:vel-y (meters 0.1)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-drop-thruster-trail + :id 1199 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4114 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4115 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4116 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4117 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4118 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4119 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4120 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4121 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4122 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4123 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 4114 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters -0.33333334) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4115 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 0) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4116 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4117 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 0.6666667) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4118 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 1) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4119 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 1.3333334) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4120 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 1.6666666) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4121 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 2) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4122 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 2.3333333) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4123 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 200.0) + (:a 20.0 10.0) + (:vel-y (meters 2.6666667) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1 -0.2) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-drop-handcuff-light + :id 1200 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4124 :flags (sp7) :period (seconds 0.335) :length (seconds 0.035)) + (sp-item 4125 :flags (sp6 sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4124 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.03)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4125 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 30.0 20.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-drop-beacon-glow + :id 1201 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4126 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4126 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017)) + (:next-launcher 4127) + ) + ) + +;; failed to figure out what this is: +(defpart 4127 + :init-specs ((:a 0.0) (:next-time (seconds 0.667)) (:next-launcher 4128)) + ) + +;; failed to figure out what this is: +(defpart 4128 + :init-specs ((:a 64.0) (:next-time (seconds 0.667)) (:next-launcher 4127)) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thrusters + :id 1202 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4129 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 4130 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4129 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -1)) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 3) (meters 1)) + (:r 10.0 20.0) + (:g 200.0) + (:b 255.0) + (:a 40.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4130 + :init-specs ((:texture (glow level-default-sprite)) + (:num 3.0) + (:scale-x (meters 4) (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 8.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thruster-trail + :id 1203 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4131 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4132 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 4131 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 30.0 10.0) + (:vel-y (meters 0) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.23333333 -0.46666667) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4132 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 30.0 10.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.13333334 -0.26666668) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thruster-little-trail + :id 1204 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4133 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4133 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 2.0) + (:y (meters 0) (meters 5)) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 30.0 10.0) + (:vel-y (meters 0.016666668)) + (:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.06666667 -0.06666667) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thruster-fire-trail + :id 1205 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4134 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4134 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 5)) + (:scale-x (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 20.0) + (:b 0.0) + (:a 100.0 30.0) + (:vel-y (meters 0.016666668)) + (:scalevel-x (meters 0.02) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21666667 -0.21666667) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thruster-thick-trail + :id 1206 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4135 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 4136 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 4135 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y (meters 1)) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 30.0 10.0) + (:vel-y (meters 0) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.13333334 -0.26666668) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4136 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y (meters 1)) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 60.0 10.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.23333333 -0.46666667) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-hellcat-explode + :id 1207 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4137 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4138 :period (seconds 32) :length (seconds 0.167)) + (sp-item 4139 :period (seconds 32) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4137 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4138 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 10) (meters 5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.01) (meters 0.1)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9 0.09) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4139 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 5.0) + (:scale-x (meters 20) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-missile + :id 1208 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4141 :binding 4140) + (sp-item 4140 :flags (sp2) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 4142) + ) + ) + +;; failed to figure out what this is: +(defpart 4141 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 4140 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 90.0 30.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:scalevel-x (meters 0.06666667) (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defpart 4142 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 2)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0 28.0) + (:b 0.0) + (:a 12.0 12.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-missile-explode + :id 1209 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4143 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4144 :period (seconds 32) :length (seconds 0.167)) + (sp-item 4145 :period (seconds 32) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4143 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 300)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4144 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 30) (meters 20)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.033333335) (meters 0.26666668)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9 0.09) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4145 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 5.0) + (:scale-x (meters 60) (meters 20)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.2)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-small-explode + :id 1210 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4146 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4147 :period (seconds 32) :length (seconds 0.167)) + (sp-item 4148 :period (seconds 32) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4146 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 300)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4147 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 3.0) + (:scale-x (meters 30) (meters 20)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.033333335) (meters 0.26666668)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9 0.09) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4148 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 3.0) + (:scale-x (meters 60) (meters 20)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.2)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.08888889) + (:fade-b -0.033333335) + (:fade-a -0.28333333 -0.28333333) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-huge-explosion + :id 1211 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4150 :flags (sp3)) + (sp-item 4151 :period (seconds 32) :length (seconds 0.167)) + (sp-item 4152 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4153 :flags (sp3) :binding 4149) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + (sp-item 4149 :flags (sp2) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 4150 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 100)) + (:scale-x (meters 800)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.035555556) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4151 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 60) (meters 40)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.06666667) (meters 0.53333336)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.044444446) + (:fade-b -0.016666668) + (:fade-a -0.14166667 -0.14166667) + (:friction 0.9 0.09) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4152 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:num 5.0) + (:scale-x (meters 120) (meters 80)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.6666667)) + (:scalevel-x (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.044444446) + (:fade-b -0.016666668) + (:fade-a -0.14166667 -0.14166667) + (:friction 0.93) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4153 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 1.0) + (:scale-x (meters 120)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 1.3333334)) + (:scalevel-x (meters -0.16666667) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0033333334)) + (:friction 0.991 0.008) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 90)) + (:rotate-y (degrees 70) (degrees 40)) + ) + ) + +;; failed to figure out what this is: +(defpart 4149 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-dust-inherit-scaler) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 64.0) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.044444446) + (:fade-b -0.016666668) + (:accel-y (meters 0) (meters -0.001)) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-smoke-plume :id 1212 :bounds (static-bspherem 0 0 0 640) :parts ((sp-item 4154))) + +;; failed to figure out what this is: +(defpart 4154 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.2) + (:x (meters -6) (meters 12)) + (:scale-x (meters 30) (meters 30)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-x (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.1) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.021333333 -0.021333333) + (:accel-y (meters 0.0033333334)) + (:friction 0.99) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function birth-func-dust-inherit-scaler +;; WARN: Return type mismatch int vs none. +(defun birth-func-dust-inherit-scaler ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sparticle-launchinfo) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((v1-1 (-> arg4 sprite sprite))) + (set! (-> arg2 launchrot w) (* (-> v1-1 x-y-z-sx w) (-> arg2 launchrot w))) + (set! (-> arg2 conerot w) (* (-> v1-1 flag-rot-sy w) (-> arg2 conerot w))) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-dust-cloud-first + :id 1213 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4155 :period (seconds 32) :length (seconds 0.067)) + (sp-item 4156 :period (seconds 32) :length (seconds 0.067)) + ) + ) + +;; failed to figure out what this is: +(defpart 4155 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:num 20.0) + (:x (meters 0)) + (:y (meters -10)) + (:z (meters 0)) + (:scale-x (meters 10)) + (:rot-z (degrees -80) (degrees 20)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-x (meters 0.5) (meters 0.33333334)) + (:scalevel-x (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.955 0.005) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.017)) + (:next-launcher 4157) + (:conerot-z (degrees -8) (degrees 10)) + (:rotate-y (degrees 40) (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 4157 + :init-specs ((:fade-g -1.0) (:fade-b -2.0) (:next-time (seconds 0.017)) (:next-launcher 4158)) + ) + +;; failed to figure out what this is: +(defpart 4158 + :init-specs ((:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.917)) (:next-launcher 4159)) + ) + +;; failed to figure out what this is: +(defpart 4159 + :init-specs ((:scalevel-x (meters 0.016666668)) (:scalevel-y :copy scalevel-x) (:friction 0.0)) + ) + +;; failed to figure out what this is: +(defpart 4156 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 20.0) + (:x (meters -60) (meters 120)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 2)) + (:r 200.0 55.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.16666667)) + (:scalevel-x (meters 0.06666667)) + (:rotvel-z (degrees -1.3333334) (degrees 2.6666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 5)) + (:flags (aux-list sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x408b00 #x40a200 #x40a600 #x40aa00 #x400600)) + (:next-time (seconds 0.017)) + (:next-launcher 4160) + (:conerot-x (degrees -30) (degrees 60)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4160 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.0) + (:fade-b -2.0) + (:next-time (seconds 0.017)) + (:next-launcher 4161) + ) + ) + +;; failed to figure out what this is: +(defpart 4161 + :init-specs ((:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-dust-cloud-big + :id 1214 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4162 :period (seconds 32) :length (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 4162 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:num 0.5) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.33333334) (meters 0.6666667)) + (:scalevel-x (meters 1) (meters 1)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64 1.28) + (:friction 0.97) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.017)) + (:next-launcher 4163) + (:conerot-x (degrees -30) (degrees 60)) + ) + ) + +;; failed to figure out what this is: +(defpart 4163 + :init-specs ((:fade-g -1.0) (:fade-b -2.0) (:next-time (seconds 0.017)) (:next-launcher 4164)) + ) + +;; failed to figure out what this is: +(defpart 4164 + :init-specs ((:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.167)) (:next-launcher 4165)) + ) + +;; failed to figure out what this is: +(defpart 4165 + :init-specs ((:scalevel-x (meters 0.06666667)) (:scalevel-y :copy scalevel-x) (:fade-a -0.021333333 -0.021333333)) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-flak + :id 1215 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4166 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4167 :period (seconds 32) :length (seconds 0.017)) + (sp-item 4168 :period (seconds 32) :length (seconds 0.035)) + (sp-item 4169 :period (seconds 32) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4166 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 150.0) + (:a 255.0) + (:scalevel-x (meters -0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-a -8.5) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4167 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 60)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 32.0) + (:fade-a -0.64) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4168 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 10.0) + (:scale-x (meters 9) (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.6666667)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.14222223 -0.14222223) + (:accel-x (meters 0.016666668)) + (:friction 0.88) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 launch-along-z)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4170 + :init-specs ((:vel-x (meters 0.1)) (:friction 1.0)) + ) + +;; failed to figure out what this is: +(defpart 4169 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:scale-x (meters 10) (meters 50)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 10.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0) (meters 0.33333334)) + (:scalevel-x (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.128) + (:accel-x (meters 0.016666668)) + (:friction 0.88) + (:timer (seconds 3.335)) + (:flags (launch-along-z)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palace-tracer-fire + :id 1216 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4171 :flags (sp7) :period (seconds 5) :length (seconds 1))) + ) + +;; failed to figure out what this is: +(defpart 4171 + :init-specs ((:texture (enemy-tracer intpfall-sprite)) + (:num 0.0 0.3) + (:scale-x (meters 50)) + (:rot-x 4) + (:scale-y (meters 5) (meters 5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 60.0) + (:omega (degrees 0.7875) (degrees 0.1125)) + (:vel-y (meters 0.2) (meters 0.06666667)) + (:timer (seconds 3) (seconds 1.997)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -30) (degrees 60)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctypal-palace-break-explode-small + :id 1217 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctypal-palace-break-explode-fountain + :id 1218 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctypal-palace-break-explode-medium + :id 1219 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctypal-palace-break-explode-large + :id 1220 + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctypal-support-break-trailer + :id 1221 + :duration (seconds 1) + :linger-duration (seconds 3) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 60) + :parts ((sp-item 4172 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4172 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:y (meters -40) (meters 80)) + (:scale-x (meters 20) (meters 20)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:scalevel-x (meters 0.026666667) (meters 0.04)) + (:scalevel-y :copy scalevel-x) + (:fade-a 1.28) + (:accel-y (meters -0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4173) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4173 + :init-specs ((:fade-a -0.11636364 -0.11636364)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctypal-palace-break-trailer-small + :id 1222 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4174)) + ) + +;; failed to figure out what this is: +(defpart 4174 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.3) + (:y (meters 0) (meters -10)) + (:scale-x (meters 12) (meters 12)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-y (meters 0) (meters 0.05)) + (:scalevel-x (meters 0.026666667) (meters 0.04)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16 0.16) + (:accel-y (meters -0.00025) (meters -0.0001)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.5)) + (:next-launcher 4175) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 16)) + ) + ) + +;; failed to figure out what this is: +(defpart 4176 + :init-specs ((:fade-a -0.10666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctypal-palace-break-trailer-medium + :id 1223 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpart 4177 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.6) + (:y (meters 0) (meters -10)) + (:scale-x (meters 24) (meters 24)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-y (meters 0) (meters 0.05)) + (:scalevel-x (meters 0.053333335) (meters 0.08)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16 0.16) + (:accel-y (meters -0.00025) (meters -0.0001)) + (:friction 0.98) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.5)) + (:next-launcher 4175) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 16)) + ) + ) + +;; failed to figure out what this is: +(defpart 4178 + :init-specs ((:fade-a -0.04 -0.04)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctypal-palace-break-trailer-large + :id 1224 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpart 4179 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.6) + (:scale-x (meters 80) (meters 80)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.06666667)) + (:scalevel-x (meters 0.12) (meters 0.16)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16 0.16) + (:accel-y (meters -0.00025) (meters -0.0001)) + (:friction 0.98) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.5)) + (:next-launcher 4175) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 16)) + ) + ) + +;; failed to figure out what this is: +(defpart 4175 + :init-specs ((:fade-a -0.053333335 -0.053333335)) + ) + +;; failed to figure out what this is: +(defpartgroup group-drop-desert-heathaze + :id 1225 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 4180 :falloff-to (meters 50) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4180 + :init-specs ((:num 1.0 1.0) + (:x (meters -12) (meters 24)) + (:y (meters -2) (meters 2)) + (:z (meters -20)) + (:rot-x 8) + (:r 24576.0) + (:g 12288.0) + (:b 12288.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:fade-b 3.4133334) + (:timer (seconds 2)) + (:flags (distort launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 4181) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lost-desert-heathaze + :id 1226 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 4182 :falloff-to (meters 50) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4182 + :init-specs ((:num 2.0) + (:x (meters -2) (meters 4)) + (:y (meters 0) (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:accel-y (meters 0.00066666666)) + (:friction 0.75) + (:timer (seconds 1.5) (seconds 1.497)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-tired-desert-heathaze + :id 1227 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4183 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4183 + :init-specs ((:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -70) (meters 140)) + (:rot-x 8) + (:r 24576.0) + (:g 12288.0) + (:b 12288.0) + (:fade-b 3.4133334) + (:accel-y (meters 0.005) (meters 0.006666667)) + (:accel-z (meters -0.0026666666) (meters 0.0053333333)) + (:friction 0.8) + (:timer (seconds 2)) + (:flags (distort launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 4181) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4181 + :init-specs ((:fade-b -3.4133334)) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-impact-dust :id 1228 :bounds (static-bspherem 0 0 0 10) :parts ((sp-item 4184))) + +;; failed to figure out what this is: +(defpart 4184 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 6.0) + (:scale-x (meters 1)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.026666667) (meters 0.01)) + (:rotvel-z (degrees -0.06666667) (degrees 0.13333334)) + (:accel-y (meters 0.00016666666)) + (:friction 0.8) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-color-desert-impact-dust* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 190.0 :y 140.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 130.0 :y 100.0 :z 60.0 :w 128.0) + (new 'static 'vector :x 130.0 :y 100.0 :z 60.0 :w 128.0) + (new 'static 'vector :x 130.0 :y 100.0 :z 60.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-alpha-desert-impact-dust* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-desert-impact-dust-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 1.4 :w 2.4) + :one-over-x-deltas (new 'static 'vector :x 0.2 :y 1.0 :z 1.0000001 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-desert-impact-dust-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 1.4 :w 2.4) + :one-over-x-deltas (new 'static 'vector :x 0.2 :y 1.0 :z 1.0000001 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-alpha-desert-impact-dust* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-desert-impact-dust-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 2.5 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-desert-impact-dust-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 2.5 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-desert-impact-dust-curve-settings*, type particle-curve-settings +(define *part-desert-impact-dust-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4184 init-specs 16 initial-valuef) + (the-as float *part-desert-impact-dust-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* color-start) *range-color-desert-impact-dust*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* alpha-start) *range-alpha-desert-impact-dust*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* scale-x-start) *range-scale-desert-impact-dust-x*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* scale-y-start) *range-scale-desert-impact-dust-y*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* a-scalar) *curve-alpha-desert-impact-dust*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* scale-x-scalar) *curve-desert-impact-dust-x*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-curve-settings* scale-y-scalar) *curve-desert-impact-dust-y*) + +;; failed to figure out what this is: +(defpartgroup group-desert-impact-dust-blow + :id 1229 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4185)) + ) + +;; failed to figure out what this is: +(defpart 4185 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 6.0) + (:y (meters 0.2)) + (:scale-x (meters 1)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.026666667) (meters 0.06666667)) + (:rotvel-z (degrees -0.06666667) (degrees 0.13333334)) + (:accel-z (meters -0.006666667)) + (:friction 0.8) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-alpha-desert-impact-dust-blow* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 32.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x 32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-desert-impact-dust-blow-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.8 :w 2.8) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y 0.99999994 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-desert-impact-dust-blow-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.8 :w 2.8) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y 0.99999994 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-alpha-desert-impact-dust-blow* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-desert-impact-dust-blow-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 2.5 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-desert-impact-dust-blow-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 2.5 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-desert-impact-dust-blow-curve-settings*, type particle-curve-settings +(define *part-desert-impact-dust-blow-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4185 init-specs 17 initial-valuef) + (the-as float *part-desert-impact-dust-blow-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* color-start) *range-color-desert-impact-dust*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* alpha-start) *range-alpha-desert-impact-dust-blow*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* scale-x-start) + *range-scale-desert-impact-dust-blow-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* scale-y-start) + *range-scale-desert-impact-dust-blow-y* + ) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* a-scalar) *curve-alpha-desert-impact-dust-blow*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* scale-x-scalar) *curve-desert-impact-dust-blow-x*) + +;; failed to figure out what this is: +(set! (-> *part-desert-impact-dust-blow-curve-settings* scale-y-scalar) *curve-desert-impact-dust-blow-y*) + +;; failed to figure out what this is: +(defpartgroup group-desert-blowing-dust + :id 1230 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4186 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4186 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.5) + (:x (meters 0)) + (:z (meters 20) (meters 20)) + (:scale-x (meters 10) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 80.0) + (:b 50.0) + (:a 0.0) + (:vel-z (meters -0.06666667) (meters -0.06666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:fade-a 0.033333335 0.033333335) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 4187) + ) + ) + +;; failed to figure out what this is: +(defpart 4187 + :init-specs ((:fade-a -0.033333335 -0.033333335)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/intro/intro-scenes_REF.gc b/test/decompiler/reference/jak3/levels/intro/intro-scenes_REF.gc new file mode 100644 index 0000000000..17eae2e73c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/intro/intro-scenes_REF.gc @@ -0,0 +1,6192 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-air-train-fma air-train-fma air-train-fma-lod0-jg air-train-fma-idle-ja + ((air-train-fma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 -2 12.5) + :shadow air-train-fma-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-beacon beacon beacon-lod0-jg beacon-idle-ja + ((beacon-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-handcuffs handcuffs handcuffs-lod0-jg handcuffs-idle-ja + ((handcuffs-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-hellcat-lowres-fma hellcat-lowres-fma hellcat-lowres-fma-lod0-jg hellcat-lowres-fma-idle-ja + ((hellcat-lowres-fma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-palace-break ctypal-palace-break ctypal-palace-break-lod0-jg ctypal-palace-break-idle-ja + ((ctypal-palace-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 500) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-palace-break-a ctypal-palace-break ctypal-palace-break-a-lod0-jg ctypal-palace-break-a-idle-ja + ((ctypal-palace-break-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 750) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-palace-break-b ctypal-palace-break ctypal-palace-break-b-lod0-jg ctypal-palace-break-b-idle-ja + ((ctypal-palace-break-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1000) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-palace-break-c ctypal-palace-break ctypal-palace-break-c-lod0-jg ctypal-palace-break-c-idle-ja + ((ctypal-palace-break-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 640) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-palace-break-d ctypal-palace-break ctypal-palace-break-d-lod0-jg ctypal-palace-break-d-idle-ja + ((ctypal-palace-break-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 640) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-palace-break-e ctypal-palace-break ctypal-palace-break-e-lod0-jg ctypal-palace-break-e-idle-ja + ((ctypal-palace-break-e-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 640) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-cable-break ctypal-cable-break ctypal-cable-break-lod0-jg ctypal-cable-break-idle-ja + ((ctypal-cable-break-lod0-mg (meters 999999))) + :bounds (static-spherem 200 0 0 640) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-support-break ctypal-support-break ctypal-support-break-lod0-jg ctypal-support-break-idle-ja + ((ctypal-support-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -150 0 300) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-rail ctypal-rail ctypal-rail-lod0-jg ctypal-rail-idle-ja + ((ctypal-rail-lod0-mg (meters 999999))) + :bounds (static-spherem -40 0 35 75) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-base-break ctypal-base-break ctypal-base-break-lod0-jg ctypal-base-break-idle-ja + ((ctypal-base-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 500) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "intro-drop" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-110" + :art-group "scenecamera" + :anim "intro-drop" + :parts 59 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float 0)) + (send-event *time-of-day* 'change 'hour (int 18)) + (apply ,(lambda :behavior scene-player + () + (let ((v1-1 (level-get *level* 'wasintro))) + (if v1-1 + (set! (-> v1-1 info fog-mult) 100.0) + ) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (none) + ) + ) + (send-event + "air-train-fma" + 'shadow-bot-plane + (float (new 'static 'bfloat)) + (float (new 'static 'bfloat :data 1.0)) + (float (new 'static 'bfloat)) + (meters (new 'static 'bfloat :data 50.0)) + ) + (send-event "air-train-fma" 'shadow-fade-dist (meters (new 'static 'bfloat :data 200.0))) + (fadein (frame-time-30 60)) + (part-tracker + "group-drop-dust-trail" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 0 360) + ) + (part-tracker + "group-drop-thrusters" + entity + "air-train-fma" + joint + "thruster_l" + track + #t + duration + (frame-range 0 720) + ) + (part-tracker + "group-drop-thruster-trail" + entity + "air-train-fma" + joint + "thruster_l" + track + #t + duration + (frame-range 0 720) + ) + (part-tracker + "group-drop-thrusters" + entity + "air-train-fma" + joint + "thruster_r" + track + #t + duration + (frame-range 0 720) + ) + (part-tracker + "group-drop-thruster-trail" + entity + "air-train-fma" + joint + "thruster_r" + track + #t + duration + (frame-range 0 720) + ) + ) + (20 (apply ,(lambda :behavior scene-player + () + (case (scf-get-territory) + ((1) + (talker-spawn-func (-> *talker-speech* 58) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((3) + (talker-spawn-func (-> *talker-speech* 60) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (else + (talker-spawn-func (-> *talker-speech* 57) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (none) + ) + ) + ) + (245 + (apply + ,(lambda :behavior scene-player + () + (process-spawn-function + process + (lambda :behavior scene-player + () + (logclear! (-> self mask) (process-mask pause)) + (let ((gp-0 (new 'stack 'hud-sprite)) + (s5-0 (level-get *level* 'inttitle)) + (f30-0 0.0) + ) + (set! (-> gp-0 flags) (hud-sprite-flags hsf3)) + (set! (-> gp-0 tid) (the-as texture-id (get-texture NaughtyDog inttitle-minimap))) + (set-vector! (-> gp-0 pos) 256 180 #xffffff 0) + (let ((v1-6 (-> gp-0 color-ptr))) + (set! (-> v1-6 0) 128) + (set! (-> v1-6 1) 128) + (set! (-> v1-6 2) 128) + (set! (-> v1-6 3) 128) + ) + (set! (-> gp-0 scale-x) 1.0) + (set! (-> gp-0 scale-y) 1.0) + (when (and s5-0 (-> gp-0 tid)) + (let ((s4-0 (current-time))) + (until (time-elapsed? s4-0 (seconds 3)) + (let ((f0-2 1.0)) + (cond + ((< f30-0 1.0) + (set! f0-2 f30-0) + ) + ((< 2.0 f30-0) + (set! f0-2 (- 3.0 f30-0)) + ) + ) + (set! (-> gp-0 color w) (the int (* 128.0 f0-2))) + ) + (with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-pris2) + ) + (draw gp-0 s2-0 s5-0 #f) + ) + (if (not (paused?)) + (+! f30-0 (seconds-per-frame)) + ) + (suspend) + ) + ) + ) + ) + (none) + ) + :name "logo-naughtydog" + :to self + ) + (none) + ) + ) + ) + (496 + (part-tracker + "group-drop-dust-trail" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 496 540) + ) + ) + (520 + (apply + ,(lambda :behavior scene-player + () + (process-spawn-function + process + (lambda :behavior scene-player + () + (logclear! (-> self mask) (process-mask pause)) + (let ((gp-0 (new 'stack 'hud-sprite)) + (s5-0 (new 'stack 'hud-sprite)) + (s4-0 (level-get *level* 'inttitle)) + (f30-0 0.0) + ) + (set! (-> gp-0 flags) (hud-sprite-flags hsf3)) + (set! (-> gp-0 scale-x) 0.85) + (set! (-> gp-0 scale-y) 0.85) + (let ((v1-8 (-> gp-0 color-ptr))) + (set! (-> v1-8 0) 128) + (set! (-> v1-8 1) 128) + (set! (-> v1-8 2) 128) + (set! (-> v1-8 3) 128) + ) + (scf-get-territory) + (set-vector! (-> gp-0 pos) 256 188 #xffffff 0) + (set! (-> gp-0 tid) (the-as texture-id (get-texture JakIII inttitle-minimap))) + (set! (-> s5-0 tid) (the-as texture-id #f)) + (when (and s4-0 (-> gp-0 tid)) + (let ((s3-0 (current-time))) + (until (time-elapsed? s3-0 (seconds 4.33)) + (let ((f0-2 1.0)) + (cond + ((< f30-0 0.5) + (set! f0-2 (* 2.0 f30-0)) + ) + ((< 3.83 f30-0) + (set! f0-2 (* 2.0 (- 4.33 f30-0))) + ) + ) + (set! (-> gp-0 color w) (the int (* 128.0 f0-2))) + (set! (-> s5-0 color w) (the int (* 128.0 f0-2))) + ) + (with-dma-buffer-add-bucket ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-pris2) + ) + (draw gp-0 s1-0 s4-0 #f) + (if (-> s5-0 tid) + (draw s5-0 s1-0 s4-0 #f) + ) + ) + (if (not (paused?)) + (+! f30-0 (seconds-per-frame)) + ) + (suspend) + ) + ) + ) + ) + (none) + ) + :name "logo-title" + :to self + ) + (none) + ) + ) + ) + (650 (apply ,(lambda :behavior scene-player + () + (if (not (-> *setting-control* user-current subtitle)) + (process-spawn-function + process + (lambda :behavior scene-player + () + (talker-spawn-func (-> *talker-speech* 61) self (target-pos 0) (the-as region #f)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 5)) + (if (cpad-pressed? 0 square) + (return #f) + ) + (suspend) + ) + ) + (none) + ) + :to self + ) + ) + (none) + ) + ) + ) + (651 + (part-tracker + "group-drop-dust-landing" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 651 790) + ) + ) + (721 + (part-tracker + "group-drop-thrusters-powerdown" + entity + "air-train-fma" + joint + "thruster_l" + track + #t + duration + (frame-range 721 800) + ) + (part-tracker + "group-drop-thrusters-powerdown" + entity + "air-train-fma" + joint + "thruster_r" + track + #t + duration + (frame-range 721 800) + ) + ) + (822 + (part-tracker + "group-drop-handcuff-light" + entity + "handcuffs" + joint + "light" + track + #t + duration + (frame-range 0 2248) + ) + ) + (2360 + (part-tracker + "group-drop-beacon-glow" + entity + "beacon" + joint + "glow" + track + #t + duration + (seconds (new 'static 'bfloat :data 49.2)) + ) + ) + (2497 + (part-tracker + "group-drop-thrusters" + entity + "air-train-fma" + joint + "thruster_l" + track + #t + duration + (frame-range 2497 2690) + ) + (part-tracker + "group-drop-thrusters" + entity + "air-train-fma" + joint + "thruster_r" + track + #t + duration + (frame-range 2497 2690) + ) + ) + (2600 + (part-tracker + "group-drop-dust-takeoff" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 2600 2760) + ) + ) + (2700 + (part-tracker + "group-drop-dust-cloud" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 2700 2701) + ) + ) + (2812 + (part-tracker + "group-drop-pecker-dustoff" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 2812 2813) + ) + ) + (2817 + (part-tracker + "group-drop-pecker-dustoff" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 2817 2818) + ) + ) + (2825 + (part-tracker + "group-drop-pecker-dustoff" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 2825 2826) + ) + ) + (2838 + (part-tracker + "group-drop-pecker-dustoff" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 2838 2839) + ) + ) + (3500 + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 1.4992504 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 + (send-event *time-of-day* 'change 'ratio (float 1)) + (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + (kill-current-talker '() '() 'die) + (kill-by-type talker *active-pool*) + (kill-current-talker '() '(daxter voicebox message) 'exit) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(151 + 201 + 361 + 496 + 651 + 721 + 821 + 891 + 1001 + 1096 + 1206 + 1291 + 1403 + 1481 + 1566 + 1676 + 1741 + 1866 + 1901 + 1936 + 2051 + 2111 + 2161 + 2221 + 2286 + 2341 + 2411 + 2451 + 2496 + 2546 + 2586 + 2641 + 2691 + 2771 + 2841 + 2936 + 3016 + 3126 + 3201 + 3258 + 3551 + 3436 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((821 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((821 max)) + :scissor-frames '() + :shadow-frames '((821 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'introcst + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((821 2411) (2451 2691)) + :scissor-frames '() + :shadow-frames '((821 2641)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "veger-highres" + :level 'introcst + :art-group "skel-veger-highres" + :prefix "" + :draw-frames '((821 2161) (2221 2691)) + :scissor-frames '() + :shadow-frames '((821 2641)) + :cloth-reset-frames '((1840 1950) 2200 2385) + :cloth-commands '(((2493 2499) set-flags local-space)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'introcst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((821 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "crimson-guard-highres" + :level 'introcst + :art-group "skel-crimson-guard-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((821 2641)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "crimson-guard-highres" + :level 'introcst + :art-group "skel-crimson-guard-highres" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((821 2641)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "air-train-fma" + :level 'introcst + :art-group "skel-air-train-fma" + :prefix "" + :draw-frames '((min 1480) (1566 1676) (1741 1901) (1936 2161) (2221 2691)) + :scissor-frames '((2586 2641)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "beacon" + :level 'introcst + :art-group "skel-beacon" + :prefix "" + :draw-frames '((2286 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "handcuffs" + :level 'introcst + :art-group "skel-handcuffs" + :prefix "" + :draw-frames '((821 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-start" + :end-point "title-restart" + :borrow '((wasintro 0 inttitle special)) + :sfx-volume 0.75 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "intro-lost" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-110" + :art-group "scenecamera" + :anim "intro-lost" + :parts 7 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 10)) + (apply + ,(lambda :behavior scene-player + () + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (set-filter-color! 1.25 1.25 1.25) + (none) + ) + ) + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'borrow '((wasintro 0 intpalrf special)) 0.0 0) + (apply-settings *setting-control*) + (none) + ) + ) + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 1.4992504 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (1 + (part-tracker + "group-lost-desert-heathaze" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 1 179) + ) + ) + (181 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 181 183) + ) + ) + (334 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 334 336) + ) + ) + (345 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 345 347) + ) + ) + (455 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 455 457) + ) + ) + (650 + (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (set! (-> *display* force-sync) (the-as uint 180)) + (persist-with-delay *setting-control* 'blur-a (seconds 4) 'blur-a 'abs 0.8 0) + (sound-play "trans1") + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + (want-display 'freehq 'special) + (save) + ) + (735 + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 + (send-event *time-of-day* 'change 'ratio (float 1)) + (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(71 208 274 354 444 497 559 641) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'introcst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-start" + :end-point "title-restart" + :borrow '((wasintro 0 intpalrf special)) + :sfx-volume 0.75 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "intro-ffhq" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-98" + :art-group "scenecamera" + :anim "intro-ffhq" + :parts 8 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 19)) + (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + (want-display 'wasintro '#f) + (want-display 'freehq 'display) + ) + (900 + (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (set! (-> *display* force-sync) (the-as uint 150)) + (persist-with-delay *setting-control* 'blur-a (seconds 3) 'blur-a 'abs 0.8 0) + (sound-play "trans2") + ) + (none) + ) + ) + (want-display 'wasintro 'special) + (save) + ) + (955 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 (send-event *time-of-day* 'change 'ratio (float 1)) (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(126 216 291 401 476 546 611 706 771 861) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'ltorn + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'introcst + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'introcst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "freehq-intro" + :end-point "title-restart" + :borrow '((wasintro 0 intpalrf special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "intro-tired" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-110" + :art-group "scenecamera" + :anim "intro-tired" + :parts 7 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 8)) + (apply + ,(lambda :behavior scene-player + () + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (set-filter-color! 1.25 1.25 1.25) + (none) + ) + ) + (want-display 'freehq '#f) + (want-display 'wasintro 'display) + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (1 + (part-tracker + "group-tired-desert-heathaze" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 1 100) + ) + ) + (2 + (part-tracker + "group-tired-desert-heathaze" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-range 2 360) + ) + (want-load 'introcst 'wasintro 'intpfall) + (want-display 'wasintro 'display) + ) + (120 + (send-event *time-of-day* 'change 'hour (int 10)) + (apply ,(lambda :behavior scene-player () (set-filter-color! 1.0 1.0 1.0) (none))) + ) + (220 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 220 222) + ) + ) + (250 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 250 252) + ) + ) + (287 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 287 289) + ) + ) + (293 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 293 295) + ) + ) + (330 + (part-tracker + "group-tired-desert-heathaze" + entity + "particleman" + joint + "particleK" + track + #f + duration + (frame-range 330 450) + ) + ) + (400 + (part-tracker + "group-tired-desert-heathaze" + entity + "particleman" + joint + "particleL" + track + #f + duration + (frame-range 400 550) + ) + ) + (445 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 445 447) + ) + ) + (557 (want-display 'intpfall 'special) (save)) + (561 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleG" + track + #t + duration + (frame-range 561 563) + ) + ) + (563 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleH" + track + #t + duration + (frame-range 563 565) + ) + ) + (566 + (part-tracker + "group-desert-impact-dust" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 566 568) + ) + ) + (585 (send-event "jak-highres" 'shadow-mask 4) (send-event "jak-highres" 'shadow-values 2816)) + (625 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (set! (-> *display* force-sync) (the-as uint 215)) + (persist-with-delay *setting-control* 'blur-a (seconds 5.167) 'blur-a 'abs 0.8 0) + (sound-play "trans3") + ) + (none) + ) + ) + ) + (745 + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 + (send-event "jak-highres" 'shadow-mask 0) + (send-event "jak-highres" 'shadow-values 0) + (send-event *time-of-day* 'change 'ratio (float 1)) + (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(120 391 465 557 586) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'introcst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-tired" + :end-point "title-restart" + :borrow '((wasintro 0 intpalrf special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "intro-palace" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-103" + :art-group "scenecamera" + :anim "intro-palace" + :parts 34 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 18)) + (apply ,(lambda :behavior scene-player + () + (let ((v1-1 (level-get *level* 'wasintro))) + (if v1-1 + (set! (-> v1-1 info fog-mult) 1.0) + ) + ) + (none) + ) + ) + (want-display 'wasintro 'special) + (want-display 'intpfall 'display) + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'borrow '((wasintro 0 intpalrf display)) 0.0 0) + (apply-settings *setting-control*) + (none) + ) + ) + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 5.988024 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (176 + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'borrow '((wasintro 0 #f #f)) 0.0 0) + (apply-settings *setting-control*) + (set! (-> ctyfarma memory-mode) (level-memory-mode small-center)) + (none) + ) + ) + (want-load 'introcst 'ctyfarma 'intpfall) + ) + (1 + (part-tracker + "group-hellcat-thruster-little-trail" + entity + "particleman" + joint + "particleX" + track + #t + duration + (frame-range 1 402) + ) + ) + (175 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 175 382) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 175 382) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 175 382) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 0 382) + ) + ) + (181 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (185 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (187 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (191 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (195 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (197 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (201 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (204 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (205 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (209 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (213 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (219 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (220 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (223 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (229 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (231 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (233 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (237 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (243 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (245 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (247 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (248 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (253 + (send-event "ashelin-highres" 'shadow-mask 16) + (send-event "ashelin-highres" 'shadow-values 655360) + (send-event "torn-highres" 'shadow-mask 16) + (send-event "torn-highres" 'shadow-values 655360) + (send-event "hellcat-movie" 'shadow-mask 16) + (send-event "hellcat-movie" 'shadow-values 655360) + ) + (291 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (321 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (327 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (344 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (328 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (333 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (349 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (351 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (361 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (365 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (367 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (368 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (371 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (372 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (380 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (382 + (send-event "ashelin-highres" 'shadow-mask 0) + (send-event "torn-highres" 'shadow-mask 0) + (send-event "hellcat-movie" 'shadow-mask 0) + ) + (383 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (387 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (395 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (399 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (401 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (403 + (part-tracker + "group-palace-hellcat-explode" + entity + "particleman" + joint + "particleX" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (406 + (part-tracker + "group-hellcat-thruster-fire-trail" + entity + "particleman" + joint + "particleX" + track + #t + duration + (frame-range 406 434) + ) + ) + (413 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (425 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (427 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (429 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (435 + (send-event "ashelin-highres" 'shadow-mask 16) + (send-event "torn-highres" 'shadow-mask 16) + (send-event "hellcat-movie" 'shadow-mask 16) + (part-tracker + "group-hellcat-thruster-little-trail" + entity + "particleman" + joint + "particleX" + track + #t + duration + (frame-range 435 850) + ) + ) + (501 + (send-event "ashelin-highres" 'shadow-mask 0) + (send-event "torn-highres" 'shadow-mask 0) + (send-event "hellcat-movie" 'shadow-mask 0) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 501 596) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 501 596) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 501 596) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 501 596) + ) + ) + (505 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (506 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (507 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (509 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (515 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (517 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (527 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (531 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (537 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (539 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (550 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (551 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (555 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (563 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (565 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (571 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (573 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (574 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (583 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (589 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (591 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (607 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (615 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (617 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (627 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (634 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (643 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (649 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (657 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (663 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (669 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (670 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (683 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (685 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (691 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (698 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (709 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (719 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (733 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (734 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (735 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (745 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (748 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (755 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (757 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (765 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (776 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (789 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (795 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (807 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (813 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (823 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (833 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (839 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (853 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (863 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (865 (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 865 962) + ) + ) + (869 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (871 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (876 (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 876 957) + ) + ) + (881 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (887 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (895 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (911 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (913 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (931 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (932 (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleK" + track + #t + duration + (frame-range 932 962) + ) + ) + (933 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (950 + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 950 963) + ) + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 950 965) + ) + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleL" + track + #t + duration + (frame-range 950 982) + ) + ) + (953 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (955 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (956 (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-c" + joint + "bd" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (957 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "ba" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bb" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bc" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bd" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bf" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "be" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bg" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (962 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (963 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (964 + (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-c" + joint + "bd" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (965 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "as" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "at" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "au" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "av" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "aw" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (967 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleD" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (971 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (979 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (982 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (985 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (987 + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (991 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (994 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1000 + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 1000 1040) + ) + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 1000 1037) + ) + ) + (1009 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1011 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1021 (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-d" + joint + "bs" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1027 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1031 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1040 (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-b" + joint + "t" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1041 (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-c" + joint + "bd" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1042 + (part-tracker + "group-ctypal-palace-break-explode-small" + entity + "ctypal-palace-break-a" + joint + "r" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-a" + joint + "s" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "t" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "u" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "v" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "w" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "x" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "y" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "z" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "zz" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "aa" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "ab" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "ac" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "ad" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "ae" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-b" + joint + "af" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1048 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1053 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 1053 1880) + ) + ) + (1057 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1068 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1075 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1081 (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 1081 1117) + ) + ) + (1083 + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 1083 1135) + ) + (part-tracker + "group-palace-missile" + entity + "particleman" + joint + "particleK" + track + #t + duration + (frame-range 1083 1162) + ) + ) + (1089 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1090 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleD" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1095 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1109 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1117 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1122 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1127 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1128 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1133 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1134 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleD" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1135 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "ax" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "ay" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "az" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-explode-small" + entity + "ctypal-palace-break-c" + joint + "ay" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1137 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1139 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleG" + track + #t + duration + (frame-range 1139 1880) + ) + ) + (1141 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1154 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 1154 1880) + ) + ) + (1155 + (part-tracker + "group-palace-missile-explode" + entity + "ctypal-palace-break-d" + joint + "bp" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1156 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1157 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1160 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1162 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1163 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bk" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bl" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1169 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1174 (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bj" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1177 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1179 + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bh" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-ctypal-palace-break-trailer-small" + entity + "ctypal-palace-break-c" + joint + "bi" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1183 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1187 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1193 (part-tracker + "group-palace-small-explode" + entity + "particleman" + joint + "particleD" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1199 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1208 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1215 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1219 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1223 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1229 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1234 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1235 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1247 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1263 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1273 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1275 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1289 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1296 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1301 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1307 (part-tracker + "group-ctypal-palace-break-explode-dust" + entity + "ctypal-palace-break-d" + joint + "cc" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1310 (part-tracker + "group-palace-huge-explosion" + entity + "ctypal-palace-break-d" + joint + "bw" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1313 (part-tracker + "group-palace-small-explode" + entity + "particleman" + joint + "particleC" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1325 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1345 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1345 1560) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1345 1560) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1345 1560) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1345 1560) + ) + ) + (1349 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1362 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1367 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1373 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 1373 1880) + ) + ) + (1377 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1389 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1396 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1401 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1409 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1423 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1441 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1461 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1487 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1535 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleQ" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1551 + (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleD" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (kill "ctypal-ctyfarma-1") + (want-display 'ctyfarma 'display) + ) + (1552 + (part-tracker + "group-ctypal-support-break-trailer" + entity + "particleman" + joint + "particleT" + track + #t + duration + (frame-range 1552 1587) + ) + (part-tracker + "group-ctypal-support-break-trailer" + entity + "particleman" + joint + "particleU" + track + #t + duration + (frame-range 1552 1587) + ) + (part-tracker + "group-ctypal-support-break-trailer" + entity + "particleman" + joint + "particleV" + track + #t + duration + (frame-range 1552 1587) + ) + ) + (1576 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1585 + (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1586) + (1587 (part-tracker + "group-palace-missile-explode" + entity + "particleman" + joint + "particleS" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1593 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1597 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1603 (part-tracker + "group-palace-tracer-fire" + entity + "particleman" + joint + "particleP" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1608 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1619 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1626 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1630 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1638 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1642 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1648 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1655 + (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 1655 2000) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1655 1710) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1655 1710) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1655 1710) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1655 1710) + ) + ) + (1665 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1670 (part-tracker + "group-palace-smoke-plume" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 1670 2000) + ) + ) + (1674 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1683 (part-tracker + "group-palace-dust-cloud-big" + entity + "particleman" + joint + "particleL" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1684 (part-tracker + "group-palace-flak" + entity + "particleman" + joint + "particleM" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (1705 (set! *artist-all-visible* #f)) + (1710 + (want-load 'introcst 'wasintro 'intpfall) + (want-display 'wasintro 'special) + (apply ,(lambda :behavior scene-player + () + (set-setting! 'borrow '((introcst 0 lwlandm special)) 0.0 0) + (apply-settings *setting-control*) + (none) + ) + ) + (save) + ) + (1784 + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1784 1933) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 1784 1880) + ) + (part-tracker + "group-hellcat-thrusters" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1784 1933) + ) + (part-tracker + "group-hellcat-thruster-trail" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 1784 1880) + ) + ) + (1940 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (set! (-> *display* force-sync) (the-as uint 150)) + (persist-with-delay *setting-control* 'blur-a (seconds 3) 'blur-a 'abs 0.8 0) + (sound-play "trans4") + ) + (none) + ) + ) + ) + (1990 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 3.003003 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 (apply ,(lambda :behavior scene-player + () + (let ((v1-1 (level-get *level* 'wasintro))) + (if v1-1 + (set! (-> v1-1 info fog-mult) 100.0) + ) + ) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + (set! (-> ctyfarma memory-mode) (level-memory-mode small-edge)) + (when (-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (set-filter-color! 1.0 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(175 253 382 434 501 596 670 715 787 952 1000 1037 1086 1239 1308 1344 1411 1551 1705 1875) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((175 434) (501 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min 1551) (1705 max)) + :scissor-frames '() + :shadow-frames '((175 434) (501 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'ltorn + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'introcst + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min 1551) (1705 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'introcst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min 1551) (1705 max)) + :scissor-frames '() + :shadow-frames '((175 434) (501 715) (787 max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hellcat-movie" + :level 'intpfall + :art-group "skel-hellcat-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hellcat-lowres-fma" + :level 'intpfall + :art-group "skel-hellcat-lowres-fma" + :prefix "" + :draw-frames '((min 952)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "palmpilot" + :level 'intpfall + :art-group "skel-palmpilot" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break" + :level 'intpfall + :art-group "skel-ctypal-palace-break" + :prefix "" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1551 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-a" + :level 'intpfall + :art-group "skel-ctypal-palace-break-a" + :prefix "a-" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1551 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-b" + :level 'intpfall + :art-group "skel-ctypal-palace-break-b" + :prefix "b-" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1705 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-c" + :level 'intpfall + :art-group "skel-ctypal-palace-break-c" + :prefix "c-" + :draw-frames '((501 596) (952 1000) (1037 1239)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-d" + :level 'intpfall + :art-group "skel-ctypal-palace-break-d" + :prefix "d-" + :draw-frames '((501 596) (952 1000) (1020 1239) (1308 1411) (1705 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-palace-break-e" + :level 'intpfall + :art-group "skel-ctypal-palace-break-e" + :prefix "e-" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1551 1600) (1705 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "a-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "d-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-cable-break" + :level 'intpfall + :art-group "skel-ctypal-cable-break" + :prefix "e-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "a-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "d-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-support-break" + :level 'intpfall + :art-group "skel-ctypal-support-break" + :prefix "e-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-rail" + :level 'intpfall + :art-group "skel-ctypal-rail" + :prefix "" + :draw-frames '((175 253) (382 434) (596 670) (715 952) (1000 1037) (1239 1308) (1411 1551)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ctypal-base-break" + :level 'intpfall + :art-group "skel-ctypal-base-break" + :prefix "" + :draw-frames '((501 596) (952 1000) (1037 1239) (1308 1411) (1620 1705)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-palace" + :end-point "title-restart" + :borrow '((wasintro 0 intpalrf special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "intro-rescue" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf7) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-110" + :art-group "scenecamera" + :anim "intro-rescue" + :parts 8 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 18)) + (apply + ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity 0) + (set-filter-color! 1.125 1.125 1.125) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (none) + ) + ) + (want-display 'wasintro 'display) + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'ambient-volume 'rel 1.0 0) + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 3.003003 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + (set-cloth-ground-height "damus-highres" 98304) + ) + (1 + (part-tracker + "group-desert-blowing-dust" + entity + "particleman" + joint + "particleI" + track + #f + duration + (frame-range 1 550) + ) + (part-tracker + "group-desert-blowing-dust" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-range 1 550) + ) + ) + (2 (want-load 'introcst 'wasintro 'title) (want-display 'wasintro 'display)) + (270 + (part-tracker "group-drop-beacon-glow" entity "beacon" joint "glow" track #t duration (frame-range 270 432)) + ) + (448 + (part-tracker + "group-desert-impact-dust-blow" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 448 449) + ) + ) + (473 + (part-tracker + "group-desert-impact-dust-blow" + entity + "particleman" + joint + "particleE" + track + #f + duration + (frame-range 473 474) + ) + (want-display 'title 'display) + (save) + ) + (500 + (setting-reset sfx-volume mode 'abs value (new 'static 'bfloat :data 1.0)) + (send-event *time-of-day* 'change 'ratio (float 1)) + (apply + ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intro #t) + (set-setting! 'fog-special-interp-targ #f 1.0 0) + (set-setting! 'fog-special-interp-rate #f 0.21 0) + (apply-settings *setting-control*) + (none) + ) + ) + ) + (600 + (setting-reset letterbox-speed mode 'abs value (new 'static 'bfloat :data 0.5)) + (setting-reset letterbox mode 'abs value (new 'static 'bfloat)) + ) + (680 + (apply + ,(lambda :behavior scene-player + () + (set-setting! 'fog-special-interp-targ #f 2.0 0) + (set-setting! 'fog-special-interp-rate #f 4.0 0) + (persist-with-delay + *setting-control* + 'fog-special-interp-targ + (seconds 1000) + 'fog-special-interp-targ + #f + 2.0 + 0 + ) + (apply-settings *setting-control*) + (none) + ) + ) + ) + (678 (apply ,(lambda :behavior scene-player + () + (if (not (-> self aborted?)) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (10000 + (send-event *time-of-day* 'change 'ratio (float 1)) + (task-close! "city-start-introduction") + (apply + ,(lambda :behavior scene-player + () + (cond + ((scene-select?) + (persist-with-delay *setting-control* 'fog-special-interp-targ 0 'fog-special-interp-targ #f 2.0 0) + (remove-setting! 'fog-special-interp-targ) + (remove-setting! 'fog-special-interp-rate) + ) + ((-> self aborted?) + (disable *screen-filter*) + (set-blackout-frames (seconds 0.2)) + (remove-setting! 'allow-blackout) + ) + (else + (set! (-> self end-point) "title-from-intro") + (set! (-> self blackout-end) #f) + ) + ) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (none) + ) + ) + ) + ) + :cut-list '(251 296 347 431 498) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'introcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'introcst + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'introcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "damus-highres" + :level 'introcst + :art-group "skel-damus-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((296 347)) + :shadow-frames '((min max)) + :cloth-reset-frames '((0 5)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kleever-highres" + :level 'introcst + :art-group "skel-kleever-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '((0 5)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "wlander-male" + :level 'lwlandm + :art-group "skel-wlander-male" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :draw-seg #x3fe0000 + :no-draw-seg #xffffffffffffffff + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'introcst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "beacon" + :level 'introcst + :art-group "skel-beacon" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasintro-rescue" + :end-point "title-restart" + :borrow '((introcst 0 lwlandm display)) + :sfx-volume -1.0 + :ambient-volume 1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc b/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc index d60dc966e3..9420d018b1 100644 --- a/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc @@ -1495,9 +1495,9 @@ ) ;; definition for method 119 of type egg-spider -;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-defaults! ((this egg-spider) (arg0 enemy-info)) - (set! (-> (the-as nav-enemy-info arg0) nav-mesh) *default-nav-mesh*) +;; WARN: Return type mismatch int vs object. +(defmethod init-enemy-defaults! ((this egg-spider) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) (t9-0 this arg0) ) @@ -1523,7 +1523,6 @@ (set! (-> this enemy-info callback-info) *physics-nav-callback-info*) (nav-enemy-method-181 this) 0 - (none) ) ;; definition for method 120 of type egg-spider @@ -1972,7 +1971,3 @@ (spider-manager-method-21 this) (go-idle this) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/palace/cable/palcab-part_REF.gc b/test/decompiler/reference/jak3/levels/palace/cable/palcab-part_REF.gc new file mode 100644 index 0000000000..6a7468b105 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/palace/cable/palcab-part_REF.gc @@ -0,0 +1,1093 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-palcab-lights + :id 1153 + :flags (sp8) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4064 :fade-after (meters 80) :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 4065 :fade-after (meters 100) :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 4064 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 20.0 4.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 5120.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4065 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0 32.0) + (:a 8.0) + (:omega (degrees 2261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 5120.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-1 + :id 1154 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 350 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-2 + :id 1155 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 405 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-3 + :id 1156 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 485 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-4 + :id 1157 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 825 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-5 + :id 1158 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 255 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-6 + :id 1159 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 640 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-7 + :id 1160 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 750 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-8 + :id 1161 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 60 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-9 + :id 1162 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 885 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-10 + :id 1163 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 465 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-11 + :id 1164 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 595 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-12 + :id 1165 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 90 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-13 + :id 1166 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 690 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-14 + :id 1167 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 165 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-15 + :id 1168 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 535 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-spark-rain-16 + :id 1169 + :flags (sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4067 :fade-after (meters 160) :falloff-to (meters 160) :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017) :offset 325 :binding 4066) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + (sp-item 4066 :flags (sp1 sp2 sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 4066 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 2.0 4.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.06) (meters 0.03)) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0 128.0) + (:a 128.0) + (:omega (degrees 0.018) (degrees 0.01125)) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:fade-g -2.55 -2.55) + (:fade-b -8.0) + (:fade-a -0.32 -0.64) + (:friction 0.8 0.02) + (:timer (seconds 0.335) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 80)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4067 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -2) (meters 4)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 0.25)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 128.0) + (:b 128.0 64.0) + (:a 96.0 16.0) + (:omega (degrees 3608.9998)) + (:scalevel-x (meters 0.08)) + (:scalevel-y :copy scalevel-x) + (:fade-g -6.375) + (:fade-b -13.066667) + (:fade-a -2.8) + (:timer (seconds 0.05) (seconds 0.03)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-birds + :id 1170 + :bounds (static-bspherem 0 8 0 128) + :parts ((sp-item 4070 :fade-after (meters 600) :flags (sp1 sp3) :binding 4068) + (sp-item 4070 :fade-after (meters 600) :flags (sp1 sp3) :binding 4068) + (sp-item 4070 :fade-after (meters 600) :flags (sp1 sp3) :binding 4068) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + (sp-item 4068 :flags (sp2 sp3) :binding 4069) + (sp-item 4069 :flags (is-3d sp2)) + ) + ) + +;; definition for function palcab-bird-bob-func +;; WARN: Return type mismatch int vs none. +(defun palcab-bird-bob-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (set! (-> arg2 y) + (+ (-> arg1 key proc root trans y) (* -2048.0 (sin (* 218.45334 (the float (mod (current-time) 300)))))) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 4070 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-random-next-time) + (:num 1.0) + (:x (meters -15) (meters 30)) + (:y (meters 0) (meters 16)) + (:z (meters -15) (meters 30)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 199.98) + (:func 'palcab-bird-bob-func) + ) + ) + +;; definition for function sparticle-palcab-bird-moon +;; WARN: Return type mismatch int vs none. +(defun sparticle-palcab-bird-moon ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (set! (-> arg2 conerot z) (the float (sar (shl (the int (+ -16384.0 (-> arg1 omega))) 48) 48))) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 4068 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-copy-omega-to-z) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 60) (meters 60)) + (:scale-x (meters 0)) + (:rot-z (degrees 0)) + (:r 32.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.00074074074) (meters 0.00074074074)) + (:vel-z (meters 0)) + (:scalevel-x (meters -0.04)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch)) + (:func 'sparticle-palcab-bird-moon) + (:next-time (seconds 0.665)) + (:next-launcher 4071) + ) + ) + +;; failed to figure out what this is: +(defpart 4071 + :init-specs ((:scale-x (meters 8)) + (:scalevel-x (meters -0.08)) + (:timer (seconds 2)) + (:next-time (seconds 0.335)) + (:next-launcher 4072) + ) + ) + +;; failed to figure out what this is: +(defpart 4072 + :init-specs ((:scale-x (meters 0)) + (:scalevel-x (meters -0.04)) + (:timer (seconds 2)) + (:next-time (seconds 0.665)) + (:next-launcher 4071) + ) + ) + +;; failed to figure out what this is: +(defpart 4069 + :init-specs ((:texture (seagull-wing intpfall-sprite)) + (:birth-func 'birth-func-copy2-rot-color) + (:num 2.0) + (:scale-x (meters 5)) + (:scale-y (meters 2)) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-stadium-lights + :id 1171 + :flags (sp8) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4073 :flags (sp6) :hour-mask #b111111111110000000) + (sp-item 4074 :flags (sp6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 4073 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 48.5) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4074 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 96) (meters 0.1)) + (:rot-x (degrees 78.75)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0 255.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-palace-fire + :id 1172 + :flags (sp8) + :bounds (static-bspherem 0 2 0 5) + :parts ((sp-item 4075 :fade-after (meters 1200) :falloff-to (meters 1200)) + (sp-item 4076 :fade-after (meters 800) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 4075 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 6) (meters 3)) + (:scale-y (meters 6) (meters 3)) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 32.0 32.0) + (:vel-x (meters 0) (meters -0.0033333334)) + (:scalevel-x (meters -0.009375)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -0.1 -0.1) + (:accel-y (meters 0.0016666667) (meters 0.0013333333)) + (:timer (seconds 0.535) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpart 4076 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.5) + (:y (meters 4)) + (:scale-x (meters 24) (meters 0.5)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 64.0 64.0) + (:b 0.0 32.0) + (:a 20.0 16.0) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.7111111) + (:fade-a -1.2) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-misc-citylights-red-1 + :id 1173 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4077 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-misc-citylights-red-2 + :id 1174 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4077 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-misc-citylights-red-3 + :id 1175 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4077 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 4077 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 8)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 32.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.1)) + (:scalevel-y (meters 0.08)) + (:fade-a 0.16) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 4078) + ) + ) + +;; failed to figure out what this is: +(defpart 4078 + :init-specs ((:scale-y (meters 16)) + (:a 32.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 4079) + ) + ) + +;; failed to figure out what this is: +(defpart 4079 + :init-specs ((:scalevel-x (meters -0.1)) + (:scalevel-y (meters -0.08)) + (:fade-a -0.16) + (:next-time (seconds 0.335)) + (:next-launcher 4080) + ) + ) + +;; failed to figure out what this is: +(defpart 4080 + :init-specs ((:scale-y (meters 8)) (:a 16.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-misc-citylights-blue-1 + :id 1176 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4081 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-misc-citylights-blue-2 + :id 1177 + :flags (sp0) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4081 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400 :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 4081 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 8)) + (:r 0.0) + (:g 128.0 32.0) + (:b 255.0) + (:a 32.0) + (:omega (degrees 67515.75)) + (:scalevel-x (meters 0.1)) + (:scalevel-y (meters 0.08)) + (:fade-a 0.16) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 4078) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-cable-lights + :id 1178 + :flags (sp8) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4082 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpart 4082 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 12)) + (:rot-x (degrees 56.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 64.0) + (:b 64.0) + (:a 20.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-strip-glows + :id 1179 + :flags (sp8) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4083 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4083 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 48) (meters 4)) + (:rot-x (degrees 371.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 64.0) + (:b 64.0) + (:a 5.0 20.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 411648.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-fiery-smokestack + :id 1180 + :flags (sp8) + :bounds (static-bspherem 0 0 -10 24) + :parts ((sp-item 4084 :fade-after (meters 1500) :falloff-to (meters 1500)) + (sp-item 4085 :fade-after (meters 2000) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 4085 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 32) (meters 8)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 8.0) + (:omega (degrees 45018)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 6144.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4084 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 8) (meters 8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:accel-x (meters -0.0016666667) (meters -0.00083333335)) + (:accel-y (meters 0.00033333333) (meters 0.00016666666)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 4086) + ) + ) + +;; failed to figure out what this is: +(defpart 4086 + :init-specs ((:fade-r -0.255 -0.255) (:fade-g :copy fade-r) (:fade-b :copy fade-g) (:fade-a -0.032 -0.032)) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-mountain-glows + :id 1181 + :flags (sp8) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4087 :fade-after (meters 3000) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4087 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 128)) + (:rot-x (degrees 56.25)) + (:scale-y (meters 96)) + (:r 128.0 32.0) + (:g 255.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-cable-blue-rotaters + :id 1182 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4088 :flags (is-3d sp1 sp7) :period (seconds 6) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 4088 + :init-specs ((:texture (palcab-blue-rotaters intpfall-sprite)) + (:num 1.0) + (:scale-x (meters 24)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:rotvel-y (degrees 0.2)) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 left-multiply-quat)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-city-glows-1 + :id 1183 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4089 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpart 4089 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 8) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 64.0) + (:b 64.0) + (:a 32.0 16.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-city-glows-2 + :id 1184 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4090 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpart 4090 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 8) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0 64.0) + (:b 0.0) + (:a 32.0 16.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-city-glows-3 + :id 1185 + :flags (sp8) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4091 :fade-after (meters 3000) :flags (sp6) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpart 4091 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 8) (meters 2)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 0.0 64.0) + (:b 128.0 64.0) + (:a 32.0 32.0) + (:omega (degrees 67515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-dest-smoke + :id 1186 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4092 :fade-after (meters 3000) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-dest-fire + :id 1187 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4092 :fade-after (meters 600) :falloff-to (meters 800) :flags (sp7)) + (sp-item 4093 :fade-after (meters 600) :falloff-to (meters 800) :flags (sp7)) + (sp-item 4094 :fade-after (meters 600) :falloff-to (meters 800) :flags (sp7)) + (sp-item 4095 :fade-after (meters 600) :falloff-to (meters 800) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 4092 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.1) + (:z (meters 0) (meters 4)) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.042666666 -0.042666666) + (:accel-y (meters 0.0033333334)) + (:accel-z (meters 0) (meters 0.00066666666)) + (:friction 0.95) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4093 + :init-specs ((:texture (flame01 level-default-sprite)) + (:num 1.0 1.0) + (:y (meters -1)) + (:scale-x (meters 8) (meters 8)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-y (meters -0.0033333334) (meters 0.0016666667)) + (:scalevel-x (meters -0.016666668)) + (:fade-r 0.33333334) + (:fade-g -0.083333336) + (:fade-b -1.875) + (:fade-a 0.42666668) + (:accel-y (meters 0.00033333333) (meters 0.0023333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 4096) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 1) (meters 10)) + ) + ) + +;; failed to figure out what this is: +(defpart 4094 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:y (meters -1)) + (:scale-x (meters 7) (meters 7)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-y (meters -0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters -0.016666668)) + (:fade-r 0.33333334) + (:fade-g -0.083333336) + (:fade-b -1.875) + (:fade-a 0.42666668) + (:accel-y (meters 0.00033333333) (meters 0.005)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 4096) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 1) (meters 10)) + ) + ) + +;; failed to figure out what this is: +(defpart 4096 + :init-specs ((:scalevel-x (meters -0.016666668)) (:fade-a -0.425 -0.425)) + ) + +;; failed to figure out what this is: +(defpart 4095 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.4) + (:x (meters 1)) + (:y (meters 2)) + (:scale-x (meters 30) (meters 30)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 5.0 10.0) + (:omega (degrees 22520.25)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-dest-steam + :id 1188 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4097 :fade-after (meters 3000) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4097 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-z (meters 0.05)) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32 0.32) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.96 0.02) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 4098) + (:conerot-y (degrees -30) (degrees 60)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4098 + :init-specs ((:fade-a -0.053333335)) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-dest-fire-smoke + :id 1189 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4093 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 4094 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 4095 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 4092 :fade-after (meters 3000) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palcab-dest-white-eco + :id 1190 + :flags (sp0) + :bounds (static-bspherem 0 0 0 150) + :parts ((sp-item 4099 :fade-after (meters 300) :flags (is-3d)) (sp-item 4100 :fade-after (meters 600))) + ) + +;; failed to figure out what this is: +(defpart 4099 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:y (meters -10)) + (:scale-x (meters 100)) + (:rot-x (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 120.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4100 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.3) + (:y (meters 5)) + (:scale-x (meters 200)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:omega (degrees 22520.25)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/palace/roof/palroof-part_REF.gc b/test/decompiler/reference/jak3/levels/palace/roof/palroof-part_REF.gc new file mode 100644 index 0000000000..8ff053acce --- /dev/null +++ b/test/decompiler/reference/jak3/levels/palace/roof/palroof-part_REF.gc @@ -0,0 +1,427 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-palroof-window-large + :id 1146 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4048 :fade-after (meters 300) :flags (sp6)) (sp-item 4049 :flags (is-3d sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4048 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 12) (meters 0.1)) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 16.0 2.0) + (:omega (degrees 6763.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4049 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 4)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 6)) + (:r 96.0 16.0) + (:g :copy r) + (:b :copy g) + (:a 48.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palroof-window-small + :id 1147 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4050 :fade-after (meters 200) :flags (sp6)) (sp-item 4051 :flags (is-3d sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4050 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 5) (meters 0.1)) + (:r 255.0) + (:g 200.0) + (:b 128.0) + (:a 16.0 2.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4051 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:z (meters 0.05)) + (:scale-x (meters 1.5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 3.5)) + (:r 96.0 16.0) + (:g :copy r) + (:b :copy g) + (:a 48.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palroof-runoff-high + :id 1148 + :flags (sp4) + :bounds (static-bspherem 0 -12 0 24) + :parts ((sp-item 4052 :fade-after (meters 140) :falloff-to (meters 140) :flags (sp7)) + (sp-item 4053 :fade-after (meters 140) :falloff-to (meters 140) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palroof-runoff-med + :id 1149 + :flags (sp4) + :bounds (static-bspherem 0 -12 0 24) + :parts ((sp-item 4054 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4055 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palroof-runoff-low + :id 1150 + :flags (sp4) + :bounds (static-bspherem 0 -12 0 24) + :parts ((sp-item 4056 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4057 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4058 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 4059)) + ) + +;; failed to figure out what this is: +(defpart 4059 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 4058)) + ) + +;; failed to figure out what this is: +(defpart 4060 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.08) (meters 0.03)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 64.0 64.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.005) (meters -0.00066666666)) + (:friction 0.98) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 launch-along-z)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0) (seconds 0.33)) + (:next-launcher 41) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4061 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-omega-normal-orient) + (:num 0.5) + (:y (meters 0.2)) + (:scale-x (meters 0.75) (meters 0.25)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 64.0 32.0) + (:omega (degrees 0)) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.2) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 10 0 0 #x401800 #x403d00 #x400700 #x408200)) + (:func 'sparticle-texture-animate) + ) + ) + +;; definition for function check-drop-level-palroof-drop-userdata +;; INFO: Used lq/sq +(defun check-drop-level-palroof-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (when (< (-> arg2 rvec y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 rvec x) (-> arg1 user-float) (-> arg2 rvec z) 1.0) + (launch-particles (-> *part-id-table* 4060) s3-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 4061) s3-0) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +;; failed to figure out what this is: +(defpart 4052 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1712947.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + (:rotate-x (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4053 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1712947.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + (:rotate-x (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4054 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1698611.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + (:rotate-x (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4055 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1698611.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + (:rotate-x (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4056 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1671987.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-z (degrees -5) (degrees 10)) + (:rotate-x (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4057 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:z (meters -0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.013333334)) + (:accel-y (meters -0.006666667) (meters 0.00033333333)) + (:friction 0.93 0.02) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1671987.2) + (:func 'check-drop-level-palroof-drop-userdata) + (:next-time (seconds 0) (seconds 0.747)) + (:next-launcher 4058) + (:launchrot-x (degrees -30) (degrees 60)) + (:launchrot-z (degrees -30) (degrees 60)) + (:rotate-x (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palroof-lightning-pole + :id 1151 + :bounds (static-bspherem 0 -3.5 0 4) + :parts ((sp-item 4062 :fade-after (meters 160) :flags (sp6) :period (seconds 0.1) :length (seconds 0.05)) + (sp-item 4063 :fade-after (meters 160) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-palroof-lightning-pole-off + :id 1152 + :bounds (static-bspherem 0 -3.5 0 4) + :parts ((sp-item 4062 :fade-after (meters 80) :flags (sp6) :period (seconds 2.667) :length (seconds 1))) + ) + +;; failed to figure out what this is: +(defpart 4063 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 2.0) + (:y (meters -1.2) 6 (meters -1)) + (:scale-x (meters 1.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 3.6) (meters 0.1)) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 3615.75)) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4062 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 32.0 4.0) + (:omega (degrees 3615.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc b/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc index 462c4d2be0..0269d0b265 100644 --- a/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc @@ -148,7 +148,7 @@ ;; definition for method 23 of type jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-23 ((this jump-pad)) +(defmethod init-skel! ((this jump-pad)) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) (quaternion-copy! (-> this fan-quat) (-> this root quat)) (let ((a0-6 (-> this node-list data (get-fan-joint-idx this)))) @@ -170,7 +170,3 @@ ) (call-parent-method this arg0) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc index 7e4dfb814b..69144bbd1f 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc @@ -486,7 +486,7 @@ ;; definition for method 24 of type sew-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 ((this sew-jump-pad)) +(defmethod init-collision! ((this sew-jump-pad)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (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)) diff --git a/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc b/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc index 8ec5192811..f3f1cee5a6 100644 --- a/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc @@ -1185,9 +1185,9 @@ ) ;; definition for method 119 of type dm-mine-spider -;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-defaults! ((this dm-mine-spider) (arg0 enemy-info)) - (set! (-> (the-as nav-enemy-info arg0) nav-mesh) *default-nav-mesh*) +;; WARN: Return type mismatch int vs object. +(defmethod init-enemy-defaults! ((this dm-mine-spider) (arg0 nav-enemy-info)) + (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) (t9-0 this arg0) ) @@ -1215,7 +1215,6 @@ (set! (-> this enemy-info callback-info) *physics-nav-callback-info*) (nav-enemy-method-181 this) 0 - (none) ) ;; definition for method 120 of type dm-mine-spider diff --git a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc index 4608936aff..dd4b1c3e45 100644 --- a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc @@ -196,7 +196,7 @@ ;; definition for method 23 of type tpl-bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-23 ((this tpl-bouncer)) +(defmethod init-skel! ((this tpl-bouncer)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-bouncer" (the-as (pointer level) #f))) @@ -208,7 +208,7 @@ ;; definition for method 24 of type tpl-bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 ((this tpl-bouncer)) +(defmethod init-collision! ((this tpl-bouncer)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (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)) diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc index b3879b96f8..367221fc1f 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc @@ -1526,7 +1526,7 @@ ;; definition for method 23 of type vol-bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-23 ((this vol-bouncer)) +(defmethod init-skel! ((this vol-bouncer)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-vol-bouncer" (the-as (pointer level) #f))) @@ -1538,7 +1538,7 @@ ;; definition for method 24 of type vol-bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 ((this vol-bouncer)) +(defmethod init-collision! ((this vol-bouncer)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) diff --git a/test/decompiler/reference/jak3/levels/wascity/cty-attack-controller_REF.gc b/test/decompiler/reference/jak3/levels/wascity/cty-attack-controller_REF.gc new file mode 100644 index 0000000000..4a8034c74f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/cty-attack-controller_REF.gc @@ -0,0 +1,311 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function city-target-type->cty-faction +;; WARN: Return type mismatch int vs cty-faction. +(defun city-target-type->cty-faction ((arg0 city-target-type)) + (let ((v1-0 arg0)) + (the-as + cty-faction + (cond + ((or (= v1-0 (city-target-type guard-tazer)) + (= v1-0 (city-target-type guard-rifle)) + (= v1-0 (city-target-type guard-grenade)) + (= v1-0 (city-target-type unk1)) + (= v1-0 (city-target-type unk2)) + ) + (the-as cty-faction (cty-faction ff)) + ) + ((or (= v1-0 (city-target-type grunt)) (= v1-0 (city-target-type flitter)) (= v1-0 (city-target-type unknown))) + (the-as cty-faction (cty-faction mh)) + ) + ((or (= v1-0 (city-target-type roboguard)) + (= v1-0 (city-target-type turret)) + (= v1-0 (city-target-type spydroid)) + (= v1-0 (city-target-type roboguard-giant)) + ) + (the-as cty-faction (cty-faction kg)) + ) + (else + (the-as cty-faction (cty-faction invalid)) + ) + ) + ) + ) + ) + +;; definition for function city-target-type->traffic-object-type +;; WARN: Return type mismatch int vs traffic-type. +(defun city-target-type->traffic-object-type ((arg0 city-target-type)) + (let ((v1-0 arg0)) + (the-as + traffic-type + (cond + ((or (= v1-0 (city-target-type guard-tazer)) + (= v1-0 (city-target-type guard-rifle)) + (= v1-0 (city-target-type guard-grenade)) + ) + (the-as traffic-type (traffic-type guard-a)) + ) + ((= v1-0 (city-target-type grunt)) + (the-as traffic-type (traffic-type metalhead-grunt)) + ) + ((= v1-0 (city-target-type flitter)) + (the-as traffic-type (traffic-type metalhead-flitter)) + ) + ((= v1-0 (city-target-type unknown)) + (the-as traffic-type (traffic-type metalhead-predator)) + ) + ((or (= v1-0 (city-target-type roboguard)) (= v1-0 (city-target-type roboguard-giant))) + (the-as traffic-type (traffic-type roboguard)) + ) + ((= v1-0 (city-target-type turret)) + (the-as traffic-type (traffic-type flying-turret)) + ) + ((= v1-0 (city-target-type spydroid)) + (the-as traffic-type (traffic-type spydroid)) + ) + (else + (the-as traffic-type (traffic-type invalid0)) + ) + ) + ) + ) + ) + +;; definition for function symbol->city-target-type +;; WARN: Return type mismatch int vs city-target-type. +(defun symbol->city-target-type ((arg0 symbol)) + (let ((v1-0 arg0)) + (the-as city-target-type (cond + ((= v1-0 'roboguard) + (the-as city-target-type (city-target-type roboguard)) + ) + ((= v1-0 'roboguard-giant) + (the-as city-target-type (city-target-type roboguard-giant)) + ) + ((= v1-0 'guard-rifle) + (the-as city-target-type (city-target-type guard-rifle)) + ) + ((= v1-0 'guard-tazer) + (the-as city-target-type (city-target-type guard-tazer)) + ) + ((= v1-0 'guard-grenade) + (the-as city-target-type (city-target-type guard-grenade)) + ) + ((= v1-0 'turret) + (the-as city-target-type (city-target-type turret)) + ) + ((= v1-0 'spydroid) + (the-as city-target-type (city-target-type spydroid)) + ) + ((= v1-0 'flitter) + (the-as city-target-type (city-target-type flitter)) + ) + ((= v1-0 'grunt) + (the-as city-target-type (city-target-type grunt)) + ) + (else + (the-as city-target-type (city-target-type unknown)) + ) + ) + ) + ) + ) + +;; definition of type cty-attack-controller +(deftype cty-attack-controller (mission-squad-control) + ((guard-angry-hatred-info-index int8) + ) + ) + +;; definition for method 3 of type cty-attack-controller +(defmethod inspect ((this cty-attack-controller)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tattackers: ~A~%" (-> this attackers)) + (format #t "~1Tunused-list: ~A~%" (-> this unused-list)) + (format #t "~1Thatred-vals: ~A~%" (-> this hatred-vals)) + (format #t "~1Thatred-indices: ~A~%" (-> this hatred-indices)) + (format #t "~1Tattacker-cache: ~A~%" (-> this attacker-cache)) + (format #t "~1Ttarget-attacker: #~%" (-> this target-attacker)) + (format #t "~1Tmax-num-object-types: ~D~%" (-> this max-num-object-types)) + (format #t "~1Tguard-angry-hatred-info-index: ~D~%" (-> this guard-angry-hatred-info-index)) + (label cfg-4) + this + ) + +;; definition (perm) for symbol *cty-attack-controller*, type cty-attack-controller +(define-perm *cty-attack-controller* cty-attack-controller #f) + +;; definition for function initialize-cty-attack-controller +(defun initialize-cty-attack-controller () + (set! *cty-attack-controller* (new 'loading-level 'cty-attack-controller)) + (init! *cty-attack-controller* 64 17 22) + (none) + ) + +;; definition for function cty-attack-reset +(defun cty-attack-reset ((arg0 symbol) (arg1 symbol) (arg2 symbol)) + (if arg0 + (init-attackers *cty-attack-controller*) + (reset-hatred *cty-attack-controller*) + ) + (init-attack-controller *cty-attack-controller*) + (none) + ) + +;; definition for method 15 of type cty-attack-controller +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 15 cty-attack-controller) has a return type of none, but the expression builder found a return statement. +(defmethod init-attack-controller ((this cty-attack-controller)) + (if (< (-> this hatred-vals allocated-length) 17) + (return 0) + ) + (let ((s5-0 (push-back-hatred this))) + (set! (-> s5-0 hatred) 0.5) + (set! (-> s5-0 hatred-dist) 163840.0) + (set! (-> s5-0 dist-scale) 0.1) + (set! (-> s5-0 attacker-scale) 0.01) + (set! (-> s5-0 max-consider-dist) 409600.0) + (set-hatred-indices this s5-0 3 9) + (set-hatred-indices this s5-0 3 12) + (set-hatred-indices this s5-0 3 10) + (set-hatred-indices this s5-0 3 11) + (set-hatred-indices this s5-0 3 6) + (set-hatred-indices this s5-0 3 7) + (set-hatred-indices this s5-0 3 8) + ) + (let ((s5-1 (push-back-hatred this))) + (set! (-> s5-1 hatred) 0.5) + (set! (-> s5-1 hatred-dist) 245760.0) + (set! (-> s5-1 dist-scale) 0.25) + (set! (-> s5-1 attacker-scale) 0.01) + (set! (-> s5-1 max-consider-dist) 409600.0) + (set-hatred-indices this s5-1 5 6) + (set-hatred-indices this s5-1 5 7) + (set-hatred-indices this s5-1 5 8) + (set-hatred-indices this s5-1 5 11) + ) + (let ((s5-2 (push-back-hatred this))) + (set! (-> s5-2 hatred) 0.7) + (set! (-> s5-2 hatred-dist) 245760.0) + (set! (-> s5-2 dist-scale) 0.25) + (set! (-> s5-2 attacker-scale) 0.01) + (set! (-> s5-2 max-consider-dist) 409600.0) + (set-hatred-indices this s5-2 5 9) + (set-hatred-indices this s5-2 5 12) + ) + (let ((a1-13 (push-back-hatred this))) + (set! (-> a1-13 hatred) 0.2) + (set! (-> a1-13 hatred-dist) 245760.0) + (set! (-> a1-13 dist-scale) 0.25) + (set! (-> a1-13 attacker-scale) 0.01) + (set! (-> a1-13 max-consider-dist) 163840.0) + (set-hatred-indices this a1-13 5 10) + ) + (let ((a1-14 (push-back-hatred this))) + (set! (-> a1-14 hatred) 0.7) + (set! (-> a1-14 hatred-dist) 245760.0) + (set! (-> a1-14 dist-scale) 0.5) + (set! (-> a1-14 attacker-scale) 0.01) + (set! (-> a1-14 max-consider-dist) 409600.0) + (set-hatred-indices this a1-14 4 10) + ) + (let ((s5-3 (push-back-hatred this))) + (set! (-> s5-3 hatred) 0.5) + (set! (-> s5-3 hatred-dist) 245760.0) + (set! (-> s5-3 dist-scale) 0.5) + (set! (-> s5-3 attacker-scale) 0.01) + (set! (-> s5-3 max-consider-dist) 409600.0) + (set-hatred-indices this s5-3 4 9) + (set-hatred-indices this s5-3 4 12) + (set-hatred-indices this s5-3 4 11) + (set-hatred-indices this s5-3 4 6) + (set-hatred-indices this s5-3 4 7) + (set-hatred-indices this s5-3 4 8) + ) + (let ((s5-4 (push-back-hatred this))) + (set! (-> s5-4 hatred) 0.6) + (set! (-> s5-4 hatred-dist) 245760.0) + (set! (-> s5-4 dist-scale) 0.25) + (set! (-> s5-4 attacker-scale) 0.0) + (set! (-> s5-4 max-consider-dist) 409600.0) + (set-hatred-indices this s5-4 9 0) + (set-hatred-indices this s5-4 12 0) + (set-hatred-indices this s5-4 10 0) + (set-hatred-indices this s5-4 11 0) + (set-hatred-indices this s5-4 6 0) + (set-hatred-indices this s5-4 7 0) + (set-hatred-indices this s5-4 8 0) + ) + (let ((s5-5 (push-back-hatred this))) + (set! (-> s5-5 hatred) 0.5) + (set! (-> s5-5 hatred-dist) 245760.0) + (set! (-> s5-5 dist-scale) 0.25) + (set! (-> s5-5 attacker-scale) 0.01) + (set! (-> s5-5 max-consider-dist) 409600.0) + (set-hatred-indices this s5-5 9 5) + (set-hatred-indices this s5-5 12 5) + (set-hatred-indices this s5-5 10 5) + (set-hatred-indices this s5-5 11 5) + (set-hatred-indices this s5-5 6 5) + (set-hatred-indices this s5-5 7 5) + (set-hatred-indices this s5-5 8 5) + (set-hatred-indices this s5-5 9 4) + (set-hatred-indices this s5-5 12 4) + (set-hatred-indices this s5-5 10 4) + (set-hatred-indices this s5-5 11 4) + (set-hatred-indices this s5-5 6 4) + (set-hatred-indices this s5-5 7 4) + (set-hatred-indices this s5-5 8 4) + (set-hatred-indices this s5-5 12 3) + (set-hatred-indices this s5-5 9 3) + (set-hatred-indices this s5-5 10 3) + (set-hatred-indices this s5-5 11 3) + (set-hatred-indices this s5-5 6 3) + (set-hatred-indices this s5-5 7 3) + (set-hatred-indices this s5-5 8 3) + ) + (let ((s5-6 (push-back-hatred this))) + (set! (-> s5-6 hatred) 0.1) + (set! (-> s5-6 hatred-dist) 163840.0) + (set! (-> s5-6 dist-scale) 0.25) + (set! (-> s5-6 attacker-scale) 0.01) + (set! (-> s5-6 max-consider-dist) 163840.0) + (set-hatred-indices this s5-6 12 1) + (set-hatred-indices this s5-6 9 1) + (set-hatred-indices this s5-6 10 1) + (set-hatred-indices this s5-6 11 1) + (set-hatred-indices this s5-6 6 1) + (set-hatred-indices this s5-6 7 1) + (set-hatred-indices this s5-6 8 1) + ) + (let ((s5-7 (push-back-hatred this))) + (set! (-> s5-7 hatred) 0.05) + (set! (-> s5-7 hatred-dist) 163840.0) + (set! (-> s5-7 dist-scale) 0.25) + (set! (-> s5-7 attacker-scale) 0.01) + (set! (-> s5-7 max-consider-dist) 163840.0) + (set-hatred-indices this s5-7 12 2) + (set-hatred-indices this s5-7 9 2) + (set-hatred-indices this s5-7 10 2) + (set-hatred-indices this s5-7 8 2) + ) + (let ((v1-184 (push-back-hatred this))) + (set! (-> v1-184 hatred) 0.4) + (set! (-> v1-184 hatred-dist) 184320.0) + (set! (-> v1-184 dist-scale) 0.25) + (set! (-> v1-184 attacker-scale) 0.01) + (set! (-> v1-184 max-consider-dist) 327680.0) + (set! (-> this guard-angry-hatred-info-index) (the-as int (-> v1-184 index))) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/cty-faction_REF.gc b/test/decompiler/reference/jak3/levels/wascity/cty-faction_REF.gc new file mode 100644 index 0000000000..f175815c1c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/cty-faction_REF.gc @@ -0,0 +1,1048 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *territory-list*, type (array pair) +(define *territory-list* (new 'static 'boxed-array :type pair '(#f) '(#f) '(#f) '(#f) '(#f) '(#f))) + +;; definition for symbol *default-faction-info*, type (array cty-faction-info) +(define *default-faction-info* + (new 'static 'boxed-array :type cty-faction-info :length 21 :allocated-length 30 + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 4 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 2 :kg-guard -2 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 2 :ff-ped -6 :kg-guard 1 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 1 :ff-ped -6 :kg-guard 2 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -2 :ff-ped -6 :kg-guard 4 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard 4 :kg-ped 4 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard 4 :kg-ped 4 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -2 :ff-ped -6 :kg-guard 4 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-ped -6 :kg-guard 2 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 2 :ff-ped -6 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :kg-guard -2 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 4 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 4 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 4 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard -4 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 4 :ff-ped 2 :kg-guard -4 :kg-ped -6 :mh-guard -2 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard 2 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard 1 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -2 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard 2 :mh-ped -6) + (new 'static 'cty-faction-info :ff-guard -2 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard 4 :mh-ped 2) + (new 'static 'cty-faction-info :ff-guard -4 :ff-ped -6 :kg-guard -4 :kg-ped -6 :mh-guard 4 :mh-ped 4) + ) + ) + +;; definition for symbol *default-faction-mod*, type cty-faction-info +(define *default-faction-mod* (new 'static 'cty-faction-info)) + +;; definition for symbol *default-faction-strength-mod*, type cty-faction-strength +(define *default-faction-strength-mod* (new 'static 'cty-faction-strength)) + +;; definition for function setup-city-task-faction +(defun setup-city-task-faction () + (cond + ((task-node-closed? (game-task-node city-power-game-resolution)) + (cty-faction-evaluate-commands '((faction-strength ff ind 5) + (faction-strength mh ind 5) + (faction-strength kg slum 5) + (faction-strength kg port 1) + (faction-strength mh port 1) + ) + ) + ) + ((task-node-closed? (game-task-node city-blow-barricade-resolution)) + (cty-faction-evaluate-commands '((faction-strength kg 1) (faction-strength kg slum 1))) + ) + ((task-node-closed? (game-task-node city-blow-barricade-resolution)) + (cty-faction-evaluate-commands '((faction-strength kg slum 1))) + ) + ((task-node-closed? (game-task-node city-destroy-grid-resolution)) + (cty-faction-evaluate-commands '((faction-strength kg slum -5) + (faction-strength mh port 0) + (faction-strength kg indb-kg-ff-border -5) + (faction-strength kg indb-kg -5) + (faction-strength kg indb-kg-deep -5) + (faction-strength kg sluma-ff-kg-border -5) + ) + ) + ) + ((task-node-closed? (game-task-node city-destroy-darkeco-resolution)) + (cty-faction-evaluate-commands '((faction-strength mh port -1))) + ) + ((task-node-closed? (game-task-node city-port-attack-resolution)) + (cty-faction-evaluate-commands + '((faction-strength mh -5) (faction-strength ff ind -5) (faction-spawn mh off)) + ) + ) + (else + (cty-faction-evaluate-commands '((faction-strength ff ind -5) + (faction-strength mh -5) + (faction-strength kg -5) + (faction-spawn kg off) + (faction-spawn mh off) + ) + ) + ) + ) + ) + +;; definition for method 15 of type cty-faction-manager +(defmethod restore-defaults ((this cty-faction-manager)) + (dotimes (s5-0 (-> *default-faction-info* allocated-length)) + (set! (-> this faction-array s5-0) (-> *default-faction-info* s5-0)) + (mem-copy! (the-as pointer (-> this faction-mod-array s5-0)) (the-as pointer *default-faction-mod*) 6) + ) + (mem-copy! + (the-as pointer (-> this global-faction-strength-mod)) + (the-as pointer *default-faction-strength-mod*) + 3 + ) + (dotimes (s5-1 4) + (mem-copy! + (the-as pointer (-> this territory-faction-strength-mod s5-1)) + (the-as pointer *default-faction-strength-mod*) + 3 + ) + ) + (set! (-> this last-requested-level) #f) + (dotimes (v1-13 3) + (set! (-> this territory-faction-flags data v1-13) (the-as uint 0)) + ) + (dotimes (v1-16 30) + (logior! (-> this territory-flags v1-16) 3) + ) + (set! (-> this last-active-territories) (the-as uint 0)) + (cty-faction-manager-method-19 this) + (dotimes (v1-21 7) + (set! (-> this faction-spawn v1-21 faction-type) (the-as uint v1-21)) + (set! (-> this faction-spawn v1-21 requested-level) (the-as uint 3)) + (set! (-> this faction-spawn v1-21 flags) (faction-spawn-flag)) + ) + (let ((v0-4 (logior (-> this update-flags) (cty-faction-update-flag cfu0)))) + (set! (-> this update-flags) v0-4) + v0-4 + ) + ) + +;; definition for method 19 of type cty-faction-manager +(defmethod cty-faction-manager-method-19 ((this cty-faction-manager)) + (dotimes (v1-0 30) + (set! (-> this permission-cache v1-0) (the-as uint 4)) + ) + #f + ) + +;; definition for method 10 of type cty-faction-manager +(defmethod cty-faction-manager-method-10 ((this cty-faction-manager) (arg0 int) (arg1 symbol)) + (-> this territory-faction-modes 0 data (+ (cty-faction-manager-method-18 this arg1) (* arg0 16))) + ) + +;; definition for method 11 of type cty-faction-manager +(defmethod cty-faction-manager-method-11 ((this cty-faction-manager) (arg0 int)) + (-> this territory-flags arg0) + ) + +;; definition for method 14 of type cty-faction-manager +(defmethod cty-faction-manager-method-14 ((this cty-faction-manager) (arg0 nav-territory-type) (arg1 int) (arg2 int)) + (local-vars (gp-0 int)) + (when (= arg0 (nav-territory-type invalid)) + (set! gp-0 0) + (goto cfg-14) + ) + (let ((v1-5 (-> this faction-array arg0))) + (set! gp-0 0) + (when (or (zero? v1-5) (not v1-5)) + (set! gp-0 gp-0) + (goto cfg-14) + ) + (let ((a0-5 (-> this faction-mod-array arg0)) + (s3-0 (-> this global-faction-strength-mod data arg2)) + (v1-7 (-> v1-5 data arg1)) + ) + -1 + (let* ((s2-0 (+ v1-7 (-> a0-5 data arg2))) + (v1-15 + (+ s3-0 + (-> this territory-faction-strength-mod 0 data (+ arg2 (* (cty-faction-manager-method-16 this arg0) 16))) + s2-0 + ) + ) + ) + (cond + ((zero? v1-15) + (set! gp-0 (logior gp-0 1)) + ) + ((> v1-15 0) + (set! gp-0 (logior gp-0 3)) + ) + ) + ) + ) + ) + (label cfg-14) + gp-0 + ) + +;; definition for method 9 of type cty-faction-manager +(defmethod cty-faction-manager-method-9 ((this cty-faction-manager) (arg0 int) (arg1 symbol)) + (local-vars (a1-2 int) (a1-4 int)) + (if (not arg1) + (return 0) + ) + (if (= arg1 'ctywide) + (return 3) + ) + (cond + ((= arg1 (-> this last-requested-level)) + (let ((v1-7 (-> this permission-cache arg0))) + (when (not (logtest? v1-7 4)) + (let ((v1-8 (logand -5 v1-7))) + (let ((a0-5 (-> *perf-stats* data 55))) + (b! (zero? (-> a0-5 ctrl)) cfg-10 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a1-2 pcr0) + (+! (-> a0-5 accum0) a1-2) + (.mfpc a1-4 pcr1) + (+! (-> a0-5 accum1) a1-4) + ) + (label cfg-10) + 0 + (return (the-as int v1-8)) + ) + ) + ) + ) + (else + (set! (-> this last-requested-level) arg1) + (cty-faction-manager-method-19 this) + ) + ) + (let* ((s3-0 (cty-faction-manager-method-17 this arg1)) + (a3-0 (cty-faction-manager-method-18 this arg1)) + (v0-0 (cty-faction-manager-method-14 this (the-as nav-territory-type arg0) s3-0 a3-0)) + ) + (set! (-> this permission-cache arg0) (the-as uint v0-0)) + v0-0 + ) + ) + +;; definition for method 16 of type cty-faction-manager +(defmethod cty-faction-manager-method-16 ((this cty-faction-manager) (arg0 nav-territory-type)) + (case arg0 + (((nav-territory-type port-ff-deep) + (nav-territory-type port-ff-near-kg) + (nav-territory-type port-ff-kg-border) + (nav-territory-type port-ff-near-mh) + (nav-territory-type port-ff-mh-border) + ) + 0 + ) + (((nav-territory-type inda-kg-ff-border) + (nav-territory-type inda-kg) + (nav-territory-type inda-kg-deep) + (nav-territory-type indb-kg-deep) + (nav-territory-type indb-kg) + (nav-territory-type indb-kg-ff-border) + ) + 1 + ) + (((nav-territory-type sluma-ff-kg-border) + (nav-territory-type sluma-ff) + (nav-territory-type sluma-ff-deep) + (nav-territory-type slumb-ff-deep) + (nav-territory-type slumc-ff-deep) + (nav-territory-type genc-border) + (nav-territory-type genc) + ) + 2 + ) + (((nav-territory-type mhcity-mh-ff-border) (nav-territory-type mhcity-mh) (nav-territory-type mhcity-mh-deep)) + 3 + ) + (else + (format 0 "Trying to use an unknown territory type ~d~%" arg0) + (break!) + 0 + ) + ) + ) + +;; definition for method 17 of type cty-faction-manager +(defmethod cty-faction-manager-method-17 ((this cty-faction-manager) (arg0 symbol)) + (case arg0 + (('ctypesa) + 0 + ) + (('ctycara 'ctycarb 'ctypepa) + 1 + ) + (('ctypesc) + 2 + ) + (('ctypepc 'ctycarkg 'lctyhijk) + 3 + ) + (('ctypesb 'ctygenb) + 4 + ) + (('ctypepb) + 5 + ) + (else + (break!) + 0 + ) + ) + ) + +;; definition for method 18 of type cty-faction-manager +(defmethod cty-faction-manager-method-18 ((this cty-faction-manager) (arg0 symbol)) + (case arg0 + (('ctycara 'ctycarb 'ctypesa 'ctypepa) + 0 + ) + (('ctypepc 'ctypesc) + 1 + ) + (('ctypepb 'ctypesb 'ctygenb) + 2 + ) + (else + (break!) + 0 + ) + ) + ) + +;; definition of type exclusive-nav-mesh-info +(deftype exclusive-nav-mesh-info (structure) + ((aid uint32) + (exclusive-mask exclusive-nav-info-mask) + ) + ) + +;; definition for method 3 of type exclusive-nav-mesh-info +(defmethod inspect ((this exclusive-nav-mesh-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'exclusive-nav-mesh-info) + (format #t "~1Taid: ~D~%" (-> this aid)) + (format #t "~1Texclusive-mask: ~D~%" (-> this exclusive-mask)) + (label cfg-4) + this + ) + +;; definition for symbol *exclusive-nav-mesh-list*, type (array exclusive-nav-mesh-info) +(define *exclusive-nav-mesh-list* + (new 'static 'boxed-array :type exclusive-nav-mesh-info + (new 'static 'exclusive-nav-mesh-info :aid #xd0ae :exclusive-mask (exclusive-nav-info-mask eni0 eni1)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0a8 :exclusive-mask (exclusive-nav-info-mask eni0 eni1 eni2)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0a9 :exclusive-mask (exclusive-nav-info-mask eni1 eni2 eni3)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0aa :exclusive-mask (exclusive-nav-info-mask eni2 eni3 eni4)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0ad :exclusive-mask (exclusive-nav-info-mask eni3 eni4)) + (new 'static 'exclusive-nav-mesh-info :aid #xd0af :exclusive-mask (exclusive-nav-info-mask eni5 eni6)) + (new 'static 'exclusive-nav-mesh-info :aid #xd2dc :exclusive-mask (exclusive-nav-info-mask eni1 eni2)) + (new 'static 'exclusive-nav-mesh-info :aid #xd2dd :exclusive-mask (exclusive-nav-info-mask eni0 eni1 eni2)) + (new 'static 'exclusive-nav-mesh-info :aid #xd22b :exclusive-mask (exclusive-nav-info-mask eni3 eni4)) + (new 'static 'exclusive-nav-mesh-info :aid #xd22c :exclusive-mask (exclusive-nav-info-mask eni0 eni3 eni4)) + (new 'static 'exclusive-nav-mesh-info :aid #xd2de :exclusive-mask (exclusive-nav-info-mask eni5 eni6 eni7)) + (new 'static 'exclusive-nav-mesh-info :aid #xd2df :exclusive-mask (exclusive-nav-info-mask eni0 eni6 eni7)) + (new 'static 'exclusive-nav-mesh-info + :aid #xd2e0 + :exclusive-mask (exclusive-nav-info-mask eni0 eni2 eni4 eni7) + ) + ) + ) + +;; definition for method 23 of type cty-faction-manager +(defmethod cty-faction-manager-method-23 ((this cty-faction-manager) (arg0 uint)) + (if (zero? (-> this target-exclusive-branch-index)) + (return #t) + ) + (logtest? (-> this target-exclusive-branch-index) arg0) + ) + +;; definition for method 13 of type cty-faction-manager +(defmethod cty-faction-manager-method-13 ((this cty-faction-manager)) + (local-vars (v1-9 int)) + (set! (-> this target-exclusive-branch-index) (the-as uint 0)) + (when *target* + (let ((v1-2 (find-nearest-nav-mesh (target-pos 0) (the-as float #x7f800000)))) + (cond + (v1-2 + (let ((v1-4 (-> v1-2 entity aid))) + (dotimes (a0-3 (-> *exclusive-nav-mesh-list* length)) + (when (= v1-4 (-> *exclusive-nav-mesh-list* a0-3 aid)) + (set! v1-9 (the-as int (-> *exclusive-nav-mesh-list* a0-3 exclusive-mask))) + (goto cfg-9) + ) + ) + ) + (set! v1-9 0) + (label cfg-9) + (set! (-> this target-exclusive-branch-index) (the-as uint v1-9)) + ) + (else + (set! (-> this target-exclusive-branch-index) (the-as uint 0)) + 0 + ) + ) + ) + ) + (when (logtest? (-> this update-flags) (cty-faction-update-flag cfu0)) + (dotimes (s5-1 30) + (when (logtest? (-> this territory-flags s5-1) 1) + (set! (-> this territory-faction-modes s5-1 kg-mode) (the-as uint 0)) + (set! (-> this territory-faction-modes s5-1 ff-mode) (the-as uint 0)) + (set! (-> this territory-faction-modes s5-1 mh-mode) (the-as uint 0)) + (let ((s2-0 (cty-faction-manager-method-14 this (the-as nav-territory-type s5-1) 1 0)) + (s4-0 (cty-faction-manager-method-14 this (the-as nav-territory-type s5-1) 0 0)) + (s3-0 (cty-faction-manager-method-14 this (the-as nav-territory-type s5-1) 2 1)) + (v1-31 (cty-faction-manager-method-14 this (the-as nav-territory-type s5-1) 4 2)) + ) + (when (or (logtest? s2-0 2) (logtest? s4-0 1)) + (let ((a0-13 #f)) + (when (logtest? s3-0 1) + (if (not (logtest? (-> this territory-faction-flags kg-mode) 1)) + (set! (-> this territory-faction-modes s5-1 kg-mode) (the-as uint 1)) + ) + (set! a0-13 #t) + ) + (when (logtest? v1-31 1) + (if (not (logtest? (-> this territory-faction-flags mh-mode) 1)) + (set! (-> this territory-faction-modes s5-1 mh-mode) (the-as uint 1)) + ) + (set! a0-13 #t) + ) + (when (and a0-13 (logtest? s4-0 1)) + (when (not (logtest? (-> this territory-faction-flags ff-mode) 1)) + (set! (-> this territory-faction-modes s5-1 ff-mode) (the-as uint 1)) + (if (logtest? (-> this last-active-territories) (ash 1 s5-1)) + #t + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((s5-2 #f)) + (when (-> *setting-control* user-current attack) + (dotimes (s4-1 30) + (when (logtest? (-> this last-active-territories) (ash 1 s4-1)) + (let ((s3-1 (cty-faction-manager-method-14 this (the-as nav-territory-type s4-1) 2 1))) + (if (or (logtest? (cty-faction-manager-method-14 this (the-as nav-territory-type s4-1) 4 2) 2) (logtest? s3-1 2)) + (set! s5-2 #t) + ) + ) + ) + ) + ) + (cond + (s5-2 + (when (or (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) + (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) + ) + (if (zero? (-> this start-fight-music-time)) + (set-time! (-> this start-fight-music-time)) + ) + (when (and (> (-> this start-fight-music-time) 0) (time-elapsed? (-> this start-fight-music-time) (seconds 5))) + (persist-with-delay *setting-control* 'cty-faction-music (seconds 1000) 'music 'fight1 0.0 0) + (set-time! (-> this last-change-music-time)) + ) + ) + ) + (else + (set! (-> this start-fight-music-time) 0) + (when (or (time-elapsed? (-> this last-change-music-time) (seconds 6)) + (not (-> *setting-control* user-current attack)) + ) + (persist-with-delay *setting-control* 'cty-faction-music 0 'music 'city1 0.0 0) + (set-time! (-> this last-change-music-time)) + ) + ) + ) + ) + (when (logtest? (-> this update-flags) (cty-faction-update-flag cfu0)) + (remove-setting! 'borrow-city) + (set-setting! 'borrow-city (-> *territory-list* 0) 0.0 0) + (add-borrow-levels *load-state*) + ) + (logclear! (-> this update-flags) (cty-faction-update-flag cfu0)) + (cty-faction-manager-method-24 this) + ) + +;; definition for method 21 of type cty-faction-manager +(defmethod cty-faction-manager-method-21 ((this cty-faction-manager) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 2) + 'ctypesb + ) + ((zero? v1-0) + 'ctypesa + ) + ((= v1-0 1) + 'ctypesc + ) + ) + ) + ) + +;; definition for method 20 of type cty-faction-manager +(defmethod cty-faction-manager-method-20 ((this cty-faction-manager) (arg0 uint)) + (local-vars (sv-16 int) (sv-17 int) (sv-18 int)) + (if (= arg0 (-> this last-active-territories)) + (return 0) + ) + (set! (-> this last-active-territories) arg0) + (let ((s4-0 (-> *territory-list* 0)) + (s3-0 1) + (s2-0 0) + ) + (set! (car s4-0) #f) + (set! (cdr s4-0) '()) + (dotimes (s1-0 30) + (let ((s0-0 s1-0)) + (when (and (logtest? (-> this territory-flags s0-0) 2) (logtest? arg0 (ash 1 s0-0))) + (set! sv-16 (cty-faction-manager-method-14 this (the-as nav-territory-type s0-0) 0 0)) + (set! sv-17 (cty-faction-manager-method-14 this (the-as nav-territory-type s0-0) 2 1)) + (set! sv-18 (cty-faction-manager-method-14 this (the-as nav-territory-type s0-0) 4 2)) + (when (and (logtest? sv-17 2) (not (logtest? s2-0 2))) + (when (!= (car s4-0) #f) + (set! (cdr s4-0) (-> *territory-list* s3-0)) + (+! s3-0 1) + (set! s4-0 (cdr s4-0)) + ) + (set! s2-0 (logior s2-0 2)) + (set! (car s4-0) (cty-faction-manager-method-21 this 1)) + (set! (cdr s4-0) '()) + ) + (when (and (logtest? sv-16 2) (not (logtest? s2-0 1))) + (when (!= (car s4-0) #f) + (set! (cdr s4-0) (-> *territory-list* s3-0)) + (+! s3-0 1) + (set! s4-0 (cdr s4-0)) + ) + (set! s2-0 (logior s2-0 1)) + (set! (car s4-0) (cty-faction-manager-method-21 this 0)) + (set! (cdr s4-0) '()) + ) + (when (and (logtest? sv-18 2) (not (logtest? s2-0 4))) + (when (!= (car s4-0) #f) + (set! (cdr s4-0) (-> *territory-list* s3-0)) + (+! s3-0 1) + (set! s4-0 (cdr s4-0)) + ) + (set! s2-0 (logior s2-0 4)) + (set! (car s4-0) (cty-faction-manager-method-21 this 2)) + (set! (cdr s4-0) '()) + ) + (logior! (-> this update-flags) (cty-faction-update-flag cfu0)) + ) + ) + ) + ) + (the-as int #f) + ) + +;; definition for method 22 of type cty-faction-manager +(defmethod cty-faction-manager-method-22 ((this cty-faction-manager)) + (set! (-> this last-active-territories) (the-as uint 0)) + (let ((v0-0 (logior (-> this update-flags) (cty-faction-update-flag cfu0)))) + (set! (-> this update-flags) v0-0) + v0-0 + ) + ) + +;; definition for function map-symbol-to-nav-territory-type +;; WARN: Return type mismatch int vs nav-territory-type. +(defun map-symbol-to-nav-territory-type ((arg0 symbol)) + (let ((v1-0 arg0)) + (the-as nav-territory-type (cond + ((= v1-0 'port-ff-deep) + (nav-territory-type port-ff-deep) + ) + ((= v1-0 'port-ff-near-kg) + (nav-territory-type port-ff-near-kg) + ) + ((= v1-0 'port-ff-kg-border) + (nav-territory-type port-ff-kg-border) + ) + ((= v1-0 'inda-kg-ff-border) + (nav-territory-type inda-kg-ff-border) + ) + ((= v1-0 'inda-kg) + (nav-territory-type inda-kg) + ) + ((= v1-0 'inda-kg-deep) + (nav-territory-type inda-kg-deep) + ) + ((= v1-0 'indb-kg-deep) + (nav-territory-type indb-kg-deep) + ) + ((= v1-0 'indb-kg) + (nav-territory-type indb-kg) + ) + ((= v1-0 'indb-kg-ff-border) + (nav-territory-type indb-kg-ff-border) + ) + ((= v1-0 'sluma-ff-kg-border) + (nav-territory-type sluma-ff-kg-border) + ) + ((= v1-0 'sluma-ff) + (nav-territory-type sluma-ff) + ) + ((= v1-0 'sluma-ff-deep) + (nav-territory-type sluma-ff-deep) + ) + ((= v1-0 'slumb-ff-deep) + (nav-territory-type slumb-ff-deep) + ) + ((= v1-0 'slumc-ff-deep) + (nav-territory-type slumc-ff-deep) + ) + ((= v1-0 'genc-border) + (nav-territory-type genc-border) + ) + ((= v1-0 'genc) + (nav-territory-type genc) + ) + ((= v1-0 'port-ff-near-mh) + (nav-territory-type port-ff-near-mh) + ) + ((= v1-0 'port-ff-mh-border) + (nav-territory-type port-ff-mh-border) + ) + ((= v1-0 'mhcity-mh-ff-border) + (nav-territory-type mhcity-mh-ff-border) + ) + ((= v1-0 'mhcity-mh) + (nav-territory-type mhcity-mh) + ) + ((= v1-0 'mhcity-mh-deep) + (nav-territory-type mhcity-mh-deep) + ) + ((= v1-0 'special0) + (nav-territory-type special0) + ) + ((= v1-0 'special1) + (nav-territory-type special1) + ) + ((= v1-0 'special2) + (nav-territory-type special2) + ) + ((= v1-0 'special3) + (nav-territory-type special3) + ) + ((= v1-0 'special4) + (nav-territory-type special4) + ) + ((= v1-0 'special5) + (nav-territory-type special5) + ) + ((= v1-0 'special6) + (nav-territory-type special6) + ) + ((= v1-0 'special7) + (nav-territory-type special7) + ) + ((= v1-0 'special8) + (nav-territory-type special8) + ) + (else + (break!) + (nav-territory-type genc) + ) + ) + ) + ) + ) + +;; definition for function cty-faction-evaluate-commands +;; WARN: Return type mismatch int vs object. +(defun cty-faction-evaluate-commands ((arg0 pair)) + (local-vars (v1-23 object)) + (let ((s5-0 (car arg0))) + (while (not (null? arg0)) + (case (car s5-0) + (('restore-defaults) + (restore-defaults *cty-faction-manager*) + ) + (('faction-spawn) + (let* ((v1-3 (ref s5-0 1)) + (s4-0 (cond + ((= v1-3 'kg-guard) + 0 + ) + ((= v1-3 'mh-guard) + 1 + ) + ((= v1-3 'ff-guard) + 2 + ) + ((= v1-3 'ff-ped) + 3 + ) + ((= v1-3 'ff-vehicle) + 4 + ) + ((= v1-3 'kg-ambient) + 5 + ) + ((= v1-3 'mh-ambient) + 6 + ) + (else + 6 + ) + ) + ) + (v1-4 (ref s5-0 2)) + (a2-0 (cond + ((= v1-4 'off) + 0 + ) + ((= v1-4 'suppress-x) + 1 + ) + ((= v1-4 'suppress) + 2 + ) + ((= v1-4 'default) + 3 + ) + ((= v1-4 'war) + 4 + ) + ((= v1-4 'war3) + 3 + ) + ((= v1-4 'combat) + 7 + ) + ((= v1-4 'mission) + 7 + ) + ((= v1-4 'mission-hi) + 7 + ) + ((= v1-4 'mission-suppress) + 5 + ) + ((= v1-4 'mission-suppress-x) + 3 + ) + (else + 0 + ) + ) + ) + ) + (faction-spawn *cty-faction-manager* s4-0 a2-0 #t #f) + ) + ) + (('faction-set-flags) + (let* ((v1-7 (ref s5-0 1)) + (s4-1 (cond + ((= v1-7 'mh) + 2 + ) + ((= v1-7 'kg) + 1 + ) + ((= v1-7 'ff) + 0 + ) + (else + (break!) + 0 + ) + ) + ) + (v1-8 (ref s5-0 2)) + ) + 0 + (if (= v1-8 'no-war) + (logior! (-> *cty-faction-manager* territory-faction-flags data s4-1) 1) + ) + ) + ) + (('faction-strength) + (let ((s4-2 (ref s5-0 1)) + (s3-0 3) + (a0-40 s5-0) + ) + (cond + ((= ((method-of-type (rtype-of a0-40) length) a0-40) s3-0) + (let ((s4-3 (cond + ((= s4-2 'mh) + 2 + ) + ((= s4-2 'kg) + 1 + ) + ((= s4-2 'ff) + 0 + ) + (else + (break!) + 0 + ) + ) + ) + ) + (set! (-> *cty-faction-manager* global-faction-strength-mod data s4-3) + (the-as int (/ (the-as int (ref s5-0 2)) 8)) + ) + ) + ) + ((begin + (set! v1-23 (ref s5-0 2)) + (let ((a0-45 v1-23)) + (or (= a0-45 'port) (= a0-45 'ind) (= a0-45 'slum) (= a0-45 'mhcity) (= a0-45 'city)) + ) + ) + (let* ((s3-1 (cond + ((= v1-23 'port) + 0 + ) + ((= v1-23 'mhcity) + 3 + ) + ((= v1-23 'ind) + 1 + ) + ((= v1-23 'slum) + 2 + ) + ((= v1-23 'city) + -1 + ) + (else + (break!) + 2 + ) + ) + ) + (v1-24 s4-2) + (s4-4 (cond + ((= v1-24 'mh) + 2 + ) + ((= v1-24 'kg) + 1 + ) + ((= v1-24 'ff) + 0 + ) + (else + (break!) + 0 + ) + ) + ) + ) + (cond + ((< -1 s3-1) + (set! (-> *cty-faction-manager* territory-faction-strength-mod 0 data (+ (* s3-1 16) s4-4)) + (the-as int (/ (the-as int (ref s5-0 3)) 8)) + ) + ) + (else + (dotimes (s3-2 4) + (set! (-> *cty-faction-manager* territory-faction-strength-mod 0 data (+ (* s3-2 16) s4-4)) + (the-as int (/ (the-as int (ref s5-0 3)) 8)) + ) + ) + ) + ) + ) + ) + (else + (let* ((s3-4 (map-symbol-to-nav-territory-type (the-as symbol (ref s5-0 2)))) + (v1-30 s4-2) + (s4-5 (cond + ((or (= v1-30 'ff) (= v1-30 'ff-guard)) + 0 + ) + ((= v1-30 'ff-ped) + 1 + ) + ((or (= v1-30 'kg) (= v1-30 'kg-guard)) + 2 + ) + ((= v1-30 'kg-ped) + 3 + ) + ((or (= v1-30 'mh) (= v1-30 'mh-guard)) + 4 + ) + ((= v1-30 'mh-ped) + 5 + ) + (else + (break!) + 0 + ) + ) + ) + ) + (set! (-> *cty-faction-manager* territory-faction-strength-mod 0 data (+ (* s3-4 16) s4-5)) + (the-as int (/ (the-as int (ref s5-0 3)) 8)) + ) + ) + ) + ) + ) + ) + ) + (set! arg0 (cdr arg0)) + (set! s5-0 (car arg0)) + ) + ) + (cty-faction-manager-method-22 *cty-faction-manager*) + 0 + ) + +;; definition for function is-faction-level-loaded? +(defun is-faction-level-loaded? ((arg0 cty-faction-level)) + (case arg0 + (((cty-faction-level pesc)) + (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) + ) + (((cty-faction-level pesb)) + (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) + ) + (((cty-faction-level pesa)) + (= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) + ) + (((cty-faction-level pepa)) + (= (status-of-level-and-borrows *level* 'ctypepa #f) 'active) + ) + (((cty-faction-level car)) + (or (= (status-of-level-and-borrows *level* 'ctycara #f) 'active) + (= (status-of-level-and-borrows *level* 'ctycarb #f) 'active) + ) + ) + (((cty-faction-level pepc)) + (= (status-of-level-and-borrows *level* 'ctypepc #f) 'active) + ) + (((cty-faction-level pepb)) + (= (status-of-level-and-borrows *level* 'ctypepb #f) 'active) + ) + ) + ) + +;; definition for method 25 of type cty-faction-manager +(defmethod faction-spawn ((this cty-faction-manager) (arg0 int) (arg1 int) (arg2 symbol) (arg3 symbol)) + (let ((v1-2 (-> this faction-spawn arg0))) + (when (or arg2 (not (logtest? (-> v1-2 flags) (faction-spawn-flag fs0 fs3)))) + (set! (-> v1-2 requested-level) (the-as uint arg1)) + (if arg2 + (logior! (-> v1-2 flags) (faction-spawn-flag fs0)) + ) + (when arg3 + (let ((v0-0 (logior (-> v1-2 flags) (faction-spawn-flag fs3)))) + (set! (-> v1-2 flags) v0-0) + v0-0 + ) + ) + ) + ) + ) + +;; definition for method 24 of type cty-faction-manager +(defmethod cty-faction-manager-method-24 ((this cty-faction-manager)) + (dotimes (s5-0 7) + (if (not (is-faction-level-loaded? (the-as cty-faction-level s5-0))) + (logior! (-> this faction-spawn s5-0 flags) (faction-spawn-flag fs2)) + ) + (set! (-> this faction-spawn s5-0 current-level) (the-as uint 0)) + (logclear! (-> this faction-spawn s5-0 flags) (faction-spawn-flag fs1)) + ) + (dotimes (s5-1 30) + (when (logtest? (-> this last-active-territories) (ash 1 s5-1)) + (if (= (-> this territory-faction-modes s5-1 ff-mode) 1) + (faction-spawn this 2 4 #f #f) + ) + (if (= (-> this territory-faction-modes s5-1 kg-mode) 1) + (faction-spawn this 0 4 #f #f) + ) + (if (= (-> this territory-faction-modes s5-1 mh-mode) 1) + (faction-spawn this 1 4 #f #f) + ) + ) + ) + (let ((s5-2 0)) + 0 + (let ((v1-30 (the int (lerp 20.0 0.0 (-> *setting-control* user-current city-heap-load))))) + (dotimes (a0-24 7) + (let ((a1-7 (-> this faction-spawn a0-24))) + (when (and (not (logtest? (-> a1-7 flags) (faction-spawn-flag fs1 fs2))) + (logtest? (-> a1-7 flags) (faction-spawn-flag fs0)) + ) + (set! (-> a1-7 current-level) (-> a1-7 requested-level)) + (logior! (-> a1-7 flags) (faction-spawn-flag fs1)) + (+! s5-2 (-> a1-7 current-level)) + ) + ) + ) + (countdown (a0-27 9) + (when (>= s5-2 v1-30) + 0 + (goto cfg-55) + ) + (let ((a1-10 0)) + (dotimes (a2-13 7) + (let ((a3-7 (-> this faction-spawn a2-13))) + (if (and (not (logtest? (-> a3-7 flags) (faction-spawn-flag fs1 fs2))) (= (-> a3-7 requested-level) a0-27)) + (+! a1-10 1) + ) + ) + ) + (when (> a1-10 0) + (let ((a3-12 (* (the-as uint a1-10) (the-as uint a0-27))) + (a2-17 (- v1-30 s5-2)) + ) + 0 + 0 + (let ((a1-11 (/ (min (the-as int a3-12) a2-17) a1-10))) + (if (zero? a1-11) + (set! a1-11 a2-17) + ) + (dotimes (a2-19 7) + (let ((a3-17 (-> this faction-spawn a2-19))) + (when (and (not (logtest? (-> a3-17 flags) (faction-spawn-flag fs1 fs2))) (= (-> a3-17 requested-level) a0-27)) + (set! (-> a3-17 current-level) (the-as uint a1-11)) + (logior! (-> a3-17 flags) (faction-spawn-flag fs1)) + (+! s5-2 a1-11) + ) + ) + (when (>= s5-2 v1-30) + 0 + (goto cfg-55) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (label cfg-55) + (dotimes (v1-35 7) + (logclear! (-> this faction-spawn v1-35 flags) (faction-spawn-flag fs3)) + ) + #f + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/ff-squad-control-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/ff-squad-control-h_REF.gc new file mode 100644 index 0000000000..474b3533a6 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/ff-squad-control-h_REF.gc @@ -0,0 +1,165 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type traffic-guard-type-info +(deftype traffic-guard-type-info (structure) + ((object-type traffic-type) + (max-target-count int8) + (min-target-count int8) + (target-count int8) + (count int8) + (change-to-type traffic-type) + ) + :allow-misaligned + ) + +;; definition for method 3 of type traffic-guard-type-info +(defmethod inspect ((this traffic-guard-type-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traffic-guard-type-info) + (format #t "~1Tobject-type: ~D~%" (-> this object-type)) + (format #t "~1Tmax-target-count: ~D~%" (-> this max-target-count)) + (format #t "~1Tmin-target-count: ~D~%" (-> this min-target-count)) + (format #t "~1Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tchange-to-type: ~D~%" (-> this change-to-type)) + (label cfg-4) + this + ) + +;; definition of type traffic-guard-type-array +(deftype traffic-guard-type-array (structure) + ((data traffic-guard-type-info 3 :inline) + (guard-info-normal traffic-guard-type-info :inline :overlay-at (-> data 0)) + (guard-info-war traffic-guard-type-info :inline :offset 16) + (guard-info-mission traffic-guard-type-info :inline :offset 32) + ) + :allow-misaligned + ) + +;; definition for method 3 of type traffic-guard-type-array +(defmethod inspect ((this traffic-guard-type-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traffic-guard-type-array) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~1Tguard-info-normal: #~%" (-> this data)) + (format #t "~1Tguard-info-war: #~%" (-> this guard-info-war)) + (format #t "~1Tguard-info-mission: #~%" (-> this guard-info-mission)) + (label cfg-4) + this + ) + +;; definition of type squad-alert-state-settings +(deftype squad-alert-state-settings (structure) + ((guard-settings-array squad-unit-settings 10 :inline) + (ped-tazer squad-unit-settings :inline :overlay-at (-> guard-settings-array 0)) + (ped-rifle squad-unit-settings :inline :offset 32) + (ped-grenade squad-unit-settings :inline :offset 64) + (ped-waster squad-unit-settings :inline :offset 96) + (bike-turret squad-unit-settings :inline :offset 128) + (hellcat-turret squad-unit-settings :inline :offset 160) + ) + :pack-me + ) + +;; definition for method 3 of type squad-alert-state-settings +(defmethod inspect ((this squad-alert-state-settings)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'squad-alert-state-settings) + (format #t "~1Tguard-settings-array[10] @ #x~X~%" (-> this ped-tazer)) + (format #t "~1Tped-tazer: #~%" (-> this ped-tazer)) + (format #t "~1Tped-rifle: #~%" (-> this ped-rifle)) + (format #t "~1Tped-grenade: #~%" (-> this ped-grenade)) + (format #t "~1Tped-waster: #~%" (-> this ped-waster)) + (format #t "~1Tbike-turret: #~%" (-> this bike-turret)) + (format #t "~1Thellcat-turret: #~%" (-> this hellcat-turret)) + (label cfg-4) + this + ) + +;; definition of type traffic-target-formation +(deftype traffic-target-formation (structure) + ((circle-range float 16) + ) + :pack-me + ) + +;; definition for method 3 of type traffic-target-formation +(defmethod inspect ((this traffic-target-formation)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traffic-target-formation) + (format #t "~1Tcircle-range[16] @ #x~X~%" (-> this circle-range)) + (label cfg-4) + this + ) + +;; definition of type ff-squad-control +(deftype ff-squad-control (squad-control-city) + ((squad-settings squad-alert-state-settings 3 :inline :offset 824) + (settings squad-alert-state-settings :inline :overlay-at (-> squad-settings 0)) + (settings-war squad-alert-state-settings :inline :overlay-at (-> squad-settings 1)) + (settings-mission squad-alert-state-settings :inline :overlay-at (-> squad-settings 2)) + (guard-type-info-array traffic-guard-type-array 10 :inline) + (guard-type-mask-from-object-type uint32 29) + (target-formation-array traffic-target-formation 3 :inline) + ) + (:methods + (ff-squad-control-method-45 (_type_) none) + (ff-squad-control-method-46 (_type_) none) + (ff-squad-control-method-47 (_type_) none) + (ff-squad-control-method-48 (_type_) none) + (set-guard-target-level (_type_ float) none) + (get-focus (_type_) process-focusable) + (ff-squad-control-method-51 (_type_ process-focusable collide-spec) process-focusable) + (end-pursuit-for-all (_type_ int) none) + (get-unit-settings-by-idx (_type_ int) squad-unit-settings) + (ff-squad-control-method-54 (_type_ int) none) + (ff-squad-control-method-55 (_type_ int int) traffic-type) + (ff-squad-control-method-56 (_type_ int int int) none) + ) + ) + +;; definition for method 3 of type ff-squad-control +(defmethod inspect ((this ff-squad-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tsync-clock: ~D~%" (-> this sync-clock)) + (format #t "~1Tsync-mask-8: ~D~%" (-> this sync-mask-8)) + (format #t "~1Tsync-mask-16: ~D~%" (-> this sync-mask-16)) + (format #t "~1Tsync-mask-32: ~D~%" (-> this sync-mask-32)) + (format #t "~1Talert-state: #~%" (-> this alert-state)) + (format #t "~1Tprimary-target-history[16] @ #x~X~%" (-> this primary-target-history)) + (format #t "~1Ttraffic: ~A~%" (-> this traffic)) + (format #t "~1Tcity-mode: ~D~%" (-> this city-mode)) + (format #t "~1Tsquad-settings[3] @ #x~X~%" (-> this settings)) + (format #t "~1Tsettings: #~%" (-> this settings)) + (format #t "~1Tsettings-war: #~%" (-> this settings-war)) + (format #t "~1Tsettings-mission: #~%" (-> this settings-mission)) + (format #t "~1Tguard-type-info-array[10] @ #x~X~%" (-> this guard-type-info-array)) + (format #t "~1Tguard-type-mask-from-object-type[29] @ #x~X~%" (-> this guard-type-mask-from-object-type)) + (format #t "~1Ttarget-formation-array[3] @ #x~X~%" (-> this target-formation-array)) + (label cfg-4) + this + ) + +;; definition for symbol *ff-squad-control*, type ff-squad-control +(define *ff-squad-control* (the-as ff-squad-control #f)) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/flee-info_REF.gc b/test/decompiler/reference/jak3/levels/wascity/flee-info_REF.gc new file mode 100644 index 0000000000..b02da29522 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/flee-info_REF.gc @@ -0,0 +1,165 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type flee-info +(deftype flee-info (structure) + ((pad uint8 4) + ) + :pack-me + (:methods + (flee-info-method-9 (_type_ citizen nav-branch int vector float) float) + (flee-info-method-10 (_type_ citizen vector) nav-segment) + (flee-info-method-11 (_type_ citizen) none) + (flee-info-method-12 (_type_ citizen) none) + (flee-info-method-13 (_type_ citizen) none) + ) + ) + +;; definition for method 3 of type flee-info +(defmethod inspect ((this flee-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'flee-info) + (label cfg-4) + this + ) + +;; definition for method 9 of type flee-info +;; INFO: Used lq/sq +(defmethod flee-info-method-9 ((this flee-info) (arg0 citizen) (arg1 nav-branch) (arg2 int) (arg3 vector) (arg4 float)) + (local-vars (sv-32 int)) + (when (nonzero? arg2) + (-> arg1 src-node) + (let* ((s2-0 (-> arg1 dest-node)) + (t9-0 vector-vector-xz-distance) + (a0-1 arg3) + (a2-1 s2-0) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-1 position quad)) + (set! (-> a1-1 w) 1.0) + (let ((s0-0 (t9-0 a0-1 a1-1)) + (s1-0 (-> s2-0 branch-count)) + (f30-0 0.0) + ) + (set! sv-32 0) + (while (< sv-32 s1-0) + (+! f30-0 (flee-info-method-9 this arg0 (-> s2-0 branch-array sv-32) (+ arg2 -1) arg3 s0-0)) + (set! sv-32 (+ sv-32 1)) + ) + (set! arg4 (+ s0-0 (the float (/ (the int f30-0) s1-0)))) + ) + ) + ) + arg4 + ) + +;; definition for method 10 of type flee-info +;; INFO: Used lq/sq +(defmethod flee-info-method-10 ((this flee-info) (arg0 citizen) (arg1 vector)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> arg0 root trans quad)) + (set! (-> a1-1 w) 81920.0) + (let ((s5-0 (find-segment arg0 a1-1 arg1))) + (if s5-0 + (citizen-method-199 arg0 s5-0) + ) + s5-0 + ) + ) + ) + +;; definition for method 11 of type flee-info +(defmethod flee-info-method-11 ((this flee-info) (arg0 citizen)) + (citizen-method-205 arg0) + (none) + ) + +;; definition for method 12 of type flee-info +(defmethod flee-info-method-12 ((this flee-info) (arg0 citizen)) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 root trans) (the-as vector (-> arg0 danger-pos))))) + (flee-info-method-10 this arg0 a2-1) + ) + (if (zero? (-> arg0 controller branch)) + (citizen-method-208 arg0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat))) + ) + (none) + ) + +;; definition for method 13 of type flee-info +;; INFO: Used lq/sq +(defmethod flee-info-method-13 ((this flee-info) (arg0 citizen)) + (local-vars (sv-80 nav-branch)) + (let* ((s5-0 (-> arg0 controller)) + (s2-0 (-> s5-0 branch dest-node)) + (s4-0 (the-as nav-branch #f)) + (s1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 dest-point) (-> arg0 controller path-prev-point))) + ) + 0.0 + (let ((s0-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 root trans) (-> arg0 dest-point)))) + (set! (-> s0-1 y) 0.0) + (set! (-> s1-1 y) 0.0) + (vector-xz-normalize! s1-1 1.0) + (let ((f0-4 (vector-dot s0-1 s1-1))) + (when (< -16384.0 f0-4) + (cond + ((zero? (-> s2-0 branch-count)) + ) + (else + (let ((s1-2 (-> s2-0 branch-count)) + (f30-0 0.0) + ) + (dotimes (s0-2 s1-2) + (set! sv-80 (-> s2-0 branch-array s0-2)) + (let ((f0-5 (flee-info-method-9 this arg0 sv-80 4 (-> arg0 danger-pos) 0.0))) + (when (< f30-0 f0-5) + (set! f30-0 f0-5) + (set! s4-0 sv-80) + ) + ) + ) + ) + ) + ) + (when s4-0 + (vehicle-controller-method-11 s5-0) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> s5-0 turn-exit-point quad)) + (vehicle-controller-method-10 s5-0 s4-0) + (set! (-> s5-0 path-prev-point quad) (-> s3-1 quad)) + ) + (set! (-> s5-0 branch) s4-0) + (let ((a1-4 (-> s4-0 dest-node)) + (v1-21 (-> s5-0 turn-exit-point)) + ) + (set! (-> v1-21 quad) (-> a1-4 position quad)) + (set! (-> v1-21 w) 1.0) + ) + ) + ) + ) + ) + ) + (when (< (-> arg0 cp-next-time) (current-time)) + (set! (-> arg0 cp-next-time) (+ (current-time) (set-reaction-time! arg0 (seconds 2) (seconds 4)))) + (citizen-method-203 arg0 (-> arg0 cp-force)) + ) + (add-offset-to-target! (-> arg0 nav state) (-> arg0 cp-force)) + (let ((a0-18 (-> arg0 nav state)) + (v1-32 (-> arg0 dest-point)) + ) + (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-18 target-pos quad) (-> v1-32 quad)) + ) + 0 + (set! (-> (new 'stack-no-clear 'vector) quad) (-> arg0 nav state target-pos quad)) + (nav-enemy-method-187 arg0) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/formation-object_REF.gc b/test/decompiler/reference/jak3/levels/wascity/formation-object_REF.gc new file mode 100644 index 0000000000..228c8b9272 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/formation-object_REF.gc @@ -0,0 +1,560 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type handle-array +(deftype handle-array (inline-array-class-uint64) + ((data0 handle :dynamic) + ) + ) + +;; definition for method 3 of type handle-array +(defmethod inspect ((this handle-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data0)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> handle-array heap-base) (the-as uint 8)) + +;; definition of type formation-object +(deftype formation-object (process-focusable) + ((object-list handle-array) + (num-objects int8) + (formation formation-layout) + (flags formation-object-flag) + (controller vehicle-controller :inline) + (alert-time-offset time-frame) + (dest-position vector :inline) + (formation-transform matrix :inline) + ) + (:state-methods + active + inactive + ) + (:methods + (formation-object-method-30 (_type_) symbol) + (formation-object-method-31 (_type_) float) + (formation-object-method-32 (_type_) float) + (formation-object-method-33 (_type_) float) + (formation-object-method-34 (_type_) float) + (formation-object-method-35 (_type_) symbol) + (get-leader-handle (_type_) handle) + (formation-object-method-37 (_type_) symbol) + (get-target-speed (_type_ process-focusable int) float) + (init-collision! (_type_) none) + (formation-object-method-40 (_type_ vector vector int) vector) + (formation-event-handler (_type_ process int symbol event-message-block) object) + (formation-object-method-42 (_type_ handle) symbol) + (formation-object-method-43 (_type_ int) none) + (formation-object-method-44 (_type_ int) object) + (formation-object-method-45 (_type_) symbol) + (clear-objects! (_type_) none) + (formation-object-method-47 (_type_ handle) object) + ) + ) + +;; definition for method 3 of type formation-object +(defmethod inspect ((this formation-object)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tobject-list: ~A~%" (-> this object-list)) + (format #t "~2Tnum-objects: ~D~%" (-> this num-objects)) + (format #t "~2Tformation: ~A~%" (-> this formation)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tcontroller: #~%" (-> this controller)) + (format #t "~2Talert-time-offset: ~D~%" (-> this alert-time-offset)) + (format #t "~2Tdest-position: #~%" (-> this dest-position)) + (format #t "~2Tformation-transform: #~%" (-> this formation-transform)) + (label cfg-4) + this + ) + +;; definition of type msg-get-num-inactive +(deftype msg-get-num-inactive (structure) + ((obj-type traffic-type) + (num-inactive-out int32) + ) + ) + +;; definition for method 3 of type msg-get-num-inactive +(defmethod inspect ((this msg-get-num-inactive)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'msg-get-num-inactive) + (format #t "~1Tobj-type: ~D~%" (-> this obj-type)) + (format #t "~1Tnum-inactive-out: ~D~%" (-> this num-inactive-out)) + (label cfg-4) + this + ) + +;; definition for method 30 of type formation-object +(defmethod formation-object-method-30 ((this formation-object)) + (let ((s5-0 (new 'stack-no-clear 'msg-get-num-inactive))) + (set! (-> s5-0 obj-type) (traffic-type guard-a)) + (send-event *traffic-manager* 'get-num-normal-available s5-0) + (>= (-> s5-0 num-inactive-out) (-> this formation num-formation-points)) + ) + ) + +;; definition for method 40 of type formation-object +(defmethod formation-object-method-40 ((this formation-object) (arg0 vector) (arg1 vector) (arg2 int)) + (when (and (>= arg2 0) (< arg2 (-> this num-objects))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-rotate*! s3-0 (-> this formation formation-points arg2) (-> this formation-transform)) + (vector+float*! arg0 arg1 s3-0 (-> this formation scale-factor)) + ) + ) + arg0 + ) + +;; definition for method 41 of type formation-object +;; INFO: Used lq/sq +;; WARN: Return type mismatch formation-object vs object. +(defmethod formation-event-handler ((this formation-object) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('member-attacked) + (dotimes (s5-1 (-> this num-objects)) + (let ((s4-0 (-> this object-list data0 s5-1))) + (if (formation-object-method-47 this s4-0) + (send-event (handle->process s4-0) 'member-attacked) + ) + ) + ) + ) + (('traffic-off) + (when (not (logtest? (-> this flags) (formation-object-flag fo0))) + ) + (set! this (the-as formation-object #f)) + (goto cfg-47) + ) + (('traffic-off-force) + (go (method-of-object this inactive)) + ) + (('get-leader-handle) + (-> arg3 param 0) + (get-leader-handle this) + ) + (('traffic-activate) + (cond + ((formation-object-method-45 this) + (matrix-identity! (-> this formation-transform)) + (let ((s5-2 (the-as traffic-object-spawn-params (-> arg3 param 0)))) + (let ((a1-3 (-> s5-2 nav-branch))) + (when a1-3 + (vehicle-controller-method-13 (-> this controller) a1-3 (-> this root trans)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (vector-! s4-1 (-> this controller turn-exit-point) (-> this root trans)) + (set! (-> s4-1 y) 0.0) + (vector-normalize! s4-1 1.0) + (forward-up->inv-matrix (-> this formation-transform) s4-1 *up-vector*) + ) + ) + ) + (set! (-> this root trans quad) (-> s5-2 position quad)) + (set! (-> s5-2 handle-parent) (process->handle this)) + (set! (-> s5-2 object-type) (traffic-type guard-a)) + (logior! (-> s5-2 flags) (traffic-spawn-flags tsf4)) + (dotimes (s4-2 (-> this num-objects)) + (set! (-> s5-2 handle) (-> this object-list data0 s4-2)) + (set! (-> s5-2 user-data) (the-as uint s4-2)) + (formation-object-method-40 this (-> s5-2 position) (-> this root trans) s4-2) + (send-event *traffic-manager* 'activate-specific-object s5-2) + (send-event (handle->process (-> s5-2 handle)) 'change-guard-type (-> this formation composition s4-2)) + ) + ) + (logclear! (-> this focus-status) (focus-status inactive)) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this inactive)) + (set! this (the-as formation-object #f)) + (goto cfg-47) + ) + ) + ) + ) + (label cfg-47) + this + ) + +;; definition for method 39 of type formation-object +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this formation-object)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 0.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for function formation-init-by-other +;; INFO: Used lq/sq +(defbehavior formation-init-by-other formation-object ((arg0 traffic-object-spawn-params)) + (stack-size-set! (-> self main-thread) 128) + (init-collision! self) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 rotation)) + (traffic-entity-hack (-> arg0 object-type)) + (set! (-> self formation) (new 'process 'formation-layout)) + (init! (-> self formation) (-> *formation-list* (logand (rand-uint31-gen *random-generator*) 1))) + (set! (-> self formation scale-factor) 20480.0) + (set! (-> self formation leader-index) 1) + (set! (-> self object-list) (new 'process 'handle-array (-> self formation num-formation-points))) + (clear-1 (-> self object-list)) + (set! (-> self num-objects) 0) + (vehicle-controller-method-9 (-> self controller)) + (go-virtual inactive) + ) + +;; definition for method 42 of type formation-object +(defmethod formation-object-method-42 ((this formation-object) (arg0 handle)) + (!= (push-back (-> this object-list) arg0) -1) + ) + +;; definition for method 44 of type formation-object +(defmethod formation-object-method-44 ((this formation-object) (arg0 int)) + (let ((gp-0 (-> this object-list data0 arg0))) + (pop-front (-> this object-list) arg0) + (when (formation-object-method-47 this gp-0) + (let* ((gp-1 (handle->process gp-0)) + (a0-6 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (send-event a0-6 'formation-exit) + ) + ) + ) + ) + +;; definition for method 43 of type formation-object +;; WARN: Return type mismatch object vs none. +(defmethod formation-object-method-43 ((this formation-object) (arg0 int)) + (let* ((gp-0 this) + (s5-0 (method-of-object gp-0 formation-object-method-44)) + ) + (dotimes (s2-0 arg0) + (case (-> this object-list data0 s2-0) + (((length (-> this object-list))) + (empty) + (goto cfg-7) + ) + ) + ) + (label cfg-7) + (s5-0 gp-0 -1) + ) + (none) + ) + +;; definition of type msg-get-inactive-objects +(deftype msg-get-inactive-objects (structure) + ((object-type-info-array (inline-array traffic-object-type-info)) + ) + ) + +;; definition for method 3 of type msg-get-inactive-objects +(defmethod inspect ((this msg-get-inactive-objects)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'msg-get-inactive-objects) + (format #t "~1Tobject-type-info-array: #x~X~%" (-> this object-type-info-array)) + (label cfg-4) + this + ) + +;; definition for symbol foo-hack, type symbol +(define foo-hack #t) + +;; definition for method 45 of type formation-object +(defmethod formation-object-method-45 ((this formation-object)) + (if (not foo-hack) + (return #f) + ) + (clear-objects! this) + (let ((s5-0 (new 'stack-no-clear 'msg-get-inactive-objects))) + (send-event *traffic-manager* 'get-inactive-object-list s5-0) + (let ((s5-1 (-> s5-0 object-type-info-array 6))) + (when (>= (-> s5-1 inactive-count) (-> this formation num-formation-points)) + (set! (-> this num-objects) (-> this formation num-formation-points)) + (dotimes (s4-0 (-> this num-objects)) + (push-back (-> this object-list) (-> s5-1 array s4-0)) + ) + (return #t) + ) + ) + ) + #f + ) + +;; definition for method 46 of type formation-object +;; WARN: Return type mismatch int vs none. +(defmethod clear-objects! ((this formation-object)) + (dotimes (s5-0 (-> this num-objects)) + (let ((s4-0 (-> this object-list data0 s5-0))) + (when (formation-object-method-47 this s4-0) + (let* ((s4-1 (handle->process s4-0)) + (a0-5 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (send-event a0-5 'formation-exit) + ) + ) + ) + ) + (clear-2 (-> this object-list)) + (set! (-> this num-objects) 0) + 0 + (none) + ) + +;; definition for method 47 of type formation-object +(defmethod formation-object-method-47 ((this formation-object) (arg0 handle)) + (let* ((s5-0 (handle->process arg0)) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (and v1-3 + (logtest? (-> (the-as citizen v1-3) flags) (citizen-flag in-formation)) + (= (-> (the-as citizen v1-3) vehicle) (process->handle this)) + ) + ) + ) + +;; definition for function formation-object-event-handler +(defbehavior formation-object-event-handler formation-object ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (formation-event-handler self arg0 arg1 arg2 arg3) + ) + +;; failed to figure out what this is: +(defstate inactive (formation-object) + :virtual #t + :event formation-object-event-handler + :enter (behavior () + (logior! (-> self focus-status) (focus-status inactive)) + (clear-objects! self) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status inactive)) + ) + :code sleep-code + ) + +;; definition for symbol random-var, type int +(define random-var 0) + +;; failed to figure out what this is: +(defstate active (formation-object) + :virtual #t + :event formation-object-event-handler + :enter (behavior () + (logclear! (-> self focus-status) (focus-status inactive)) + (set-time! (-> self state-time)) + (set! (-> self alert-time-offset) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.9 1.3))))) + (formation-object-method-40 + self + (-> self dest-position) + (-> self controller turn-exit-point) + (-> self formation leader-index) + ) + (formation-object-method-37 self) + ) + :trans (behavior () + (if (not (formation-object-method-35 self)) + (go-virtual inactive) + ) + (formation-object-method-34 self) + (let ((f30-0 (formation-object-method-33 self))) + (when (and (nonzero? (-> self controller branch)) + (< (vector-vector-xz-distance-squared (-> self root trans) (-> self dest-position)) (* f30-0 f30-0)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self controller turn-exit-point quad)) + (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) + (vector-! gp-0 (-> self controller turn-exit-point) s5-0) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (forward-up->inv-matrix (-> self formation-transform) gp-0 *up-vector*) + ) + (formation-object-method-40 + self + (-> self dest-position) + (-> self controller turn-exit-point) + (-> self formation leader-index) + ) + (formation-object-method-37 self) + ) + ) + (when (time-elapsed? (-> self state-time) (-> self alert-time-offset)) + (set! (-> self alert-time-offset) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.9 1.3))))) + (set-time! (-> self state-time)) + (when *traffic-manager* + (let ((gp-1 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> gp-1 sphere quad) (-> self root trans quad)) + (set! (-> gp-1 sphere r) 40960.0) + (vector-reset! (-> gp-1 velocity)) + (set! (-> gp-1 notify-radius) (formation-object-method-32 self)) + (set! (-> gp-1 danger-level) 1.0) + (set! (-> gp-1 decay-rate) 0.0) + (set! (-> gp-1 flags) (the-as uint 1)) + (set! (-> gp-1 danger-type) (the-as uint 0)) + (set! (-> gp-1 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere gp-1) + ) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 7 of type formation-object +;; WARN: Return type mismatch process-focusable vs formation-object. +(defmethod relocate ((this formation-object) (offset int)) + (if (nonzero? (-> this formation)) + (&+! (-> this formation) offset) + ) + (if (nonzero? (-> this object-list)) + (&+! (-> this object-list) offset) + ) + (the-as formation-object ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for method 31 of type formation-object +(defmethod formation-object-method-31 ((this formation-object)) + (* (-> this formation scale-factor) (-> this formation estimated-radius)) + ) + +;; definition for method 34 of type formation-object +;; INFO: Used lq/sq +(defmethod formation-object-method-34 ((this formation-object)) + (let* ((s5-0 (handle->process (-> this object-list data0 (-> this formation leader-index)))) + (a0-6 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if a0-6 + (set! (-> this root trans quad) (-> (get-trans (the-as process-focusable a0-6) 0) quad)) + ) + ) + (set! (-> this root trans y) (+ 20480.0 (-> this root trans y))) + ) + +;; definition for method 35 of type formation-object +(defmethod formation-object-method-35 ((this formation-object)) + (let ((gp-0 0)) + (dotimes (s4-0 (-> this num-objects)) + (let ((a1-0 (-> this object-list data0 s4-0))) + (cond + ((formation-object-method-47 this a1-0) + (+! gp-0 1) + ) + ((= s4-0 (-> this formation leader-index)) + (return #f) + ) + ) + ) + ) + (when (< gp-0 2) + ) + (>= gp-0 2) + ) + ) + +;; definition for method 36 of type formation-object +(defmethod get-leader-handle ((this formation-object)) + (-> this object-list data0 (-> this formation leader-index)) + ) + +;; definition for method 37 of type formation-object +(defmethod formation-object-method-37 ((this formation-object)) + (dotimes (s5-0 (-> this num-objects)) + (let ((s4-0 (handle->process (-> this object-list data0 s5-0)))) + (send-event + s4-0 + 'formation-set-destination + (formation-object-method-40 this (new 'stack-no-clear 'vector) (-> this controller turn-exit-point) s5-0) + ) + ) + ) + #f + ) + +;; definition for method 33 of type formation-object +(defmethod formation-object-method-33 ((this formation-object)) + (* 2.0 (+ 10240.0 (formation-object-method-31 this))) + ) + +;; definition for method 32 of type formation-object +(defmethod formation-object-method-32 ((this formation-object)) + (* 2.3 (+ 10240.0 (formation-object-method-31 this))) + ) + +;; definition for method 38 of type formation-object +(defmethod get-target-speed ((this formation-object) (arg0 process-focusable) (arg1 int)) + (process->handle arg0) + (let* ((s4-0 (get-trans arg0 0)) + (v1-6 + (formation-object-method-40 this (new 'stack-no-clear 'vector) *zero-vector* (-> this formation leader-index)) + ) + (a2-3 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) v1-6)) + (s3-0 (formation-object-method-40 this (new 'stack-no-clear 'vector) a2-3 arg1)) + (s5-1 + (formation-object-method-40 this (new 'stack-no-clear 'vector) (-> this controller turn-exit-point) arg1) + ) + (f30-1 (- (vector-vector-xz-distance s4-0 s5-1) (vector-vector-xz-distance s3-0 s5-1))) + (f1-0 (formation-object-method-31 this)) + (f0-2 (fmax 0.0 (fmin 1.8 (/ (fabs f30-1) f1-0)))) + (f0-3 (* 0.5555556 f0-2)) + (f1-4 1.0) + ) + (if (>= f0-3 0.07) + (set! f1-4 (cond + ((< 0.0 f30-1) + (let ((f0-6 (- 1.0 (* (- 1.0 f0-3) (- 1.0 f0-3))))) + (- (+ 1.0 (* 1.8 f0-6)) f0-6) + ) + ) + (else + (- (+ 1.0 (* 0.75 f0-3)) f0-3) + ) + ) + ) + ) + f1-4 + ) + ) diff --git a/test/decompiler/reference/jak3/levels/wascity/formations_REF.gc b/test/decompiler/reference/jak3/levels/wascity/formations_REF.gc new file mode 100644 index 0000000000..74a130f522 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/formations_REF.gc @@ -0,0 +1,126 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type formation-info +(deftype formation-info (structure) + ((composition (array uint8)) + (layout (array vector)) + ) + ) + +;; definition for method 3 of type formation-info +(defmethod inspect ((this formation-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'formation-info) + (format #t "~1Tcomposition: ~A~%" (-> this composition)) + (format #t "~1Tlayout: ~A~%" (-> this layout)) + (label cfg-4) + this + ) + +;; definition of type formation-layout +(deftype formation-layout (basic) + ((formation-points vector 10 :inline) + (num-formation-points int8) + (leader-index int8) + (__pad int16) + (scale-factor float) + (estimated-radius float) + (composition (array uint8)) + ) + (:methods + (init! (_type_ formation-info) none) + ) + ) + +;; definition for method 3 of type formation-layout +(defmethod inspect ((this formation-layout)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tformation-points[10] @ #x~X~%" (-> this formation-points)) + (format #t "~1Tnum-formation-points: ~D~%" (-> this num-formation-points)) + (format #t "~1Tleader-index: ~D~%" (-> this leader-index)) + (format #t "~1T__pad: ~D~%" (-> this __pad)) + (format #t "~1Tscale-factor: ~f~%" (-> this scale-factor)) + (format #t "~1Testimated-radius: ~f~%" (-> this estimated-radius)) + (format #t "~1Tcomposition: ~A~%" (-> this composition)) + (label cfg-4) + this + ) + +;; definition for method 9 of type formation-layout +;; INFO: Used lq/sq +;; WARN: Return type mismatch (array uint8) vs none. +(defmethod init! ((this formation-layout) (arg0 formation-info)) + (let* ((s4-0 (-> arg0 layout)) + (v1-1 (length s4-0)) + (f0-0 0.0) + ) + (dotimes (a0-2 v1-1) + (set! (-> this formation-points a0-2 quad) (-> s4-0 a0-2 quad)) + (let* ((a1-6 (-> this formation-points a0-2)) + (f1-3 (+ (* (-> a1-6 x) (-> a1-6 x)) (* (-> a1-6 z) (-> a1-6 z)))) + ) + (if (< f0-0 f1-3) + (set! f0-0 f1-3) + ) + ) + ) + (set! (-> this num-formation-points) v1-1) + (if (> v1-1 0) + (set! (-> this estimated-radius) (sqrtf f0-0)) + ) + ) + (set! (-> this composition) (-> arg0 composition)) + (none) + ) + +;; definition for symbol *formation-layout-cross*, type (array vector) +(define *formation-layout-cross* (new 'static 'boxed-array :type vector + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + +;; definition for symbol *formation-composition-cross*, type (array uint8) +(define *formation-composition-cross* (new 'static 'boxed-array :type uint8 #x1 #x2 #x1 #x1)) + +;; definition for symbol *formation-layout-wedge*, type (array vector) +(define *formation-layout-wedge* (new 'static 'boxed-array :type vector + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + +;; definition for symbol *formation-composition-wedge*, type (array uint8) +(define *formation-composition-wedge* (new 'static 'boxed-array :type uint8 #x2 #x1 #x1)) + +;; definition for symbol *formation-list*, type (inline-array formation-info) +(define *formation-list* + (new 'static 'inline-array formation-info 2 (new 'static 'formation-info) (new 'static 'formation-info)) + ) + +;; failed to figure out what this is: +(set! (-> *formation-list* 0 composition) *formation-composition-cross*) + +;; failed to figure out what this is: +(set! (-> *formation-list* 0 layout) *formation-layout-cross*) + +;; failed to figure out what this is: +(set! (-> *formation-list* 1 composition) *formation-composition-wedge*) + +;; failed to figure out what this is: +(set! (-> *formation-list* 1 layout) *formation-layout-wedge*) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/guard-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/guard-h_REF.gc new file mode 100644 index 0000000000..9932298a79 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/guard-h_REF.gc @@ -0,0 +1,396 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type guard-anim-info +(deftype guard-anim-info (structure) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) + ) + :pack-me + ) + +;; definition for method 3 of type guard-anim-info +(defmethod inspect ((this guard-anim-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'guard-anim-info) + (format #t "~1Tanim-index[2] @ #x~X~%" (-> this anim-index)) + (format #t "~1Tanim-index-front: ~D~%" (-> this anim-index-front)) + (format #t "~1Tanim-index-back: ~D~%" (-> this anim-index-back)) + (label cfg-4) + this + ) + +;; definition of type guard-global-info +(deftype guard-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (knocked-land int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim guard-anim-info 2 :inline) + (yellow-land-anim guard-anim-info 2 :inline) + (blue-hit-anim int32 1) + (pad uint8 4) + ) + ) + +;; definition for method 3 of type guard-global-info +(defmethod inspect ((this guard-global-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tknocked[2] @ #x~X~%" (-> this knocked)) + (format #t "~1Tknocked-land[2] @ #x~X~%" (-> this knocked-land)) + (format #t "~1Tanim-knocked-front: ~D~%" (-> this anim-knocked-front)) + (format #t "~1Tanim-knocked-back: ~D~%" (-> this anim-knocked-back)) + (format #t "~1Tanim-knocked-front-land: ~D~%" (-> this anim-knocked-front-land)) + (format #t "~1Tanim-knocked-back-land: ~D~%" (-> this anim-knocked-back-land)) + (format #t "~1Tyellow-hit-anim[2] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tyellow-land-anim[2] @ #x~X~%" (-> this yellow-land-anim)) + (format #t "~1Tblue-hit-anim[1] @ #x~X~%" (-> this blue-hit-anim)) + (label cfg-4) + this + ) + +;; definition of type guard-shoot-info +(deftype guard-shoot-info (structure) + ((anim-index int32) + (start float) + (end float) + ) + :pack-me + ) + +;; definition for method 3 of type guard-shoot-info +(defmethod inspect ((this guard-shoot-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'guard-shoot-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~1Tstart: ~f~%" (-> this start)) + (format #t "~1Tend: ~f~%" (-> this end)) + (label cfg-4) + this + ) + +;; definition of type range +(deftype range (structure) + ((start float) + (end float) + ) + ) + +;; definition for method 3 of type range +(defmethod inspect ((this range)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'range) + (format #t "~1Tstart: ~f~%" (-> this start)) + (format #t "~1Tend: ~f~%" (-> this end)) + (label cfg-4) + this + ) + +;; definition of type crimson-guard-collide-shape +(deftype crimson-guard-collide-shape (collide-shape-moving) + () + ) + +;; definition for method 3 of type crimson-guard-collide-shape +(defmethod inspect ((this crimson-guard-collide-shape)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) + (format #t "~1Tnav-radius: (meters ~m)~%" (-> this nav-radius)) + (format #t "~1Ttransv: ~`vector`P~%" (-> this transv)) + (format #t "~1Trotv: ~`vector`P~%" (-> this rotv)) + (format #t "~1Tscalev: ~`vector`P~%" (-> this scalev)) + (format #t "~1Tdir-targ: #~%" (-> this dir-targ)) + (format #t "~1Tangle-change-time: ~D~%" (-> this angle-change-time)) + (format #t "~1Told-y-angle-diff: ~f~%" (-> this old-y-angle-diff)) + (format #t "~1Tactor-hash-index: ~D~%" (-> this actor-hash-index)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tmax-iteration-count: ~D~%" (-> this max-iteration-count)) + (format #t "~1Tnav-flags: ~D~%" (-> this nav-flags)) + (format #t "~1Ttotal-prims: ~D~%" (-> this total-prims)) + (format #t "~1Tnum-riders: ~D~%" (-> this num-riders)) + (format #t "~1Tevent-self: ~A~%" (-> this event-self)) + (format #t "~1Tevent-other: ~A~%" (-> this event-other)) + (format #t "~1Troot-prim: ~A~%" (-> this root-prim)) + (format #t "~1Triders: #x~X~%" (-> this riders)) + (format #t "~1Tpenetrate-using: #x~X : (penetrate " (-> this penetrate-using)) + (penetrate->string (-> this penetrate-using)) + (format #t ")~%") + (format #t "~1Tpenetrated-by: #x~X : (penetrate " (-> this penetrated-by)) + (penetrate->string (-> this penetrated-by)) + (format #t ")~%") + (format #t "~1Tevent-priority: ~D~%" (-> this event-priority)) + (format #t "~1Trider-max-momentum: ~f~%" (-> this rider-max-momentum)) + (format #t "~1Trider-time: ~D~%" (-> this rider-time)) + (format #t "~1Trider-last-move: ~`vector`P~%" (-> this rider-last-move)) + (format #t "~1Ttrans-old: ~`vector`P~%" (-> this trans-old)) + (format #t "~1Tpoly-pat: #x~X~%" (-> this poly-pat)) + (format #t "~1Tcur-pat: #x~X~%" (-> this cur-pat)) + (format #t "~1Tground-pat: #x~X~%" (-> this ground-pat)) + (format #t "~1Tstatus: ~D~%" (-> this status)) + (format #t "~1Treaction: ~A~%" (-> this reaction)) + (format #t "~1Tno-reaction: ~A~%" (-> this no-reaction)) + (format #t "~1Tlocal-normal: ~`vector`P~%" (-> this local-normal)) + (format #t "~1Tsurface-normal: ~`vector`P~%" (-> this surface-normal)) + (format #t "~1Tpoly-normal: ~`vector`P~%" (-> this poly-normal)) + (format #t "~1Tground-poly-normal: ~`vector`P~%" (-> this ground-poly-normal)) + (format #t "~1Tgspot-pos: ~`vector`P~%" (-> this gspot-pos)) + (format #t "~1Tgspot-normal: ~`vector`P~%" (-> this gspot-normal)) + (format #t "~1Tground-touch-point: ~`vector`P~%" (-> this ground-touch-point)) + (format #t "~1Tground-impact-vel: (meters ~m)~%" (-> this ground-impact-vel)) + (format #t "~1Tsurface-angle: ~f~%" (-> this surface-angle)) + (format #t "~1Tpoly-angle: ~f~%" (-> this poly-angle)) + (format #t "~1Ttouch-angle: ~f~%" (-> this touch-angle)) + (format #t "~1Tcoverage: ~f~%" (-> this coverage)) + (format #t "~1Tdynam: ~A~%" (-> this dynam)) + (format #t "~1Tsurf: ~A~%" (-> this surf)) + (label cfg-4) + this + ) + +;; definition of type crimson-guard +(deftype crimson-guard (citizen) + ((squad ff-squad-control :override) + (root crimson-guard-collide-shape :override) + (info guard-global-info) + (hit-face uint32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (small-hit int32) + (yellow-anim uint32) + (guard-type guard-type) + (settings squad-unit-settings) + (next-time time-frame) + (last-time-see-target time-frame) + (joint joint-mod) + (joint-enable symbol) + (already-shot symbol) + (miss-amount float) + (l-control lightning-control) + (next-shot time-frame) + (anim-shoot guard-shoot-info 3 :inline) + (transport handle) + (transport-side uint32) + (target-flags uint8) + (target-pos vector :inline) + (target-pos-predict vector :inline) + (target-pos-predict-miss vector :inline) + (los-status uint64) + (target-vel-vec vector :inline) + (target-vel float) + (target-self vector :inline) + (target-self-xz vector :inline) + (target-self-dist float) + (target-self-xz-dist float) + (grenade-guard-min-player-dist float) + (flee-behavior flee-info :inline) + (last-check-player-time time-frame) + (num-times-reloading-interrupted int32) + (total-flee-time time-frame) + (last-fire-time time-frame) + (ammo-count int8) + (urgent-fire symbol) + (last-onscreen-time time-frame) + (target-y-angle float) + (rand-state-time time-frame) + (pursuit-start-time time-frame) + (last-visible-target-pos vector :inline) + (lazer-sound sound-id) + (move-position vector :inline) + (move-index int32) + (reloading-ammo handle) + (guard-riot-shield handle) + (guard-shield-rotate-y-degrees float) + (attack-hit-shield-type uint64) + (current-shield-logic uint64) + (target-status squad-target-status :inline) + (minimap connection-minimap) + (other-side symbol) + (last-choose-new-enemy-time time-frame) + (last-quick-target-spot-angle float) + (next-update-target-time time-frame) + (last-player-attack-time time-frame) + (player-attack-count int32) + ) + (:state-methods + get-up-front + get-up-back + search + attack + arrest + gun-shoot + grenade-throw + grenade-throw-post-reloading + grenade-throw-post-retreating + exit-transport + waiting-ambush + close-attack + attack-tazer + knocked-off-vehicle + roll-right + roll-left + close-attack-active + flee-danger + grenade-hostile + rifle-hostile + tazer-hostile + undefined0 + undefined1 + undefined2 + undefined3 + undefined4 + undefined5 + undefined6 + undefined7 + undefined8 + undefined9 + undefined10 + undefined11 + undefined12 + rifle-reload + ) + (:methods + (crimson-guard-method-251 (_type_) none) + (crimson-guard-method-252 (_type_) none) + (crimson-guard-method-253 (_type_) none) + (crimson-guard-method-254 (_type_) none) + (crimson-guard-method-255 (_type_) none) + (crimson-guard-method-256 (_type_) symbol) + (crimson-guard-method-257 (_type_) symbol) + (crimson-guard-method-258 (_type_ vector vector vector) int) + (crimson-guard-method-259 (_type_ vector) none) + (crimson-guard-method-260 (_type_) none) + (crimson-guard-method-261 (_type_) none) + (crimson-guard-method-262 (_type_) none) + (crimson-guard-method-263 (_type_) none) + (crimson-guard-method-264 (_type_) none) + (crimson-guard-method-265 (_type_ float) none) + (crimson-guard-method-266 (_type_ vector) float) + (crimson-guard-method-267 (_type_ guard-type symbol) none) + (crimson-guard-method-268 (_type_) object) + (crimson-guard-method-269 (_type_ process-focusable) object) + (crimson-guard-method-270 (_type_) symbol) + (crimson-guard-method-271 (_type_) symbol) + (crimson-guard-method-272 (_type_) symbol) + (crimson-guard-method-273 (_type_) none) + (crimson-guard-method-274 (_type_) none) + (crimson-guard-method-275 (_type_) none) + (crimson-guard-method-276 (_type_) none) + (crimson-guard-method-277 (_type_) none) + (crimson-guard-method-278 (_type_) none) + (crimson-guard-method-279 (_type_) none) + (crimson-guard-method-280 (_type_) symbol) + (crimson-guard-method-281 (_type_) none) + (crimson-guard-method-282 (_type_ vector traffic-target-formation (pointer float) int) symbol) + (crimson-guard-method-283 (_type_) float) + (crimson-guard-method-284 (_type_ vector) vector) + (crimson-guard-method-285 (_type_ int) int) + (crimson-guard-method-286 (_type_) int) + (crimson-guard-method-287 (_type_ process-focusable) float) + (crimson-guard-method-288 (_type_ process-focusable) float) + (crimson-guard-method-289 (_type_ float) none) + (crimson-guard-method-290 (_type_) process) + ) + ) + +;; definition for method 3 of type crimson-guard +(defmethod inspect ((this crimson-guard)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type citizen inspect))) + (t9-0 this) + ) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Thit-face: ~D~%" (-> this hit-face)) + (format #t "~2Tanim-get-up-front: ~D~%" (-> this anim-get-up-front)) + (format #t "~2Tanim-get-up-back: ~D~%" (-> this anim-get-up-back)) + (format #t "~2Tsmall-hit: ~D~%" (-> this small-hit)) + (format #t "~2Tyellow-anim: ~D~%" (-> this yellow-anim)) + (format #t "~2Tguard-type: ~D~%" (-> this guard-type)) + (format #t "~2Tsettings: #~%" (-> this settings)) + (format #t "~2Tnext-time: ~D~%" (-> this next-time)) + (format #t "~2Tlast-time-see-target: ~D~%" (-> this last-time-see-target)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Tjoint-enable: ~A~%" (-> this joint-enable)) + (format #t "~2Talready-shot: ~A~%" (-> this already-shot)) + (format #t "~2Tmiss-amount: ~f~%" (-> this miss-amount)) + (format #t "~2Tl-control: ~A~%" (-> this l-control)) + (format #t "~2Tnext-shot: ~D~%" (-> this next-shot)) + (format #t "~2Tanim-shoot[3] @ #x~X~%" (-> this anim-shoot)) + (format #t "~2Ttransport: ~D~%" (-> this transport)) + (format #t "~2Ttransport-side: ~D~%" (-> this transport-side)) + (format #t "~2Ttarget-flags: ~D~%" (-> this target-flags)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Ttarget-pos-predict: #~%" (-> this target-pos-predict)) + (format #t "~2Ttarget-pos-predict-miss: #~%" (-> this target-pos-predict-miss)) + (format #t "~2Tlos-status: ~D~%" (-> this los-status)) + (format #t "~2Ttarget-vel-vec: #~%" (-> this target-vel-vec)) + (format #t "~2Ttarget-vel: ~f~%" (-> this target-vel)) + (format #t "~2Ttarget-self: #~%" (-> this target-self)) + (format #t "~2Ttarget-self-xz: #~%" (-> this target-self-xz)) + (format #t "~2Ttarget-self-dist: ~f~%" (-> this target-self-dist)) + (format #t "~2Ttarget-self-xz-dist: ~f~%" (-> this target-self-xz-dist)) + (format #t "~2Tgrenade-guard-min-player-dist: ~f~%" (-> this grenade-guard-min-player-dist)) + (format #t "~2Tflee-behavior: #~%" (-> this flee-behavior)) + (format #t "~2Tlast-check-player-time: ~D~%" (-> this last-check-player-time)) + (format #t "~2Tnum-times-reloading-interrupted: ~D~%" (-> this num-times-reloading-interrupted)) + (format #t "~2Ttotal-flee-time: ~D~%" (-> this total-flee-time)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Tammo-count: ~D~%" (-> this ammo-count)) + (format #t "~2Turgent-fire: ~A~%" (-> this urgent-fire)) + (format #t "~2Tlast-onscreen-time: ~D~%" (-> this last-onscreen-time)) + (format #t "~2Ttarget-y-angle: ~f~%" (-> this target-y-angle)) + (format #t "~2Trand-state-time: ~D~%" (-> this rand-state-time)) + (format #t "~2Tpursuit-start-time: ~D~%" (-> this pursuit-start-time)) + (format #t "~2Tlast-visible-target-pos: #~%" (-> this last-visible-target-pos)) + (format #t "~2Tlazer-sound: ~D~%" (-> this lazer-sound)) + (format #t "~2Tmove-position: #~%" (-> this move-position)) + (format #t "~2Tmove-index: ~D~%" (-> this move-index)) + (format #t "~2Treloading-ammo: ~D~%" (-> this reloading-ammo)) + (format #t "~2Tguard-riot-shield: ~D~%" (-> this guard-riot-shield)) + (format #t "~2Tguard-shield-rotate-y-degrees: ~f~%" (-> this guard-shield-rotate-y-degrees)) + (format #t "~2Tattack-hit-shield-type: ~D~%" (-> this attack-hit-shield-type)) + (format #t "~2Tcurrent-shield-logic: ~D~%" (-> this current-shield-logic)) + (format #t "~2Ttarget-status: #~%" (-> this target-status)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tother-side: ~A~%" (-> this other-side)) + (format #t "~2Tlast-choose-new-enemy-time: ~D~%" (-> this last-choose-new-enemy-time)) + (format #t "~2Tlast-quick-target-spot-angle: ~f~%" (-> this last-quick-target-spot-angle)) + (format #t "~2Tnext-update-target-time: ~D~%" (-> this next-update-target-time)) + (format #t "~2Tlast-player-attack-time: ~D~%" (-> this last-player-attack-time)) + (format #t "~2Tplayer-attack-count: ~D~%" (-> this player-attack-count)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/levels/wascity/kg-squad-control-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/kg-squad-control-h_REF.gc new file mode 100644 index 0000000000..74d0f163a5 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/kg-squad-control-h_REF.gc @@ -0,0 +1,161 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type handle-array +(deftype handle-array (inline-array-class-uint64) + ((data0 handle :dynamic) + ) + ) + +;; definition for method 3 of type handle-array +(defmethod inspect ((this handle-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data0)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> handle-array heap-base) (the-as uint 8)) + +;; definition of type kg-squad-member-settings +(deftype kg-squad-member-settings (structure) + ((object-type traffic-type) + (max-target-count int8) + (min-target-count int8) + (target-count int8) + (enemy-type traffic-type) + (toggle-shield-percentage float) + (heat-shield-percentage float) + ) + ) + +;; definition for method 3 of type kg-squad-member-settings +(defmethod inspect ((this kg-squad-member-settings)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'kg-squad-member-settings) + (format #t "~1Tobject-type: ~D~%" (-> this object-type)) + (format #t "~1Tmax-target-count: ~D~%" (-> this max-target-count)) + (format #t "~1Tmin-target-count: ~D~%" (-> this min-target-count)) + (format #t "~1Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~1Tenemy-type: ~D~%" (-> this enemy-type)) + (format #t "~1Ttoggle-shield-percentage: ~f~%" (-> this toggle-shield-percentage)) + (format #t "~1Theat-shield-percentage: ~f~%" (-> this heat-shield-percentage)) + (label cfg-4) + this + ) + +;; definition of type kg-squad-settings +(deftype kg-squad-settings (structure) + ((roboguard-settings kg-squad-member-settings :inline) + (roboguard-giant-settings kg-squad-member-settings :inline) + (flying-turret-settings kg-squad-member-settings :inline) + (spydroid-settings kg-squad-member-settings :inline) + (kg-enemy-settings kg-squad-member-settings 4 :inline :overlay-at roboguard-settings) + ) + ) + +;; definition for method 3 of type kg-squad-settings +(defmethod inspect ((this kg-squad-settings)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'kg-squad-settings) + (format #t "~1Troboguard-settings: #~%" (-> this roboguard-settings)) + (format + #t + "~1Troboguard-giant-settings: #~%" + (-> this roboguard-giant-settings) + ) + (format #t "~1Tflying-turret-settings: #~%" (-> this flying-turret-settings)) + (format #t "~1Tspydroid-settings: #~%" (-> this spydroid-settings)) + (format #t "~1Tkg-enemy-settings[4] @ #x~X~%" (-> this roboguard-settings)) + (label cfg-4) + this + ) + +;; definition of type kg-squad-control +(deftype kg-squad-control (squad-control-city) + ((guard-to-traffic-mapping traffic-type 10) + (guard-to-squad-setting-mapping uint8 10) + (used-guard-types kg-squad-used-guard-types) + (active-squad-member-list handle-array :offset 852) + (enemy-type-seek-to-list uint8 3) + (enemy-type-seek-from-list uint8 3) + (enemy-type-seek-to uint8 :overlay-at (-> enemy-type-seek-to-list 0)) + (enemy-type-seek-from uint8 :overlay-at (-> enemy-type-seek-from-list 0)) + (enemy-type-seek-to-war uint8 :overlay-at (-> enemy-type-seek-to-list 1)) + (enemy-type-seek-from-war uint8 :overlay-at (-> enemy-type-seek-from-list 1)) + (enemy-type-seek-to-mission uint8 :overlay-at (-> enemy-type-seek-to-list 2)) + (enemy-type-seek-from-mission uint8 :overlay-at (-> enemy-type-seek-from-list 2)) + (alert-level int8) + (squad-settings kg-squad-settings 3 :inline) + (squad-normal-settings kg-squad-settings :inline :overlay-at (-> squad-settings 0)) + (squad-war-settings kg-squad-settings :inline :overlay-at (-> squad-settings 1)) + (squad-mission-settings kg-squad-settings :inline :overlay-at (-> squad-settings 2)) + (current-target-attackers int8) + ) + (:methods + (increment-alert-level (_type_ int) int) + (set-alert-level1 (_type_ int) int) + (add-squad-member (_type_ process) int) + (pop-squad-member-from-list (_type_ process) int) + (get-alert-level1 (_type_) int) + (copy-squad-settings-to-idx (_type_ (inline-array kg-squad-member-settings) int) none) + (kg-squad-control-method-51 (_type_) symbol) + (kg-squad-control-method-52 (_type_ process process) int) + (kg-squad-control-method-53 (_type_) none) + (kg-squad-control-method-54 (_type_) float) + ) + ) + +;; definition for method 3 of type kg-squad-control +(defmethod inspect ((this kg-squad-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tsync-clock: ~D~%" (-> this sync-clock)) + (format #t "~1Tsync-mask-8: ~D~%" (-> this sync-mask-8)) + (format #t "~1Tsync-mask-16: ~D~%" (-> this sync-mask-16)) + (format #t "~1Tsync-mask-32: ~D~%" (-> this sync-mask-32)) + (format #t "~1Talert-state: #~%" (-> this alert-state)) + (format #t "~1Tprimary-target-history[16] @ #x~X~%" (-> this primary-target-history)) + (format #t "~1Ttraffic: ~A~%" (-> this traffic)) + (format #t "~1Tcity-mode: ~D~%" (-> this city-mode)) + (format #t "~1Tguard-to-traffic-mapping[10] @ #x~X~%" (-> this guard-to-traffic-mapping)) + (format #t "~1Tguard-to-squad-setting-mapping[10] @ #x~X~%" (-> this guard-to-squad-setting-mapping)) + (format #t "~1Tused-guard-types: ~D~%" (-> this used-guard-types)) + (format #t "~1Ttraffic: ~A~%" (-> this traffic)) + (format #t "~1Tactive-squad-member-list: ~A~%" (-> this active-squad-member-list)) + (format #t "~1Tenemy-type-seek-to-list[3] @ #x~X~%" (-> this enemy-type-seek-to-list)) + (format #t "~1Tenemy-type-seek-from-list[3] @ #x~X~%" (-> this enemy-type-seek-from-list)) + (format #t "~1Tenemy-type-seek-to: ~D~%" (-> this enemy-type-seek-to)) + (format #t "~1Tenemy-type-seek-from: ~D~%" (-> this enemy-type-seek-from)) + (format #t "~1Tenemy-type-seek-to-war: ~D~%" (-> this enemy-type-seek-to-war)) + (format #t "~1Tenemy-type-seek-from-war: ~D~%" (-> this enemy-type-seek-from-war)) + (format #t "~1Tenemy-type-seek-to-mission: ~D~%" (-> this enemy-type-seek-to-mission)) + (format #t "~1Tenemy-type-seek-from-mission: ~D~%" (-> this enemy-type-seek-from-mission)) + (format #t "~1Talert-level: ~D~%" (-> this alert-level)) + (format #t "~1Tsquad-settings[3] @ #x~X~%" (-> this squad-settings)) + (format #t "~1Tsquad-normal-settings: #~%" (-> this squad-settings)) + (format #t "~1Tsquad-war-settings: #~%" (-> this squad-war-settings)) + (format #t "~1Tsquad-mission-settings: #~%" (-> this squad-mission-settings)) + (format #t "~1Tcurrent-target-attackers: ~D~%" (-> this current-target-attackers)) + (label cfg-4) + this + ) + +;; definition for symbol *kg-squad-control*, type kg-squad-control +(define *kg-squad-control* (the-as kg-squad-control #f)) diff --git a/test/decompiler/reference/jak3/levels/wascity/mh-squad-control-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/mh-squad-control-h_REF.gc new file mode 100644 index 0000000000..f555046c25 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/mh-squad-control-h_REF.gc @@ -0,0 +1,104 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mh-squad-member-settings +(deftype mh-squad-member-settings (structure) + ((object-type traffic-type) + (max-target-count int8) + (min-target-count int8) + (target-count int8) + (toggle-shield-percentage float) + (heat-shield-percentage float) + ) + ) + +;; definition for method 3 of type mh-squad-member-settings +(defmethod inspect ((this mh-squad-member-settings)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mh-squad-member-settings) + (format #t "~1Tobject-type: ~D~%" (-> this object-type)) + (format #t "~1Tmax-target-count: ~D~%" (-> this max-target-count)) + (format #t "~1Tmin-target-count: ~D~%" (-> this min-target-count)) + (format #t "~1Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~1Ttoggle-shield-percentage: ~f~%" (-> this toggle-shield-percentage)) + (format #t "~1Theat-shield-percentage: ~f~%" (-> this heat-shield-percentage)) + (label cfg-4) + this + ) + +;; definition of type mh-squad-settings +(deftype mh-squad-settings (structure) + ((mh-enemy-settings mh-squad-member-settings 3 :inline) + (grunt-settings mh-squad-member-settings :inline :overlay-at (-> mh-enemy-settings 0)) + (flitter-settings mh-squad-member-settings :inline :offset 16) + (predator-settings mh-squad-member-settings :inline :offset 32) + ) + ) + +;; definition for method 3 of type mh-squad-settings +(defmethod inspect ((this mh-squad-settings)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mh-squad-settings) + (format #t "~1Tmh-enemy-settings[3] @ #x~X~%" (-> this grunt-settings)) + (format #t "~1Tgrunt-settings: #~%" (-> this grunt-settings)) + (format #t "~1Tflitter-settings: #~%" (-> this flitter-settings)) + (format #t "~1Tpredator-settings: #~%" (-> this predator-settings)) + (label cfg-4) + this + ) + +;; definition of type mh-squad-control +(deftype mh-squad-control (squad-control-city) + ((active-squad-member-list handle-array :offset 828) + (squad-settings mh-squad-settings 3 :inline) + (squad-normal-settings mh-squad-settings :inline :overlay-at (-> squad-settings 0)) + (squad-war-settings mh-squad-settings :inline :overlay-at (-> squad-settings 1)) + (squad-mission-settings mh-squad-settings :inline :overlay-at (-> squad-settings 2)) + (alert-level int8) + (map-traffic-object-type-to-squad traffic-type 29) + (current-target-attackers int8) + ) + (:methods + (add-squad-member (_type_ process) int) + (pop-squad-member-from-list (_type_ process) int) + (copy-squad-settings-to-idx (_type_ (inline-array mh-squad-member-settings) int) none) + (mh-squad-control-method-48 (_type_) symbol) + ) + ) + +;; definition for method 3 of type mh-squad-control +(defmethod inspect ((this mh-squad-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tsync-clock: ~D~%" (-> this sync-clock)) + (format #t "~1Tsync-mask-8: ~D~%" (-> this sync-mask-8)) + (format #t "~1Tsync-mask-16: ~D~%" (-> this sync-mask-16)) + (format #t "~1Tsync-mask-32: ~D~%" (-> this sync-mask-32)) + (format #t "~1Talert-state: #~%" (-> this alert-state)) + (format #t "~1Tprimary-target-history[16] @ #x~X~%" (-> this primary-target-history)) + (format #t "~1Ttraffic: ~A~%" (-> this traffic)) + (format #t "~1Tcity-mode: ~D~%" (-> this city-mode)) + (format #t "~1Ttraffic: ~A~%" (-> this traffic)) + (format #t "~1Tactive-squad-member-list: ~A~%" (-> this active-squad-member-list)) + (format #t "~1Tsquad-settings[3] @ #x~X~%" (-> this squad-settings)) + (format #t "~1Tsquad-normal-settings: #~%" (-> this squad-settings)) + (format #t "~1Tsquad-war-settings: #~%" (-> this squad-war-settings)) + (format #t "~1Tsquad-mission-settings: #~%" (-> this squad-mission-settings)) + (format #t "~1Talert-level: ~D~%" (-> this alert-level)) + (format #t "~1Tmap-traffic-object-type-to-squad[29] @ #x~X~%" (-> this map-traffic-object-type-to-squad)) + (format #t "~1Tcurrent-target-attackers: ~D~%" (-> this current-target-attackers)) + (label cfg-4) + this + ) + +;; definition for symbol *mh-squad-control*, type mh-squad-control +(define *mh-squad-control* (the-as mh-squad-control #f)) diff --git a/test/decompiler/reference/jak3/levels/wascity/mission-squad-control-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/mission-squad-control-h_REF.gc index 067561dbb3..4b4b3fe802 100644 --- a/test/decompiler/reference/jak3/levels/wascity/mission-squad-control-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/mission-squad-control-h_REF.gc @@ -13,12 +13,12 @@ (enemy-type int16) (self-index int16) (enemy-index int16) - (callback function) - (hatred-map-callback function) + (callback (function process city-attacker-info int)) + (hatred-map-callback (function process city-attacker-info int)) ) (:methods - (city-attacker-info-method-9 () none) - (city-attacker-info-method-10 () none) + (init! (_type_ process int) none) + (reset! (_type_) none) ) ) @@ -48,9 +48,10 @@ ;; definition of type city-attacker-cache (deftype city-attacker-cache (structure) ((pos vector) - (proc basic) + (proc process) (attackable? symbol) ) + :pack-me ) ;; definition for method 3 of type city-attacker-cache @@ -78,6 +79,7 @@ (index uint8) (pad uint8) ) + :pack-me ) ;; definition for method 3 of type city-hatred-info @@ -171,29 +173,29 @@ ;; definition of type mission-squad-control (deftype mission-squad-control (basic) ((attackers city-attacker-array) - (unused-list basic) - (hatred-vals basic) - (hatred-indices basic) + (unused-list (array int16)) + (hatred-vals city-hatred-array) + (hatred-indices (array uint8)) (attacker-cache city-attacker-cache-array) (target-attacker city-attacker-info) (max-num-object-types int32) ) (:methods - (mission-squad-control-method-9 () none) - (mission-squad-control-method-10 () none) - (mission-squad-control-method-11 () none) - (mission-squad-control-method-12 () none) - (mission-squad-control-method-13 () none) - (mission-squad-control-method-14 () none) - (mission-squad-control-method-15 () none) - (mission-squad-control-method-16 () none) - (mission-squad-control-method-17 () none) - (mission-squad-control-method-18 () none) - (mission-squad-control-method-19 () none) - (mission-squad-control-method-20 () none) - (mission-squad-control-method-21 () none) - (mission-squad-control-method-22 () none) - (mission-squad-control-method-23 () none) + (init! (_type_ int int int) none) + (allocate-attacker (_type_) city-attacker-info) + (remove-attacker (_type_ city-attacker-info) none) + (mission-squad-control-method-12 (_type_) symbol) + (mission-squad-control-method-13 (_type_ city-attacker-info) int) + (init-attackers (_type_) none) + (init-attack-controller (_type_) none) + (mission-squad-control-method-16 (_type_) none) + (set-hatred-indices-for-all (_type_ int city-hatred-info city-hatred-info int) symbol) + (get-attacker-at-idx (_type_ int) city-attacker-info) + (push-back-hatred (_type_) city-hatred-info) + (set-hatred-indices (_type_ city-hatred-info int int) uint) + (get-hatred-at-idx (_type_ int int) city-hatred-info) + (update-attack-target (_type_) none) + (reset-hatred (_type_) none) ) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/mission-squad-control_REF.gc b/test/decompiler/reference/jak3/levels/wascity/mission-squad-control_REF.gc new file mode 100644 index 0000000000..809eb20d25 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/mission-squad-control_REF.gc @@ -0,0 +1,396 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type mission-squad-control +(defmethod init! ((this mission-squad-control) (arg0 int) (arg1 int) (arg2 int)) + (set! (-> this attackers) (new 'loading-level 'city-attacker-array arg0)) + (set! (-> this attacker-cache) (new 'loading-level 'city-attacker-cache-array arg0)) + (set! (-> this unused-list) (new 'loading-level 'boxed-array int16 arg0)) + (set! (-> this hatred-vals) (new 'loading-level 'city-hatred-array arg2)) + (set! (-> this hatred-indices) (new 'loading-level 'boxed-array uint8 (* arg1 arg1))) + (set! (-> this max-num-object-types) arg1) + (init-attackers this) + (none) + ) + +;; definition for method 10 of type city-attacker-info +;; WARN: Return type mismatch symbol vs none. +(defmethod reset! ((this city-attacker-info)) + (set! (-> this proc) (the-as handle #f)) + (set! (-> this enemy) (the-as handle #f)) + (set! (-> this next-update-target-time) 0) + (set! (-> this flags) (city-attacker-info-flag)) + (set! (-> this num-current-attackers) (the-as uint 0)) + (set! (-> this self-type) -1) + (set! (-> this enemy-type) -1) + (set! (-> this enemy-index) -1) + (set! (-> this callback) #f) + (set! (-> this hatred-map-callback) #f) + (none) + ) + +;; definition for method 14 of type mission-squad-control +(defmethod init-attackers ((this mission-squad-control)) + (set! (-> this attackers length) (-> this attackers allocated-length)) + (dotimes (s5-0 (-> this attackers length)) + (reset! (-> this attackers data s5-0)) + (set! (-> this attackers data s5-0 self-index) s5-0) + (set! (-> this unused-list s5-0) s5-0) + ) + (set! (-> this unused-list length) (-> this unused-list allocated-length)) + (set! (-> this target-attacker) (allocate-attacker this)) + (set! (-> this target-attacker flags) (city-attacker-info-flag)) + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai1)) + (set! (-> this target-attacker max-num-attackers) (the-as uint 4)) + (reset-hatred this) + (none) + ) + +;; definition for method 23 of type mission-squad-control +;; WARN: Return type mismatch city-hatred-info-flag vs none. +(defmethod reset-hatred ((this mission-squad-control)) + (set! (-> this hatred-vals length) 1) + (dotimes (v1-1 (-> this hatred-indices length)) + (set! (-> this hatred-indices v1-1) (the-as uint 0)) + ) + (set! (-> this target-attacker flags) (city-attacker-info-flag)) + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai1)) + (logior! (-> this hatred-vals data 0 flags) (city-hatred-info-flag chi0)) + (none) + ) + +;; definition for method 10 of type mission-squad-control +(defmethod allocate-attacker ((this mission-squad-control)) + (let ((gp-0 (the-as city-attacker-info #f))) + (cond + ((> (-> this unused-list length) 0) + (let ((v1-7 (-> this unused-list (+ (-> this unused-list length) -1)))) + (set! gp-0 (-> this attackers data v1-7)) + ) + (+! (-> this unused-list length) -1) + ) + (else + (format 0 "!!!! Unable to allocate new attacker for mission squad!~%") + ) + ) + gp-0 + ) + ) + +;; definition for method 11 of type mission-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod remove-attacker ((this mission-squad-control) (arg0 city-attacker-info)) + (let ((s5-0 (-> arg0 self-index))) + (when (and (>= s5-0 0) (< s5-0 (-> this attackers length))) + (dotimes (v1-3 (-> this attackers length)) + (let ((a0-5 (-> this attackers data v1-3))) + (when (= (-> a0-5 enemy-index) s5-0) + (set! (-> a0-5 enemy-index) -1) + (set! (-> a0-5 enemy) (the-as handle #f)) + (logior! (-> a0-5 flags) (city-attacker-info-flag cai2)) + ) + ) + ) + (let ((v1-6 (-> arg0 enemy-index))) + (when (and (>= v1-6 0) (< v1-6 (-> this attackers length))) + (let ((v1-9 (-> this attackers data v1-6))) + (+! (-> v1-9 num-current-attackers) -1) + ) + ) + ) + (reset! arg0) + (set! (-> this unused-list (-> this unused-list length)) s5-0) + (+! (-> this unused-list length) 1) + ) + ) + (none) + ) + +;; definition for method 9 of type city-attacker-info +;; WARN: Return type mismatch symbol vs none. +(defmethod init! ((this city-attacker-info) (arg0 process) (arg1 int)) + (set! (-> this proc) (process->handle arg0)) + (set! (-> this self-type) arg1) + (set! (-> this enemy) (the-as handle #f)) + (logior! (-> this flags) (city-attacker-info-flag cai0)) + (set! (-> this next-update-target-time) 0) + (set! (-> this num-current-attackers) (the-as uint 0)) + (set! (-> this max-num-attackers) (the-as uint 127)) + (set! (-> this enemy-index) -1) + (set! (-> this callback) #f) + (none) + ) + +;; definition for method 13 of type mission-squad-control +(defmethod mission-squad-control-method-13 ((this mission-squad-control) (arg0 city-attacker-info)) + (local-vars (v0-3 int)) + (let ((f30-0 0.0) + (gp-0 -1) + ) + (dotimes (s3-0 (-> this attackers length)) + (let ((s2-0 (-> this attackers data s3-0))) + (when (and (!= (-> arg0 self-index) s3-0) + (logtest? (-> s2-0 flags) (city-attacker-info-flag cai0)) + (not (logtest? (-> s2-0 flags) (city-attacker-info-flag cai3))) + (-> this attacker-cache data s3-0 attackable?) + ) + (let ((v1-11 -1)) + (if (-> arg0 hatred-map-callback) + (set! v1-11 ((-> arg0 hatred-map-callback) (handle->process (-> arg0 proc)) s2-0)) + ) + (if (< v1-11 0) + (set! v1-11 + (the-as + int + (-> this hatred-indices (+ (* (-> arg0 self-type) (-> this max-num-object-types)) (-> s2-0 self-type))) + ) + ) + ) + (when (> v1-11 0) + (let ((s1-0 (-> this hatred-vals data v1-11))) + (when (and (not (logtest? (-> s1-0 flags) (city-hatred-info-flag chi0))) + (or (not (-> arg0 callback)) ((-> arg0 callback) (handle->process (-> arg0 proc)) s2-0)) + ) + (let ((f28-0 (-> s1-0 hatred))) + 1.0 + (let ((f0-1 1.0) + (v1-30 (-> s2-0 num-current-attackers)) + ) + (if (= (-> arg0 enemy-index) s3-0) + (+! v1-30 -1) + ) + (let* ((f1-2 (/ (the float v1-30) (the float (-> s2-0 max-num-attackers)))) + (f2-3 (fmin 1.0 f1-2)) + (f1-3 1.0) + (f26-0 (+ f1-3 (* f2-3 (- (-> s1-0 attacker-scale) f1-3)))) + ) + (when (< (-> s1-0 dist-scale) 1.0) + (let* ((f1-6 (vector-vector-xz-distance + (-> this attacker-cache data (-> arg0 self-index) pos) + (-> this attacker-cache data s3-0 pos) + ) + ) + (f0-3 (/ f1-6 (-> s1-0 hatred-dist))) + ) + (set! f0-1 (cond + ((>= f1-6 (-> s1-0 max-consider-dist)) + 0.0 + ) + (else + (let ((f1-8 (fmin 1.0 f0-3)) + (f0-4 1.0) + ) + (+ f0-4 (* f1-8 (- (-> s1-0 dist-scale) f0-4))) + ) + ) + ) + ) + ) + ) + (let ((f0-7 (* f28-0 (* f26-0 f0-1)))) + (if (= s3-0 (-> arg0 enemy-index)) + (set! f0-7 (* 2.0 f0-7)) + ) + (when (< f30-0 f0-7) + (set! f30-0 f0-7) + (set! gp-0 s3-0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (when #t + (when (!= gp-0 (-> arg0 enemy-index)) + (when (and (>= (-> arg0 enemy-index) 0) (< gp-0 0)) + (if (logtest? (-> this attackers data (-> arg0 enemy-index) flags) (city-attacker-info-flag cai5)) + (return 0) + ) + ) + (if (>= (-> arg0 enemy-index) 0) + (+! (-> this attackers data (-> arg0 enemy-index) num-current-attackers) -1) + ) + (logior! (-> arg0 flags) (city-attacker-info-flag cai2)) + (set! (-> arg0 enemy-index) gp-0) + (cond + ((>= gp-0 0) + (set! (-> arg0 enemy) (-> this attackers data gp-0 proc)) + (set! (-> arg0 enemy-type) (-> this attackers data gp-0 self-type)) + (set! v0-3 (the-as int (+ (-> this attackers data gp-0 num-current-attackers) 1))) + (set! (-> this attackers data gp-0 num-current-attackers) (the-as uint v0-3)) + ) + (else + (set! (-> arg0 enemy) (the-as handle #f)) + (set! v0-3 -1) + (set! (-> arg0 enemy-type) v0-3) + ) + ) + v0-3 + ) + ) + ) + ) + +;; definition for method 12 of type mission-squad-control +(defmethod mission-squad-control-method-12 ((this mission-squad-control)) + (dotimes (s5-0 (-> this attackers length)) + (let ((a1-0 (-> this attackers data s5-0))) + (when (logtest? (-> a1-0 flags) (city-attacker-info-flag cai0)) + (let ((v1-6 (handle->process (-> a1-0 proc)))) + (cond + (v1-6 + (set! (-> this attacker-cache data s5-0 proc) v1-6) + (set! (-> this attacker-cache data s5-0 pos) (-> (the-as process-drawable v1-6) root trans)) + (set! (-> this attacker-cache data s5-0 attackable?) + (or (= (-> v1-6 type) target) + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead inactive))) + ) + ) + ) + ((!= (-> a1-0 self-index) (-> this target-attacker self-index)) + (remove-attacker this a1-0) + ) + ) + ) + ) + ) + ) + (dotimes (s5-1 (-> this attackers length)) + (let ((a1-9 (-> this attackers data s5-1))) + (when (logtest? (-> a1-9 flags) (city-attacker-info-flag cai0)) + (if (and (not (logtest? (-> a1-9 flags) (city-attacker-info-flag cai1))) + (or (< (-> a1-9 enemy-index) 0) + (not (logtest? (-> this attackers data (-> a1-9 enemy-index) flags) (city-attacker-info-flag cai0))) + (and (< (-> a1-9 next-update-target-time) (current-time)) + (let ((a0-29 + (-> this hatred-indices (+ (* (-> a1-9 self-type) (-> this max-num-object-types)) (-> a1-9 enemy-type))) + ) + ) + (or (when (> a0-29 0) + (let ((a0-31 (-> this hatred-vals data a0-29))) + (not (logtest? (-> a0-31 flags) (city-hatred-info-flag chi1))) + ) + ) + (-> a1-9 hatred-map-callback) + ) + ) + ) + ) + ) + (mission-squad-control-method-13 this a1-9) + ) + ) + ) + ) + #f + ) + +;; definition for method 22 of type mission-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod update-attack-target ((this mission-squad-control)) + (cond + ((or (not *target*) (focus-test? *target* disable dead inactive)) + (logclear! (-> this target-attacker flags) (city-attacker-info-flag cai0)) + (logclear! (-> this target-attacker flags) (city-attacker-info-flag cai5)) + ) + ((or (not *target*) (focus-test? *target* ignore)) + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai0)) + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai5)) + ) + (else + (logior! (-> this target-attacker flags) (city-attacker-info-flag cai0 cai1 cai4)) + (logclear! (-> this target-attacker flags) (city-attacker-info-flag cai5)) + (set! (-> this target-attacker self-type) 0) + (set! (-> this target-attacker proc) (process->handle *target*)) + ) + ) + (none) + ) + +;; definition for method 16 of type mission-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod mission-squad-control-method-16 ((this mission-squad-control)) + (update-attack-target this) + (mission-squad-control-method-12 this) + 0 + (none) + ) + +;; definition for method 21 of type mission-squad-control +(defmethod get-hatred-at-idx ((this mission-squad-control) (arg0 int) (arg1 int)) + (-> this hatred-vals data (-> this hatred-indices (+ (* arg0 (-> this max-num-object-types)) arg1))) + ) + +;; definition for method 19 of type mission-squad-control +;; WARN: Return type mismatch object vs city-hatred-info. +(defmethod push-back-hatred ((this mission-squad-control)) + (the-as city-hatred-info (cond + ((= (-> this hatred-vals length) (-> this hatred-vals allocated-length)) + (break!) + (-> this hatred-vals data) + ) + (else + (let ((v1-4 (-> this hatred-vals length))) + (set! (-> this hatred-vals data v1-4 index) (the-as uint v1-4)) + (+! (-> this hatred-vals length) 1) + (-> this hatred-vals data v1-4) + ) + ) + ) + ) + ) + +;; definition for method 20 of type mission-squad-control +(defmethod set-hatred-indices ((this mission-squad-control) (arg0 city-hatred-info) (arg1 int) (arg2 int)) + (let ((v0-0 (-> arg0 index))) + (set! (-> this hatred-indices (+ (* arg1 (-> this max-num-object-types)) arg2)) v0-0) + v0-0 + ) + ) + +;; definition for method 15 of type mission-squad-control +;; WARN: Return type mismatch int vs none. +(defmethod init-attack-controller ((this mission-squad-control)) + 0 + (none) + ) + +;; definition for method 17 of type mission-squad-control +(defmethod set-hatred-indices-for-all ((this mission-squad-control) (arg0 int) (arg1 city-hatred-info) (arg2 city-hatred-info) (arg3 int)) + (dotimes (s1-0 (-> this max-num-object-types)) + (let ((a0-2 (get-hatred-at-idx this s1-0 arg0))) + (if (= (-> a0-2 index) (-> arg1 index)) + (set-hatred-indices this arg2 s1-0 arg3) + ) + ) + ) + #f + ) + +;; definition for method 18 of type mission-squad-control +(defmethod get-attacker-at-idx ((this mission-squad-control) (arg0 int)) + (if (or (< arg0 0) (>= arg0 (-> this attackers length))) + (return (the-as city-attacker-info #f)) + ) + (let ((v0-0 (-> this attackers data arg0))) + (cond + ((= (-> v0-0 self-type) -1) + (the-as city-attacker-info #f) + ) + (else + (empty) + v0-0 + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/squad-control-city-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/squad-control-city-h_REF.gc new file mode 100644 index 0000000000..87a7660928 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/squad-control-city-h_REF.gc @@ -0,0 +1,44 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type squad-control-city +(deftype squad-control-city (squad-control) + ((traffic traffic-engine) + (city-mode squad-city-mode) + ) + (:methods + (squad-control-city-method-34 (_type_) symbol) + (squad-control-city-method-35 (_type_ citizen handle) process-focusable) + (get-city-mode (_type_) squad-city-mode) + (squad-control-city-method-37 (_type_) none) + (squad-control-city-method-38 (_type_ process-focusable process-focusable) symbol) + (squad-control-city-method-39 (_type_ process-focusable process-focusable) float) + (squad-control-city-method-40 (_type_ process-focusable process-focusable) none) + (squad-control-city-method-41 (_type_ process-focusable process-focusable) symbol) + (squad-control-city-method-42 (_type_) float) + (squad-control-city-method-43 (_type_ process-focusable) symbol) + (add-squad-to-traffic-engine (_type_ traffic-engine) none) + ) + ) + +;; definition for method 3 of type squad-control-city +(defmethod inspect ((this squad-control-city)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tsync-clock: ~D~%" (-> this sync-clock)) + (format #t "~1Tsync-mask-8: ~D~%" (-> this sync-mask-8)) + (format #t "~1Tsync-mask-16: ~D~%" (-> this sync-mask-16)) + (format #t "~1Tsync-mask-32: ~D~%" (-> this sync-mask-32)) + (format #t "~1Talert-state: #~%" (-> this alert-state)) + (format #t "~1Tprimary-target-history[16] @ #x~X~%" (-> this primary-target-history)) + (format #t "~1Ttraffic: ~A~%" (-> this traffic)) + (format #t "~1Tcity-mode: ~D~%" (-> this city-mode)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/levels/wascity/squad-control-city_REF.gc b/test/decompiler/reference/jak3/levels/wascity/squad-control-city_REF.gc new file mode 100644 index 0000000000..1f541507b5 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/squad-control-city_REF.gc @@ -0,0 +1,388 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 10 of type squad-control-city +(defmethod squad-control-method-10 ((this squad-control-city)) + (init! (-> this alert-state)) + (set! (-> this city-mode) (squad-city-mode zero)) + (call-parent-method this) + (none) + ) + +;; definition for method 44 of type squad-control-city +(defmethod add-squad-to-traffic-engine ((this squad-control-city) (arg0 traffic-engine)) + (set! (-> this traffic) arg0) + (add-squad-ctrl arg0 this) + (none) + ) + +;; definition for method 34 of type squad-control-city +(defmethod squad-control-city-method-34 ((this squad-control-city)) + (dotimes (s5-0 (the-as int (-> this traffic tracker0 active-object-count))) + (let ((a0-1 (-> this traffic tracker0 active-object-type-list s5-0))) + (when (logtest? (-> this traffic object-type-info-array a0-1 flags) (traffic-type-flag ttf4)) + (let ((a0-5 (handle->process (-> this traffic tracker0 active-object-list s5-0)))) + (if (and (the-as vehicle a0-5) + (not (logtest? (-> (the-as vehicle a0-5) v-flags) (vehicle-flag persistent))) + (not (focus-test? (the-as vehicle a0-5) dead inactive)) + (or (zero? (-> (the-as vehicle a0-5) draw)) + (not (logtest? (-> (the-as vehicle a0-5) draw status) (draw-control-status on-screen))) + ) + ) + (send-event a0-5 'traffic-off-force) + ) + ) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> this traffic tracker1 active-object-count))) + (let ((a0-8 (-> this traffic tracker1 active-object-type-list s5-1))) + (when (logtest? (-> this traffic object-type-info-array a0-8 flags) (traffic-type-flag ttf4)) + (let ((a0-12 (handle->process (-> this traffic tracker1 active-object-list s5-1)))) + (if (and (the-as process-focusable a0-12) + (not (focus-test? (the-as process-focusable a0-12) dead inactive)) + (or (zero? (-> (the-as process-focusable a0-12) draw)) + (not (logtest? (-> (the-as process-focusable a0-12) draw status) (draw-control-status on-screen))) + ) + ) + (send-event a0-12 'traffic-off-force) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 13 of type squad-control-city +;; WARN: Return type mismatch int vs none. +(defmethod update ((this squad-control-city)) + (call-parent-method this) + (squad-control-city-method-34 this) + (squad-control-method-24 this) + 0 + (none) + ) + +;; definition for method 38 of type squad-control-city +(defmethod squad-control-city-method-38 ((this squad-control-city) (arg0 process-focusable) (arg1 process-focusable)) + (let* ((s5-0 (get-trans arg1 0)) + (f0-0 (vector-vector-xz-distance-squared (-> arg0 root trans) s5-0)) + (f1-0 245760.0) + ) + (or (< f0-0 (* f1-0 f1-0)) (< (fabs (- (-> s5-0 y) (-> arg0 root trans y))) 61440.0)) + ) + ) + +;; definition for method 39 of type squad-control-city +(defmethod squad-control-city-method-39 ((this squad-control-city) (arg0 process-focusable) (arg1 process-focusable)) + 0.0 + ) + +;; definition for method 41 of type squad-control-city +(defmethod squad-control-city-method-41 ((this squad-control-city) (arg0 process-focusable) (arg1 process-focusable)) + #t + ) + +;; definition for method 40 of type squad-control-city +;; WARN: Return type mismatch int vs none. +(defmethod squad-control-city-method-40 ((this squad-control-city) (arg0 process-focusable) (arg1 process-focusable)) + 0 + (none) + ) + +;; definition for method 42 of type squad-control-city +(defmethod squad-control-city-method-42 ((this squad-control-city)) + 1.0 + ) + +;; definition for method 43 of type squad-control-city +(defmethod squad-control-city-method-43 ((this squad-control-city) (arg0 process-focusable)) + #t + ) + +;; definition for method 35 of type squad-control-city +;; INFO: Used lq/sq +;; WARN: Return type mismatch process-drawable vs process-focusable. +(defmethod squad-control-city-method-35 ((this squad-control-city) (arg0 citizen) (arg1 handle)) + (local-vars (sv-16 vector) (sv-32 vector) (sv-48 vector)) + (let* ((s4-0 (handle->process arg1)) + (s2-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + (s1-0 #f) + (s4-1 arg0) + ) + (let ((s3-0 (the-as process-drawable #f))) + (let ((v1-5 #f)) + (if (or (not s2-0) (focus-test? s2-0 disable dead inactive)) + (set! s1-0 #t) + (set! v1-5 (squad-control-city-method-38 this s4-1 s2-0)) + ) + (if (and (not s1-0) (or v1-5 (logtest? (-> s4-1 flags) (citizen-flag in-pursuit)))) + (set! s3-0 s2-0) + ) + (when (or s1-0 (and (not (logtest? (enemy-flag lock-focus) (-> s4-1 enemy-flags))) + (or (not v1-5) (squad-control-city-method-43 this arg0)) + ) + ) + (when (= (-> s4-1 level name) 'ctypesb) + (nop!) + 0 + ) + (when (!= (-> s4-1 faction-mode) 1) + (set! s3-0 (get-focus-in-range this s4-1)) + (goto cfg-121) + ) + (let* ((f30-0 0.0) + (f0-0 40960000.0) + (f28-0 (* f0-0 f0-0)) + ) + (when #t + (let ((v1-22 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((s2-1 (-> v1-22 next0))) + (while (!= v1-22 (-> *collide-player-list* alive-list-end)) + (let* ((v1-23 (the-as collide-shape (-> (the-as connection v1-22) param1))) + (a0-21 (-> v1-23 root-prim)) + ) + (when (logtest? (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list bot-targetable jak-vehicle) + (-> a0-21 prim-core collide-as) + ) + (let* ((s0-0 (-> v1-23 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (not (focus-test? (the-as process-focusable s1-1) disable dead inactive)) + (!= arg0 s1-1) + (squad-control-city-method-38 this s4-1 (the-as process-focusable s1-1)) + ) + (squad-control-city-method-40 this s4-1 (the-as process-focusable s1-1)) + (when (squad-control-city-method-41 this s4-1 (the-as process-focusable s1-1)) + (let ((f26-0 (squad-control-city-method-39 this s4-1 (the-as process-focusable s1-1)))) + (let ((v1-36 (get-idx-in-status-arr this (process->handle s1-1)))) + (if (>= v1-36 0) + (+! f26-0 (-> this alert-state target-status-array v1-36 threat-level)) + ) + ) + (cond + ((< f30-0 f26-0) + (set! f30-0 f26-0) + (set! f28-0 + (vector-vector-xz-distance-squared (-> arg0 root trans) (get-trans (the-as process-focusable s1-1) 3)) + ) + (set! s3-0 s1-1) + ) + ((= f26-0 f30-0) + (let ((s0-2 vector-vector-xz-distance-squared)) + (set! sv-16 (-> arg0 root trans)) + (let* ((a1-25 (get-trans (the-as process-focusable s1-1) 3)) + (f0-4 (* (s0-2 sv-16 a1-25) (squad-control-city-method-42 this))) + ) + (when (< f0-4 f28-0) + (set! f28-0 f0-4) + (set! s3-0 s1-1) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! v1-22 s2-1) + *collide-player-list* + (set! s2-1 (-> s2-1 next0)) + ) + ) + ) + ) + (when #t + (when #f + (let ((v1-56 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((s2-2 (-> v1-56 next0))) + (while (!= v1-56 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((v1-57 (the-as collide-shape (-> (the-as connection v1-56) param1))) + (a0-46 (-> v1-57 root-prim)) + ) + (when (logtest? (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list bot-targetable jak-vehicle) + (-> a0-46 prim-core collide-as) + ) + (let* ((s0-3 (-> v1-57 process)) + (s1-2 (if (type? s0-3 process-focusable) + s0-3 + ) + ) + ) + (when (and s1-2 + (not (focus-test? (the-as process-focusable s1-2) disable dead inactive)) + (!= arg0 s1-2) + (squad-control-city-method-38 this s4-1 (the-as process-focusable s1-2)) + ) + (squad-control-city-method-40 this s4-1 (the-as process-focusable s1-2)) + (when (squad-control-city-method-41 this s4-1 (the-as process-focusable s1-2)) + (let ((f26-2 (squad-control-city-method-39 this s4-1 (the-as process-focusable s1-2)))) + (let ((v1-70 (get-idx-in-status-arr this (process->handle s1-2)))) + (if (>= v1-70 0) + (+! f26-2 (-> this alert-state target-status-array v1-70 threat-level)) + ) + ) + (cond + ((< f30-0 f26-2) + (set! f30-0 f26-2) + (set! f28-0 + (vector-vector-xz-distance-squared (-> arg0 root trans) (get-trans (the-as process-focusable s1-2) 3)) + ) + (set! s3-0 s1-2) + ) + ((= f26-2 f30-0) + (let ((s0-5 vector-vector-xz-distance-squared)) + (set! sv-32 (-> arg0 root trans)) + (let* ((a1-41 (get-trans (the-as process-focusable s1-2) 3)) + (f0-7 (* (s0-5 sv-32 a1-41) (squad-control-city-method-42 this))) + ) + (when (< f0-7 f28-0) + (set! f28-0 f0-7) + (set! s3-0 s1-2) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! v1-56 s2-2) + *collide-hit-by-player-list* + (set! s2-2 (-> s2-2 next0)) + ) + ) + ) + ) + (when #t + (let ((v1-89 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((s2-3 (-> v1-89 next0))) + (while (!= v1-89 (-> *collide-hit-by-others-list* alive-list-end)) + (let* ((v1-90 (the-as collide-shape (-> (the-as connection v1-89) param1))) + (a0-71 (-> v1-90 root-prim)) + ) + (when (logtest? (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list bot-targetable jak-vehicle) + (-> a0-71 prim-core collide-as) + ) + (let* ((s0-6 (-> v1-90 process)) + (s1-3 (if (type? s0-6 process-focusable) + s0-6 + ) + ) + ) + (when (and s1-3 + (not (focus-test? (the-as process-focusable s1-3) disable dead inactive)) + (!= arg0 s1-3) + (squad-control-city-method-38 this s4-1 (the-as process-focusable s1-3)) + ) + (squad-control-city-method-40 this s4-1 (the-as process-focusable s1-3)) + (when (squad-control-city-method-41 this s4-1 (the-as process-focusable s1-3)) + (let ((f26-4 (squad-control-city-method-39 this s4-1 (the-as process-focusable s1-3)))) + (let ((v1-103 (get-idx-in-status-arr this (process->handle s1-3)))) + (if (>= v1-103 0) + (+! f26-4 (-> this alert-state target-status-array v1-103 threat-level)) + ) + ) + (cond + ((< f30-0 f26-4) + (set! f30-0 f26-4) + (set! f28-0 + (vector-vector-xz-distance-squared (-> arg0 root trans) (get-trans (the-as process-focusable s1-3) 3)) + ) + (set! s3-0 s1-3) + ) + ((= f26-4 f30-0) + (let ((s0-8 vector-vector-xz-distance-squared)) + (set! sv-48 (-> arg0 root trans)) + (let* ((a1-57 (get-trans (the-as process-focusable s1-3) 3)) + (f0-10 (* (s0-8 sv-48 a1-57) (squad-control-city-method-42 this))) + ) + (when (< f0-10 f28-0) + (set! f28-0 f0-10) + (set! s3-0 s1-3) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! v1-89 s2-3) + *collide-hit-by-others-list* + (set! s2-3 (-> s2-3 next0)) + ) + ) + ) + ) + ) + ) + ) + ) + (label cfg-121) + (the-as process-focusable s3-0) + ) + ) + ) + +;; definition for method 32 of type squad-control-city +;; INFO: Used lq/sq +(defmethod get-handle-pos ((this squad-control-city) (arg0 handle) (arg1 vector)) + (let* ((s5-0 (handle->process arg0)) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (when s4-0 + (cond + ((valid-target-handle? this arg0) + (set! (-> s5-1 quad) (the-as uint128 0)) + (dotimes (v1-7 16) + (vector+! s5-1 s5-1 (the-as vector (+ (the-as uint (-> this primary-target-history 0 velocity)) (* v1-7 32)))) + ) + (vector-float*! s5-1 s5-1 0.0625) + ) + (else + (set! (-> s5-1 quad) (-> (the-as process-focusable s4-0) root transv quad)) + ) + ) + (set! (-> s5-1 y) 0.0) + (vector+float*! arg1 (-> (the-as process-focusable s4-0) root trans) s5-1 1.5) + ) + ) + arg1 + ) + +;; definition for method 36 of type squad-control-city +(defmethod get-city-mode ((this squad-control-city)) + (-> this city-mode) + ) + +;; definition for method 37 of type squad-control-city +;; WARN: Return type mismatch int vs none. +(defmethod squad-control-city-method-37 ((this squad-control-city)) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/wascity/traffic-util_REF.gc b/test/decompiler/reference/jak3/levels/wascity/traffic-util_REF.gc new file mode 100644 index 0000000000..085dc7a95c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/traffic-util_REF.gc @@ -0,0 +1,1241 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition (debug) for function add-debug-line-arrow +;; WARN: Return type mismatch int vs none. +(defun-debug add-debug-line-arrow () + 0 + (none) + ) + +;; definition for method 10 of type vis-cell +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this vis-cell)) + (local-vars (sv-48 (function _varargs_ object))) + (dotimes (s5-0 (-> this segment-count)) + (let ((s4-0 (-> this segment-array s5-0))) + (add-debug-line + #t + (bucket-id debug) + (the-as vector (-> s4-0 vertex)) + (-> s4-0 vertex 1) + *color-white* + #f + *color-black* + ) + (let ((s3-1 (vector-float*! + (new 'stack-no-clear 'vector) + (vector+! (new 'stack-no-clear 'vector) (the-as vector (-> s4-0 vertex)) (-> s4-0 vertex 1)) + 0.5 + ) + ) + (s2-0 add-debug-text-3d) + (s1-0 #t) + (s0-0 583) + ) + (set! sv-48 format) + (let ((a0-7 (clear *temp-string*)) + (a1-2 "~d") + (a2-1 (-> s4-0 branch clock-type)) + ) + (sv-48 a0-7 a1-2 a2-1) + ) + (s2-0 s1-0 (the-as bucket-id s0-0) *temp-string* s3-1 (font-color red) (the-as vector2h #f)) + ) + (add-debug-x #t (bucket-id debug) (-> s4-0 vertex 1) *color-red*) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type vis-cell +;; WARN: Return type mismatch int vs none. +(defmethod reset-segment-counts ((this vis-cell)) + (set! (-> this incoming-segment-count) 0) + (set! (-> this segment-count) 0) + 0 + (none) + ) + +;; definition for method 9 of type grid-info +;; WARN: Return type mismatch int vs none. +(defmethod setup-grid-from-bounding-box ((this grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) + (mem-copy! (the-as pointer (-> this box)) arg0 32) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (dotimes (a0-2 3) + (set! (-> v1-0 data a0-2) (- (-> this box max data a0-2) (-> this box min data a0-2))) + ) + (let ((f0-5 (sqrtf (/ (the float arg1) (* (-> v1-0 x) (-> v1-0 z) (the float arg2)))))) + (let ((a0-6 (min 126 (+ arg1 -1)))) + (set! (-> this dimension-array 0) (max 1 (min (the int (* f0-5 (-> v1-0 x))) a0-6))) + (set! (-> this dimension-array 1) arg2) + (set! (-> this dimension-array 2) (max 1 (min (the int (* f0-5 (-> v1-0 z))) a0-6))) + ) + (let* ((f1-11 (* f0-5 (-> v1-0 z))) + (f1-13 (- f1-11 (the float (the int f1-11)))) + (f0-6 (* f0-5 (-> v1-0 x))) + ) + (cond + ((< f1-13 (- f0-6 (the float (the int f0-6)))) + (if (>= arg1 (* (* (+ (-> this dimension-array 0) 1) (-> this dimension-array 1)) (-> this dimension-array 2))) + (+! (-> this dimension-array 0) 1) + ) + ) + (else + (if (>= arg1 (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (+ (-> this dimension-array 2) 1))) + (+! (-> this dimension-array 2) 1) + ) + ) + ) + ) + ) + (dotimes (a0-24 3) + (set! (-> this axis-scale a0-24) (/ (the float (-> this dimension-array a0-24)) (-> v1-0 data a0-24))) + (set! (-> this cell-size data a0-24) (/ (-> v1-0 data a0-24) (the float (-> this dimension-array a0-24)))) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type grid-info +;; WARN: Return type mismatch int vs none. +(defmethod lookup-cell-for-point ((this grid-info) (arg0 vis-grid-pos) (arg1 vector)) + (set! (-> arg0 x) (max 0 (min + (the int (* (- (-> arg1 x) (-> this box min x)) (-> this axis-scale 0))) + (+ (-> this dimension-array 0) -1) + ) + ) + ) + (set! (-> arg0 y) (max 0 (min + (the int (* (- (-> arg1 y) (-> this box min y)) (-> this axis-scale 1))) + (+ (-> this dimension-array 1) -1) + ) + ) + ) + (set! (-> arg0 z) (max 0 (min + (the int (* (- (-> arg1 z) (-> this box min z)) (-> this axis-scale 2))) + (+ (-> this dimension-array 2) -1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type grid-info +;; WARN: Return type mismatch int vs none. +(defmethod lookup-box-for-sphere ((this grid-info) (arg0 vis-grid-box) (arg1 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'bounding-box))) + (let ((a0-1 (-> s5-0 min))) + (let ((v1-0 arg1)) + (let ((a1-1 (- (-> arg1 w)))) + (.mov vf6 a1-1) + ) + (.lvf vf4 (&-> v1-0 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-1 quad) vf5) + ) + (let ((a0-2 (-> s5-0 max))) + (let ((v1-1 arg1)) + (let ((a1-2 (-> arg1 w))) + (.mov vf6 a1-2) + ) + (.lvf vf4 (&-> v1-1 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-2 quad) vf5) + ) + (lookup-cell-for-point this (-> arg0 min) (-> s5-0 min)) + (lookup-cell-for-point this (-> arg0 max) (-> s5-0 max)) + ) + 0 + (none) + ) + ) + +;; definition for method 13 of type grid-info +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-cell ((this grid-info) (arg0 vis-grid-pos) (arg1 rgba)) + (let ((v1-0 (new 'stack-no-clear 'bounding-box))) + (dotimes (a3-0 3) + (set! (-> v1-0 min data a3-0) + (+ (-> this box min data a3-0) (* (the float (-> arg0 data a3-0)) (-> this cell-size data a3-0))) + ) + ) + (vector+! (-> v1-0 max) (-> v1-0 min) (-> this cell-size)) + (add-debug-box #t (bucket-id debug) (-> v1-0 min) (-> v1-0 max) arg1) + ) + 0 + (none) + ) + +;; definition for method 12 of type grid-info +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-grid ((this grid-info) (arg0 rgba)) + (draw-grid (the-as vector (-> this box)) (-> this box max) (-> this dimension-array) arg0) + 0 + (none) + ) + +;; definition for method 9 of type traffic-suppression-params +(defmethod try-creating-new-suppression-box ((this traffic-suppression-params)) + (cond + ((= (-> this id) -1) + (send-event *traffic-manager* 'new-suppression-box this) + (!= (-> this id) -1) + ) + (else + #t + ) + ) + ) + +;; definition for method 10 of type traffic-suppression-params +(defmethod create-or-update-suppression-box ((this traffic-suppression-params)) + (cond + ((= (-> this id) -1) + (send-event *traffic-manager* 'new-suppression-box this) + (!= (-> this id) -1) + ) + (else + (send-event *traffic-manager* 'update-suppression-box this) + #t + ) + ) + ) + +;; definition for method 12 of type traffic-suppression-params +;; WARN: Return type mismatch int vs none. +(defmethod kill-suppression-box ((this traffic-suppression-params)) + (when (!= (-> this id) -1) + (let ((s5-0 (-> this duration))) + (set! (-> this duration) 0) + (send-event *traffic-manager* 'update-suppression-box this) + (set! (-> this duration) s5-0) + ) + (set! (-> this id) -1) + ) + (none) + ) + +;; definition for method 9 of type traffic-suppressor +;; WARN: Return type mismatch int vs none. +(defmethod reset-boxes ((this traffic-suppressor)) + (logclear! (-> this flags) (traffic-suppressor-flag tfs0 needs-update)) + (dotimes (v1-2 16) + (let ((a1-3 (-> this array v1-2))) + (logclear! (-> a1-3 flags) (traffic-suppression-box-flag in-use tfsb1)) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type traffic-suppressor +;; WARN: Return type mismatch int vs none. +(defmethod add-new-supression-box ((this traffic-suppressor) (arg0 traffic-suppression-params)) + (set! (-> arg0 id) -1) + (let ((v1-1 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (let ((a2-2 (-> this array v1-1))) + (b! (logtest? (-> a2-2 flags) (traffic-suppression-box-flag in-use)) cfg-3 :delay (empty-form)) + (set! (-> arg0 id) v1-1) + (set! (-> a2-2 flags) (traffic-suppression-box-flag in-use)) + ) + (update-box-from-params this arg0) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + (+! v1-1 1) + (label cfg-4) + (b! (< v1-1 16) cfg-1) + ) + (label cfg-6) + 0 + (none) + ) + +;; definition for method 11 of type traffic-suppressor +;; WARN: Return type mismatch int vs none. +(defmethod remove-box-by-id ((this traffic-suppressor) (arg0 int)) + (when (!= arg0 -1) + (logior! (-> this flags) (traffic-suppressor-flag needs-update)) + (let ((v1-6 (-> this array arg0))) + (logclear! (-> v1-6 flags) (traffic-suppression-box-flag in-use)) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type traffic-suppressor +;; WARN: Return type mismatch int vs none. +(defmethod update-box-from-params ((this traffic-suppressor) (arg0 traffic-suppression-params)) + (let ((v1-0 (-> arg0 id))) + (when (!= v1-0 -1) + (logior! (-> this flags) (traffic-suppressor-flag needs-update)) + (let* ((s5-0 (-> this array v1-0)) + (s4-1 (logior (-> s5-0 flags) (traffic-suppression-box-flag tfsb1))) + ) + (mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32) + (set! (-> s5-0 duration) (the-as uint (-> arg0 duration))) + (set! (-> s5-0 flags) s4-1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type traffic-suppressor +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this traffic-suppressor)) + (let ((s5-0 (new 'stack-no-clear 'bounding-box))) + (new 'stack-no-clear 'vector4w) + (let ((s4-0 *color-red*)) + (dotimes (s3-0 16) + (let ((v1-3 (-> this array s3-0))) + (when (logtest? (-> v1-3 flags) (traffic-suppression-box-flag in-use)) + (set! (-> s5-0 min quad) (-> v1-3 bbox min quad)) + (set! (-> s5-0 max quad) (-> v1-3 bbox max quad)) + (set! (-> s5-0 min w) 1.0) + (set! (-> s5-0 max w) 1.0) + (add-debug-box #t (bucket-id debug-no-zbuf1) (-> s5-0 min) (-> s5-0 max) s4-0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 14 of type city-level-info +(defmethod get-first-cell-in-box ((this city-level-info) (arg0 vis-grid-box)) + (-> this + cell-array + (+ (-> arg0 min x) + (* (-> arg0 min z) (-> this grid-info dimension-array 0)) + (* (* (-> arg0 min y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) + ) + ) + ) + +;; definition for method 15 of type city-level-info +(defmethod sphere-in-grid? ((this city-level-info) (arg0 vector) (arg1 int)) + (let ((gp-0 #f)) + (let ((s3-0 (new 'stack-no-clear 'vis-grid-box)) + (s2-0 (new 'stack-no-clear 'vis-grid-box)) + ) + (lookup-box-for-sphere (-> this grid-info) s2-0 arg0) + (set! (-> s3-0 min y) (-> s2-0 min y)) + (let ((v1-6 (+ (- 1 (-> s2-0 min y)) (-> s2-0 max y)))) + (b! #t cfg-13 :delay (nop!)) + (label cfg-1) + (+! v1-6 -1) + (set! (-> s3-0 min z) (-> s2-0 min z)) + (let ((a0-7 (+ (- 1 (-> s2-0 min z)) (-> s2-0 max z)))) + (b! #t cfg-11 :delay (nop!)) + (label cfg-2) + (+! a0-7 -1) + (set! (-> s3-0 min x) (-> s2-0 min x)) + (let ((a1-7 (+ (- 1 (-> s2-0 min x)) (-> s2-0 max x)))) + (b! #t cfg-9 :delay (nop!)) + (label cfg-3) + (+! a1-7 -1) + (let ((a3-0 this) + (t1-0 s3-0) + ) + (b! + (not (logtest? (-> a3-0 + cell-array + (+ (-> t1-0 min x) + (* (-> t1-0 min z) (-> a3-0 grid-info dimension-array 0)) + (* (* (-> t1-0 min y) (-> a3-0 grid-info dimension-array 0)) (-> a3-0 grid-info dimension-array 2)) + ) + flags + ) + (ash 1 arg1) + ) + ) + cfg-8 + :delay (empty-form) + ) + ) + (set! gp-0 #t) + (b! #t cfg-15 :delay (nop!)) + (label cfg-8) + (+! (-> s3-0 min x) 1) + (label cfg-9) + (b! (nonzero? a1-7) cfg-3 :delay (nop!)) + ) + (+! (-> s3-0 min z) 1) + (label cfg-11) + (b! (nonzero? a0-7) cfg-2 :delay (nop!)) + ) + (+! (-> s3-0 min y) 1) + (label cfg-13) + (b! (nonzero? v1-6) cfg-1 :delay (nop!)) + ) + ) + (label cfg-15) + gp-0 + ) + ) + +;; definition for method 16 of type city-level-info +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod callback-on-nav-segments-in-sphere ((this city-level-info) + (arg0 vector) + (arg1 int) + (arg2 traffic-find-segment-struct) + (arg3 (function traffic-find-segment-struct nav-segment none)) + ) + (local-vars + (sv-16 city-level-info) + (sv-20 vector) + (sv-24 int) + (sv-28 traffic-find-segment-struct) + (sv-32 (function traffic-find-segment-struct nav-segment none)) + (sv-80 vis-grid-box) + (sv-84 vis-grid-box) + ) + (set! sv-16 this) + (set! sv-20 arg0) + (set! sv-24 arg1) + (set! sv-28 arg2) + (set! sv-32 arg3) + (set! sv-80 (new 'stack-no-clear 'vis-grid-box)) + (set! sv-84 (new 'stack-no-clear 'vis-grid-box)) + (lookup-box-for-sphere (-> sv-16 grid-info) sv-80 sv-20) + (set! (-> sv-84 min y) (-> sv-80 min y)) + (countdown (gp-0 (+ (- 1 (-> sv-80 min y)) (-> sv-80 max y))) + (set! (-> sv-84 min z) (-> sv-80 min z)) + (countdown (s5-0 (+ (- 1 (-> sv-80 min z)) (-> sv-80 max z))) + (set! (-> sv-84 min x) (-> sv-80 min x)) + (countdown (s4-0 (+ (- 1 (-> sv-80 min x)) (-> sv-80 max x))) + (let* ((a0-17 sv-16) + (a2-2 sv-84) + (v1-18 + (-> a0-17 + cell-array + (+ (-> a2-2 min x) + (* (-> a2-2 min z) (-> a0-17 grid-info dimension-array 0)) + (* (* (-> a2-2 min y) (-> a0-17 grid-info dimension-array 0)) (-> a0-17 grid-info dimension-array 2)) + ) + ) + ) + (s3-0 (-> v1-18 segment-array 0)) + ) + (countdown (s2-0 (-> v1-18 segment-count)) + (if (and (= (-> s3-0 tracker-id) sv-24) + (line-sphere-intersection? sv-20 (the-as vector (-> s3-0 vertex)) (-> s3-0 vertex 1)) + ) + (sv-32 sv-28 s3-0) + ) + (&+! s3-0 48) + ) + ) + (+! (-> sv-84 min x) 1) + ) + (+! (-> sv-84 min z) 1) + ) + (+! (-> sv-84 min y) 1) + ) + 0 + (none) + ) + +;; definition for method 17 of type city-level-info +;; WARN: Return type mismatch int vs none. +(defmethod update-suppressions-from-traffic-engine ((this city-level-info) (arg0 traffic-engine)) + (let ((v1-0 (-> this cell-count))) + (dotimes (a0-1 (the-as int v1-0)) + (let ((a1-2 (-> this cell-array a0-1))) + (logclear! (-> a1-2 flags) (vis-cell-flag suppress)) + ) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'vis-grid-pos 2))) + (dotimes (s3-0 16) + (let ((s2-0 (-> arg0 suppressor array s3-0))) + (when (logtest? (-> s2-0 flags) (traffic-suppression-box-flag in-use)) + (lookup-cell-for-point (-> this grid-info) (-> s4-0 1) (the-as vector (-> s2-0 bbox))) + (lookup-cell-for-point (-> this grid-info) (-> s4-0 2) (-> s2-0 bbox max)) + (set! (-> s4-0 0 y) (-> s4-0 1 y)) + (countdown (v1-15 (+ (- 1 (-> s4-0 1 y)) (-> s4-0 2 y))) + (set! (-> s4-0 0 z) (-> s4-0 1 z)) + (countdown (a0-9 (+ (- 1 (-> s4-0 1 z)) (-> s4-0 2 z))) + (set! (-> s4-0 0 x) (-> s4-0 1 x)) + (countdown (a1-10 (+ (- 1 (-> s4-0 1 x)) (-> s4-0 2 x))) + (let* ((a3-1 this) + (t1-0 (-> s4-0 0)) + (a2-8 (-> a3-1 + cell-array + (+ (-> t1-0 x) + (* (-> t1-0 z) (-> a3-1 grid-info dimension-array 0)) + (* (* (-> t1-0 y) (-> a3-1 grid-info dimension-array 0)) (-> a3-1 grid-info dimension-array 2)) + ) + ) + ) + ) + (logior! (-> a2-8 flags) (vis-cell-flag suppress)) + ) + (+! (-> s4-0 0 x) 1) + ) + (+! (-> s4-0 0 z) 1) + ) + (+! (-> s4-0 0 y) 1) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type city-level-info +(defmethod lookup-cell-by-position ((this city-level-info) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'vis-grid-pos))) + (lookup-cell-for-point (-> this grid-info) s5-0 arg0) + (-> this + cell-array + (+ (-> s5-0 x) + (* (-> s5-0 z) (-> this grid-info dimension-array 0)) + (* (* (-> s5-0 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) + ) + ) + ) + ) + +;; definition for method 10 of type city-level-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-vis-ray ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) + (set! (-> arg0 pos quad) (-> arg1 quad)) + (set! (-> arg0 dest-pos quad) (-> arg2 quad)) + (let ((v1-2 (new 'stack-no-clear 'vector))) + (vector-! v1-2 arg2 arg1) + (set! (-> arg0 len) (vector-length v1-2)) + (let ((a0-9 (-> arg0 dir)) + (f0-1 (-> arg0 len)) + ) + (vector-float*! a0-9 v1-2 (/ 1.0 f0-1)) + ) + ) + (lookup-cell-for-point (-> this grid-info) (-> arg0 grid-pos) arg1) + (set! (-> arg0 cell) (lookup-cell-by-position this arg1)) + 0 + (none) + ) + +;; definition for method 11 of type city-level-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod city-level-info-method-11 ((this city-level-info) (arg0 vis-ray)) + (local-vars (a3-3 int)) + (let ((f0-0 (-> arg0 len)) + (s4-0 -1) + ) + (dotimes (v1-0 2) + (let ((a0-1 (* v1-0 2)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (the-as uint128 0)) + (set! (-> a1-1 data a0-1) -1.0) + (let ((f1-1 (-> this grid-info box min data a0-1)) + (a2-6 1) + ) + (let ((a3-2 (-> arg0 dir data a0-1))) + (shift-arith-right-32 a3-3 a3-2 31) + ) + (set! (-> a1-1 w) + (+ f1-1 + (* (the float (+ (- a2-6 (logand a3-3 1)) (-> (the-as (pointer int8) (+ a0-1 (the-as int arg0))) 64))) + (-> this grid-info cell-size data a0-1) + ) + ) + ) + ) + (when (!= (-> arg0 dir data a0-1) 0.0) + (let ((f1-6 (/ (- (-> a1-1 w) (-> arg0 pos data a0-1)) (-> arg0 dir data a0-1)))) + (when (< f1-6 f0-0) + (set! f0-0 f1-6) + (set! s4-0 a0-1) + (set! (-> arg0 plane quad) (-> a1-1 quad)) + ) + ) + ) + ) + ) + (cond + ((= s4-0 -1) + (set! (-> arg0 pos quad) (-> arg0 dest-pos quad)) + (set! (-> arg0 len) 0.0) + ) + (else + (vector+float*! (-> arg0 pos) (-> arg0 pos) (-> arg0 dir) f0-0) + (set! (-> arg0 len) (vector-vector-distance (-> arg0 pos) (-> arg0 dest-pos))) + (+! (-> arg0 grid-pos data s4-0) (if (>= (-> arg0 dir data s4-0) 0.0) + 1 + -1 + ) + ) + (let ((a1-4 (-> arg0 grid-pos))) + (set! (-> arg0 cell) + (-> this + cell-array + (+ (-> a1-4 x) + (* (-> a1-4 z) (-> this grid-info dimension-array 0)) + (* (* (-> a1-4 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type city-level-info +;; INFO: Used lq/sq +(defmethod city-level-info-method-12 ((this city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s2-0 (-> arg1 dest-node)) + (s3-0 #t) + (s5-0 (new 'stack-no-clear 'inline-array 'vector 7)) + ) + (let ((a1-1 s2-0) + (v1-0 (-> s5-0 2)) + ) + (set! (-> v1-0 quad) (-> a1-1 position quad)) + (set! (-> v1-0 w) 1.0) + ) + (let ((v1-1 s2-0) + (s1-0 (-> s5-0 3)) + ) + (let ((f0-2 (the float (-> v1-1 angle))) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (sincos! s0-0 f0-2) + (set! (-> s1-0 x) (-> s0-0 y)) + (set! (-> s1-0 y) 0.0) + (set! (-> s1-0 z) (- (-> s0-0 x))) + ) + (set! (-> s1-0 w) 1.0) + ) + (vector-! (-> s5-0 5) (-> s5-0 2) arg0) + (set! (-> s5-0 4 quad) (-> s5-0 3 quad)) + (set! (-> s5-0 4 x) (-> s5-0 3 z)) + (set! (-> s5-0 4 z) (- (-> s5-0 3 x))) + (when (< 0.0 (vector-dot (-> s5-0 5) (-> s5-0 4))) + (set! s3-0 #f) + (vector-float*! (-> s5-0 4) (-> s5-0 4) -1.0) + ) + (let ((a1-8 (-> s5-0 6))) + (let ((v1-12 (-> s5-0 2))) + (let ((a0-9 (-> s5-0 4))) + (let* ((a2-1 s2-0) + (a2-4 (* 1024.0 (the float (-> a2-1 radius)))) + ) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> a1-8 quad) vf6) + ) + (set! (-> s5-0 6 w) (* 1024.0 (the float (-> s2-0 radius)))) + (vector-! (-> s5-0 0) (-> s5-0 6) arg0) + (set! (-> s5-0 0 y) 0.0) + (let* ((v1-17 (-> s5-0 0)) + (f30-0 (sqrtf (+ (* (-> v1-17 x) (-> v1-17 x)) (* (-> v1-17 z) (-> v1-17 z))))) + (f28-0 (-> s5-0 6 w)) + ) + (vector-xz-normalize! (-> s5-0 0) 1.0) + (set! (-> s5-0 1 x) (-> s5-0 0 z)) + (set! (-> s5-0 1 y) 0.0) + (set! (-> s5-0 1 z) (- (-> s5-0 0 x))) + (if s3-0 + (vector-float*! (-> s5-0 1) (-> s5-0 1) -1.0) + ) + (let* ((f0-29 f30-0) + (f0-31 (* f0-29 f0-29)) + (f1-9 f28-0) + (f1-12 (sqrtf (fabs (- f0-31 (* f1-9 f1-9))))) + (f0-35 (/ (* f28-0 f1-12) f30-0)) + ) + (let ((f1-15 (/ (* f1-12 f1-12) f30-0))) + (set! (-> arg2 quad) (-> arg0 quad)) + (let ((a1-13 arg2)) + (let ((v1-26 arg2)) + (let ((a0-14 (-> s5-0 0))) + (let ((a2-5 f1-15)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-26 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 (&-> a1-13 quad) vf6) + ) + ) + (let ((a1-14 arg2)) + (let ((v1-27 arg2)) + (let ((a0-15 (-> s5-0 1))) + (let ((a2-6 f0-35)) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-15 quad)) + ) + (.lvf vf4 (&-> v1-27 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 (&-> a1-14 quad) vf6) + ) + ) + ) + (set! (-> arg2 y) (-> s5-0 2 y)) + ) + arg2 + ) + ) + +;; definition for method 18 of type city-level-info +;; INFO: Used lq/sq +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod city-level-info-method-18 ((this city-level-info)) + (local-vars (sv-48 int)) + (let ((gp-0 (new 'stack-no-clear 'bounding-box)) + (s5-0 (-> this nav-graph)) + ) + (set! sv-48 (-> s5-0 node-count)) + (dotimes (s4-0 sv-48) + (let ((s3-0 (-> s5-0 node-array s4-0))) + (set-id-and-link-branches-back s3-0 (the-as uint s4-0)) + (let ((a1-1 s3-0) + (v1-4 (-> gp-0 min)) + ) + (set! (-> v1-4 quad) (-> a1-1 position quad)) + (set! (-> v1-4 w) 1.0) + ) + (dotimes (s2-0 (-> s3-0 branch-count)) + (let ((s1-0 (-> s3-0 branch-array s2-0))) + (let ((a1-4 (-> s1-0 dest-node)) + (v1-6 (-> gp-0 max)) + ) + (set! (-> v1-6 quad) (-> a1-4 position quad)) + (set! (-> v1-6 w) 1.0) + ) + (set! (-> s1-0 max-user-count) + (the-as uint (max 1 (the int (/ (vector-vector-distance (-> gp-0 min) (-> gp-0 max)) + (if (logtest? (-> s3-0 flags) (nav-node-flag-byte pedestrian)) + 24576.0 + 49152.0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type city-level-info +;; INFO: Used lq/sq +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +(defmethod city-level-info-method-9 ((this city-level-info)) + (local-vars + (sv-96 (inline-array nav-node)) + (sv-100 int) + (sv-104 vis-ray) + (sv-112 int) + (sv-160 nav-node) + (sv-164 vector) + (sv-168 vector) + (sv-172 vis-cell) + (sv-176 int) + (sv-184 nav-branch) + (sv-240 nav-node) + (sv-244 vector) + (sv-248 vector) + (sv-252 vector) + (sv-256 nav-segment) + (sv-260 vis-cell) + (sv-264 int) + ) + (set! (-> this cell-count) + (the-as uint (* (* (-> this grid-info dimension-array 0) (-> this grid-info dimension-array 1)) + (-> this grid-info dimension-array 2) + ) + ) + ) + (let ((s5-0 (-> this cell-count))) + (dotimes (s4-0 (the-as int s5-0)) + (reset-segment-counts (-> this cell-array s4-0)) + ) + (when (< 0.01 (-> this grid-info axis-scale 0)) + (format 0 "segments not generates~%") + (return #t) + ) + (set! sv-96 (-> this nav-graph node-array)) + (set! sv-100 (-> this nav-graph node-count)) + (set! sv-104 (new 'stack-no-clear 'vis-ray)) + (set! sv-112 0) + (dotimes (s4-1 sv-100) + (let ((s3-0 (-> sv-96 s4-1))) + (dotimes (s2-0 (-> s3-0 branch-count)) + (let* ((a2-0 (-> s3-0 branch-array s2-0)) + (f0-1 0.0) + (v1-19 a2-0) + ) + (when (< f0-1 (* 0.0078125 (the float (-> v1-19 density)))) + (set! sv-160 (-> a2-0 dest-node)) + (set! sv-164 (new 'stack-no-clear 'vector)) + (set! sv-168 (new 'stack-no-clear 'vector)) + (set! sv-172 (the-as vis-cell #f)) + (set! sv-176 0) + (let ((a1-1 s3-0) + (v1-26 sv-168) + ) + (set! (-> v1-26 quad) (-> a1-1 position quad)) + (set! (-> v1-26 w) 1.0) + ) + (cond + ((logtest? (-> s3-0 flags) (nav-node-flag-byte pedestrian)) + (let ((a1-4 (-> a2-0 dest-node)) + (v1-29 sv-164) + ) + (set! (-> v1-29 quad) (-> a1-4 position quad)) + (set! (-> v1-29 w) 1.0) + ) + ) + (else + (city-level-info-method-12 this sv-168 a2-0 sv-164) + ) + ) + (init-vis-ray this sv-104 sv-168 sv-164) + (while (< 0.0 (-> sv-104 len)) + (set! sv-172 (-> sv-104 cell)) + (city-level-info-method-11 this sv-104) + (+! (-> sv-172 segment-count) 1) + (set! sv-112 (+ sv-112 1)) + (if (> sv-176 0) + (+! (-> sv-172 incoming-segment-count) 1) + ) + (set! sv-176 (+ sv-176 1)) + ) + ) + ) + ) + ) + ) + (format 0 "~d segments were generated~%" sv-112) + (set! (-> this segment-array) (the-as (inline-array nav-segment) (malloc 'debug (* 48 sv-112)))) + (let ((v1-59 0)) + (dotimes (a0-20 (the-as int s5-0)) + (let ((a1-14 (-> this cell-array a0-20))) + (set! (-> a1-14 id) (the-as uint a0-20)) + (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) #f)) + (when (> (-> a1-14 segment-count) 0) + (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) (-> this segment-array v1-59))) + (dotimes (a2-8 (-> a1-14 segment-count)) + (let ((a3-5 (-> a1-14 segment-array a2-8))) + (set! (-> a3-5 id) (the-as uint v1-59)) + (set! (-> a3-5 cell-id) (the-as uint #xffff)) + ) + (+! v1-59 1) + ) + ) + (set! (-> a1-14 flags) (the-as vis-cell-flag (-> a1-14 segment-count))) + (set! (-> a1-14 segment-count) 0) + (set! (-> a1-14 incoming-segment-count) 0) + ) + 0 + ) + (set! (-> this segment-count) v1-59) + ) + ) + (dotimes (s5-1 sv-100) + (let ((s4-2 (-> sv-96 s5-1))) + (dotimes (s3-1 (-> s4-2 branch-count)) + (set! sv-184 (-> s4-2 branch-array s3-1)) + (let ((f0-5 0.0) + (v1-63 sv-184) + ) + (when (< f0-5 (* 0.0078125 (the float (-> v1-63 density)))) + (set! sv-240 (-> sv-184 dest-node)) + (set! sv-244 (new 'stack-no-clear 'vector)) + (set! sv-248 (new 'stack-no-clear 'vector)) + (set! sv-252 (new 'stack-no-clear 'vector)) + (set! sv-256 (the-as nav-segment #f)) + (set! sv-260 (the-as vis-cell #f)) + (set! sv-264 0) + (let ((a1-16 s4-2) + (v1-72 sv-244) + ) + (set! (-> v1-72 quad) (-> a1-16 position quad)) + (set! (-> v1-72 w) 1.0) + ) + (cond + ((logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian)) + (let ((a1-19 (-> sv-184 dest-node)) + (v1-76 sv-252) + ) + (set! (-> v1-76 quad) (-> a1-19 position quad)) + (set! (-> v1-76 w) 1.0) + ) + ) + (else + (city-level-info-method-12 this sv-244 sv-184 sv-252) + ) + ) + (init-vis-ray this sv-104 sv-244 sv-252) + (while (< 0.0 (-> sv-104 len)) + (set! (-> sv-248 quad) (-> sv-104 pos quad)) + (set! sv-260 (-> sv-104 cell)) + (city-level-info-method-11 this sv-104) + (let ((a2-14 (-> sv-260 incoming-segment-count))) + (if (zero? sv-264) + (set! a2-14 + (+ (- -1 (-> sv-260 segment-count)) (-> sv-260 incoming-segment-count) (-> sv-260 alloc-segment-count)) + ) + ) + (when (or (< a2-14 0) (>= a2-14 (-> sv-260 alloc-segment-count))) + (format + 0 + "******************************************************** bad i-seg ~d ************************************************~%" + a2-14 + ) + (return #f) + ) + (let ((s2-1 (-> sv-260 segment-array a2-14))) + (set! (-> s2-1 vertex 0 quad) (-> sv-248 quad)) + (set! (-> s2-1 vertex 1 quad) (-> sv-104 pos quad)) + (set! (-> s2-1 length) (vector-vector-distance (the-as vector (-> s2-1 vertex)) (-> s2-1 vertex 1))) + (let* ((f0-9 (if (logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian)) + 24576.0 + 49152.0 + ) + ) + (f1-8 -1.0) + (f2-4 0.0001) + (v1-107 sv-184) + (f2-5 (fmax f2-4 (* 0.0078125 (the float (-> v1-107 density))))) + ) + (set! (-> s2-1 spawn-spacing) (* f0-9 (+ f1-8 (/ 1.0 f2-5)))) + ) + (set! (-> s2-1 cell-id) (-> sv-260 id)) + (set! (-> s2-1 branch) sv-184) + (set! (-> s2-1 from-cell-id) (the-as uint #xffff)) + (set! (-> s2-1 nav-mesh-id) (-> s4-2 nav-mesh-id)) + (set! (-> s2-1 tracker-id) 0) + (if (logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian)) + (set! (-> s2-1 tracker-id) 1) + ) + (if sv-256 + (set! (-> s2-1 from-cell-id) (-> (the-as nav-segment sv-256) cell-id)) + ) + (set! sv-256 s2-1) + ) + ) + 0 + (+! (-> sv-260 segment-count) 1) + (if (> sv-264 0) + (+! (-> sv-260 incoming-segment-count) 1) + ) + (set! sv-264 (+ sv-264 1)) + ) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for method 9 of type traffic-level-data +;; WARN: Return type mismatch int vs none. +(defmethod reset! ((this traffic-level-data)) + (set! (-> this city-info) (the-as city-level-info 0)) + (set! (-> this active-cell-count) (the-as uint 0)) + (set! (-> this newly-active-cell-count) (the-as uint 0)) + 0 + (none) + ) + +;; definition for method 10 of type traffic-level-data +;; WARN: Return type mismatch int vs none. +(defmethod add-active-cell ((this traffic-level-data) (arg0 vis-cell)) + (let ((v1-0 (-> this active-cell-count))) + (when (< v1-0 (the-as uint 255)) + (set! (-> this active-cell-list v1-0) arg0) + (+! (-> this active-cell-count) 1) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type traffic-level-data +;; WARN: Return type mismatch int vs none. +(defmethod remove-active-cell ((this traffic-level-data) (arg0 int)) + (let ((v1-1 (+ (-> this active-cell-count) -1))) + (when (>= v1-1 0) + (set! (-> this active-cell-list arg0) (-> this active-cell-list v1-1)) + (+! (-> this active-cell-count) -1) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type traffic-level-data +;; WARN: Return type mismatch int vs none. +(defmethod add-newly-active-cell ((this traffic-level-data) (arg0 vis-cell)) + (let ((v1-0 (-> this newly-active-cell-count))) + (when (< v1-0 (the-as uint 255)) + (set! (-> this newly-active-cell-list v1-0) arg0) + (+! (-> this newly-active-cell-count) 1) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type traffic-level-data +;; WARN: Return type mismatch int vs none. +(defmethod per-frame-cell-update ((this traffic-level-data)) + (set! (-> this newly-active-cell-count) (the-as uint 0)) + (dotimes (v1-0 (the-as int (-> this active-cell-count))) + (let ((a0-3 (-> this active-cell-list v1-0))) + (set! (-> a0-3 prev-flags) (-> a0-3 flags)) + ) + ) + (let ((s5-0 (math-camera-pos)) + (f30-0 81920.0) + (f28-0 819200.0) + (f26-0 491520.0) + ) + (dotimes (s4-0 (the-as int (-> this city-info cell-count))) + (let ((s3-0 (-> this city-info cell-array s4-0))) + (let ((f24-0 (vector-vector-distance-squared (-> s3-0 sphere) s5-0)) + (f0-1 (+ (-> s3-0 sphere r) f28-0)) + ) + (cond + ((or (< (* f0-1 f0-1) f24-0) (let ((f0-5 (+ (-> s3-0 sphere r) f30-0))) + (and (< (* f0-5 f0-5) f24-0) (not (sphere-in-view-frustum? (-> s3-0 sphere)))) + ) + ) + (logclear! (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian)) + ) + ((let ((f0-9 (+ (-> s3-0 sphere r) f26-0))) + (< (* f0-9 f0-9) f24-0) + ) + (let ((v1-17 (logior (-> s3-0 flags) (vis-cell-flag active-vehicle)))) + (set! (-> s3-0 flags) (logclear v1-17 (vis-cell-flag active-pedestrian))) + ) + ) + (else + (logior! (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian)) + ) + ) + ) + (if (< (the-as uint (logand (-> s3-0 prev-flags) (vis-cell-flag active-vehicle active-pedestrian))) + (the-as uint (logand (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian))) + ) + (add-newly-active-cell this s3-0) + ) + ) + ) + ) + (countdown (s5-1 (-> this active-cell-count)) + (let ((v1-32 (-> this active-cell-list s5-1))) + (when (not (logtest? (-> v1-32 flags) (vis-cell-flag active-vehicle active-pedestrian))) + (logclear! (-> v1-32 prev-flags) (vis-cell-flag active-vehicle active-pedestrian)) + (remove-active-cell this (the-as int s5-1)) + ) + ) + ) + (dotimes (s5-2 (the-as int (-> this newly-active-cell-count))) + (let ((a1-5 (-> this newly-active-cell-list s5-2))) + (add-active-cell this a1-5) + ) + ) + (let ((v1-43 (-> this active-cell-box))) + (set-vector! + (-> v1-43 min) + 10000000000000000000000000000000000000.0 + 10000000000000000000000000000000000000.0 + 10000000000000000000000000000000000000.0 + 1.0 + ) + (set-vector! + (-> v1-43 max) + -10000000000000000000000000000000000000.0 + -10000000000000000000000000000000000000.0 + -10000000000000000000000000000000000000.0 + 1.0 + ) + (countdown (a0-23 (-> this active-cell-count)) + (let ((a1-16 (-> this active-cell-list a0-23))) + (set! (-> v1-43 min x) (fmin (-> v1-43 min x) (- (-> a1-16 sphere x) (-> a1-16 sphere r)))) + (set! (-> v1-43 min y) (fmin (-> v1-43 min y) (- (-> a1-16 sphere y) (-> a1-16 sphere r)))) + (set! (-> v1-43 min z) (fmin (-> v1-43 min z) (- (-> a1-16 sphere z) (-> a1-16 sphere r)))) + (set! (-> v1-43 max x) (fmax (-> v1-43 max x) (+ (-> a1-16 sphere x) (-> a1-16 sphere r)))) + (set! (-> v1-43 max y) (fmax (-> v1-43 max y) (+ (-> a1-16 sphere y) (-> a1-16 sphere r)))) + (set! (-> v1-43 max z) (fmax (-> v1-43 max z) (+ (-> a1-16 sphere z) (-> a1-16 sphere r)))) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 14 of type traffic-level-data +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this traffic-level-data)) + (local-vars (sv-16 nav-node) (sv-20 nav-branch) (sv-80 nav-node) (sv-84 vector) (sv-88 vector) (sv-92 vector)) + (when (and (nonzero? (-> this city-info)) (nonzero? (-> this city-info nav-graph))) + (let ((s5-0 (-> this city-info nav-graph))) + (let ((v1-6 (-> s5-0 node-array 0))) + (countdown (a0-3 (-> s5-0 node-count)) + (logclear! (-> v1-6 flags) (nav-node-flag-byte visited)) + (&+! v1-6 32) + ) + ) + (dotimes (s4-0 (the-as int (-> this active-cell-count))) + (let ((a0-4 (-> this active-cell-list s4-0))) + (dotimes (v1-11 (-> a0-4 segment-count)) + (let ((a1-5 (-> a0-4 segment-array v1-11 branch src-node))) + (logior! (-> a1-5 flags) (nav-node-flag-byte visited)) + ) + ) + (debug-draw a0-4) + ) + ) + (set! sv-16 (-> s5-0 node-array 0)) + (countdown (gp-1 (-> s5-0 node-count)) + (when (logtest? (-> sv-16 flags) (nav-node-flag-byte visited)) + (debug-draw sv-16) + (dotimes (s5-1 (-> sv-16 branch-count)) + (set! sv-20 (-> sv-16 branch-array s5-1)) + (set! sv-80 (-> sv-20 dest-node)) + (set! sv-84 (new 'stack-no-clear 'vector)) + (set! sv-88 (new 'stack-no-clear 'vector)) + (set! sv-92 (new 'stack-no-clear 'vector)) + (let ((a1-7 sv-16) + (v1-35 sv-88) + ) + (set! (-> v1-35 quad) (-> a1-7 position quad)) + (set! (-> v1-35 w) 1.0) + ) + (let ((a1-10 sv-80) + (v1-36 sv-92) + ) + (set! (-> v1-36 quad) (-> a1-10 position quad)) + (set! (-> v1-36 w) 1.0) + ) + (vector-! sv-84 sv-92 sv-88) + (vector+float*! sv-84 sv-88 sv-84 0.5) + (let ((s4-1 add-debug-text-3d) + (s3-0 #t) + (s2-0 583) + ) + (format (clear *temp-string*) "~D" (-> sv-20 user-count)) + (s4-1 + s3-0 + (the-as bucket-id s2-0) + *temp-string* + sv-84 + (if (< (-> sv-20 user-count) (-> sv-20 max-user-count)) + (font-color yellow) + (font-color red) + ) + (the-as vector2h #f) + ) + ) + ) + ) + (set! sv-16 (&+ sv-16 32)) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc index 4c9f451c7d..f68b7a4fbe 100644 --- a/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc @@ -332,7 +332,6 @@ ) ;; definition for method 3 of type shaker -;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this shaker)) (when (not this) (set! this this) @@ -354,7 +353,6 @@ ) ;; definition for method 9 of type shaker -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch float vs none. (defmethod shaker-method-9 ((this shaker)) (let ((s5-0 (- (current-time) (-> this start-time)))) @@ -957,7 +955,7 @@ ;; definition for method 23 of type wascity-awning-a ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-23 ((this wascity-awning-a)) +(defmethod init-skel! ((this wascity-awning-a)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-awning-a" (the-as (pointer level) #f))) @@ -969,7 +967,7 @@ ;; definition for method 24 of type wascity-awning-a ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 ((this wascity-awning-a)) +(defmethod init-collision! ((this wascity-awning-a)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) @@ -1033,7 +1031,7 @@ ;; definition for method 23 of type wascity-awning-b ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-23 ((this wascity-awning-b)) +(defmethod init-skel! ((this wascity-awning-b)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-awning-b" (the-as (pointer level) #f))) @@ -1045,7 +1043,7 @@ ;; definition for method 24 of type wascity-awning-b ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 ((this wascity-awning-b)) +(defmethod init-collision! ((this wascity-awning-b)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) diff --git a/test/decompiler/reference/jak3/levels/wascity/wlander-female_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wlander-female_REF.gc new file mode 100644 index 0000000000..8cc8f48a2b --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/wlander-female_REF.gc @@ -0,0 +1,1058 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-waster-b waster-b 0 -1 + ((1 (meters 20)) (2 (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow 3 + ) + +;; definition for symbol *waster-b-global-info*, type civilian-global-info +(define *waster-b-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 20 22) + :knocked-land (new 'static 'array int32 2 21 23) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 20 22)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 26)) + ) + :anim-cover-head-start 28 + :anim-cover-head-loop 29 + :anim-cover-head-end 30 + :speech-ambient 19 + :speech-alert 20 + :speech-cower 21 + :speech-touched-by-player 22 + :speech-shot-by-player 23 + :speech-avoiding-player-vehicle 24 + :speech-hit-by-player-vehicle 25 + ) + ) + +;; definition of type waster-b +(deftype waster-b (civilian) + () + ) + +;; definition for method 3 of type waster-b +(defmethod inspect ((this waster-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type civilian inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *waster-b-nav-enemy-info*, type nav-enemy-info +(define *waster-b-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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 20 + :knocked-land-anim 21 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 11 + :jump-in-air-anim 11 + :jump-land-anim 11 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance-delta (meters 0.1) + :default-hit-points 1.0 + :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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 20480.0 + :knocked-soft-vy-hi 40960.0 + :knocked-medium-vxz-lo 40960.0 + :knocked-medium-vxz-hi 73728.0 + :knocked-medium-vy-lo 24576.0 + :knocked-medium-vy-hi 53248.0 + :knocked-hard-vxz-lo 53248.0 + :knocked-hard-vxz-hi 102400.0 + :knocked-hard-vy-lo 40960.0 + :knocked-hard-vy-hi 81920.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 8192.0 + :knocked-yellow-vxz-hi 16384.0 + :knocked-yellow-vy-lo 12288.0 + :knocked-yellow-vy-hi 24576.0 + :knocked-red-vxz-lo 12288.0 + :knocked-red-vxz-hi 24576.0 + :knocked-red-vy-lo 20480.0 + :knocked-red-vy-hi 36864.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 32768.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9956 :y 0.0755 :z -0.0549 :w 34275.477) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :y -0.1262 :z -0.9919 :w 14.399715) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1925.12 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9223 :y -0.0007 :z -0.3862 :w 32775.19) + :geo-tform (new 'static 'vector :x 0.9203 :y -0.1312 :z -0.3683 :w 34427.207) + :axial-slop 965.27246 + :max-angle 5853.9307 + :coll-rad 2340.4543 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2005 :z -0.9796 :w 2271.4595) + :geo-tform (new 'static 'vector :x 0.1581 :y 0.9865 :z -0.0421 :w 8845.103) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1692.0576 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7243 :z -0.6893 :w 2846.8657) + :geo-tform (new 'static 'vector :x -0.1479 :y 0.9867 :z 0.066 :w 8858.61) + :axial-slop 965.27246 + :max-angle 4573.776 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.8955 :z -0.445 :w 13969.198) + :geo-tform (new 'static 'vector :x -0.7036 :y -0.676 :z 0.2186 :w 20755.123) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1223.8848 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8754 :z -0.4832 :w 13897.382) + :geo-tform (new 'static 'vector :x -0.3584 :y -0.8556 :z -0.3732 :w 18419.002) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 901.5296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.0404 :z -0.9991 :w 8581.703) + :geo-tform (new 'static 'vector :x 0.2116 :y -0.9532 :z 0.2155 :w 17374.959) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 949.0432 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0279 :z 0.9996 :w 3558.259) + :geo-tform (new 'static 'vector :x -0.9963 :y -0.085 :z -0.0097 :w 9371.43) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1292.6976 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4821 :z 0.876 :w 10845.134) + :geo-tform (new 'static 'vector :x -0.5782 :y 0.7328 :z 0.3585 :w 34858.27) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1266.0736 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6376 :z 0.7703 :w 15514.556) + :geo-tform (new 'static 'vector :x 0.0502 :y 0.9291 :z 0.3662 :w 35412.96) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1164.9023 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.963 :z -0.2693 :w 7833.773) + :geo-tform (new 'static 'vector :x -0.0243 :y 0.0434 :z 0.9987 :w 31253.5) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1002.7008 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2155 :z -0.9764 :w 1509.913) + :geo-tform (new 'static 'vector :x -0.2514 :y 0.9548 :z 0.1584 :w 16456.654) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1101.0048 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.9221 :y -0.0002 :z -0.3868 :w 16.09273) + :geo-tform (new 'static 'vector :x -0.9217 :y 0.0096 :z 0.3876 :w 10.176285) + :axial-slop 965.27246 + :max-angle 2330.5146 + :coll-rad 1939.456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :z -1.0 :w 12461.907) + :geo-tform (new 'static 'vector :x -0.3106 :y -0.4242 :z 0.8505 :w 16421.393) + :axial-slop 965.27246 + :max-angle 2253.4373 + :coll-rad 983.8592 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6836 :z 0.7298 :w 14527.329) + :geo-tform (new 'static 'vector :x 0.6717 :y -0.6833 :z 0.286 :w 11624.775) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1144.4224 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.693 :z 0.7208 :w 8269.915) + :geo-tform (new 'static 'vector :x -0.693 :y -0.5965 :z -0.4047 :w 14961.978) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1106.3296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5333 :z -0.8459 :w 11592.299) + :geo-tform (new 'static 'vector :x -0.6362 :y -0.6968 :z -0.331 :w 13379.302) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1120.6656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint 13 + :pre-tform (new 'static 'vector :z 1.0 :w 12451.658) + :geo-tform (new 'static 'vector :x -0.5073 :y 0.5962 :z -0.6221 :w 12900.307) + :axial-slop 965.27246 + :max-angle 2242.4417 + :coll-rad 829.44 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8844 :z -0.4666 :w 10098.569) + :geo-tform (new 'static 'vector :x 0.7665 :y 0.5537 :z -0.3251 :w 13637.15) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 889.6512 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6949 :z -0.719 :w 11076.858) + :geo-tform (new 'static 'vector :x -0.8013 :y 0.5535 :z 0.2267 :w 15242.5625) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1168.1792 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7409 :z 0.6715 :w 12293.717) + :geo-tform (new 'static 'vector :x -0.6542 :y 0.6831 :z 0.3245 :w 13102.194) + :axial-slop 965.27246 + :max-angle 4573.776 + :coll-rad 1168.1792 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 11 + :turn-anim 11 + :run-anim 15 + :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 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *waster-b-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 67 of type waster-b +(defmethod coin-flip? ((this waster-b)) + #f + ) + +;; definition for method 27 of type waster-b +(defmethod get-inv-mass ((this waster-b)) + 0.5 + ) + +;; definition for method 55 of type waster-b +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this waster-b)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-5 (handle->process (-> this focus handle)))) + (when a0-5 + (get-trans (the-as process-focusable a0-5) 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f30-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) + (vector-negate-in-place! s5-1) + ) + (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f1-2 (deg- f30-0 f28-0)) + (f2-0 (fabs f1-2)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) + ) + (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) + (set! f30-0 (+ (cond + ((< f2-0 16384.0) + (if (>= f1-2 0.0) + f0-8 + (- f0-8) + ) + ) + ((>= f1-2 0.0) + (- 32768.0 f0-8) + ) + (else + (+ -32768.0 f0-8) + ) + ) + f28-0 + ) + ) + (if (< f30-0 0.0) + (set! f30-0 (+ 65536.0 f30-0)) + ) + ) + ) + ) + ) + ) + (the-as degrees f30-0) + ) + ) + +;; definition for method 87 of type waster-b +(defmethod knocked-anim-handler ((this waster-b) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-0 (ja-done? 0))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + (when s5-0 + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + ) + (set! (-> a0-6 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-6 param 1) (-> arg1 anim-speed)) + (set! (-> a0-6 frame-num) 3.0) + (joint-control-channel-group! + a0-6 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + num-func-seek! + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +;; definition for method 85 of type waster-b +(defmethod knocked-anim ((this waster-b) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-131 this 1 a2-0)) + (a1-7 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) + yellow-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) + (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) + (set! (-> a0-15 param 1) (-> arg0 anim-speed)) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim a1-7) num-func-seek!) + ) + ) + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.01)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-131 this 3 a2-2)) + (a1-14 + (-> this + draw + art-group + data + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) + blue-hit-anim + 0 + anim-index-front + ) + ) + ) + ) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) + (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) + (set! (-> a0-30 param 1) 1.0) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim a1-14) num-func-seek!) + ) + ) + ) + (else + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.01)) + (let ((a0-39 (-> this skel root-channel 0))) + (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-39 param 1) (-> arg0 anim-speed)) + (set! (-> a0-39 frame-num) 0.0) + (joint-control-channel-group! a0-39 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + ) + #t + ) + +;; definition for method 86 of type waster-b +(defmethod knocked-land-anim ((this waster-b) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + ) + (set! (-> a0-2 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + frames + num-frames + ) + -1 + ) + ) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! + a0-2 + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + num-func-seek! + ) + ) + #t + ) + +;; failed to figure out what this is: +(defstate knocked (waster-b) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (the-as collide-shape-prim-group (-> self root root-prim)))) + (logior! (-> v1-5 child 0 prim-core action) (collide-action no-standon)) + (logclear! (-> v1-5 child 1 prim-core action) (collide-action no-standon)) + (set! (-> v1-5 child 1 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate get-up-front (waster-b) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-front) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-back (waster-b) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian get-up-back) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self root root-prim))) + (logclear! (-> (the-as collide-shape-prim-group v1-5) child 0 prim-core action) (collide-action no-standon)) + (logior! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core action) (collide-action no-standon)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-as) (collide-spec civilian)) + (set! (-> (the-as collide-shape-prim-group v1-5) child 1 prim-core collide-with) + (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait (waster-b) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (until #f + (let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0))) + (gp-0 (rand-vu-int-range 1 5)) + (s5-0 (rand-vu-int-count 2)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (if (zero? s5-0) + (ja-no-eval :group! (-> self draw art-group data 5) :num! min) + (ja-no-eval :group! (-> self draw art-group data 7) :num! min) + ) + (let ((f28-0 0.0)) + (while (< f28-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f28-0 f28-0 f28-0) (* 3.0 f28-0 f28-0)) 0.0 1.0) + ) + (suspend) + (+! f28-0 (seconds-per-frame)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (while (> gp-0 0) + (+! gp-0 -1) + (cond + ((zero? s5-0) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + ) + ) + (if (-> self wait-return-state) + (go (-> self wait-return-state)) + ) + ) + #f + ) + ) + +;; definition for method 120 of type waster-b +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this waster-b)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 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 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 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) 4096.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type waster-b +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this waster-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-waster-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *waster-b-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *waster-b-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 12) + (let ((v1-18 (rnd-int this 3))) + (cond + ((zero? v1-18) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 1) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ((= v1-18 2) + (set! (-> this anim-walk) 14) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) + ) + ) + ) + (let ((v1-33 (rnd-int this 3))) + (cond + ((zero? v1-33) + (set! (-> this anim-panic-run) 17) + ) + ((= v1-33 1) + (set! (-> this anim-panic-run) 17) + ) + ((= v1-33 2) + (set! (-> this anim-panic-run) 15) + ) + ) + ) + (set! (-> this dist-run-anim) 20480.0) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (set! (-> this anim-run) 15) + ) + ((= v1-40 1) + (set! (-> this anim-run) 16) + ) + ((= v1-40 2) + (set! (-> this anim-run) 16) + ) + ) + ) + (set! (-> this speed-run) 32768.0) + (set! (-> this anim-on-ground) 19) + (set! (-> this anim-dive) 18) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (rnd-float-range this 1.0 1.25)) + (f0-15 (rnd-float-range this 1.0 1.25)) + ) + (set-vector! (-> this root scale) f0-15 f30-0 f0-15 1.0) + ) + (let ((f0-17 (rnd-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-17 f0-17 f0-17 1.0) + ) + (set! (-> this water-anim) 32) + 0 + (none) + ) + +;; definition for method 194 of type waster-b +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this waster-b)) + (let ((t9-0 (method-of-type civilian citizen-method-194))) + (t9-0 this) + ) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (let ((v1-7 (rnd-int this 2))) + (cond + ((zero? v1-7) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (rnd-int this 3))) + (cond + ((zero? v1-11) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-11 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-11 2) + (setup-masks (-> this draw) #x8000 0) + ) + ) + ) + (let ((v1-20 (rnd-int this 4))) + (cond + ((zero? v1-20) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-20 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-20 2) + (setup-masks (-> this draw) 130 0) + ) + ) + ) + (setup-masks (-> this draw) 512 0) + (let ((v1-31 (rnd-int this 3))) + (cond + ((zero? v1-31) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-31 1) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-31 2) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + (let ((v1-40 (rnd-int this 3))) + (cond + ((zero? v1-40) + (setup-masks (-> this draw) 32 0) + ) + ((= v1-40 1) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-40 2) + (setup-masks (-> this draw) #x20000 0) + ) + ) + ) + (let ((v1-49 (rnd-int this 3))) + (cond + ((zero? v1-49) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-49 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-49 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ((= v1-7 1) + (setup-masks (-> this draw) #x400000 0) + (setup-masks (-> this draw) #x200000 0) + (let ((v1-63 (rnd-int this 2))) + (cond + ((zero? v1-63) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-63 1) + (setup-masks (-> this draw) #x80000 0) + ) + ) + ) + (let ((v1-70 (rnd-int this 2))) + (cond + ((zero? v1-70) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-70 1) + (setup-masks (-> this draw) #x100000 0) + ) + ) + ) + (let ((v1-77 (rnd-int this 4))) + (cond + ((zero? v1-77) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-77 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-77 2) + (setup-masks (-> this draw) 130 0) + ) + ) + ) + (if (zero? (rnd-int this 1)) + (setup-masks (-> this draw) #x20000 0) + ) + (let ((v1-91 (rnd-int this 3))) + (cond + ((zero? v1-91) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-91 1) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-91 2) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/wlander-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wlander-h_REF.gc new file mode 100644 index 0000000000..5a3e97f2b7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/wlander-h_REF.gc @@ -0,0 +1,70 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type wlander-anim-info +(deftype wlander-anim-info (structure) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) + ) + :pack-me + ) + +;; definition for method 3 of type wlander-anim-info +(defmethod inspect ((this wlander-anim-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'wlander-anim-info) + (format #t "~1Tanim-index[2] @ #x~X~%" (-> this anim-index)) + (format #t "~1Tanim-index-front: ~D~%" (-> this anim-index-front)) + (format #t "~1Tanim-index-back: ~D~%" (-> this anim-index-back)) + (label cfg-4) + this + ) + +;; definition of type wlander-global-info +(deftype wlander-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (knocked-land int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim wlander-anim-info 2 :inline) + (yellow-land-anim wlander-anim-info 2 :inline) + (blue-hit-anim wlander-anim-info 1 :inline) + ) + ) + +;; definition for method 3 of type wlander-global-info +(defmethod inspect ((this wlander-global-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tknocked[2] @ #x~X~%" (-> this knocked)) + (format #t "~1Tknocked-land[2] @ #x~X~%" (-> this knocked-land)) + (format #t "~1Tanim-knocked-front: ~D~%" (-> this anim-knocked-front)) + (format #t "~1Tanim-knocked-back: ~D~%" (-> this anim-knocked-back)) + (format #t "~1Tanim-knocked-front-land: ~D~%" (-> this anim-knocked-front-land)) + (format #t "~1Tanim-knocked-back-land: ~D~%" (-> this anim-knocked-back-land)) + (format #t "~1Tyellow-hit-anim[2] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tyellow-land-anim[2] @ #x~X~%" (-> this yellow-land-anim)) + (format #t "~1Tblue-hit-anim[1] @ #x~X~%" (-> this blue-hit-anim)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc new file mode 100644 index 0000000000..ced7600953 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc @@ -0,0 +1,2865 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type wlander +(deftype wlander (civilian) + ((mad-level float :offset 1128) + (los los-control :inline) + (target-pos vector :inline) + (gun-joint int32) + (gun-axis int32) + (gun-length float) + (shoot-time time-frame) + (last-time-far time-frame) + (last-time-los time-frame) + (shot-sound int32) + (knocked-collide basic) + (knocked-speed-scale float :offset 1384) + (male symbol) + ) + (:state-methods + gun-shoot + close-attack + standing + panic + ) + (:methods + (call-for-help (_type_ float) none) + (fire-shot (_type_) none) + (toggle-cspec (_type_ symbol int) none) + (search-for-focus (_type_) none) + (try-activate (_type_) symbol) + ) + ) + +;; definition for method 3 of type wlander +(defmethod inspect ((this wlander)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type civilian inspect))) + (t9-0 this) + ) + (format #t "~2Thit-face: ~D~%" (-> this hit-face)) + (format #t "~2Tmad-level: ~f~%" (-> this mad-level)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tgun-joint: ~D~%" (-> this gun-joint)) + (format #t "~2Tgun-axis: ~D~%" (-> this gun-axis)) + (format #t "~2Tgun-length: ~f~%" (-> this gun-length)) + (format #t "~2Tshoot-time: ~D~%" (-> this shoot-time)) + (format #t "~2Tlast-time-far: ~D~%" (-> this last-time-far)) + (format #t "~2Tlast-time-los: ~D~%" (-> this last-time-los)) + (format #t "~2Tshot-sound: ~D~%" (-> this shot-sound)) + (format #t "~2Tknocked-collide: ~A~%" (-> this knocked-collide)) + (format #t "~2Tanim-get-up-front: ~D~%" (-> this anim-get-up-front)) + (format #t "~2Tanim-get-up-back: ~D~%" (-> this anim-get-up-back)) + (format #t "~2Tknocked-speed-scale: ~f~%" (-> this knocked-speed-scale)) + (format #t "~2Tmale: ~A~%" (-> this male)) + (label cfg-4) + this + ) + +;; definition for method 194 of type wlander +;; WARN: Return type mismatch citizen-flag vs none. +(defmethod citizen-method-194 ((this wlander)) + (let ((t9-0 (method-of-type citizen citizen-method-194))) + (t9-0 this) + ) + (set! (-> this knocked-speed-scale) 1.0) + (set! (-> this anim-get-up-front) -1) + (set! (-> this anim-get-up-back) -1) + (set! (-> this ragdoll-proc) (the-as handle #f)) + (cond + ((rand-vu-percent? 0.5) + ) + (else + (logclear! (-> this flags) (citizen-flag talking)) + ) + ) + (none) + ) + +;; definition for method 123 of type wlander +;; WARN: Return type mismatch object vs symbol. +(defmethod enemy-method-123 ((this wlander)) + (the-as + symbol + (or (and (>= (-> this incoming blue-juggle-count) (the-as uint 2)) (-> this incoming knocked-type) 6) + (or (= (-> this hit-points) 0.0) (nonzero? (-> this fated-time))) + ) + ) + ) + +;; definition for method 125 of type wlander +;; INFO: this function exists in multiple non-identical object files +(defmethod ragdoll-settled? ((this wlander)) + (let ((s5-0 (handle->process (-> this ragdoll-proc)))) + (or (not s5-0) + (or (ragdoll-proc-method-19 (the-as ragdoll-proc s5-0)) + (and (time-elapsed? (-> this state-time) (seconds 0.1)) + (< (vector-length (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-joints 0 velocity)) + (* 4096.0 (seconds-per-frame)) + ) + (< (cos (* 182.04445 (seconds-per-frame))) (-> (the-as ragdoll-proc s5-0) ragdoll rotate-vel w)) + (not (enemy-method-109 this)) + (not (within-gspot-range? this)) + ) + ) + ) + ) + ) + +;; definition for method 20 of type wlander +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this wlander)) + (let ((v1-1 (handle->process (-> this focus handle)))) + (the-as search-info-flag (if (if v1-1 + (= (-> v1-1 type) target) + ) + 16 + (the-as int (call-parent-method this)) + ) + ) + ) + ) + +;; definition for method 126 of type wlander +;; WARN: Return type mismatch float vs vector. +(defmethod ragdoll-spawn! ((this wlander) (arg0 symbol) (arg1 symbol)) + (let ((t9-0 (method-of-type nav-enemy ragdoll-spawn!))) + (t9-0 this arg0 arg1) + ) + (let ((v1-2 (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))))) + (the-as vector (when v1-2 + (set! (-> v1-2 ragdoll stretch-vel) 1.1) + (set! (-> v1-2 ragdoll stretch-vel-parallel) 1.1) + ) + ) + ) + ) + +;; definition for method 125 of type wlander +;; INFO: this function exists in multiple non-identical object files +(defmethod ragdoll-settled? ((this wlander)) + (let ((s5-0 (handle->process (-> this ragdoll-proc)))) + (if s5-0 + (seek! (-> (the-as ragdoll-proc s5-0) ragdoll momentum) 0.7 (seconds-per-frame)) + ) + ) + ((method-of-type nav-enemy ragdoll-settled?) this) + ) + +;; definition for method 193 of type wlander +;; WARN: Return type mismatch int vs none. +(defmethod set-squad ((this wlander)) + (set! (-> this squad) *waswide-squad-control*) + 0 + (none) + ) + +;; definition for method 82 of type wlander +;; INFO: Used lq/sq +;; WARN: disable def twice: 165. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this wlander) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('help) + (let ((v1-1 (-> arg3 param 0)) + (f0-0 (the-as float (-> arg3 param 1))) + ) + (cond + ((and (zero? (-> this focus handle)) + (!= (-> this focus handle) (the-as handle v1-1)) + (!= this (handle->process (the-as handle v1-1))) + (< 0.0 f0-0) + ) + (+! (-> this mad-level) 1.0) + (set! (-> this focus handle) (the-as handle v1-1)) + #t + ) + (else + #f + ) + ) + ) + ) + (('event-shoot) + (fire-shot this) + ) + (('hit 'hit-flinch 'hit-knocked) + (+! (-> this mad-level) 1.0) + (speech-control-method-14 *speech-control* (the-as handle this)) + (logior! (-> this flags) (citizen-flag hostile)) + (let* ((s1-0 (handle->process (-> this incoming attacker-handle))) + (a1-12 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when a1-12 + (enemy-method-70 this (the-as process-focusable a1-12) (the-as enemy-aware #f)) + (call-for-help this (* 4096.0 (* 10.0 (-> this mad-level)))) + (if (-> this male) + (speech-control-method-12 *speech-control* this (speech-type civ-m-shot-by-player)) + (speech-control-method-12 *speech-control* this (speech-type civ-f-shot-by-player)) + ) + ) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('event-death) + (if (= (-> this hit-points) 0.0) + (do-effect (-> this skel effect) "death-default" 0.0 -1) + ) + ) + (('combo) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (!= (-> this hit-points) 0.0)) + ) + ) + (('notify) + (let ((a0-32 (-> arg3 param 0)) + (v1-32 (the-as object (-> arg3 param 1))) + ) + (when (= a0-32 'attack) + (when (logtest? (-> (the-as process-focusable v1-32) mask) (process-mask target)) + (if (focus-test? (the-as process-focusable v1-32) dead) + (format #t "guard killed player~%") + ) + ) + ) + ) + ) + (('clear-path) + (set-time! (-> this last-danger-time)) + (let ((v1-37 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-37 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-37 velocity quad)) + (when (= (-> v1-37 danger-type) 8) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 50.0) + (let ((s5-1 (-> this cp-plane))) + (set! (-> s5-1 quad) (-> this cp-vec quad)) + (set! (-> s5-1 y) 0.0) + (vector-rotate90-around-y! s5-1 s5-1) + (vector-normalize! s5-1 1.0) + (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> this cp-sphere))))) + ) + (set! (-> this cp-exit-time) (+ (current-time) (seconds 4))) + (if (and (-> this next-state) (let ((v1-50 (-> this next-state name))) + (or (= v1-50 'active) (= v1-50 'wait) (= v1-50 'avoid-danger)) + ) + ) + (go (method-of-object this clear-path)) + ) + ) + ) + ) + (else + ((method-of-type citizen event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (wlander) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (nav-enemy-method-184 self) + (let ((a0-2 (-> self nav state)) + (v1-5 *null-vector*) + ) + (logior! (-> a0-2 flags) (nav-state-flag directional-mode)) + (set! (-> a0-2 travel quad) (-> v1-5 quad)) + ) + 0 + (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (set! (-> self gnd-height) (-> self root gspot-pos y)) + (vector-reset! (-> self root transv)) + ) + :exit (behavior () + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (let ((s5-0 (if (zero? (-> self hit-face)) + (-> self anim-get-up-front) + (-> self anim-get-up-back) + ) + ) + ) + (when (!= s5-0 -1) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data s5-0) :num! min) + (ja-no-eval :num! (seek! max (-> self speed-scale))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (go-virtual active) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (wlander) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type citizen knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self hit-face) + (the-as + uint + (if (< (vector-dot (-> self root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + 0.0 + ) + 1 + 0 + ) + ) + ) + (set! (-> self knocked-collide) #f) + ) + :post (behavior () + (let ((gp-0 (-> self root))) + (cond + ((focus-test? self under-water) + (accelerate-fall! self (-> gp-0 transv)) + ) + (else + (if (logtest? (-> gp-0 status) (collide-status touch-surface)) + (set! (-> self knocked-collide) (the-as basic #t)) + ) + (when (and (not (-> self knocked-collide)) (!= (-> self incoming knocked-type) 4)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-orient-by-quat! s5-0 s5-0 (-> gp-0 quat)) + (vector-xz-normalize! + (-> gp-0 transv) + (* (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))) (-> self knocked-speed-scale)) + ) + ) + ) + (let ((a1-3 (new-stack-vector0))) + (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 a1-3 (-> self enemy-info slip-factor))) + ) + ) + ) + (let ((a2-2 (new 'stack-no-clear 'collide-query))) + (set! (-> a2-2 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> a2-2 ignore-process0) self) + (set! (-> a2-2 ignore-process1) #f) + (set! (-> a2-2 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> gp-0 pat-ignore-mask))) + (set! (-> a2-2 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide gp-0 (-> gp-0 transv) a2-2 (meters 0)) + ) + ) + (apply-friction self) + (enemy-common-post self) + ) + ) + +;; definition for method 27 of type wlander +(defmethod get-inv-mass ((this wlander)) + 0.5 + ) + +;; definition for method 240 of type wlander +;; WARN: Return type mismatch int vs none. +(defmethod toggle-cspec ((this wlander) (arg0 symbol) (arg1 int)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a3-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) + (cond + ((and arg0 (= (-> a3-1 prim-id) arg1)) + (logior! (-> a3-1 prim-core action) (collide-action deadly)) + (when (nonzero? (-> a3-1 prim-id)) + (set! (-> a3-1 prim-core collide-as) (collide-spec civilian)) + (set! (-> a3-1 prim-core collide-with) (collide-spec jak bot player-list)) + ) + ) + (else + (logclear! (-> a3-1 prim-core action) (collide-action deadly)) + (when (nonzero? (-> a3-1 prim-id)) + (set! (-> a3-1 prim-core collide-as) (collide-spec)) + (set! (-> a3-1 prim-core collide-with) (collide-spec)) + 0 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 214 of type wlander +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-214 ((this wlander) (arg0 nav-control) (arg1 vector)) + (set! (-> arg1 y) 0.0) + (vector-normalize! arg1 1.0) + (let ((gp-0 (new 'stack-no-clear 'quaternion)) + (s5-0 (-> this root quat)) + ) + (quaternion-set! gp-0 0.0 (-> arg1 x) 0.0 (+ 1.0 (-> arg1 z))) + (quaternion-normalize! gp-0) + (quaternion-smooth-seek! + s5-0 + s5-0 + gp-0 + (* (+ 1.0 (* 0.00024414062 (-> this nav state speed))) (seconds-per-frame)) + ) + ) + 0 + (none) + ) + +;; definition for function wlander-travel-anim +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior wlander-travel-anim wlander ((arg0 object) (arg1 time-frame)) + (logclear! (-> self flags) (citizen-flag run-mode)) + (let ((v1-4 (ja-group))) + (when (not (and v1-4 (= v1-4 (-> self draw art-group data (-> self anim-walk))))) + (ja-channel-push! 2 arg1) + (ja-no-eval :group! (-> self draw art-group data (-> self anim-walk)) + :num! (loop!) + :dist (-> self dist-walk-anim) + :frame-num (ja-aframe 4.0 0) + ) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-3 (-> self interp))) + (set! (-> gp-1 frame-interp 1) f0-3) + (set! (-> gp-1 frame-interp 0) f0-3) + ) + (set! (-> gp-1 dist) (-> self dist-run-anim)) + (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data (get-run-anim self)))) + (set! (-> gp-1 param 0) 0.0) + (joint-control-channel-group! + gp-1 + (the-as art-joint-anim (-> self draw art-group data (get-run-anim self))) + num-func-chan + ) + ) + ) + ) + (until #f + (let* ((f28-0 (-> self nav state speed)) + (f30-0 (lerp-scale 0.0 1.0 f28-0 (-> self speed-walk) (-> self speed-run))) + ) + (seek! (-> self interp) f30-0 (* 4.0 (seconds-per-frame))) + (let ((v1-38 (-> self skel root-channel 1)) + (f0-13 (-> self interp)) + ) + (set! (-> v1-38 frame-interp 1) f0-13) + (set! (-> v1-38 frame-interp 0) f0-13) + ) + (cond + ((< (-> self speed-walk) f28-0) + (ja :num! (loop! (+ 1.0 (* 0.4 f30-0)))) + ) + (else + (let ((f0-18 (lerp-scale 0.1 1.0 f28-0 4096.0 (-> self speed-walk)))) + (ja :num! (loop! f0-18)) + ) + ) + ) + ) + (ja :chan 1 :num! (chan 0)) + (suspend) + ) + #f + (none) + ) + +;; definition for method 78 of type wlander +(defmethod go-hostile ((this wlander)) + (go (method-of-object this hostile)) + ) + +;; definition for method 212 of type wlander +;; WARN: Return type mismatch int vs none. +(defmethod go-from-behavior ((this wlander) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((12) + (go (method-of-object this standing)) + ) + ((2) + (go (method-of-object this active)) + ) + ((3) + (go (method-of-object this hostile)) + ) + (else + (go-inactive this) + ) + ) + 0 + (none) + ) + +;; definition for method 239 of type wlander +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod fire-shot ((this wlander)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((s5-0 (handle->process (-> this focus handle))) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (when s4-0 + (vector-! s5-1 (-> this root trans) (get-trans (the-as process-focusable s4-0) 0)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-rotate90-around-y! s5-1 s5-1) + (if (< 0.0 (vector-dot s5-1 (get-transv (the-as process-focusable s4-0)))) + (vector-negate-in-place! s5-1) + ) + (cond + ((= (-> s4-0 type) target) + (let ((s3-4 (-> this target-pos))) + (let ((s2-1 (get-trans (the-as process-focusable s4-0) 3))) + (let ((v1-17 (* 0.2 (vector-length (get-transv (the-as process-focusable s4-0)))))) + (.mov vf7 v1-17) + ) + (.lvf vf5 (&-> s5-1 quad)) + (.lvf vf4 (&-> s2-1 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 (&-> s3-4 quad) vf6) + ) + ) + (else + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + ) + ) + ) + ) + (let ((t0-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this gun-joint))))) + (new 'stack-no-clear 'vector) + (let ((a0-15 t0-0)) + (let ((v1-25 t0-0)) + (let ((a1-12 (&-> (-> this node-list data (-> this gun-joint) bone) transform quad (-> this gun-axis)))) + (let ((a2-3 (-> this gun-length))) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-12 0)) + ) + (.lvf vf4 (&-> v1-25 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 (&-> a0-15 quad) vf6) + ) + (spawn-guard-projectile this t0-0 (-> this target-pos) 819200.0 t0-0) + ) + (let ((s5-2 sound-play-by-spec) + (s4-1 (static-sound-spec "wlander-fire" :group 0)) + ) + (set! (-> s4-1 volume) 1024) + (set! (-> s4-1 pitch-mod) 0) + (set! (-> s4-1 reg 0) (the-as uint (-> this shot-sound))) + (s5-2 s4-1 (new-sound-id) (-> this root trans)) + ) + 0 + (none) + ) + ) + +;; definition for method 242 of type wlander +(defmethod try-activate ((this wlander)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) + (new 'stack-no-clear 'vector) + (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> gp-0 object-type) (traffic-type wlander-male)) + (set! (-> gp-0 behavior) (the-as uint 12)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 nav-mesh) (-> this nav state mesh)) + (set! (-> gp-0 nav-branch) #f) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 handle) (process->handle this)) + (set! (-> gp-0 user-data) (the-as uint 0)) + (set! (-> gp-0 flags) (traffic-spawn-flags)) + (set! (-> gp-0 guard-type) (the-as uint 11)) + (set! (-> gp-0 entity) #f) + (vector-reset! (-> gp-0 velocity)) + (let ((v1-12 (-> gp-0 position))) + (let ((a0-8 (-> this root trans))) + (let ((a1-3 16384.0)) + (.mov vf7 a1-3) + ) + (.lvf vf5 (&-> s4-0 quad)) + (.lvf vf4 (&-> a0-8 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 (&-> v1-12 quad) vf6) + ) + (quaternion-rotate-local-y! (-> gp-0 rotation) (-> this root quat) 32768.0) + (send-event *traffic-manager* 'activate-object gp-0) + (if (-> gp-0 proc) + (return #t) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate standing (wlander) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self root transv quad) (the-as uint128 0)) + (logclear! (-> self flags) (citizen-flag talking)) + ) + :trans (behavior () + '() + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate active (wlander) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type citizen active) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + (if (task-node-open? (game-task-node wascity-defend-get-to)) + (go-virtual panic) + ) + (when (logtest? (-> self flags) (citizen-flag talking)) + (do-navigation-to-destination (-> self nav state) (-> self root trans)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s5-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((s4-0 (-> self nav state current-poly)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (vector-rotate90-around-y! gp-0 gp-0) + (set! (-> gp-0 y) 0.0) + (vector-xz-normalize-copy! s3-0 gp-0 (* 4096.0 (rnd-float-range self 10.0 40.0))) + (clamp-vector-to-mesh-no-gaps (-> self nav) (-> self root trans) s4-0 s3-0 s5-0) + ) + (if (-> s5-0 found-boundary) + (set! (-> self root trans quad) (-> s5-0 intersection quad)) + (vector+! (-> self root trans) (-> self root trans) gp-0) + ) + ) + (if (try-activate self) + (go-virtual standing) + (logclear! (-> self flags) (citizen-flag talking)) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type citizen active) exit))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self flags) (citizen-flag talking)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type citizen active) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (handle->process (-> self focus handle)) + (go-virtual hostile) + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (wlander) + :virtual #t + :enter (behavior () + (nav-enemy-method-177 self) + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (init-los! (-> self los) self (seconds 0.2) 327680.0 (collide-spec backgnd hit-by-others-list los-blocker)) + (set-time! (-> self state-time)) + (when (and (handle->process (-> self focus handle)) (= (-> (handle->process (-> self focus handle)) type) target)) + (let ((v1-19 (-> self nav))) + (set! (-> v1-19 sphere-mask) (the-as uint #x1000fc)) + ) + 0 + ) + (set-time! (-> self last-time-far)) + (set-time! (-> self last-time-los)) + (logior! (-> self flags) (citizen-flag persistent)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (cond + ((< (-> self mad-level) 0.0) + ) + (else + (set! (-> self mad-level) (- (-> self mad-level) (* 0.1 (seconds-per-frame)))) + ) + ) + (let* ((s5-0 (handle->process (-> self focus handle))) + (gp-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when (or (not gp-0) (focus-test? gp-0 inactive) (focus-test? gp-0 disable) (focus-test? gp-0 dead)) + (clear-focused (-> self focus)) + (set! (-> self mad-level) 0.0) + (logclear! (-> self flags) (citizen-flag persistent)) + (go-virtual active) + ) + (cond + (gp-0 + (los-control-method-9 (-> self los) gp-0 (get-trans gp-0 3) 819.2 4096.0) + (let* ((v1-25 (get-trans gp-0 0)) + (f30-0 (vector-length (vector-! (new 'stack-no-clear 'vector) v1-25 (-> self root trans)))) + ) + (if (< 32768.0 f30-0) + (set-time! (-> self last-time-far)) + ) + (cond + ((should-check-los? (-> self los) 0) + (set! (-> self target-pos quad) (-> (get-trans gp-0 3) quad)) + (if (and (enemy-method-105 self 6371.5557 #t) (>= 12288.0 f30-0)) + (go-virtual close-attack) + ) + (if (or (< f30-0 204800.0) + (and (enemy-method-105 self 910.2222 #t) (< (seconds 4) (- (current-time) (-> self last-time-far)))) + ) + (go-virtual gun-shoot) + ) + (set-time! (-> self last-time-los)) + ) + (else + (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) + (time-elapsed? (-> self last-time-los) (seconds 5)) + ) + (clear-focused (-> self focus)) + (set! (-> self mad-level) 0.0) + (logclear! (-> self flags) (citizen-flag persistent)) + (go-virtual active) + ) + ) + ) + ) + ) + (else + ) + ) + ) + ) + :code (behavior () + (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) + ) + :post (behavior () + (when (handle->process (-> self focus handle)) + ) + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate panic (wlander) + :virtual #t + :parent (wlander active) + :enter (behavior () + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (search-for-focus self) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (if (handle->process (-> self focus handle)) + (go-virtual hostile) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate close-attack (wlander) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-4 *game-info*) + (v0-0 (+ (-> v1-4 attack-id) 1)) + ) + (set! (-> v1-4 attack-id) v0-0) + (set! (-> self attack-id) v0-0) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (toggle-cspec self #f -1) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + '() + ) + :code sleep-code + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate gun-shoot (wlander) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let* ((v1-2 *game-info*) + (a0-2 (+ (-> v1-2 attack-id) 1)) + ) + (set! (-> v1-2 attack-id) a0-2) + (set! (-> self attack-id) a0-2) + ) + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (set! (-> self root transv quad) (the-as uint128 0)) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (let* ((s5-0 (handle->process (-> self focus handle))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when (or (not gp-0) + (focus-test? (the-as process-focusable gp-0) inactive) + (focus-test? (the-as process-focusable gp-0) disable) + (focus-test? (the-as process-focusable gp-0) dead) + (not (-> *setting-control* user-current citizen-fights)) + ) + (clear-focused (-> self focus)) + (set! (-> self mad-level) 0.0) + (logclear! (-> self flags) (citizen-flag persistent)) + (go-virtual active) + ) + (when gp-0 + (los-control-method-9 + (-> self los) + (the-as process-focusable gp-0) + (get-trans (the-as process-focusable gp-0) 3) + 819.2 + 4096.0 + ) + (let* ((v1-24 (get-trans (the-as process-focusable gp-0) 0)) + (f30-0 (vector-length (vector-! (new 'stack-no-clear 'vector) v1-24 (-> self root trans)))) + ) + (cond + ((should-check-los? (-> self los) 0) + (set! (-> self target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (if (and (enemy-method-105 self 6371.5557 #t) (>= 12288.0 f30-0)) + (go-virtual close-attack) + ) + (set-time! (-> self last-time-los)) + ) + (else + (if (or (< 245760.0 f30-0) (time-elapsed? (-> self last-time-los) (seconds 0.1))) + (go-virtual hostile) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +;; definition for method 238 of type wlander +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod call-for-help ((this wlander) (arg0 float)) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (set! (-> v1-0 quad) (-> this root trans quad)) + (set! (-> v1-0 w) arg0) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* v1-0 s5-0 64)) + (let* ((s3-0 (-> s5-0 s4-0)) + (v1-3 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-3 + (let* ((s3-1 (-> v1-3 process)) + (a0-5 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (new 'stack-no-clear 'vector) + (when (and a0-5 (!= this a0-5)) + (when (send-event a0-5 'help (-> this focus handle) (-> this mad-level)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 241 of type wlander +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 241 wlander) has a return type of none, but the expression builder found a return statement. +(defmethod search-for-focus ((this wlander)) + (let ((a1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (set! (-> a1-0 quad) (-> this root trans quad)) + (set! (-> a1-0 w) 245760.0) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* a1-0 s5-0 64)) + (let* ((s3-0 (-> s5-0 s4-0)) + (v1-5 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-5 + (let* ((s3-1 (-> v1-5 process)) + (a1-3 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (new 'stack-no-clear 'vector) + (when (and a1-3 + (!= this a1-3) + (not (focus-test? (the-as process-focusable a1-3) inactive)) + (not (focus-test? (the-as process-focusable a1-3) disable)) + (not (focus-test? (the-as process-focusable a1-3) dead)) + (logtest? (process-mask enemy) (-> a1-3 mask)) + ) + (try-update-focus (-> this focus) (the-as process-focusable a1-3) this) + (return #f) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for symbol *wlander-male-nav-enemy-info*, type nav-enemy-info +(define *wlander-male-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 15 + :knocked-land-anim 16 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint 6 + :look-at-joint 5 + :bullseye-joint 4 + :sound-hit (static-sound-name "wlander-male-hi") + :sound-die (static-sound-name "wlander-male-di") + :notice-distance-delta (meters 0.1) + :default-hit-points 8.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 49152.0 + :knocked-medium-vy-hi 102400.0 + :knocked-hard-vxz-lo 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 24576.0 + :knocked-yellow-vy-lo 32768.0 + :knocked-yellow-vy-hi 49152.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 32768.0 + :knocked-red-vy-hi 49152.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 32768.0 + :knocked-blue-vy-hi 49152.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9955 :y 0.0573 :z 0.0754 :w 35528.34) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0 :w 10.176285) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 32189.08) + :geo-tform (new 'static 'vector :x 1.0 :w 42486.152) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8098.6113) + :geo-tform (new 'static 'vector :x 1.0 :w 5056.958) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 4998.831) + :geo-tform (new 'static 'vector :x 1.0 :w 3216.9983) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5593 :z -0.8289 :w 9863.859) + :geo-tform (new 'static 'vector :x 0.6544 :y 0.7366 :z -0.1703 :w 39376.05) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6236 :z -0.7817 :w 14559.55) + :geo-tform (new 'static 'vector :x 0.3033 :y 0.6659 :z 0.6815 :w 38777.812) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6694 :z -0.7428 :w 16626.646) + :geo-tform (new 'static 'vector :x 0.0788 :y 0.9815 :z -0.1741 :w 41031.305) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5579 :z 0.8298 :w 9863.077) + :geo-tform (new 'static 'vector :x -0.654 :y 0.737 :z -0.1703 :w 26147.9) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6241 :z 0.7813 :w 14545.569) + :geo-tform (new 'static 'vector :x -0.3037 :y 0.6658 :z 0.6814 :w 26750.775) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6686 :z 0.7436 :w 16626.646) + :geo-tform (new 'static 'vector :x -0.3897 :y 0.1538 :z 0.9079 :w 33939.582) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 13.471289) + :geo-tform (new 'static 'vector :x -1.0 :w 7430.3623) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1647 :z -0.9863 :w 14417.501) + :geo-tform (new 'static 'vector :x -0.5111 :y -0.6757 :z 0.5311 :w 14693.463) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9601 :z 0.2795 :w 10381.085) + :geo-tform (new 'static 'vector :x 0.8079 :y -0.3633 :z 0.4639 :w 20998.17) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5041 :z 0.8636 :w 18906.99) + :geo-tform (new 'static 'vector :x -0.6128 :y -0.7075 :z -0.3518 :w 14221.239) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 13 + :pre-tform (new 'static 'vector :x -0.1655 :z 0.9862 :w 14409.09) + :geo-tform (new 'static 'vector :x -0.5112 :y 0.6757 :z -0.5309 :w 14680.92) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.96 :z -0.2797 :w 10371.873) + :geo-tform (new 'static 'vector :x 0.8082 :y 0.3631 :z -0.4635 :w 20994.604) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5049 :z -0.8631 :w 18906.973) + :geo-tform (new 'static 'vector :x -0.6132 :y 0.7072 :z 0.3517 :w 14214.285) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 14663.753) + :geo-tform (new 'static 'vector :x -1.0 :w 14663.753) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.9984 :z -0.0551 :w 3427.2053) + :geo-tform (new 'static 'vector :x -0.0071 :y 0.9998 :z -0.018 :w 7926.0513) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6866 :z -0.727 :w 150.04103) + :geo-tform (new 'static 'vector :y 1.0 :w 7924.704) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.7852 :z -0.6191 :w 11466.542) + :geo-tform (new 'static 'vector :x 0.2589 :y 0.5886 :z 0.7657 :w 10875.99) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6068 :z 0.7947 :w 8644.234) + :geo-tform (new 'static 'vector :y 1.0 :w 6801.344) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9701 :y -0.2425 :w 10.176285) + :geo-tform (new 'static 'vector :y 1.0 :w 6801.344) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.504 :z -0.8636 :w 9627.074) + :geo-tform (new 'static 'vector :x -0.5806 :y -0.7427 :z -0.3334 :w 13728.991) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.5049 :z 0.8631 :w 9627.057) + :geo-tform (new 'static 'vector :x -0.5811 :y 0.7424 :z 0.3333 :w 13721.71) + :axial-slop 2102.3037 + :max-angle 4268.4873 + :coll-rad 1029.7344 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim 4 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 12) + :walk-travel-speed (meters 3) + :maximum-rotation-rate (degrees 720) + :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! (-> *wlander-male-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition of type wlander-male +(deftype wlander-male (wlander) + () + ) + +;; definition for method 3 of type wlander-male +(defmethod inspect ((this wlander-male)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wlander inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for function wlander-male-joint-callback +;; WARN: Return type mismatch int vs none. +(defun wlander-male-joint-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control)) + (-> arg0 process) + (let ((gp-0 (-> arg1 data 9)) + (s5-0 (-> arg1 data 20)) + (a1-2 (matrix-translate! (new 'stack-no-clear 'matrix) (new 'static 'vector :y -819.2 :z -8192.0 :w 1.0))) + ) + (matrix*! (-> s5-0 bone transform) a1-2 (-> gp-0 bone transform)) + ) + 0 + (none) + ) + +;; definition for method 123 of type wlander-male +(defmethod enemy-method-123 ((this wlander-male)) + (when (call-parent-method this) + (set! (-> this skel postbind-function) wlander-male-joint-callback) + #t + ) + ) + +;; definition for method 85 of type wlander-male +(defmethod knocked-anim ((this wlander-male) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.01)) + (cond + ((zero? (-> this hit-face)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 17))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 17)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 17)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) + ) + ) + ) + #t + ) + +;; definition for method 86 of type wlander-male +(defmethod knocked-land-anim ((this wlander-male) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.01)) + (cond + ((zero? (-> this hit-face)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + ) + ) + #t + ) + +;; failed to figure out what this is: +(defstate gun-shoot (wlander-male) + :virtual #t + :code (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! wlander-male-idle-to-shoot-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (while (not (enemy-method-105 self 4187.0225 #t)) + (let* ((gp-0 (handle->process (-> self focus handle))) + (s5-0 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when s5-0 + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-2 + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s5-0) 0) (-> self root trans)) + ) + (s5-1 (new 'stack-no-clear 'vector)) + (f30-0 1.2) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (set! (-> gp-2 y) 0.0) + (vector-normalize! gp-2 1.0) + (vector-cross! s5-1 s4-0 gp-2) + (cond + ((< (vector-dot gp-2 s4-0) (cos 4187.0225)) + (ja-no-eval :group! wlander-male-shoot-turn1-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wlander-male-shoot-turn1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) gp-2 65536.0 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wlander-male-shoot-turn1-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((< (-> s5-1 y) 0.0) + (ja-no-eval :group! wlander-male-shoot-turn0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* -10240.0 (seconds-per-frame) f30-0)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! wlander-male-shoot-turn0-ja :num! (seek! 0.0 f30-0) :frame-num max) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 10240.0 (seconds-per-frame) f30-0)) + (suspend) + (ja :num! (seek! 0.0 f30-0)) + ) + ) + ) + ) + ) + ) + ) + (let* ((gp-3 (handle->process (-> self focus handle))) + (v1-167 (if (type? gp-3 process-focusable) + gp-3 + ) + ) + ) + (when v1-167 + (cond + ((focus-test? (the-as process-focusable v1-167) ignore) + (ja-no-eval :group! wlander-male-shoot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! wlander-male-shoot0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + #f + (go-hostile self) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate standing (wlander-male) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.4 0.6))) + (until #f + (ja-no-eval :group! wlander-male-idle0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate close-attack (wlander-male) + :virtual #t + :code (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! wlander-male-attack-rifle-butt-ja :num! (seek! 3.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 3.0)) + ) + (toggle-cspec self #t 1) + (ja-no-eval :group! wlander-male-attack-rifle-butt-ja :num! (seek! 8.0) :frame-num 3.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 8.0)) + ) + (toggle-cspec self #f -1) + (ja-no-eval :group! wlander-male-attack-rifle-butt-ja :num! (seek!) :frame-num 8.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + ) + +;; definition for method 120 of type wlander-male +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this wlander-male)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec civilian)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly 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 crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 5324.8 0.0 5324.8) + ) + (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 crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-15 local-sphere) 0.0 10649.6 0.0 5324.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec civilian)) + (set! (-> v1-17 prim-core collide-with) + (collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-17 prim-core action) (collide-action deadly)) + (set! (-> v1-17 transform-index) 2) + (set-vector! (-> v1-17 local-sphere) 0.0 8192.0 2867.2 8192.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set-vector! (-> v1-19 local-sphere) 0.0 8192.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 7 of type wlander-male +(defmethod relocate ((this wlander-male) (offset int)) + (call-parent-method this offset) + ) + +;; definition for method 121 of type wlander-male +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this wlander-male)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wlander-male" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *wlander-male-nav-enemy-info*) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this anim-shuffle) 5) + (set! (-> this anim-walk) 5) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) + (set! (-> this speed-run) 49152.0) + (set! (-> this gun-joint) 21) + (set! (-> this gun-axis) 2) + (set! (-> this gun-length) 0.0) + (set! (-> this water-anim) -1) + 0 + (none) + ) + +;; definition for method 194 of type wlander-male +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this wlander-male)) + (let ((t9-0 (method-of-type wlander citizen-method-194))) + (t9-0 this) + ) + (set! (-> this knocked-speed-scale) 0.5) + (set! (-> this skel postbind-function) #f) + (logior! (-> this mask) (process-mask guard)) + (logclear! (-> this mask) (process-mask enemy)) + (set! (-> this fact pickup-type) (pickup-type ammo-light-random)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list bot-targetable jak-vehicle)) + (let ((f30-0 (rnd-float-range this 1.2 1.5)) + (f0-3 (rnd-float-range this 1.2 1.5)) + ) + (set-vector! (-> this root scale) f0-3 f30-0 f0-3 1.0) + ) + (setup-masks (-> this draw) 0 -1) + (let ((v1-23 (rnd-int this 3))) + (cond + ((zero? v1-23) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-23 1) + (setup-masks (-> this draw) 256 0) + ) + ((= v1-23 2) + (setup-masks (-> this draw) #x200000 0) + ) + ) + ) + (let ((v1-32 (rnd-int this 3))) + (cond + ((zero? v1-32) + (setup-masks (-> this draw) 4 0) + (if (zero? (rnd-int this 3)) + (setup-masks (-> this draw) 32 0) + ) + ) + ((= v1-32 1) + (setup-masks (-> this draw) 4096 0) + ) + ((= v1-32 2) + (setup-masks (-> this draw) #x40000 0) + ) + ) + ) + (let ((v1-46 (rnd-int this 2))) + (cond + ((zero? v1-46) + (setup-masks (-> this draw) 2 0) + (let ((v1-50 (rnd-int this 4))) + (cond + ((zero? v1-50) + (setup-masks (-> this draw) 2048 0) + ) + ((= v1-50 1) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + ) + ((= v1-46 1) + (setup-masks (-> this draw) #x20000 0) + ) + ) + ) + (let ((v1-60 (rnd-int this 3))) + (cond + ((zero? v1-60) + (setup-masks (-> this draw) 8 0) + ) + ((= v1-60 1) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-60 2) + (setup-masks (-> this draw) #x100000 0) + ) + ) + ) + (let ((v1-69 (rnd-int this 3))) + (cond + ((zero? v1-69) + (setup-masks (-> this draw) 512 0) + ) + ((= v1-69 1) + (setup-masks (-> this draw) #x4000 0) + ) + ((= v1-69 2) + (setup-masks (-> this draw) #x400000 0) + ) + ) + ) + (let ((v1-78 (rnd-int this 5))) + (cond + ((zero? v1-78) + (setup-masks (-> this draw) 1024 0) + ) + ((= v1-78 1) + (setup-masks (-> this draw) #x8000 0) + ) + ((= v1-78 2) + (setup-masks (-> this draw) #x1000000 0) + ) + ) + ) + (if (zero? (rnd-int this 6)) + (setup-masks (-> this draw) #x800000 0) + ) + (let ((v1-92 (rnd-int this 6))) + (cond + ((zero? v1-92) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-92 1) + (setup-masks (-> this draw) #x80000 0) + ) + ) + ) + (let ((v1-99 (rnd-int this 2))) + (cond + ((zero? v1-99) + (setup-masks (-> this draw) #x2000000 0) + ) + ((= v1-99 1) + (setup-masks (-> this draw) #x4000000 0) + ) + ) + ) + (set! (-> this shoot-time) (set-reaction-time! this (seconds 1) (seconds 3))) + (set! (-> this shot-sound) (rnd-int this 7)) + (toggle-cspec this #f -1) + (ja-channel-set! 0) + (set! (-> this male) #t) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-wlander-female wlander-female wlander-female-lod0-jg -1 + ((wlander-female-lod0-mg (meters 20)) (wlander-female-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow wlander-female-shadow-mg + :origin-joint-index 3 + ) + +;; definition for symbol *wlander-female-nav-enemy-info*, type nav-enemy-info +(define *wlander-female-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 12 + :knocked-land-anim 13 + :die-anim 4 + :die-falling-anim 4 + :victory-anim 4 + :jump-wind-up-anim 4 + :jump-in-air-anim 4 + :jump-land-anim 4 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-hit (static-sound-name "wlander-female-") + :sound-die (static-sound-name "wlander-female-") + :notice-distance-delta (meters 0.1) + :default-hit-points 4.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list 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-smack + flut + 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 + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 61440.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 1.0 :w 37977.51) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0 :w 10.176285) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 32774.715) + :geo-tform (new 'static 'vector :x 1.0 :w 38578.75) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 4662.0854) + :geo-tform (new 'static 'vector :x 1.0 :w 40129.113) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.2436 :z -0.9698 :w 9509.766) + :geo-tform (new 'static 'vector :x 0.6346 :y 0.7642 :z -0.1145 :w 37720.082) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4663 :z -0.8845 :w 14131.728) + :geo-tform (new 'static 'vector :x 0.205 :y 0.7336 :z 0.6478 :w 37528.734) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8178 :z -0.5754 :w 15088.99) + :geo-tform (new 'static 'vector :x -0.0167 :y 0.9984 :z -0.0528 :w 39154.445) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.2443 :z 0.9696 :w 9496.33) + :geo-tform (new 'static 'vector :x -0.6351 :y 0.7638 :z -0.1144 :w 27817.902) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.466 :z 0.8847 :w 14144.853) + :geo-tform (new 'static 'vector :x -0.2051 :y 0.7336 :z 0.6478 :w 28006.684) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8177 :z 0.5755 :w 15089.009) + :geo-tform (new 'static 'vector :x -0.3014 :y 0.0503 :z 0.9521 :w 32435.35) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 14.399715) + :geo-tform (new 'static 'vector :x -1.0 :w 3963.9268) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0762 :z -0.997 :w 14415.736) + :geo-tform (new 'static 'vector :x 0.0071 :y -0.2818 :z 0.9594 :w 8815.866) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1183 :z 0.9929 :w 8437.05) + :geo-tform (new 'static 'vector :x 0.9832 :y -0.1333 :z 0.1246 :w 15858.384) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9683 :z 0.2494 :w 15682.073) + :geo-tform (new 'static 'vector :x -0.9494 :y -0.2899 :z -0.1203 :w 8596.775) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9683 :z -0.2494 :w 8206.545) + :geo-tform (new 'static 'vector :x -0.9768 :y -0.1649 :z 0.1359 :w 10236.323) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.0767 :z 0.997 :w 14403.721) + :geo-tform (new 'static 'vector :x 0.0076 :y 0.282 :z -0.9593 :w 8802.541) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1177 :z -0.993 :w 8423.779) + :geo-tform (new 'static 'vector :x 0.9832 :y 0.1331 :z -0.1245 :w 15858.056) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9684 :z -0.2492 :w 15682.054) + :geo-tform (new 'static 'vector :x -0.9495 :y 0.2897 :z 0.1202 :w 8596.066) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9684 :z 0.2492 :w 8206.509) + :geo-tform (new 'static 'vector :x -0.5046 :y 0.6751 :z -0.538 :w 14914.9375) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 29632.375) + :geo-tform (new 'static 'vector :x 1.0 :w 8945.792) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7799 :z 0.6258 :w 42961.58) + :geo-tform (new 'static 'vector :x 0.6487 :y 0.6492 :z 0.3968 :w 24880.27) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint 8 + :pre-tform (new 'static 'vector :x 0.3452 :z 0.9384 :w 2537.481) + :geo-tform (new 'static 'vector :x -0.2538 :y 0.6802 :z -0.6875 :w 9158.073) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6167 :z -0.7871 :w 6379.8203) + :geo-tform (new 'static 'vector :x -0.2203 :y 0.6902 :z -0.6892 :w 9046.754) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 11 + :pre-tform (new 'static 'vector :x 0.3643 :z -0.9312 :w 2476.6965) + :geo-tform (new 'static 'vector :x -0.3016 :y 0.115 :z 0.9464 :w 38890.977) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6244 :z 0.781 :w 6334.437) + :geo-tform (new 'static 'vector :x -0.3023 :y 0.0965 :z 0.9482 :w 38902.08) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint 5 + :pre-tform (new 'static 'vector :x 1.0 :w 4039.5845) + :geo-tform (new 'static 'vector :x 1.0 :w 38742.496) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 39209.86) + :geo-tform (new 'static 'vector :x 1.0 :w 112.50346) + :axial-slop 2050.931 + :max-angle 4280.229 + :coll-rad 1040.384 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim 4 + :run-anim 6 + :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 8) + :maximum-rotation-rate (degrees 720) + :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! (-> *wlander-female-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition of type wlander-female +(deftype wlander-female (wlander) + ((gunout symbol) + ) + ) + +;; definition for method 3 of type wlander-female +(defmethod inspect ((this wlander-female)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wlander inspect))) + (t9-0 this) + ) + (format #t "~2Tgunout: ~A~%" (-> this gunout)) + (label cfg-4) + this + ) + +;; definition for function wlander-female-joint-callback +;; WARN: Return type mismatch int vs none. +(defun wlander-female-joint-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control)) + (-> arg0 process) + (let ((gp-0 (-> arg1 data 4)) + (s5-0 (-> arg1 data 21)) + (a1-2 (matrix-translate! (new 'stack-no-clear 'matrix) (new 'static 'vector :y -544.768 :z 1114.112 :w 1.0))) + ) + (matrix*! (-> s5-0 bone transform) a1-2 (-> gp-0 bone transform)) + ) + 0 + (none) + ) + +;; definition for method 82 of type wlander-female +(defmethod event-handler ((this wlander-female) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('event-gunout) + (set! (-> this skel postbind-function) #f) + (set! v0-0 23) + (set! (-> this anim-walk) (the-as int v0-0)) + v0-0 + ) + (('event-gunaway) + (set! (-> this skel postbind-function) wlander-female-joint-callback) + (set! v0-0 5) + (set! (-> this anim-walk) (the-as int v0-0)) + v0-0 + ) + (else + ((method-of-type wlander event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 85 of type wlander-female +(defmethod knocked-anim ((this wlander-female) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.01)) + (cond + ((zero? (-> this hit-face)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) + ) + ) + ) + #t + ) + +;; definition for method 86 of type wlander-female +(defmethod knocked-land-anim ((this wlander-female) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 (seconds 0.01)) + (cond + ((zero? (-> this hit-face)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) + ) + ) + ) + #t + ) + +;; failed to figure out what this is: +(defstate wait (wlander-female) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (cond + ((-> self gunout) + (ja-no-eval :group! wlander-female-gun-out-idle-ja :num! (seek! max (-> self speed-scale)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + ) + (else + (ja-no-eval :group! wlander-female-idle0-ja :num! (seek! max (-> self speed-scale)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed-scale))) + ) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate close-attack (wlander-female) + :virtual #t + :code (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! wlander-female-attack-kick-spin0-ja :num! (seek! 7.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 7.0)) + ) + (toggle-cspec self #t 1) + (ja-no-eval :group! wlander-female-attack-kick-spin0-ja :num! (seek! 10.0) :frame-num 7.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0)) + ) + (toggle-cspec self #f -1) + (ja-no-eval :group! wlander-female-attack-kick-spin0-ja :num! (seek!) :frame-num 10.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + ) + +;; failed to figure out what this is: +(defstate gun-shoot (wlander-female) + :virtual #t + :code (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.1)) + (when (-> self skel postbind-function) + (ja-no-eval :group! wlander-female-gun-takeout-ja :num! (seek! max 1.6) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.6)) + ) + ) + (ja-no-eval :group! wlander-female-gun-out-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (while (not (enemy-method-105 self 4187.0225 #t)) + (let* ((gp-0 (handle->process (-> self focus handle))) + (s5-0 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when s5-0 + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-2 + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s5-0) 0) (-> self root trans)) + ) + (s5-1 (new 'stack-no-clear 'vector)) + (f30-0 1.2) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (set! (-> gp-2 y) 0.0) + (vector-normalize! gp-2 1.0) + (vector-cross! s5-1 s4-0 gp-2) + (cond + ((< (vector-dot gp-2 s4-0) (cos 4187.0225)) + (ja-no-eval :group! wlander-female-shoot-turn1-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wlander-female-shoot-turn1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) gp-2 65536.0 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! wlander-female-shoot-turn1-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((< (-> s5-1 y) 0.0) + (ja-no-eval :group! wlander-female-shoot-turn0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* -10240.0 (seconds-per-frame) f30-0)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! wlander-female-shoot-turn0-ja :num! (seek! 0.0 f30-0) :frame-num max) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 10240.0 (seconds-per-frame) f30-0)) + (suspend) + (ja :num! (seek! 0.0 f30-0)) + ) + ) + ) + ) + ) + ) + ) + (let* ((gp-3 (handle->process (-> self focus handle))) + (v1-194 (if (type? gp-3 process-focusable) + gp-3 + ) + ) + ) + (when v1-194 + (cond + ((focus-test? (the-as process-focusable v1-194) ignore) + (ja-no-eval :group! wlander-female-shoot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! wlander-female-shoot0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + #f + (go-hostile self) + ) + :post nav-enemy-simple-post + ) + +;; definition for method 120 of type wlander-female +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this wlander-female)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec civilian)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak 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 player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 5324.8 0.0 5324.8) + ) + (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 player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-15 local-sphere) 0.0 9011.2 0.0 5324.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec civilian)) + (set! (-> v1-17 prim-core collide-with) + (collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-17 prim-core action) (collide-action deadly)) + (set! (-> v1-17 transform-index) 2) + (set-vector! (-> v1-17 local-sphere) 0.0 8192.0 2867.2 8192.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set-vector! (-> v1-19 local-sphere) 0.0 8192.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) 6144.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 7 of type wlander-female +(defmethod relocate ((this wlander-female) (offset int)) + (call-parent-method this offset) + ) + +;; definition for method 121 of type wlander-female +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this wlander-female)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wlander-female" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this skel postbind-function) wlander-female-joint-callback) + (init-enemy-defaults! this *wlander-female-nav-enemy-info*) + (let ((v1-6 (-> this nav))) + (set! (-> v1-6 speed-scale) 1.0) + ) + 0 + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this anim-shuffle) 5) + (set! (-> this anim-walk) 5) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 12288.0) + (set! (-> this dist-run-anim) 19660.8) + (set! (-> this anim-run) 6) + (set! (-> this speed-run) 49152.0) + (set! (-> this gun-joint) 22) + (set! (-> this gun-axis) 1) + (set! (-> this gun-length) 0.0) + (set! (-> this water-anim) -1) + 0 + (none) + ) + +;; definition for method 194 of type wlander-female +;; WARN: Return type mismatch int vs none. +(defmethod citizen-method-194 ((this wlander-female)) + (let ((t9-0 (method-of-type wlander citizen-method-194))) + (t9-0 this) + ) + (logior! (-> this mask) (process-mask guard)) + (logclear! (-> this mask) (process-mask enemy)) + (set! (-> this fact pickup-type) (pickup-type ammo-light-random)) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list bot-targetable jak-vehicle)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 288 0) + (let ((v1-17 (rnd-int this 2))) + (cond + ((zero? v1-17) + (setup-masks (-> this draw) 2 0) + ) + ((= v1-17 1) + (setup-masks (-> this draw) 512 0) + ) + ) + ) + (let ((v1-24 (rnd-int this 2))) + (cond + ((zero? v1-24) + (setup-masks (-> this draw) 4 0) + ) + ((= v1-24 1) + (setup-masks (-> this draw) 1024 0) + ) + ) + ) + (let ((v1-31 (rnd-int this 2))) + (cond + ((zero? v1-31) + (setup-masks (-> this draw) 8 0) + ) + ((= v1-31 1) + (setup-masks (-> this draw) 2048 0) + ) + ) + ) + (let ((v1-38 (rnd-int this 2))) + (cond + ((zero? v1-38) + (setup-masks (-> this draw) 16 0) + ) + ((= v1-38 1) + (setup-masks (-> this draw) 4096 0) + ) + ) + ) + (let ((v1-45 (rnd-int this 2))) + (cond + ((zero? v1-45) + (setup-masks (-> this draw) 64 0) + ) + ((= v1-45 1) + (setup-masks (-> this draw) 8192 0) + ) + ) + ) + (let ((v1-52 (rnd-int this 2))) + (cond + ((zero? v1-52) + (setup-masks (-> this draw) 128 0) + ) + ((= v1-52 1) + (setup-masks (-> this draw) #x4000 0) + ) + ) + ) + (let ((v1-59 (rnd-int this 2))) + (cond + ((zero? v1-59) + (setup-masks (-> this draw) #x8000 0) + ) + ((= v1-59 1) + (setup-masks (-> this draw) #x10000 0) + ) + ) + ) + (set! (-> this anim-get-up-front) 17) + (set! (-> this shoot-time) (set-reaction-time! this (seconds 1) (seconds 3))) + (set! (-> this shot-sound) (rnd-int this 7)) + (set! (-> this gunout) (if (rnd-int this 2) + #f + #t + ) + ) + (toggle-cspec this #f -1) + (ja-channel-set! 0) + (set! (-> this male) #f) + 0 + (none) + ) + + + + diff --git a/test/offline/config/jak3/config.jsonc b/test/offline/config/jak3/config.jsonc index 6bf9133c72..1c535146db 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -88,7 +88,25 @@ "DGO/LFACTORY.DGO", "DGO/RAILX.DGO", "DGO/FACB.DGO", - "DGO/TITLE.DGO" + "DGO/TITLE.DGO", + "DGO/DESRESC.DGO", + "DGO/CTYPESB.DGO", + "DGO/CTYPESC.DGO", + "DGO/LCTYHIJK.DGO", + "DGO/CIA.DGO", + "DGO/CIB.DGO", + "DGO/LCTYPATK.DGO", + "DGO/CPO.DGO", + "DGO/CTA.DGO", + "DGO/CTB.DGO", + "DGO/CTC.DGO", + "DGO/INTROCST.DGO", + "DGO/IPF.DGO", + "DGO/CFB.DGO", + "DGO/FREEHQ.DGO", + "DGO/LJINX.DGO", + "DGO/ONINTENT.DGO", + "DGO/LCTYSNPR.DGO" ], "skip_compile_files": [ @@ -320,7 +338,26 @@ // fac-robotank-turret "draw-2d-hud", // fac-robotank - "(method 7 fac-robotank)" + "(method 7 fac-robotank)", + // nav-graph + "(method 14 nav-graph)", + // wlander-male + "(method 125 wlander)", + // neo-satellite + "neo-sat-init-by-other", // break form + // desert-passenger + "(method 25 task-manager-desert-rescue)", + // guard + "(method 266 crimson-guard)", + "(method 282 crimson-guard)", + // roboguard-city + "(method 160 roboguard-city)", // register allocator failure + // desert-chase + "(method 34 desert-chase-ambush-manager)", + // bombbot + "(method 196 bombbot-player)", + // cty-sniper-turret + "citysniper-draw-2d-hud" ], "skip_compile_states": { @@ -329,6 +366,9 @@ "(active task-manager-race)": ["code"], // adds b! but the corresponding label is missing "(active task-manager-forest-plants)": ["code"], // bad handle->process "(open wstd-fight-plat-box)": ["trans"], // bad handle->process - "(setup wascity-turret)": ["code"] // bad handle->process + "(setup wascity-turret)": ["code"], // bad handle->process + "(hostile spydroid)": ["trans"], // reassigning process to a conditional + "(explode krimson-wall-break)": ["code"], // art-joint-anim cast + "(active desert-chase-ambush-manager)": ["code"] } }