From 308038a20f870d80ecc72b64f72ffc7388351a29 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Sun, 1 Jan 2023 18:05:31 -0500 Subject: [PATCH] [decomp] collectables, fix float bug in a few files (#2082) Fixes https://github.com/open-goal/jak-project/issues/1931 Also decompile collectables.gc --- common/goos/Printer.cpp | 5 +- common/util/print_float.cpp | 12 + common/util/print_float.h | 1 + decompiler/IR2/FormExpressionAnalysis.cpp | 7 +- decompiler/config/jak2/all-types.gc | 260 +- .../jak2/anonymous_function_types.jsonc | 3 + decompiler/config/jak2/label_types.jsonc | 17 + decompiler/config/jak2/stack_structures.jsonc | 3 +- decompiler/config/jak2/type_casts.jsonc | 47 +- goal_src/jak2/engine/ambient/ambient.gc | 4 +- .../jak2/engine/common_objs/collectables.gc | 2743 ++++++++++++- goal_src/jak2/engine/game/game-h.gc | 2 + goal_src/jak2/engine/game/game-save.gc | 10 +- .../jak2/engine/game/task/task-control.gc | 11 +- .../process-drawable/process-taskable.gc | 4 +- goal_src/jak2/engine/scene/scene.gc | 8 +- .../jak2/engine/ui/progress/progress-draw.gc | 148 +- goal_src/jak2/engine/ui/progress/progress.gc | 4 +- goal_src/jak2/levels/common/warp-gate.gc | 4 +- goal_src/jak2/levels/gungame/gungame-obs.gc | 4 +- .../jak2/engine/ambient/ambient_REF.gc | 4 +- .../engine/common_objs/collectables_REF.gc | 3382 +++++++++++++++++ .../jak2/engine/game/game-save_REF.gc | 10 +- .../jak2/engine/game/task/task-control_REF.gc | 8 +- .../process-drawable/process-taskable_REF.gc | 4 +- .../reference/jak2/engine/scene/scene_REF.gc | 8 +- .../engine/ui/progress/progress-draw_REF.gc | 148 +- .../jak2/engine/ui/progress/progress_REF.gc | 4 +- .../jak2/levels/common/warp-gate_REF.gc | 4 +- .../jak2/levels/gungame/gungame-obs_REF.gc | 4 +- 30 files changed, 6518 insertions(+), 355 deletions(-) create mode 100644 test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc diff --git a/common/goos/Printer.cpp b/common/goos/Printer.cpp index 489ac90279..80b47c79c8 100644 --- a/common/goos/Printer.cpp +++ b/common/goos/Printer.cpp @@ -4,6 +4,7 @@ #include #include "common/goos/Object.h" +#include "common/util/print_float.h" #include "third-party/fmt/core.h" @@ -24,9 +25,7 @@ const std::unordered_map const_floats = {{0x40490fda, "PI"}, goos::Object float_representation(float value) { u32 int_value; memcpy(&int_value, &value, 4); - u8 exp = (int_value >> 23) & 0xff; - u32 mant = int_value & 0x7fffff; - if ((exp == 0 && mant != 0) || exp == 0xff || !std::isfinite(value)) { + if (!proper_float(value)) { // lg::warn("PS2-incompatible float (0x{:08X}) detected! Writing as the-as cast.", int_value); return pretty_print::build_list("the-as", "float", fmt::format("#x{:x}", int_value)); } else if (const_floats.find(int_value) != const_floats.end()) { diff --git a/common/util/print_float.cpp b/common/util/print_float.cpp index 3a96697a57..93d142882c 100644 --- a/common/util/print_float.cpp +++ b/common/util/print_float.cpp @@ -208,3 +208,15 @@ int float_to_cstr(float value, char* buffer, bool append_trailing_decimal) { } return i; } + +bool proper_float(float value) { + u32 int_value; + memcpy(&int_value, &value, 4); + u8 exp = (int_value >> 23) & 0xff; + u32 mant = int_value & 0x7fffff; + if ((exp == 0 && mant != 0) || exp == 0xff || !std::isfinite(value)) { + return false; + } else { + return true; + } +} \ No newline at end of file diff --git a/common/util/print_float.h b/common/util/print_float.h index 5dc47d44cf..796d1e84cb 100644 --- a/common/util/print_float.h +++ b/common/util/print_float.h @@ -11,3 +11,4 @@ std::string meters_to_string(float value, bool append_trailing_decimal = false); std::string degrees_to_string(float value, bool append_trailing_decimal = false); std::string seconds_to_string(s64 value, bool append_trailing_decimal = false); int float_to_cstr(float value, char* buffer, bool append_trailing_decimal = true); +bool proper_float(float value); diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 5d34690336..fc4d059e49 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -812,10 +812,11 @@ void SimpleExpressionElement::update_from_stack_gpr_to_fpr(const Env& env, auto int_constant = get_goal_integer_constant(frm, env); if (int_constant && u64_valid_for_float_constant(*int_constant)) { float flt; - memcpy(&flt, &int_constant.value(), sizeof(float)); - result->push_back(pool.alloc_element(flt)); - return; + if (proper_float(flt)) { + result->push_back(pool.alloc_element(flt)); + return; + } } } // converting something else to an FPR, put an expression around it. diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 98f0c8394b..b09095b4b8 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -29956,206 +29956,168 @@ ;; collectables ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype collectable (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(defenum collectable-flag + :type uint32 + :bitfield #t + (bounce 0) ;; 1 + (fadeout 1) ;; 2 + (pickup 2) ;; 4 + (do-fadeout 3) ;; 8 + (suck-in 4) ;; 16 + (no-eco-blue 5) ;; 32 + (no-bob 6) ;; 64 + (no-distance-check-fadeout 7) ;; 128 ) -|# -#| -(deftype eco (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype collectable (process-drawable) + ((root-override2 collide-shape-moving :offset 128 :score 1000) + (pickup-type pickup-type :offset-assert 200) + (pickup-amount float :offset-assert 204) + (notify handle :offset-assert 208) + (old-base vector :inline :offset-assert 224) + (base vector :inline :offset-assert 240) + (extra-trans vector :inline :offset-assert 256) + (jump-pos vector :inline :offset-assert 272) + (flags collectable-flag :offset-assert 288) + (birth-time seconds :offset-assert 296) + (collect-timeout seconds :offset-assert 304) + (fadeout-timeout seconds :offset-assert 312) + (bob-offset seconds :offset-assert 320) + (bob-amount float :offset-assert 328) + (pickup-handle handle :offset-assert 336) + (actor-pause symbol :offset-assert 344) + (collect-effect basic :offset-assert 348) + (collect-effect2 basic :offset-assert 352) + (target handle :offset-assert 360) + (suck-time seconds :offset-assert 368) + (suck-y-offset float :offset-assert 376) + (speed vector :inline :offset-assert 384) + (movie-pos-index int32 :offset-assert 400) + ) + :flag-assert #x2401200194 ;; L802 + (:methods + (blocked () _type_ :state 20) + (wait () _type_ :state 21) + (deploy () _type_ :state 22) + (suck (handle) _type_ :state 23) + (jump () _type_ :state 24) + (fade () _type_ :state 25) + (pickup (symbol handle) _type_ :state 26) + (die () _type_ :state 27) + (notice-blue (handle) _type_ :state 28) + (init-common (_type_ entity-actor pickup-type float) none 29) ;; seen it. + (initialize-effects (_type_ pickup-type) none 30) + (go-to-initial-state (_type_) none 31) + (initialize-options (_type_ int float fact-info) collectable 32) + (initialize-allocations (_type_) none 33) + (common-post (_type_) none 34) + (do-pickup (_type_ handle) none 35) + ) ) -|# -#| -(deftype eco-yellow (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype eco (collectable) + ( + (respan-delay seconds :offset-assert 408)) + :flag-assert #x24012001a0 ;; L803 ) -|# -#| -(deftype eco-red (UNKNOWN) +(deftype eco-yellow (eco) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x24012001a0 ;; L803 ) -|# -#| -(deftype eco-blue (UNKNOWN) +(deftype eco-red (eco) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x24012001a0 ;; L803 ) -|# -#| -(deftype eco-green (UNKNOWN) +(deftype eco-blue (eco) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x24012001a0 ;; L803 ) -|# -#| -(deftype health (UNKNOWN) +(deftype eco-green (eco) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x24012001a0 ;; L803 ) -|# -#| -(deftype eco-pill (UNKNOWN) +(deftype health (collectable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x2401200194 ;; L802 ) -|# -#| -(deftype money (UNKNOWN) +(deftype eco-pill (collectable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x2401200194 ;; L802 ) -|# -#| -(deftype gem (UNKNOWN) +(deftype money (collectable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x2401200194 ;; L802 ) -|# -#| -(deftype skill (UNKNOWN) +(deftype gem (money) + ((roty-speed degrees :offset-assert 404) + (bounce-time seconds :offset-assert 408) + ) + :flag-assert #x24012001a0 ;; L803 + ) + +(deftype skill (money) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x2401200194 ;; L802 ) -|# -#| -(deftype fuel-cell (UNKNOWN) +(deftype fuel-cell (process-hidden) ;; rip () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #xf00000080 ;; L801 ) -|# -#| -(deftype trick-point (UNKNOWN) +(deftype trick-point (collectable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x2401200194 ;; L802 ) -|# -#| -(deftype skate-point (UNKNOWN) +(deftype skate-point (trick-point) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x2401200194 ;; L802 ) -|# -#| -(deftype ammo-collectable (UNKNOWN) +(deftype ammo-collectable (collectable) + ((ammo-effect basic :offset-assert 404)) + :flag-assert #x2401200198 ;; L800 + ) + +(deftype ammo (ammo-collectable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x2401200198 ;; L800 ) -|# -#| -(deftype ammo (UNKNOWN) +(deftype shield (ammo-collectable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x2401200198 ;; L800 ) -|# -#| -(deftype shield (UNKNOWN) +(deftype upgrade-collectable (ammo-collectable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #x2401200198 ;; L800 ) -|# -#| -(deftype upgrade-collectable (UNKNOWN) +(deftype ecovent (process-hidden) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :flag-assert #xf00000080 ;; L801 ) -|# -#| -(deftype ecovent (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -;; (define-extern initialize-eco-by-other function) ;; (function vector vector fact-info none :behavior eco) -;; (define-extern add-blue-shake function) ;; (function vector vector vector vector) -;; (define-extern check-blue-suck function) ;; (function process-drawable none :behavior eco-collectable) -;; (define-extern add-blue-motion function) ;; (function symbol symbol symbol symbol symbol :behavior eco-collectable) -;; (define-extern collectable-standard-event-handler function) -;; (define-extern money-init-by-other function) ;; (function vector vector fact-info entity-actor none :behavior money) -;; (define-extern money-init-by-other-no-bob function) ;; (function vector vector fact-info float entity-actor none :behavior money) -;; (define-extern *collectable-dummy-shadow-control* shadow-control) -;; (define-extern initialize-ammo-by-other function) -;; (define-extern initialize-upgrade-by-other function) +(define-extern initialize-eco-by-other (function vector vector fact-info none :behavior eco)) +(define-extern add-blue-shake (function vector vector vector vector)) +(define-extern check-blue-suck (function process-drawable symbol :behavior eco)) +(define-extern add-blue-motion (function symbol symbol symbol symbol symbol :behavior eco)) +(define-extern collectable-standard-event-handler (function process int symbol event-message-block object :behavior collectable)) +(define-extern money-init-by-other (function vector vector fact-info entity-actor none :behavior money)) +(define-extern money-init-by-other-no-bob (function vector vector fact-info float entity-actor none :behavior money)) +(define-extern *collectable-dummy-shadow-control* shadow-control) +(define-extern initialize-ammo-by-other (function vector vector fact-info none :behavior ammo)) +(define-extern initialize-upgrade-by-other (function vector vector fact-info entity-actor none :behavior upgrade-collectable)) (define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index 0ec576c1fc..9896d743a7 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -649,5 +649,8 @@ [0, "(function process-drawable vector)"], [1, "(function float)"], [3, "(function none :behavior scene-player)"] + ], + "collectables": [ + [69, "(function part-tracker vector)"] ] } diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 0031ce7e3b..cb8fd450b8 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -784,5 +784,22 @@ ["L3069", "vector"], ["L3068", "vector"], ["L3067", "vector"] + ], + "collectables": [ + ["L562", "uint64", true], + ["L563", "uint64", true], + ["L564", "uint64", true], + ["L565", "uint64", true], + ["L566", "uint64", true], + ["L567", "uint64", true], + ["L568", "uint64", true], + ["L569", "uint64", true], + ["L570", "uint64", true], + ["L571", "uint64", true], + ["L572", "uint64", true], + ["L800", "uint64", true], + ["L801", "uint64", true], + ["L802", "uint64", true], + ["L803", "uint64", true] ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index 261dd2b000..f44cf8d91b 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1272,5 +1272,6 @@ ], "(method 18 nav-mesh)": [[16, "nav-ray"]], "(post idle gun-dummy)": [[16, "event-message-block"]], - "(method 23 training-manager)": [[16, "vector"]] + "(method 23 training-manager)": [[16, "vector"]], + "birth-pickup-at-point": [[16, "vector"]] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 7651504899..843373fe9b 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -5466,5 +5466,50 @@ ], "(method 23 training-manager)": [[104, "s0", "process-focusable"]], "(method 11 training-manager)": [["_stack_", 16, "res-tag"]], - "attach-pod-part": [[32, "v1", "float"]] + "attach-pod-part": [[32, "v1", "float"]], + "(method 30 collectable)": [[109, "v1", "collide-shape"]], + "(method 32 collectable)": [ + [19, "v1", "int"], + [19, "a0", "int"], + [23, "a0", "int"], + [155, "v1", "process-drawable"] + ], + "(anon-function 69 collectables)": [ + //[[1, 6], "v1", "handle"], + [2, "v1", "handle"], + [5, "v1", "handle"], + [8, "v1", "handle"], + [13, "v1", "collectable"], + [[34, 39], "a0", "process-focusable"] + ], + "check-blue-suck": [ + [19, "v1", "collide-shape"] + ], + "add-blue-motion": [ + [27, "s2", "process-focusable"] + ], + "collectable-standard-event-handler": [ + [84, "a0", "vector"], + [102, "a0", "vector"], + [[167, 171], "a0", "process"], + [[292, 296], "a0", "process"] + ], + "(event pickup collectable)": [ + [17, "a0", "vector"], + [18, "v1", "vector"] + ], + "(code die eco)": [ + [55, "v1", "float"] + ], + "(code pickup eco)": [ + [39, "v0", "state"], + [41, "t9", "(function none)"] + ], + "(method 10 gem)": [ + [12, "t9", "(function gem none)"] + ], + "(method 9 fact-info)": [ + [245, "a0", "process-drawable"], + [293, "a0", "process-drawable"] + ] } diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index c9d21a6a22..f445df561d 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -304,10 +304,10 @@ ) ) (let ((v1-14 gp-0)) - (set! (-> v1-14 width) (the float (the-as float #x1b8))) + (set! (-> v1-14 width) (the float 440)) ) (let ((v1-15 gp-0)) - (set! (-> v1-15 height) (the float (the-as float #x8c))) + (set! (-> v1-15 height) (the float 140)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) (if (logtest? (-> obj message flags) 32) diff --git a/goal_src/jak2/engine/common_objs/collectables.gc b/goal_src/jak2/engine/common_objs/collectables.gc index ececab99cb..fd8df84275 100644 --- a/goal_src/jak2/engine/common_objs/collectables.gc +++ b/goal_src/jak2/engine/common_objs/collectables.gc @@ -5,8 +5,2747 @@ ;; name in dgo: collectables ;; dgos: ENGINE, GAME +(defenum collectable-flag + :type uint32 + :bitfield #t + (bounce 0) ;; 1 + (fadeout 1) ;; 2 + (pickup 2) ;; 4 + (do-fadeout 3) ;; 8 + (suck-in 4) ;; 16 + (no-eco-blue 5) ;; 32 + (no-bob 6) ;; 64 + (no-distance-check-fadeout 7) ;; 128 + ) + +(declare-type collectable process-drawable) +(declare-type eco collectable) +(declare-type ammo collectable) + ;; DECOMP BEGINS +(defskelgroup skel-health collectables 3 5 + ((4 (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 6 + ) + +(defskelgroup skel-gem collectables 6 9 + ((7 (meters 20)) (8 (meters 999999))) + :bounds (static-spherem 0 0 0 0.6) + :texture-level 6 + ) + +(defskelgroup skel-gun-yellow-up yellow-barrel 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :origin-joint-index 3 + ) + +(defskelgroup skel-gun-dark-up dark-barrel 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :origin-joint-index 3 + ) + +(defskelgroup skel-skill collectables 17 22 + ((18 (meters 20)) (19 (meters 40)) (20 (meters 999999))) + :bounds (static-spherem 0 0 0 0.6) + :shadow 21 + :texture-level 6 + :shadow-joint-index 0 + ) + +(deftype collectable (process-drawable) + ((root-override2 collide-shape-moving :offset 128) + (pickup-type pickup-type :offset-assert 200) + (pickup-amount float :offset-assert 204) + (notify handle :offset-assert 208) + (old-base vector :inline :offset-assert 224) + (base vector :inline :offset-assert 240) + (extra-trans vector :inline :offset-assert 256) + (jump-pos vector :inline :offset-assert 272) + (flags collectable-flag :offset-assert 288) + (birth-time seconds :offset-assert 296) + (collect-timeout seconds :offset-assert 304) + (fadeout-timeout seconds :offset-assert 312) + (bob-offset seconds :offset-assert 320) + (bob-amount float :offset-assert 328) + (pickup-handle handle :offset-assert 336) + (actor-pause symbol :offset-assert 344) + (collect-effect basic :offset-assert 348) + (collect-effect2 basic :offset-assert 352) + (target handle :offset-assert 360) + (suck-time seconds :offset-assert 368) + (suck-y-offset float :offset-assert 376) + (speed vector :inline :offset-assert 384) + (movie-pos-index int32 :offset-assert 400) + ) + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + (:methods + (blocked () _type_ :state 20) + (wait () _type_ :state 21) + (deploy () _type_ :state 22) + (suck (handle) _type_ :state 23) + (jump () _type_ :state 24) + (fade () _type_ :state 25) + (pickup (symbol handle) _type_ :state 26) + (die () _type_ :state 27) + (notice-blue (handle) _type_ :state 28) + (init-common (_type_ entity-actor pickup-type float) none 29) + (initialize-effects (_type_ pickup-type) none 30) + (go-to-initial-state (_type_) none 31) + (initialize-options (_type_ int float fact-info) collectable 32) + (initialize-allocations (_type_) none 33) + (common-post (_type_) none 34) + (do-pickup (_type_ handle) none 35) + ) + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod go-to-initial-state collectable ((obj collectable)) + (cond + ((logtest? (-> obj fact options) (actor-option wait-for-task-complete)) + (go (method-of-object obj blocked)) + ) + ((logtest? (-> obj flags) (collectable-flag bounce)) + (go (method-of-object obj deploy)) + ) + (else + (go (method-of-object obj wait)) + ) + ) + (none) + ) + +(defmethod initialize-options collectable ((obj collectable) (arg0 int) (arg1 float) (arg2 fact-info)) + (with-pp + (logclear! (-> obj mask) (process-mask crate enemy platform ambient)) + (set! (-> obj mask) (logior (process-mask bit18) (-> obj mask))) + (set! (-> obj flags) (collectable-flag pickup no-eco-blue)) + (set! (-> obj bob-amount) arg1) + (set! (-> obj bob-offset) (the-as seconds (+ (the-as int (-> obj root-override2 trans x)) + (the-as int (-> obj root-override2 trans y)) + (the-as int (-> obj root-override2 trans z)) + ) + ) + ) + (cond + ((or (= (vector-length (-> obj root-override2 transv)) 0.0) + (logtest? (-> obj fact options) (actor-option auto-pickup)) + ) + (vector-reset! (-> obj root-override2 transv)) + ) + (else + (logior! (-> obj flags) (collectable-flag bounce)) + (logclear! (-> obj flags) (collectable-flag pickup)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj bob-amount) 0.0) + ) + ) + (when (> arg0 0) + (logior! (-> obj flags) (collectable-flag fadeout)) + (set! (-> obj fadeout-timeout) (the-as seconds arg0)) + (if (logtest? (actor-option no-distance-check-fadeout) (-> arg2 options)) + (logior! (-> obj flags) (collectable-flag no-distance-check-fadeout)) + ) + ) + (set! (-> obj collect-timeout) (the-as seconds 99)) + (set! (-> obj birth-time) (-> pp clock frame-counter)) + (set! (-> obj base quad) (-> obj root-override2 trans quad)) + (set! (-> obj old-base quad) (-> obj root-override2 trans quad)) + (set! (-> obj pickup-handle) (the-as handle #f)) + (case (-> obj fact pickup-type) + (((pickup-type eco-pill-green) + (pickup-type eco-pill-dark) + (pickup-type eco-green) + (pickup-type money) + (pickup-type gem) + (pickup-type skill) + (pickup-type eco-blue) + (pickup-type health) + (pickup-type trick-point) + ) + (logclear! (-> obj flags) (collectable-flag no-eco-blue)) + ) + ) + (if (logtest? (-> obj fact options) (actor-option big-collision)) + (set! (-> obj root-override2 root-prim local-sphere w) + (* 2.5 (-> obj root-override2 root-prim local-sphere w)) + ) + ) + (when (and arg2 (nonzero? (-> obj draw))) + (let* ((s5-0 (-> arg2 process)) + (v1-56 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (if v1-56 + (set! (-> obj draw light-index) (-> (the-as process-drawable v1-56) draw light-index)) + ) + ) + ) + obj + ) + ) + +(defmethod initialize-allocations collectable ((obj collectable)) + (stack-size-set! (-> obj main-thread) 128) + (logior! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #t) + (set! (-> obj notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-11 local-sphere) 0.0 3276.8 0.0 3276.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-11) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + 0 + (none) + ) + +;; WARN: Return type mismatch ambient-sound vs none. +(defmethod initialize-effects collectable ((obj collectable) (arg0 pickup-type)) + (let ((s5-0 (the-as sparticle-launch-group #f)) + (s4-0 (the-as sound-spec #f)) + ) + (set! (-> obj fact pickup-type) arg0) + (case (-> obj fact pickup-type) + (((pickup-type eco-blue) + (pickup-type eco-red) + (pickup-type eco-green) + (pickup-type eco-yellow) + (pickup-type health) + (pickup-type eco-pill-dark) + (pickup-type trick-point) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + ) + ) + (case arg0 + (((pickup-type eco-yellow)) + (set! s5-0 (-> *part-group-id-table* 108)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 115)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 109)) + (set! s4-0 (static-sound-spec "yel-eco-idle" :fo-max 15)) + ) + (((pickup-type eco-red)) + (set! s5-0 (-> *part-group-id-table* 102)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 116)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 103)) + (set! s4-0 (static-sound-spec "red-eco-idle" :fo-max 15)) + ) + (((pickup-type eco-blue)) + (set! s5-0 (-> *part-group-id-table* 98)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 114)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 99)) + (set! s4-0 (static-sound-spec "blue-eco-idle" :fo-max 15)) + ) + (((pickup-type eco-green)) + (set! s5-0 (-> *part-group-id-table* 83)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 93)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 79)) + (set! s4-0 (static-sound-spec "green-eco-idle" :fo-max 15)) + ) + (((pickup-type health)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-health" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-37 (-> (the-as collide-shape (-> obj root-override2)) root-prim local-sphere))) + (set! (-> v1-37 y) 2457.6) + (set! (-> v1-37 w) 4096.0) + ) + (set! (-> obj collect-effect) (-> *part-group-id-table* 93)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 79)) + (set! s4-0 (static-sound-spec "green-eco-idle" :fo-max 15)) + ) + (((pickup-type eco-pill-green)) + (set! s5-0 (-> *part-group-id-table* 80)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 81)) + ) + (((pickup-type eco-pill-dark)) + (set! s5-0 (-> *part-group-id-table* 82)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 92)) + ) + ) + (if s5-0 + (set! (-> obj part) (create-launch-control s5-0 obj)) + ) + (if s4-0 + (set! (-> obj sound) (new 'process 'ambient-sound s4-0 (-> obj root-override2 trans))) + ) + ) + (none) + ) + +(defbehavior initialize-eco-by-other eco ((arg0 vector) (arg1 vector) (arg2 fact-info)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (case (-> self fact pickup-type) + (((pickup-type eco-blue) (pickup-type eco-yellow) (pickup-type eco-red)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 0 + ) + 1024.0 + arg2 + ) + ) + (else + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 4500 + ) + 1024.0 + arg2 + ) + ) + ) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +(defmethod init-common collectable ((obj collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> obj pickup-amount) arg2) + (set! (-> obj pickup-type) arg1) + (initialize-allocations obj) + (set! (-> obj root-override2 trans quad) (-> arg0 extra trans quad)) + (initialize-effects obj (-> obj fact pickup-type)) + (initialize-options obj 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> obj root-override2)) + (if (logtest? (-> obj fact options) (actor-option wait-for-task-complete)) + (go (method-of-object obj blocked)) + ) + (go-to-initial-state obj) + (none) + ) + +(defmethod common-post collectable ((obj collectable)) + (let ((s5-0 (-> obj part)) + (s4-0 (-> obj root-override2 root-prim prim-core)) + ) + (if (nonzero? (-> obj draw)) + (ja-post) + ) + (if (nonzero? s5-0) + (spawn s5-0 (the-as vector s4-0)) + ) + ) + (if (nonzero? (-> obj sound)) + (update! (-> obj sound)) + ) + 0 + (none) + ) + +(defmethod do-pickup collectable ((obj collectable) (arg0 handle)) + (set! (-> obj pickup-handle) arg0) + (logclear! (-> obj mask) (process-mask actor-pause)) + (let ((v1-3 (-> obj root-override2 root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (if (nonzero? (-> obj sound)) + (stop! (-> obj sound)) + ) + (if (nonzero? (-> obj draw)) + (logior! (-> obj draw status) (draw-control-status no-draw)) + ) + (if (nonzero? (-> obj part)) + (kill-and-free-particles (-> obj part)) + ) + (case (-> obj fact pickup-type) + (((pickup-type eco-yellow)) + (sound-play "y-eco-pickup") + ) + (((pickup-type eco-red)) + (sound-play "r-eco-pickup") + ) + (((pickup-type eco-blue)) + (sound-play "b-eco-pickup") + ) + (((pickup-type eco-green) (pickup-type health)) + (sound-play "g-eco-pickup") + ) + (((pickup-type eco-pill-green)) + (sound-play "pill-pickup") + ) + (((pickup-type eco-pill-dark)) + (sound-play "pill-pickup") + (when (>= (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) + (set! (-> obj collect-effect) (the-as basic 0)) + (set! (-> obj collect-effect2) (the-as basic 0)) + 0 + ) + ) + (((pickup-type fuel-cell)) + (sound-play "pu-powercell") + ) + (((pickup-type ammo-yellow) + (pickup-type ammo-red) + (pickup-type ammo-blue) + (pickup-type ammo-dark) + (pickup-type gun-red) + (pickup-type gun-yellow) + (pickup-type gun-blue) + (pickup-type gun-dark) + (pickup-type board) + ) + (sound-play "ammo-pickup") + ) + (((pickup-type skill)) + (talker-spawn-func (-> *talker-speech* 16) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (let ((s4-9 (handle->process arg0))) + (when (nonzero? (-> obj collect-effect)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-1 + (let ((t9-21 (method-of-type part-tracker activate))) + (t9-21 (the-as part-tracker s5-1) s4-9 (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-22 run-function-in-process) + (a0-60 s5-1) + (a1-26 part-tracker-init) + (a2-11 (-> obj collect-effect)) + (a3-10 0) + (t0-8 part-tracker-track-target) + (t1-8 #f) + (t2-8 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> obj root-override2 root-prim prim-core world-sphere quad)) + ((the-as (function object object object object object object object object none) t9-22) + a0-60 + a1-26 + a2-11 + a3-10 + t0-8 + t1-8 + t2-8 + t3-0 + ) + ) + (-> s5-1 ppointer) + ) + ) + ) + ) + (when (nonzero? (-> obj collect-effect2)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-2 + (let ((t9-24 (method-of-type part-tracker activate))) + (t9-24 (the-as part-tracker s5-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-25 run-function-in-process) + (a0-63 s5-2) + (a1-29 part-tracker-init) + (a2-16 (-> obj collect-effect2)) + (a3-12 0) + (t0-9 + (lambda ((arg0 part-tracker)) + (with-pp + (let ((v1-1 (handle->process (-> arg0 userdata)))) + (when (the-as process v1-1) + (let* ((s5-0 (handle->process (-> (the-as collectable v1-1) pickup-handle))) + (a0-9 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (a2-0 (if (not a0-9) + (-> arg0 root trans) + (get-trans (the-as process-focusable a0-9) 3) + ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (/ (the float (- (-> pp clock frame-counter) (-> arg0 start-time))) (the float (-> arg0 part group duration))) + ) + ) + ) + ) + ) + ) + ) + (t1-13 (process->handle obj)) + (t2-9 #f) + (t3-1 *launch-matrix*) + ) + (set! (-> t3-1 trans quad) (-> obj root-override2 root-prim prim-core world-sphere quad)) + ((the-as (function object object object object object object object object none) t9-25) + a0-63 + a1-29 + a2-16 + a3-12 + t0-9 + t1-13 + t2-9 + t3-1 + ) + ) + (-> s5-2 ppointer) + ) + ) + ) + (send-event (handle->process (-> obj notify)) 'notify 'pickup) + 0 + (none) + ) + +(defun add-blue-shake ((arg0 vector) (arg1 vector) (arg2 vector)) + (let* ((f0-0 (vector-vector-distance arg1 arg2)) + (f30-0 (lerp-scale 409.6 0.0 f0-0 (-> *FACT-bank* suck-suck-dist) (-> *FACT-bank* suck-bounce-dist))) + ) + (+! (-> arg0 x) (rand-vu-float-range (- f30-0) f30-0)) + (+! (-> arg0 y) (rand-vu-float-range (- f30-0) f30-0)) + (+! (-> arg0 z) (rand-vu-float-range (- f30-0) f30-0)) + ) + arg0 + ) + +(defbehavior check-blue-suck eco ((arg0 process-drawable)) + (let ((v1-0 (if (type? arg0 process-drawable) + arg0 + ) + ) + ) + (when v1-0 + (let* ((gp-1 (-> v1-0 root)) + (v1-1 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (when v1-1 + (let ((a0-5 (-> self root-override2 root-prim prim-core)) + (a1-2 (-> (the-as collide-shape v1-1) root-prim prim-core)) + ) + (when (< (vector-vector-distance (the-as vector a0-5) (the-as vector a1-2)) (-> *FACT-bank* suck-suck-dist)) + (logior! (-> self flags) (collectable-flag suck-in)) + #t + ) + ) + ) + ) + ) + ) + ) + +(defbehavior add-blue-motion eco ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 symbol)) + (let* ((gp-0 (handle->process (-> self target))) + (s2-0 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (when s2-0 + (let ((a0-6 (if (type? s2-0 process-focusable) + (the-as process-focusable s2-0) + ) + ) + ) + (when a0-6 + (let ((s2-1 (-> self root-override2 root-prim prim-core)) + (gp-1 (get-trans a0-6 3)) + ) + (if (and arg1 (rand-vu-percent? 0.25)) + (eco-blue-glow (the-as vector s2-1)) + ) + (let ((f0-0 (vector-vector-distance (the-as vector s2-1) gp-1))) + (cond + ((and arg3 (< f0-0 8192.0)) + (return #t) + ) + ((begin + (set! arg0 + (and (or (not arg2) + (or (< f0-0 (-> *FACT-bank* suck-suck-dist)) (logtest? (-> self flags) (collectable-flag suck-in))) + ) + arg0 + ) + ) + arg0 + ) + (logior! (-> self flags) (collectable-flag suck-in)) + (when (= (-> self speed w) 0.0) + (set! (-> self suck-time) (-> self clock frame-counter)) + (set! (-> self speed x) (rand-vu-float-range 327680.0 819200.0)) + ) + (+! (-> self speed w) (* (lerp-scale + 40960.0 + (-> self speed x) + (the float (- (-> self clock frame-counter) (the-as int (-> self suck-time)))) + 45.0 + 60.0 + ) + (-> self clock seconds-per-frame) + ) + ) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> self base) gp-1))) + (vector-normalize! + s5-2 + (fmax 0.0 (- (vector-length s5-2) (* (-> self speed w) (-> self clock seconds-per-frame)))) + ) + (when (< (vector-length s5-2) 81920.0) + (+! (-> self speed y) (* 72817.78 (-> self clock seconds-per-frame))) + (set! (-> self speed y) (fmin (fmin 291271.12 (-> self speed y)) (-> self speed y))) + (vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (-> self clock seconds-per-frame))) + ) + (set! (-> self suck-y-offset) + (* 2048.0 + (sin (* 873.81335 (the float (mod (- (-> self clock frame-counter) (the-as int (-> self suck-time))) 75)))) + ) + ) + (vector+! (-> self base) gp-1 s5-2) + ) + ) + ((and arg2 (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) + (zero? (logand (-> self flags) (collectable-flag suck-in))) + ) + ) + (go-virtual wait) + ) + (arg1 + (add-blue-shake (-> self root-override2 trans) (the-as vector s2-1) gp-1) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 108] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 144] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 179] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 191] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 213] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 256] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 271] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 288] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 309] +(defbehavior collectable-standard-event-handler collectable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-4 none)) + (when (and (or (= arg2 'touch) (= arg2 'attack)) + (and (logtest? (-> self flags) (collectable-flag pickup)) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self collect-timeout)) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event arg0 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (process->handle arg0)) + ) + (the-as object (cond + ((= arg2 'trans) + (set! (-> self root-override2 trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (update-transforms (-> self root-override2)) + (ja-post) + ) + ((= arg2 'jump) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (go-virtual jump) + ) + ((= arg2 'pickup) + (when (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (if (and (> arg1 0) (-> arg3 param 0)) + (move-to-point! (-> self root-override2) (the-as vector (-> arg3 param 0))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (the-as handle #f)) + ) + ) + ((= arg2 'suck) + (when (not (and (-> self next-state) (let ((v1-60 (-> self next-state name))) + (or (= v1-60 'suck) (= v1-60 'pickup)) + ) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual suck (process->handle (the-as process (-> arg3 param 0)))) + ) + ) + ((= arg2 'die) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual die) + ) + ((= arg2 'movie-pos) + (set! v0-4 (the-as none (-> arg3 param 0))) + (set! (-> self movie-pos-index) (the-as int v0-4)) + v0-4 + ) + ((= arg2 'actor-pause) + (cond + ((-> arg3 param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (set! v0-4 (the-as none #t)) + (set! (-> self actor-pause) (the-as symbol v0-4)) + v0-4 + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + ((= arg2 'fade) + (logior! (-> self flags) (collectable-flag fadeout)) + (set! (-> self fadeout-timeout) (the-as seconds 30)) + (set! v0-4 (the-as none (-> self clock frame-counter))) + (set! (-> self birth-time) (the-as time-frame v0-4)) + v0-4 + ) + ((= arg2 'anim) + (cond + ((-> arg3 param 0) + (set! v0-4 (the-as none (logclear (-> self flags) (collectable-flag no-bob)))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + (else + (set! v0-4 (the-as none (logior (-> self flags) (collectable-flag no-bob)))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + ) + v0-4 + ) + ((= arg2 'collide-shape) + (cond + ((-> arg3 param 0) + (let ((v1-97 (-> self root-override2 root-prim))) + (set! (-> v1-97 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! v0-4 (the-as none (-> self root-override2 backup-collide-with))) + (set! (-> v1-97 prim-core collide-with) (the-as collide-spec v0-4)) + ) + v0-4 + ) + (else + (let ((v1-99 (-> self root-override2 root-prim))) + (set! (-> v1-99 prim-core collide-as) (collide-spec)) + (set! (-> v1-99 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + ((= arg2 'get-notify) + (cond + ((= (-> arg3 param 0) #t) + (let ((v1-103 (ppointer->process (-> self parent)))) + (cond + ((logtest? (-> v1-103 mask) (process-mask process-tree)) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (the-as none (process->handle v1-103))) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ) + ((= (-> arg3 param 0) #f) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (the-as none (process->handle (the-as process (-> arg3 param 0))))) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ((= arg2 'effect) + (when (not (-> arg3 param 0)) + (set! (-> self collect-effect) (the-as basic 0)) + (set! (-> self collect-effect2) (the-as basic 0)) + 0 + ) + ) + ) + ) + ) + +(defstate blocked (collectable) + :virtual #t + :trans (behavior () + (if (task-complete? *game-info* (the-as game-task (-> self entity extra perm task))) + (go-virtual wait) + ) + (none) + ) + :code (the-as (function none :behavior collectable) sleep-code) + ) + +(defstate jump (collectable) + :virtual #t + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((gp-0 (new 'stack 'trajectory))) + (set! (-> self base y) (-> self jump-pos y)) + (setup-from-to-duration! gp-0 (-> self root-override2 trans) (-> self jump-pos) 300.0 -2.2755556) + (set! (-> self state-time) (-> self clock frame-counter)) + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (let ((f0-2 (the float (- (-> self clock frame-counter) (-> self state-time))))) + (compute-trans-at-time gp-0 f0-2 (-> self root-override2 trans)) + ) + (transform-post) + (common-post self) + (suspend) + (if (nonzero? (-> self skel)) + (ja :num! (loop! 0.5)) + ) + ) + ) + (set! (-> self root-override2 trans quad) (-> self jump-pos quad)) + (set! (-> self base quad) (-> self root-override2 trans quad)) + (vector-reset! (-> self root-override2 transv)) + (update-transforms (-> self root-override2)) + (logclear! (-> self flags) (collectable-flag bounce)) + (logior! (-> self flags) (collectable-flag pickup)) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (go-virtual wait) + (none) + ) + ) + +(defstate deploy (collectable) + :virtual #t + :event collectable-standard-event-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (case (-> self pickup-type) + (((pickup-type gem)) + (sound-play "gem-spawn") + ) + (((pickup-type eco-pill-dark)) + (sound-play "pill-spawn") + ) + ) + (if (and (logtest? (-> self fact options) (actor-option suck-in)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + *target* + (zero? (logand (-> *target* focus-status) (focus-status dead))) + ) + (go-virtual suck (process->handle *target*)) + ) + (none) + ) + :exit (behavior () + (vector-reset! (-> self root-override2 transv)) + (logclear! (-> self flags) (collectable-flag bounce)) + (logior! (-> self flags) (collectable-flag pickup)) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (set! (-> self base quad) (-> self root-override2 trans quad)) + (logclear! (-> self root-override2 root-prim prim-core action) (collide-action solid)) + (set! (-> self root-override2 root-prim prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> self root-override2 root-prim prim-core collide-as) + (collide-spec collectable notice-blue-eco-powerup) + ) + (none) + ) + :trans (behavior () + (vector-v++! + (-> self root-override2 transv) + (compute-acc-due-to-gravity (-> self root-override2) (new-stack-vector0) 0.0) + ) + (integrate-no-collide! (-> self root-override2) (-> self root-override2 transv)) + (when (and (>= 0.0 (-> self root-override2 transv y)) (>= (-> self base y) (-> self root-override2 trans y))) + (set! (-> self root-override2 trans y) (-> self base y)) + (cond + ((< (-> self root-override2 transv y) -8192.0) + (set! (-> self root-override2 transv y) (* -0.5 (-> self root-override2 transv y))) + ) + (else + (if (and (logtest? (-> self fact options) (actor-option suck-in)) + (zero? (logand (-> self flags) (collectable-flag no-eco-blue))) + ) + (go-virtual notice-blue (process->handle *target*)) + ) + (when (and (logtest? (-> self fact options) (actor-option auto-pickup suck-in)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (process-contact-action *target*) + (go-virtual pickup #f (process->handle *target*)) + ) + (go-virtual wait) + ) + ) + ) + (none) + ) + :code (behavior () + (until #f + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +(defstate suck (collectable) + :virtual #t + :event collectable-standard-event-handler + :enter (behavior ((arg0 handle)) + (sound-play "pickup-suck") + (set! (-> self target) arg0) + (set! (-> self speed quad) (the-as uint128 0)) + (set! (-> self speed z) (if (rand-vu-percent? 0.5) + 1.0 + -1.0 + ) + ) + (set! (-> self suck-y-offset) 0.0) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self flags) (collectable-flag pickup suck-in)) + (none) + ) + :code (behavior ((arg0 handle)) + (until #f + (set! (-> self root-override2 trans quad) (-> self base quad)) + (add-blue-motion #t #f #f #f) + (update-transforms (-> self root-override2)) + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +(defstate wait (collectable) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('eco-blue) + (when (and (not (logtest? (-> self flags) (collectable-flag do-fadeout no-eco-blue))) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (and (if (check-blue-suck (the-as process-drawable proc)) + (go-virtual suck (process->handle proc)) + ) + (logtest? (-> self flags) (collectable-flag pickup)) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self collect-timeout)) + ) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual notice-blue (process->handle proc)) + ) + ) + (else + (collectable-standard-event-handler proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (when (and (logtest? (-> self fact options) (actor-option auto-pickup suck-in)) + (logtest? (-> self flags) (collectable-flag pickup)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (process-contact-action *target*) + (go-virtual pickup #f (process->handle *target*)) + ) + (none) + ) + :code (behavior () + (until #f + (if (and (logtest? (-> self flags) (collectable-flag fadeout)) + (begin + (if (movie?) + (set! (-> self birth-time) (-> self clock frame-counter)) + ) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self fadeout-timeout)) + ) + ) + (or (or (not *target*) + (or (< 204800.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) + (logtest? (focus-status teleporting) (-> *target* focus-status)) + ) + ) + (logtest? (-> self flags) (collectable-flag no-distance-check-fadeout)) + ) + ) + (go-virtual fade) + ) + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +(defstate fade (collectable) + :virtual #t + :event collectable-standard-event-handler + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + (logior! (-> self flags) (collectable-flag do-fadeout)) + (logior! (-> self state-flags) (state-flags sf0)) + (let ((gp-0 (-> self clock frame-counter))) + (until #f + (let ((f0-1 (- 300.0 (the float (- (-> self clock frame-counter) gp-0))))) + (cond + ((< f0-1 0.0) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (else + (if (nonzero? (-> self part)) + (set! (-> self part fade) (* 0.0033333334 f0-1)) + ) + (when (nonzero? (-> self draw)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self draw force-fade) (the-as uint (max 0 (min 128 (the int (* 0.42666668 f0-1)))))) + ) + ) + ) + ) + (common-post self) + (suspend) + ) + ) + #f + (none) + ) + ) + +(defstate notice-blue (collectable) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (when (and (or (= event-type 'touch) (= event-type 'attack)) + (and (logtest? (-> self flags) (collectable-flag pickup)) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self collect-timeout)) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle proc)) + ) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self target) arg0) + (set! (-> self speed quad) (the-as uint128 0)) + (set! (-> self speed z) (if (rand-vu-percent? 0.5) + 1.0 + -1.0 + ) + ) + (set! (-> self suck-y-offset) 0.0) + (logclear! (-> self mask) (process-mask actor-pause)) + (none) + ) + :exit (behavior () + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (none) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'powerup)) + (set! (-> a1-0 param 1) (the-as uint 3)) + (if (and (not (send-event-function *target* a1-0)) (zero? (logand (-> self flags) (collectable-flag suck-in)))) + (go-virtual wait) + ) + ) + (none) + ) + :code (behavior ((arg0 handle)) + (until #f + (set! (-> self root-override2 trans quad) (-> self base quad)) + (add-blue-motion #t #f #t #f) + (update-transforms (-> self root-override2)) + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +(defstate pickup (collectable) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('set-movie-pos) + (let ((v1-2 (res-lump-struct (-> self entity) 'movie-pos structure))) + (when v1-2 + (set! (-> (the-as vector v1-2) quad) (-> (the-as vector (-> event param 0)) quad)) + v1-2 + ) + ) + ) + (('actor-pause) + (cond + ((-> event param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v0-1 (the-as object #t))) + (set! (-> self actor-pause) (the-as symbol v0-1)) + v0-1 + ) + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (the-as object (deactivate self)) + ) + (('effect) + (when (not (-> event param 0)) + (set! (-> self collect-effect) (the-as basic 0)) + (set! (-> self collect-effect2) (the-as basic 0)) + 0 + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol) (arg1 handle)) + (do-pickup self arg1) + (none) + ) + :code (behavior ((arg0 symbol) (arg1 handle)) + (while (-> self child) + (suspend) + ) + (go-virtual die) + (none) + ) + ) + +(defstate die (collectable) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + (none) + ) + ) + +(deftype eco (collectable) + ((respan-delay seconds :offset-assert 408) + ) + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + + +(defmethod initialize-allocations eco ((obj eco)) + (let ((t9-0 (method-of-type collectable initialize-allocations))) + (t9-0 obj) + ) + (if (logtest? (-> obj fact options) (actor-option respawn-delay)) + (set! (-> obj respan-delay) (-> obj fact fade-time)) + ) + 0 + (none) + ) + +(defstate die (eco) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (the-as object (deactivate self)) + ) + (('die) + (go-virtual die) + ) + ) + ) + ) + :exit (behavior () + (process-entity-status! self (entity-perm-status no-kill) #f) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (none) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status no-kill) #t) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self fact options) (actor-option auto-pickup suck-in)) + (if (nonzero? (-> self part)) + (kill-and-free-particles (-> self part)) + ) + (cond + ((nonzero? (-> self respan-delay)) + (let ((gp-0 (-> self clock frame-counter))) + (while (< (- (-> self clock frame-counter) gp-0) (the-as time-frame (-> self respan-delay))) + (suspend) + ) + ) + ) + (else + (while (let ((f30-0 0.0)) + (< f30-0 (the-as float (send-event *target* 'query 'pickup (-> self fact pickup-type)))) + ) + (suspend) + ) + ) + ) + (set! (-> self base quad) (-> self old-base quad)) + (set! (-> self root-override2 trans quad) (-> self base quad)) + (let ((v1-26 (-> self root-override2 root-prim))) + (set! (-> v1-26 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-26 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (set! (-> self clock) (-> *display* entity-clock)) + (if (nonzero? (-> self draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (go-virtual wait) + (none) + ) + ) + +(defstate pickup (eco) + :virtual #t + :code (behavior ((arg0 symbol) (arg1 handle)) + (if (not (logtest? (-> self fact options) (actor-option no-reaction))) + (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (let ((t9-2 (-> (the-as state (find-parent-method eco 26)) code))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + (none) + ) + ) + +(deftype eco-yellow (eco) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + + +(defmethod init-from-entity! eco-yellow ((obj eco-yellow) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) + (none) + ) + +(deftype eco-red (eco) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + + +(defmethod init-from-entity! eco-red ((obj eco-red) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) + (none) + ) + +(deftype eco-blue (eco) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + + +(defmethod init-from-entity! eco-blue ((obj eco-blue) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) + (none) + ) + +(deftype eco-green (eco) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + + +(defmethod init-from-entity! eco-green ((obj eco-green) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) + (none) + ) + +(deftype health (collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + + +(defmethod init-from-entity! health ((obj health) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) + (none) + ) + +(deftype eco-pill (collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + + +(defstate wait (eco-pill) + :virtual #t + :trans (behavior () + (if (and (and *target* + (and (>= 32768.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) + (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (and (not (logtest? (-> *target* focus-status) (focus-status dead hit))) + (case (-> self fact pickup-type) + (((pickup-type eco-pill-dark)) + (< (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) + ) + (else + #t + ) + ) + ) + ) + (send-event self 'suck *target*) + ) + (none) + ) + ) + +(defmethod init-from-entity! eco-pill ((obj eco-pill) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) + (none) + ) + +(defmethod deactivate eco-pill ((obj eco-pill)) + (+! (-> *game-info* live-eco-pill-count) -1) + ((method-of-type collectable deactivate) obj) + (none) + ) + +(defmethod initialize-allocations eco-pill ((obj eco-pill)) + (+! (-> *game-info* live-eco-pill-count) 1) + (stack-size-set! (-> obj main-thread) 128) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #f) + (set! (-> obj notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-13 local-sphere) 0.0 3276.8 0.0 1638.4) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-13) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-16 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + 0 + (none) + ) + +(deftype money (collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + + +(defmethod run-logic? money ((obj money)) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) + (or (and (nonzero? (-> obj draw)) + (logtest? (-> obj draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override2 pause-adjust-distance)) + (vector-vector-distance (-> obj root-override2 trans) (math-camera-pos)) + ) + ) + (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) + (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status uninited))) + ) + ) + ) + +(defmethod deactivate money ((obj money)) + (when (and (-> obj next-state) (= (-> obj next-state name) 'pickup)) + (case (-> obj pickup-type) + (((pickup-type gem)) + (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save)))) + (format #t "~A ~A was killed in pickup~%" (-> obj type) (-> obj name)) + ) + (process-entity-status! obj (entity-perm-status dead) #t) + ) + (else + (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status dead)))) + (format #t "~A ~A was killed in pickup~%" (-> obj type) (-> obj name)) + ) + ) + ) + ) + ((method-of-type collectable deactivate) obj) + (none) + ) + +(defmethod common-post money ((obj money)) + (with-pp + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (* 40049.777 (-> pp clock seconds-per-frame)) + ) + (let ((f30-0 (-> obj bob-amount))) + (when (< 0.0 f30-0) + (set! (-> obj root-override2 trans y) + (+ (-> obj base y) + (-> obj suck-y-offset) + (* f30-0 + (sin + (* 109.22667 + (the float + (mod + (+ (- (-> pp clock frame-counter) (the-as int (-> obj birth-time))) (the-as time-frame (-> obj bob-offset))) + 600 + ) + ) + ) + ) + ) + ) + ) + (update-transforms (-> obj root-override2)) + ) + ) + (ja-post) + (none) + ) + ) + +(defstate notice-blue (money) + :virtual #t + :code (behavior ((arg0 handle)) + (until #f + (quaternion-rotate-y! + (-> self root-override2 quat) + (-> self root-override2 quat) + (* 91022.22 (-> self clock seconds-per-frame)) + ) + (set! (-> self root-override2 trans quad) (-> self base quad)) + (add-blue-motion #t #t #t #f) + (let ((f30-0 (-> self bob-amount))) + (if (< 0.0 f30-0) + (set! (-> self root-override2 trans y) + (+ (-> self base y) + (-> self suck-y-offset) + (* f30-0 + (sin (* 109.22667 (the float (mod + (+ (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self bob-offset)) + ) + 600 + ) + ) + ) + ) + ) + ) + ) + ) + ) + (transform-post) + (suspend) + ) + #f + (none) + ) + ) + +(defstate pickup (money) + :virtual #t + :code (behavior ((arg0 symbol) (arg1 handle)) + (process-entity-status! self (entity-perm-status dead) #t) + (none) + ) + ) + +(defmethod initialize-allocations money ((obj money)) + (stack-size-set! (-> obj main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (logior! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #t) + (set! (-> obj notify) (the-as handle #f)) + (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type money) 1.0)) + (let ((a0-11 (-> obj entity))) + (if (when a0-11 + (let ((a0-12 (-> a0-11 extra perm task))) + (if a0-12 + (zero? a0-12) + ) + ) + ) + (set! (-> obj entity extra perm task) (the-as uint 1)) + ) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (if (-> obj entity) + (nav-mesh-connect-from-ent obj) + ) + (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + 0 + (none) + ) + +(defmethod init-from-entity! money ((obj money) (arg0 entity-actor)) + (initialize-allocations obj) + (process-drawable-from-entity! obj (-> obj entity)) + (initialize-options obj 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> obj root-override2)) + (go-to-initial-state obj) + (none) + ) + +(defbehavior money-init-by-other money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (process-entity-set! self arg3) + (set! (-> self pickup-type) s3-0) + (set! (-> self pickup-amount) f30-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (let ((v1-5 (ppointer->process (-> self parent)))) + (set! (-> self notify) (if (logtest? (-> v1-5 mask) (process-mask process-tree)) + (the-as handle #f) + (process->handle v1-5) + ) + ) + ) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root-override2 quat)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 4500 + ) + 1024.0 + arg2 + ) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +(defbehavior money-init-by-other-no-bob money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 float) (arg4 entity-actor)) + (process-entity-set! self arg4) + (set! (-> self pickup-type) (the-as pickup-type arg2)) + (set! (-> self pickup-amount) arg3) + (initialize-allocations self) + (set! (-> self fact pickup-type) (the-as pickup-type arg2)) + (set! (-> self fact pickup-amount) arg3) + (let ((v1-4 (ppointer->process (-> self parent)))) + (set! (-> self notify) (if (logtest? (-> v1-4 mask) (process-mask process-tree)) + (the-as handle #f) + (process->handle v1-4) + ) + ) + ) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root-override2 quat)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-options self 4500 0.0 (the-as fact-info #f)) + (logior! (-> self flags) (collectable-flag no-eco-blue)) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +(deftype gem (money) + ((roty-speed degrees :offset-assert 404) + (bounce-time seconds :offset-assert 408) + ) + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + + +(defmethod deactivate gem ((obj gem)) + (+! (-> *game-info* live-gem-count) -1) + ((the-as (function gem none) (find-parent-method gem 10)) obj) + (none) + ) + +(defmethod common-post gem ((obj gem)) + (with-pp + (seek! (-> obj roty-speed) 20024.889 (* 65536.0 (-> pp clock seconds-per-frame))) + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (* (-> obj roty-speed) (-> pp clock seconds-per-frame)) + ) + (logclear! (-> obj draw status) (draw-control-status no-draw-temp uninited)) + (do-joint-math (-> obj draw) (-> obj node-list) (-> obj skel)) + (let ((a0-7 (-> obj part)) + (a1-3 (-> obj draw skeleton bones 3)) + ) + (if (nonzero? a0-7) + (spawn-with-matrix a0-7 (the-as matrix a1-3)) + ) + ) + 0 + (none) + ) + ) + +(defstate deploy (gem) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type collectable deploy) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-vector! + (-> self root-override2 transv) + (rand-vu-float-range -20480.0 20480.0) + 81920.0 + (rand-vu-float-range -20480.0 20480.0) + 1.0 + ) + (set-gravity-length (-> self root-override2 dynam) 122880.0) + (set! (-> self roty-speed) 186413.52) + (logior! (-> self flags) (collectable-flag pickup)) + (set! (-> self root-override2 root-prim prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> self root-override2 root-prim prim-core collide-as) (collide-spec collectable)) + (set! (-> self root-override2 max-iteration-count) (the-as uint 2)) + (logior! (-> self root-override2 root-prim prim-core action) (collide-action solid)) + (set! (-> self root-override2 reaction) projectile-bounce-reaction) + (set! (-> self root-override2 penetrated-by) (the-as penetrate -1)) + (none) + ) + :exit (behavior () + (set! (-> self roty-speed) (fmin 262144.0 (-> self roty-speed))) + (set-gravity-length (-> self root-override2 dynam) 245760.0) + (set! (-> self root-override2 root-prim local-sphere w) 6144.0) + (update-transforms (-> self root-override2)) + (let ((t9-2 (-> (method-of-type collectable deploy) exit))) + (if t9-2 + (t9-2) + ) + ) + (none) + ) + :trans (the-as (function none :behavior gem) #f) + :code (the-as (function none :behavior gem) sleep-code) + :post (behavior () + (let ((gp-0 #t)) + (vector-v++! + (-> self root-override2 transv) + (compute-acc-due-to-gravity (-> self root-override2) (new-stack-vector0) 0.0) + ) + (when (-> self entity) + (when (get-simple-travel-vector + (-> self entity) + (-> self root-override2 transv) + (-> self root-override2 trans) + (-> self root-override2 transv) + (* 1.5 (-> self root-override2 root-prim prim-core world-sphere w)) + 0.8 + ) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (f30-0 (-> self root-override2 transv y)) + ) + (project-point-to-nav-mesh + (-> self entity) + s5-1 + (-> self root-override2 trans) + (the-as nav-poly #f) + 40960000.0 + ) + (when (>= (vector-vector-xz-distance s5-1 (-> self root-override2 trans)) 204.8) + (vector-! (-> self root-override2 transv) s5-1 (-> self root-override2 trans)) + (vector-normalize! (-> self root-override2 transv) 40960.0) + (set! (-> self root-override2 transv y) + (if (< 0.0 (-> self root-override2 transv y)) + (+ f30-0 (* 4.0 (-> self clock seconds-per-frame) (-> self root-override2 transv y))) + f30-0 + ) + ) + (set! gp-0 #f) + ) + ) + ) + ) + (cond + (gp-0 + (let ((v1-31 (-> self root-override2)) + (a2-3 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> a2-3 collide-with) (-> v1-31 root-prim prim-core collide-with)) + (set! (-> a2-3 ignore-process0) self) + (set! (-> a2-3 ignore-process1) #f) + (set! (-> a2-3 ignore-pat) (-> v1-31 pat-ignore-mask)) + (set! (-> a2-3 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-31 (-> v1-31 transv) a2-3 (meters 0)) + ) + ) + (else + (integrate-no-collide! (-> self root-override2) (-> self root-override2 transv)) + ) + ) + ) + (let* ((gp-1 (-> self root-override2)) + (s5-2 (-> gp-1 status)) + ) + (cond + ((logtest? s5-2 (collide-status touch-surface)) + (set! (-> gp-1 transv x) (* 0.7 (-> gp-1 transv x))) + (set! (-> gp-1 transv y) (* (-> gp-1 transv y) (rand-vu-float-range 0.7 0.75))) + (set! (-> gp-1 transv z) (* 0.7 (-> gp-1 transv z))) + (set! (-> self roty-speed) + (fmin + 131072.0 + (+ (-> self roty-speed) (lerp-scale 0.0 131072.0 (-> self root-override2 ground-impact-vel) 0.0 122880.0)) + ) + ) + (if (or (and (logtest? s5-2 (collide-status on-surface)) (< (vector-length (-> gp-1 transv)) 1228.8)) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 10)) + ) + (go-virtual wait) + ) + (when (>= (- (-> self clock frame-counter) (the-as int (-> self bounce-time))) (seconds 0.1)) + (set! (-> self bounce-time) (-> self clock frame-counter)) + (sound-play-by-name + (static-sound-name "gem-bounce") + (new-sound-id) + (the int (* 1024.0 (lerp-scale 0.5 1.0 (-> self root-override2 ground-impact-vel) 0.0 40960.0))) + 0 + 0 + (sound-group sfx) + #t + ) + ) + ) + ((>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 15)) + (go-virtual wait) + ) + ) + ) + (seek! (-> self roty-speed) 0.0 (* 16384.0 (-> self clock seconds-per-frame))) + (common-post self) + (none) + ) + ) + +(defmethod initialize-allocations gem ((obj gem)) + (+! (-> *game-info* live-gem-count) 1) + (stack-size-set! (-> obj main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-11 local-sphere) 0.0 2048.0 0.0 2048.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-11) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (set! (-> obj roty-speed) 40049.777) + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (rand-vu-float-range 0.0 65536.0) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #f) + (set! (-> obj notify) (the-as handle #f)) + (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type gem) 1.0)) + (let ((v1-22 (-> obj entity))) + (if (and (-> obj entity) + (-> v1-22 extra perm task) + (zero? (-> v1-22 extra perm task)) + (type-type? (-> v1-22 etype) crate) + ) + (set! (-> obj entity extra perm task) (the-as uint 1)) + ) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 1.5 1.5 1.5 1.0) + (if (-> obj entity) + (nav-mesh-connect-from-ent obj) + ) + (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 86) obj)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 87)) + 0 + (none) + ) + +(define *collectable-dummy-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :flags (shadow-flags disable-fade) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 40960.0) + :top-plane (new 'static 'plane :y 1.0 :w -4096.0) + ) + ) + ) + +(deftype skill (money) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + + +(defstate wait (skill) + :virtual #t + :code (behavior () + (until #f + (if (and (logtest? (-> self flags) (collectable-flag fadeout)) + (begin + (if (movie?) + (set! (-> self birth-time) (-> self clock frame-counter)) + ) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self fadeout-timeout)) + ) + ) + ) + (go-virtual fade) + ) + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +(defmethod initialize-allocations skill ((obj skill)) + (stack-size-set! (-> obj main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (logior! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #t) + (set! (-> obj notify) (the-as handle #f)) + (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type skill) 1.0)) + (let ((a0-11 (-> obj entity))) + (if (when a0-11 + (let ((a0-12 (-> a0-11 extra perm task))) + (if a0-12 + (zero? a0-12) + ) + ) + ) + (set! (-> obj entity extra perm task) (the-as uint 1)) + ) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-skill" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw shadow-ctrl) *collectable-dummy-shadow-control*) + (if (-> obj entity) + (nav-mesh-connect-from-ent obj) + ) + (cond + ((>= (-> obj pickup-amount) (-> *FACT-bank* super-skill-inc)) + (set-vector! (-> obj draw color-mult) 0.8 0.8 0.0 1.0) + (set-vector! (-> obj draw color-emissive) 0.0 1.0 0.2 1.0) + ) + (else + (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + ) + ) + 0 + (none) + ) + +(deftype fuel-cell (process-hidden) + () + :method-count-assert 15 + :size-assert #x80 + :flag-assert #xf00000080 + ) + + +(deftype trick-point (collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + + +(deftype skate-point (trick-point) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + + +(defmethod initialize-allocations trick-point ((obj trick-point)) + (stack-size-set! (-> obj main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (logior! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #t) + (set! (-> obj notify) (the-as handle #f)) + (set! (-> obj root-override2 pause-adjust-distance) 204800.0) + (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type trick-point) 100.0)) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 94) obj)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 95)) + 0 + (none) + ) + +(defmethod init-from-entity! trick-point ((obj trick-point) (arg0 entity-actor)) + (initialize-allocations obj) + (process-drawable-from-entity! obj (-> obj entity)) + (initialize-options obj 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> obj root-override2)) + (go-to-initial-state obj) + (none) + ) + +(deftype ammo-collectable (collectable) + ((ammo-effect basic :offset-assert 404) + ) + :heap-base #x120 + :method-count-assert 36 + :size-assert #x198 + :flag-assert #x2401200198 + ) + + +(defmethod initialize-allocations ammo-collectable ((obj ammo-collectable)) + (stack-size-set! (-> obj main-thread) 128) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #f) + (set! (-> obj notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-10 local-sphere) 0.0 3276.8 0.0 6553.6) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-10) + ) + (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! (-> obj root-override2) s5-0) + ) + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (rand-vu-float-range 0.0 65536.0) + ) + (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + (case (-> obj pickup-type) + (((pickup-type ammo-yellow)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 88)) + ) + (((pickup-type ammo-red)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 89)) + ) + (((pickup-type ammo-blue)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 90)) + ) + (((pickup-type ammo-dark)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 91)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod initialize-effects ammo-collectable ((obj ammo-collectable) (arg0 pickup-type)) + (set! (-> obj fact pickup-type) arg0) + (case arg0 + (((pickup-type ammo-yellow)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 2.5 2.5 2.5 1.0) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 108)) + ) + (((pickup-type ammo-red)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 4.0 4.0 4.0 1.0) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 102)) + ) + (((pickup-type ammo-blue)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 4.0 4.0 4.0 1.0) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 98)) + ) + (((pickup-type ammo-dark)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 3.0 3.0 3.0 1.0) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 83)) + ) + (((pickup-type gun-yellow)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-yellow-up" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 3.0 3.0 3.0 1.0) + (logclear! (-> obj flags) (collectable-flag fadeout)) + (let ((v1-34 (-> obj node-list data))) + (set! (-> v1-34 0 param0) (the-as (function cspace matrix none) cspace<-transformq+trans!)) + (set! (-> v1-34 0 param1) (the-as basic (-> obj root-override2 trans))) + (set! (-> v1-34 0 param2) (the-as basic (-> obj extra-trans))) + ) + (set-vector! (-> obj extra-trans) 0.0 1638.4 0.0 1.0) + ) + (((pickup-type gun-dark)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dark-up" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 3.0 3.0 3.0 1.0) + (logclear! (-> obj flags) (collectable-flag fadeout)) + ) + (((pickup-type board)) + (process-entity-set! obj (the-as entity-actor #f)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-board" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((v1-48 (-> obj skel root-channel 0))) + (set! (-> v1-48 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + ) + (set-vector! (-> obj root-override2 scale) 2.0 2.0 2.0 1.0) + (let ((v1-52 (-> obj node-list data))) + (set! (-> v1-52 0 param0) (the-as (function cspace matrix none) cspace<-transformq+trans!)) + (set! (-> v1-52 0 param1) (the-as basic (-> obj root-override2 trans))) + (set! (-> v1-52 0 param2) (the-as basic (-> obj extra-trans))) + ) + (set-vector! (-> obj extra-trans) 0.0 2048.0 0.0 1.0) + (logclear! (-> obj flags) (collectable-flag fadeout)) + ) + (((pickup-type shield)) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 80)) + ) + (((pickup-type trick-point)) + ) + ) + (none) + ) + +(defbehavior initialize-ammo-by-other ammo ((arg0 vector) (arg1 vector) (arg2 fact-info)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (initialize-options self 4500 1024.0 arg2) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +(defmethod init-common ammo-collectable ((obj ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> obj pickup-amount) arg2) + (set! (-> obj pickup-type) arg1) + (initialize-allocations obj) + (set! (-> obj root-override2 trans quad) (-> arg0 extra trans quad)) + (initialize-effects obj (-> obj fact pickup-type)) + (initialize-options obj 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> obj root-override2)) + (go-to-initial-state obj) + (none) + ) + +(defmethod common-post ammo-collectable ((obj ammo-collectable)) + (with-pp + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (* 40049.777 (-> pp clock seconds-per-frame)) + ) + ((method-of-type collectable common-post) obj) + 0 + (none) + ) + ) + +(defstate die (ammo-collectable) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + (none) + ) + ) + +(deftype ammo (ammo-collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x198 + :flag-assert #x2401200198 + ) + + +(deftype shield (ammo-collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x198 + :flag-assert #x2401200198 + ) + + +(deftype upgrade-collectable (ammo-collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x198 + :flag-assert #x2401200198 + ) + + +(defbehavior initialize-upgrade-by-other upgrade-collectable ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) + (process-entity-set! self arg3) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 0 + ) + 1024.0 + (the-as fact-info #f) + ) + (set! (-> self collect-timeout) (the-as seconds 300)) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +(defmethod init-from-entity! eco ((obj eco) (arg0 entity-actor)) + (let ((v1-1 (res-lump-value (-> obj entity) 'eco-info uint128 :time -1000000000.0))) + (set! (-> obj type) (cond + ((= (the-as uint v1-1) 3) + eco-blue + ) + ((= (the-as uint v1-1) 2) + eco-red + ) + ((= (the-as uint v1-1) 1) + eco-yellow + ) + ((= (the-as uint v1-1) 5) + eco-green + ) + ((= (the-as uint v1-1) 18) + health + ) + ((= (the-as uint v1-1) 9) + money + ) + ((= (the-as uint v1-1) 19) + trick-point + ) + ((= (the-as uint v1-1) 21) + gem + ) + ((= (the-as uint v1-1) 22) + skill + ) + ((= (the-as uint v1-1) 10) + fuel-cell + ) + (else + eco-pill + ) + ) + ) + ) + (init-from-entity! obj arg0) + (none) + ) + +(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info)) + (local-vars (sv-32 vector) (sv-36 float) (sv-40 (pointer process)) (sv-48 int) (sv-56 fact-info) (sv-64 int)) + (set! sv-32 (new-stack-vector0)) + (set! sv-36 (res-lump-float + (if (and arg5 (nonzero? (-> arg5 process))) + (-> arg5 process entity) + ) + 'pickup-radius + :default (cond + ((= arg1 (pickup-type buzzer)) + 0.0 + ) + ((= arg2 1.0) + 409.6 + ) + (else + 8192.0 + ) + ) + ) + ) + (set! sv-40 (the-as (pointer process) #f)) + (set! sv-48 (the int arg2)) + (set! sv-56 (new 'static 'fact-info)) + (set! (-> sv-56 options) (actor-option)) + (if arg5 + (mem-copy! (&-> sv-56 type) (&-> arg5 type) 40) + ) + (set! (-> sv-56 pickup-type) arg1) + (set! (-> sv-56 pickup-spawn-amount) 1.0) + (while (> sv-48 0) + (set! sv-48 (+ sv-48 -1)) + (when arg3 + (set-vector! sv-32 0.0 57001.605 sv-36 1.0) + (vector-rotate-around-y! sv-32 sv-32 (/ (* 65536.0 (the float sv-48)) arg2)) + ) + (case arg1 + (((pickup-type eco-yellow)) + (set! sv-40 + (process-spawn eco-yellow :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type eco-red)) + (set! sv-40 + (process-spawn eco-red :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type eco-blue)) + (set! sv-40 + (process-spawn eco-blue :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type eco-green)) + (set! sv-40 + (process-spawn eco-green :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type health)) + (set! (-> sv-56 pickup-spawn-amount) arg2) + (set! sv-40 + (process-spawn health :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type eco-pill-green) (pickup-type eco-pill-dark)) + (set! sv-40 + (process-spawn eco-pill :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type ammo-yellow) + (pickup-type ammo-red) + (pickup-type ammo-blue) + (pickup-type ammo-dark) + (pickup-type shield) + ) + (let ((v1-56 arg1)) + (set! sv-64 (cond + ((= v1-56 (pickup-type ammo-red)) + 5 + ) + ((= v1-56 (pickup-type ammo-dark)) + 1 + ) + (else + 10 + ) + ) + ) + ) + (set! (-> sv-56 pickup-spawn-amount) (the float sv-64)) + (set! sv-40 (process-spawn + ammo-collectable + :init initialize-ammo-by-other + arg0 + sv-32 + sv-56 + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 (- sv-48 (+ sv-64 -1))) + ) + (((pickup-type gun-yellow) + (pickup-type gun-red) + (pickup-type gun-blue) + (pickup-type gun-dark) + (pickup-type board) + ) + (set! sv-40 (process-spawn + upgrade-collectable + :init initialize-upgrade-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type trick-point)) + (set! (-> sv-56 pickup-spawn-amount) arg2) + (set! sv-40 + (process-spawn trick-point :init initialize-ammo-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type money)) + (set! sv-40 (process-spawn money arg0 sv-32 sv-56 (-> self entity) :from *pickup-dead-pool* :to arg4)) + ) + (((pickup-type trick-point)) + (set! sv-40 (process-spawn money arg0 sv-32 sv-56 (-> self entity) :from *pickup-dead-pool* :to arg4)) + ) + (((pickup-type gem)) + (if (>= (-> *game-info* live-gem-count) 20) + (return (the-as (pointer process) #f)) + ) + (set! sv-40 (process-spawn + gem + :init money-init-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type skill)) + (when (>= arg2 (-> *FACT-bank* super-skill-inc)) + (set! (-> sv-56 pickup-spawn-amount) arg2) + (set! sv-48 0) + 0 + ) + (set! sv-40 (process-spawn + skill + :init money-init-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (else + (format 0 "ERROR: unknown type of eco ~d~%" arg1) + ) + ) + ) + sv-40 + ) + (defmethod drop-pickup fact-info ((obj fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) - (the (pointer process) #f) - ) \ No newline at end of file + (let ((s2-0 (the-as int (-> obj pickup-type))) + (f30-0 (-> obj pickup-amount)) + ) + (when (= (the-as pickup-type s2-0) (pickup-type ammo-random)) + (let ((s2-1 (-> *game-info* features))) + 0.0 + (let* ((f0-2 (if (logtest? s2-1 (game-feature gun-yellow)) + (-> *FACT-bank* ammo-yellow-max) + 0.0 + ) + ) + (f1-1 (if (logtest? s2-1 (game-feature gun-red)) + (-> *FACT-bank* ammo-red-max) + 0.0 + ) + ) + (f2-1 (if (logtest? s2-1 (game-feature gun-blue)) + (-> *FACT-bank* ammo-blue-max) + 0.0 + ) + ) + (f3-1 (if (logtest? s2-1 (game-feature gun-dark)) + (-> *FACT-bank* ammo-dark-max) + 0.0 + ) + ) + (f4-1 (if (logtest? s2-1 (game-feature gun-yellow)) + (-> *FACT-bank* ammo-yellow-max) + 0.0 + ) + ) + (f5-1 (if (logtest? s2-1 (game-feature gun-red)) + (-> *FACT-bank* ammo-red-max) + 0.0 + ) + ) + (f6-1 (if (logtest? s2-1 (game-feature gun-blue)) + (-> *FACT-bank* ammo-blue-max) + 0.0 + ) + ) + (f7-1 (if (logtest? s2-1 (game-feature gun-dark)) + (-> *FACT-bank* ammo-dark-max) + 0.0 + ) + ) + (f8-1 (if (logtest? s2-1 (game-feature gun-yellow)) + (-> *game-info* gun-ammo 0) + 0.0 + ) + ) + (f9-1 (if (logtest? s2-1 (game-feature gun-red)) + (-> *game-info* gun-ammo 1) + 0.0 + ) + ) + (f10-1 (if (logtest? s2-1 (game-feature gun-blue)) + (-> *game-info* gun-ammo 2) + 0.0 + ) + ) + (f11-1 (if (logtest? s2-1 (game-feature gun-dark)) + (-> *game-info* gun-ammo 3) + 0.0 + ) + ) + (f0-3 (+ f0-2 (- f4-1 f8-1))) + (f1-2 (+ f1-1 (- f5-1 f9-1))) + (f2-2 (+ f2-1 (- f6-1 f10-1))) + (f3-2 (+ f3-1 (- f7-1 f11-1))) + (f4-8 (+ f0-3 f1-2 f2-2 f3-2)) + ) + (cond + ((!= f4-8 0.0) + (let* ((f26-0 (/ f0-3 f4-8)) + (f0-4 (/ f1-2 f4-8)) + (f1-3 (/ f2-2 f4-8)) + (f2-3 (/ f3-2 f4-8)) + (f22-0 (+ f0-4 f26-0)) + (f24-0 (+ f1-3 f22-0)) + (f28-0 (+ f2-3 f24-0)) + (f0-5 (rand-vu)) + ) + (cond + ((and (>= f26-0 f0-5) (logtest? s2-1 (game-feature gun-yellow))) + (set! s2-0 13) + ) + ((and (>= f22-0 f0-5) (logtest? s2-1 (game-feature gun-red))) + (set! s2-0 14) + (set! f30-0 (* 0.5 f30-0)) + ) + ((and (>= f24-0 f0-5) (logtest? s2-1 (game-feature gun-blue))) + (set! s2-0 15) + ) + ((and (>= f28-0 f0-5) (logtest? s2-1 (game-feature gun-dark))) + (set! s2-0 16) + (set! f30-0 (* 0.1 f30-0)) + ) + (else + (set! s2-0 7) + ) + ) + ) + ) + (else + (return (the-as (pointer process) #f)) + ) + ) + ) + ) + ) + (when (= s2-0 8) + f30-0 + (you-suck-stage *game-info* #f) + (set! s2-0 7) + (set! f30-0 (cond + ((< 20 (-> *game-info* live-eco-pill-count)) + (return (the-as (pointer process) #f)) + f30-0 + ) + ((< 10 (-> *game-info* live-eco-pill-count)) + 1.0 + ) + ((type? obj fact-info-enemy) + (+ (rand-vu-float-range 3.0 (+ 5.0 f30-0)) (the float arg3)) + ) + (else + (+ (rand-vu-float-range 2.0 (+ 3.0 f30-0)) (the float arg3)) + ) + ) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> obj process)) root trans quad)) + (set-vector! (-> s3-1 move-dist) 0.0 -81920.0 0.0 1.0) + (set! (-> s3-1 start-pos y) (+ 12288.0 (-> s3-1 start-pos y))) + (let ((v1-75 s3-1)) + (set! (-> v1-75 radius) 40.96) + (set! (-> v1-75 collide-with) (collide-spec backgnd)) + (set! (-> v1-75 ignore-process0) #f) + (set! (-> v1-75 ignore-process1) #f) + (set! (-> v1-75 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-75 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) + (set! (-> s3-1 start-pos quad) (-> s3-1 best-other-tri intersect quad)) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> obj process)) root trans quad)) + ) + (if (= s2-0 10) + (set! (-> s3-1 start-pos y) (+ 6144.0 (-> s3-1 start-pos y))) + ) + (birth-pickup-at-point (-> s3-1 start-pos) (the-as pickup-type s2-0) f30-0 arg0 arg1 obj) + ) + ) + ) + +(deftype ecovent (process-hidden) + () + :method-count-assert 15 + :size-assert #x80 + :flag-assert #xf00000080 + ) diff --git a/goal_src/jak2/engine/game/game-h.gc b/goal_src/jak2/engine/game/game-h.gc index c1c82f2259..3e90a7aca2 100644 --- a/goal_src/jak2/engine/game/game-h.gc +++ b/goal_src/jak2/engine/game/game-h.gc @@ -15,6 +15,8 @@ (declare-type carry-info basic) (declare-type touching-shapes-entry structure) (declare-type rigid-body-control basic) +(define-extern eco-blue-glow (function vector none)) +(define-extern process-contact-action (function process none :behavior target)) (define-extern vector<-cspace! (function vector cspace vector)) diff --git a/goal_src/jak2/engine/game/game-save.gc b/goal_src/jak2/engine/game/game-save.gc index 0a5073ddac..e7c5c3dbd6 100644 --- a/goal_src/jak2/engine/game/game-save.gc +++ b/goal_src/jak2/engine/game/game-save.gc @@ -1661,10 +1661,10 @@ ) ) (let ((v1-5 gp-0)) - (set! (-> v1-5 width) (the float (the-as float #x1b8))) + (set! (-> v1-5 width) (the float 440)) ) (let ((v1-6 gp-0)) - (set! (-> v1-6 height) (the float (the-as float #x50))) + (set! (-> v1-6 height) (the float 80)) ) (set! (-> gp-0 flags) (font-flags shadow kerning)) (format (clear *temp-string*) "~S / ~S ~D~%" (-> self mode) (-> self state name) (-> self which)) @@ -1688,10 +1688,10 @@ (set! (-> v1-17 scale) 0.8) ) (let ((v1-18 gp-1)) - (set! (-> v1-18 width) (the float (the-as float #x1b0))) + (set! (-> v1-18 width) (the float 432)) ) (let ((v1-19 gp-1)) - (set! (-> v1-19 height) (the float (the-as float #x14))) + (set! (-> v1-19 height) (the float 20)) ) (set! (-> gp-1 flags) (font-flags shadow kerning middle left large)) (when (and (>= 1 (-> *game-info* auto-save-count)) (-> self next-state) (= (-> self next-state name) 'save)) @@ -1702,7 +1702,7 @@ (set! (-> v1-30 scale) 0.7) ) (let ((v1-31 gp-1)) - (set! (-> v1-31 height) (the float (the-as float #xc8))) + (set! (-> v1-31 height) (the float 200)) ) (let ((s5-2 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-dont-remove) #f) 1) diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index f1f3639d14..887e4f046d 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -1434,10 +1434,10 @@ (set! (-> v1-7 scale) 0.7) ) (let ((v1-8 gp-0)) - (set! (-> v1-8 width) (the float (the-as float #x12c))) + (set! (-> v1-8 width) (the float 300)) ) (let ((v1-9 gp-0)) - (set! (-> v1-9 height) (the float (the-as float #x23))) + (set! (-> v1-9 height) (the float 35)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle left large)) (let ((s4-0 (if (logtest? (-> obj flags) (fail-mission-flags famflags-2)) @@ -1455,14 +1455,14 @@ ) (when (= (-> obj message) (fail-mission-message fammsg-1)) (let ((v1-17 gp-0)) - (set! (-> v1-17 height) (the float (the-as float #x5f))) + (set! (-> v1-17 height) (the float 95)) ) (let ((s5-1 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id text-x18a) #f) 1) (s5-1 *temp-string* gp-0 #f 44 (bucket-id progress)) ) (let ((v1-19 gp-0)) - (set! (-> v1-19 height) (the float (the-as float #x9b))) + (set! (-> v1-19 height) (the float 155)) ) (let ((s5-2 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id text-x180) #f) 1) @@ -2199,8 +2199,7 @@ :virtual #t :event task-manager-event-handler :exit (behavior () - ;; todo - ; (disable *screen-filter*) + (disable *screen-filter*) (none) ) :code (behavior () diff --git a/goal_src/jak2/engine/process-drawable/process-taskable.gc b/goal_src/jak2/engine/process-drawable/process-taskable.gc index fb722b5e04..c811d12880 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable.gc @@ -267,10 +267,10 @@ ) ) (let ((v1-84 s5-1)) - (set! (-> v1-84 width) (the float (the-as float #x154))) + (set! (-> v1-84 width) (the float 340)) ) (let ((v1-85 s5-1)) - (set! (-> v1-85 height) (the float (the-as float #x50))) + (set! (-> v1-85 height) (the float 80)) ) (let ((v1-86 s5-1)) (set! (-> v1-86 scale) 0.9) diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index e3436ae0be..d52daf2a70 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -805,10 +805,10 @@ ) ) (let ((v1-20 s2-0)) - (set! (-> v1-20 width) (the float (the-as float #x1d1))) + (set! (-> v1-20 width) (the float 465)) ) (let ((v1-21 s2-0)) - (set! (-> v1-21 height) (the float (the-as float #x46))) + (set! (-> v1-21 height) (the float 70)) ) (let ((v1-22 s2-0)) (set! (-> v1-22 scale) 0.5) @@ -1457,10 +1457,10 @@ ) ) (let ((v1-121 gp-6)) - (set! (-> v1-121 width) (the float (the-as float #x1b8))) + (set! (-> v1-121 width) (the float 440)) ) (let ((v1-122 gp-6)) - (set! (-> v1-122 height) (the float (the-as float #x30))) + (set! (-> v1-122 height) (the float 48)) ) (let ((v1-123 gp-6)) (set! (-> v1-123 scale) 0.5) diff --git a/goal_src/jak2/engine/ui/progress/progress-draw.gc b/goal_src/jak2/engine/ui/progress/progress-draw.gc index 0e0ef75d00..e6472dba31 100644 --- a/goal_src/jak2/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak2/engine/ui/progress/progress-draw.gc @@ -2747,10 +2747,10 @@ (set! (-> arg1 origin x) 120.0) (set! (-> arg1 origin y) 110.0) (let ((v1-8 arg1)) - (set! (-> v1-8 width) (the float (the-as float #x10e))) + (set! (-> v1-8 width) (the float 270)) ) (let ((v1-9 arg1)) - (set! (-> v1-9 height) (the float (the-as float #x23))) + (set! (-> v1-9 height) (the float 35)) ) (if (< f30-0 0.0) 0.0 @@ -2774,7 +2774,7 @@ ) (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) (let ((v1-25 arg1)) - (set! (-> v1-25 height) (the float (the-as float #xa0))) + (set! (-> v1-25 height) (the float 160)) ) (let ((a0-16 arg1)) (set! (-> a0-16 color) (font-color #7efbfb)) @@ -2803,10 +2803,10 @@ (set! (-> arg1 origin x) 75.0) (set! (-> arg1 origin y) 80.0) (let ((v1-8 arg1)) - (set! (-> v1-8 width) (the float (the-as float #x168))) + (set! (-> v1-8 width) (the float 360)) ) (let ((v1-9 arg1)) - (set! (-> v1-9 height) (the float (the-as float #x50))) + (set! (-> v1-9 height) (the float 80)) ) (let ((s4-0 410)) (case (-> arg0 current) @@ -2824,7 +2824,7 @@ ) (set! (-> arg1 origin y) (+ 80.0 (-> arg1 origin y))) (let ((v1-17 arg1)) - (set! (-> v1-17 height) (the float (the-as float #x32))) + (set! (-> v1-17 height) (the float 50)) ) (let ((s4-1 print-game-text)) (format @@ -2839,7 +2839,7 @@ ) (set! (-> arg1 origin y) (+ 55.0 (-> arg1 origin y))) (let ((v1-22 arg1)) - (set! (-> v1-22 height) (the float (the-as float #x5a))) + (set! (-> v1-22 height) (the float 90)) ) (cond ((and (!= (-> *progress-state* starting-state) 'insufficient-space) @@ -2893,10 +2893,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 130.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x3c))) + (set! (-> v1-7 height) (the float 60)) ) (let ((s5-0 409)) (progress-method-28 arg0 'select-save) @@ -2907,7 +2907,7 @@ ) (set! (-> arg1 origin y) (+ 140.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x1e))) + (set! (-> v1-13 height) (the float 30)) ) (let ((s5-1 arg1)) (set! (-> s5-1 color) (the-as font-color (progress-selected 0))) @@ -2938,10 +2938,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 130.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x5f))) + (set! (-> v1-7 height) (the float 95)) ) (let ((s5-0 print-game-text)) (format @@ -2953,7 +2953,7 @@ ) (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x3c))) + (set! (-> v1-10 height) (the float 60)) ) (let ((s5-1 arg1)) (set! (-> s5-1 color) (the-as font-color (progress-selected 0))) @@ -2984,10 +2984,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 100.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x2d))) + (set! (-> v1-7 height) (the float 45)) ) (let ((s5-0 425)) (case (-> arg0 current) @@ -3008,7 +3008,7 @@ ) (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) (let ((v1-16 arg1)) - (set! (-> v1-16 height) (the float (the-as float #x69))) + (set! (-> v1-16 height) (the float 105)) ) (let ((s5-1 print-game-text)) (format @@ -3020,7 +3020,7 @@ ) (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) (let ((v1-19 arg1)) - (set! (-> v1-19 height) (the float (the-as float #x2d))) + (set! (-> v1-19 height) (the float 45)) ) (let ((s5-2 arg1)) (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) @@ -3051,10 +3051,10 @@ (set! (-> arg1 origin x) 77.0) (set! (-> arg1 origin y) 85.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x19))) + (set! (-> v1-7 height) (the float 25)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-error-while-saving) #f) @@ -3065,7 +3065,7 @@ ) (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x3c))) + (set! (-> v1-10 height) (the float 60)) ) (let ((s5-1 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-check) #f) 1) @@ -3073,7 +3073,7 @@ ) (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x2d))) + (set! (-> v1-13 height) (the float 45)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-disabled) #f) @@ -3084,7 +3084,7 @@ ) (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) (let ((v1-16 arg1)) - (set! (-> v1-16 height) (the float (the-as float #x5f))) + (set! (-> v1-16 height) (the float 95)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-reenabling-info) #f) @@ -3095,7 +3095,7 @@ ) (set! (-> arg1 origin y) (+ 90.0 (-> arg1 origin y))) (let ((v1-19 arg1)) - (set! (-> v1-19 height) (the float (the-as float #x19))) + (set! (-> v1-19 height) (the float 25)) ) (let ((s5-4 arg1)) (set! (-> s5-4 color) (the-as font-color (progress-selected 0))) @@ -3126,10 +3126,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 80.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x46))) + (set! (-> v1-7 height) (the float 70)) ) (let ((s5-0 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-was-removed) #f) 1) @@ -3145,7 +3145,7 @@ ) (set! (-> arg1 origin y) (+ 65.0 (-> arg1 origin y))) (let ((v1-12 arg1)) - (set! (-> v1-12 height) (the float (the-as float #x5a))) + (set! (-> v1-12 height) (the float 90)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-reenabling-info) #f) @@ -3156,7 +3156,7 @@ ) (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) (let ((v1-15 arg1)) - (set! (-> v1-15 height) (the float (the-as float #x23))) + (set! (-> v1-15 height) (the float 35)) ) (let ((s5-3 arg1)) (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) @@ -3187,10 +3187,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 120.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x23))) + (set! (-> v1-7 height) (the float 35)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-removed-notice) #f) @@ -3201,7 +3201,7 @@ ) (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x55))) + (set! (-> v1-10 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-removed-prompt) #f) @@ -3213,7 +3213,7 @@ (when (is-cd-in?) (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) (let ((v1-14 arg1)) - (set! (-> v1-14 height) (the float (the-as float #x32))) + (set! (-> v1-14 height) (the float 50)) ) (let ((s5-2 arg1)) (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) @@ -3245,10 +3245,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 120.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x23))) + (set! (-> v1-7 height) (the float 35)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-read-error) #f) @@ -3259,7 +3259,7 @@ ) (set! (-> arg1 origin y) (+ 55.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x55))) + (set! (-> v1-10 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-read-error-prompt) #f) @@ -3270,7 +3270,7 @@ ) (set! (-> arg1 origin y) (+ 105.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x32))) + (set! (-> v1-13 height) (the float 50)) ) (let ((s5-2 arg1)) (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) @@ -3332,10 +3332,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 80.0) (let ((v1-27 arg1)) - (set! (-> v1-27 width) (the float (the-as float #x14a))) + (set! (-> v1-27 width) (the float 330)) ) (let ((v1-28 arg1)) - (set! (-> v1-28 height) (the float (the-as float #x55))) + (set! (-> v1-28 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-explanation) #f) @@ -3346,7 +3346,7 @@ ) (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) (let ((v1-31 arg1)) - (set! (-> v1-31 height) (the float (the-as float #x5f))) + (set! (-> v1-31 height) (the float 95)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-dont-remove) #f) @@ -3357,7 +3357,7 @@ ) (set! (-> arg1 origin y) (+ 90.0 (-> arg1 origin y))) (let ((v1-34 arg1)) - (set! (-> v1-34 height) (the float (the-as float #x32))) + (set! (-> v1-34 height) (the float 50)) ) (let ((s5-3 arg1)) (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) @@ -3388,10 +3388,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 80.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x55))) + (set! (-> v1-7 height) (the float 85)) ) (let ((s4-0 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-unformatted) #f) 1) @@ -3399,7 +3399,7 @@ ) (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x55))) + (set! (-> v1-10 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-formatting-required-notice) #f) @@ -3410,7 +3410,7 @@ ) (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x19))) + (set! (-> v1-13 height) (the float 25)) ) (draw-highlight (the int (-> arg1 origin y)) 44 (-> arg1 alpha)) (print-game-text @@ -3440,10 +3440,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 120.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x55))) + (set! (-> v1-7 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-overwrite-warning) #f) @@ -3454,7 +3454,7 @@ ) (set! (-> arg1 origin y) (+ 105.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x2d))) + (set! (-> v1-10 height) (the float 45)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-overwrite-confirm) #f) @@ -3484,10 +3484,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 110.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x5a))) + (set! (-> v1-7 height) (the float 90)) ) (let ((s4-0 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-no-jak2-found) #f) 1) @@ -3495,7 +3495,7 @@ ) (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x3c))) + (set! (-> v1-10 height) (the float 60)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-create-jak2-file?) #f) @@ -3525,10 +3525,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 85.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x2d))) + (set! (-> v1-7 height) (the float 45)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-60hz-change-notice) #f) @@ -3539,7 +3539,7 @@ ) (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x5f))) + (set! (-> v1-10 height) (the float 95)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-1) #f) @@ -3550,7 +3550,7 @@ ) (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x37))) + (set! (-> v1-13 height) (the float 55)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-2) #f) @@ -3561,7 +3561,7 @@ ) (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) (let ((v1-16 arg1)) - (set! (-> v1-16 height) (the float (the-as float #x1e))) + (set! (-> v1-16 height) (the float 30)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) @@ -3591,10 +3591,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 130.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x32))) + (set! (-> v1-7 height) (the float 50)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-60hz-change-complete) #f) @@ -3605,7 +3605,7 @@ ) (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x32))) + (set! (-> v1-10 height) (the float 50)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-mode-revert?) #f) @@ -3635,10 +3635,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 75.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x32))) + (set! (-> v1-7 height) (the float 50)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-change-notice) #f) @@ -3649,7 +3649,7 @@ ) (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x5a))) + (set! (-> v1-10 height) (the float 90)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-1) #f) @@ -3660,7 +3660,7 @@ ) (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x4b))) + (set! (-> v1-13 height) (the float 75)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-2) #f) @@ -3671,7 +3671,7 @@ ) (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) (let ((v1-16 arg1)) - (set! (-> v1-16 height) (the float (the-as float #x1e))) + (set! (-> v1-16 height) (the float 30)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) @@ -3701,10 +3701,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 90.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x50))) + (set! (-> v1-7 height) (the float 80)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-change-complete) #f) @@ -3715,7 +3715,7 @@ ) (set! (-> arg1 origin y) (+ 100.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x4b))) + (set! (-> v1-10 height) (the float 75)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-mode-revert?) #f) @@ -3745,10 +3745,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 160.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x46))) + (set! (-> v1-7 height) (the float 70)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-quit-game-confirm) #f) @@ -3797,10 +3797,10 @@ ) (set! (-> arg1 origin y) 100.0) (let ((v1-9 arg1)) - (set! (-> v1-9 width) (the float (the-as float #x159))) + (set! (-> v1-9 width) (the float 345)) ) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #xd2))) + (set! (-> v1-10 height) (the float 210)) ) (let* ((v1-11 (-> arg0 current)) (a3-1 (cond @@ -3980,10 +3980,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 100.0) (let ((v1-14 arg1)) - (set! (-> v1-14 width) (the float (the-as float #x14f))) + (set! (-> v1-14 width) (the float 335)) ) (let ((v1-15 arg1)) - (set! (-> v1-15 height) (the float (the-as float #xd2))) + (set! (-> v1-15 height) (the float 210)) ) (let ((a1-9 arg1)) (set! (-> a1-9 color) (font-color #7efbfb)) @@ -4764,13 +4764,13 @@ (case (get-aspect-ratio) (('aspect4x3) (let ((v1-68 arg1)) - (set! (-> v1-68 height) (the float (the-as float #xb9))) + (set! (-> v1-68 height) (the float 185)) ) (set! (-> arg1 origin y) 133.0) ) (('aspect16x9) (let ((v1-72 arg1)) - (set! (-> v1-72 height) (the float (the-as float #xb9))) + (set! (-> v1-72 height) (the float 185)) ) (set! (-> arg1 origin y) 133.0) ) @@ -5767,7 +5767,7 @@ (set! (-> sv-140 origin y) (+ 46.0 (-> sv-140 origin y))) (set! (-> sv-140 origin x) 65.0) (let ((v1-46 sv-140)) - (set! (-> v1-46 width) (the float (the-as float #x16f))) + (set! (-> v1-46 width) (the float 367)) ) (let ((a0-23 sv-140)) (set! (-> a0-23 flags) (font-flags kerning large)) diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index 6a7d1765e9..8a56eff500 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -1338,10 +1338,10 @@ (set! (-> sv-144 origin x) 79.0) (set! (-> sv-144 origin y) (the float sv-148)) (let ((v1-29 sv-144)) - (set! (-> v1-29 width) (the float (the-as float #x163))) + (set! (-> v1-29 width) (the float 355)) ) (let ((v1-30 sv-144)) - (set! (-> v1-30 height) (the float (the-as float #x1e))) + (set! (-> v1-30 height) (the float 30)) ) (set! (-> sv-144 flags) (if (= (-> *setting-control* user-default language) (language-enum japanese)) (font-flags middle left large) diff --git a/goal_src/jak2/levels/common/warp-gate.gc b/goal_src/jak2/levels/common/warp-gate.gc index 36209ea486..316a5c0ef5 100644 --- a/goal_src/jak2/levels/common/warp-gate.gc +++ b/goal_src/jak2/levels/common/warp-gate.gc @@ -587,10 +587,10 @@ ) ) (let ((v1-51 gp-0)) - (set! (-> v1-51 width) (the float (the-as float #x154))) + (set! (-> v1-51 width) (the float 340)) ) (let ((v1-52 gp-0)) - (set! (-> v1-52 height) (the float (the-as float #x50))) + (set! (-> v1-52 height) (the float 80)) ) (let ((v1-53 gp-0)) (set! (-> v1-53 scale) 0.9) diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index e9be0d2c5f..0baa0e42b4 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -230,10 +230,10 @@ ) (set! (-> s5-1 flags) (font-flags shadow kerning left large)) (let ((v1-4 s5-1)) - (set! (-> v1-4 width) (the float (the-as float #x1b8))) + (set! (-> v1-4 width) (the float 440)) ) (let ((v1-5 s5-1)) - (set! (-> v1-5 height) (the float (the-as float #x50))) + (set! (-> v1-5 height) (the float 80)) ) (let ((v1-6 s5-1)) (set! (-> v1-6 scale) 0.7) diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc index 5aa99bec64..5fc5ae134e 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc @@ -319,10 +319,10 @@ ) ) (let ((v1-14 gp-0)) - (set! (-> v1-14 width) (the float (the-as float #x1b8))) + (set! (-> v1-14 width) (the float 440)) ) (let ((v1-15 gp-0)) - (set! (-> v1-15 height) (the float (the-as float #x8c))) + (set! (-> v1-15 height) (the float 140)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) (if (logtest? (-> obj message flags) 32) diff --git a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc new file mode 100644 index 0000000000..9b1344f3b7 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc @@ -0,0 +1,3382 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-health collectables 3 5 + ((4 (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 6 + ) + +;; failed to figure out what this is: +(defskelgroup skel-gem collectables 6 9 + ((7 (meters 20)) (8 (meters 999999))) + :bounds (static-spherem 0 0 0 0.6) + :texture-level 6 + ) + +;; failed to figure out what this is: +(defskelgroup skel-gun-yellow-up yellow-barrel 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-gun-dark-up dark-barrel 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-skill collectables 17 22 + ((18 (meters 20)) (19 (meters 40)) (20 (meters 999999))) + :bounds (static-spherem 0 0 0 0.6) + :shadow 21 + :texture-level 6 + :shadow-joint-index 0 + ) + +;; definition of type collectable +(deftype collectable (process-drawable) + ((root-override2 collide-shape-moving :offset 128) + (pickup-type pickup-type :offset-assert 200) + (pickup-amount float :offset-assert 204) + (notify handle :offset-assert 208) + (old-base vector :inline :offset-assert 224) + (base vector :inline :offset-assert 240) + (extra-trans vector :inline :offset-assert 256) + (jump-pos vector :inline :offset-assert 272) + (flags collectable-flag :offset-assert 288) + (birth-time seconds :offset-assert 296) + (collect-timeout seconds :offset-assert 304) + (fadeout-timeout seconds :offset-assert 312) + (bob-offset seconds :offset-assert 320) + (bob-amount float :offset-assert 328) + (pickup-handle handle :offset-assert 336) + (actor-pause symbol :offset-assert 344) + (collect-effect basic :offset-assert 348) + (collect-effect2 basic :offset-assert 352) + (target handle :offset-assert 360) + (suck-time seconds :offset-assert 368) + (suck-y-offset float :offset-assert 376) + (speed vector :inline :offset-assert 384) + (movie-pos-index int32 :offset-assert 400) + ) + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + (:methods + (blocked () _type_ :state 20) + (wait () _type_ :state 21) + (deploy () _type_ :state 22) + (suck (handle) _type_ :state 23) + (jump () _type_ :state 24) + (fade () _type_ :state 25) + (pickup (symbol handle) _type_ :state 26) + (die () _type_ :state 27) + (notice-blue (handle) _type_ :state 28) + (init-common (_type_ entity-actor pickup-type float) none 29) + (initialize-effects (_type_ pickup-type) none 30) + (go-to-initial-state (_type_) none 31) + (initialize-options (_type_ int float fact-info) collectable 32) + (initialize-allocations (_type_) none 33) + (common-post (_type_) none 34) + (do-pickup (_type_ handle) none 35) + ) + ) + +;; definition for method 3 of type collectable +(defmethod inspect collectable ((obj collectable)) + (when (not obj) + (set! obj obj) + (goto cfg-20) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tpickup-type: ~D~%" (-> obj pickup-type)) + (format #t "~2Tpickup-amount: ~f~%" (-> obj pickup-amount)) + (format #t "~2Tnotify: ~D~%" (-> obj notify)) + (format #t "~2Told-base: ~`vector`P~%" (-> obj old-base)) + (format #t "~2Tbase: ~`vector`P~%" (-> obj base)) + (format #t "~2Textra-trans: ~`vector`P~%" (-> obj extra-trans)) + (format #t "~2Tjump-pos: ~`vector`P~%" (-> obj jump-pos)) + (format #t "~2Tflags: #x~X : (collectable-flag " (-> obj flags)) + (let ((s5-0 (-> obj flags))) + (if (= (logand s5-0 (collectable-flag no-eco-blue)) (collectable-flag no-eco-blue)) + (format #t "no-eco-blue ") + ) + (if (= (logand s5-0 (collectable-flag suck-in)) (collectable-flag suck-in)) + (format #t "suck-in ") + ) + (if (= (logand s5-0 (collectable-flag bounce)) (collectable-flag bounce)) + (format #t "bounce ") + ) + (if (= (logand s5-0 (collectable-flag no-distance-check-fadeout)) (collectable-flag no-distance-check-fadeout)) + (format #t "no-distance-check-fadeout ") + ) + (if (= (logand s5-0 (collectable-flag fadeout)) (collectable-flag fadeout)) + (format #t "fadeout ") + ) + (if (= (logand s5-0 (collectable-flag no-bob)) (collectable-flag no-bob)) + (format #t "no-bob ") + ) + (if (= (logand s5-0 (collectable-flag do-fadeout)) (collectable-flag do-fadeout)) + (format #t "do-fadeout ") + ) + (if (= (logand s5-0 (collectable-flag pickup)) (collectable-flag pickup)) + (format #t "pickup ") + ) + ) + (format #t ")~%") + (format #t "~2Tbirth-time: ~D~%" (-> obj birth-time)) + (format #t "~2Tcollect-timeout: ~D~%" (-> obj collect-timeout)) + (format #t "~2Tfadeout-timeout: ~D~%" (-> obj fadeout-timeout)) + (format #t "~2Tbob-offset: ~D~%" (-> obj bob-offset)) + (format #t "~2Tbob-amount: ~f~%" (-> obj bob-amount)) + (format #t "~2Tpickup-handle: ~D~%" (-> obj pickup-handle)) + (format #t "~2Tactor-pause: ~A~%" (-> obj actor-pause)) + (format #t "~2Tcollect-effect: ~A~%" (-> obj collect-effect)) + (format #t "~2Tcollect-effect2: ~A~%" (-> obj collect-effect2)) + (format #t "~2Ttarget: ~D~%" (-> obj target)) + (format #t "~2Tsuck-time: ~D~%" (-> obj suck-time)) + (format #t "~2Tsuck-y-offset: ~f~%" (-> obj suck-y-offset)) + (format #t "~2Tspeed: ~`vector`P~%" (-> obj speed)) + (format #t "~2Tmovie-pos-index: ~D~%" (-> obj movie-pos-index)) + (label cfg-20) + obj + ) + +;; definition for method 31 of type collectable +;; WARN: Return type mismatch object vs none. +(defmethod go-to-initial-state collectable ((obj collectable)) + (cond + ((logtest? (-> obj fact options) (actor-option wait-for-task-complete)) + (go (method-of-object obj blocked)) + ) + ((logtest? (-> obj flags) (collectable-flag bounce)) + (go (method-of-object obj deploy)) + ) + (else + (go (method-of-object obj wait)) + ) + ) + (none) + ) + +;; definition for method 32 of type collectable +;; INFO: Used lq/sq +(defmethod initialize-options collectable ((obj collectable) (arg0 int) (arg1 float) (arg2 fact-info)) + (with-pp + (logclear! (-> obj mask) (process-mask crate enemy platform ambient)) + (set! (-> obj mask) (logior (process-mask bit18) (-> obj mask))) + (set! (-> obj flags) (collectable-flag pickup no-eco-blue)) + (set! (-> obj bob-amount) arg1) + (set! (-> obj bob-offset) (the-as seconds (+ (the-as int (-> obj root-override2 trans x)) + (the-as int (-> obj root-override2 trans y)) + (the-as int (-> obj root-override2 trans z)) + ) + ) + ) + (cond + ((or (= (vector-length (-> obj root-override2 transv)) 0.0) + (logtest? (-> obj fact options) (actor-option auto-pickup)) + ) + (vector-reset! (-> obj root-override2 transv)) + ) + (else + (logior! (-> obj flags) (collectable-flag bounce)) + (logclear! (-> obj flags) (collectable-flag pickup)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj bob-amount) 0.0) + ) + ) + (when (> arg0 0) + (logior! (-> obj flags) (collectable-flag fadeout)) + (set! (-> obj fadeout-timeout) (the-as seconds arg0)) + (if (logtest? (actor-option no-distance-check-fadeout) (-> arg2 options)) + (logior! (-> obj flags) (collectable-flag no-distance-check-fadeout)) + ) + ) + (set! (-> obj collect-timeout) (the-as seconds 99)) + (set! (-> obj birth-time) (-> pp clock frame-counter)) + (set! (-> obj base quad) (-> obj root-override2 trans quad)) + (set! (-> obj old-base quad) (-> obj root-override2 trans quad)) + (set! (-> obj pickup-handle) (the-as handle #f)) + (case (-> obj fact pickup-type) + (((pickup-type eco-pill-green) + (pickup-type eco-pill-dark) + (pickup-type eco-green) + (pickup-type money) + (pickup-type gem) + (pickup-type skill) + (pickup-type eco-blue) + (pickup-type health) + (pickup-type trick-point) + ) + (logclear! (-> obj flags) (collectable-flag no-eco-blue)) + ) + ) + (if (logtest? (-> obj fact options) (actor-option big-collision)) + (set! (-> obj root-override2 root-prim local-sphere w) + (* 2.5 (-> obj root-override2 root-prim local-sphere w)) + ) + ) + (when (and arg2 (nonzero? (-> obj draw))) + (let* ((s5-0 (-> arg2 process)) + (v1-56 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (if v1-56 + (set! (-> obj draw light-index) (-> (the-as process-drawable v1-56) draw light-index)) + ) + ) + ) + obj + ) + ) + +;; definition for method 33 of type collectable +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations collectable ((obj collectable)) + (stack-size-set! (-> obj main-thread) 128) + (logior! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #t) + (set! (-> obj notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-11 local-sphere) 0.0 3276.8 0.0 3276.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-11) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + 0 + (none) + ) + +;; definition for method 30 of type collectable +;; WARN: Return type mismatch ambient-sound vs none. +(defmethod initialize-effects collectable ((obj collectable) (arg0 pickup-type)) + (let ((s5-0 (the-as sparticle-launch-group #f)) + (s4-0 (the-as sound-spec #f)) + ) + (set! (-> obj fact pickup-type) arg0) + (case (-> obj fact pickup-type) + (((pickup-type eco-blue) + (pickup-type eco-red) + (pickup-type eco-green) + (pickup-type eco-yellow) + (pickup-type health) + (pickup-type eco-pill-dark) + (pickup-type trick-point) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + ) + ) + (case arg0 + (((pickup-type eco-yellow)) + (set! s5-0 (-> *part-group-id-table* 108)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 115)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 109)) + (set! s4-0 (static-sound-spec "yel-eco-idle" :fo-max 15)) + ) + (((pickup-type eco-red)) + (set! s5-0 (-> *part-group-id-table* 102)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 116)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 103)) + (set! s4-0 (static-sound-spec "red-eco-idle" :fo-max 15)) + ) + (((pickup-type eco-blue)) + (set! s5-0 (-> *part-group-id-table* 98)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 114)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 99)) + (set! s4-0 (static-sound-spec "blue-eco-idle" :fo-max 15)) + ) + (((pickup-type eco-green)) + (set! s5-0 (-> *part-group-id-table* 83)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 93)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 79)) + (set! s4-0 (static-sound-spec "green-eco-idle" :fo-max 15)) + ) + (((pickup-type health)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-health" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-37 (-> (the-as collide-shape (-> obj root-override2)) root-prim local-sphere))) + (set! (-> v1-37 y) 2457.6) + (set! (-> v1-37 w) 4096.0) + ) + (set! (-> obj collect-effect) (-> *part-group-id-table* 93)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 79)) + (set! s4-0 (static-sound-spec "green-eco-idle" :fo-max 15)) + ) + (((pickup-type eco-pill-green)) + (set! s5-0 (-> *part-group-id-table* 80)) + (set! (-> obj collect-effect2) (-> *part-group-id-table* 81)) + ) + (((pickup-type eco-pill-dark)) + (set! s5-0 (-> *part-group-id-table* 82)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 92)) + ) + ) + (if s5-0 + (set! (-> obj part) (create-launch-control s5-0 obj)) + ) + (if s4-0 + (set! (-> obj sound) (new 'process 'ambient-sound s4-0 (-> obj root-override2 trans))) + ) + ) + (none) + ) + +;; definition for function initialize-eco-by-other +;; INFO: Used lq/sq +(defbehavior initialize-eco-by-other eco ((arg0 vector) (arg1 vector) (arg2 fact-info)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (case (-> self fact pickup-type) + (((pickup-type eco-blue) (pickup-type eco-yellow) (pickup-type eco-red)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 0 + ) + 1024.0 + arg2 + ) + ) + (else + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 4500 + ) + 1024.0 + arg2 + ) + ) + ) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +;; definition for method 29 of type collectable +;; INFO: Used lq/sq +(defmethod init-common collectable ((obj collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> obj pickup-amount) arg2) + (set! (-> obj pickup-type) arg1) + (initialize-allocations obj) + (set! (-> obj root-override2 trans quad) (-> arg0 extra trans quad)) + (initialize-effects obj (-> obj fact pickup-type)) + (initialize-options obj 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> obj root-override2)) + (if (logtest? (-> obj fact options) (actor-option wait-for-task-complete)) + (go (method-of-object obj blocked)) + ) + (go-to-initial-state obj) + (none) + ) + +;; definition for method 34 of type collectable +;; WARN: Return type mismatch int vs none. +(defmethod common-post collectable ((obj collectable)) + (let ((s5-0 (-> obj part)) + (s4-0 (-> obj root-override2 root-prim prim-core)) + ) + (if (nonzero? (-> obj draw)) + (ja-post) + ) + (if (nonzero? s5-0) + (spawn s5-0 (the-as vector s4-0)) + ) + ) + (if (nonzero? (-> obj sound)) + (update! (-> obj sound)) + ) + 0 + (none) + ) + +;; definition for method 35 of type collectable +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod do-pickup collectable ((obj collectable) (arg0 handle)) + (set! (-> obj pickup-handle) arg0) + (logclear! (-> obj mask) (process-mask actor-pause)) + (let ((v1-3 (-> obj root-override2 root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (if (nonzero? (-> obj sound)) + (stop! (-> obj sound)) + ) + (if (nonzero? (-> obj draw)) + (logior! (-> obj draw status) (draw-control-status no-draw)) + ) + (if (nonzero? (-> obj part)) + (kill-and-free-particles (-> obj part)) + ) + (case (-> obj fact pickup-type) + (((pickup-type eco-yellow)) + (sound-play "y-eco-pickup") + ) + (((pickup-type eco-red)) + (sound-play "r-eco-pickup") + ) + (((pickup-type eco-blue)) + (sound-play "b-eco-pickup") + ) + (((pickup-type eco-green) (pickup-type health)) + (sound-play "g-eco-pickup") + ) + (((pickup-type eco-pill-green)) + (sound-play "pill-pickup") + ) + (((pickup-type eco-pill-dark)) + (sound-play "pill-pickup") + (when (>= (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) + (set! (-> obj collect-effect) (the-as basic 0)) + (set! (-> obj collect-effect2) (the-as basic 0)) + 0 + ) + ) + (((pickup-type fuel-cell)) + (sound-play "pu-powercell") + ) + (((pickup-type ammo-yellow) + (pickup-type ammo-red) + (pickup-type ammo-blue) + (pickup-type ammo-dark) + (pickup-type gun-red) + (pickup-type gun-yellow) + (pickup-type gun-blue) + (pickup-type gun-dark) + (pickup-type board) + ) + (sound-play "ammo-pickup") + ) + (((pickup-type skill)) + (talker-spawn-func (-> *talker-speech* 16) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (let ((s4-9 (handle->process arg0))) + (when (nonzero? (-> obj collect-effect)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-1 + (let ((t9-21 (method-of-type part-tracker activate))) + (t9-21 (the-as part-tracker s5-1) s4-9 (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-22 run-function-in-process) + (a0-60 s5-1) + (a1-26 part-tracker-init) + (a2-11 (-> obj collect-effect)) + (a3-10 0) + (t0-8 part-tracker-track-target) + (t1-8 #f) + (t2-8 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> obj root-override2 root-prim prim-core world-sphere quad)) + ((the-as (function object object object object object object object object none) t9-22) + a0-60 + a1-26 + a2-11 + a3-10 + t0-8 + t1-8 + t2-8 + t3-0 + ) + ) + (-> s5-1 ppointer) + ) + ) + ) + ) + (when (nonzero? (-> obj collect-effect2)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-2 + (let ((t9-24 (method-of-type part-tracker activate))) + (t9-24 (the-as part-tracker s5-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-25 run-function-in-process) + (a0-63 s5-2) + (a1-29 part-tracker-init) + (a2-16 (-> obj collect-effect2)) + (a3-12 0) + (t0-9 + (lambda ((arg0 part-tracker)) + (with-pp + (let ((v1-1 (handle->process (-> arg0 userdata)))) + (when (the-as process v1-1) + (let* ((s5-0 (handle->process (-> (the-as collectable v1-1) pickup-handle))) + (a0-9 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (a2-0 (if (not a0-9) + (-> arg0 root trans) + (get-trans (the-as process-focusable a0-9) 3) + ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (/ (the float (- (-> pp clock frame-counter) (-> arg0 start-time))) (the float (-> arg0 part group duration))) + ) + ) + ) + ) + ) + ) + ) + (t1-13 (process->handle obj)) + (t2-9 #f) + (t3-1 *launch-matrix*) + ) + (set! (-> t3-1 trans quad) (-> obj root-override2 root-prim prim-core world-sphere quad)) + ((the-as (function object object object object object object object object none) t9-25) + a0-63 + a1-29 + a2-16 + a3-12 + t0-9 + t1-13 + t2-9 + t3-1 + ) + ) + (-> s5-2 ppointer) + ) + ) + ) + (send-event (handle->process (-> obj notify)) 'notify 'pickup) + 0 + (none) + ) + +;; definition for function add-blue-shake +(defun add-blue-shake ((arg0 vector) (arg1 vector) (arg2 vector)) + (let* ((f0-0 (vector-vector-distance arg1 arg2)) + (f30-0 (lerp-scale 409.6 0.0 f0-0 (-> *FACT-bank* suck-suck-dist) (-> *FACT-bank* suck-bounce-dist))) + ) + (+! (-> arg0 x) (rand-vu-float-range (- f30-0) f30-0)) + (+! (-> arg0 y) (rand-vu-float-range (- f30-0) f30-0)) + (+! (-> arg0 z) (rand-vu-float-range (- f30-0) f30-0)) + ) + arg0 + ) + +;; definition for function check-blue-suck +(defbehavior check-blue-suck eco ((arg0 process-drawable)) + (let ((v1-0 (if (type? arg0 process-drawable) + arg0 + ) + ) + ) + (when v1-0 + (let* ((gp-1 (-> v1-0 root)) + (v1-1 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (when v1-1 + (let ((a0-5 (-> self root-override2 root-prim prim-core)) + (a1-2 (-> (the-as collide-shape v1-1) root-prim prim-core)) + ) + (when (< (vector-vector-distance (the-as vector a0-5) (the-as vector a1-2)) (-> *FACT-bank* suck-suck-dist)) + (logior! (-> self flags) (collectable-flag suck-in)) + #t + ) + ) + ) + ) + ) + ) + ) + +;; definition for function add-blue-motion +(defbehavior add-blue-motion eco ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 symbol)) + (let* ((gp-0 (handle->process (-> self target))) + (s2-0 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (when s2-0 + (let ((a0-6 (if (type? s2-0 process-focusable) + (the-as process-focusable s2-0) + ) + ) + ) + (when a0-6 + (let ((s2-1 (-> self root-override2 root-prim prim-core)) + (gp-1 (get-trans a0-6 3)) + ) + (if (and arg1 (rand-vu-percent? 0.25)) + (eco-blue-glow (the-as vector s2-1)) + ) + (let ((f0-0 (vector-vector-distance (the-as vector s2-1) gp-1))) + (cond + ((and arg3 (< f0-0 8192.0)) + (return #t) + ) + ((begin + (set! arg0 + (and (or (not arg2) + (or (< f0-0 (-> *FACT-bank* suck-suck-dist)) (logtest? (-> self flags) (collectable-flag suck-in))) + ) + arg0 + ) + ) + arg0 + ) + (logior! (-> self flags) (collectable-flag suck-in)) + (when (= (-> self speed w) 0.0) + (set! (-> self suck-time) (-> self clock frame-counter)) + (set! (-> self speed x) (rand-vu-float-range 327680.0 819200.0)) + ) + (+! (-> self speed w) (* (lerp-scale + 40960.0 + (-> self speed x) + (the float (- (-> self clock frame-counter) (the-as int (-> self suck-time)))) + 45.0 + 60.0 + ) + (-> self clock seconds-per-frame) + ) + ) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> self base) gp-1))) + (vector-normalize! + s5-2 + (fmax 0.0 (- (vector-length s5-2) (* (-> self speed w) (-> self clock seconds-per-frame)))) + ) + (when (< (vector-length s5-2) 81920.0) + (+! (-> self speed y) (* 72817.78 (-> self clock seconds-per-frame))) + (set! (-> self speed y) (fmin (fmin 291271.12 (-> self speed y)) (-> self speed y))) + (vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (-> self clock seconds-per-frame))) + ) + (set! (-> self suck-y-offset) + (* 2048.0 + (sin (* 873.81335 (the float (mod (- (-> self clock frame-counter) (the-as int (-> self suck-time))) 75)))) + ) + ) + (vector+! (-> self base) gp-1 s5-2) + ) + ) + ((and arg2 (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) + (zero? (logand (-> self flags) (collectable-flag suck-in))) + ) + ) + (go-virtual wait) + ) + (arg1 + (add-blue-shake (-> self root-override2 trans) (the-as vector s2-1) gp-1) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +;; definition for function collectable-standard-event-handler +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 108] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 144] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 179] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 191] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 213] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 256] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 271] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 288] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 309] +(defbehavior collectable-standard-event-handler collectable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-4 none)) + (when (and (or (= arg2 'touch) (= arg2 'attack)) + (and (logtest? (-> self flags) (collectable-flag pickup)) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self collect-timeout)) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event arg0 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (process->handle arg0)) + ) + (the-as object (cond + ((= arg2 'trans) + (set! (-> self root-override2 trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (update-transforms (-> self root-override2)) + (ja-post) + ) + ((= arg2 'jump) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (go-virtual jump) + ) + ((= arg2 'pickup) + (when (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (if (and (> arg1 0) (-> arg3 param 0)) + (move-to-point! (-> self root-override2) (the-as vector (-> arg3 param 0))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (the-as handle #f)) + ) + ) + ((= arg2 'suck) + (when (not (and (-> self next-state) (let ((v1-60 (-> self next-state name))) + (or (= v1-60 'suck) (= v1-60 'pickup)) + ) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual suck (process->handle (the-as process (-> arg3 param 0)))) + ) + ) + ((= arg2 'die) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual die) + ) + ((= arg2 'movie-pos) + (set! v0-4 (the-as none (-> arg3 param 0))) + (set! (-> self movie-pos-index) (the-as int v0-4)) + v0-4 + ) + ((= arg2 'actor-pause) + (cond + ((-> arg3 param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (set! v0-4 (the-as none #t)) + (set! (-> self actor-pause) (the-as symbol v0-4)) + v0-4 + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + ((= arg2 'fade) + (logior! (-> self flags) (collectable-flag fadeout)) + (set! (-> self fadeout-timeout) (the-as seconds 30)) + (set! v0-4 (the-as none (-> self clock frame-counter))) + (set! (-> self birth-time) (the-as time-frame v0-4)) + v0-4 + ) + ((= arg2 'anim) + (cond + ((-> arg3 param 0) + (set! v0-4 (the-as none (logclear (-> self flags) (collectable-flag no-bob)))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + (else + (set! v0-4 (the-as none (logior (-> self flags) (collectable-flag no-bob)))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + ) + v0-4 + ) + ((= arg2 'collide-shape) + (cond + ((-> arg3 param 0) + (let ((v1-97 (-> self root-override2 root-prim))) + (set! (-> v1-97 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! v0-4 (the-as none (-> self root-override2 backup-collide-with))) + (set! (-> v1-97 prim-core collide-with) (the-as collide-spec v0-4)) + ) + v0-4 + ) + (else + (let ((v1-99 (-> self root-override2 root-prim))) + (set! (-> v1-99 prim-core collide-as) (collide-spec)) + (set! (-> v1-99 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + ((= arg2 'get-notify) + (cond + ((= (-> arg3 param 0) #t) + (let ((v1-103 (ppointer->process (-> self parent)))) + (cond + ((logtest? (-> v1-103 mask) (process-mask process-tree)) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (the-as none (process->handle v1-103))) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ) + ((= (-> arg3 param 0) #f) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (the-as none (process->handle (the-as process (-> arg3 param 0))))) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ((= arg2 'effect) + (when (not (-> arg3 param 0)) + (set! (-> self collect-effect) (the-as basic 0)) + (set! (-> self collect-effect2) (the-as basic 0)) + 0 + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate blocked (collectable) + :virtual #t + :trans (behavior () + (if (task-complete? *game-info* (the-as game-task (-> self entity extra perm task))) + (go-virtual wait) + ) + (none) + ) + :code (the-as (function none :behavior collectable) sleep-code) + ) + +;; failed to figure out what this is: +(defstate jump (collectable) + :virtual #t + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((gp-0 (new 'stack 'trajectory))) + (set! (-> self base y) (-> self jump-pos y)) + (setup-from-to-duration! gp-0 (-> self root-override2 trans) (-> self jump-pos) 300.0 -2.2755556) + (set! (-> self state-time) (-> self clock frame-counter)) + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (let ((f0-2 (the float (- (-> self clock frame-counter) (-> self state-time))))) + (compute-trans-at-time gp-0 f0-2 (-> self root-override2 trans)) + ) + (transform-post) + (common-post self) + (suspend) + (if (nonzero? (-> self skel)) + (ja :num! (loop! 0.5)) + ) + ) + ) + (set! (-> self root-override2 trans quad) (-> self jump-pos quad)) + (set! (-> self base quad) (-> self root-override2 trans quad)) + (vector-reset! (-> self root-override2 transv)) + (update-transforms (-> self root-override2)) + (logclear! (-> self flags) (collectable-flag bounce)) + (logior! (-> self flags) (collectable-flag pickup)) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (go-virtual wait) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate deploy (collectable) + :virtual #t + :event collectable-standard-event-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (case (-> self pickup-type) + (((pickup-type gem)) + (sound-play "gem-spawn") + ) + (((pickup-type eco-pill-dark)) + (sound-play "pill-spawn") + ) + ) + (if (and (logtest? (-> self fact options) (actor-option suck-in)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + *target* + (zero? (logand (-> *target* focus-status) (focus-status dead))) + ) + (go-virtual suck (process->handle *target*)) + ) + (none) + ) + :exit (behavior () + (vector-reset! (-> self root-override2 transv)) + (logclear! (-> self flags) (collectable-flag bounce)) + (logior! (-> self flags) (collectable-flag pickup)) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (set! (-> self base quad) (-> self root-override2 trans quad)) + (logclear! (-> self root-override2 root-prim prim-core action) (collide-action solid)) + (set! (-> self root-override2 root-prim prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> self root-override2 root-prim prim-core collide-as) + (collide-spec collectable notice-blue-eco-powerup) + ) + (none) + ) + :trans (behavior () + (vector-v++! + (-> self root-override2 transv) + (compute-acc-due-to-gravity (-> self root-override2) (new-stack-vector0) 0.0) + ) + (integrate-no-collide! (-> self root-override2) (-> self root-override2 transv)) + (when (and (>= 0.0 (-> self root-override2 transv y)) (>= (-> self base y) (-> self root-override2 trans y))) + (set! (-> self root-override2 trans y) (-> self base y)) + (cond + ((< (-> self root-override2 transv y) -8192.0) + (set! (-> self root-override2 transv y) (* -0.5 (-> self root-override2 transv y))) + ) + (else + (if (and (logtest? (-> self fact options) (actor-option suck-in)) + (zero? (logand (-> self flags) (collectable-flag no-eco-blue))) + ) + (go-virtual notice-blue (process->handle *target*)) + ) + (when (and (logtest? (-> self fact options) (actor-option auto-pickup suck-in)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (process-contact-action *target*) + (go-virtual pickup #f (process->handle *target*)) + ) + (go-virtual wait) + ) + ) + ) + (none) + ) + :code (behavior () + (until #f + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate suck (collectable) + :virtual #t + :event collectable-standard-event-handler + :enter (behavior ((arg0 handle)) + (sound-play "pickup-suck") + (set! (-> self target) arg0) + (set! (-> self speed quad) (the-as uint128 0)) + (set! (-> self speed z) (if (rand-vu-percent? 0.5) + 1.0 + -1.0 + ) + ) + (set! (-> self suck-y-offset) 0.0) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self flags) (collectable-flag pickup suck-in)) + (none) + ) + :code (behavior ((arg0 handle)) + (until #f + (set! (-> self root-override2 trans quad) (-> self base quad)) + (add-blue-motion #t #f #f #f) + (update-transforms (-> self root-override2)) + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate wait (collectable) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('eco-blue) + (when (and (not (logtest? (-> self flags) (collectable-flag do-fadeout no-eco-blue))) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (and (if (check-blue-suck (the-as process-drawable proc)) + (go-virtual suck (process->handle proc)) + ) + (logtest? (-> self flags) (collectable-flag pickup)) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self collect-timeout)) + ) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual notice-blue (process->handle proc)) + ) + ) + (else + (collectable-standard-event-handler proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (when (and (logtest? (-> self fact options) (actor-option auto-pickup suck-in)) + (logtest? (-> self flags) (collectable-flag pickup)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (process-contact-action *target*) + (go-virtual pickup #f (process->handle *target*)) + ) + (none) + ) + :code (behavior () + (until #f + (if (and (logtest? (-> self flags) (collectable-flag fadeout)) + (begin + (if (movie?) + (set! (-> self birth-time) (-> self clock frame-counter)) + ) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self fadeout-timeout)) + ) + ) + (or (or (not *target*) + (or (< 204800.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) + (logtest? (focus-status teleporting) (-> *target* focus-status)) + ) + ) + (logtest? (-> self flags) (collectable-flag no-distance-check-fadeout)) + ) + ) + (go-virtual fade) + ) + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate fade (collectable) + :virtual #t + :event collectable-standard-event-handler + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + (logior! (-> self flags) (collectable-flag do-fadeout)) + (logior! (-> self state-flags) (state-flags sf0)) + (let ((gp-0 (-> self clock frame-counter))) + (until #f + (let ((f0-1 (- 300.0 (the float (- (-> self clock frame-counter) gp-0))))) + (cond + ((< f0-1 0.0) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (else + (if (nonzero? (-> self part)) + (set! (-> self part fade) (* 0.0033333334 f0-1)) + ) + (when (nonzero? (-> self draw)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self draw force-fade) (the-as uint (max 0 (min 128 (the int (* 0.42666668 f0-1)))))) + ) + ) + ) + ) + (common-post self) + (suspend) + ) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate notice-blue (collectable) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (when (and (or (= event-type 'touch) (= event-type 'attack)) + (and (logtest? (-> self flags) (collectable-flag pickup)) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self collect-timeout)) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle proc)) + ) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self target) arg0) + (set! (-> self speed quad) (the-as uint128 0)) + (set! (-> self speed z) (if (rand-vu-percent? 0.5) + 1.0 + -1.0 + ) + ) + (set! (-> self suck-y-offset) 0.0) + (logclear! (-> self mask) (process-mask actor-pause)) + (none) + ) + :exit (behavior () + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (none) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'powerup)) + (set! (-> a1-0 param 1) (the-as uint 3)) + (if (and (not (send-event-function *target* a1-0)) (zero? (logand (-> self flags) (collectable-flag suck-in)))) + (go-virtual wait) + ) + ) + (none) + ) + :code (behavior ((arg0 handle)) + (until #f + (set! (-> self root-override2 trans quad) (-> self base quad)) + (add-blue-motion #t #f #t #f) + (update-transforms (-> self root-override2)) + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate pickup (collectable) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('set-movie-pos) + (let ((v1-2 (res-lump-struct (-> self entity) 'movie-pos structure))) + (when v1-2 + (set! (-> (the-as vector v1-2) quad) (-> (the-as vector (-> event param 0)) quad)) + v1-2 + ) + ) + ) + (('actor-pause) + (cond + ((-> event param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v0-1 (the-as object #t))) + (set! (-> self actor-pause) (the-as symbol v0-1)) + v0-1 + ) + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (the-as object (deactivate self)) + ) + (('effect) + (when (not (-> event param 0)) + (set! (-> self collect-effect) (the-as basic 0)) + (set! (-> self collect-effect2) (the-as basic 0)) + 0 + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol) (arg1 handle)) + (do-pickup self arg1) + (none) + ) + :code (behavior ((arg0 symbol) (arg1 handle)) + (while (-> self child) + (suspend) + ) + (go-virtual die) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (collectable) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + (none) + ) + ) + +;; definition of type eco +(deftype eco (collectable) + ((respan-delay seconds :offset-assert 408) + ) + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + +;; definition for method 3 of type eco +(defmethod inspect eco ((obj eco)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 obj) + ) + (format #t "~2Trespawn-delay: ~D~%" (-> obj respan-delay)) + (label cfg-4) + obj + ) + +;; definition for method 33 of type eco +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations eco ((obj eco)) + (let ((t9-0 (method-of-type collectable initialize-allocations))) + (t9-0 obj) + ) + (if (logtest? (-> obj fact options) (actor-option respawn-delay)) + (set! (-> obj respan-delay) (-> obj fact fade-time)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate die (eco) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (the-as object (deactivate self)) + ) + (('die) + (go-virtual die) + ) + ) + ) + ) + :exit (behavior () + (process-entity-status! self (entity-perm-status no-kill) #f) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (none) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status no-kill) #t) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self fact options) (actor-option auto-pickup suck-in)) + (if (nonzero? (-> self part)) + (kill-and-free-particles (-> self part)) + ) + (cond + ((nonzero? (-> self respan-delay)) + (let ((gp-0 (-> self clock frame-counter))) + (while (< (- (-> self clock frame-counter) gp-0) (the-as time-frame (-> self respan-delay))) + (suspend) + ) + ) + ) + (else + (while (let ((f30-0 0.0)) + (< f30-0 (the-as float (send-event *target* 'query 'pickup (-> self fact pickup-type)))) + ) + (suspend) + ) + ) + ) + (set! (-> self base quad) (-> self old-base quad)) + (set! (-> self root-override2 trans quad) (-> self base quad)) + (let ((v1-26 (-> self root-override2 root-prim))) + (set! (-> v1-26 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-26 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (set! (-> self clock) (-> *display* entity-clock)) + (if (nonzero? (-> self draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (go-virtual wait) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate pickup (eco) + :virtual #t + :code (behavior ((arg0 symbol) (arg1 handle)) + (if (not (logtest? (-> self fact options) (actor-option no-reaction))) + (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (let ((t9-2 (-> (the-as state (find-parent-method eco 26)) code))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + (none) + ) + ) + +;; definition of type eco-yellow +(deftype eco-yellow (eco) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + +;; definition for method 3 of type eco-yellow +(defmethod inspect eco-yellow ((obj eco-yellow)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type eco inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type eco-yellow +(defmethod init-from-entity! eco-yellow ((obj eco-yellow) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) + (none) + ) + +;; definition of type eco-red +(deftype eco-red (eco) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + +;; definition for method 3 of type eco-red +(defmethod inspect eco-red ((obj eco-red)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type eco inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type eco-red +(defmethod init-from-entity! eco-red ((obj eco-red) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) + (none) + ) + +;; definition of type eco-blue +(deftype eco-blue (eco) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + +;; definition for method 3 of type eco-blue +(defmethod inspect eco-blue ((obj eco-blue)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type eco inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type eco-blue +(defmethod init-from-entity! eco-blue ((obj eco-blue) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) + (none) + ) + +;; definition of type eco-green +(deftype eco-green (eco) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + +;; definition for method 3 of type eco-green +(defmethod inspect eco-green ((obj eco-green)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type eco inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type eco-green +(defmethod init-from-entity! eco-green ((obj eco-green) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) + (none) + ) + +;; definition of type health +(deftype health (collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + +;; definition for method 3 of type health +(defmethod inspect health ((obj health)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type health +(defmethod init-from-entity! health ((obj health) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) + (none) + ) + +;; definition of type eco-pill +(deftype eco-pill (collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + +;; definition for method 3 of type eco-pill +(defmethod inspect eco-pill ((obj eco-pill)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate wait (eco-pill) + :virtual #t + :trans (behavior () + (if (and (and *target* + (and (>= 32768.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) + (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (and (not (logtest? (-> *target* focus-status) (focus-status dead hit))) + (case (-> self fact pickup-type) + (((pickup-type eco-pill-dark)) + (< (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) + ) + (else + #t + ) + ) + ) + ) + (send-event self 'suck *target*) + ) + (none) + ) + ) + +;; definition for method 11 of type eco-pill +(defmethod init-from-entity! eco-pill ((obj eco-pill) (arg0 entity-actor)) + (init-common obj arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) + (none) + ) + +;; definition for method 10 of type eco-pill +(defmethod deactivate eco-pill ((obj eco-pill)) + (+! (-> *game-info* live-eco-pill-count) -1) + ((method-of-type collectable deactivate) obj) + (none) + ) + +;; definition for method 33 of type eco-pill +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations eco-pill ((obj eco-pill)) + (+! (-> *game-info* live-eco-pill-count) 1) + (stack-size-set! (-> obj main-thread) 128) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #f) + (set! (-> obj notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-13 local-sphere) 0.0 3276.8 0.0 1638.4) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-13) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-16 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + 0 + (none) + ) + +;; definition of type money +(deftype money (collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + +;; definition for method 3 of type money +(defmethod inspect money ((obj money)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 12 of type money +(defmethod run-logic? money ((obj money)) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) + (or (and (nonzero? (-> obj draw)) + (logtest? (-> obj draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override2 pause-adjust-distance)) + (vector-vector-distance (-> obj root-override2 trans) (math-camera-pos)) + ) + ) + (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) + (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status uninited))) + ) + ) + ) + +;; definition for method 10 of type money +(defmethod deactivate money ((obj money)) + (when (and (-> obj next-state) (= (-> obj next-state name) 'pickup)) + (case (-> obj pickup-type) + (((pickup-type gem)) + (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save)))) + (format #t "~A ~A was killed in pickup~%" (-> obj type) (-> obj name)) + ) + (process-entity-status! obj (entity-perm-status dead) #t) + ) + (else + (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status dead)))) + (format #t "~A ~A was killed in pickup~%" (-> obj type) (-> obj name)) + ) + ) + ) + ) + ((method-of-type collectable deactivate) obj) + (none) + ) + +;; definition for method 34 of type money +(defmethod common-post money ((obj money)) + (with-pp + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (* 40049.777 (-> pp clock seconds-per-frame)) + ) + (let ((f30-0 (-> obj bob-amount))) + (when (< 0.0 f30-0) + (set! (-> obj root-override2 trans y) + (+ (-> obj base y) + (-> obj suck-y-offset) + (* f30-0 + (sin + (* 109.22667 + (the float + (mod + (+ (- (-> pp clock frame-counter) (the-as int (-> obj birth-time))) (the-as time-frame (-> obj bob-offset))) + 600 + ) + ) + ) + ) + ) + ) + ) + (update-transforms (-> obj root-override2)) + ) + ) + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate notice-blue (money) + :virtual #t + :code (behavior ((arg0 handle)) + (until #f + (quaternion-rotate-y! + (-> self root-override2 quat) + (-> self root-override2 quat) + (* 91022.22 (-> self clock seconds-per-frame)) + ) + (set! (-> self root-override2 trans quad) (-> self base quad)) + (add-blue-motion #t #t #t #f) + (let ((f30-0 (-> self bob-amount))) + (if (< 0.0 f30-0) + (set! (-> self root-override2 trans y) + (+ (-> self base y) + (-> self suck-y-offset) + (* f30-0 + (sin (* 109.22667 (the float (mod + (+ (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self bob-offset)) + ) + 600 + ) + ) + ) + ) + ) + ) + ) + ) + ) + (transform-post) + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate pickup (money) + :virtual #t + :code (behavior ((arg0 symbol) (arg1 handle)) + (process-entity-status! self (entity-perm-status dead) #t) + (none) + ) + ) + +;; definition for method 33 of type money +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations money ((obj money)) + (stack-size-set! (-> obj main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (logior! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #t) + (set! (-> obj notify) (the-as handle #f)) + (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type money) 1.0)) + (let ((a0-11 (-> obj entity))) + (if (when a0-11 + (let ((a0-12 (-> a0-11 extra perm task))) + (if a0-12 + (zero? a0-12) + ) + ) + ) + (set! (-> obj entity extra perm task) (the-as uint 1)) + ) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (if (-> obj entity) + (nav-mesh-connect-from-ent obj) + ) + (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + 0 + (none) + ) + +;; definition for method 11 of type money +(defmethod init-from-entity! money ((obj money) (arg0 entity-actor)) + (initialize-allocations obj) + (process-drawable-from-entity! obj (-> obj entity)) + (initialize-options obj 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> obj root-override2)) + (go-to-initial-state obj) + (none) + ) + +;; definition for function money-init-by-other +;; INFO: Used lq/sq +(defbehavior money-init-by-other money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (process-entity-set! self arg3) + (set! (-> self pickup-type) s3-0) + (set! (-> self pickup-amount) f30-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (let ((v1-5 (ppointer->process (-> self parent)))) + (set! (-> self notify) (if (logtest? (-> v1-5 mask) (process-mask process-tree)) + (the-as handle #f) + (process->handle v1-5) + ) + ) + ) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root-override2 quat)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 4500 + ) + 1024.0 + arg2 + ) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +;; definition for function money-init-by-other-no-bob +;; INFO: Used lq/sq +(defbehavior money-init-by-other-no-bob money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 float) (arg4 entity-actor)) + (process-entity-set! self arg4) + (set! (-> self pickup-type) (the-as pickup-type arg2)) + (set! (-> self pickup-amount) arg3) + (initialize-allocations self) + (set! (-> self fact pickup-type) (the-as pickup-type arg2)) + (set! (-> self fact pickup-amount) arg3) + (let ((v1-4 (ppointer->process (-> self parent)))) + (set! (-> self notify) (if (logtest? (-> v1-4 mask) (process-mask process-tree)) + (the-as handle #f) + (process->handle v1-4) + ) + ) + ) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root-override2 quat)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-options self 4500 0.0 (the-as fact-info #f)) + (logior! (-> self flags) (collectable-flag no-eco-blue)) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +;; definition of type gem +(deftype gem (money) + ((roty-speed degrees :offset-assert 404) + (bounce-time seconds :offset-assert 408) + ) + :heap-base #x120 + :method-count-assert 36 + :size-assert #x1a0 + :flag-assert #x24012001a0 + ) + +;; definition for method 3 of type gem +(defmethod inspect gem ((obj gem)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type money inspect))) + (t9-0 obj) + ) + (format #t "~2Troty-speed: (deg ~r)~%" (-> obj roty-speed)) + (format #t "~2Tbounce-time: ~D~%" (-> obj bounce-time)) + (label cfg-4) + obj + ) + +;; definition for method 10 of type gem +(defmethod deactivate gem ((obj gem)) + (+! (-> *game-info* live-gem-count) -1) + ((the-as (function gem none) (find-parent-method gem 10)) obj) + (none) + ) + +;; definition for method 34 of type gem +;; WARN: Return type mismatch int vs none. +(defmethod common-post gem ((obj gem)) + (with-pp + (seek! (-> obj roty-speed) 20024.889 (* 65536.0 (-> pp clock seconds-per-frame))) + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (* (-> obj roty-speed) (-> pp clock seconds-per-frame)) + ) + (logclear! (-> obj draw status) (draw-control-status no-draw-temp uninited)) + (do-joint-math (-> obj draw) (-> obj node-list) (-> obj skel)) + (let ((a0-7 (-> obj part)) + (a1-3 (-> obj draw skeleton bones 3)) + ) + (if (nonzero? a0-7) + (spawn-with-matrix a0-7 (the-as matrix a1-3)) + ) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate deploy (gem) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type collectable deploy) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-vector! + (-> self root-override2 transv) + (rand-vu-float-range -20480.0 20480.0) + 81920.0 + (rand-vu-float-range -20480.0 20480.0) + 1.0 + ) + (set-gravity-length (-> self root-override2 dynam) 122880.0) + (set! (-> self roty-speed) 186413.52) + (logior! (-> self flags) (collectable-flag pickup)) + (set! (-> self root-override2 root-prim prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> self root-override2 root-prim prim-core collide-as) (collide-spec collectable)) + (set! (-> self root-override2 max-iteration-count) (the-as uint 2)) + (logior! (-> self root-override2 root-prim prim-core action) (collide-action solid)) + (set! (-> self root-override2 reaction) projectile-bounce-reaction) + (set! (-> self root-override2 penetrated-by) (the-as penetrate -1)) + (none) + ) + :exit (behavior () + (set! (-> self roty-speed) (fmin 262144.0 (-> self roty-speed))) + (set-gravity-length (-> self root-override2 dynam) 245760.0) + (set! (-> self root-override2 root-prim local-sphere w) 6144.0) + (update-transforms (-> self root-override2)) + (let ((t9-2 (-> (method-of-type collectable deploy) exit))) + (if t9-2 + (t9-2) + ) + ) + (none) + ) + :trans (the-as (function none :behavior gem) #f) + :code (the-as (function none :behavior gem) sleep-code) + :post (behavior () + (let ((gp-0 #t)) + (vector-v++! + (-> self root-override2 transv) + (compute-acc-due-to-gravity (-> self root-override2) (new-stack-vector0) 0.0) + ) + (when (-> self entity) + (when (get-simple-travel-vector + (-> self entity) + (-> self root-override2 transv) + (-> self root-override2 trans) + (-> self root-override2 transv) + (* 1.5 (-> self root-override2 root-prim prim-core world-sphere w)) + 0.8 + ) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (f30-0 (-> self root-override2 transv y)) + ) + (project-point-to-nav-mesh + (-> self entity) + s5-1 + (-> self root-override2 trans) + (the-as nav-poly #f) + 40960000.0 + ) + (when (>= (vector-vector-xz-distance s5-1 (-> self root-override2 trans)) 204.8) + (vector-! (-> self root-override2 transv) s5-1 (-> self root-override2 trans)) + (vector-normalize! (-> self root-override2 transv) 40960.0) + (set! (-> self root-override2 transv y) + (if (< 0.0 (-> self root-override2 transv y)) + (+ f30-0 (* 4.0 (-> self clock seconds-per-frame) (-> self root-override2 transv y))) + f30-0 + ) + ) + (set! gp-0 #f) + ) + ) + ) + ) + (cond + (gp-0 + (let ((v1-31 (-> self root-override2)) + (a2-3 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> a2-3 collide-with) (-> v1-31 root-prim prim-core collide-with)) + (set! (-> a2-3 ignore-process0) self) + (set! (-> a2-3 ignore-process1) #f) + (set! (-> a2-3 ignore-pat) (-> v1-31 pat-ignore-mask)) + (set! (-> a2-3 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-31 (-> v1-31 transv) a2-3 (meters 0)) + ) + ) + (else + (integrate-no-collide! (-> self root-override2) (-> self root-override2 transv)) + ) + ) + ) + (let* ((gp-1 (-> self root-override2)) + (s5-2 (-> gp-1 status)) + ) + (cond + ((logtest? s5-2 (collide-status touch-surface)) + (set! (-> gp-1 transv x) (* 0.7 (-> gp-1 transv x))) + (set! (-> gp-1 transv y) (* (-> gp-1 transv y) (rand-vu-float-range 0.7 0.75))) + (set! (-> gp-1 transv z) (* 0.7 (-> gp-1 transv z))) + (set! (-> self roty-speed) + (fmin + 131072.0 + (+ (-> self roty-speed) (lerp-scale 0.0 131072.0 (-> self root-override2 ground-impact-vel) 0.0 122880.0)) + ) + ) + (if (or (and (logtest? s5-2 (collide-status on-surface)) (< (vector-length (-> gp-1 transv)) 1228.8)) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 10)) + ) + (go-virtual wait) + ) + (when (>= (- (-> self clock frame-counter) (the-as int (-> self bounce-time))) (seconds 0.1)) + (set! (-> self bounce-time) (-> self clock frame-counter)) + (sound-play-by-name + (static-sound-name "gem-bounce") + (new-sound-id) + (the int (* 1024.0 (lerp-scale 0.5 1.0 (-> self root-override2 ground-impact-vel) 0.0 40960.0))) + 0 + 0 + (sound-group sfx) + #t + ) + ) + ) + ((>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 15)) + (go-virtual wait) + ) + ) + ) + (seek! (-> self roty-speed) 0.0 (* 16384.0 (-> self clock seconds-per-frame))) + (common-post self) + (none) + ) + ) + +;; definition for method 33 of type gem +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations gem ((obj gem)) + (+! (-> *game-info* live-gem-count) 1) + (stack-size-set! (-> obj main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-11 local-sphere) 0.0 2048.0 0.0 2048.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-11) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (set! (-> obj roty-speed) 40049.777) + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (rand-vu-float-range 0.0 65536.0) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #f) + (set! (-> obj notify) (the-as handle #f)) + (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type gem) 1.0)) + (let ((v1-22 (-> obj entity))) + (if (and (-> obj entity) + (-> v1-22 extra perm task) + (zero? (-> v1-22 extra perm task)) + (type-type? (-> v1-22 etype) crate) + ) + (set! (-> obj entity extra perm task) (the-as uint 1)) + ) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 1.5 1.5 1.5 1.0) + (if (-> obj entity) + (nav-mesh-connect-from-ent obj) + ) + (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 86) obj)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 87)) + 0 + (none) + ) + +;; definition for symbol *collectable-dummy-shadow-control*, type shadow-control +(define *collectable-dummy-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :flags (shadow-flags disable-fade) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 40960.0) + :top-plane (new 'static 'plane :y 1.0 :w -4096.0) + ) + ) + ) + +;; definition of type skill +(deftype skill (money) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + +;; definition for method 3 of type skill +(defmethod inspect skill ((obj skill)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type money inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate wait (skill) + :virtual #t + :code (behavior () + (until #f + (if (and (logtest? (-> self flags) (collectable-flag fadeout)) + (begin + (if (movie?) + (set! (-> self birth-time) (-> self clock frame-counter)) + ) + (>= (- (-> self clock frame-counter) (the-as int (-> self birth-time))) + (the-as time-frame (-> self fadeout-timeout)) + ) + ) + ) + (go-virtual fade) + ) + (common-post self) + (suspend) + ) + #f + (none) + ) + ) + +;; definition for method 33 of type skill +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations skill ((obj skill)) + (stack-size-set! (-> obj main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (logior! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #t) + (set! (-> obj notify) (the-as handle #f)) + (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type skill) 1.0)) + (let ((a0-11 (-> obj entity))) + (if (when a0-11 + (let ((a0-12 (-> a0-11 extra perm task))) + (if a0-12 + (zero? a0-12) + ) + ) + ) + (set! (-> obj entity extra perm task) (the-as uint 1)) + ) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-skill" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw shadow-ctrl) *collectable-dummy-shadow-control*) + (if (-> obj entity) + (nav-mesh-connect-from-ent obj) + ) + (cond + ((>= (-> obj pickup-amount) (-> *FACT-bank* super-skill-inc)) + (set-vector! (-> obj draw color-mult) 0.8 0.8 0.0 1.0) + (set-vector! (-> obj draw color-emissive) 0.0 1.0 0.2 1.0) + ) + (else + (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + ) + ) + 0 + (none) + ) + +;; definition of type fuel-cell +(deftype fuel-cell (process-hidden) + () + :method-count-assert 15 + :size-assert #x80 + :flag-assert #xf00000080 + ) + +;; definition for method 3 of type fuel-cell +(defmethod inspect fuel-cell ((obj fuel-cell)) + (when (not obj) + (set! obj obj) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) + (let ((s5-0 (-> obj 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 "attackable ") + ) + (if (= (logand (process-mask bit18) s5-0) (process-mask bit18)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand (process-mask no-track) s5-0) (process-mask no-track)) + (format #t "no-track ") + ) + (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 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) (shl #x8000 16)) + (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 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~%" (-> obj clock)) + (format #t "~1Tparent: #x~X~%" (-> obj parent)) + (format #t "~1Tbrother: #x~X~%" (-> obj brother)) + (format #t "~1Tchild: #x~X~%" (-> obj child)) + (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) + (format #t "~1Tself: ~A~%" (-> obj self)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tstatus: ~A~%" (-> obj status)) + (format #t "~1Tpid: ~D~%" (-> obj pid)) + (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tstate: ~A~%" (-> obj state)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) + (format #t "~1Theap: #~%" (&-> obj heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (label cfg-68) + obj + ) + +;; definition of type trick-point +(deftype trick-point (collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + +;; definition for method 3 of type trick-point +(defmethod inspect trick-point ((obj trick-point)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type skate-point +(deftype skate-point (trick-point) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x194 + :flag-assert #x2401200194 + ) + +;; definition for method 3 of type skate-point +(defmethod inspect skate-point ((obj skate-point)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type trick-point inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 33 of type trick-point +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations trick-point ((obj trick-point)) + (stack-size-set! (-> obj main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + (logior! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #t) + (set! (-> obj notify) (the-as handle #f)) + (set! (-> obj root-override2 pause-adjust-distance) 204800.0) + (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type trick-point) 100.0)) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 94) obj)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 95)) + 0 + (none) + ) + +;; definition for method 11 of type trick-point +(defmethod init-from-entity! trick-point ((obj trick-point) (arg0 entity-actor)) + (initialize-allocations obj) + (process-drawable-from-entity! obj (-> obj entity)) + (initialize-options obj 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> obj root-override2)) + (go-to-initial-state obj) + (none) + ) + +;; definition of type ammo-collectable +(deftype ammo-collectable (collectable) + ((ammo-effect basic :offset-assert 404) + ) + :heap-base #x120 + :method-count-assert 36 + :size-assert #x198 + :flag-assert #x2401200198 + ) + +;; definition for method 3 of type ammo-collectable +(defmethod inspect ammo-collectable ((obj ammo-collectable)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 obj) + ) + (format #t "~2Tammo-effect: ~A~%" (-> obj ammo-effect)) + (label cfg-4) + obj + ) + +;; definition for method 33 of type ammo-collectable +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations ammo-collectable ((obj ammo-collectable)) + (stack-size-set! (-> obj main-thread) 128) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj actor-pause) #f) + (set! (-> obj notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-10 local-sphere) 0.0 3276.8 0.0 6553.6) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-10) + ) + (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! (-> obj root-override2) s5-0) + ) + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (rand-vu-float-range 0.0 65536.0) + ) + (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + (case (-> obj pickup-type) + (((pickup-type ammo-yellow)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 88)) + ) + (((pickup-type ammo-red)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 89)) + ) + (((pickup-type ammo-blue)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 90)) + ) + (((pickup-type ammo-dark)) + (set! (-> obj collect-effect) (-> *part-group-id-table* 91)) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type ammo-collectable +;; WARN: Return type mismatch object vs none. +(defmethod initialize-effects ammo-collectable ((obj ammo-collectable) (arg0 pickup-type)) + (set! (-> obj fact pickup-type) arg0) + (case arg0 + (((pickup-type ammo-yellow)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 2.5 2.5 2.5 1.0) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 108)) + ) + (((pickup-type ammo-red)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 4.0 4.0 4.0 1.0) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 102)) + ) + (((pickup-type ammo-blue)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 4.0 4.0 4.0 1.0) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 98)) + ) + (((pickup-type ammo-dark)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 3.0 3.0 3.0 1.0) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 83)) + ) + (((pickup-type gun-yellow)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-yellow-up" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 3.0 3.0 3.0 1.0) + (logclear! (-> obj flags) (collectable-flag fadeout)) + (let ((v1-34 (-> obj node-list data))) + (set! (-> v1-34 0 param0) (the-as (function cspace matrix none) cspace<-transformq+trans!)) + (set! (-> v1-34 0 param1) (the-as basic (-> obj root-override2 trans))) + (set! (-> v1-34 0 param2) (the-as basic (-> obj extra-trans))) + ) + (set-vector! (-> obj extra-trans) 0.0 1638.4 0.0 1.0) + ) + (((pickup-type gun-dark)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dark-up" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj root-override2 scale) 3.0 3.0 3.0 1.0) + (logclear! (-> obj flags) (collectable-flag fadeout)) + ) + (((pickup-type board)) + (process-entity-set! obj (the-as entity-actor #f)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-board" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((v1-48 (-> obj skel root-channel 0))) + (set! (-> v1-48 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + ) + (set-vector! (-> obj root-override2 scale) 2.0 2.0 2.0 1.0) + (let ((v1-52 (-> obj node-list data))) + (set! (-> v1-52 0 param0) (the-as (function cspace matrix none) cspace<-transformq+trans!)) + (set! (-> v1-52 0 param1) (the-as basic (-> obj root-override2 trans))) + (set! (-> v1-52 0 param2) (the-as basic (-> obj extra-trans))) + ) + (set-vector! (-> obj extra-trans) 0.0 2048.0 0.0 1.0) + (logclear! (-> obj flags) (collectable-flag fadeout)) + ) + (((pickup-type shield)) + (set! (-> obj ammo-effect) (-> *part-group-id-table* 80)) + ) + (((pickup-type trick-point)) + ) + ) + (none) + ) + +;; definition for function initialize-ammo-by-other +;; INFO: Used lq/sq +(defbehavior initialize-ammo-by-other ammo ((arg0 vector) (arg1 vector) (arg2 fact-info)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (initialize-options self 4500 1024.0 arg2) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +;; definition for method 29 of type ammo-collectable +;; INFO: Used lq/sq +(defmethod init-common ammo-collectable ((obj ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> obj pickup-amount) arg2) + (set! (-> obj pickup-type) arg1) + (initialize-allocations obj) + (set! (-> obj root-override2 trans quad) (-> arg0 extra trans quad)) + (initialize-effects obj (-> obj fact pickup-type)) + (initialize-options obj 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> obj root-override2)) + (go-to-initial-state obj) + (none) + ) + +;; definition for method 34 of type ammo-collectable +;; WARN: Return type mismatch int vs none. +(defmethod common-post ammo-collectable ((obj ammo-collectable)) + (with-pp + (quaternion-rotate-y! + (-> obj root-override2 quat) + (-> obj root-override2 quat) + (* 40049.777 (-> pp clock seconds-per-frame)) + ) + ((method-of-type collectable common-post) obj) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (ammo-collectable) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + (none) + ) + ) + +;; definition of type ammo +(deftype ammo (ammo-collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x198 + :flag-assert #x2401200198 + ) + +;; definition for method 3 of type ammo +(defmethod inspect ammo ((obj ammo)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type ammo-collectable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type shield +(deftype shield (ammo-collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x198 + :flag-assert #x2401200198 + ) + +;; definition for method 3 of type shield +(defmethod inspect shield ((obj shield)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type ammo-collectable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type upgrade-collectable +(deftype upgrade-collectable (ammo-collectable) + () + :heap-base #x120 + :method-count-assert 36 + :size-assert #x198 + :flag-assert #x2401200198 + ) + +;; definition for method 3 of type upgrade-collectable +(defmethod inspect upgrade-collectable ((obj upgrade-collectable)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type ammo-collectable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for function initialize-upgrade-by-other +;; INFO: Used lq/sq +(defbehavior initialize-upgrade-by-other upgrade-collectable ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) + (process-entity-set! self arg3) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root-override2 trans quad) (-> arg0 quad)) + (set! (-> self root-override2 transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 0 + ) + 1024.0 + (the-as fact-info #f) + ) + (set! (-> self collect-timeout) (the-as seconds 300)) + (update-transforms (-> self root-override2)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + (none) + ) + +;; definition for method 11 of type eco +(defmethod init-from-entity! eco ((obj eco) (arg0 entity-actor)) + (let ((v1-1 (res-lump-value (-> obj entity) 'eco-info uint128 :time -1000000000.0))) + (set! (-> obj type) (cond + ((= (the-as uint v1-1) 3) + eco-blue + ) + ((= (the-as uint v1-1) 2) + eco-red + ) + ((= (the-as uint v1-1) 1) + eco-yellow + ) + ((= (the-as uint v1-1) 5) + eco-green + ) + ((= (the-as uint v1-1) 18) + health + ) + ((= (the-as uint v1-1) 9) + money + ) + ((= (the-as uint v1-1) 19) + trick-point + ) + ((= (the-as uint v1-1) 21) + gem + ) + ((= (the-as uint v1-1) 22) + skill + ) + ((= (the-as uint v1-1) 10) + fuel-cell + ) + (else + eco-pill + ) + ) + ) + ) + (init-from-entity! obj arg0) + (none) + ) + +;; definition for function birth-pickup-at-point +;; INFO: Used lq/sq +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info)) + (local-vars (sv-32 vector) (sv-36 float) (sv-40 (pointer process)) (sv-48 int) (sv-56 fact-info) (sv-64 int)) + (set! sv-32 (new-stack-vector0)) + (set! sv-36 (res-lump-float + (if (and arg5 (nonzero? (-> arg5 process))) + (-> arg5 process entity) + ) + 'pickup-radius + :default (cond + ((= arg1 (pickup-type buzzer)) + 0.0 + ) + ((= arg2 1.0) + 409.6 + ) + (else + 8192.0 + ) + ) + ) + ) + (set! sv-40 (the-as (pointer process) #f)) + (set! sv-48 (the int arg2)) + (set! sv-56 (new 'static 'fact-info)) + (set! (-> sv-56 options) (actor-option)) + (if arg5 + (mem-copy! (&-> sv-56 type) (&-> arg5 type) 40) + ) + (set! (-> sv-56 pickup-type) arg1) + (set! (-> sv-56 pickup-spawn-amount) 1.0) + (while (> sv-48 0) + (set! sv-48 (+ sv-48 -1)) + (when arg3 + (set-vector! sv-32 0.0 57001.605 sv-36 1.0) + (vector-rotate-around-y! sv-32 sv-32 (/ (* 65536.0 (the float sv-48)) arg2)) + ) + (case arg1 + (((pickup-type eco-yellow)) + (set! sv-40 + (process-spawn eco-yellow :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type eco-red)) + (set! sv-40 + (process-spawn eco-red :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type eco-blue)) + (set! sv-40 + (process-spawn eco-blue :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type eco-green)) + (set! sv-40 + (process-spawn eco-green :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type health)) + (set! (-> sv-56 pickup-spawn-amount) arg2) + (set! sv-40 + (process-spawn health :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type eco-pill-green) (pickup-type eco-pill-dark)) + (set! sv-40 + (process-spawn eco-pill :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type ammo-yellow) + (pickup-type ammo-red) + (pickup-type ammo-blue) + (pickup-type ammo-dark) + (pickup-type shield) + ) + (let ((v1-56 arg1)) + (set! sv-64 (cond + ((= v1-56 (pickup-type ammo-red)) + 5 + ) + ((= v1-56 (pickup-type ammo-dark)) + 1 + ) + (else + 10 + ) + ) + ) + ) + (set! (-> sv-56 pickup-spawn-amount) (the float sv-64)) + (set! sv-40 (process-spawn + ammo-collectable + :init initialize-ammo-by-other + arg0 + sv-32 + sv-56 + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 (- sv-48 (+ sv-64 -1))) + ) + (((pickup-type gun-yellow) + (pickup-type gun-red) + (pickup-type gun-blue) + (pickup-type gun-dark) + (pickup-type board) + ) + (set! sv-40 (process-spawn + upgrade-collectable + :init initialize-upgrade-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type trick-point)) + (set! (-> sv-56 pickup-spawn-amount) arg2) + (set! sv-40 + (process-spawn trick-point :init initialize-ammo-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type money)) + (set! sv-40 (process-spawn money arg0 sv-32 sv-56 (-> self entity) :from *pickup-dead-pool* :to arg4)) + ) + (((pickup-type trick-point)) + (set! sv-40 (process-spawn money arg0 sv-32 sv-56 (-> self entity) :from *pickup-dead-pool* :to arg4)) + ) + (((pickup-type gem)) + (if (>= (-> *game-info* live-gem-count) 20) + (return (the-as (pointer process) #f)) + ) + (set! sv-40 (process-spawn + gem + :init money-init-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type skill)) + (when (>= arg2 (-> *FACT-bank* super-skill-inc)) + (set! (-> sv-56 pickup-spawn-amount) arg2) + (set! sv-48 0) + 0 + ) + (set! sv-40 (process-spawn + skill + :init money-init-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (else + (format 0 "ERROR: unknown type of eco ~d~%" arg1) + ) + ) + ) + sv-40 + ) + +;; definition for method 9 of type fact-info +;; INFO: Used lq/sq +(defmethod drop-pickup fact-info ((obj fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) + (let ((s2-0 (the-as int (-> obj pickup-type))) + (f30-0 (-> obj pickup-amount)) + ) + (when (= (the-as pickup-type s2-0) (pickup-type ammo-random)) + (let ((s2-1 (-> *game-info* features))) + 0.0 + (let* ((f0-2 (if (logtest? s2-1 (game-feature gun-yellow)) + (-> *FACT-bank* ammo-yellow-max) + 0.0 + ) + ) + (f1-1 (if (logtest? s2-1 (game-feature gun-red)) + (-> *FACT-bank* ammo-red-max) + 0.0 + ) + ) + (f2-1 (if (logtest? s2-1 (game-feature gun-blue)) + (-> *FACT-bank* ammo-blue-max) + 0.0 + ) + ) + (f3-1 (if (logtest? s2-1 (game-feature gun-dark)) + (-> *FACT-bank* ammo-dark-max) + 0.0 + ) + ) + (f4-1 (if (logtest? s2-1 (game-feature gun-yellow)) + (-> *FACT-bank* ammo-yellow-max) + 0.0 + ) + ) + (f5-1 (if (logtest? s2-1 (game-feature gun-red)) + (-> *FACT-bank* ammo-red-max) + 0.0 + ) + ) + (f6-1 (if (logtest? s2-1 (game-feature gun-blue)) + (-> *FACT-bank* ammo-blue-max) + 0.0 + ) + ) + (f7-1 (if (logtest? s2-1 (game-feature gun-dark)) + (-> *FACT-bank* ammo-dark-max) + 0.0 + ) + ) + (f8-1 (if (logtest? s2-1 (game-feature gun-yellow)) + (-> *game-info* gun-ammo 0) + 0.0 + ) + ) + (f9-1 (if (logtest? s2-1 (game-feature gun-red)) + (-> *game-info* gun-ammo 1) + 0.0 + ) + ) + (f10-1 (if (logtest? s2-1 (game-feature gun-blue)) + (-> *game-info* gun-ammo 2) + 0.0 + ) + ) + (f11-1 (if (logtest? s2-1 (game-feature gun-dark)) + (-> *game-info* gun-ammo 3) + 0.0 + ) + ) + (f0-3 (+ f0-2 (- f4-1 f8-1))) + (f1-2 (+ f1-1 (- f5-1 f9-1))) + (f2-2 (+ f2-1 (- f6-1 f10-1))) + (f3-2 (+ f3-1 (- f7-1 f11-1))) + (f4-8 (+ f0-3 f1-2 f2-2 f3-2)) + ) + (cond + ((!= f4-8 0.0) + (let* ((f26-0 (/ f0-3 f4-8)) + (f0-4 (/ f1-2 f4-8)) + (f1-3 (/ f2-2 f4-8)) + (f2-3 (/ f3-2 f4-8)) + (f22-0 (+ f0-4 f26-0)) + (f24-0 (+ f1-3 f22-0)) + (f28-0 (+ f2-3 f24-0)) + (f0-5 (rand-vu)) + ) + (cond + ((and (>= f26-0 f0-5) (logtest? s2-1 (game-feature gun-yellow))) + (set! s2-0 13) + ) + ((and (>= f22-0 f0-5) (logtest? s2-1 (game-feature gun-red))) + (set! s2-0 14) + (set! f30-0 (* 0.5 f30-0)) + ) + ((and (>= f24-0 f0-5) (logtest? s2-1 (game-feature gun-blue))) + (set! s2-0 15) + ) + ((and (>= f28-0 f0-5) (logtest? s2-1 (game-feature gun-dark))) + (set! s2-0 16) + (set! f30-0 (* 0.1 f30-0)) + ) + (else + (set! s2-0 7) + ) + ) + ) + ) + (else + (return (the-as (pointer process) #f)) + ) + ) + ) + ) + ) + (when (= s2-0 8) + f30-0 + (you-suck-stage *game-info* #f) + (set! s2-0 7) + (set! f30-0 (cond + ((< 20 (-> *game-info* live-eco-pill-count)) + (return (the-as (pointer process) #f)) + f30-0 + ) + ((< 10 (-> *game-info* live-eco-pill-count)) + 1.0 + ) + ((type? obj fact-info-enemy) + (+ (rand-vu-float-range 3.0 (+ 5.0 f30-0)) (the float arg3)) + ) + (else + (+ (rand-vu-float-range 2.0 (+ 3.0 f30-0)) (the float arg3)) + ) + ) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> obj process)) root trans quad)) + (set-vector! (-> s3-1 move-dist) 0.0 -81920.0 0.0 1.0) + (set! (-> s3-1 start-pos y) (+ 12288.0 (-> s3-1 start-pos y))) + (let ((v1-75 s3-1)) + (set! (-> v1-75 radius) 40.96) + (set! (-> v1-75 collide-with) (collide-spec backgnd)) + (set! (-> v1-75 ignore-process0) #f) + (set! (-> v1-75 ignore-process1) #f) + (set! (-> v1-75 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-75 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) + (set! (-> s3-1 start-pos quad) (-> s3-1 best-other-tri intersect quad)) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> obj process)) root trans quad)) + ) + (if (= s2-0 10) + (set! (-> s3-1 start-pos y) (+ 6144.0 (-> s3-1 start-pos y))) + ) + (birth-pickup-at-point (-> s3-1 start-pos) (the-as pickup-type s2-0) f30-0 arg0 arg1 obj) + ) + ) + ) + +;; definition of type ecovent +(deftype ecovent (process-hidden) + () + :method-count-assert 15 + :size-assert #x80 + :flag-assert #xf00000080 + ) + +;; definition for method 3 of type ecovent +(defmethod inspect ecovent ((obj ecovent)) + (when (not obj) + (set! obj obj) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) + (let ((s5-0 (-> obj 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 "attackable ") + ) + (if (= (logand (process-mask bit18) s5-0) (process-mask bit18)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand (process-mask no-track) s5-0) (process-mask no-track)) + (format #t "no-track ") + ) + (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 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) (shl #x8000 16)) + (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 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~%" (-> obj clock)) + (format #t "~1Tparent: #x~X~%" (-> obj parent)) + (format #t "~1Tbrother: #x~X~%" (-> obj brother)) + (format #t "~1Tchild: #x~X~%" (-> obj child)) + (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) + (format #t "~1Tself: ~A~%" (-> obj self)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tstatus: ~A~%" (-> obj status)) + (format #t "~1Tpid: ~D~%" (-> obj pid)) + (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tstate: ~A~%" (-> obj state)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) + (format #t "~1Theap: #~%" (&-> obj heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (label cfg-68) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc index 2e1cfed471..1fd3c2cf30 100644 --- a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc @@ -1895,10 +1895,10 @@ ) ) (let ((v1-5 gp-0)) - (set! (-> v1-5 width) (the float (the-as float #x1b8))) + (set! (-> v1-5 width) (the float 440)) ) (let ((v1-6 gp-0)) - (set! (-> v1-6 height) (the float (the-as float #x50))) + (set! (-> v1-6 height) (the float 80)) ) (set! (-> gp-0 flags) (font-flags shadow kerning)) (format (clear *temp-string*) "~S / ~S ~D~%" (-> self mode) (-> self state name) (-> self which)) @@ -1922,10 +1922,10 @@ (set! (-> v1-17 scale) 0.8) ) (let ((v1-18 gp-1)) - (set! (-> v1-18 width) (the float (the-as float #x1b0))) + (set! (-> v1-18 width) (the float 432)) ) (let ((v1-19 gp-1)) - (set! (-> v1-19 height) (the float (the-as float #x14))) + (set! (-> v1-19 height) (the float 20)) ) (set! (-> gp-1 flags) (font-flags shadow kerning middle left large)) (when (and (>= 1 (-> *game-info* auto-save-count)) (-> self next-state) (= (-> self next-state name) 'save)) @@ -1936,7 +1936,7 @@ (set! (-> v1-30 scale) 0.7) ) (let ((v1-31 gp-1)) - (set! (-> v1-31 height) (the float (the-as float #xc8))) + (set! (-> v1-31 height) (the float 200)) ) (let ((s5-2 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-dont-remove) #f) 1) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc index 3ff4e2c8d3..f2c42c75aa 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc @@ -1485,10 +1485,10 @@ (set! (-> v1-7 scale) 0.7) ) (let ((v1-8 gp-0)) - (set! (-> v1-8 width) (the float (the-as float #x12c))) + (set! (-> v1-8 width) (the float 300)) ) (let ((v1-9 gp-0)) - (set! (-> v1-9 height) (the float (the-as float #x23))) + (set! (-> v1-9 height) (the float 35)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle left large)) (let ((s4-0 (if (logtest? (-> obj flags) (fail-mission-flags famflags-2)) @@ -1506,14 +1506,14 @@ ) (when (= (-> obj message) (fail-mission-message fammsg-1)) (let ((v1-17 gp-0)) - (set! (-> v1-17 height) (the float (the-as float #x5f))) + (set! (-> v1-17 height) (the float 95)) ) (let ((s5-1 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id text-x18a) #f) 1) (s5-1 *temp-string* gp-0 #f 44 (bucket-id progress)) ) (let ((v1-19 gp-0)) - (set! (-> v1-19 height) (the float (the-as float #x9b))) + (set! (-> v1-19 height) (the float 155)) ) (let ((s5-2 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id text-x180) #f) 1) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc index 382a05d046..590b89adfa 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc @@ -229,10 +229,10 @@ ) ) (let ((v1-84 s5-1)) - (set! (-> v1-84 width) (the float (the-as float #x154))) + (set! (-> v1-84 width) (the float 340)) ) (let ((v1-85 s5-1)) - (set! (-> v1-85 height) (the float (the-as float #x50))) + (set! (-> v1-85 height) (the float 80)) ) (let ((v1-86 s5-1)) (set! (-> v1-86 scale) 0.9) diff --git a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc index 9a92cd5a90..8dede04d2e 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc @@ -969,10 +969,10 @@ ) ) (let ((v1-20 s2-0)) - (set! (-> v1-20 width) (the float (the-as float #x1d1))) + (set! (-> v1-20 width) (the float 465)) ) (let ((v1-21 s2-0)) - (set! (-> v1-21 height) (the float (the-as float #x46))) + (set! (-> v1-21 height) (the float 70)) ) (let ((v1-22 s2-0)) (set! (-> v1-22 scale) 0.5) @@ -1624,10 +1624,10 @@ ) ) (let ((v1-121 gp-6)) - (set! (-> v1-121 width) (the float (the-as float #x1b8))) + (set! (-> v1-121 width) (the float 440)) ) (let ((v1-122 gp-6)) - (set! (-> v1-122 height) (the float (the-as float #x30))) + (set! (-> v1-122 height) (the float 48)) ) (let ((v1-123 gp-6)) (set! (-> v1-123 scale) 0.5) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc index 3f84a17397..3464e9b3df 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc @@ -2904,10 +2904,10 @@ (set! (-> arg1 origin x) 120.0) (set! (-> arg1 origin y) 110.0) (let ((v1-8 arg1)) - (set! (-> v1-8 width) (the float (the-as float #x10e))) + (set! (-> v1-8 width) (the float 270)) ) (let ((v1-9 arg1)) - (set! (-> v1-9 height) (the float (the-as float #x23))) + (set! (-> v1-9 height) (the float 35)) ) (if (< f30-0 0.0) 0.0 @@ -2931,7 +2931,7 @@ ) (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) (let ((v1-25 arg1)) - (set! (-> v1-25 height) (the float (the-as float #xa0))) + (set! (-> v1-25 height) (the float 160)) ) (let ((a0-16 arg1)) (set! (-> a0-16 color) (font-color #7efbfb)) @@ -2962,10 +2962,10 @@ (set! (-> arg1 origin x) 75.0) (set! (-> arg1 origin y) 80.0) (let ((v1-8 arg1)) - (set! (-> v1-8 width) (the float (the-as float #x168))) + (set! (-> v1-8 width) (the float 360)) ) (let ((v1-9 arg1)) - (set! (-> v1-9 height) (the float (the-as float #x50))) + (set! (-> v1-9 height) (the float 80)) ) (let ((s4-0 410)) (case (-> arg0 current) @@ -2983,7 +2983,7 @@ ) (set! (-> arg1 origin y) (+ 80.0 (-> arg1 origin y))) (let ((v1-17 arg1)) - (set! (-> v1-17 height) (the float (the-as float #x32))) + (set! (-> v1-17 height) (the float 50)) ) (let ((s4-1 print-game-text)) (format @@ -2998,7 +2998,7 @@ ) (set! (-> arg1 origin y) (+ 55.0 (-> arg1 origin y))) (let ((v1-22 arg1)) - (set! (-> v1-22 height) (the float (the-as float #x5a))) + (set! (-> v1-22 height) (the float 90)) ) (cond ((and (!= (-> *progress-state* starting-state) 'insufficient-space) @@ -3054,10 +3054,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 130.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x3c))) + (set! (-> v1-7 height) (the float 60)) ) (let ((s5-0 409)) (progress-method-28 arg0 'select-save) @@ -3068,7 +3068,7 @@ ) (set! (-> arg1 origin y) (+ 140.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x1e))) + (set! (-> v1-13 height) (the float 30)) ) (let ((s5-1 arg1)) (set! (-> s5-1 color) (the-as font-color (progress-selected 0))) @@ -3101,10 +3101,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 130.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x5f))) + (set! (-> v1-7 height) (the float 95)) ) (let ((s5-0 print-game-text)) (format @@ -3116,7 +3116,7 @@ ) (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x3c))) + (set! (-> v1-10 height) (the float 60)) ) (let ((s5-1 arg1)) (set! (-> s5-1 color) (the-as font-color (progress-selected 0))) @@ -3149,10 +3149,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 100.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x2d))) + (set! (-> v1-7 height) (the float 45)) ) (let ((s5-0 425)) (case (-> arg0 current) @@ -3173,7 +3173,7 @@ ) (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) (let ((v1-16 arg1)) - (set! (-> v1-16 height) (the float (the-as float #x69))) + (set! (-> v1-16 height) (the float 105)) ) (let ((s5-1 print-game-text)) (format @@ -3185,7 +3185,7 @@ ) (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) (let ((v1-19 arg1)) - (set! (-> v1-19 height) (the float (the-as float #x2d))) + (set! (-> v1-19 height) (the float 45)) ) (let ((s5-2 arg1)) (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) @@ -3218,10 +3218,10 @@ (set! (-> arg1 origin x) 77.0) (set! (-> arg1 origin y) 85.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x19))) + (set! (-> v1-7 height) (the float 25)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-error-while-saving) #f) @@ -3232,7 +3232,7 @@ ) (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x3c))) + (set! (-> v1-10 height) (the float 60)) ) (let ((s5-1 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-check) #f) 1) @@ -3240,7 +3240,7 @@ ) (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x2d))) + (set! (-> v1-13 height) (the float 45)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-disabled) #f) @@ -3251,7 +3251,7 @@ ) (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) (let ((v1-16 arg1)) - (set! (-> v1-16 height) (the float (the-as float #x5f))) + (set! (-> v1-16 height) (the float 95)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-reenabling-info) #f) @@ -3262,7 +3262,7 @@ ) (set! (-> arg1 origin y) (+ 90.0 (-> arg1 origin y))) (let ((v1-19 arg1)) - (set! (-> v1-19 height) (the float (the-as float #x19))) + (set! (-> v1-19 height) (the float 25)) ) (let ((s5-4 arg1)) (set! (-> s5-4 color) (the-as font-color (progress-selected 0))) @@ -3295,10 +3295,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 80.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x46))) + (set! (-> v1-7 height) (the float 70)) ) (let ((s5-0 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-was-removed) #f) 1) @@ -3314,7 +3314,7 @@ ) (set! (-> arg1 origin y) (+ 65.0 (-> arg1 origin y))) (let ((v1-12 arg1)) - (set! (-> v1-12 height) (the float (the-as float #x5a))) + (set! (-> v1-12 height) (the float 90)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-reenabling-info) #f) @@ -3325,7 +3325,7 @@ ) (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) (let ((v1-15 arg1)) - (set! (-> v1-15 height) (the float (the-as float #x23))) + (set! (-> v1-15 height) (the float 35)) ) (let ((s5-3 arg1)) (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) @@ -3358,10 +3358,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 120.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x23))) + (set! (-> v1-7 height) (the float 35)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-removed-notice) #f) @@ -3372,7 +3372,7 @@ ) (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x55))) + (set! (-> v1-10 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-removed-prompt) #f) @@ -3384,7 +3384,7 @@ (when (is-cd-in?) (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) (let ((v1-14 arg1)) - (set! (-> v1-14 height) (the float (the-as float #x32))) + (set! (-> v1-14 height) (the float 50)) ) (let ((s5-2 arg1)) (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) @@ -3418,10 +3418,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 120.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x23))) + (set! (-> v1-7 height) (the float 35)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-read-error) #f) @@ -3432,7 +3432,7 @@ ) (set! (-> arg1 origin y) (+ 55.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x55))) + (set! (-> v1-10 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-read-error-prompt) #f) @@ -3443,7 +3443,7 @@ ) (set! (-> arg1 origin y) (+ 105.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x32))) + (set! (-> v1-13 height) (the float 50)) ) (let ((s5-2 arg1)) (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) @@ -3507,10 +3507,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 80.0) (let ((v1-27 arg1)) - (set! (-> v1-27 width) (the float (the-as float #x14a))) + (set! (-> v1-27 width) (the float 330)) ) (let ((v1-28 arg1)) - (set! (-> v1-28 height) (the float (the-as float #x55))) + (set! (-> v1-28 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-explanation) #f) @@ -3521,7 +3521,7 @@ ) (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) (let ((v1-31 arg1)) - (set! (-> v1-31 height) (the float (the-as float #x5f))) + (set! (-> v1-31 height) (the float 95)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-dont-remove) #f) @@ -3532,7 +3532,7 @@ ) (set! (-> arg1 origin y) (+ 90.0 (-> arg1 origin y))) (let ((v1-34 arg1)) - (set! (-> v1-34 height) (the float (the-as float #x32))) + (set! (-> v1-34 height) (the float 50)) ) (let ((s5-3 arg1)) (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) @@ -3565,10 +3565,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 80.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x55))) + (set! (-> v1-7 height) (the float 85)) ) (let ((s4-0 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-unformatted) #f) 1) @@ -3576,7 +3576,7 @@ ) (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x55))) + (set! (-> v1-10 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-formatting-required-notice) #f) @@ -3587,7 +3587,7 @@ ) (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x19))) + (set! (-> v1-13 height) (the float 25)) ) (draw-highlight (the int (-> arg1 origin y)) 44 (-> arg1 alpha)) (print-game-text @@ -3619,10 +3619,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 120.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x55))) + (set! (-> v1-7 height) (the float 85)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-overwrite-warning) #f) @@ -3633,7 +3633,7 @@ ) (set! (-> arg1 origin y) (+ 105.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x2d))) + (set! (-> v1-10 height) (the float 45)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-overwrite-confirm) #f) @@ -3665,10 +3665,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 110.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x5a))) + (set! (-> v1-7 height) (the float 90)) ) (let ((s4-0 print-game-text)) (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-no-jak2-found) #f) 1) @@ -3676,7 +3676,7 @@ ) (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x3c))) + (set! (-> v1-10 height) (the float 60)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-create-jak2-file?) #f) @@ -3708,10 +3708,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 85.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x2d))) + (set! (-> v1-7 height) (the float 45)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-60hz-change-notice) #f) @@ -3722,7 +3722,7 @@ ) (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x5f))) + (set! (-> v1-10 height) (the float 95)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-1) #f) @@ -3733,7 +3733,7 @@ ) (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x37))) + (set! (-> v1-13 height) (the float 55)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-2) #f) @@ -3744,7 +3744,7 @@ ) (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) (let ((v1-16 arg1)) - (set! (-> v1-16 height) (the float (the-as float #x1e))) + (set! (-> v1-16 height) (the float 30)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) @@ -3776,10 +3776,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 130.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x32))) + (set! (-> v1-7 height) (the float 50)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-60hz-change-complete) #f) @@ -3790,7 +3790,7 @@ ) (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x32))) + (set! (-> v1-10 height) (the float 50)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-mode-revert?) #f) @@ -3822,10 +3822,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 75.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x32))) + (set! (-> v1-7 height) (the float 50)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-change-notice) #f) @@ -3836,7 +3836,7 @@ ) (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x5a))) + (set! (-> v1-10 height) (the float 90)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-1) #f) @@ -3847,7 +3847,7 @@ ) (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) (let ((v1-13 arg1)) - (set! (-> v1-13 height) (the float (the-as float #x4b))) + (set! (-> v1-13 height) (the float 75)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-2) #f) @@ -3858,7 +3858,7 @@ ) (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) (let ((v1-16 arg1)) - (set! (-> v1-16 height) (the float (the-as float #x1e))) + (set! (-> v1-16 height) (the float 30)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) @@ -3890,10 +3890,10 @@ (set! (-> arg1 origin x) 80.0) (set! (-> arg1 origin y) 90.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x168))) + (set! (-> v1-6 width) (the float 360)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x50))) + (set! (-> v1-7 height) (the float 80)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-change-complete) #f) @@ -3904,7 +3904,7 @@ ) (set! (-> arg1 origin y) (+ 100.0 (-> arg1 origin y))) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #x4b))) + (set! (-> v1-10 height) (the float 75)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-mode-revert?) #f) @@ -3936,10 +3936,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 160.0) (let ((v1-6 arg1)) - (set! (-> v1-6 width) (the float (the-as float #x14a))) + (set! (-> v1-6 width) (the float 330)) ) (let ((v1-7 arg1)) - (set! (-> v1-7 height) (the float (the-as float #x46))) + (set! (-> v1-7 height) (the float 70)) ) (print-game-text (lookup-text! *common-text* (game-text-id progress-quit-game-confirm) #f) @@ -3991,10 +3991,10 @@ ) (set! (-> arg1 origin y) 100.0) (let ((v1-9 arg1)) - (set! (-> v1-9 width) (the float (the-as float #x159))) + (set! (-> v1-9 width) (the float 345)) ) (let ((v1-10 arg1)) - (set! (-> v1-10 height) (the float (the-as float #xd2))) + (set! (-> v1-10 height) (the float 210)) ) (let* ((v1-11 (-> arg0 current)) (a3-1 (cond @@ -4177,10 +4177,10 @@ (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 100.0) (let ((v1-14 arg1)) - (set! (-> v1-14 width) (the float (the-as float #x14f))) + (set! (-> v1-14 width) (the float 335)) ) (let ((v1-15 arg1)) - (set! (-> v1-15 height) (the float (the-as float #xd2))) + (set! (-> v1-15 height) (the float 210)) ) (let ((a1-9 arg1)) (set! (-> a1-9 color) (font-color #7efbfb)) @@ -5345,13 +5345,13 @@ (case (get-aspect-ratio) (('aspect4x3) (let ((v1-68 arg1)) - (set! (-> v1-68 height) (the float (the-as float #xb9))) + (set! (-> v1-68 height) (the float 185)) ) (set! (-> arg1 origin y) 133.0) ) (('aspect16x9) (let ((v1-72 arg1)) - (set! (-> v1-72 height) (the float (the-as float #xb9))) + (set! (-> v1-72 height) (the float 185)) ) (set! (-> arg1 origin y) 133.0) ) @@ -6499,7 +6499,7 @@ (set! (-> sv-140 origin y) (+ 46.0 (-> sv-140 origin y))) (set! (-> sv-140 origin x) 65.0) (let ((v1-46 sv-140)) - (set! (-> v1-46 width) (the float (the-as float #x16f))) + (set! (-> v1-46 width) (the float 367)) ) (let ((a0-23 sv-140)) (set! (-> a0-23 flags) (font-flags kerning large)) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc index 4897c285a3..029ca81f0b 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -1459,10 +1459,10 @@ (set! (-> sv-144 origin x) 79.0) (set! (-> sv-144 origin y) (the float sv-148)) (let ((v1-29 sv-144)) - (set! (-> v1-29 width) (the float (the-as float #x163))) + (set! (-> v1-29 width) (the float 355)) ) (let ((v1-30 sv-144)) - (set! (-> v1-30 height) (the float (the-as float #x1e))) + (set! (-> v1-30 height) (the float 30)) ) (set! (-> sv-144 flags) (if (= (-> *setting-control* user-default language) (language-enum japanese)) (font-flags middle left large) diff --git a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc index a9c623df86..1a33acc91c 100644 --- a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc @@ -634,10 +634,10 @@ ) ) (let ((v1-51 gp-0)) - (set! (-> v1-51 width) (the float (the-as float #x154))) + (set! (-> v1-51 width) (the float 340)) ) (let ((v1-52 gp-0)) - (set! (-> v1-52 height) (the float (the-as float #x50))) + (set! (-> v1-52 height) (the float 80)) ) (let ((v1-53 gp-0)) (set! (-> v1-53 scale) 0.9) diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc index b216185cb0..019a17b283 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc @@ -294,10 +294,10 @@ ) (set! (-> s5-1 flags) (font-flags shadow kerning left large)) (let ((v1-4 s5-1)) - (set! (-> v1-4 width) (the float (the-as float #x1b8))) + (set! (-> v1-4 width) (the float 440)) ) (let ((v1-5 s5-1)) - (set! (-> v1-5 height) (the float (the-as float #x50))) + (set! (-> v1-5 height) (the float 80)) ) (let ((v1-6 s5-1)) (set! (-> v1-6 scale) 0.7)